From 9fae01fa351805b2903e535736e06971bc0b925e Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 29 Nov 2010 00:47:11 +0100 Subject: Imported Upstream version 0.8.1 --- AUTHORS | 6 + CONTRIBUTING | 41 + COPYING | 351 + ChangeLog | 22187 +++++++++++++++++++ INSTALL | 365 + Makefile.am | 34 + Makefile.in | 863 + NEWS | 236 + NetworkManager.pc.in | 11 + README | 85 + TODO | 1 + aclocal.m4 | 1674 ++ callouts/77-nm-olpc-mesh.rules | 6 + callouts/Makefile.am | 94 + callouts/Makefile.in | 825 + callouts/nm-avahi-autoipd-action.c | 142 + callouts/nm-avahi-autoipd.conf | 13 + callouts/nm-dhcp-client-action.c | 320 + callouts/nm-dhcp-client.conf | 13 + callouts/nm-dispatcher-action.c | 798 + callouts/nm-dispatcher-action.h | 33 + callouts/nm-dispatcher.conf | 14 + callouts/nm-dispatcher.xml | 37 + callouts/org.freedesktop.nm_dispatcher.service.in | 5 + cli/Makefile.am | 2 + cli/Makefile.in | 620 + cli/src/Makefile.am | 38 + cli/src/Makefile.in | 703 + cli/src/connections.c | 1642 ++ cli/src/connections.h | 27 + cli/src/devices.c | 1294 ++ cli/src/devices.h | 27 + cli/src/network-manager.c | 278 + cli/src/network-manager.h | 27 + cli/src/nmcli.c | 363 + cli/src/nmcli.h | 114 + cli/src/settings.c | 1369 ++ cli/src/settings.h | 59 + cli/src/utils.c | 298 + cli/src/utils.h | 36 + compile | 143 + config.guess | 1501 ++ config.h.in | 220 + config.sub | 1705 ++ configure | 18359 +++++++++++++++ configure.ac | 544 + depcomp | 630 + docs/Makefile.am | 50 + docs/Makefile.in | 746 + docs/generate-settings-spec.c | 196 + docs/libnm-glib/Makefile.am | 85 + docs/libnm-glib/Makefile.in | 712 + docs/libnm-glib/html/NMCdmaDevice.html | 105 + docs/libnm-glib/html/NMDHCP4Config.html | 187 + docs/libnm-glib/html/NMDHCP6Config.html | 169 + docs/libnm-glib/html/NMGsmDevice.html | 105 + docs/libnm-glib/html/NMIP4Config.html | 370 + docs/libnm-glib/html/NMIP6Config.html | 290 + docs/libnm-glib/html/NMSerialDevice.html | 170 + docs/libnm-glib/html/ch01.html | 113 + docs/libnm-glib/html/home.png | Bin 0 -> 654 bytes docs/libnm-glib/html/index.html | 116 + docs/libnm-glib/html/index.sgml | 498 + docs/libnm-glib/html/left.png | Bin 0 -> 459 bytes .../html/libnm-glib-NMExportedConnection.html | 89 + .../html/libnm-glib-NMRemoteConnection.html | 104 + .../html/libnm-glib-NMRemoteSettingsSystem.html | 89 + .../html/libnm-glib-nm-access-point.html | 503 + .../html/libnm-glib-nm-active-connection.html | 445 + docs/libnm-glib/html/libnm-glib-nm-client.html | 724 + docs/libnm-glib/html/libnm-glib-nm-device-bt.html | 196 + .../html/libnm-glib-nm-device-ethernet.html | 243 + .../libnm-glib/html/libnm-glib-nm-device-wifi.html | 458 + docs/libnm-glib/html/libnm-glib-nm-device.html | 743 + docs/libnm-glib/html/libnm-glib-nm-object.html | 170 + .../html/libnm-glib-nm-remote-settings.html | 123 + ...ibnm-glib-nm-settings-connection-interface.html | 403 + .../html/libnm-glib-nm-settings-interface.html | 331 + .../html/libnm-glib-nm-settings-service.html | 158 + .../libnm-glib-nm-settings-system-interface.html | 322 + docs/libnm-glib/html/libnm-glib-nm-types.html | 231 + .../html/libnm-glib-nm-vpn-connection.html | 159 + .../libnm-glib-nm-vpn-plugin-ui-interface.html | 679 + docs/libnm-glib/html/libnm-glib-nm-vpn-plugin.html | 328 + docs/libnm-glib/html/libnm-glib.devhelp | 378 + docs/libnm-glib/html/libnm-glib.devhelp2 | 378 + docs/libnm-glib/html/right.png | Bin 0 -> 472 bytes docs/libnm-glib/html/style.css | 257 + docs/libnm-glib/html/up.png | Bin 0 -> 406 bytes docs/libnm-glib/libnm-glib-docs.sgml | 44 + docs/libnm-glib/libnm-glib-overrides.txt | 0 docs/libnm-glib/libnm-glib-sections.txt | 606 + docs/libnm-glib/libnm-glib.types | 25 + docs/libnm-glib/tmpl/libnm-glib-unused.sgml | 637 + docs/libnm-glib/tmpl/libnm_glib.sgml | 22 + docs/libnm-glib/tmpl/nm-access-point.sgml | 227 + docs/libnm-glib/tmpl/nm-active-connection.sgml | 194 + docs/libnm-glib/tmpl/nm-cdma-device.sgml | 38 + docs/libnm-glib/tmpl/nm-client.sgml | 284 + docs/libnm-glib/tmpl/nm-dbus-connection.sgml | 19 + docs/libnm-glib/tmpl/nm-dbus-settings-system.sgml | 19 + docs/libnm-glib/tmpl/nm-dbus-settings.sgml | 19 + docs/libnm-glib/tmpl/nm-device-bt-bindings.sgml | 26 + docs/libnm-glib/tmpl/nm-device-bt.sgml | 87 + docs/libnm-glib/tmpl/nm-device-ethernet.sgml | 101 + docs/libnm-glib/tmpl/nm-device-wifi.sgml | 178 + docs/libnm-glib/tmpl/nm-device.sgml | 320 + docs/libnm-glib/tmpl/nm-dhcp4-config.sgml | 69 + docs/libnm-glib/tmpl/nm-dhcp6-config-bindings.sgml | 26 + docs/libnm-glib/tmpl/nm-dhcp6-config.sgml | 64 + docs/libnm-glib/tmpl/nm-exported-connection.sgml | 38 + docs/libnm-glib/tmpl/nm-gsm-device.sgml | 38 + docs/libnm-glib/tmpl/nm-ip4-config.sgml | 164 + docs/libnm-glib/tmpl/nm-ip6-config-bindings.sgml | 26 + docs/libnm-glib/tmpl/nm-ip6-config.sgml | 122 + docs/libnm-glib/tmpl/nm-object.sgml | 70 + .../tmpl/nm-remote-connection-private.sgml | 35 + docs/libnm-glib/tmpl/nm-remote-connection.sgml | 40 + .../libnm-glib/tmpl/nm-remote-settings-system.sgml | 38 + docs/libnm-glib/tmpl/nm-remote-settings.sgml | 60 + docs/libnm-glib/tmpl/nm-serial-device.sgml | 55 + .../tmpl/nm-settings-connection-interface.sgml | 138 + docs/libnm-glib/tmpl/nm-settings-interface.sgml | 148 + docs/libnm-glib/tmpl/nm-settings-service.sgml | 70 + .../tmpl/nm-settings-system-interface.sgml | 131 + docs/libnm-glib/tmpl/nm-settings.sgml | 35 + docs/libnm-glib/tmpl/nm-types.sgml | 134 + docs/libnm-glib/tmpl/nm-vpn-connection.sgml | 71 + .../tmpl/nm-vpn-plugin-ui-interface.sgml | 265 + docs/libnm-glib/tmpl/nm-vpn-plugin.sgml | 154 + docs/libnm-util/Makefile.am | 64 + docs/libnm-util/Makefile.in | 691 + docs/libnm-util/html/NMConnection.html | 1011 + docs/libnm-util/html/NMSetting.html | 725 + docs/libnm-util/html/NMSetting8021x.html | 2835 +++ docs/libnm-util/html/NMSettingBluetooth.html | 292 + docs/libnm-util/html/NMSettingCdma.html | 322 + docs/libnm-util/html/NMSettingConnection.html | 514 + docs/libnm-util/html/NMSettingGsm.html | 759 + docs/libnm-util/html/NMSettingIP4Config.html | 1774 ++ docs/libnm-util/html/NMSettingIP6Config.html | 1636 ++ docs/libnm-util/html/NMSettingOlpcMesh.html | 316 + docs/libnm-util/html/NMSettingPPP.html | 968 + docs/libnm-util/html/NMSettingPPPOE.html | 317 + docs/libnm-util/html/NMSettingSerial.html | 405 + docs/libnm-util/html/NMSettingVPN.html | 579 + docs/libnm-util/html/NMSettingWired.html | 444 + docs/libnm-util/html/NMSettingWireless.html | 797 + .../libnm-util/html/NMSettingWirelessSecurity.html | 1151 + docs/libnm-util/html/api-index-full.html | 3197 +++ docs/libnm-util/html/ch01.html | 86 + docs/libnm-util/html/home.png | Bin 0 -> 654 bytes docs/libnm-util/html/index.html | 91 + docs/libnm-util/html/index.sgml | 925 + docs/libnm-util/html/left.png | Bin 0 -> 459 bytes docs/libnm-util/html/libnm-util-nm-utils.html | 1074 + docs/libnm-util/html/libnm-util.devhelp | 813 + docs/libnm-util/html/libnm-util.devhelp2 | 830 + docs/libnm-util/html/object-tree.html | 50 + docs/libnm-util/html/right.png | Bin 0 -> 472 bytes docs/libnm-util/html/style.css | 257 + docs/libnm-util/html/up.png | Bin 0 -> 406 bytes docs/libnm-util/libnm-util-docs.sgml | 49 + docs/libnm-util/libnm-util-overrides.txt | 0 docs/libnm-util/libnm-util-sections.txt | 877 + docs/libnm-util/libnm-util.types | 34 + docs/libnm-util/tmpl/libnm-util-unused.sgml | 695 + docs/libnm-util/tmpl/nm-connection.sgml | 335 + docs/libnm-util/tmpl/nm-setting-8021x.sgml | 966 + docs/libnm-util/tmpl/nm-setting-bluetooth.sgml | 153 + docs/libnm-util/tmpl/nm-setting-bridge.sgml | 160 + docs/libnm-util/tmpl/nm-setting-cdma.sgml | 160 + docs/libnm-util/tmpl/nm-setting-connection.sgml | 223 + docs/libnm-util/tmpl/nm-setting-gsm.sgml | 394 + docs/libnm-util/tmpl/nm-setting-ip4-config.sgml | 758 + docs/libnm-util/tmpl/nm-setting-ip6-config.sgml | 695 + docs/libnm-util/tmpl/nm-setting-olpc-mesh.sgml | 159 + docs/libnm-util/tmpl/nm-setting-ppp.sgml | 475 + docs/libnm-util/tmpl/nm-setting-pppoe.sgml | 160 + docs/libnm-util/tmpl/nm-setting-serial.sgml | 202 + docs/libnm-util/tmpl/nm-setting-vpn.sgml | 250 + docs/libnm-util/tmpl/nm-setting-wimax.sgml | 136 + docs/libnm-util/tmpl/nm-setting-wired.sgml | 222 + .../tmpl/nm-setting-wireless-security.sgml | 499 + docs/libnm-util/tmpl/nm-setting-wireless.sgml | 363 + docs/libnm-util/tmpl/nm-setting.sgml | 252 + docs/libnm-util/tmpl/nm-utils.sgml | 362 + docs/settings-spec.html | 963 + docs/spec.html | 1138 + examples/Makefile.am | 1 + examples/Makefile.in | 620 + examples/python/Makefile.am | 8 + examples/python/Makefile.in | 424 + examples/python/add-system-connection.py | 48 + examples/python/list-connections.py | 112 + examples/python/nm-state.py | 69 + examples/python/show-bssids.py | 78 + examples/python/vpn.py | 152 + gtk-doc.make | 224 + include/Makefile.am | 14 + include/Makefile.in | 529 + include/NetworkManager.h | 391 + include/NetworkManagerVPN.h | 173 + include/nm-dbus-glib-types.h | 43 + include/nm-glib-compat.h | 37 + include/nm-test-helpers.h | 48 + include/wireless-helper.h | 32 + initscript/Arch/Makefile.am | 5 + initscript/Arch/Makefile.in | 487 + initscript/Arch/networkmanager | 66 + initscript/Arch/networkmanager.in | 66 + initscript/Debian/Makefile.am | 5 + initscript/Debian/Makefile.in | 487 + initscript/Debian/NetworkManager.in | 91 + initscript/Gentoo/Makefile.am | 5 + initscript/Gentoo/Makefile.in | 487 + initscript/Gentoo/NetworkManager | 23 + initscript/Gentoo/NetworkManager.in | 23 + initscript/Makefile.am | 25 + initscript/Makefile.in | 630 + initscript/Mandriva/Makefile.am | 6 + initscript/Mandriva/Makefile.in | 487 + initscript/Mandriva/networkmanager | 106 + initscript/Mandriva/networkmanager.in | 106 + initscript/RedHat/Makefile.am | 6 + initscript/RedHat/Makefile.in | 487 + initscript/RedHat/NetworkManager | 104 + initscript/RedHat/NetworkManager.in | 104 + initscript/SUSE/Makefile.am | 8 + initscript/SUSE/Makefile.in | 429 + initscript/SUSE/networkmanager.in | 51 + initscript/Slackware/Makefile.am | 6 + initscript/Slackware/Makefile.in | 487 + initscript/Slackware/rc.networkmanager | 96 + initscript/Slackware/rc.networkmanager.in | 96 + initscript/paldo/Makefile.am | 6 + initscript/paldo/Makefile.in | 487 + initscript/paldo/NetworkManager | 56 + initscript/paldo/NetworkManager.in | 56 + install-sh | 520 + intltool-extract.in | 0 intltool-merge.in | 0 intltool-update.in | 0 introspection/Makefile.am | 28 + introspection/Makefile.in | 445 + introspection/all.xml | 60 + introspection/errors.xml | 36 + introspection/generic-types.xml | 35 + introspection/nm-access-point.xml | 92 + introspection/nm-active-connection.xml | 57 + introspection/nm-device-bt.xml | 48 + introspection/nm-device-cdma.xml | 15 + introspection/nm-device-ethernet.xml | 33 + introspection/nm-device-gsm.xml | 15 + introspection/nm-device-olpc-mesh.xml | 34 + introspection/nm-device-serial.xml | 20 + introspection/nm-device-wifi.xml | 104 + introspection/nm-device.xml | 408 + introspection/nm-dhcp4-config.xml | 20 + introspection/nm-dhcp6-config.xml | 20 + introspection/nm-exported-connection.xml | 99 + introspection/nm-ip4-config.xml | 29 + introspection/nm-ip6-config.xml | 19 + introspection/nm-manager-client.xml | 71 + introspection/nm-manager.xml | 295 + introspection/nm-ppp-manager.xml | 22 + introspection/nm-settings-system.xml | 81 + introspection/nm-settings.xml | 47 + introspection/nm-vpn-connection.xml | 168 + introspection/nm-vpn-plugin.xml | 151 + introspection/vpn-errors.xml | 32 + libnm-glib/Makefile.am | 212 + libnm-glib/Makefile.in | 1183 + libnm-glib/libnm-glib-test.c | 419 + libnm-glib/libnm-glib-vpn.pc.in | 13 + libnm-glib/libnm-glib-vpn.ver | 26 + libnm-glib/libnm-glib.pc.in | 13 + libnm-glib/libnm-glib.ver | 161 + libnm-glib/libnm_glib.c | 600 + libnm-glib/libnm_glib.h | 60 + libnm-glib/nm-access-point.c | 597 + libnm-glib/nm-access-point.h | 83 + libnm-glib/nm-active-connection.c | 570 + libnm-glib/nm-active-connection.h | 81 + libnm-glib/nm-cdma-device.c | 130 + libnm-glib/nm-cdma-device.h | 60 + libnm-glib/nm-client.c | 1160 + libnm-glib/nm-client.h | 110 + libnm-glib/nm-dbus-utils.c | 215 + libnm-glib/nm-dbus-utils.h | 57 + libnm-glib/nm-device-bt.c | 307 + libnm-glib/nm-device-bt.h | 71 + libnm-glib/nm-device-ethernet.c | 315 + libnm-glib/nm-device-ethernet.h | 68 + libnm-glib/nm-device-private.h | 36 + libnm-glib/nm-device-wifi.c | 759 + libnm-glib/nm-device-wifi.h | 82 + libnm-glib/nm-device.c | 1246 ++ libnm-glib/nm-device.h | 107 + libnm-glib/nm-dhcp4-config.c | 248 + libnm-glib/nm-dhcp4-config.h | 68 + libnm-glib/nm-dhcp6-config.c | 248 + libnm-glib/nm-dhcp6-config.h | 68 + libnm-glib/nm-exported-connection.c | 281 + libnm-glib/nm-exported-connection.h | 75 + libnm-glib/nm-gsm-device.c | 130 + libnm-glib/nm-gsm-device.h | 61 + libnm-glib/nm-ip4-config.c | 526 + libnm-glib/nm-ip4-config.h | 77 + libnm-glib/nm-ip6-config.c | 438 + libnm-glib/nm-ip6-config.h | 73 + libnm-glib/nm-object-cache.c | 72 + libnm-glib/nm-object-cache.h | 39 + libnm-glib/nm-object-private.h | 101 + libnm-glib/nm-object.c | 675 + libnm-glib/nm-object.h | 66 + libnm-glib/nm-remote-connection-private.h | 35 + libnm-glib/nm-remote-connection.c | 439 + libnm-glib/nm-remote-connection.h | 65 + libnm-glib/nm-remote-settings-system.c | 375 + libnm-glib/nm-remote-settings-system.h | 64 + libnm-glib/nm-remote-settings.c | 540 + libnm-glib/nm-remote-settings.h | 67 + libnm-glib/nm-serial-device.c | 207 + libnm-glib/nm-serial-device.h | 63 + libnm-glib/nm-settings-connection-interface.c | 192 + libnm-glib/nm-settings-connection-interface.h | 116 + libnm-glib/nm-settings-interface.c | 206 + libnm-glib/nm-settings-interface.h | 109 + libnm-glib/nm-settings-service.c | 372 + libnm-glib/nm-settings-service.h | 82 + libnm-glib/nm-settings-system-interface.c | 150 + libnm-glib/nm-settings-system-interface.h | 108 + libnm-glib/nm-types-private.h | 39 + libnm-glib/nm-types.c | 423 + libnm-glib/nm-types.h | 54 + libnm-glib/nm-vpn-connection.c | 257 + libnm-glib/nm-vpn-connection.h | 75 + libnm-glib/nm-vpn-plugin-ui-interface.c | 245 + libnm-glib/nm-vpn-plugin-ui-interface.h | 204 + libnm-glib/nm-vpn-plugin.c | 807 + libnm-glib/nm-vpn-plugin.h | 127 + libnm-util/COPYING | 488 + libnm-util/Makefile.am | 113 + libnm-util/Makefile.in | 1121 + libnm-util/crypto.c | 636 + libnm-util/crypto.h | 131 + libnm-util/crypto_gnutls.c | 448 + libnm-util/crypto_nss.c | 562 + libnm-util/libnm-util.pc.in | 13 + libnm-util/libnm-util.ver | 394 + libnm-util/nm-connection.c | 1210 + libnm-util/nm-connection.h | 167 + libnm-util/nm-param-spec-specialized.c | 973 + libnm-util/nm-param-spec-specialized.h | 46 + libnm-util/nm-setting-8021x.c | 3440 +++ libnm-util/nm-setting-8021x.h | 280 + libnm-util/nm-setting-bluetooth.c | 282 + libnm-util/nm-setting-bluetooth.h | 85 + libnm-util/nm-setting-cdma.c | 363 + libnm-util/nm-setting-cdma.h | 83 + libnm-util/nm-setting-connection.c | 521 + libnm-util/nm-setting-connection.h | 110 + libnm-util/nm-setting-gsm.c | 656 + libnm-util/nm-setting-gsm.h | 135 + libnm-util/nm-setting-ip4-config.c | 1287 ++ libnm-util/nm-setting-ip4-config.h | 177 + libnm-util/nm-setting-ip6-config.c | 1120 + libnm-util/nm-setting-ip6-config.h | 170 + libnm-util/nm-setting-olpc-mesh.c | 296 + libnm-util/nm-setting-olpc-mesh.h | 84 + libnm-util/nm-setting-ppp.c | 730 + libnm-util/nm-setting-ppp.h | 113 + libnm-util/nm-setting-pppoe.c | 274 + libnm-util/nm-setting-pppoe.h | 83 + libnm-util/nm-setting-serial.c | 314 + libnm-util/nm-setting-serial.h | 87 + libnm-util/nm-setting-vpn.c | 464 + libnm-util/nm-setting-vpn.h | 106 + libnm-util/nm-setting-wired.c | 384 + libnm-util/nm-setting-wired.h | 88 + libnm-util/nm-setting-wireless-security.c | 1208 + libnm-util/nm-setting-wireless-security.h | 133 + libnm-util/nm-setting-wireless.c | 909 + libnm-util/nm-setting-wireless.h | 115 + libnm-util/nm-setting.c | 752 + libnm-util/nm-setting.h | 179 + libnm-util/nm-utils-private.h | 37 + libnm-util/nm-utils.c | 2104 ++ libnm-util/nm-utils.h | 218 + libnm-util/tests/Makefile.am | 139 + libnm-util/tests/Makefile.in | 935 + libnm-util/tests/certs/Makefile.am | 20 + libnm-util/tests/certs/Makefile.in | 437 + libnm-util/tests/certs/ca-no-ending-newline.pem | 15 + libnm-util/tests/certs/test-cert.p12 | Bin 0 -> 4092 bytes libnm-util/tests/certs/test-key-only-decrypted.der | Bin 0 -> 1192 bytes libnm-util/tests/certs/test-key-only.pem | 92 + libnm-util/tests/certs/test2-cert.p12 | Bin 0 -> 4136 bytes libnm-util/tests/certs/test2_ca_cert.pem | 27 + libnm-util/tests/certs/test2_key_and_cert.pem | 119 + libnm-util/tests/certs/test_ca_cert.pem | 27 + libnm-util/tests/certs/test_key_and_cert.pem | 119 + libnm-util/tests/test-crypto.c | 317 + libnm-util/tests/test-general.c | 246 + libnm-util/tests/test-need-secrets.c | 566 + libnm-util/tests/test-setting-8021x.c | 163 + libnm-util/tests/test-settings-defaults.c | 135 + ltmain.sh | 8406 +++++++ m4/compiler_warnings.m4 | 31 + m4/gtk-doc.m4 | 61 + m4/intltool.m4 | 216 + m4/libnl-check.m4 | 65 + m4/libtool.m4 | 7360 ++++++ m4/ltoptions.m4 | 368 + m4/ltsugar.m4 | 123 + m4/ltversion.m4 | 23 + m4/lt~obsolete.m4 | 92 + man/Makefile.am | 17 + man/Makefile.in | 611 + man/NetworkManager.8 | 108 + man/NetworkManager.8.in | 108 + man/NetworkManager.conf.5 | 139 + man/NetworkManager.conf.5.in | 139 + man/nm-system-settings.conf.5 | 26 + man/nm-system-settings.conf.5.in | 26 + man/nm-tool.1 | 17 + man/nm-tool.1.in | 17 + man/nmcli.1 | 321 + man/nmcli.1.in | 321 + marshallers/Makefile.am | 27 + marshallers/Makefile.in | 570 + marshallers/nm-marshal-main.c | 2 + marshallers/nm-marshal.list | 29 + missing | 376 + po/ChangeLog | 2146 ++ po/LINGUAS | 66 + po/Makefile.in.in | 217 + po/POTFILES.in | 23 + po/POTFILES.skip | 5 + po/ar.po | 379 + po/as.po | 1809 ++ po/be@latin.po | 68 + po/bg.po | 962 + po/bn_IN.po | 1648 ++ po/bs.po | 193 + po/ca.po | 1209 + po/cs.po | 1386 ++ po/da.po | 717 + po/de.po | 1678 ++ po/dz.po | 218 + po/el.po | 385 + po/en_CA.po | 865 + po/en_GB.po | 1077 + po/es.po | 1723 ++ po/et.po | 289 + po/eu.po | 1351 ++ po/fi.po | 328 + po/fr.po | 1670 ++ po/gl.po | 488 + po/gu.po | 1639 ++ po/he.po | 50 + po/hi.po | 1642 ++ po/hr.po | 220 + po/hu.po | 493 + po/id.po | 963 + po/it.po | 1667 ++ po/ja.po | 1641 ++ po/ka.po | 1089 + po/kn.po | 1811 ++ po/ko.po | 1641 ++ po/ku.po | 904 + po/lt.po | 1861 ++ po/lv.po | 969 + po/mk.po | 57 + po/ml.po | 1637 ++ po/mr.po | 1638 ++ po/nb.po | 275 + po/ne.po | 229 + po/nl.po | 293 + po/oc.po | 241 + po/or.po | 1641 ++ po/pa.po | 1900 ++ po/pl.po | 1616 ++ po/pt.po | 218 + po/pt_BR.po | 1368 ++ po/ru.po | 1651 ++ po/rw.po | 398 + po/sk.po | 972 + po/sl.po | 992 + po/sq.po | 184 + po/sr.po | 437 + po/sr@latin.po | 437 + po/sv.po | 1602 ++ po/ta.po | 1806 ++ po/te.po | 1642 ++ po/th.po | 943 + po/uk.po | 222 + po/vi.po | 253 + po/wa.po | 193 + po/zh_CN.po | 1636 ++ po/zh_HK.po | 1004 + po/zh_TW.po | 1642 ++ policy/Makefile.am | 26 + policy/Makefile.in | 491 + ...edesktop.network-manager-settings.system.policy | 295 + ...sktop.network-manager-settings.system.policy.in | 48 + src/Makefile.am | 278 + src/Makefile.in | 1722 ++ src/NetworkManager.conf | 82 + src/NetworkManagerUtils.c | 625 + src/NetworkManagerUtils.h | 80 + src/backends/Makefile.am | 70 + src/backends/Makefile.in | 689 + src/backends/NetworkManagerArch.c | 70 + src/backends/NetworkManagerDebian.c | 64 + src/backends/NetworkManagerFrugalware.c | 58 + src/backends/NetworkManagerGeneric.c | 113 + src/backends/NetworkManagerGeneric.h | 30 + src/backends/NetworkManagerGentoo.c | 66 + src/backends/NetworkManagerMandriva.c | 61 + src/backends/NetworkManagerPaldo.c | 61 + src/backends/NetworkManagerPardus.c | 57 + src/backends/NetworkManagerRedHat.c | 59 + src/backends/NetworkManagerSlackware.c | 57 + src/backends/NetworkManagerSuSE.c | 62 + src/bluez-manager/Makefile.am | 38 + src/bluez-manager/Makefile.in | 601 + src/bluez-manager/nm-bluez-adapter.c | 367 + src/bluez-manager/nm-bluez-adapter.h | 67 + src/bluez-manager/nm-bluez-common.h | 34 + src/bluez-manager/nm-bluez-device.c | 452 + src/bluez-manager/nm-bluez-device.h | 75 + src/bluez-manager/nm-bluez-manager.c | 369 + src/bluez-manager/nm-bluez-manager.h | 63 + src/dhcp-manager/Makefile.am | 39 + src/dhcp-manager/Makefile.in | 610 + src/dhcp-manager/nm-dhcp-client.c | 1243 ++ src/dhcp-manager/nm-dhcp-client.h | 142 + src/dhcp-manager/nm-dhcp-dhclient.c | 786 + src/dhcp-manager/nm-dhcp-dhclient.h | 49 + src/dhcp-manager/nm-dhcp-dhcpcd.c | 294 + src/dhcp-manager/nm-dhcp-dhcpcd.h | 49 + src/dhcp-manager/nm-dhcp-manager.c | 647 + src/dhcp-manager/nm-dhcp-manager.h | 98 + src/dnsmasq-manager/Makefile.am | 19 + src/dnsmasq-manager/Makefile.in | 564 + src/dnsmasq-manager/nm-dnsmasq-manager.c | 495 + src/dnsmasq-manager/nm-dnsmasq-manager.h | 69 + src/gdb-cmd | 3 + src/ip6-manager/Makefile.am | 26 + src/ip6-manager/Makefile.in | 570 + src/ip6-manager/nm-ip6-manager.c | 1123 + src/ip6-manager/nm-ip6-manager.h | 86 + src/logging/Makefile.am | 15 + src/logging/Makefile.in | 556 + src/logging/nm-logging.c | 377 + src/logging/nm-logging.h | 111 + src/main.c | 758 + src/modem-manager/Makefile.am | 35 + src/modem-manager/Makefile.in | 611 + src/modem-manager/nm-modem-cdma.c | 351 + src/modem-manager/nm-modem-cdma.h | 56 + src/modem-manager/nm-modem-gsm.c | 554 + src/modem-manager/nm-modem-gsm.h | 56 + src/modem-manager/nm-modem-manager.c | 443 + src/modem-manager/nm-modem-manager.h | 53 + src/modem-manager/nm-modem-types.h | 111 + src/modem-manager/nm-modem.c | 1147 + src/modem-manager/nm-modem.h | 157 + src/named-manager/Makefile.am | 21 + src/named-manager/Makefile.in | 564 + src/named-manager/nm-named-manager.c | 821 + src/named-manager/nm-named-manager.h | 92 + src/nm-activation-request.c | 700 + src/nm-activation-request.h | 103 + src/nm-active-connection.c | 63 + src/nm-active-connection.h | 42 + src/nm-call-store.c | 209 + src/nm-call-store.h | 47 + src/nm-crash-logger.c | 86 + src/nm-dbus-manager.c | 378 + src/nm-dbus-manager.h | 78 + src/nm-device-bt.c | 1073 + src/nm-device-bt.h | 72 + src/nm-device-cdma.c | 75 + src/nm-device-cdma.h | 55 + src/nm-device-ethernet.c | 1975 ++ src/nm-device-ethernet.h | 67 + src/nm-device-gsm.c | 75 + src/nm-device-gsm.h | 55 + src/nm-device-interface.c | 402 + src/nm-device-interface.h | 148 + src/nm-device-modem.c | 471 + src/nm-device-modem.h | 56 + src/nm-device-olpc-mesh.c | 974 + src/nm-device-olpc-mesh.h | 81 + src/nm-device-private.h | 45 + src/nm-device-wifi.c | 3936 ++++ src/nm-device-wifi.h | 107 + src/nm-device.c | 3827 ++++ src/nm-device.h | 188 + src/nm-dhcp4-config.c | 192 + src/nm-dhcp4-config.h | 61 + src/nm-dhcp6-config.c | 192 + src/nm-dhcp6-config.h | 61 + src/nm-hostname-provider.c | 54 + src/nm-hostname-provider.h | 44 + src/nm-ip4-config.c | 909 + src/nm-ip4-config.h | 142 + src/nm-ip6-config.c | 745 + src/nm-ip6-config.h | 120 + src/nm-manager.c | 3463 +++ src/nm-manager.h | 121 + src/nm-netlink-monitor.c | 866 + src/nm-netlink-monitor.h | 99 + src/nm-policy-hostname.c | 205 + src/nm-policy-hostname.h | 47 + src/nm-policy-hosts.c | 235 + src/nm-policy-hosts.h | 40 + src/nm-policy.c | 1138 + src/nm-policy.h | 36 + src/nm-properties-changed-signal.c | 201 + src/nm-properties-changed-signal.h | 32 + src/nm-rfkill.h | 45 + src/nm-secrets-provider-interface.c | 224 + src/nm-secrets-provider-interface.h | 90 + src/nm-system.c | 1347 ++ src/nm-system.h | 84 + src/nm-udev-manager.c | 578 + src/nm-udev-manager.h | 72 + src/nm-wifi-ap.c | 1477 ++ src/nm-wifi-ap.h | 129 + src/ppp-manager/Makefile.am | 58 + src/ppp-manager/Makefile.in | 679 + src/ppp-manager/nm-ppp-manager.c | 1058 + src/ppp-manager/nm-ppp-manager.h | 80 + src/ppp-manager/nm-ppp-status.h | 43 + src/ppp-manager/nm-pppd-plugin.c | 359 + src/ppp-manager/nm-pppd-plugin.h | 29 + src/supplicant-manager/Makefile.am | 35 + src/supplicant-manager/Makefile.in | 760 + src/supplicant-manager/nm-supplicant-config.c | 1014 + src/supplicant-manager/nm-supplicant-config.h | 84 + src/supplicant-manager/nm-supplicant-interface.c | 1429 ++ src/supplicant-manager/nm-supplicant-interface.h | 145 + src/supplicant-manager/nm-supplicant-manager.c | 343 + src/supplicant-manager/nm-supplicant-manager.h | 88 + .../nm-supplicant-settings-verify.c | 238 + .../nm-supplicant-settings-verify.h | 37 + src/supplicant-manager/nm-supplicant-types.h | 28 + src/supplicant-manager/tests/Makefile.am | 27 + src/supplicant-manager/tests/Makefile.in | 579 + .../tests/test-supplicant-config.c | 518 + src/system-settings/Makefile.am | 61 + src/system-settings/Makefile.in | 661 + src/system-settings/nm-default-wired-connection.c | 308 + src/system-settings/nm-default-wired-connection.h | 59 + src/system-settings/nm-inotify-helper.c | 212 + src/system-settings/nm-inotify-helper.h | 54 + src/system-settings/nm-polkit-helpers.h | 32 + src/system-settings/nm-sysconfig-connection.c | 658 + src/system-settings/nm-sysconfig-connection.h | 56 + src/system-settings/nm-sysconfig-settings.c | 1520 ++ src/system-settings/nm-sysconfig-settings.h | 71 + src/system-settings/nm-system-config-error.c | 59 + src/system-settings/nm-system-config-error.h | 45 + src/system-settings/nm-system-config-interface.c | 163 + src/system-settings/nm-system-config-interface.h | 145 + src/tests/Makefile.am | 49 + src/tests/Makefile.in | 628 + src/tests/test-dhcp-options.c | 715 + src/tests/test-policy-hosts.c | 394 + src/vpn-manager/Makefile.am | 46 + src/vpn-manager/Makefile.in | 611 + src/vpn-manager/nm-vpn-connection.c | 1192 + src/vpn-manager/nm-vpn-connection.h | 78 + src/vpn-manager/nm-vpn-manager.c | 369 + src/vpn-manager/nm-vpn-manager.h | 86 + src/vpn-manager/nm-vpn-service.c | 478 + src/vpn-manager/nm-vpn-service.h | 60 + src/wpa.c | 455 + src/wpa.h | 38 + system-settings/Makefile.am | 2 + system-settings/Makefile.in | 620 + system-settings/plugins/Makefile.am | 17 + system-settings/plugins/Makefile.in | 625 + system-settings/plugins/ifcfg-rh/Makefile.am | 76 + system-settings/plugins/ifcfg-rh/Makefile.in | 924 + system-settings/plugins/ifcfg-rh/common.h | 49 + system-settings/plugins/ifcfg-rh/errors.c | 35 + .../plugins/ifcfg-rh/nm-ifcfg-connection.c | 353 + .../plugins/ifcfg-rh/nm-ifcfg-connection.h | 64 + system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf | 18 + system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml | 31 + system-settings/plugins/ifcfg-rh/plugin.c | 793 + system-settings/plugins/ifcfg-rh/plugin.h | 50 + system-settings/plugins/ifcfg-rh/reader.c | 3261 +++ system-settings/plugins/ifcfg-rh/reader.h | 42 + system-settings/plugins/ifcfg-rh/shvar.c | 396 + system-settings/plugins/ifcfg-rh/shvar.h | 110 + system-settings/plugins/ifcfg-rh/tests/Makefile.am | 50 + system-settings/plugins/ifcfg-rh/tests/Makefile.in | 774 + .../plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns1 | 21 + .../plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns2 | 21 + .../ifcfg-rh/tests/iscsiadm-test-bad-gateway | 21 + .../ifcfg-rh/tests/iscsiadm-test-bad-ipaddr | 21 + .../plugins/ifcfg-rh/tests/iscsiadm-test-dhcp | 33 + .../plugins/ifcfg-rh/tests/iscsiadm-test-static | 35 + .../ifcfg-rh/tests/network-scripts/Makefile.am | 76 + .../ifcfg-rh/tests/network-scripts/Makefile.in | 495 + .../tests/network-scripts/ifcfg-test-ibft-dhcp | 4 + .../tests/network-scripts/ifcfg-test-ibft-static | 4 + .../tests/network-scripts/ifcfg-test-minimal | 4 + .../tests/network-scripts/ifcfg-test-nm-controlled | 9 + .../tests/network-scripts/ifcfg-test-onboot-no | 5 + .../ifcfg-test-static-routes-legacy | 12 + .../tests/network-scripts/ifcfg-test-wifi-leap | 17 + .../tests/network-scripts/ifcfg-test-wifi-open | 13 + .../network-scripts/ifcfg-test-wifi-open-auto | 13 + .../ifcfg-test-wifi-open-ssid-bad-hex | 13 + .../network-scripts/ifcfg-test-wifi-open-ssid-hex | 13 + .../ifcfg-test-wifi-open-ssid-long-hex | 13 + .../ifcfg-test-wifi-open-ssid-long-quoted | 13 + .../ifcfg-test-wifi-open-ssid-quoted | 13 + .../tests/network-scripts/ifcfg-test-wifi-wep | 14 + .../network-scripts/ifcfg-test-wifi-wep-104-ascii | 14 + .../network-scripts/ifcfg-test-wifi-wep-40-ascii | 14 + .../network-scripts/ifcfg-test-wifi-wep-adhoc | 15 + .../ifcfg-test-wifi-wep-eap-ttls-chap | 20 + .../network-scripts/ifcfg-test-wifi-wep-passphrase | 14 + .../network-scripts/ifcfg-test-wifi-wpa-eap-tls | 25 + .../ifcfg-test-wifi-wpa-eap-ttls-tls | 28 + .../tests/network-scripts/ifcfg-test-wifi-wpa-psk | 19 + .../network-scripts/ifcfg-test-wifi-wpa-psk-adhoc | 16 + .../network-scripts/ifcfg-test-wifi-wpa-psk-hex | 19 + .../ifcfg-test-wifi-wpa-psk-unquoted | 19 + .../ifcfg-test-wifi-wpa-psk-unquoted2 | 19 + .../ifcfg-test-wired-8021x-peap-mschapv2 | 15 + .../network-scripts/ifcfg-test-wired-defroute-no | 15 + .../ifcfg-test-wired-defroute-no-gatewaydev-yes | 15 + .../tests/network-scripts/ifcfg-test-wired-dhcp | 14 + .../ifcfg-test-wired-global-gateway | 14 + .../network-scripts/ifcfg-test-wired-ipv6-manual | 19 + .../network-scripts/ifcfg-test-wired-ipv6-only | 14 + .../network-scripts/ifcfg-test-wired-never-default | 11 + .../tests/network-scripts/ifcfg-test-wired-static | 20 + .../ifcfg-test-wired-static-bootproto | 15 + .../ifcfg-test-wired-static-no-prefix-16 | 14 + .../ifcfg-test-wired-static-no-prefix-24 | 14 + .../ifcfg-test-wired-static-no-prefix-8 | 14 + .../network-scripts/ifcfg-test-wired-static-routes | 15 + .../ifcfg-test-wired-static-routes-legacy | 15 + .../tests/network-scripts/keys-test-wifi-leap | 1 + .../tests/network-scripts/keys-test-wifi-wep | 1 + .../network-scripts/keys-test-wifi-wep-104-ascii | 1 + .../network-scripts/keys-test-wifi-wep-40-ascii | 1 + .../tests/network-scripts/keys-test-wifi-wep-adhoc | 1 + .../keys-test-wifi-wep-eap-ttls-chap | 2 + .../network-scripts/keys-test-wifi-wep-passphrase | 1 + .../network-scripts/keys-test-wifi-wpa-eap-tls | 2 + .../keys-test-wifi-wpa-eap-ttls-tls | 2 + .../tests/network-scripts/keys-test-wifi-wpa-psk | 2 + .../network-scripts/keys-test-wifi-wpa-psk-adhoc | 2 + .../network-scripts/keys-test-wifi-wpa-psk-hex | 2 + .../keys-test-wifi-wpa-psk-unquoted | 2 + .../keys-test-wifi-wpa-psk-unquoted2 | 2 + .../keys-test-wired-8021x-peap-mschapv2 | 2 + .../network-test-wired-defroute-no-gatewaydev-yes | 2 + .../network-test-wired-global-gateway | 1 + .../network-test-wired-never-default | 4 + .../route-test-static-routes-legacy | 3 + .../network-scripts/route-test-wired-static-routes | 8 + .../route-test-wired-static-routes-legacy | 7 + .../network-scripts/route6-test-wired-ipv6-manual | 1 + .../tests/network-scripts/test1_key_and_cert.pem | 118 + .../tests/network-scripts/test_ca_cert.pem | 27 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c | 162 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 9112 ++++++++ system-settings/plugins/ifcfg-rh/utils.c | 338 + system-settings/plugins/ifcfg-rh/utils.h | 51 + system-settings/plugins/ifcfg-rh/writer.c | 1559 ++ system-settings/plugins/ifcfg-rh/writer.h | 39 + system-settings/plugins/ifcfg-suse/Makefile.am | 26 + system-settings/plugins/ifcfg-suse/Makefile.in | 624 + system-settings/plugins/ifcfg-suse/plugin.c | 322 + system-settings/plugins/ifcfg-suse/plugin.h | 52 + system-settings/plugins/ifupdown/Makefile.am | 34 + system-settings/plugins/ifupdown/Makefile.in | 657 + .../plugins/ifupdown/interface_parser.c | 215 + .../plugins/ifupdown/interface_parser.h | 57 + .../plugins/ifupdown/nm-ifupdown-connection.c | 187 + .../plugins/ifupdown/nm-ifupdown-connection.h | 55 + system-settings/plugins/ifupdown/parser.c | 577 + system-settings/plugins/ifupdown/parser.h | 34 + system-settings/plugins/ifupdown/plugin.c | 681 + system-settings/plugins/ifupdown/plugin.h | 53 + system-settings/plugins/keyfile/Makefile.am | 40 + system-settings/plugins/keyfile/Makefile.in | 801 + system-settings/plugins/keyfile/io/Makefile.am | 20 + system-settings/plugins/keyfile/io/Makefile.in | 569 + system-settings/plugins/keyfile/io/reader.c | 1085 + system-settings/plugins/keyfile/io/reader.h | 32 + system-settings/plugins/keyfile/io/writer.c | 691 + system-settings/plugins/keyfile/io/writer.h | 38 + .../plugins/keyfile/nm-keyfile-connection.c | 242 + .../plugins/keyfile/nm-keyfile-connection.h | 54 + system-settings/plugins/keyfile/plugin.c | 581 + system-settings/plugins/keyfile/plugin.h | 46 + system-settings/plugins/keyfile/tests/Makefile.am | 32 + system-settings/plugins/keyfile/tests/Makefile.in | 733 + .../keyfile/tests/keyfiles/ATT_Data_Connect_BT | 23 + .../keyfile/tests/keyfiles/ATT_Data_Connect_Plain | 20 + .../plugins/keyfile/tests/keyfiles/Makefile.am | 14 + .../plugins/keyfile/tests/keyfiles/Makefile.in | 433 + .../keyfile/tests/keyfiles/Test_GSM_Connection | 41 + .../keyfile/tests/keyfiles/Test_Wired_Connection | 32 + .../tests/keyfiles/Test_Wired_Connection_IP6 | 20 + .../tests/keyfiles/Test_Wired_Connection_MAC_Case | 32 + .../tests/keyfiles/Test_Wireless_Connection | 22 + .../plugins/keyfile/tests/test-keyfile.c | 1882 ++ test/Makefile.am | 39 + test/Makefile.in | 662 + test/libnm-glib-test.c | 113 + test/nm-online.c | 210 + test/nm-tool.c | 721 + tools/Makefile.am | 1 + tools/Makefile.in | 418 + tools/doc-generator.xsl | 691 + 829 files changed, 349666 insertions(+) create mode 100644 AUTHORS create mode 100644 CONTRIBUTING create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 NetworkManager.pc.in create mode 100644 README create mode 100644 TODO create mode 100644 aclocal.m4 create mode 100644 callouts/77-nm-olpc-mesh.rules create mode 100644 callouts/Makefile.am create mode 100644 callouts/Makefile.in create mode 100644 callouts/nm-avahi-autoipd-action.c create mode 100644 callouts/nm-avahi-autoipd.conf create mode 100644 callouts/nm-dhcp-client-action.c create mode 100644 callouts/nm-dhcp-client.conf create mode 100644 callouts/nm-dispatcher-action.c create mode 100644 callouts/nm-dispatcher-action.h create mode 100644 callouts/nm-dispatcher.conf create mode 100644 callouts/nm-dispatcher.xml create mode 100644 callouts/org.freedesktop.nm_dispatcher.service.in create mode 100644 cli/Makefile.am create mode 100644 cli/Makefile.in create mode 100644 cli/src/Makefile.am create mode 100644 cli/src/Makefile.in create mode 100644 cli/src/connections.c create mode 100644 cli/src/connections.h create mode 100644 cli/src/devices.c create mode 100644 cli/src/devices.h create mode 100644 cli/src/network-manager.c create mode 100644 cli/src/network-manager.h create mode 100644 cli/src/nmcli.c create mode 100644 cli/src/nmcli.h create mode 100644 cli/src/settings.c create mode 100644 cli/src/settings.h create mode 100644 cli/src/utils.c create mode 100644 cli/src/utils.h create mode 100755 compile create mode 100755 config.guess create mode 100644 config.h.in create mode 100755 config.sub create mode 100755 configure create mode 100644 configure.ac create mode 100755 depcomp create mode 100644 docs/Makefile.am create mode 100644 docs/Makefile.in create mode 100644 docs/generate-settings-spec.c create mode 100644 docs/libnm-glib/Makefile.am create mode 100644 docs/libnm-glib/Makefile.in create mode 100644 docs/libnm-glib/html/NMCdmaDevice.html create mode 100644 docs/libnm-glib/html/NMDHCP4Config.html create mode 100644 docs/libnm-glib/html/NMDHCP6Config.html create mode 100644 docs/libnm-glib/html/NMGsmDevice.html create mode 100644 docs/libnm-glib/html/NMIP4Config.html create mode 100644 docs/libnm-glib/html/NMIP6Config.html create mode 100644 docs/libnm-glib/html/NMSerialDevice.html create mode 100644 docs/libnm-glib/html/ch01.html create mode 100644 docs/libnm-glib/html/home.png create mode 100644 docs/libnm-glib/html/index.html create mode 100644 docs/libnm-glib/html/index.sgml create mode 100644 docs/libnm-glib/html/left.png create mode 100644 docs/libnm-glib/html/libnm-glib-NMExportedConnection.html create mode 100644 docs/libnm-glib/html/libnm-glib-NMRemoteConnection.html create mode 100644 docs/libnm-glib/html/libnm-glib-NMRemoteSettingsSystem.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-access-point.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-active-connection.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-client.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-device-bt.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-device-ethernet.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-device-wifi.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-device.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-object.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-remote-settings.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-settings-connection-interface.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-settings-interface.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-settings-service.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-settings-system-interface.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-types.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-vpn-connection.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-vpn-plugin-ui-interface.html create mode 100644 docs/libnm-glib/html/libnm-glib-nm-vpn-plugin.html create mode 100644 docs/libnm-glib/html/libnm-glib.devhelp create mode 100644 docs/libnm-glib/html/libnm-glib.devhelp2 create mode 100644 docs/libnm-glib/html/right.png create mode 100644 docs/libnm-glib/html/style.css create mode 100644 docs/libnm-glib/html/up.png create mode 100644 docs/libnm-glib/libnm-glib-docs.sgml create mode 100644 docs/libnm-glib/libnm-glib-overrides.txt create mode 100644 docs/libnm-glib/libnm-glib-sections.txt create mode 100644 docs/libnm-glib/libnm-glib.types create mode 100644 docs/libnm-glib/tmpl/libnm-glib-unused.sgml create mode 100644 docs/libnm-glib/tmpl/libnm_glib.sgml create mode 100644 docs/libnm-glib/tmpl/nm-access-point.sgml create mode 100644 docs/libnm-glib/tmpl/nm-active-connection.sgml create mode 100644 docs/libnm-glib/tmpl/nm-cdma-device.sgml create mode 100644 docs/libnm-glib/tmpl/nm-client.sgml create mode 100644 docs/libnm-glib/tmpl/nm-dbus-connection.sgml create mode 100644 docs/libnm-glib/tmpl/nm-dbus-settings-system.sgml create mode 100644 docs/libnm-glib/tmpl/nm-dbus-settings.sgml create mode 100644 docs/libnm-glib/tmpl/nm-device-bt-bindings.sgml create mode 100644 docs/libnm-glib/tmpl/nm-device-bt.sgml create mode 100644 docs/libnm-glib/tmpl/nm-device-ethernet.sgml create mode 100644 docs/libnm-glib/tmpl/nm-device-wifi.sgml create mode 100644 docs/libnm-glib/tmpl/nm-device.sgml create mode 100644 docs/libnm-glib/tmpl/nm-dhcp4-config.sgml create mode 100644 docs/libnm-glib/tmpl/nm-dhcp6-config-bindings.sgml create mode 100644 docs/libnm-glib/tmpl/nm-dhcp6-config.sgml create mode 100644 docs/libnm-glib/tmpl/nm-exported-connection.sgml create mode 100644 docs/libnm-glib/tmpl/nm-gsm-device.sgml create mode 100644 docs/libnm-glib/tmpl/nm-ip4-config.sgml create mode 100644 docs/libnm-glib/tmpl/nm-ip6-config-bindings.sgml create mode 100644 docs/libnm-glib/tmpl/nm-ip6-config.sgml create mode 100644 docs/libnm-glib/tmpl/nm-object.sgml create mode 100644 docs/libnm-glib/tmpl/nm-remote-connection-private.sgml create mode 100644 docs/libnm-glib/tmpl/nm-remote-connection.sgml create mode 100644 docs/libnm-glib/tmpl/nm-remote-settings-system.sgml create mode 100644 docs/libnm-glib/tmpl/nm-remote-settings.sgml create mode 100644 docs/libnm-glib/tmpl/nm-serial-device.sgml create mode 100644 docs/libnm-glib/tmpl/nm-settings-connection-interface.sgml create mode 100644 docs/libnm-glib/tmpl/nm-settings-interface.sgml create mode 100644 docs/libnm-glib/tmpl/nm-settings-service.sgml create mode 100644 docs/libnm-glib/tmpl/nm-settings-system-interface.sgml create mode 100644 docs/libnm-glib/tmpl/nm-settings.sgml create mode 100644 docs/libnm-glib/tmpl/nm-types.sgml create mode 100644 docs/libnm-glib/tmpl/nm-vpn-connection.sgml create mode 100644 docs/libnm-glib/tmpl/nm-vpn-plugin-ui-interface.sgml create mode 100644 docs/libnm-glib/tmpl/nm-vpn-plugin.sgml create mode 100644 docs/libnm-util/Makefile.am create mode 100644 docs/libnm-util/Makefile.in create mode 100644 docs/libnm-util/html/NMConnection.html create mode 100644 docs/libnm-util/html/NMSetting.html create mode 100644 docs/libnm-util/html/NMSetting8021x.html create mode 100644 docs/libnm-util/html/NMSettingBluetooth.html create mode 100644 docs/libnm-util/html/NMSettingCdma.html create mode 100644 docs/libnm-util/html/NMSettingConnection.html create mode 100644 docs/libnm-util/html/NMSettingGsm.html create mode 100644 docs/libnm-util/html/NMSettingIP4Config.html create mode 100644 docs/libnm-util/html/NMSettingIP6Config.html create mode 100644 docs/libnm-util/html/NMSettingOlpcMesh.html create mode 100644 docs/libnm-util/html/NMSettingPPP.html create mode 100644 docs/libnm-util/html/NMSettingPPPOE.html create mode 100644 docs/libnm-util/html/NMSettingSerial.html create mode 100644 docs/libnm-util/html/NMSettingVPN.html create mode 100644 docs/libnm-util/html/NMSettingWired.html create mode 100644 docs/libnm-util/html/NMSettingWireless.html create mode 100644 docs/libnm-util/html/NMSettingWirelessSecurity.html create mode 100644 docs/libnm-util/html/api-index-full.html create mode 100644 docs/libnm-util/html/ch01.html create mode 100644 docs/libnm-util/html/home.png create mode 100644 docs/libnm-util/html/index.html create mode 100644 docs/libnm-util/html/index.sgml create mode 100644 docs/libnm-util/html/left.png create mode 100644 docs/libnm-util/html/libnm-util-nm-utils.html create mode 100644 docs/libnm-util/html/libnm-util.devhelp create mode 100644 docs/libnm-util/html/libnm-util.devhelp2 create mode 100644 docs/libnm-util/html/object-tree.html create mode 100644 docs/libnm-util/html/right.png create mode 100644 docs/libnm-util/html/style.css create mode 100644 docs/libnm-util/html/up.png create mode 100644 docs/libnm-util/libnm-util-docs.sgml create mode 100644 docs/libnm-util/libnm-util-overrides.txt create mode 100644 docs/libnm-util/libnm-util-sections.txt create mode 100644 docs/libnm-util/libnm-util.types create mode 100644 docs/libnm-util/tmpl/libnm-util-unused.sgml create mode 100644 docs/libnm-util/tmpl/nm-connection.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-8021x.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-bluetooth.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-bridge.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-cdma.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-connection.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-gsm.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-ip4-config.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-ip6-config.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-olpc-mesh.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-ppp.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-pppoe.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-serial.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-vpn.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-wimax.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-wired.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-wireless-security.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting-wireless.sgml create mode 100644 docs/libnm-util/tmpl/nm-setting.sgml create mode 100644 docs/libnm-util/tmpl/nm-utils.sgml create mode 100644 docs/settings-spec.html create mode 100644 docs/spec.html create mode 100644 examples/Makefile.am create mode 100644 examples/Makefile.in create mode 100644 examples/python/Makefile.am create mode 100644 examples/python/Makefile.in create mode 100755 examples/python/add-system-connection.py create mode 100644 examples/python/list-connections.py create mode 100644 examples/python/nm-state.py create mode 100644 examples/python/show-bssids.py create mode 100644 examples/python/vpn.py create mode 100644 gtk-doc.make create mode 100644 include/Makefile.am create mode 100644 include/Makefile.in create mode 100644 include/NetworkManager.h create mode 100644 include/NetworkManagerVPN.h create mode 100644 include/nm-dbus-glib-types.h create mode 100644 include/nm-glib-compat.h create mode 100644 include/nm-test-helpers.h create mode 100644 include/wireless-helper.h create mode 100644 initscript/Arch/Makefile.am create mode 100644 initscript/Arch/Makefile.in create mode 100644 initscript/Arch/networkmanager create mode 100644 initscript/Arch/networkmanager.in create mode 100644 initscript/Debian/Makefile.am create mode 100644 initscript/Debian/Makefile.in create mode 100755 initscript/Debian/NetworkManager.in create mode 100644 initscript/Gentoo/Makefile.am create mode 100644 initscript/Gentoo/Makefile.in create mode 100644 initscript/Gentoo/NetworkManager create mode 100755 initscript/Gentoo/NetworkManager.in create mode 100644 initscript/Makefile.am create mode 100644 initscript/Makefile.in create mode 100644 initscript/Mandriva/Makefile.am create mode 100644 initscript/Mandriva/Makefile.in create mode 100644 initscript/Mandriva/networkmanager create mode 100644 initscript/Mandriva/networkmanager.in create mode 100644 initscript/RedHat/Makefile.am create mode 100644 initscript/RedHat/Makefile.in create mode 100644 initscript/RedHat/NetworkManager create mode 100755 initscript/RedHat/NetworkManager.in create mode 100644 initscript/SUSE/Makefile.am create mode 100644 initscript/SUSE/Makefile.in create mode 100644 initscript/SUSE/networkmanager.in create mode 100644 initscript/Slackware/Makefile.am create mode 100644 initscript/Slackware/Makefile.in create mode 100644 initscript/Slackware/rc.networkmanager create mode 100644 initscript/Slackware/rc.networkmanager.in create mode 100644 initscript/paldo/Makefile.am create mode 100644 initscript/paldo/Makefile.in create mode 100644 initscript/paldo/NetworkManager create mode 100644 initscript/paldo/NetworkManager.in create mode 100755 install-sh create mode 100644 intltool-extract.in create mode 100644 intltool-merge.in create mode 100644 intltool-update.in create mode 100644 introspection/Makefile.am create mode 100644 introspection/Makefile.in create mode 100644 introspection/all.xml create mode 100644 introspection/errors.xml create mode 100644 introspection/generic-types.xml create mode 100644 introspection/nm-access-point.xml create mode 100644 introspection/nm-active-connection.xml create mode 100644 introspection/nm-device-bt.xml create mode 100644 introspection/nm-device-cdma.xml create mode 100644 introspection/nm-device-ethernet.xml create mode 100644 introspection/nm-device-gsm.xml create mode 100644 introspection/nm-device-olpc-mesh.xml create mode 100644 introspection/nm-device-serial.xml create mode 100644 introspection/nm-device-wifi.xml create mode 100644 introspection/nm-device.xml create mode 100644 introspection/nm-dhcp4-config.xml create mode 100644 introspection/nm-dhcp6-config.xml create mode 100644 introspection/nm-exported-connection.xml create mode 100644 introspection/nm-ip4-config.xml create mode 100644 introspection/nm-ip6-config.xml create mode 100644 introspection/nm-manager-client.xml create mode 100644 introspection/nm-manager.xml create mode 100644 introspection/nm-ppp-manager.xml create mode 100644 introspection/nm-settings-system.xml create mode 100644 introspection/nm-settings.xml create mode 100644 introspection/nm-vpn-connection.xml create mode 100644 introspection/nm-vpn-plugin.xml create mode 100644 introspection/vpn-errors.xml create mode 100644 libnm-glib/Makefile.am create mode 100644 libnm-glib/Makefile.in create mode 100644 libnm-glib/libnm-glib-test.c create mode 100644 libnm-glib/libnm-glib-vpn.pc.in create mode 100644 libnm-glib/libnm-glib-vpn.ver create mode 100644 libnm-glib/libnm-glib.pc.in create mode 100644 libnm-glib/libnm-glib.ver create mode 100644 libnm-glib/libnm_glib.c create mode 100644 libnm-glib/libnm_glib.h create mode 100644 libnm-glib/nm-access-point.c create mode 100644 libnm-glib/nm-access-point.h create mode 100644 libnm-glib/nm-active-connection.c create mode 100644 libnm-glib/nm-active-connection.h create mode 100644 libnm-glib/nm-cdma-device.c create mode 100644 libnm-glib/nm-cdma-device.h create mode 100644 libnm-glib/nm-client.c create mode 100644 libnm-glib/nm-client.h create mode 100644 libnm-glib/nm-dbus-utils.c create mode 100644 libnm-glib/nm-dbus-utils.h create mode 100644 libnm-glib/nm-device-bt.c create mode 100644 libnm-glib/nm-device-bt.h create mode 100644 libnm-glib/nm-device-ethernet.c create mode 100644 libnm-glib/nm-device-ethernet.h create mode 100644 libnm-glib/nm-device-private.h create mode 100644 libnm-glib/nm-device-wifi.c create mode 100644 libnm-glib/nm-device-wifi.h create mode 100644 libnm-glib/nm-device.c create mode 100644 libnm-glib/nm-device.h create mode 100644 libnm-glib/nm-dhcp4-config.c create mode 100644 libnm-glib/nm-dhcp4-config.h create mode 100644 libnm-glib/nm-dhcp6-config.c create mode 100644 libnm-glib/nm-dhcp6-config.h create mode 100644 libnm-glib/nm-exported-connection.c create mode 100644 libnm-glib/nm-exported-connection.h create mode 100644 libnm-glib/nm-gsm-device.c create mode 100644 libnm-glib/nm-gsm-device.h create mode 100644 libnm-glib/nm-ip4-config.c create mode 100644 libnm-glib/nm-ip4-config.h create mode 100644 libnm-glib/nm-ip6-config.c create mode 100644 libnm-glib/nm-ip6-config.h create mode 100644 libnm-glib/nm-object-cache.c create mode 100644 libnm-glib/nm-object-cache.h create mode 100644 libnm-glib/nm-object-private.h create mode 100644 libnm-glib/nm-object.c create mode 100644 libnm-glib/nm-object.h create mode 100644 libnm-glib/nm-remote-connection-private.h create mode 100644 libnm-glib/nm-remote-connection.c create mode 100644 libnm-glib/nm-remote-connection.h create mode 100644 libnm-glib/nm-remote-settings-system.c create mode 100644 libnm-glib/nm-remote-settings-system.h create mode 100644 libnm-glib/nm-remote-settings.c create mode 100644 libnm-glib/nm-remote-settings.h create mode 100644 libnm-glib/nm-serial-device.c create mode 100644 libnm-glib/nm-serial-device.h create mode 100644 libnm-glib/nm-settings-connection-interface.c create mode 100644 libnm-glib/nm-settings-connection-interface.h create mode 100644 libnm-glib/nm-settings-interface.c create mode 100644 libnm-glib/nm-settings-interface.h create mode 100644 libnm-glib/nm-settings-service.c create mode 100644 libnm-glib/nm-settings-service.h create mode 100644 libnm-glib/nm-settings-system-interface.c create mode 100644 libnm-glib/nm-settings-system-interface.h create mode 100644 libnm-glib/nm-types-private.h create mode 100644 libnm-glib/nm-types.c create mode 100644 libnm-glib/nm-types.h create mode 100644 libnm-glib/nm-vpn-connection.c create mode 100644 libnm-glib/nm-vpn-connection.h create mode 100644 libnm-glib/nm-vpn-plugin-ui-interface.c create mode 100644 libnm-glib/nm-vpn-plugin-ui-interface.h create mode 100644 libnm-glib/nm-vpn-plugin.c create mode 100644 libnm-glib/nm-vpn-plugin.h create mode 100644 libnm-util/COPYING create mode 100644 libnm-util/Makefile.am create mode 100644 libnm-util/Makefile.in create mode 100644 libnm-util/crypto.c create mode 100644 libnm-util/crypto.h create mode 100644 libnm-util/crypto_gnutls.c create mode 100644 libnm-util/crypto_nss.c create mode 100644 libnm-util/libnm-util.pc.in create mode 100644 libnm-util/libnm-util.ver create mode 100644 libnm-util/nm-connection.c create mode 100644 libnm-util/nm-connection.h create mode 100644 libnm-util/nm-param-spec-specialized.c create mode 100644 libnm-util/nm-param-spec-specialized.h create mode 100644 libnm-util/nm-setting-8021x.c create mode 100644 libnm-util/nm-setting-8021x.h create mode 100644 libnm-util/nm-setting-bluetooth.c create mode 100644 libnm-util/nm-setting-bluetooth.h create mode 100644 libnm-util/nm-setting-cdma.c create mode 100644 libnm-util/nm-setting-cdma.h create mode 100644 libnm-util/nm-setting-connection.c create mode 100644 libnm-util/nm-setting-connection.h create mode 100644 libnm-util/nm-setting-gsm.c create mode 100644 libnm-util/nm-setting-gsm.h create mode 100644 libnm-util/nm-setting-ip4-config.c create mode 100644 libnm-util/nm-setting-ip4-config.h create mode 100644 libnm-util/nm-setting-ip6-config.c create mode 100644 libnm-util/nm-setting-ip6-config.h create mode 100644 libnm-util/nm-setting-olpc-mesh.c create mode 100644 libnm-util/nm-setting-olpc-mesh.h create mode 100644 libnm-util/nm-setting-ppp.c create mode 100644 libnm-util/nm-setting-ppp.h create mode 100644 libnm-util/nm-setting-pppoe.c create mode 100644 libnm-util/nm-setting-pppoe.h create mode 100644 libnm-util/nm-setting-serial.c create mode 100644 libnm-util/nm-setting-serial.h create mode 100644 libnm-util/nm-setting-vpn.c create mode 100644 libnm-util/nm-setting-vpn.h create mode 100644 libnm-util/nm-setting-wired.c create mode 100644 libnm-util/nm-setting-wired.h create mode 100644 libnm-util/nm-setting-wireless-security.c create mode 100644 libnm-util/nm-setting-wireless-security.h create mode 100644 libnm-util/nm-setting-wireless.c create mode 100644 libnm-util/nm-setting-wireless.h create mode 100644 libnm-util/nm-setting.c create mode 100644 libnm-util/nm-setting.h create mode 100644 libnm-util/nm-utils-private.h create mode 100644 libnm-util/nm-utils.c create mode 100644 libnm-util/nm-utils.h create mode 100644 libnm-util/tests/Makefile.am create mode 100644 libnm-util/tests/Makefile.in create mode 100644 libnm-util/tests/certs/Makefile.am create mode 100644 libnm-util/tests/certs/Makefile.in create mode 100644 libnm-util/tests/certs/ca-no-ending-newline.pem create mode 100644 libnm-util/tests/certs/test-cert.p12 create mode 100644 libnm-util/tests/certs/test-key-only-decrypted.der create mode 100644 libnm-util/tests/certs/test-key-only.pem create mode 100644 libnm-util/tests/certs/test2-cert.p12 create mode 100644 libnm-util/tests/certs/test2_ca_cert.pem create mode 100644 libnm-util/tests/certs/test2_key_and_cert.pem create mode 100644 libnm-util/tests/certs/test_ca_cert.pem create mode 100644 libnm-util/tests/certs/test_key_and_cert.pem create mode 100644 libnm-util/tests/test-crypto.c create mode 100644 libnm-util/tests/test-general.c create mode 100644 libnm-util/tests/test-need-secrets.c create mode 100644 libnm-util/tests/test-setting-8021x.c create mode 100644 libnm-util/tests/test-settings-defaults.c create mode 100755 ltmain.sh create mode 100644 m4/compiler_warnings.m4 create mode 100644 m4/gtk-doc.m4 create mode 100644 m4/intltool.m4 create mode 100644 m4/libnl-check.m4 create mode 100644 m4/libtool.m4 create mode 100644 m4/ltoptions.m4 create mode 100644 m4/ltsugar.m4 create mode 100644 m4/ltversion.m4 create mode 100644 m4/lt~obsolete.m4 create mode 100644 man/Makefile.am create mode 100644 man/Makefile.in create mode 100644 man/NetworkManager.8 create mode 100644 man/NetworkManager.8.in create mode 100644 man/NetworkManager.conf.5 create mode 100644 man/NetworkManager.conf.5.in create mode 100644 man/nm-system-settings.conf.5 create mode 100644 man/nm-system-settings.conf.5.in create mode 100644 man/nm-tool.1 create mode 100644 man/nm-tool.1.in create mode 100644 man/nmcli.1 create mode 100644 man/nmcli.1.in create mode 100644 marshallers/Makefile.am create mode 100644 marshallers/Makefile.in create mode 100644 marshallers/nm-marshal-main.c create mode 100644 marshallers/nm-marshal.list create mode 100755 missing create mode 100644 po/ChangeLog create mode 100644 po/LINGUAS create mode 100644 po/Makefile.in.in create mode 100644 po/POTFILES.in create mode 100644 po/POTFILES.skip create mode 100644 po/ar.po create mode 100644 po/as.po create mode 100644 po/be@latin.po create mode 100644 po/bg.po create mode 100644 po/bn_IN.po create mode 100644 po/bs.po create mode 100644 po/ca.po create mode 100644 po/cs.po create mode 100644 po/da.po create mode 100644 po/de.po create mode 100644 po/dz.po create mode 100644 po/el.po create mode 100644 po/en_CA.po create mode 100644 po/en_GB.po create mode 100644 po/es.po create mode 100644 po/et.po create mode 100644 po/eu.po create mode 100644 po/fi.po create mode 100644 po/fr.po create mode 100644 po/gl.po create mode 100644 po/gu.po create mode 100644 po/he.po create mode 100644 po/hi.po create mode 100644 po/hr.po create mode 100644 po/hu.po create mode 100644 po/id.po create mode 100644 po/it.po create mode 100644 po/ja.po create mode 100644 po/ka.po create mode 100644 po/kn.po create mode 100644 po/ko.po create mode 100644 po/ku.po create mode 100644 po/lt.po create mode 100644 po/lv.po create mode 100644 po/mk.po create mode 100644 po/ml.po create mode 100644 po/mr.po create mode 100644 po/nb.po create mode 100644 po/ne.po create mode 100644 po/nl.po create mode 100644 po/oc.po create mode 100644 po/or.po create mode 100644 po/pa.po create mode 100644 po/pl.po create mode 100644 po/pt.po create mode 100644 po/pt_BR.po create mode 100644 po/ru.po create mode 100644 po/rw.po create mode 100644 po/sk.po create mode 100644 po/sl.po create mode 100644 po/sq.po create mode 100644 po/sr.po create mode 100644 po/sr@latin.po create mode 100644 po/sv.po create mode 100644 po/ta.po create mode 100644 po/te.po create mode 100644 po/th.po create mode 100644 po/uk.po create mode 100644 po/vi.po create mode 100644 po/wa.po create mode 100644 po/zh_CN.po create mode 100644 po/zh_HK.po create mode 100644 po/zh_TW.po create mode 100644 policy/Makefile.am create mode 100644 policy/Makefile.in create mode 100644 policy/org.freedesktop.network-manager-settings.system.policy create mode 100644 policy/org.freedesktop.network-manager-settings.system.policy.in create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/NetworkManager.conf create mode 100644 src/NetworkManagerUtils.c create mode 100644 src/NetworkManagerUtils.h create mode 100644 src/backends/Makefile.am create mode 100644 src/backends/Makefile.in create mode 100644 src/backends/NetworkManagerArch.c create mode 100644 src/backends/NetworkManagerDebian.c create mode 100644 src/backends/NetworkManagerFrugalware.c create mode 100644 src/backends/NetworkManagerGeneric.c create mode 100644 src/backends/NetworkManagerGeneric.h create mode 100644 src/backends/NetworkManagerGentoo.c create mode 100644 src/backends/NetworkManagerMandriva.c create mode 100644 src/backends/NetworkManagerPaldo.c create mode 100644 src/backends/NetworkManagerPardus.c create mode 100644 src/backends/NetworkManagerRedHat.c create mode 100644 src/backends/NetworkManagerSlackware.c create mode 100644 src/backends/NetworkManagerSuSE.c create mode 100644 src/bluez-manager/Makefile.am create mode 100644 src/bluez-manager/Makefile.in create mode 100644 src/bluez-manager/nm-bluez-adapter.c create mode 100644 src/bluez-manager/nm-bluez-adapter.h create mode 100644 src/bluez-manager/nm-bluez-common.h create mode 100644 src/bluez-manager/nm-bluez-device.c create mode 100644 src/bluez-manager/nm-bluez-device.h create mode 100644 src/bluez-manager/nm-bluez-manager.c create mode 100644 src/bluez-manager/nm-bluez-manager.h create mode 100644 src/dhcp-manager/Makefile.am create mode 100644 src/dhcp-manager/Makefile.in create mode 100644 src/dhcp-manager/nm-dhcp-client.c create mode 100644 src/dhcp-manager/nm-dhcp-client.h create mode 100644 src/dhcp-manager/nm-dhcp-dhclient.c create mode 100644 src/dhcp-manager/nm-dhcp-dhclient.h create mode 100644 src/dhcp-manager/nm-dhcp-dhcpcd.c create mode 100644 src/dhcp-manager/nm-dhcp-dhcpcd.h create mode 100644 src/dhcp-manager/nm-dhcp-manager.c create mode 100644 src/dhcp-manager/nm-dhcp-manager.h create mode 100644 src/dnsmasq-manager/Makefile.am create mode 100644 src/dnsmasq-manager/Makefile.in create mode 100644 src/dnsmasq-manager/nm-dnsmasq-manager.c create mode 100644 src/dnsmasq-manager/nm-dnsmasq-manager.h create mode 100644 src/gdb-cmd create mode 100644 src/ip6-manager/Makefile.am create mode 100644 src/ip6-manager/Makefile.in create mode 100644 src/ip6-manager/nm-ip6-manager.c create mode 100644 src/ip6-manager/nm-ip6-manager.h create mode 100644 src/logging/Makefile.am create mode 100644 src/logging/Makefile.in create mode 100644 src/logging/nm-logging.c create mode 100644 src/logging/nm-logging.h create mode 100644 src/main.c create mode 100644 src/modem-manager/Makefile.am create mode 100644 src/modem-manager/Makefile.in create mode 100644 src/modem-manager/nm-modem-cdma.c create mode 100644 src/modem-manager/nm-modem-cdma.h create mode 100644 src/modem-manager/nm-modem-gsm.c create mode 100644 src/modem-manager/nm-modem-gsm.h create mode 100644 src/modem-manager/nm-modem-manager.c create mode 100644 src/modem-manager/nm-modem-manager.h create mode 100644 src/modem-manager/nm-modem-types.h create mode 100644 src/modem-manager/nm-modem.c create mode 100644 src/modem-manager/nm-modem.h create mode 100644 src/named-manager/Makefile.am create mode 100644 src/named-manager/Makefile.in create mode 100644 src/named-manager/nm-named-manager.c create mode 100644 src/named-manager/nm-named-manager.h create mode 100644 src/nm-activation-request.c create mode 100644 src/nm-activation-request.h create mode 100644 src/nm-active-connection.c create mode 100644 src/nm-active-connection.h create mode 100644 src/nm-call-store.c create mode 100644 src/nm-call-store.h create mode 100644 src/nm-crash-logger.c create mode 100644 src/nm-dbus-manager.c create mode 100644 src/nm-dbus-manager.h create mode 100644 src/nm-device-bt.c create mode 100644 src/nm-device-bt.h create mode 100644 src/nm-device-cdma.c create mode 100644 src/nm-device-cdma.h create mode 100644 src/nm-device-ethernet.c create mode 100644 src/nm-device-ethernet.h create mode 100644 src/nm-device-gsm.c create mode 100644 src/nm-device-gsm.h create mode 100644 src/nm-device-interface.c create mode 100644 src/nm-device-interface.h create mode 100644 src/nm-device-modem.c create mode 100644 src/nm-device-modem.h create mode 100644 src/nm-device-olpc-mesh.c create mode 100644 src/nm-device-olpc-mesh.h create mode 100644 src/nm-device-private.h create mode 100644 src/nm-device-wifi.c create mode 100644 src/nm-device-wifi.h create mode 100644 src/nm-device.c create mode 100644 src/nm-device.h create mode 100644 src/nm-dhcp4-config.c create mode 100644 src/nm-dhcp4-config.h create mode 100644 src/nm-dhcp6-config.c create mode 100644 src/nm-dhcp6-config.h create mode 100644 src/nm-hostname-provider.c create mode 100644 src/nm-hostname-provider.h create mode 100644 src/nm-ip4-config.c create mode 100644 src/nm-ip4-config.h create mode 100644 src/nm-ip6-config.c create mode 100644 src/nm-ip6-config.h create mode 100644 src/nm-manager.c create mode 100644 src/nm-manager.h create mode 100644 src/nm-netlink-monitor.c create mode 100644 src/nm-netlink-monitor.h create mode 100644 src/nm-policy-hostname.c create mode 100644 src/nm-policy-hostname.h create mode 100644 src/nm-policy-hosts.c create mode 100644 src/nm-policy-hosts.h create mode 100644 src/nm-policy.c create mode 100644 src/nm-policy.h create mode 100644 src/nm-properties-changed-signal.c create mode 100644 src/nm-properties-changed-signal.h create mode 100644 src/nm-rfkill.h create mode 100644 src/nm-secrets-provider-interface.c create mode 100644 src/nm-secrets-provider-interface.h create mode 100644 src/nm-system.c create mode 100644 src/nm-system.h create mode 100644 src/nm-udev-manager.c create mode 100644 src/nm-udev-manager.h create mode 100644 src/nm-wifi-ap.c create mode 100644 src/nm-wifi-ap.h create mode 100644 src/ppp-manager/Makefile.am create mode 100644 src/ppp-manager/Makefile.in create mode 100644 src/ppp-manager/nm-ppp-manager.c create mode 100644 src/ppp-manager/nm-ppp-manager.h create mode 100644 src/ppp-manager/nm-ppp-status.h create mode 100644 src/ppp-manager/nm-pppd-plugin.c create mode 100644 src/ppp-manager/nm-pppd-plugin.h create mode 100644 src/supplicant-manager/Makefile.am create mode 100644 src/supplicant-manager/Makefile.in create mode 100644 src/supplicant-manager/nm-supplicant-config.c create mode 100644 src/supplicant-manager/nm-supplicant-config.h create mode 100644 src/supplicant-manager/nm-supplicant-interface.c create mode 100644 src/supplicant-manager/nm-supplicant-interface.h create mode 100644 src/supplicant-manager/nm-supplicant-manager.c create mode 100644 src/supplicant-manager/nm-supplicant-manager.h create mode 100644 src/supplicant-manager/nm-supplicant-settings-verify.c create mode 100644 src/supplicant-manager/nm-supplicant-settings-verify.h create mode 100644 src/supplicant-manager/nm-supplicant-types.h create mode 100644 src/supplicant-manager/tests/Makefile.am create mode 100644 src/supplicant-manager/tests/Makefile.in create mode 100644 src/supplicant-manager/tests/test-supplicant-config.c create mode 100644 src/system-settings/Makefile.am create mode 100644 src/system-settings/Makefile.in create mode 100644 src/system-settings/nm-default-wired-connection.c create mode 100644 src/system-settings/nm-default-wired-connection.h create mode 100644 src/system-settings/nm-inotify-helper.c create mode 100644 src/system-settings/nm-inotify-helper.h create mode 100644 src/system-settings/nm-polkit-helpers.h create mode 100644 src/system-settings/nm-sysconfig-connection.c create mode 100644 src/system-settings/nm-sysconfig-connection.h create mode 100644 src/system-settings/nm-sysconfig-settings.c create mode 100644 src/system-settings/nm-sysconfig-settings.h create mode 100644 src/system-settings/nm-system-config-error.c create mode 100644 src/system-settings/nm-system-config-error.h create mode 100644 src/system-settings/nm-system-config-interface.c create mode 100644 src/system-settings/nm-system-config-interface.h create mode 100644 src/tests/Makefile.am create mode 100644 src/tests/Makefile.in create mode 100644 src/tests/test-dhcp-options.c create mode 100644 src/tests/test-policy-hosts.c create mode 100644 src/vpn-manager/Makefile.am create mode 100644 src/vpn-manager/Makefile.in create mode 100644 src/vpn-manager/nm-vpn-connection.c create mode 100644 src/vpn-manager/nm-vpn-connection.h create mode 100644 src/vpn-manager/nm-vpn-manager.c create mode 100644 src/vpn-manager/nm-vpn-manager.h create mode 100644 src/vpn-manager/nm-vpn-service.c create mode 100644 src/vpn-manager/nm-vpn-service.h create mode 100644 src/wpa.c create mode 100644 src/wpa.h create mode 100644 system-settings/Makefile.am create mode 100644 system-settings/Makefile.in create mode 100644 system-settings/plugins/Makefile.am create mode 100644 system-settings/plugins/Makefile.in create mode 100644 system-settings/plugins/ifcfg-rh/Makefile.am create mode 100644 system-settings/plugins/ifcfg-rh/Makefile.in create mode 100644 system-settings/plugins/ifcfg-rh/common.h create mode 100644 system-settings/plugins/ifcfg-rh/errors.c create mode 100644 system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c create mode 100644 system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h create mode 100644 system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf create mode 100644 system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml create mode 100644 system-settings/plugins/ifcfg-rh/plugin.c create mode 100644 system-settings/plugins/ifcfg-rh/plugin.h create mode 100644 system-settings/plugins/ifcfg-rh/reader.c create mode 100644 system-settings/plugins/ifcfg-rh/reader.h create mode 100644 system-settings/plugins/ifcfg-rh/shvar.c create mode 100644 system-settings/plugins/ifcfg-rh/shvar.h create mode 100644 system-settings/plugins/ifcfg-rh/tests/Makefile.am create mode 100644 system-settings/plugins/ifcfg-rh/tests/Makefile.in create mode 100755 system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns1 create mode 100755 system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns2 create mode 100755 system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-gateway create mode 100755 system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-ipaddr create mode 100755 system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-dhcp create mode 100755 system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-static create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.in create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-ibft-dhcp create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-ibft-static create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-minimal create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-nm-controlled create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-onboot-no create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-static-routes-legacy create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-leap create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-auto create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-hex create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-long-hex create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-long-quoted create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-quoted create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-104-ascii create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-40-ascii create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-adhoc create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-eap-ttls-chap create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-passphrase create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-eap-tls create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-eap-ttls-tls create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-hex create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted2 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-8021x-peap-mschapv2 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-only create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-never-default create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-bootproto create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-16 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-24 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-8 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-routes create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-routes-legacy create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-leap create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-104-ascii create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-40-ascii create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-adhoc create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-eap-ttls-chap create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-passphrase create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-eap-tls create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-eap-ttls-tls create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-adhoc create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-hex create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-unquoted create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-unquoted2 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wired-8021x-peap-mschapv2 create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-defroute-no-gatewaydev-yes create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-global-gateway create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-never-default create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-static-routes-legacy create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes-legacy create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/route6-test-wired-ipv6-manual create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/test1_key_and_cert.pem create mode 100644 system-settings/plugins/ifcfg-rh/tests/network-scripts/test_ca_cert.pem create mode 100644 system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c create mode 100644 system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c create mode 100644 system-settings/plugins/ifcfg-rh/utils.c create mode 100644 system-settings/plugins/ifcfg-rh/utils.h create mode 100644 system-settings/plugins/ifcfg-rh/writer.c create mode 100644 system-settings/plugins/ifcfg-rh/writer.h create mode 100644 system-settings/plugins/ifcfg-suse/Makefile.am create mode 100644 system-settings/plugins/ifcfg-suse/Makefile.in create mode 100644 system-settings/plugins/ifcfg-suse/plugin.c create mode 100644 system-settings/plugins/ifcfg-suse/plugin.h create mode 100644 system-settings/plugins/ifupdown/Makefile.am create mode 100644 system-settings/plugins/ifupdown/Makefile.in create mode 100644 system-settings/plugins/ifupdown/interface_parser.c create mode 100644 system-settings/plugins/ifupdown/interface_parser.h create mode 100644 system-settings/plugins/ifupdown/nm-ifupdown-connection.c create mode 100644 system-settings/plugins/ifupdown/nm-ifupdown-connection.h create mode 100644 system-settings/plugins/ifupdown/parser.c create mode 100644 system-settings/plugins/ifupdown/parser.h create mode 100644 system-settings/plugins/ifupdown/plugin.c create mode 100644 system-settings/plugins/ifupdown/plugin.h create mode 100644 system-settings/plugins/keyfile/Makefile.am create mode 100644 system-settings/plugins/keyfile/Makefile.in create mode 100644 system-settings/plugins/keyfile/io/Makefile.am create mode 100644 system-settings/plugins/keyfile/io/Makefile.in create mode 100644 system-settings/plugins/keyfile/io/reader.c create mode 100644 system-settings/plugins/keyfile/io/reader.h create mode 100644 system-settings/plugins/keyfile/io/writer.c create mode 100644 system-settings/plugins/keyfile/io/writer.h create mode 100644 system-settings/plugins/keyfile/nm-keyfile-connection.c create mode 100644 system-settings/plugins/keyfile/nm-keyfile-connection.h create mode 100644 system-settings/plugins/keyfile/plugin.c create mode 100644 system-settings/plugins/keyfile/plugin.h create mode 100644 system-settings/plugins/keyfile/tests/Makefile.am create mode 100644 system-settings/plugins/keyfile/tests/Makefile.in create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_BT create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_Plain create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Makefile.am create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Makefile.in create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Test_GSM_Connection create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_IP6 create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_MAC_Case create mode 100644 system-settings/plugins/keyfile/tests/keyfiles/Test_Wireless_Connection create mode 100644 system-settings/plugins/keyfile/tests/test-keyfile.c create mode 100644 test/Makefile.am create mode 100644 test/Makefile.in create mode 100644 test/libnm-glib-test.c create mode 100644 test/nm-online.c create mode 100644 test/nm-tool.c create mode 100644 tools/Makefile.am create mode 100644 tools/Makefile.in create mode 100644 tools/doc-generator.xsl diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..f5d97bc5 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,6 @@ +Current authors: +Dan Williams +Tambet Ingo + +Previous authors: +Robert Love diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 00000000..47f93700 --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1,41 @@ +Guidelines for Contributing: + +1) Platform-specific functionality (for example, location of binaries that +NetworkManager calls, or functionality used only on some platforms or +distribution, like resolvconf) should be configurable at build time, with the +normal autoconf mechanisms for putting a #define in config.h (AC_DEFINE), then +with #ifdef MY_DEFINE / #endif in the code. + +2) Coding standards are generally GNOME coding standards, with these exceptions: + a) 4 space tabs (_not_ 8-space tabs) + b) REAL tabs (_not_ a mix of tabs and spaces in the initial indent) + c) spaces used to align continuation lines past the indent point of the + first statement line, like so: + + if (some_really_really_long_variable_name && + another_really_really_long_variable_name) { + ... + } + +* Keep a space between the function name and the opening '('. + GOOD: g_strdup (x) + BAD: g_strdup(x) + +* C-style comments, except for FIXMEs. + GOOD: f(x); /* comment */ + BAD: f(x); // comment + + GOOD: // FIXME: juice the gooblygok + BAD: /* FIXME: juice the gooblygok */ + +* Keep assignments in the variable declaration area pretty short. + GOOD: MyObject *object; + BAD: MyObject *object = complex_and_long_init_function(arg1, arg2, arg3); + +* 80-cols is a guideline, don't make the code uncomfortable in order to fit in + less than 80 cols. + +* Constants are CAPS_WITH_UNDERSCORES and use the preprocessor. + GOOD: #define MY_CONSTANT 42 + BAD: static const unsigned myConstant = 42; + diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..fde38aaa --- /dev/null +++ b/COPYING @@ -0,0 +1,351 @@ +Unless a COPYING file in a subdirectory or file-specific license headers +specify a different license, the following applies to all files in this +directory and all subdirectories. + +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. + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..d529664b --- /dev/null +++ b/ChangeLog @@ -0,0 +1,22187 @@ +2008-12-11 Dan Williams + + * Move NetworkManager to git.freedesktop.org + - git clone git://git.freedesktop.org/git/NetworkManager/NetworkManager.git + +2008-12-09 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - Add 'never-default' property, which when true indicates that a + connection should never be the default connection + + * src/nm-ip4-config.c + src/nm-ip4-config.h + - (nm_ip4_config_get_never_default, nm_ip4_config_set_never_default): + Add never-default helpers + + * src/NetworkManagerUtils.c + - (nm_utils_merge_ip4_config): update never-default when merging the + IP4 setting to the IP4 config + + * src/NetworkManagerSystem.c + - (nm_system_apply_ip4_config): if the connection is never-default, + don't add routes without a gateway + + * src/NetworkManagerPolicy.c + - (get_best_device): don't let never-default connections be the best + - (update_routing_and_dns): handle never-default for VPN connections + + * system-settings/plugins/ifcfg-rh/reader.c + - (make_ip4_setting): handle never-default by checking GATEWAYDEV + +2008-12-08 Dan Williams + + * src/vpn-manager/nm-vpn-connection.c + - (plugin_state_changed): clear secrets before setting the connection + state to FAILED, since doing so may destroy the connection itself, + since the NMVPNService owning this NMVPNConnection will unref it + when the NMVPNConnection is failed or stopped + +2008-12-05 Dan Williams + + Patch from Michael Biebl + + * libnm-glib/Makefile.am + - Bump libnm-glib revision to indicate new API + - Give libnm-util version info + + * libnm-util/Makefile.am + - Bump libnm-util soname to indicate API/ABI break with 0.6 + +2008-11-26 Dan Williams + + * Release NetworkManager 0.7 + +2008-11-26 Dan Williams + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - (nm_exported_connection_delete): rename 'delete' to 'do_delete' to + avoid using C++ reserved keywords in headers + + * libnm-glib/nm-dbus-connection.c + system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c + system-settings/plugins/ifcfg-suse/nm-suse-connection.c + system-settings/plugins/ifupdown/nm-ifupdown-connection.c + system-settings/plugins/keyfile/nm-keyfile-connection.c + system-settings/src/nm-sysconfig-connection.c + - Change 'delete' to 'do_delete' + +2008-11-25 Dan Williams + + * system-settings/plugins/ifcfg-rh + - Rename 'ifcfg-fedora' to 'ifcfg-rh'; it's not just used on Fedora + + * system-settings/src/main.c + - (load_plugins): transparently handle ifcfg-fedora as ifcfg-rh + +2008-11-25 Dan Williams + + Patch from Tambet Ingo + + Fix mishandling of netlink error floods (rh #459205, novell #443429, lp #284507) + + * src/nm-netlink-monitor.c + - Remove bits for using a non-default GMainContext, which weren't used + - (nm_netlink_monitor_error_handler): don't leak the GError, and report + the actual error code + + * src/NetworkManager.c + - (nm_error_monitoring_device_link_state): disconnect error handler when + an error flood occurs to avoid pegging the CPU + +2008-11-23 Dan Williams + + * callouts/nm-dispatcher-action.c + - (construct_envp, nm_dispatcher_action): pass connection UUID to + scripts in the environment + +2008-11-21 Dan Williams + + Patch from Tambet Ingo + + * configure.in + libnm-util/libnm-util.ver + libnm-util/nm-setting-8021x.c + libnm-util/nm-setting-8021x.h + - Add configure-time option for the system CA path + - Add 'system-ca-certs' option to 802.1x setting, which directs + NetworkManager to use system CA certificates instead of any + connection-defined CA certificates + + * src/supplicant-manager/nm-supplicant-config.c + src/supplicant-manager/nm-supplicant-settings-verify.c + - Use system CA certificates if the connection says to do so + +2008-11-21 Dan Williams + + * src/nm-dbus-manager.c + src/nm-dbus-manager.h + - (nm_dbus_manager_get_name_owner): return error + + * src/nm-manager.c + - (impl_manager_activate_connection): perform additional validation on + ActivateConnection calls of user connections + - (is_user_request_authorized): ensure that the requestor is the same + UID as the UID that owns the user settings service; users shouldn't + be able to control another user's connections + +2008-11-21 Dan Williams + + * gfilemonitor/inotify-sub.c + - (dup_dirname): actually remove trailing '/' (bgo #561807) + +2008-11-21 Tambet Ingo + + * system-settings/plugins/ifcfg-suse/parser.c (read_wpa_eap_settings): Make suse + plugin compile again. + +2008-11-20 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/nm-setting.c + libnm-util/nm-setting.h + - (NMSettingValueIterFn): instead of just a gboolean for secrets, take + all the GParamSpec flags of the property + + * system-settings/plugins/keyfile/nm-keyfile-connection.c + system-settings/plugins/keyfile/reader.c + system-settings/plugins/keyfile/writer.c + - Update for NMSettingValueIterFn change + +2008-11-20 Dan Williams + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + - More documentation updates + +2008-11-20 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-utils.c + libnm-util/nm-utils.h + libnm-util/nm-utils-private.h + libnm-util/nm-connection.c + - (nm_utils_register_value_transformations): make private, called + from NMConnection registration anyway + +2008-11-20 Dan Williams + + * libnm-util/Makefile.am + libnm-util/nm-utils-private.h + - New header for internal utils private functions + + * libnm-util/libnm-util.ver + libnm-util/nm-utils.c + libnm-util/nm-utils.h + - Document some functions + - (nm_utils_string_in_list, nm_utils_string_list_contains, + nm_utils_string_slist_validate): un-export, only used within + libnm-util or of limited use in general, and very easy to + re-implement by apps if needed + + * libnm-util/nm-setting-8021x.c + libnm-util/nm-setting-wired.c + libnm-util/nm-setting-wireless-security.c + libnm-util/nm-setting-wireless.c + - Update for private nm_utils_string_* functions + +2008-11-20 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-setting.c + libnm-util/nm-setting.h + - Add NMSetting errors + - (nm_setting_update_secrets): return errors + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_update_secrets): return errors + + * libnm-util/nm-setting-vpn.c + src/nm-activation-request.c + src/vpn-manager/nm-vpn-connection.c + - Handle update secrets errors + +2008-11-20 Dan Williams + + * libnm-util/nm-setting.c + libnm-util/nm-setting.h + libnm-util/libnm-util.ver + - (nm_setting_new_from_hash): rename from nm_setting_from_hash() to be + consistent with nm_connection_new_from_hash() + + * src/nm-activation-request.c + libnm-util/nm-connection.c + - Handle rename + +2008-11-19 Dan Williams + + * configure.in + Makefile.am + docs/libnm-util/Makefile.am + docs/libnm-util/libnm-util.types + - Start to document libnm-util + +2008-11-19 Dan Williams + + * libnm-util/nm-connection.h + libnm-util/nm-connection.c + - Document public functions + +2008-11-19 Dan Williams + + * libnm-util/nm-setting.h + libnm-util/nm-setting.c + src/nm-device.c + src/nm-manager.c + system-settings/plugins/ifcfg-fedora/plugin.c + - Prefix compare flag defines with NM_SETTING_ + +2008-11-19 Dan Williams + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_replace_settings): take a GError + + * libnm-glib/nm-settings.c + libnm-glib/nm-dbus-connection.c + src/nm-manager.c + system-settings/plugins/ifcfg-suse/nm-suse-connection.c + system-settings/plugins/keyfile/nm-keyfile-connection.c + system-settings/plugins/keyfile/plugin.c + - Handle, or don't handle, errors from nm_connection_replace_settings() + +2008-11-19 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-connection.c + - (nm_setting_register, nm_setting_unregister): unexport; they are + private and don't have a use outside libnm-util + +2008-11-17 Dan Williams + + * src/nm-hso-gsm-device.c + - (real_connection_secrets_updated): handle PIN/PUK correctly for HSO + devices + +2008-11-17 Dan Williams + + * system-settings/plugins/ifcfg-fedora/reader.c + - (read_mac_address): clean up + - (make_wireless_setting): pass NULL array to read_mac_address() like it + expects + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (read_one_connection): don't segfault on NULL errors + +2008-11-14 Dan Williams + + * Tag 0.7.0-rc2 + +2008-11-14 Dan Williams + + Handle gateways on different subnets + + * src/NetworkManagerSystem.c + - (add_ip4_route_to_gateway): gateway route should be link scope and + a host route + - (replace_default_ip4_route): use a destination address too; gateway + address should be /0; don't leak the gateway route object + +2008-11-14 Dan Williams + + * libnm-glib/libnm_glib.ver + libnm-glib/nm-dbus-settings-system.c + libnm-glib/nm-dbus-settings-system.h + - Add libnm-glib bits for CanModify + +2008-11-14 Dan Williams + + * introspection/nm-settings-system.xml + system-settings/src/dbus-settings.c + system-settings/src/dbus-settings.h + - Add a "CanModify" property to indicate if any plugins support + connection modification + +2008-11-14 Dan Williams + + Relicense libnm-glib to LGPLv2+ with agreement from contributors + +2008-11-14 Dan Williams + + * vpn-manager/nm-vpn-connection.c + - (plugin_state_changed): clear VPN secrets on error to ensure they + are always requested from the settings service (rh #429287) + +2008-11-13 Dan Williams + + * libnm-util/crypto.c + - (crypto_get_private_key_data): fix bad initial arg type checking + from pkcs#12 patch + +2008-11-13 Dan Williams + + Add support for PKCS#12 private keys (bgo #558982) + + * libnm-util/crypto.c + libnm-util/crypto.h + - (parse_old_openssl_key_file): rename from parse_key_file(); adapt to + take a GByteArray instead of a filename + - (file_to_g_byte_array): handle private key files too + - (decrypt_key): take a GByteArray rather than data + len + - (crypto_get_private_key_data): refactor crypto_get_private_key() into + one function that takes a filename, and one that takes raw data; + detect pkcs#12 files as well + - (crypto_load_and_verify_certificate): detect file type + - (crypto_is_pkcs12_data, crypto_is_pkcs12_file): add pkcs#12 detection + functions + + * libnm-util/crypto_gnutls.c + - (crypto_decrypt): take GByteArray rather than data + len; fix a bug + whereby tail padding was incorrectly handled, leading to erroneous + successes when trying to decrypt the data + - (crypto_verify_cert): rework somewhat + - (crypto_verify_pkcs12): validate pkcs#12 keys + + * libnm-util/crypto_nss.c + - (crypto_init): enable various pkcs#12 ciphers + - (crypto_decrypt): take a GByteArray rather than data + len + - (crypto_verify_cert): clean up + - (crypto_verify_pkcs12): validate pkcs#12 keys + + * libnm-util/test-crypto.c + - Handle pkcs#12 keys + + * libnm-util/nm-setting-8021x.c + libnm-util/nm-setting-8021x.h + libnm-util/libnm-util.ver + - Add two new properties, 'private-key-password' and + 'phase2-private-key-password', to be used in conjunction with + pkcs#12 keys + - (nm_setting_802_1x_set_ca_cert_from_file, + nm_setting_802_1x_set_client_cert_from_file, + nm_setting_802_1x_set_phase2_ca_cert_from_file, + nm_setting_802_1x_set_phase2_client_from_file): return certificate + type + - (nm_setting_802_1x_get_private_key_password, + nm_setting_802_1x_get_phase2_private_key_password): return private + key passwords + - (nm_setting_802_1x_set_private_key_from_file, + nm_setting_802_1x_set_phase2_private_key_from_file): set the private + key from a file, and update the private key password at the same time + - (nm_setting_802_1x_get_private_key_type, + nm_setting_802_1x_get_phase2_private_key_type): return the private + key type + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - Whitelist private key passwords + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_8021x): for pkcs#12 private keys, + add the private key password to the supplicant config, but do not + add the client certificate (as required by wpa_supplicant) + +2008-11-12 Tambet Ingo + + * system-settings/plugins/keyfile/nm-keyfile-connection.c (copy_one_secret) + (add_secrets): Don't add empty secrets to the secrets hash table. + +2008-11-07 Dan Williams + + * libnm-util/nm-setting-wireless.c + - (nm_setting_wireless_get_seen_bssid): fix bug from accessor conversion + that cased this function to return garbage, breaking hidden AP + detection + +2008-11-07 Dan Williams + + Fix deletion of VPN gateway route on DHCP renew (bgo #558133) + + * src/NetworkManagerSystem.c + src/NetworkManagerSystem.h + - (nm_system_device_set_ip4_route): return the route that was added + - (nm_system_add_ip4_vpn_gateway_route): make add_vpn_gateway_route() + public, clean up, and return the route that was added + - (nm_system_apply_ip4_config): remove VPN related stuff to simplify, + since nm_system_add_ip4_vpn_gateway_route() is now available; add + flags to allow only certain attributes of the NMIP4Config to be + applied + + * src/nm-device.c + - (handle_dhcp_lease_change): don't touch the DHCP4 config on failure + - (nm_device_set_ip4_config): use nm_ip4_config_diff() to only apply + what's really changed between the old and new configs; don't export + the new IP4 config on failure; always send the DNS info to the + named manager + + * src/vpn-manager/nm-vpn-connection.c + - (device_ip4_config_changed, nm_vpn_connection_new, dispose): track the + parent device's IP4Config and re-add the VPN gateway route when it + changes + - (nm_vpn_connection_ip4_config_get): add the VPN gateway route (since + nm_system_apply_ip4_config() no longer does) and cache it for later + - (connection_state_changed): move cleanup code to its own function + - (vpn_cleanup): delete any previously added VPN gateway route; and + re-apply the parent device's addresses and routes using + nm_system_apply_ip4_config(), not nm_device_set_ip4_config() + +2008-11-07 Dan Williams + + * src/nm-ip4-config.c + src/nm-ip4-config.h + - (nm_ip4_config_diff): new function; return the difference between two + IP4 configs + - (nm_ip4_config_compare): change into nm_ip4_config_diff + +2008-11-05 Dan Williams + + * nm-ip4-config.c + nm-ip4-config.h + - (nm_ip4_config_compare): compare two IP4 configs + +2008-11-05 Dan Williams + + * src/NetworkManagerPolicy.c + - (update_etc_hosts): only add newline if not the last line of the file + (Jonathan Miner) + +2008-11-05 Dan Williams + + * src/dhcp-manager/nm-dhcp-dhclient.c + - (get_leasefile_for_iface): move lease files back to where dhclient + puts them + +2008-11-05 Michael Biebl + + * initscripts/Debian/NetworkManager + - Update to what Debian is actually using + +2008-11-05 Tambet Ingo + + * libnm-util/nm-setting-8021x.c: Verify PEAP settings as well. + +2008-11-03 Dan Williams + + * system-settings/src/main.c + - (add_default_dhcp_connection): make the fallback connection read-only + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - Add detailed errors + - (impl_exported_connection_update, impl_exported_connection_delete): + return an error if the connection is read-only + + * system-settings/plugins/ifupdown/nm-ifupdown-connection.c + system-settings/plugins/keyfile/nm-keyfile-connection.c + system-settings/src/main.c + - Use more detailed errors + + * system-settings/src/nm-system-config-error.c + system-settings/src/nm-system-config-error.h + system-settings/src/dbus-settings.c + - Remove NM_SYSCONFIG_SETTINGS_ERROR_INVALID_CONNECTION, replaced by + NM_SETTINGS_ERROR_INVALID_CONNECTION + +2008-11-02 Dan Williams + + * Add license headers to everything in src/ + +2008-11-02 Dan Williams + + * Tag 0.7.0-rc1 + +2008-11-02 Dan Williams + + * src/NetworkManagerAP.c + - (nm_ap_new_fake_from_connection): treat only lack of a wireless security + setting as unencrypted; fixes a bug where NM wouldn't ask for new + secrets when connecting to an encrypted network failed + +2008-10-30 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-ip6-config.c + libnm-util/nm-setting-ip6-config.h + libnm-util/Makefile.am + - Make properties private and add accessor functions + - Hide IPv6 stuff from public API, it's incomplete and completely unused + + * libnm-util/nm-connection.c + libnm-util/nm-utils.c + libnm-util/nm-utils.h + - Ignore IPv6 stuff for now + +2008-10-30 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-8021x.c + libnm-util/nm-setting-8021x.h + - Make properties private and add accessor functions + + * src/supplicant-manager/nm-supplicant-config.c + system-settings/plugins/ifcfg-suse/parser.c + - Use 802.1x setting accessors + +2008-10-30 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-wireless-security.c + libnm-util/nm-setting-wireless-security.h + - Make properties private and add accessor functions + + * libnm-util/nm-setting-wireless.c + src/NetworkManagerAP.c + src/nm-device-wifi.c + src/supplicant-manager/nm-supplicant-config.c + system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-suse/parser.c + - Use wireless security accessors + +2008-10-30 Dan Williams + + * src/nm-device-ethernet.c + src/nm-device-wifi.c + src/nm-device.c + src/ppp-manager/nm-ppp-manager.c + - Harmonize return checking of ioctl + + * system-settings/plugins/ifcfg-fedora/reader.c + - (is_wireless_device): fall back to SIOCGIWNAME (rh #466340) + +2008-10-30 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (nm_ppp_manager_start): if /dev/ppp doesn't exist, load the + ppp_generic module to create it (bgo #533064) + +2008-10-30 Dan Williams + + Patch from Alexander Sack + + Fix "ppp connections don't honour ip4 connection settings" + + * src/nm-device-ethernet.c + - (real_act_stage4_get_ip4_config): merge ip4config settings + with results from ppp manager + + * src/nm-serial-device.c + - (real_act_stage4_get_ip4_config): merge ip4config settings + with results from ppp manager + +2008-10-29 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - Make properties private and add accessor functions + + * callouts/nm-dispatcher-action.c + libnm-glib/libnm-glib-test.c + libnm-util/nm-utils.c + src/NetworkManagerPolicy.c + src/NetworkManagerSystem.c + src/NetworkManagerUtils.c + src/dhcp-manager/nm-dhcp-dhclient.c + src/dhcp-manager/nm-dhcp-manager.c + src/dnsmasq-manager/nm-dnsmasq-manager.c + src/nm-device-wifi.c + src/nm-device.c + src/nm-hso-gsm-device.c + src/nm-ip4-config.c + src/nm-ip4-config.h + src/ppp-manager/nm-ppp-manager.c + src/vpn-manager/nm-vpn-connection.c + system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-suse/parser.c + system-settings/plugins/ifcfg-suse/plugin.c + system-settings/plugins/ifupdown/parser.c + test/nm-tool.c + vpn-daemons/vpnc/properties/nm-vpnc.c + - Use IP4 accessor functions + +2008-10-29 Tambet Ingo + + Half of it by Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-vpn.c + libnm-util/nm-setting-vpn.h + - Make properties private and add accessor functions. + + * src/vpn-manager/nm-vpn-connection.c + src/vpn-manager/nm-vpn-manager.c + system-settings/plugins/keyfile/reader.c + vpn-daemons/openvpn/properties/auth-helpers.c + vpn-daemons/openvpn/properties/import-export.c + vpn-daemons/openvpn/properties/nm-openvpn.c + vpn-daemons/openvpn/src/nm-openvpn-service.c + vpn-daemons/pptp/auth-dialog/main.c + vpn-daemons/pptp/properties/advanced-dialog.c + vpn-daemons/pptp/properties/nm-pptp.c + vpn-daemons/pptp/src/nm-pptp-service.c + vpn-daemons/vpnc/properties/nm-vpnc.c + vpn-daemons/vpnc/src/nm-vpnc-service.c + - Use VPN setting accessors. + +2008-10-28 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-wireless.c + libnm-util/nm-setting-wireless.h + - Make properties private and add accessor functions + + * src/NetworkManagerAP.c + src/nm-device-wifi.c + src/nm-manager.c + src/supplicant-manager/nm-supplicant-config.c + system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c + system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-suse/parser.c + system-settings/plugins/ifupdown/parser.c + - Use wireless setting accessors + +2008-10-27 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-ppp.c + libnm-util/nm-setting-ppp.h + - Make properties private and add accessor functions + + * src/ppp-manager/nm-ppp-manager.c + - Use ppp setting accessors + +2008-10-27 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/nm-setting.h + libnm-util/nm-setting.c + - Make properties private and add accessor functions + + * libnm-util/nm-connection.c + libnm-util/nm-setting-8021x.c + libnm-util/nm-setting-cdma.c + libnm-util/nm-setting-connection.c + libnm-util/nm-setting-gsm.c + libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip6-config.c + libnm-util/nm-setting-ppp.c + libnm-util/nm-setting-pppoe.c + libnm-util/nm-setting-serial.c + libnm-util/nm-setting-template.c + libnm-util/nm-setting-vpn.c + libnm-util/nm-setting-wired.c + libnm-util/nm-setting-wireless-security.c + libnm-util/nm-setting-wireless.c + system-settings/plugins/keyfile/reader.c + system-settings/plugins/keyfile/writer.c + - Use setting accessors + +2008-10-27 Dan Williams + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-connection.c + libnm-util/nm-setting-connection.h + - Add a 'read-only' property that indicates the connection cannot be + modified + + * system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-suse/parser.c + system-settings/plugins/ifupdown/parser.c + - These plugins are read-only at the moment + + * system-settings/plugins/keyfile/reader.c + system-settings/plugins/keyfile/writer.c + - Read-only shouldn't get saved out to files or read in from them + +2008-10-27 Tambet Ingo + + * src/nm-device-ethernet.c (nm_device_ethernet_get_speed): Implement + correct speed reporting for fast devices (kernel >= 2.6.27). + +2008-10-26 Dan Williams + + Attempt to compensate for modems that don't enable full AT parsing before + the PIN has been entered. + + * src/nm-gsm-device.c + - (init_modem): accept different init strings + - (init_done): try different init strings on failure + - (check_pin_done): on PIN success, do full modem init + +2008-10-26 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-connection.c + libnm-util/nm-setting-connection.h + - Make properties private and add accessor functions + + * src/NetworkManagerPolicy.c + src/nm-cdma-device.c + src/nm-device-ethernet.c + src/nm-device-interface.c + src/nm-device-wifi.c + src/nm-gsm-device.c + src/nm-manager.c + src/ppp-manager/nm-ppp-manager.c + src/vpn-manager/nm-vpn-connection.c + system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c + system-settings/plugins/ifcfg-fedora/plugin.c + system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-suse/parser.c + system-settings/plugins/ifupdown/parser.c + system-settings/plugins/keyfile/nm-keyfile-connection.c + system-settings/plugins/keyfile/plugin.c + system-settings/plugins/keyfile/writer.c + system-settings/src/main.c + - Use those accessors + +2008-10-26 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-gsm.c + libnm-util/nm-setting-gsm.h + - Make properties private and add accessor functions + + * src/nm-gsm-device.c + src/nm-hso-gsm-device.c + src/ppp-manager/nm-ppp-manager.c + - Use those accessors + +2008-10-26 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-cdma.c + libnm-util/nm-setting-cdma.h + - Make properties private and add accessor functions + + * src/nm-cdma-device.c + src/ppp-manager/nm-ppp-manager.c + - Use those accessors + +2008-10-26 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-pppoe.c + libnm-util/nm-setting-pppoe.h + - Make properties private and add accessor functions + + * src/nm-device-ethernet.c + src/ppp-manager/nm-ppp-manager.c + - Use those accessors + +2008-10-26 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-wired.c + libnm-util/nm-setting-wired.h + - Make properties private and add accessor functions + + * src/nm-device-ethernet.c + system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c + system-settings/plugins/ifcfg-suse/parser.c + system-settings/src/main.c + - Use those accessors + +2008-10-26 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/libnm-util.ver + libnm-util/nm-setting-serial.c + libnm-util/nm-setting-serial.h + src/nm-serial-device.c + - Make properties private and use accessors instead + +2008-10-26 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + src/supplicant-manager/nm-supplicant-interface.h + src/supplicant-manager/nm-supplicant-manager.c + src/supplicant-manager/nm-supplicant-manager.h + - Add state-to-string conversion functions + + * src/nm-device-wifi.c + src/nm-device-ethernet.c + - Normalize state info logging and use strings instead of numbers + +2008-10-26 Dan Williams + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): ignore host routes when determining whether + a VPN connection should own the default route (bgo #552594) + +2008-10-24 Dan Williams + + * src/nm-gsm-device.c + - (set_apn): remove erroneous spaces in AT+CGDCONT command (Jerone Young) + +2008-10-23 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (create_pppd_cmd_line): pppd always parses /etc/ppp/options, so always + add really important stuff to the command line to ensure that NM + overrides /etc/ppp/options (bgo #556781) + +2008-10-22 Dan Williams + + * src/NetworkManagerSystem.c + src/nm-device.c + - Use the device's IP interface where appropriate (Per Hallsmark) + +2008-10-22 Dan Williams + + * src/nm-gsm-device.c + - (schedule_automatic_registration_again): use a short timeout here + instead of an idle handler to avoid using too much CPU polling for + something we should be waiting a bit for anyway + +2008-10-22 Dan Williams + + * include/NetworkManager.h + introspection/nm-device.xml + - Add device state change reason for carrier changes + + * src/nm-device-ethernet.c + - (set_carrier): use the carrier change reason when changing device + state in response to carrier changes + +2008-10-21 Dan Williams + + * src/NetworkManagerPolicy.c + - (update_etc_hosts): don't leak errors, and ensure that + g_file_set_contents() gets a valid error placeholder (rh #461933) + +2008-10-21 Dan Williams + + * src/nm-manager.c + - (free_get_settings_info): don't use the DBusGProxy which could be + disposed of by the time the function is called + - (internal_new_connection_cb): save connection scope + - (connection_get_settings_cb): don't replace a connection unless it's + actually different from the existing one; fixes an issue where + killing the settings service wouldn't deactivate an active connection + provided by that settings service, because it was using a connection + that had already been replaced in the system or user hash + +2008-10-21 Dan Williams + + * src/NetworkManager.c + - (main): keep the DHCP manager around since it's a singleton; fixes + a use-after-free exposed by r4196 since the DHCP manager singleton + variable isn't cleared when the DHCP manager object is finalized + +2008-10-20 Dan Williams + + * libnm-util/nm-setting-wireless-security.c + - (verify): accept 'none' as a pairwise cipher with Ad-Hoc WPA connections + +2008-10-20 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (ADD_STRING_LIST_VAL): don't add empty values to the supplicant config + +2008-10-20 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_get): fix mismatched refcount; creating the dhcp + manager object already refs it once + - (nm_dhcp_manager_cancel_transaction_real): clear freed variables that + also get cleaned up by nm_dhcp_device_destroy() to prevent + double-frees + +2008-10-20 Dan Williams + + * src/nm-manager.c + - (initial_get_connections): use private dbus manager, don't keep + ref-ing the singleton. Fixes mismatched refcounts of the dbus + manager object. + +2008-10-18 Dan Williams + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - Rename the "get_secrets" virtual function "service_get_secrets" to + clarify when it's used; NMExportedConnetion is a base-class for both + the client and service side, which is sort of confusing, and + get_secrets only makes sense on the service side. + + * libnm-glib/nm-dbus-connection.c + - (get_secrets): remove, unused, and clients need to do extra work to + get secrets anyway since the call can block on the remote side + + * system-settings/plugins/ifupdown/nm-ifupdown-connection.c + system-settings/plugins/keyfile/nm-keyfile-connection.c + - Fix up for get_secrets -> service_get_secrets + +2008-10-16 Dan Williams + + * src/nm-device-wifi.c + - (constructor): correctly determine encryption capabilities + +2008-10-15 Dan Williams + + * src/nm-device-wifi.c + - (wireless_qual_to_percent): fix quality calculation in a fallback case + (Johannes Berg) + +2008-10-15 Dan Williams + + * src/NetworkManagerSystem.c + - (ip4_dest_in_same_subnet): tighter checks on subnet matching, + if the ip4_dest is in a smaller subnet contained within a subnet + the machine is currently on, the destination is in the same subnet + - (nm_system_device_set_ip4_route): move subnet checks to callers + - (add_vpn_gateway_route): check if the VPN gateway is in the same + subnet as the parent device, and if so, don't add the direct + host route via the parent device's gateway (bgo #481620) + - (nm_system_apply_ip4_config): check whether the route to be added + is contained within a subnet the device is already on + +2008-10-11 Dan Williams + + * include/NetworkManager.h + introspection/nm-device.xml + include/NetworkManagerVPN.h + - Add a few more state reasons for the device deactivated state + + * src/nm-device-interface.c + src/nm-device-interface.h + - (nm_device_interface_deactivate): add a 'reason' argument + + * src/nm-device.c + src/nm-device.h + - (nm_device_deactivate, nm_device_take_down): add a 'reason' argument + - (nm_device_state_changed): pass the state change reason to + nm_device_take_down() + - (nm_device_set_managed): take a 'reason' argument, and pass it along + to the state change function + + * src/nm-manager.c + src/nm-manager.h + - (remove_one_device, handle_unmanaged_devices, sync_devices, + impl_manager_sleep): pass a reason code to nm_device_set_managed() + - (nm_manager_deactivate_connection): add a 'reason' argument and pass + something reasonable along to VPN deactivation + + * src/vpn-manager/nm-vpn-manager.c + src/vpn-manager/nm-vpn-manager.h + - (nm_vpn_manager_deactivate_connection): add a 'reason' argument and + pass that along to nm_vpn_connection_disconnect() + +2008-10-11 Dan Williams + + * src/nm-device-wifi.c + - (can_scan): remove old madwifi hack for not scanning while connected + +2008-10-11 Dan Williams + + Add support for VPN subnet gateways (bgo #549196) + + * include/NetworkManager.h + - Add key for internal VPN subnet gateway + + * src/vpn-manager/nm-vpn-connection.c + - (ip_address_to_string): return a const from a static buffer so we + don't leak a lot of strings + - (print_vpn_config): print internal VPN gateway as well + - (nm_vpn_connection_ip4_config_get): grab internal VPN gateway from + VPN service too + - (nm_vpn_connection_get_ip4_internal_gateway): new function + + * src/NetworkManagerSystem.c + src/NetworkManagerSystem.h + - (nm_system_device_replace_default_ip4_route): split into two, one for + VPN connections and one for normal devices + - (replace_default_ip4_route): break out route stuff into its own function + - (nm_system_replace_default_ip4_route_vpn, + nm_system_replace_default_ip4_route): simplify by having two cases, + one for VPNs and one for normal devices + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): simplify, use split default route replacement + functions + +2008-10-10 Dan Williams + + Rework default route handling to consolidate decisions in the policy, + and to take active VPN connections into account when changing the default + route (bgo #545912) + + * src/NetworkManager.c + - (main): pass the vpn_manager to the policy so it knows about active + VPN connections; clean up the named manager which wasn't done before + + * src/NetworkManagerPolicy.c + src/NetworkManagerPolicy.h + - (nm_policy_new): get a clue about the vpn_manager + - (update_default_route): remove, fold into update_routing_and_dns() + - (update_routing_and_dns): handle active VPN connections too; an + active VPN connection becomes the default route if it does not have + server-specified or user-specified custom routes. Otherwise, the + best active device gets the default route + - (vpn_connection_activated, vpn_connection_deactivated, nm_policy_new, + nm_policy_destroy): track VPN connection activation and deactivation + and update the default route when appropriate + + * src/NetworkManagerSystem.c + src/NetworkManagerSystem.h + - (nm_system_vpn_device_unset_from_ip4_config): remove, put functionality + in the VPN connection itself + - (nm_system_vpn_device_set_from_ip4_config, + nm_system_device_set_from_ip4_config): merge together to make + nm_system_apply_ip4_config() + - (add_vpn_gateway_route): add a route to the VPN's external gateway + via the parent device + - (nm_system_apply_ip4_config): simplify + - (add_ip4_route_to_gateway): new function; add a direct route to the + gateway if needed + - (nm_system_device_replace_default_ip4_route): simplify, break gateway + route stuff out into add_ip4_route_to_gateway() for clarity + + * src/nm-device.c + - (nm_device_set_ip4_config): update for nm_system_apply_ip4_config() + + * src/vpn-manager/nm-vpn-connection.c + src/vpn-manager/nm-vpn-connection.h + - (nm_vpn_connection_get_ip4_config, nm_vpn_connection_get_ip_iface, + nm_vpn_connection_get_parent_device): add + - (nm_vpn_connection_ip4_config_get): make the requirement of a tunnel + device explicit + - (connection_state_changed): update the named manager now that + nm_system_vpn_device_unset_from_ip4_config() is gone; do something + useful on errors + + * src/vpn-manager/nm-vpn-manager.c + src/vpn-manager/nm-vpn-manager.h + - Add a 'connection-activated' signal + - (nm_vpn_manager_get_active_connections): new function; mainly for the + policy to find out about active VPN connections + +2008-10-10 Tambet Ingo + + * src/nm-logging.c (nm_logging_setup): Don't use LOG_CONS when running as + a daemon to prevent NM logging spew on console on startup and shutdown (due + to dependency loop between NM and syslog). + +2008-10-10 Alexander Sack + + Implement managed mode. We bind devices configured in /etc/network/interfaces + to their connections by updating wired/wireless setting with the + mac address of the device. + + * system-settings/plugins/ifupdown/plugin.c + - (get_net_address_for_udi): implement function to retrieve MAC + address of udi from hal in GByteArray format + - (bind_device_to_connection): bind mac address of device to + wired/wireless system connection + - (hal_device_added_cb): call bind_device_to_connection for + system connections with a matching interface.name + - (hal_device_added_cb): ensure that all code paths + properly free the "iface" string. + +2008-10-10 Alexander Sack + + Parse nm-system-settings.conf and allow admins to either use managed and unmanaged + mode of the ifupdown system config plugin. + + * system-settings/plugins/ifupdown/plugin.c + - (SCPluginIfupdown_init): parse nm-system-settings.conf keyfile and set + private unmanage_well_known state field accordingly + +2008-10-10 Alexander Sack + + Implement unmanaged mode that will prevent all devices in the + well_known_udis set from being touched by NetworkManager + + * system-settings/plugins/ifupdown/plugin.c + - (typedef struct SCPluginIfupdownPrivate): add gboolean + unmanage_well_known field used to turn on/off unmanaged + mode + - (hal_device_added_cb,hal_device_remove_cb): emit |unmanaged-devices-changed| + signal when well_known_udis get added/removed + - (SCPluginIfupdown_get_unmanaged_devices): return all well_known_udis + if we are in unmanaged mode + +2008-10-10 Alexander Sack + + Add support to track network devices that have a configuration + with a matching interface.name in /etc/network/interfaces + + * system-settings/plugins/ifupdown/plugin.c + - (typedef struct SCPluginIfupdownPrivate): add hash table + to track |well_known_udis| + - (get_iface_for_udi): helper function to get interface.name + for a udi + - (hal_device_added_cb, hal_device_removed_cb): callbacks + that add and remove devices to and from the well_known_udis + set depending on whether their |interface.name| matches + any interface definition in /etc/network/interfaces + - (SCPluginIfupdown_init): connect callbacks from above with + hal_mgr and setup well_known_udis hashtable + - (GObject__dispose): destroy well_known_udis hashtable + - (hal_device_added_cb2): implement wrapper callback with GFunc + signature. user_data is supposed to be a triple (hal_mgr, + config and devtype) + - (SCPluginIfupdown_init): bootstrap wired and wifi devices for + startup and call hal_device_added_cb2 + +2008-10-10 Alexander Sack + + Remove implementation for not used NMSystemConfigInterface callback functions + in ifupdown plugin + + * system-settings/plugins/ifupdown/plugin.c + - (SCPluginIfupdown_unmanaged_devices_changed): removed + - (SCPluginIfupdown_connection_added): removed + +2008-10-08 Dan Williams + + Add a 'hostname' dispatcher action triggered on hostname changes (bgo #552983) + + * src/NetworkManagerUtils.c + - (nm_utils_call_dispatcher): add a 'hostname' action + + * src/NetworkManagerPolicy.c + - (set_system_hostname): dispatch hostname changes + + * callouts/nm-dispatcher-action.c + - (nm_dispatcher_action): handle 'hostname' actions + +2008-10-08 Dan Williams + + * src/NetworkManagerSystem.c + - (find_route): ref the route so it doesn't get destroyed when the cache + is cleared + - (nm_system_device_set_priority): unref the route here after it's done + being used + +2008-10-08 Dan Williams + + * src/nm-serial-device.c + - Turn on serial debugging when NM_SERIAL_DEBUG is set in the environment + +2008-10-08 Tambet Ingo + + * system-settings/plugins/keyfile/nm-keyfile-connection.c (update): Update the + connection with new settings before saving it. + +2008-10-06 Dan Williams + + * src/nm-ip4-config.c + src/nm-ip4-config.h + - nm_ip4_config_is_exported -> nm_ip4_config_get_dbus_path + + * src/nm-device-interface.c + - (nm_device_interface_init): make 'ip4-config' a boxed property of type + DBUS_TYPE_G_OBJECT_PATH so that we can make it NULL when we need to + by using '/' for the object path + + * src/nm-device.c + - (src/nm-device.c): marshal missing/unexported ip4-config through + dbus as '/' since dbus-glib can't handle NULL objects nor can + dbus handle NULL object paths + +2008-10-03 Alexander Sack + + Implement system hostname support for debian/ubuntu + + * system-settings/plugins/ifupdown/plugin.c + - (GObject__get_property): extend announced capabilities; add + NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME support + - (GObject__set_property,write_system_hostname): implement + NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME capability. + - (GObject__set_property, GObject__get_property, SCPluginIfupdown_init, + update_system_hostname, get_hostname): + implement hostname property that watches and + parses /etc/hostname + +2008-10-03 Alexander Sack + + * system-settings/plugins/ifcfg-fedora/nm-inotify-helper.c + system-settings/plugins/ifcfg-fedora/nm-inotify-helper.h + system-settings/plugins/ifcfg-fedora/Makefile.am + system-settings/src/nm-inotify-helper.c + system-settings/src/nm-inotify-helper.h + src/Makefile.am + - Move ifcfg-fedora inotify helpers to the system settings service so + they are available to all plugins + +2008-10-03 Alexander Sack + + Implement support for wep-tx-keyidx in ifupdown system + config plugin. + + * system-settings/plugins/ifupdown/parser.c + - (update_wireless_security_setting_from_if_block): introduce + free_type_mapping func table; rename a few local + variables to improve readability; add wpa security mapping + for wep-tx-keyidx property + - (string_to_gpointerint): new function used for the auto_type_mapping + of new wep-tx-keyidx property + - (slist_free_all): free func used for mapped slist types + +2008-10-03 Alexander Sack + + * system-settings/src/main.c: + - (add_default_dhcp_connection, device_removed_cb): ensure the UDI is + always used as the hash key; fixes a crash when removing wired + devices + +2008-10-02 Dan Williams + + * src/nm-gsm-device.c + - (enter_pin_done, enter_pin, check_pin_done, real_act_stage1_prepare): + pass the required GSM secret along via user_data rather than keeping + it around in the private data where it sometimes didn't get cleared + - (real_get_ppp_name): implement using the GSM username + +2008-10-02 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + src/ppp-manager/nm-ppp-manager.h + - (impl_ppp_manager_need_secrets): tries secrets twice before asking + the settings daemon for completely new ones + - (create_pppd_cmd_line): new parameter 'ppp_name' used to set the + local PPP peer name; allow PPP debuging by launching NM with + the environment variable NM_PPP_DEBUG defined + - (nm_ppp_manager_start): new parameter 'ppp_name' passed to + create_pppd_cmd_line() + + * src/nm-serial-device.c + src/nm-serial-device.h + - New 'get_ppp_name' function for subclasses to implement to return the + local PPP peer name + - (real_act_stage2_config): call 'get_ppp_name' function of subclasses + and pass that name to the PPP manager + + * src/nm-device-ethernet.c + - (pppoe_stage2_config): pass the PPPoE username to the PPP manager as + the local peer name + + * src/nm-cdma-device.c + - (real_get_ppp_name): implement using the CDMA username + +2008-10-02 Dan Williams + + Patch from Alexander Sack + + * system-settings/plugins/ifupdown/parser.c + - Implement more graceful ip4 config parsing for cases where + /etc/network/interfaces omits basic ip4 settings, such as gateway etc + by using default values + +2008-10-02 Dan Williams + + * src/NetworkManagerPolicy.c + - (device_state_changed): when marking a connection invalid, clear its + secrets too so that fresh secrets get requested the next time + +2008-10-01 Dan Williams + + * system-settings/src/dbus-settings.c + - (nm_sysconfig_settings_init): cache system hostname on startup as + a fallback if no plugin provides a hostname + - (get_property): fall back to cached hostname if no plugin provides + a hostname + +2008-10-01 Dan Williams + + Fix setting value comparison issue that caused some settings to look the + same when they were really different (rh #464417) + + * libnm-util/nm-param-spec-specialized.c + - (type_is_fixed_size): return fundamental size of the fixed type too + - (nm_gvalues_compare_collection): use the fundamental fixed type size + in the comparison so that the _entire_ fixed type collection gets + compared rather than just the first 'len1' bytes + +2008-09-30 Dan Williams + + * src/NetworkManagerPolicy.c + - (lookup_thread_worker): don't store the idle handler ID becuase the + idle handler could have already run and freed the LookupThread + structure + +2008-09-30 Tambet Ingo + + * src/nm-device.c (nm_device_get_priority): Implement. + (nm_device_set_ip4_config): Send the device priority to system ip4 + config setter. + + * src/NetworkManagerSystem.c (nm_system_device_set_from_ip4_config): + Add priority argument and if it's >= 0, set the priority of the network + route added automatically by netlink (or kernel?). + (nm_system_device_set_priority): Implement. + + * src/NetworkManagerPolicy.c (get_best_device): Use + nm_device_get_priority() instead of home-grown version. Revert the + meaning, best priority is the lowest one. + +2008-09-29 Dan Williams + + Handle ipw3945 suspend/resume by retrying the GIWRANGE request a few times + when it returns EAGAIN (rh #362421) + + * src/nm-device-wifi.c + - (wireless_get_range): try GIWRANGE a few times until the card responds + - (real_get_generic_capabilities, constructor): use wireless_get_range() + +2008-09-28 Dan Williams + + * src/nm-serial-device.c + src/nm-serial-device.h + - (nm_serial_device_close): stop PPP manager here so that PPP gets + cleaned at the right times when subclasses close the serial port too + - (nm_serial_device_send_command): use a default send delay; don't + spin forever on EAGAIN + - (get_reply_done, get_reply_got_data, nm_serial_device_get_reply): + remove, no longer used + - (find_response): return the matched response if any + - (nm_serial_device_wait_reply_blocking): wait for a reply but block + while doing so + - (wait_for_reply_done): pass the matched response to the callback + - (wait_for_reply_got_data): save the matched response; simplify timeout + handling + - (nm_serial_device_wait_for_reply): make 'responses' and 'terminators' + const since they never get modified + - (cleanup_device): split out common cleanup stuff to a new function + - (real_deactivate_quickly, finalize): use cleanup_device() + + * src/nm-gsm-device.c + - (modem_get_reply): remove, unused + - (set_apn): give the card a bit more time to respond + - (manual_registration_again, schedule_manual_registration_again, + manual_registration_response, manual_registration): handle manual + registration timeouts better by retrying registration a few times + because cards are a bit slow after CFUN=1 + - (automatic_registration_get_network, get_network_response): use + modem_wait_for_reply() because it interacts better with the serial + buffer and does more intelligent matching; need to wait for 'OK' + rather than just matching terminators + - (schedule_automatic_registration_again, + automatic_registration_response, automatic_registration): retry + registration a few times on timeout or "searching" because cards + take a bit to find a network after being powered up with CFUN=1 + - (power_up_response, power_up, init_full_done, enter_pin, + check_pin_done): power up the card with CFUN=1 before trying to + register with the network + - (init_modem_full, init_modem): use more standard 3G init strings + + * src/nm-hso-gsm-device.c + - (modem_get_reply): remove, unused + - (hso_ip4_config_response, real_act_stage3_ip_config_start): use + modem_wait_for_reply() to match actual responses instead of single + termination characters; it doesn't leave stuff in the serial buffer + that might confuse later calls + - (real_deactivate_quickly): use nm_serial_device_wait_reply_blocking() + to ensure that the call is really disconnected and not leave extra + stuff in the serial buffer + + * src/nm-cdma-device.c + - (power_up_response, power_up, init_done): try Sierra-style modem + power up before attempting to connect + +2008-09-27 Dan Williams + + * libnm-util/nm-setting-gsm.c + - (verify): verify GSM network ID + +2008-09-25 Dan Williams + + * libnm-util/nm-setting-gsm.c + libnm-util/nm-setting-gsm.h + - Fix up NM_GSM_NETWORK_* constants to accurately reflect the network + technology terms (bgo #551361) + +2008-09-25 Dan Williams + + Fix bgo #549401 (inspired by patch from Alexander Sack) + + * src/nm-device-ethernet.c + - (finish_supplicant_task): clean up scheduled tasks and free memory + - (remove_supplicant_interface_error_handler): remove the supplicant + error idle callback too + - (supplicant_interface_release): rename from supplicant_interface_clean + to match nm-device-wifi.c; clean up supplicant interface-related + state tasks when the supplicant interface is disposed of + - (schedule_state_handler): add scheduled tasks to a list so they can + be cleaned up later + - (supplicant_mgr_state_cb_handler, supplicant_iface_state_cb_handler, + supplicant_iface_connection_state_cb_handler): use + finish_supplicant_task() to clean up each completed task + - (supplicant_iface_connection_error_cb_handler, + supplicant_connection_timeout_cb): clear source id when the task is + complete + - (supplicant_iface_connection_error_cb): save scheduled task id for + later cleanup + - (nm_device_ethernet_dispose): clean up any pending supplicant state + tasks + + * src/nm-device-wifi.c + - (finish_supplicant_task): clean up scheduled tasks and free memory + - (remove_supplicant_interface_error_handler): remove the supplicant + error idle callback too + - (supplicant_interface_release): clean up supplicant interface-related + state tasks when the supplicant interface is disposed of + - (schedule_state_handler): add scheduled tasks to a list so they can + be cleaned up later + - (supplicant_mgr_state_cb_handler, supplicant_iface_state_cb_handler, + supplicant_iface_connection_state_cb_handler): use + finish_supplicant_task() to clean up each completed task + - (supplicant_iface_connection_error_cb_handler): clear source id when + the task is complete + - (supplicant_iface_connection_error_cb): save scheduled task id for + later cleanup + - (nm_device_wifi_dispose): clean up any pending supplicant state tasks + +2008-09-24 Tambet Ingo + + * system-settings/plugins/keyfile/plugin.c: Implement unmanaged_devices + method and get/set hostname property. + +2008-09-24 Tambet Ingo + + * src/supplicant-manager/nm-supplicant-interface.c + (nm_supplicant_interface_disconnect): Don't increment the reference + count when disconnecting. The problem is on shutdown, when the replies + to these commands do not arrive before NM exits, resulting on never + calling supplicant interface's dispose(), which removes the interface + from supplicant. + +2008-09-24 Tambet Ingo + + * libnm-glib/nm-vpn-plugin-ui-interface.c: Add type checking to + all the public function arguments. + +2008-09-22 Tambet Ingo + + * src/vpn-manager/nm-vpn-connection.c: Add a signal handler for the + "Failure" signal from VPN plugins, store the failure reason, and + use it when the state is changed to failure. + + * introspection/nm-vpn-plugin.xml: Fix the "Failure" signal's type + description. + + * include/NetworkManagerVPN.h (NMVPNConnectionStateReason): Add a new + reason to the end of the list to not break the API. + (NMVPNPluginFailure): Move it here (from libnm-glib/nm-vpn-plugin.h) + so it can be shared by plugins and daemon. + +2008-09-18 Dan Williams + + Patch from Alexander Sack + + * configure.in + system-settings/plugins/Makefile.am + system-settings/plugins/ifupdown/Makefile.am + system-settings/plugins/ifupdown/interface_parser.c + system-settings/plugins/ifupdown/interface_parser.h + system-settings/plugins/ifupdown/nm-ifupdown-connection.c + system-settings/plugins/ifupdown/nm-ifupdown-connection.h + system-settings/plugins/ifupdown/parser.c + system-settings/plugins/ifupdown/parser.h + system-settings/plugins/ifupdown/plugin.c + system-settings/plugins/ifupdown/plugin.h + - Implement a Debian/Ubuntu legacy network configuration plugin + (gnome.org #551941) + +2008-09-18 Dan Williams + + Implement support for honoring configured and automatic hostnames, and for + setting the configured hostname. + + * introspection/nm-ip4-config.xml + src/nm-ip4-config.c + src/nm-ip4-config.h + src/dhcp-manager/nm-dhcp-manager.c + - Remove useless hostname property; it's not really part of the IPv4 + config + + * introspection/nm-settings-system.xml + libnm-glib/nm-dbus-settings-system.c + libnm-glib/nm-dbus-settings-system.h + - Add SetHostname() call to system settings D-Bus interface + - Add Hostname property to system settings D-Bus interface + - (nm_dbus_settings_system_save_hostname, + nm_dbus_settings_system_get_hostname): implement + + * src/nm-device.c + src/nm-device.h + - (nm_device_get_dhcp4_config): implement + + * src/nm-manager.c + src/nm-manager.h + - Fetch and track system settings service hostname changes, and proxy + the changes via a GObject property of the manager + + * system-settings/src/nm-system-config-interface.c + system-settings/src/nm-system-config-interface.h + - Replace nm_system_config_interface_supports_add() with a capabilities + bitfield + + * system-settings/src/nm-system-config-error.c + system-settings/src/nm-system-config-error.h + - Add additional errors + + * system-settings/src/dbus-settings.c + system-settings/src/dbus-settings.h + - (get_property, nm_sysconfig_settings_class_init): add hostname + property; first plugin returning a hostname wins + - (impl_settings_add_connection): use plugin capabilities instead of + nm_system_config_interface_supports_add() + - (impl_settings_save_hostname): implement hostname saving + + * src/NetworkManagerPolicy.c + - (lookup_thread_run_cb, lookup_thread_worker, lookup_thread_new, + lookup_thread_die): implement an asynchronous hostname lookup thread + which given an IPv4 address tries to look up the hostname for that + address with reverse DNS + - (get_best_device): split out best device code from + update_routing_and_dns() + - (update_etc_hosts): update /etc/hosts with the machine's new hostname + to preserve the 127.0.0.1 reverse mapping that so many things require + - (set_system_hostname): set a given hostname + - (update_system_hostname): implement hostname policy; a configured + hostname (from the system settings service) is used if available, + otherwise an automatically determined hostname from DHCP, VPN, etc. + If there was no automatically determined hostname, reverse DNS of + the best device's IP address will be used, and as a last resort the + hostname 'localhost.localdomain' is set. + - (update_routing_and_dns): use get_best_device(); update the system + hostname when the network config changes + - (hostname_changed): update system hostname if the system settings + service signals a hostname change + - (nm_policy_new): list for system settings service hostname changes + - (nm_policy_destroy): ensure that an in-progress hostname lookup thread + gets told to die + + * system-settings/plugins/keyfile/plugin.c + system-settings/plugins/ifcfg-suse/plugin.c + - (get_property, sc_plugin_ifcfg_class_init): implement hostname and + capabilities properties + + * system-settings/plugins/ifcfg-fedora/shvar.c + - (svOpenFile): re-enable R/W access of ifcfg files since the plugin + writes out /etc/sysconfig/network now + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (plugin_get_hostname): get hostname from /etc/sysconfig/network + - (plugin_set_hostname): save hostname to /etc/sysconfig/network + - (sc_network_changed_cb): handle changes to /etc/sysconfig/network + - (sc_plugin_ifcfg_init): monitor /etc/sysconfig/network for changes + - (get_property, set_property, sc_plugin_ifcfg_class_init): implement + hostname get/set and capabilities get + +2008-09-18 Dan Williams + + * libnm-util/nm-setting-wireless.c + - (nm_setting_wireless_ap_security_compatible): only verify pairwise and + group ciphers if the wireless-security setting explicitly specified + them, effectively making the default be "all ciphers" (idea from + Alexander Sack) + +2008-09-15 Dan Williams + + Patch from Alexander Sack + + * src/named-manager/nm-named-manager.c + - (dispatch_resolvconf): respect resolvconf exit code + +2008-09-12 Tambet Ingo + + * src/named-manager/nm-named-manager.c (dispatch_netconfig): Make it compile + again. Add some debugging. + +2008-09-11 Dan Williams + + * system-settings/plugins/keyfile/plugin.c + - (update_connection_settings): update connection manually, since + nm_exported_connection_update() does authentication + - (dir_changed): update_connection_settings() doesn't need to return + an error + +2008-09-09 Dan Williams + + * libnm-glib/nm-vpn-plugin-ui-interface.c + libnm-glib/nm-vpn-plugin-ui-interface.h + libnm-glib/libnm_glib_vpn.ver + - (nm_vpn_plugin_ui_interface_delete_connection): called when the plugin + should clean up resources related to the connection (like keyring + secrets) + - (nm_vpn_plugin_ui_widget_interface_save_secrets): called when the plugin + should save user-scope secrets (like to the keyring) + +2008-09-08 Dan Williams + + Patch from Alexander Sack + + * libnm-util/crypto_gnutls.c + libnm-util/crypto_nss.c + - (crypto_init, crypto_deinit): just use a boolean instead of a refcount + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + libnm-util/libnm-util.ver + - (nm_utils_init): initialize libnm-util + - (nm_utils_deinit): de-initialize libnm-util and clean up resources + + * libnm-util/nm-setting-8021x.c + - (nm_setting_802_1x_class_init): init libnm-util when needed + +2008-09-05 Dan Williams + + Patch from Roy Marples and others + + * configure.in + src/named-manager/nm-named-manager.c + - Add support for resolvconf; use --with-resolvconf at configure time + to enable it + +2008-09-05 Dan Williams + + * libnm-util/crypto_nss.c + libnm-util/crypto_gnutls.c + libnm-util/crypto.h + - (crypto_init): return error when init fails + +2008-09-05 Dan Williams + + * libnm-glib/nm-device-wifi.c + - (access_point_removed_proxy): clean up the active access point too + just in case the active ap changed signal didn't come through yet + - (clean_up_aps): be sure to set priv->active_ap to NULL when cleaning up + +2008-09-05 Dan Williams + + * libnm-glib/nm-client.c + - (constructor): get initial state after we know whether NM is running + or not + +2008-09-05 Dan Williams + + * libnm-glib/nm-ip4-config.c + libnm-glib/nm-dhcp4-config.c + - (finalize): clean up the DBusGProxy + +2008-09-04 Dan Williams + + * src/nm-ip4-config.c + src/nm-ip4-config.h + - (nm_ip4_config_new): don't export over D-Bus here + - (nm_ip4_config_export): new function; export the config over D-Bus + - (nm_ip4_config_is_exported): new function + + * src/nm-device.c + - (nm_device_activate_stage5_ip_config_commit): fix leak of IP4Config + objects by balancing the IP4Config constructor; the device holds + a reference to the IP4Config already + - (nm_device_set_ip4_config): export the IP4Config when needed + +2008-09-04 Dan Williams + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - Allow WPA-NONE key management for Ad-Hoc WPA connections + +2008-09-04 Dan Williams + + * libnm-util/nm-setting-vpn.c + libnm-util/nm-setting-vpn.h + - Split VPN secrets from VPN data so that settings services can actually + figure out that they are secrets and store them accordingly + + * system-settings/plugins/keyfile/nm-keyfile-connection.c + system-settings/plugins/keyfile/reader.c + system-settings/plugins/keyfile/reader.h + system-settings/plugins/keyfile/writer.c + - Store VPN secrets separately from VPN data so that they can be fetched + on demand + - Implement the get_secrets() call so that (a) secrets don't leak out + to unprivileged callers, and (b) secrets can be sent to privileged + callers when needed + + * vpn-daemons/vpnc/src/nm-vpnc-service.c + - Handle split VPN secrets + +2008-08-27 Dan Williams + + * system-settings/plugins/ifcfg-fedora/reader.c + - (make_ip4_setting): use DOMAIN not SEARCH (rh #459370) + +2008-08-27 Dan Williams + + Ensure zombie children get cleaned up. To get notifications when children + die abnormally, g_spawn_async() requires G_SPAWN_DO_NOT_REAP_CHILD, but + that requires calling waitpid() yourself if you've removed the child watch + handler before the process has actually died, which NM needs to do in a few + places. So ensure that everything uses G_SPAWN_DO_NOT_REAP_CHILD and also + cleans up after the child when required. Should fix problems trying to + activate mobile broadband connections after a previous failure. + + * src/dhcp-manager/nm-dhcp-dhclient.c + src/dhcp-manager/nm-dhcp-dhcpcd.c + - Use G_SPAWN_DO_NOT_REAP_CHILD + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_device_destroy): ensure child is cleaned up + - (nm_dhcp_client_stop, nm_dhcp_manager_cancel_transaction_real): always + block on child quitting, since the non-blocking functionality was + never actually used + + * src/dnsmasq-manager/nm-dnsmasq-manager.c + - (dm_watch_cb): child is already reaped here + - (ensure_killed, nm_dnsmasq_manager_stop): block until child is dead + + * src/nm-device.c + - (aipd_cleanup): block until child is dead + + * src/named-manager/nm-named-manager.c + - (run_netconfig): don't use G_SPAWN_DO_NOT_REAP_CHILD if we aren't + event bothering to watch the child + + * src/ppp-manager/nm-ppp-manager.c + - (ppp_watch_cb): child is already reaped here + - (ensure_killed, nm_ppp_manager_stop): block until child is dead + + * src/vpn-manager/nm-vpn-service.c + - (vpn_service_watch_cb): child is already reaped here + - (nm_vpn_service_daemon_exec): use G_SPAWN_DO_NOT_REAP_CHILD so that + status of the child is actually tracked + - (ensure_killed, finalize): block until child is dead + +2008-08-26 Dan Williams + + * system-settings/plugins/keyfile/nm-keyfile-connection.c + - (update): Update filename of the connection if the connection id + was changed + + * system-settings/plugins/keyfile/plugin.c + - (dir_changed): first pass at handling connection renames correctly + + * system-settings/plugins/keyfile/writer.c + system-settings/plugins/keyfile/writer.h + - (write_connection): replace '/' with '*' when writing out the filename + from the connection id + +2008-08-26 Dan Williams + + Add connection UUIDs, since connection names can be changed, and since + old-style connection IDs could change over the life of the connection. The + UUID should be assigned at connection creation time, be stable for a given + connection, and should be unique among all connections for a given settings + service. + + * configure.in + libnm-util/Makefile.am + - Require libuuid + + * introspection/nm-exported-connection.xml + - Remove "GetID" method + + * libnm-glib/nm-dbus-connection.c + libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - Remove id-related stuff + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + libnm-util/libnm-util.ver + - (nm_utils_uuid_generate, nm_utils_uuid_generate_from_string): Add + utility functions to generate UUIDs + + * libnm-util/nm-setting-connection.c + libnm-util/nm-setting-connection.h + - Add 'uuid' member to the connection setting + - (verify): require valid 'uuid' for a valid connection + + * system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c + system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-suse/nm-suse-connection.c + system-settings/plugins/ifcfg-suse/parser.c + system-settings/plugins/keyfile/nm-keyfile-connection.c + system-settings/src/main.c + - Remove id-related stuff + - Give connections UUIDs where needed + +2008-08-25 Dan Williams + + * libnm-util/crypto_gnutls.c + libnm-util/crypto_nss.c + - (crypto_init, crypto_deinit): refcount init/deinit + - (crypto_md5_hash): allow NULL salt + +2008-08-22 Michael Biebl + + * libnm-glib/Makefile.am + libnm-util/Makefile.am + libnm-glib/libnm_glib.ver + libnm-glib/libnm_glib_vpn.ver + libnm-util/libnm-util.ver + - Use linker version scripts to control the list of exported + symbols. List each exported symbol explicitely. + * libnm-util/Makefile.am + - Fix compilation of the test-crypto binary. The crypto + functions are no longer part of the libnm-util API. Add + crypto_*.c to test_crypto_SOURCES and link against the correct + crypto libraries. + +2008-08-19 Dan Williams + + * configure.in + test/Makefile.am + - Don't build test/test-common + - Remove unused stuff + + * test/nm-set-fallback + test/nmtestdevices.c + test/test-common/.cvsignore + test/test-common/Makefile.am + test/test-common/test-common.c + test/test-common/test-common.h + - delete + +2008-08-18 Dan Williams + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + - (nm_utils_garray_to_string): remove; NM was the only user and doesn't + export anything that needs to be converted with this function + + * src/dhcp-manager/nm-dhcp-manager.c + - (garray_to_string): convert a byte array to a UTF-8 string with + minimal validation; the DHCP client sends it in ASCII anyway + - (get_option, copy_option): use garray_to_string() + +2008-08-18 Dan Williams + + * include/NetworkManager.h + introspection/nm-device.xml + - Add a "missing firmware" device state reason + + * src/NetworkManagerSystem.c + src/NetworkManagerSystem.h + - (nm_system_device_set_up_down): add a no_firmware argument + - (nm_system_device_set_up_down_with_iface): if the result of setting + IFF_UP is ENOENT, that almost always means missing firmware + + * src/backends/NetworkManagerGeneric.c + src/nm-device-ethernet.c + src/nm-device-private.h + src/nm-device-wifi.c + src/nm-device.c + src/nm-device.h + src/nm-hso-gsm-device.c + src/vpn-manager/nm-vpn-connection.c + - Pass no_firmware along; check it where appropriate + +2008-08-18 Dan Williams + + Patch from Robert Buchholz + + * autogen.sh + configure.in + - Change to automake 1.9 and 'ustar' tar format defined by POSIX + 1003.1-1988, allowing for file names longer than 99 characters + +2008-08-17 Dan Williams + + * include/NetworkManager.h + introspection/nm-device.xml + src/nm-gsm-device.c + - Finer-grained GSM registration failure error codes + +2008-08-17 Dan Williams + + * callouts/Makefile.am + src/Makefile.am + - Move dispatcher directory creation to callouts/Makefile.am + + * system-settings/plugins/keyfile/Makefile.am + - Create keyfile connections directory in DESTDIR (bgo #546833) + +2008-08-15 Dan Williams + + Do connection sharing in a cleaner manner; all required iptables rules + are now stored in the activation request and pertain only to the device + which is being shared to other computers. (rh #458625) + + * src/nm-activation-request.c + src/nm-activation-request.h + - (nm_act_request_add_share_rule): new function; add a sharing rule to + the activation request which will get torn down automatically when + the activation request dies + - (nm_act_request_set_shared): push sharing rules to iptables when sharing + is started, and tear them down when sharing is stopped + + * src/nm-device.c + - (start_sharing): start up sharing by doing the required iptables magic + - (share_init): poke the right bits of the kernel and load the right + modules for NAT + - (nm_device_activate_stage5_ip_config_commit): start NAT-ing this + connection if it's a 'shared' connection + + * src/NetworkManagerPolicy.c + - Remove all sharing stuff; done in the device code itself + +2008-08-15 Dan Williams + + * src/dnsmasq-manager/nm-dnsmasq-manager.c + - (create_dm_cmd_line): send the right router address + +2008-08-15 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (pppd_timed_out): ensure timeouts fail the connection + +2008-08-14 Dan Williams + + * src/nm-properties-changed-signal.c + src/nm-properties-changed-signal.h + - Add a property spec flag for "don't export this property" in + property changed signals + + * src/nm-hso-gsm-device.c + src/nm-gsm-device.c + src/nm-cdma-device.c + - Don't export monitor interface or netdev interface properties + +2008-08-14 Dan Williams + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): 'hso' devices can be default even if they + don't have a gateway + +2008-08-14 Dan Williams + + * src/nm-device.c + - (nm_device_deactivate_quickly): tear down activation request after + calling device-specific deactivation + + * src/nm-hso-gsm-device.c + - (real_deactivate_quickly): terminate connection when deactivating + +2008-08-14 Dan Williams + + * src/nm-activation-request.h + - Add HSO secrets caller + + * src/nm-gsm-device.c + src/nm-gsm-device.h + - (modem_wait_for_reply): add a 'user_data' argument so callers can pass + something to the callback function + - (set_apn, set_apn_done): call class dial function, not a static one + - (nm_gsm_device_class_init): add a class 'dial' function + + * src/nm-hal-manager.c + - (get_hso_netdev): find the hso-driven hardware's net device + - (modem_device_creator): recognize hso-driven hardware and create the + right type of device object for it + + * src/Makefile.am + src/nm-hso-gsm-device.c + src/nm-hso-gsm-device.h + - Implement support for devices driven by the 'hso' driver as a subclass + of NMGsmDevice + +2008-08-14 Dan Williams + + * src/NetworkManagerSystem.c + - (nm_system_device_is_up_with_iface): ensure ifreq is cleared before using + - (nm_system_device_set_up_down_with_iface): cleanups; only return + success if the operation really was successful + +2008-08-14 Dan Williams + + * src/nm-netlink-monitor.c + src/nm-netlink-monitor.h + src/nm-device-ethernet.c + - (nm_netlink_monitor_request_status): return an error on failure + - (constructor): don't segfault on missing error + +2008-08-13 Dan Williams + + * callouts/nm-dispatcher-action.c + - Add IP4 config info to script environment + +2008-08-12 Dan Williams + + * src/nm-device.c + - (nm_device_set_ip4_config): don't touch hostnames here; distros + that want to use DHCP hostnames should use dispatcher scripts + for that + + * src/NetworkManagerSystem.h + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - Remove nm_system_set_hostname(), no longer used + + * src/backends/Makefile.am + src/backends/shvar.c + src/backends/shvar.h + - Remove shvar.*; no longer used + +2008-08-12 Dan Williams + + Revert most of the 'hostname' patch. Too much stuff still breaks when + hostname is updated at runtime. Distros or users who want hostname updates + can use dispatcher scripts to update the hostname if they need it. + +2008-08-12 Dan Williams + + * introspection/nm-settings-system.xml + system-settings/src/dbus-settings.c + system-settings/src/dbus-settings.h + - Add a 'Hostname' property (rw) which represents the configured + hostname and domain of the system, if any + + * system-settings/src/nm-system-config-error.c + system-settings/src/nm-system-config-error.h + system-settings/src/nm-system-config-interface.c + system-settings/src/nm-system-config-interface.h + - Add a 'hostname' property to the plugin interface + - Add a method to send updated hostname to plugins to save in their + backing configuration store + + * system-settings/plugins/keyfile/nm-keyfile-connection.c + system-settings/plugins/keyfile/plugin.c + system-settings/plugins/keyfile/writer.c + system-settings/plugins/keyfile/writer.h + system-settings/plugins/ifcfg-suse/plugin.c + - Add minimal hostname support + + * system-settings/plugins/ifcfg-fedora/plugin.c + - Add support for updating system hostname in /etc/sysconfig/network + +2008-08-12 Dan Williams + + * system-settings/plugins/ifcfg-fedora/shvar.c + system-settings/plugins/ifcfg-fedora/shvar.c + - Fix double-free caused by svSetValue() followed by svCloseFile() + +2008-08-12 Tambet Ingo + + * Makefile.am: Fix distcheck. + +2008-08-12 Tambet Ingo + + * libnm-glib/*.c. Document some more. + +2008-08-12 Tambet Ingo + + Start documenting libnm-glib public API using gtk-doc. + + * libnm-glib/nm-serial-device.c: + * libnm-glib/nm-object.c: + * libnm-glib/nm-gsm-device.c: + * libnm-glib/nm-device.c: + * libnm-glib/nm-device-wifi.c: + * libnm-glib/nm-device-ethernet.c: + * libnm-glib/nm-client.c: + * libnm-glib/nm-cdma-device.c: Document the public API. + + * docs/libnm-glib/libnm-glib.types: Implement. + + * docs/libnm-glib/Makefile.am: Implement. + + * autogen.sh: + * configure.in: + * Makefile.am: Add gtk-doc support. + +2008-08-12 Tambet Ingo + + * src/backends/*: Get rid of nm_system_should_modify_resolv_conf(). + + * src/named-manager/nm-named-manager.c (rewrite_resolv_conf): Calculate + the composite result of all the IP4 configurations and call a distro + specific update_resolv_conf(). + (update_resolv_conf): Implement one for directly writing to + /etc/resolv.conf and one for opensuse to call netconfig. + +2008-08-11 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (impl_ppp_manager_need_secrets): pass interface as required + +2008-08-11 Dan Williams + + Merge the vpn-properties setting with the vpn setting since it was pointless + to keep both of them around. Convert the vpn 'data' hash table to a hash + of string:string (instead of string:variant) so that system settings plugins + can have an easier time dealing with the arbitrary key/value pairs. + +2008-08-11 Dan Williams + + * libnm-util/nm-utils.c + - (nm_utils_register_value_transformations): add value transform for + a hash table of string:string + +2008-08-10 Dan Williams + + * libnm-glib/nm-vpn-plugin.c + - (nm_vpn_plugin_connect): stop plugin after connection failure from + an idle handler so the Connect reply gets delivered before the + stop StateChanged signal + +2008-08-10 Dan Williams + + * src/nm-ip4-config.c + - (get_property): use common ip4 address/route conversion functions + - (nm_ip4_config_replace_address, nm_ip4_config_replace_route): should + copy the new route here, not take ownership + +2008-08-08 Tambet Ingo + + * system-settings/plugins/ifcfg-suse/parser.c (make_ip4_setting): + Update the IP4 setting's method name. + +2008-08-07 Dan Williams + + * introspection/nm-ip4-config.xml + libnm-glib/libnm-glib-test.c + libnm-glib/nm-ip4-config.c + libnm-glib/nm-ip4-config.h + src/NetworkManagerSystem.h + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + src/dhcp-manager/nm-dhcp-manager.c + src/nm-device.c + src/nm-ip4-config.c + src/nm-ip4-config.h + - Remove NIS logic; should be done from dispatcher scripts instead + +2008-08-07 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_get_ip4_config): fix regression which caused + mis-handling of DHCP responses that returned more than one router + (found by Grant Williamson) + +2008-08-07 Dan Williams + + * callouts/nm-dispatcher-action.c + - (nm_dispatcher_action): grab device path and create the device; pass + the device's DHCP4 config to script caller + - (dispatch_scripts): dump the DHCP4 config to the environment of called + scripts + + * libnm-glib/nm-dhcp4-config.c + libnm-glib/nm-dhcp4-config.h + - (nm_dhcp4_config_get_options): expose + - (nm_dhcp4_config_get_one_option): renamed from nm_dhcp4_config_get_option + +2008-08-07 Dan Williams + + * include/NetworkManager.h + - Add the DHCP4Config D-Bus interface + + * libnm-glib/Makefile.am + libnm-glib/nm-dhcp4-config.c + libnm-glib/nm-dhcp4-config.h + - Handle DHCP4 config objects exported by NM over D-Bus + + * libnm-glib/nm-device.c + libnm-glib/nm-device.h + - Add a 'dhcp4-config' property + + * libnm-glib/libnm-glib-test.c + - Print out DHCP4 config for devices + - Fix some crashes when no connections are active + + * src/nm-device-interface.c + src/nm-device.c + src/nm-dhcp4-config.c + src/nm-dhcp4-config.h + - Treat dhcp4-config object as an object path at the D-Bus interface so + that when it doesn't exist we can proxy it as "/" which dbus-glib + doesn't let us do when the property type is G_TYPE_OBJECT + +2008-08-07 Dan Williams + + * src/NetworkManager.c + src/NetworkManagerSystem.h + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - (nm_system_init, nm_system_kill_all_dhcp_daemons): remove, unused + +2008-08-06 Dan Williams + + * libnm-glib/nm-ip4-config.c + libnm-glib/nm-ip4-config.h + - Add 'routes' property + + * libnm-util/nm-setting-vpn.c + libnm-util/nm-setting-vpn.h + - Remove 'routes' property + + * libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - 'ignore-dhcp-dns' renamed to 'ignore-auto-dns' + - Add 'ignore-auto-routes' property + - 'routes' exposed over D-Bus is now an array of array of uint (4) to + accomodate route metrics + - 'routes' exposed in C is now a list of NMSettingIP4Route structures + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + - Add helpers for marshalling IP4 routes + + * src/NetworkManagerUtils.c + - (nm_utils_merge_ip4_config): handle property renames and new route + structure + + * src/NetworkManagerSystem.c + - (nm_system_device_set_ip4_route, nm_system_device_set_from_ip4_config, + nm_system_vpn_device_set_from_ip4_config): respect route metrics + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_get_ip4_config): handle new route structure + + * system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-fedora/writer.c + - Handle routes separately from addresses now that routes have a different + format + + * introspection/nm-ip4-config.xml + src/nm-ip4-config.c + src/nm-ip4-config.h + - Rename internal routing functions + - 'static-routes' renamed to 'routes' + +2008-08-04 Dan Williams + + Patch from Sjoerd Simons + + * src/NetworkManager.c + src/nm-manager.c + src/nm-manager.h + - More explicitly make the NMManager a singleton + +2008-08-04 Dan Williams + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_verify): return error on missing 'connection' setting + (found by Sjoerd Simons) + +2008-08-04 Dan Williams + + Handle multiple concurrent PPP connections. + + * src/ppp-manager/nm-ppp-manager.c + src/ppp-manager/nm-ppp-manager.h + - (constructor): only PPP Manager request bus name once; each + NMPPPManager object gets a unique object path + - (nm_ppp_manager_class_init, get_property, set_property, + nm_ppp_manager_new, nm_ppp_manager_start): pass parent interface in + at construct time + - (impl_ppp_manager_need_secrets, impl_ppp_manager_set_state): don't + remove timeout until PPP manager gets an IP4 config + - (create_pppd_cmd_line): pass dbus object path as 'ipparam' so that + the plugin can call back to this specific PPP manager instance + + * src/nm-device-ethernet.c + src/nm-serial-device.c + - Pass parent device in nm_ppp_manager_new() + + * src/nm-gsm-device.c + src/nm-cdma-device.c + - (device_state_changed): don't close serial device on NEED_AUTH + state changed, that's not a failure case like the rest are + + * src/ppp-manager/nm-pppd-plugin.c + - (nm_ip_up): always use index 0 into the ipcp options, because NM always + binds one interface to any pppd process, thus the correct index + is always 0; send PHASE_DEAD on error to alert NM immediately of + problems; try harder to get a peer address in spite of pppd + - (plugin_init): use 'ipparam' as the object path back to our specific + PPP manager instance + +2008-08-04 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (impl_ppp_manager_need_secrets): rework to handle secrets better; + since the GSM and CDMA settings now implement need_secrets, we can + rely on them to do the right thing. Where secrets are not required, + just pass empty strings back to the pppd plugin. + - (nm_ppp_manager_update_secrets): leak fix; don't need to dup the strings + - (impl_ppp_manager_set_ip4_config): clear the secrets tries counter + on successful IP4 config receipt + +2008-08-04 Dan Williams + + * libnm-util/nm-setting-cdma.c + libnm-util/nm-setting-gsm.c + - (verify): validate username & password if they exist + - (need_secrets): if username given, require a password too + +2008-08-04 Dan Williams + + * src/dnsmasq-manager/nm-dnsmasq-manager.c + - (create_dm_cmd_line): really don't listen on lo, despite what the + manpage says about --listen-address without --interface + (bgo #546033) + +2008-08-01 Dan Williams + + * libnm-glib/nm-device.c + - (proxy_get_string): util function for querying a HAL property + - (get_ancestor_device): split out from get_product_and_vendor() + - (get_product_and_vendor): simplify; get more accurate pid & vid info + from PCI devices by querying subsys properties + - (nm_device_update_description): simplify + +2008-08-01 Dan Williams + + * libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - Make IPv4 methods reflect their usage; 'dhcp' -> 'auto' and + 'autoip' -> 'link-local'. VPN & PPP connections can also have IPv4 + settings, and they don't necessarily use DHCP. + + * src/NetworkManagerPolicy.c + src/nm-device.c + system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-suse/parser.c + - Fixup for method changes + +2008-07-31 Dan Williams + + * src/nm-activation-request.c + src/vpn-manager/nm-vpn-connection.c + - Correct GetSecrets D-Bus pending call usage; the GetSecrets call + itself should be attached to the activation request or the VPN + connection, not the NMConnection object, since the call is not + expected to live as long as the NMConnection itself + +2008-07-31 Dan Williams + + * src/nm-device-wifi.c + - (real_act_stage2_config): fix issue where association would continue + even though secrets were needed; 'goto out' was in wrong scope and + result of handle_auth_or_fail() should have been dumped directly to + 'ret' to ensure that the association was postponed until secrets + are available + +2008-07-31 Dan Williams + + * system-settings/plugins/ifcfg-fedora/plugin.c + system-settings/plugins/ifcfg-fedora/reader.c + - Don't ignore unmanaged devices if their ifcfg file doesn't make a + valid NM connection + +2008-07-29 Dan Williams + + * src/nm-gsm-device.c + - (automatic_registration_response, automatic_registration): recognize + denied registration and reorder responses + +2008-07-29 Dan Williams + + * src/nm-serial-device.c + - (nm_serial_device_wait_for_reply): fix timeout calculation. Since + time(2) is used for current time, which returns seconds, we shouldn't + be multiplying by 1000. + +2008-07-28 Dan Williams + + Patch from Fabrice Bellet + + * src/NetworkManagerSystem.c + - (route_in_same_subnet): mask addresses and compare them so that the + function actually does what it says it's going to do (rh #456685) + +2008-07-27 Dan Williams + + * libnm-util/nm-setting-ip6-config.c + - (set_property): add missing break that caused routes to be overwritten + with addresses + + * libnm-util/nm-setting-ip6-config.c + - (verify): validate routes and return GError everywhere on invalid setting + - (finalize): don't leak routes + - (set_property): add missing break that caused routes to be overwritten + with addresses + +2008-07-27 Dan Williams + + * libnm-util/* + - Relicense to LGPLv2+ + +2008-07-27 Dan Williams + + * system-settings/plugins/ifcfg-fedora/reader.c + - (make_ip4_setting): fix parsing automatic configs + +2008-07-27 Dan Williams + + * src/dnsmasq-manager/nm-dnsmasq-manager.c + src/nm-device.c + src/ppp-manager/nm-ppp-manager.c + - Ensure child process gets reaped. The child watch function may be + removed from the mainloop before the child gets killed, so we have + to make sure the child is reaped when it's told to die intentionally + +2008-07-27 Dan Williams + + Patch from Roy Marples + + * src/dhcp-manager/nm-dhcp-dhcpcd.c + - (nm_dhcp_client_start): fixup for latest dhcpcd 4.0 RC + +2008-07-27 Dan Williams + + * src/nm-gsm-device.c + - (init_modem_full): send "ATZ E0" after CPIN, because apparently some + Huawei devices turn echo back on after CPIN (rh #456770) + +2008-07-24 Tambet Ingo + + * src/ppp-manager/nm-ppp-manager.c (nm_ppp_manager_update_secrets): Add + format argument to g_set_error() call. + + * src/backends/interface_parser.[ch]: Remove. + + * src/backends/Makefile.am: Remove unused files interface_parser.[ch]. + +2008-07-21 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (create_pppd_cmd_line): send 'noipdefault' on non-PPPoE connections + to prevent pppd from picking up some random local address from an + interface that doesn't have anything to do with the one we're + interested in (rh #455348) + +2008-07-17 Dan Williams + + * libnm-util/nm-utils.c + - (string_to_utf8): general function for conversion to UTF-8 assisted + by locale + - (nm_utils_ssid_to_utf8): use string_to_utf8() + - (nm_utils_garray_to_string): ensure returned string is UTF-8 safe + +2008-07-17 Dan Williams + + * introspection/Makefile.am + introspection/nm-device.xml + introspection/nm-dhcp4-config.xml + - Add bits for the DHCP4Config property of the device, and the DHCP4Config + itself + * src/nm-device-interface.c + src/nm-device-interface.h + - Add the DHCP4Config property + + * src/nm-device.c + - Keep track of DHCP4 options via a new DHCP4Config property and notify + D-Bus clients when it changes + + * src/nm-dhcp4-config.c + src/nm-dhcp4-config.h + - Simple object to store DHCP4 options, export them over D-Bus, and + notify when they change + + * src/dhcp-manager/nm-dhcp-manager.c + src/dhcp-manager/nm-dhcp-manager.h + - (nm_dhcp_manager_set_dhcp4_config, copy_dhcp4_config_option): copy and + filter server-returned DHCP options into an NMDHCP4Config object + +2008-07-16 Dan Williams + + * introspection/nm-device.xml + - Add device state reasons + +2008-07-16 Dan Williams + + Patch from Roy Marples + + * configure.in + - Add --with-dhcp-client option + + * src/dhcp-manager/Makefile.am + - pass DHCP_CLIENT_PATH on compile line + + * src/dhcp-manager/nm-dhcp-manager.c + src/dhcp-manager/nm-dhcp-manager.h + - Genericize for both dhcpcd and dhclient + + * src/dhcp-manager/nm-dhcp-dhclient.c + - Move dhclient stuff out to it's own file from nm-dhcp-manager.c + + * src/dhcp-manager/nm-dhcp-dhcpcd.c + - Implement support for dhcpcd too + +2008-07-16 Tambet Ingo + + * system-settings/src/nm-system-config-interface.c + (nm_system_config_interface_supports_add): Implement. + (nm_system_config_interface_add_connection): Return a boolean to notify + of errors. + + * system-settings/src/nm-polkit-helpers.c: + * system-settings/src/nm-polkit-helpers.h: Move error declarations to + a separate file. + + * system-settings/src/dbus-settings.c (impl_settings_add_connection): + Return an error when none of the plugins support add or if addition + failed for some reason. + + * system-settings/src/nm-system-config-error.h: + * system-settings/src/nm-system-config-error.c: New files, mostly moved + here from nm-polkit-helpers.[ch]. + + * system-settings/src/Makefile.am: Build new files. + + * system-settings/plugins/keyfile/reader.c + (read_array_of_array_of_uint): Make it more general so that it would + work for routes as well. + + * system-settings/plugins/keyfile/writer.c + (write_array_of_array_of_uint): Ditto. + Fix the netmask/prefix writing. + + * system-settings/plugins/keyfile/plugin.c (add_connection): Return + boolean to notify errors. + + * system-settings/plugins/ifcfg-suse/nm-suse-connection.c (update): + Return more specific error. + (delete): Ditto. + +2008-07-11 Dan Williams + + Modify the NMDevice::state-changed signal to include the previous state + and reason. Enables the applet to provide more information why device + activation failed. + +2008-07-09 Dan Williams + + * callouts/Makefile.am + callouts/nm-avahi-autoipd-action.c + callouts/nm-avahi-autoipd.conf + - avahi-autoipd callout to send options back to NM + + * src/autoip.c + src/autoip.h + - remove + + * src/nm-device.c + src/nm-device-private.h + src/nm-manager.c + - Use avahi-autoipd for IPv4LL functionality rather than really crappy + old custom stuff + +2008-07-07 Dan Williams + + * system-settings/plugins/ifcfg-fedora/reader.c + - (make_ip4_setting): handle DHCP_HOSTNAME; fix up prefix support to + handle PREFIX too; clean up + +2008-07-07 Dan Williams + + Convert to using IPv4 prefixes instead of netmasks. + +2008-07-03 Dan Williams + + * libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - Add properties for DHCP Client Identifier and DHCP Hostname + + * src/dhcp-manager/nm-dhcp-manager.c + src/dhcp-manager/nm-dhcp-manager.h + - (nm_dhcp_manager_begin_transaction): take the connection's ip4-config + setting as an argument to pass on to the dhclient config file + creation function + - (nm_dhcp_manager_cancel_transaction_real): remove dhclient config when + DHCP is torn down + - (dhclient_run): punt config file handling to create_dhclient_config() + - (create_dhclient_config): create an interface-specific dhclient + config file since there may need to be interface-specific options + passed to dhclient + - (merge_dhclient_config): merge normal distro dhclient config file and + add options from the connection + - (nm_dhcp_device_new): generate the interface specific dhclient + config file path once + - (nm_dhcp_device_destroy): handle partially initialized objects; free + dhclient config file path + + * src/nm-device.c + - (real_act_stage3_ip_config_start): pass ip4-config, if any, to the + DHCP manager when starting DHCP + +2008-07-02 Dan Williams + + * libnm-util/nm-setting-8021x.c + - (verify): allow forcing the PEAP label to 0 + +2008-07-02 Dan Williams + + * introspection/nm-active-connection.xml + introspection/nm-vpn-connection.xml + libnm-glib/nm-active-connection.c + src/nm-activation-request.c + src/nm-active-connection.h + src/vpn-manager/nm-vpn-connection.c + - Remove "SharedServiceName" and "SharedConnection" bits from the D-Bus + and libnm-glib API since sharing didn't get implemented that way + +2008-07-02 Dan Williams + + * src/nm-device-wifi.c + - (can_scan): don't scan when a shared connection is activated since + that makes drivers mad (causing disconnects); also NM doesn't need + to hedge against disconnects by keeping up-to-date network topology + because the connection originates from the local machine, and thus + there should be no disconnects + +2008-07-01 Dan Williams + + Fix mobile broadband username/password issues. NM was never requesting + mobile broadband secrets, nor was it passing back the username and password + if it had them. + + * marshallers/nm-marshal.list + - Add some new types for activation request objects + + * src/nm-activation-request.c + src/nm-activation-request.h + - (get_secrets_cb): pass the caller type in the signal + - (nm_act_request_request_connection_secrets): take a caller type, so + that GetSecrets() reply handlers know who asked for the secrets in + the first place; use secret hints too so the settings service can + figure out exactly what NM wants (ie, PIN or the PPP password) + + * src/ppp-manager/nm-ppp-manager.c + src/ppp-manager/nm-ppp-manager.h + - (impl_ppp_manager_need_secrets): nm_connection_need_secrets() won't + detect needed secrets when the secret could be blank, like GSM/CDMA + passwords. So always ask for secrets, and send a hint as to what + secret we really want. + - (nm_ppp_manager_update_secrets): make function more generic by making + the device specific class figure out the username and password, and + accept an error argument to return back over D-Bus + + * src/nm-device-wifi.c + - (link_timeout_cb, handle_auth_or_fail): update for changes to + nm_act_request_request_connection_secrets() + - (real_connection_secrets_updated): update for 'caller' changes + + * src/nm-device.c + src/nm-device.h + - (connection_secrets_updated_cb, connection_secrets_failed_cb): update + for 'caller' changes + + * src/nm-device-ethernet.c + - (real_connection_secrets_updated): update for 'caller' changes and + move logic for getting PPPoE username and password here before + calling nm_ppp_manager_update_secrets() + - (link_timeout_cb, handle_auth_or_fail): update for changes to + nm_act_request_request_connection_secrets() + + * src/nm-cdma-device.c + - (real_connection_secrets_updated): pass username and password back + to the PPP manager when required + + * src/nm-gsm-device.c + - (enter_pin): send the required secret name to the settings service + - (real_connection_secrets_updated): pass username and password back + to the PPP manager when required + +2008-06-30 Dan Williams + + * src/nm-device-wifi.c + - Consistently use NM_DEVICE_WIFI_GET_PRIVATE instead of self->priv + +2008-06-30 Dan Williams + + Attempt to fix various issues causing rh #448889. Mainly, to qualify for + the DISCONNECTED state, the device must not be rfkilled _and_ have a valid + priv->supplicant.iface. When either condition is false, the device should + transition back to UNAVAILABLE because it cannot be used. + + * src/nm-device-wifi.c + - (constructor): cleanup; connect to supplicant manager here since the + supplicant manager is always around + - (supplicant_interface_acquire): rename from init_supplicant_interface, + ensure the supplicant manager is in the IDLE state + - (supplicant_interface_release): rename from cleanup_supplicant_interface, + cancel any pending scans too + - (real_bring_up): don't set up the supplicnat interface here, because + we need the supplicant interface at times when the device may not + be "up" + - (real_take_down): just remove the periodic source + - (schedule_scan): ensure a state that would peg the CPU doesn't happen + - (remove_supplicant_interface_connection_error_handler): cleanup; don't + do anything if there's no supplicant interface + - (cleanup_association_attempt): cleanup + - (supplicant_iface_state_cb_handler): request an immediate scan when + the interface enters the READY state; transition to UNAVAILABLE + state when the interface goes down because the device can't be used + without a supplicant interface + - (supplicant_mgr_state_cb_handler): if the supplicant goes away, clean + up and transition to UNAVAILABLE; if the supplicant becomes ready, + acquire the supplicant interface and transition to DISCONNECTED + if the radio isn't killed + - (nm_device_wifi_dispose): move most of device_cleanup() here + - (state_changed_cb): release any existing supplicant interface; if the + radio is enabled then try to acquire a new supplicant interface; + if the radio is enabled and a supplicant interface has been acquired, + we can transition to DISCONNECTED + - (nm_device_wifi_set_enabled): if bringing the hardware up failed, + don't enable the radio, because HAL probably lied to us about the + killswitch being off. If bringing the hardware up worked, then + try to grab a supplicant interface, and if that was successful, + transition to DISCONNECTED + +2008-06-30 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + - (request_scan_results, nm_supplicant_interface_dispose, + wpas_iface_query_scan_results): cleanup; scan_results_timeout is now + the id of the timeout, not a GSource + +2008-06-30 Tambet Ingo + + * src/backends/NetworkManagerSuSE.c (nm_system_activate_nis): Fix a + bunch of typoes introduced by "Patch from David Cantrell + and me". + +2008-06-30 Tambet Ingo + + * src/nm-serial-device.c: + * src/nm-gsm-device.c: + * src/nm-cdma-device.c: Move the pending call handling to a common location + in serial device. Handle setting device state to failed in one place as well. + +2008-06-29 Dan Williams + + * src/nm-hal-manager.c + - Rework killswitch handling to query killswitch status immediately + when the first killswitch is added, so that rfkill state is + known as early as possible + - Also treat failure of GetPower() as rfkill when the dbus method + call times out (but not when the HAL callout returns an error) + +2008-06-26 Dan Williams + + Patch from David Cantrell and me + + * include/nm-dbus-glib-types.h + - Add IP6 address types + + * libnm-util/Makefile.am + libnm-util/nm-setting-ip6-config.c + libnm-util/nm-setting-ip6-config.h + - Add IP6 settings object + + * libnm-util/nm-connection.c + - (register_default_settings): register ip6 settings object + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + - (nm_utils_ip6_addresses_from_gvalue, nm_utils_ip6_addresses_to_gvalue, + nm_utils_ip6_dns_from_gvalue, nm_utils_ip6_dns_to_gvalue): add + ip6 address conversion functions + +2008-06-26 Dan Williams + + Patch from David Cantrell + + * Use inet_ntop() and inet_pton() everwhere and check for errors + +2008-06-26 Dan Williams + + * Update FSF address in license headers (Michael Biebl ) + +2008-06-26 Dan Williams + + Patch from Adel Gadllah + + * src/nm-device-wifi.c + - (link_timeout_cb): don't ignore disconnects due to scanning + - (supplicant_iface_connection_state_cb_handler): instead, schedule + a longer timeout when scanning; avoids case where supplicant can't + find the AP and just keeps scanning forever but isn't connected + +2008-06-26 Dan Williams + + Patch from Michael Biebl + + * Clean up build system stuff + +2008-06-23 Christian Persch + + * vpn-daemons/openvpn/auth-dialog/gnome-two-password-dialog.c: + * vpn-daemons/openvpn/auth-dialog/gnome-two-password-dialog.h: + * vpn-daemons/pptp/auth-dialog-general/anonymous-auth-module.c: + (impl_get_object): + * vpn-daemons/pptp/auth-dialog-general/chap-auth-module.c: + (impl_get_object): + * vpn-daemons/pptp/auth-dialog-general/gnome-generic-auth-dialog.c: + * vpn-daemons/pptp/auth-dialog-general/gnome-generic-auth-dialog.h: + * vpn-daemons/pptp/auth-dialog-general/mschapv2-auth-module.c: + (impl_get_object): + * vpn-daemons/pptp/auth-dialog/gnome-two-password-dialog.c: + * vpn-daemons/pptp/auth-dialog/gnome-two-password-dialog.h: + * vpn-daemons/pptp/properties/nm-ppp-properties.c: (impl_setup): + * vpn-daemons/pptp/properties/vpnui_impl.c: (impl_get_object): + * vpn-daemons/pptp/properties/vpnui_opt.c: + (vpnui_opt_connect_signals): + * vpn-daemons/pptp/properties/vpnui_opt.h: + * vpn-daemons/vpnc/auth-dialog/gnome-two-password-dialog.c: + * vpn-daemons/vpnc/auth-dialog/gnome-two-password-dialog.h: Don't use + deprecated gtk type macros. Bug #539325. + +2008-06-20 Dan Williams + + * libnm-glib/nm-vpn-plugin-ui-interface.c + libnm-glib/nm-vpn-plugin-ui-interface.h + - 'validity-changed' -> 'changed' to work better with the connection + editor. Plugin UI widgets should emit 'changed' whenever their + UI values change in a meaningful way. + - (nm_vpn_plugin_ui_widget_interface_update_connection): the + update_connection member now returns validity of the UI widget + +2008-06-20 Tambet Ingo + + * libnm-util/nm-connection.c (nm_connection_duplicate): Implement. + +2008-06-17 Dan Williams + + * libnm-glib/nm-vpn-plugin-ui-interface.c + libnm-glib/nm-vpn-plugin-ui-interface.h + - Add "desc" property for longer descriptions of the VPN plugin + +2008-06-16 Dan Williams + + * configure.in + libnm-glib/libnm_glib_vpn.pc.in + - add a .pc file for libnm_glib_vpn + + * libnm-glib/nm-vpn-plugin-ui-interface.c + libnm-glib/nm-vpn-plugin-ui-interface.h + - Move the glib/GNOME VPN UI plugin interface into libnm-glib and + rework it substantially + +2008-06-12 Dan Williams + + Add a GError argument to nm_connection_verify() and nm_setting_verify(), + and add error enums to each NMSetting subclass. Each NMSetting subclass now + returns a descriptive GError when verification fails. + +2008-06-11 Dan Williams + + Patch from Tambet Ingo + + * libnm-util/nm-setting-gsm.c + - (verify): validate APN + + * src/nm-gsm-device.c + - (manual_registration_done): start setting APN if needed + - (set_apn, set_apn_done): set the APN + - (do_dial): use the APN when dialing + +2008-06-11 Dan Williams + + * src/NetworkManagerSystem.c + - (nm_system_device_set_ip4_route, + nm_system_device_replace_default_ip4_route): check for the right + return value from rtnl_route_add() to know when to add a gateway + route (from Tambet) + +2008-06-11 Dan Williams + + * src/NetworkManagerPolicy.c + - do_ipt_cmd -> do_cmd + - (sharing_init): use do_cmd() instead of system() + +2008-06-10 Dan Williams + + The grand 802-11-wireless rename. Get rid of the 802-11/80211/802_11 bits + and use "wifi" everwhere instead. + +2008-06-10 Dan Williams + + The grand 802-3-ethernet rename. Get rid of the 802-3/8023/802_3 bits. + +2008-06-10 Dan Williams + + Patch from Tambet Ingo + + * src/ppp-manager/nm-ppp-manager.c: Add ppp stats monitoring, signal the + changes. + + * src/nm-serial-device.c: Monitor "ppp-stats" signals from NMPPPManager. Add + a signal to emit these changes over dbus. + + * src/Makefile.am: Genereate nm-serial-device-glue. + + * libnm-glib/nm-serial-device.[ch]: Implement. + + * libnm-glib/nm-cdma-device.[ch] + libnm-glib/nm-gsm-device.[ch]: Inherit from NMSerialDevice. + + * libnm-glib/Makefile.am: Add nm-serial-device.[ch]. + + * introspection/nm-device-serial.xml: Implement. + + * introspection/all.xml: Fix a couple of typos, add nm-device-serial.xml. + + * introspection/Makefile.am: Add nm-device-serial.xml. + + * include/NetworkManager.h: Add a DBus interface for serial device. + +2008-06-10 Dan Williams + + * configure.in + - Add TARGET_* define to config.h to distinguish distros + + * src/dhcp-manager/nm-dhcp-manager.c + - (dhclient_run): use distro-specific path for dhclient config file + +2008-06-09 Dan Williams + + * src/dnsmasq-manager/nm-dnsmasq-manager.c + src/dnsmasq-manager/nm-dnsmasq-manager.h + - (create_dm_cmd_line): use the IP4 address of the ip4-config to + calculate the addresses passed to dnsmasq instead of hard-coding + them + + * src/nm-device.c + - (nm_device_new_ip4_shared_config): be somewhat dynamic when choosing + IP addresses for shared connections to guard against shared + connection address collisions + - (real_act_stage4_get_ip4_config): handle possible NULL ip4-configs on + error conditions + - (nm_device_activate_stage5_ip_config_commit): pass ip4-config to + the dnsmasq manager + +2008-06-09 Dan Williams + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): set the default connection _after_ unsetting + default on all non-default connections so that two connections can + never be default at the same time + - (device_state_changed): start and stop connection sharing when + needed + - (active_connection_default_changed): restart or stop sharing when + the default connection changes to keep shared connections always + NAT-ed through the default connection + - (check_sharing): handle activation/deactivation of shared connections + - (sharing_restart): atom-bomb approach to connection sharing until we + can use libnl; reinit all sharing when the default connection or + shared connections change + - (sharing_init, sharing_stop): evil functions that init and deinit + iptables + +2008-06-09 Dan Williams + + * src/nm-activation-request.c + src/nm-activation-request.h + - (nm_act_request_set_shared, nm_act_request_get_shared, + nm_act_request_get_device): new functions to facilitate connection + sharing + +2008-06-09 Dan Williams + + * src/nm-device.c + - (clear_act_request): unset the 'default' property of the activation + request when clearing it to ensure the property changed signal gets + delivered and handled + +2008-06-09 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.c + - (access_point_removed_proxy): actually unref the AP after removing + it from the device's AP list. Fixes refcounting bug for APs that + caused them to get mixed up in the applet's menu. + +2008-06-09 Tambet Ingo + + * src/dhcp-manager/nm-dhcp-manager.c (finalize): Free private members. + (nm_dhcp_device_destroy): Destroy the device options hash table. + +2008-06-06 Dan Williams + + * system-settings/src/nm-polkit-helpers.c + - (create_polkit_context): in PolicyKit 0.6, polkit_context_init() will + unref the context if the initialization fails; also avoid spew when + the error isn't set + +2008-06-06 Dan Williams + + Patch from Tambet Ingo + + * src/NetworkManagerSystem.c + src/NetworkManagerSystem.h + - (nm_system_device_add_ip4_route_via_device_with_iface): remove + - (nm_system_device_set_from_ip4_config): remove unused route_to_iface + - (nm_system_device_set_ip4_route): clean up + - (nm_system_vpn_device_set_from_ip4_config): clean up, add VPN routes + + * src/nm-device.c + - (nm_device_set_ip4_config): remove unused route_to_iface bits + + * src/vpn-manager/nm-vpn-connection.c + - (ip_address_to_string): new function + - (print_vpn_config): use ip_address_to_string + - (merge_vpn_routes): add user-defined routes to the ip4 config + - (nm_vpn_connection_ip4_config_get): add routes the VPN server sent + + * include/NetworkManagerVPN.h + - Add 'routes' key + +2008-06-05 Dan Williams + + Patch from Markus Becker + + * test/nm-tool.c + - Show which device is the default device + +2008-06-05 Tambet Ingo + + Fix memory leaks. + + * system-settings/src/nm-system-config-hal-manager.c (get_type_for_udi): + Free data returned from dbus method call. + + * system-settings/src/nm-polkit-helpers.c (check_polkit_privileges): + dbus_g_method_get_sender() returns a duplicated string, free it + when done. + (check_polkit_privileges): Looks like policykit sometimes returns + error and non-null return value, don't leak errors in that case. + + * system-settings/src/main.c (find_plugin): Don't leak existing + plugin names. + (load_stuff): Don't leak device list and list items. + (have_connection_for_device): Don't leak connection list. + + * system-settings/plugins/keyfile/reader.c (read_one_setting_value): + Free the data received from g_keyfile_get_*. + + * system-settings/plugins/ifcfg-suse/parser.c (READ_WEP_KEY): Free + the key when the security object is updated. + + * src/supplicant-manager/nm-supplicant-interface.c (scan_results_cb): + Free data returned from dbus method call. + (iface_state_cb): Ditto. + (add_network_cb): Ditto. + (nm_supplicant_interface_add_cb): Don't make another copy of already + duplicated object path. + (nm_supplicant_interface_add_to_supplicant): Free the driver GValue + when done. + + * src/supplicant-manager/nm-supplicant-config.c + (ADD_STRING_LIST_VAL): Fix a memory leak. + + * src/nm-manager.c (free_get_settings_info): Free the allocated + memory slice. + (list_connections_cb): Free data returned from dbus method call. + (system_settings_get_unmanaged_devices_cb): Ditto. + + * src/nm-device-802-11-wireless.c (device_cleanup): Free ssid. + + * system-settings/plugins/ifcfg-suse/shvar.c (svCloseFile): + * system-settings/plugins/ifcfg-fedora/shvar.c (svCloseFile): + * src/backends/shvar.c (svCloseFile): Free the duplicated content + of the GList. + + * libnm-util/nm-setting.c (nm_setting_from_hash): Free the constructor + arguments after the object is created. + +2008-06-04 Dan Williams + + * libnm-util/Makefile.am + - Don't distribute nm-param-spec-specialized.h + +2008-06-02 Tambet Ingo + + * libnm-util/nm-setting-ip4-config.[ch]: Add static routes property. + + * src/nm-ip4-config.[ch]: Store the static routes as a list of + NMIP4Address, update the getters and setters. + + * src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get_ip4_config): + Use the updated NMIP4Config routes api. + + * src/NetworkManagerUtils.c (nm_utils_merge_ip4_config): Merge + static routes as well. + + * src/NetworkManagerSystem.c (netmask_to_prefix): Implement. + (nm_system_device_set_from_ip4_config): Use the updated NMIP4Config + routes api. + +2008-05-30 Dan Williams + + * src/named-manager/nm-named-manager.c + src/named-manager/nm-named-manager.h + - Remove stale/obsolete bits for controlling bind over DBus + +2008-05-29 Dan Williams + + * src/dnsmasq-manager/nm-dnsmasq-manager.c + src/dnsmasq-manager/nm-dnsmasq-manager.h + - (nm_dnsmasq_manager_new): move iface argument here + - (constructor): remove, not needed + - (get_pidfile_for_iface, create_dm_cmd_line, kill_existing_for_iface, + nm_dnsmasq_manager_start, nm_dnsmasq_manager_stop): use priv->pidfile + + * src/nm-device.c + - (real_act_stage4_get_ip4_config, + nm_device_activate_stage5_ip_config_commit): fix for dnsmasq manager + changes + +2008-05-29 Dan Williams + + * src/nm-device.c + - (dnsmasq_state_changed_cb): new function; fail the connection if + something happens to dnsmasq + - (nm_device_new_ip4_shared_config): new function; create a new + ip4-config for shared connections. Shared connections always use a + fixed static IP address. + - (real_act_stage4_get_ip4_config): handle shared connections; fix + autoip connections by actually using the returned ip4-config and + not leaking it + - (nm_device_activate_stage5_ip_config_commit): start dnsmasq for shared + connections + - (nm_device_deactivate_quickly, nm_device_dispose): terminate dnsmasq + if its active + +2008-05-29 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_get_best_auto_connection): auto-activate 'shared' method + connections too + +2008-05-29 Dan Williams + + * libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - Add a 'shared' method to indicate that this connection should be + brought up with a DHCP and proxy DNS server to facilitate + connection sharing. + - (verify): 'shared' method doesn't allow DNS or searches either + +2008-05-29 Dan Williams + + * configure.in + src/Makefile.am + src/dnsmasq-manager/Makefile.am + src/dnsmasq-manager/nm-dnsmasq-manager.c + src/dnsmasq-manager/nm-dnsmasq-manager.h + - Add a dnsmasq daemon manager to facilitate connection sharing + +2008-05-29 Dan Williams + + * src/nm-device-private.h + - Remove unused prototypes and clean up + + * src/nm-device.c + - Remove anything related to system_config_data, which is no longer used + - (nm_device_new_ip4_autoip_config): make static + +2008-05-29 Tambet Ingo + + * system-settings/plugins/ifcfg-suse/nm-suse-connection.c + (file_changed): Fix a bug where suse system settings plugin didn't + update the connections automatically when the files changed. + +2008-05-28 Dan Williams + + Revert r3697 (adhoc-create property patch); it's the wrong way to do this. + +2008-05-28 Dan Williams + + Patch from Benoit Boissinot + + * src/NetworkManagerSystem.c + - (nm_system_device_flush_ip4_routes_with_iface): implement with libnl + - (nm_system_vpn_device_set_from_ip4_config): don't flush routes here, + was causing -EINVAL errors since the libnl code actually does flush + the routes on VPN interfaces now + + * src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - (nm_system_device_flush_ip4_routes, + nm_system_device_flush_ip4_routes_with_iface): remove + +2008-05-28 Dan Williams + + * libnm-util/nm-setting-wireless.c + libnm-util/nm-setting-wireless.h + - (set_property, get_property, nm_setting_wireless_class_init): add the + 'adhoc-create' property, which when TRUE indicates that NM should + create this connection as an adhoc wifi network if it's not found + as an adhoc network during scanning. Can be used to auto-create + adhoc networks when used in combination with autoconnect. + +2008-05-28 Tambet Ingo + + Patch from Dennis Noordsij . + + * src/nm-gsm-device.c: Don't try to reset the modem before PIN is + checked, it doesn't work on some devices. + +2008-05-28 Tambet Ingo + + * src/ppp-manager/nm-ppp-manager.c (nm_ppp_manager_stop): Make sure + pppd gets killed, if SIGTERM doesn't do it's job, SIGKILL it. + + * src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get_ip4_config): + Use inet_aton() everywhere to improve error detection. + Don't fall back to 'dhcp_server_identifier' if the gateway is not + provided. + +2008-05-26 Tambet Ingo + + * system-settings/plugins/ifcfg-suse/plugin.c (get_unamanged_devices_cb): + Fix a typo. + +2008-05-26 Tambet Ingo + + * src/vpn-manager/nm-vpn-manager.c (nm_vpn_manager_get_service): Fix a + reference counting issue. + +2008-05-23 Dan Williams + + Patch from Benoit Boissinot + + * src/backends/NetworkManagerGeneric.c + - (nm_generic_enable_loopback): use libnl + +2008-05-23 Dan Williams + + Patch from Benoit Boissinot + + * src/NetworkManagerSystem.h + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - (nm_system_device_has_active_routes, nm_system_flush_loopback_routes, + nm_system_flush_arp_cache): remove, unused + + * src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + - (nm_generic_device_has_active_routes, nm_generic_flush_loopback_routes, + nm_generic_flush_arp_cache): remove, unused + +2008-05-23 Dan Williams + + * system-settings/plugins/ifcfg-fedora/reader.c + - (make_ip4_setting): honor PEERDNS setting + +2008-05-23 Dan Williams + + Patch from Benoit Boissinot + + * src/NetworkManagerSystem.c + - (nm_system_device_flush_ip4_addresses_with_iface): implement with + libnl + + * src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - (nm_system_device_flush_ip4_addresses, + nm_system_device_flush_ip4_addresses_with_iface): remove + + * src/backends/NetworkManagerGeneric.c + - (nm_generic_device_flush_ip4_addresses, + nm_generic_device_flush_ip4_addresses_with_iface): remove + +2008-05-23 Dan Williams + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - Switch 'bssid' from bytes to keyword type + - (validate_type_keyword): allow NULL keyword lists + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless): convert the bssid from + a byte array to string form, which is what the supplicant expects + +2008-05-23 Tambet Ingo + + Add a flag to NMSettingIP4Config to make it possible to ignore the DNS + information received from DHCP. + + * libnm-util/nm-setting-ip4-config.c: Add a new membet "ignore_dhcp_dns" + to make it possible to ignore the DNS information (both servers and + searches) returned by DHCP server. + + * src/NetworkManagerUtils.c (nm_utils_merge_ip4_config): Reset the + name servers and searches if "ignore_dhcp_dns" is set. + + * src/nm-ip4-config.c (nm_ip4_config_reset_nameservers) + (nm_ip4_config_reset_searches): Implement. + +2008-05-22 Dan Williams + + Remove anything mDNS related. This is better done from a distro-specific + dispatcher script. Plus, any distro using avahi doesn't need to restart + avahi, since avahi can handle interface changes just fine using netlink. + + * configure.in + - Remove --with-mdns-provider + + * src/NetworkManagerPolicy.c + - (global_state_changed): don't restart the mdns provider + + * src/NetworkManagerSystem.h + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - (nm_system_restart_mdns_responder): remove + + * src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + - (nm_generic_restart_mdns_responder): remove + +2008-05-22 Dan Williams + + * configure.in + - clean up crypto options; just use --with-crypto=nss or + --with-crypto=gnutls + +2008-05-22 Tambet Ingo + + * src/nm-manager.c (impl_manager_sleep): No need to schedule the sync + anymore, do it right away. + +2008-05-22 Tambet Ingo + + * src/nm-gsm-device.c (device_state_changed): Make sure we don't leave the + serial device open when we're not connecting or connected. + + * src/nm-cdma-device.c (device_state_changed): Ditto. + +2008-05-22 Tambet Ingo + + Don't remove all devices on waking up, sync with HAL. + + * src/nm-manager.c (nm_manager_udi_is_managed): Implement. + (sync_devices): Implement, based on hal_manager_hal_reappeared_cb. + (hal_manager_hal_reappeared_cb): Just call sync_devices. + +2008-05-21 Tambet Ingo + + * src/NetworkManagerSystem.c (nm_system_device_replace_default_ip4_route): + If the default gateway is unreachable, add a route to gateway and try + again. + +2008-05-20 Dan Williams + + * system-settings/plugins/ifcfg-fedora/reader.c + - (add_one_wep_key): handle ASCII WEP keys too (rh #293111) + +2008-05-19 Dan Williams + + * system-settings/plugins/ifcfg-fedora/reader.c + - (make_ip4_setting): get a fallback gateway from /etc/sysconfig/network + if the ifcfg doesn't specify one (rh #446527) + +2008-05-19 Dan Williams + + Make the system settings service exit when the bus goes away. Since it's + a bus-activated service, it's lifetime is limited to the bus that activated + it (rh #444976). + + * system-settings/src/Makefile.am + system-settings/src/nm-system-config-hal-manager-private.h + - Remove nm-system-config-hal-manager-private.h + + * system-settings/src/nm-system-config-hal-manager.c + - (nm_system_config_hal_manager_reinit_dbus, + nm_system_config_hal_manager_deinit_dbus): remove + + * system-settings/src/main.c + - (dbus_reconnect): remove + - (dbus_cleanup): don't tell the HAL manager to deinit dbus + - (destroy_cb): just quit when the bus goes away + - (start_dbus_service, dbus_init): simplify + - (main): destroy the wired devices hash table after destroying + the HAL manager so we don't have to disconnect signals from the + HAL manager + +2008-05-15 Tambet Ingo + + Move crypto functions from nm-applet to libnm-util. + + * libnm-util/nm-setting-8021x.c (nm_setting_802_1x_set_ca_cert) + (nm_setting_802_1x_set_client_cert) + (nm_setting_802_1x_set_phase2_ca_cert) + (nm_setting_802_1x_set_phase2_client_cert) + (nm_setting_802_1x_set_private_key) + (nm_setting_802_1x_set_phase2_private_key): Implement. Given a certificate + file (or private key and it's password), read the certificate data. + + * libnm-util/crypto_nss.c: + * libnm-util/crypto_gnutls.c: + * libnm-util/crypto.[ch]: Move here from nm-applet. + + * configure.in: Check for NSS and gnutls here (moved here from nm-applet). + + * system-settings/plugins/ifcfg-suse/parser.c (read_wpa_eap_settings): + Imlement WPA-EAP configuration reading from sysconfig. + +2008-05-16 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_set_enabled): request a scan after enabling + wireless + +2008-05-14 Dan Williams + + Fix Linus' bug in rh #134886 + + * src/nm-device-802-3-ethernet.c + - (constructor): request initial carrier state + + * src/nm-netlink-monitor.c + - (nm_netlink_monitor_request_status): schedule emission of carrier + signals after refilling the link cache. Because the refill is a + synchronous operation, the normal message hander won't get called + since libnl has already consumed the messages. + - (deferred_emit_carrier_state): emit carrier states from an idle handler + +2008-05-14 Dan Williams + + * src/NetworkManagerSystem.c + - (nm_system_device_is_up_with_iface): clean up + +2008-05-13 Dan Williams + + Fix refcounting issues over sleep/wake when a VPN connection was active that + caused NM to try registering an object path for a device upon wake that was + the same as an already registered object path. + + * src/nm-device.c + - (nm_device_take_down): properly handle cases where the device is + no longer active but was just active, and therefore must be + deactivated. When a device moves to unmanaged mode, this function + previously would not deactivate the device, because the state was + already unmanaged by the time this function was called. + + * src/vpn-manager/nm-vpn-connection.c + - (device_state_changed): properly handle multiple devices states in + which the device is now deactivated. Code previously didn't handle + transitions to the UNAVAILABLE (like rfkill or carrier off) and + UNMANAGED states. + +2008-05-13 Dan Williams + + * src/nm-device-private.h + src/nm-device.c + - (nm_device_hw_bring_up, nm_device_hw_take_down): export + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_set_enabled): take devices up + and down as appropriate for the rfkill state + +2008-05-13 Dan Williams + + * marshallers/nm-marshal.list + - Add VOID:POINTER,STRING marshaller for ifcfg-fedora plugin + + * system-settings/plugins/ifcfg-fedora/Makefile.am + system-settings/plugins/ifcfg-fedora/nm-inotify-helper.c + system-settings/plugins/ifcfg-fedora/nm-inotify-helper.h + - Implement a minimal inotify helper for watch paths for IN_CLOSE_WRITE + events. Solely for use watching ifcfg files to pick up changes + to their hardlinks, since GIO doesn't support this yet (bgo #532815) + + * system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c + - (nm_ifcfg_connection_class_init): new 'ifcfg-changed' signal when the + file contents change + - (finalize): clean up inotify watches + - (nm_ifcfg_connection_new): store keyfile; inotify watch the keyfile + and the connection ifcfg for changes on their hardlinks + - (files_changed_cb): proxy the changed signal back out to listeners + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (dir_changed): + - (connection_ifcfg_changed): re-read the connection when the ifcfg + changes + - (read_one_connection): connect to change signals on the new connection + - (dir_changed, connection_changed_handler, + handle_connection_remove_or_new): break out connection change + handling and connection new/remove handling so it can be used from + both the GFileMonitor callback and the NMIfcfgConnection changed + signals + + * system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-fedora/reader.h + - (connection_from_file): return the keyfile path the connection would use + +2008-05-13 Tambet Ingo + + * system-settings/src/nm-polkit-helpers.c (create_polkit_context): Use a + single PolKitContext which is shared by all. PolKitContext::unref leaks + just about everything, including all open file descriptiors and results + in 99% cpu usage when data arrives to any of the fds that don't belong + to any context anymore. + +2008-05-12 Dan Williams + + * gfilemonitor/glocaldirectorymonitor.c + gfilemonitor/glocaldirectorymonitor.h + - (g_local_directory_monitor_constructor): actually subscribe to the + watch + - (_g_local_directory_monitor_new): ensure that inotify is started up + + * gfilemonitor/glocalfilemonitor.c + gfilemonitor/glocalfilemonitor.h + - (g_local_file_monitor_constructor): actually subscribe to the watch + - (_g_local_file_monitor_new): ensure that inotify is started up + +2008-05-11 Dan Williams + + * configure.in + - record PolicyKit version + + * system-settings/src/nm-polkit-helpers.c + - (check_polkit_privileges): use polkit_context_can_caller_do_action() + with PolicyKit <= 0.6 + +2008-05-11 Dan Williams + + Update Fedora system-settings plugin to support latest API and use + GFileMonitor rather than home-rolled inotify code. + + * system-settings/plugins/ifcfg-fedora/Makefile.am + system-settings/plugins/ifcfg-fedora/common.h + system-settings/plugins/ifcfg-fedora/plugin.c + - Update to latest system settings plugin API; use GIO instead of + custom inotify code; use NMIfcfgConnection objects instead of + ConnectionData structures tacked onto NMConnection objects + + * system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c + system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.h + - Implement an NMExportedConnection subclass mapping ifcfg files to + connections + + * system-settings/plugins/ifcfg-fedora/reader.c + system-settings/plugins/ifcfg-fedora/reader.h + - Move ifcfg parsing bits here from parser.c + + * system-settings/plugins/ifcfg-fedora/parser.c + system-settings/plugins/ifcfg-fedora/parser.h + - Remove; most code moved to reader.c + +2008-05-11 Dan Williams + + * configure.in + Makefile.am + gfilemonitor/* + - Add a private copy of the GIO GFileMonitor code, with a custom GFile + implementation, so that the same change monitoring code can be used + on systems without glib-2.14 (like Fedora 8) + + * system-settings/plugins/keyfile/Makefile.am + system-settings/plugins/keyfile/plugin.c + system-settings/plugins/ifcfg-suse/Makefile.am + system-settings/plugins/ifcfg-suse/plugin.c + - Use private gfilemonitor code if GIO is not present + +2008-05-09 Tambet Ingo + + * system-settings/plugins/ifcfg-suse/nm-suse-connection.c: Implement + NMExportedConnection's 'update' and 'delete' and return error with + descriptive message. + +2008-05-08 Dan Williams + + Patch from Markus Becker + + * src/nm-gsm-device.c + src/nm-cdma-device.c + - (real_get_best_auto_connection): implement; allow autoconnection + to GSM & CDMA devices + +2008-05-08 Tambet Ingo + + Use PolicyKit to authorize the system settings' AddConnection method + and the system settings connections' Update and Delete methods. + + * libnm-glib/nm-settings.c (impl_exported_connection_update) + (impl_exported_connection_delete, nm_exported_connection_update) + (nm_exported_connection_delete): Return boolean and fill GError + to notify the callers of the reasons why it might have failed. + + * libnm-glib/nm-dbus-settings-system.c + (nm_dbus_settings_system_add_connection): Return the error from dbus + call so that the callers can see why it failed. + + * libnm-glib/nm-dbus-connection.c (update, delete): Update the + signatures. + + * system-settings/src/nm-polkit-helpers.[ch]: Implement. + + * system-settings/src/nm-sysconfig-connection.[ch]: Implement. New + abstract base class that checks PolicyKit permissions. + + * system-settings/src/dbus-settings.c: + (impl_settings_add_connection): Check the policy before carring out + the request. + + * system-settings/plugins/keyfile/nm-keyfile-connection.c: + Inherit from NMSysconfigConnection, check the policies before + allowing updating or removing. + + * system-settings/plugins/ifcfg-suse/nm-suse-connection.c: + Inherit from NMSysconfigConnection. + + * introspection/nm-exported-connection.xml: Annotate "Update" and + "Delete" methods with async flag so that the implementations can get + access to DBusGMethodInvocation. + + * system-settings/src/dbus-settings.c + (settings_add_connection_check_privileges): Implement. + (impl_settings_add_connection): Check the privileges before adding a new + connection. Improve error reporting. + + * introspection/nm-settings-system.xml: Make the 'AddConnection' method + async so that the implementation can access DBusGMethodInvocation. + + * configure.in: Check for PolicyKit. + + * policy/org.freedesktop.network-manager-settings.system.policy: + New file. + + * policy/Makefile.am: Install the policy file. + + * configure.in: Add 'policy' subdir. + +2008-05-08 Tambet Ingo + + Rewrite the suse system settings plugin. + + * system-settings/plugins/ifcfg-suse/plugin.c: Rewrite. + + * system-settings/plugins/ifcfg-suse/parser.c: Rewrite. + + * system-settings/plugins/ifcfg-suse/nm-suse-connection.[ch]: Implement. + + * system-settings/plugins/ifcfg-suse/Makefile.am: Add new files to build. + + * system-settings/src/dbus-settings.c: Fix connection reference counting. + + * system-settings/src/main.c (load_plugins): Improve error reporting. + + * system-settings/src/sha1.[ch] Add. + + * system-settings/src/Makefile.am: Add sha1[ch] to build. + +2008-05-07 Dan Williams + + * system-settings/plugins/keyfile/reader.c + - (read_one_setting_value): handle IP address items separately + - (read_array_of_uint): read IPv4 DNS option as a string array + - (read_array_of_array_of_uint): read IPv4 address tuples as a string + array + + * system-settings/plugins/keyfile/writer.c + - (write_setting_value): handle IP address items separately + - (write_array_of_uint): handle IPv4 DNS option as a string array, + not an array of uint, so that it's user-editable + - (write_array_of_array_of_uint): handle IPv4 address tuples as string + arrays, so they are user-editable + +2008-05-07 Dan Williams + + * system-settings/plugins/keyfile/Makefile.am + - Change location of the keyfile plugin settings to + /etc/NetworkManager/system-connections + +2008-05-05 Tambet Ingo + + * system-settings/plugins/keyfile/nm-keyfile-connection.[ch]: Implement. + + * system-settings/plugins/keyfile/plugin.c: Work with + NMKeyfileConnections. + + * system-settings/src/dbus-settings.c: Remove NMSysconfigExportedConnection. + Plugins are supposed to return NMExportedConnections now and handle the + updated(), removed(), and GetSecrets(). + Store the internal list of connections in hash table to make it easier + to find duplicates. + +2008-05-07 Tambet Ingo + + * src/backends/NetworkManagerSuSE.c (nm_system_set_hostname): Update + for multiple IP addresses. + +2008-05-07 Tambet Ingo + + Patch from André Lemos. + + * libnm-glib/nm-dbus-settings.c (fetch_connections_done): Fix a memory + corruption. + +2008-05-06 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_get_ip4_config): clean up; update for changes to + NMIP4Config to support multiple IP addresses + + * src/NetworkManagerUtils.c + - (nm_utils_merge_ip4_config): update for multiple IP addresses + + * src/nm-ip4-config.c + src/nm-ip4-config.h + - Store a list of IPv4 address/netmask/gateway tuples + - (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway, + nm_ip4_config_get_netmask, nm_ip4_config_set_netmask, + nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast, + nm_ip4_config_set_address): remove + - (nm_ip4_config_take_address, nm_ip4_config_add_address, + nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses): + new functions; handle multiple IPv4 addresses + + * src/nm-device.c + src/ppp-manager/nm-ppp-manager.c + src/vpn-manager/nm-vpn-connection.c + src/NetworkManagerPolicy.c + test/nm-tool.c + libnm-glib/libnm-glib-test.c + - update for changes to NMIP4Config for multiple IPv4 addresses + + * src/NetworkManagerSystem.c + - (nm_system_device_set_ip4_route): don't add the route if any address + is on the same subnet as the destination + - (check_one_address): ignore the exact match, just match family and + interface index + - (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to + an interface + - (nm_system_device_set_from_ip4_config): use add_ip4_addresses() + - (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses() + + * introspection/nm-ip4-config.xml + - Remove 'address', 'gateway', 'netmask', and 'broadcast' properties + - Add 'addresses' property which is an array of (uuu) tuples of + address/netmask/gateway + + * libnm-util/nm-setting-ip4-config.c + - (set_property): use ip-address <-> GValue converters from nm-utils.c + + * libnm-glib/nm-ip4-config.c + libnm-glib/nm-ip4-config.h + - Handle D-Bus interface changes to support multiple IP addresses + +2008-05-06 Dan Williams + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + - (nm_utils_ip4_addresses_from_gvalue, + nm_utils_ip4_addresses_to_gvalue): new functions + +2008-05-06 Tambet Ingo + + * libnm-glib/nm-dbus-settings.c (fetch_connections_done): Don't leak + the returned connection paths. + +2008-05-05 Tambet Ingo + + * libnm-glib/nm-dbus-settings.c (constructor): Fix the + "PropertiesChanged" signal signature. + + * libnm-glib/nm-dbus-connection.c (constructor): Use the common GType + defined in nm-dbus-glib-types.h. + Don't register the connection on dbus, we're a proxy class to + communicate with an already registered connection over dbus. + +2008-04-30 Tambet Ingo + + Implement new subclasses of NMSettings and NMExportedConnection to make + it easier for the applet to access and modify system settings. + + * libnm-glib/nm-dbus-connection.[ch]: + * libnm-glib/nm-dbus-settings.[ch]: + * libnm-glib/nm-dbus-settings-system.[ch]: Implement. + + * libnm-glib/Makefile.am: Add the new files to build, generate some more + bindings and glue. + + * include/NetworkManager.h: Define the system settings DBus interface. + +2008-04-30 Tambet Ingo + + Implement additional C API for exported connections to make them identical + with the DBus API. Change the (list_connections) virtual function to be + more usable from C - instead of requiring implementers to return a GPtrArray + of dbus paths, return a list of connections. + + * libnm-glib/nm-settings.c (nm_exported_connection_class_init): Fix a typo. + (nm_settings_list_connections): + (nm_exported_connection_new): + (nm_exported_connection_update): + (nm_exported_connection_delete): Implement. + + (impl_settings_list_connections): + (impl_exported_connection_update): + (impl_exported_connection_delete): Use the new public functions to make + sure the C and dbus interfaces stay in sync. + + * system-settings/src/dbus-settings.c (list_connections): Return a list of + connections. + +2008-05-02 Dan Williams + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (dispose): use right unref call on the DBusGConnection + +2008-05-02 Dan Williams + + * src/nm-serial-device.c + - (find_terminator): don't compare the whole line, just the size of the + terminator, since some modems put stuff after the terminator, like + "CONNECT 9600" + +2008-05-01 Dan Williams + + Patch from Michael Biebl + + * callouts/Makefile.am + callouts/org.freedesktop.nm_dispatcher.service.in + system-settings/src/Makefile.am + system-settings/src/org.freedesktop.NetworkManagerSystemSettings.service.in + - use the right install location for dbus-activated stuff + +2008-04-30 Dan Williams + + * src/nm-gsm-device.c + - (enter_pin): fix setting name passed to applets when asking for a GSM + PIN or PUK + +2008-04-30 Dan Williams + + * src/nm-manager.c + - (nm_manager_error_get_type): remove erroneous NULL enum from table + +2008-04-30 Dan Williams + + * src/nm-device-802-3-ethernet.c + src/nm-device-802-11-wireless.c + - (real_is_up): return true instead of chaining up to unimplemented + parent method + +2008-04-30 Dan Williams + + * src/NetworkManagerSystem.c + src/NetworkManagerSystem.h + - (nm_system_device_is_up, nm_system_device_is_up_with_iface): new + functions to check device flags for IFF_UP + + * src/nm-serial-device.c + - (real_is_up): remove; NMDevice now returns TRUE if the subclass doesn't + implement is_up + + * src/nm-device-802-3-ethernet.c + src/nm-device-802-11-wireless.c + - (real_hw_is_up): call nm_system_device_is_up() + + * src/nm-device.c + - (real_hw_is_up): move to nm_system_device_is_up_with_iface() + - (real_is_up): remove; nm_device_is_up() returns TRUE if subclass + does not implement + +2008-04-29 Dan Williams + + Handle HAL dropouts better; allow NM to start up even if HAL isn't up yet. + + * marshallers/nm-marshal.list + - Add marshaller + + * src/NetworkManager.c + - (main): let the NMManager handle the NMHalManager + + * src/nm-hal-manager.c + src/nm-hal-manager.h + - convert to a GObject, and emit singals when stuff changes. Let the + NMManager handle the signals, instead of the NMHalManager calling + into the NMManager. + + * src/nm-manager.c + src/nm-manager.h + - (remove_one_device): consolidate device removals here + - (dispose): use remove_one_device() + - (nm_manager_get_device_by_udi): make static + - (deferred_hal_manager_query_devices): idle handler to query the HAL + manager for devices at startup or wakeup time + - (nm_manager_new): create and monitor the HAL manager + - (hal_manager_udi_added_cb): new function; do what + nm_manager_add_device() used to do when signalled by the hal manager + - (hal_manager_udi_removed_cb): new function; do what + nm_manager_remove_device() used to do when signalled by the hal + manager + - (hal_manager_rfkill_changed_cb): handle rfkill changes from the + hal manager + - (hal_manager_hal_reappeared_cb): when HAL comes back, remove devices + in our device list that aren't known to HAL + - (impl_manager_sleep): on wakeup, re-add devices from an idle handler; + see comments on nm-hal-manager.c::nm_manager_state_changed() a few + commits ago + - (nm_manager_get_device_by_path, nm_manager_is_udi_managed, + nm_manager_activation_pending, nm_manager_wireless_enabled, + nm_manager_wireless_hardware_enabled, + nm_manager_set_wireless_hardware_enabled): remove, unused + +2008-04-28 Dan Williams + + Fix the device up/down ambiguities. Up/down state used to be a + conglomeration of hardware state (IFF_UP) and any device-specific things + (supplicant, periodic timers, etc) that the device used to indicate + readiness. Unfortunately, if the hardware was already IFF_UP for some + reason, then the device specific stuff wouldn't get run, and the device + would be stuck. + + * src/nm-device.c + src/nm-device.h + - Create hw_is_up, hw_bring_up, and hw_take_down + - Rename bring_down -> take_down + - (real_hw_is_up): check interface flags for IFF_UP + - (nm_device_hw_is_up): let subclasses figure out their own HW state + - (nm_device_is_up): make static; only used locally + - (nm_device_hw_bring_up): update the hardware and IPv4 addresses even + if the device is already up; if the device isn't up, bring it up + - (nm_device_hw_take_down): just take down hardware + - (nm_device_bring_up): bring up HW first, then device specific stuff + - (nm_device_take_down): always deactivate device when called; always + try to take hardware down too + - (nm_device_state_changed): take device down when entering unmanaged + state from a higher state + + * src/nm-device-802-11-wireless.c + - (real_hw_is_up, real_hw_bring_up, real_hw_take_down): implement; just + check IFF_UP really + - (real_take_down, supplicant_iface_state_cb_handler, + supplicant_iface_connection_state_cb_handler, + supplicant_mgr_state_cb_handler): fix some messages + + * src/nm-device-802-3-ethernet.c + - (real_hw_is_up, real_hw_bring_up, real_hw_take_down): implement; just + check IFF_UP really + +2008-04-28 Dan Williams + + * src/nm-manager.c + src/nm-manager.h + - (nm_manager_error_get_type): add new error + - (nm_manager_remove_device): don't bother taking down the device here, + the state change from unmanaging the device will do it + - (impl_manager_sleep): move nm_manager_sleep() here since nothing else + uses it; when going to sleep, just unmanage the device instead of + taking it down, because stuff will cleaned up correctly when the + device gets unmanaged + +2008-04-28 Dan Williams + + * src/nm-hal-manager.c + - (add_initial_devices): convert to a GSourceFunc prototype + - (nm_manager_state_changed): when coming out of sleep, punt the + device re-addition to an idle handler to let D-Bus events go out + first, fixing a potential dbus-glib assert if the old device was + not yet disposed (due to references held while emitting the D-Bus + signals) but the new device was found, because the mainloop didn't + run between signal emission and add_initial_devices() + +2008-04-27 Dan Williams + + Patch from Benoit Boissinot + + * initscript/paldo/NetworkManager.in + initscript/SUSE/networkmanager.in + - Remove last bits of dhcdbd + +2008-04-27 Dan Williams + + * src/nm-device-802-11-wireless.c + - (link_timeout_cb): don't ask for secrets when disconnected during + association/authentication phase, drivers are still just too crappy + +2008-04-27 Dan Williams + + * Makefile.am + configure.in + dispatcher-daemon/Makefile.am + dispatcher-daemon/NetworkManagerDispatcher.c + initscript/Arch/Makefile.am + initscript/Arch/networkmanager-dispatcher.in + initscript/Gentoo/Makefile.am + initscript/Gentoo/NetworkManagerDispatcher.in + initscript/Mandriva/Makefile.am + initscript/Mandriva/networkmanagerdispatcher.in + initscript/RedHat/Makefile.am + initscript/RedHat/NetworkManagerDispatcher.in + initscript/SUSE/Makefile.am + initscript/SUSE/networkmanager-dispatcher.in + initscript/Slackware/Makefile.am + initscript/Slackware/rc.networkmanager-dispatcher.in + initscript/paldo/Makefile.am + initscript/paldo/NetworkManagerDispatcher.in + man/Makefile.am + man/NetworkManagerDispatcher.8.in + - Remove the dispatcher daemon + +2008-04-27 Dan Williams + + * callouts/Makefile.am + callouts/nm-dispatcher-action.c + callouts/nm-dispatcher-action.h + callouts/nm-dispatcher.conf + callouts/nm-dispatcher.xml + callouts/org.freedesktop.nm_dispatcher.service + - Re-implement the dispatcher as a system-bus activated service that + NM calls on-demand, rather than an always running daemon + + * src/Makefile.am + - Add callouts dir to includes to pick up dispatcher defines + + * src/nm-device.c + - (nm_device_state_changed): call dispatcher on device activated/ + deactivated + + * src/vpn-manager/nm-vpn-connection.c + - (nm_vpn_connection_set_vpn_state): call dispatcher when VPN connections + go up and down + + * src/NetworkManagerUtils.c + src/NetworkManagerUtils.h + - (nm_utils_call_dispatcher): helper to call dispatcher + +2008-04-27 Dan Williams + + * src/NetworkManagerUtils.c + src/NetworkManagerUtils.h + - remove unneeded includes + - (nm_null_safe_strcmp, nm_ethernet_addresses_are_equal, + nm_utils_inet_ip4_address_as_string, nm_timeval_has_passed, + nm_timeval_cmp, nm_timeval_add): remove, unused + - clean up formatting + - (nm_spawn_process): de-uglify + + * src/nm-device-802-11-wireless.c + - (get_active_ap): use memcmp() not nm_ethernet_addresses_are_equal() + +2008-04-26 Saleem Abdulrasool + + * initscript/Gentoo/NetworkManager.in: + Fix for starting the daemon. + +2008-04-25 Dan Williams + + Patch from Benoit Boissinot + + * src/NetworkManagerSystem.c + - (nm_system_device_set_ip4_route): reimplement using libnl, not ioctls + +2008-04-25 Dan Williams + + Patch from Benoit Boissinot + + * src/NetworkManagerSystem.c + - (nm_system_device_replace_default_ip4_route): new function; a libnl + implementation of nm_system_device_replace_default_route() + + * src/NetworkManagerPolicy.c + - (update_default_route): use nm_system_device_replace_default_ip4_route() + + * src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - (nm_system_device_replace_default_route): remove + +2008-04-25 Dan Williams + + Patch from Benoit Boissinot + + * src/NetworkManagerSystem.c + - (validate_ip4_route): remove; use nl_addr_parse() instead + - (nm_system_device_add_ip4_route_via_device_with_iface): new function, + replace nm_system_device_add_route_via_device_with_iface() in the + backends + + * src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - Remove nm_system_device_add_route_via_device_with_iface() + +2008-04-25 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (GET_ONE_DNS): fix parsing of DNS2 & DNS3 + +2008-04-24 Dan Williams + + * dispatcher-daemon/NetworkManagerDispatcher.c + - (nmd_execute_scripts): execute scripts in order as sorted by strcmp() + +2008-04-24 Dan Williams + + * initscript/RedHat/NetworkManager.in + initscript/RedHat/NetworkManagerDispatcher.in + - Be active at runlevel 2 + - Adjust priorities earlier + +2008-04-22 Dan Williams + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): when checking for a gateway, look at the + composite IP4 config, not the connection's ip4-config setting, which + doesn't include DHCP-returned information + +2008-04-22 Tambet Ingo + + Implement GKeyFile system settings plugin. + Implement writing system settings (currently supported only by GKeyFile plugin). + + * system-settings/src/main.c: + * system-settings/src/dbus-settings.c: Move the communication with plugins + from main.c to dbus-settings.c. Makes it possible to talk to all registered + plugins for adding/updating/removing connections. + + * system-settings/src/nm-system-config-interface.c + (nm_system_config_interface_add_connection): Implement + (nm_system_config_interface_update_connection): Implement. + (nm_system_config_interface_remove_connection): Implement. + + * system-settings/plugins/keyfile/Makefile.am: + * system-settings/plugins/keyfile/plugin.[ch]: + * system-settings/plugins/keyfile/writer.[ch]: + * system-settings/plugins/keyfile/reader.[ch]: Implement. + + * system-settings/plugins/Makefile.am: Add GKeyFile plugin. + + * configure.in: Generate GKeyFile Makefile. + + * libnm-glib/nm-settings.c (impl_exported_connection_get_id): Fix a memory + corruption, need to duplicate the returned string. + (impl_exported_connection_update): Implement. + (impl_exported_connection_delete): Implement. + + * introspection/nm-settings-system.xml: Add "AddConnection" method. + + * introspection/nm-exported-connection.xml: Add "Update" and "Delete" methods. + +2008-04-22 Dan Williams + + Patch from Charles R. Anderson (cra@wpi.edu) + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): don't select devices without a gateway + as having the default route (rh #437338) + +2008-04-21 Dan Williams + + * src/nm-activation-request.c + src/nm-activation-request.h + - (dispose): ensure to disconnect from the device's state-changed signal + when appropriate so the signal doesn't get handled by an already + disposed NMActRequest + - (device_state_changed): update is_default here too just to make sure + default is only True when the child device is activated + - (nm_act_request_set_default): new function + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): set 'default' on the active connection which + has the default route and DNS + +2008-04-21 Dan Williams + + * src/NetworkManagerPolicy.c + - (device_state_changed): update routing and DNS when a device goes + into unmanaged or unavailable states too (like rfkill or carrier loss) + +2008-04-21 Dan Williams + + * include/NetworkManager.h + - Add NMActiveConnectionState enum + + * introspection/nm-active-connection.xml + introspection/nm-vpn-connection.xml + - Add 'State' property for overall active connection state + - Add 'Default' property, when True means this active connection + has the default route + - Add PropertyChanged signals so changes actually go out over the bus + + * src/nm-active-connection.h + - Add defines for State & Default properties + + * src/nm-activation-request.c + - Add 'state' and 'default' properties, hook up to device 'state-changed' + signal to determine active connection state + + * src/vpn-manager/nm-vpn-connection.c + src/vpn-manager/nm-vpn-connection.h + src/vpn-manager/nm-vpn-manager.c + src/vpn-manager/nm-vpn-service.c + - Rename old 'state' to 'vpn-state' + - Rename nm_vpn_connection_get_state() -> nm_vpn_connection_get_vpn_state() + - Add 'state' and 'default' properties, hook up to the vpn connection's + 'vpn-state-changed' signal + + * libnm-glib/nm-active-connection.c + libnm-glib/nm-active-connection.h + - Add new 'state' and 'default' properties and accessors + + * libnm-glib/nm-vpn-connection.c + libnm-glib/nm-vpn-connection.h + - Rename old 'state' property to 'vpn-state' + - Add new 'state' and 'default' properties and accessors + +2008-04-21 Dan Williams + + * src/nm-ip4-config.c + - (nm_ip4_config_to_rtnl_addr): fill in the broadcast address if it's + not specified (rh #443474) + +2008-04-20 Dan Williams + + * src/NetworkManagerUtils.c + src/NetworkManagerUtils.h + - (nm_utils_merge_ip4_config): new function; merge settings from an + NMSettingIP4Config to an NMIP4Config object + + * src/nm-device.c + - (merge_ip4_config): move to NetworkManagerUtils.c + + * src/vpn-manager/nm-vpn-connection.c + - (nm_vpn_connection_ip4_config_get): merge in user-specified settings + too + +2008-04-18 Dan Williams + + * libnm-util/nm-setting-ppp.c + libnm-util/nm-setting-ppp.h + - Add 'no-vj-comp' option for TCP header compression + - baud, mru, mtu, lcp_echo_failure, and lcp_echo_interval are really + uint32 + +2008-04-18 Dan Williams + + * libnm-util/nm-setting-ppp.c + libnm-util/nm-setting-ppp.h + src/ppp-manager/nm-ppp-manager.c + - Add 'refuse-pap' and 'refuse-mschapv2' options + +2008-04-18 Dan Williams + + * libnm-util/nm-setting-ppp.c + libnm-util/nm-setting-ppp.h + src/ppp-manager/nm-ppp-manager.c + - Remove the 'usepeerdns' option and always request DNS servers from + the PPP server; the connection chooses to use/override/ignore the + DNS servers returned from the PPP server + +2008-04-18 Dan Williams + + * libnm-util/nm-setting-ppp.c + libnm-util/nm-setting-ppp.h + src/ppp-manager/nm-ppp-manager.c + - Remove the 'require-mppc' option, because pppd doesn't support it and + it seems to have been an erroneous addition to the PPTP plugin in + the first place (from which the ppp-manager is derived) + +2008-04-17 Dan Williams + + * libnm-util/nm-setting-pppoe.c + - (verify): require a PPP setting too + + * src/ppp-manager/nm-ppp-manager.c + - (nm_ppp_manager_start): fail if no PPP setting is present instead of + segfaulting + +2008-04-17 Dan Williams + + * src/nm-device.c + - (nm_device_state_changed): do deactivation and and promotion to + unavailable here, so that the device gets cleaned up before the + manager runs and starts emitting signals; do the + FAILED->DISCONNECTED transition from an idle handler rather than + immediately to guard against recursion + - (nm_device_deactivate_quickly, nm_device_dispose): stop the + FAILED->DISCONNECTED handler if it's scheduled + +2008-04-17 Dan Williams + + * src/nm-device-802-11-wireless.c + - (state_changed_cb): clear AP list when device transitions to + unavailable or unmanaged + - (nm_device_802_11_wireless_dispose): remove redundant set_current_ap() + since this is already done in device_cleanup() + - (supplicant_iface_scanned_ap_cb): don't leak new APs when the device + isn't available or managed + - (device_cleanup): use remove_all_aps() + - (remove_all_aps): consolidate code removing all APs + +2008-04-17 Dan Williams + + * src/nm-serial-device.c + src/nm-serial-device.h + - (wait_for_reply_got_data): break input into lines, and search each + line for responses _and_ terminator strings; also make sure that + the read loop doesn't continue after the timeout is supposed to fire + - (nm_serial_device_wait_for_reply): take an array of terminators too + + * src/nm-gsm-device.c + src/nm-cdma-device.c + - Send terminators to nm_serial_device_wait_for_reply() + +2008-04-16 Dan Williams + + Patch from 陈鑫 + + * src/ppp-manager/nm-pppd-plugin.c + - (get_credentials): return correct value for success; handle case where + pppd just does some checking but doesn't want a password + - (plugin_init): make CHAP work too + +2008-04-16 Dan Williams + + Patch from 陈鑫 + + * src/ppp-manager/nm-ppp-manager.c + - (create_pppd_cmd_line): fix argument generation when spawning pppd + +2008-04-16 Dan Williams + + Patch from 陈鑫 + + * src/nm-device-802-3-ethernet.c + - (real_deactivate_quickly): clear the IP interface name on + deactivation, otherwise the wrong interface might get used later + for routing and IP management + +2008-04-15 Dan Williams + + * libnm-glib/nm-device.c + - (get_product_and_vendor): handle serial devices correctly + - (nm_device_update_description): pass device to get_product_and_vendor() + +2008-04-15 Dan Williams + + Patch from Benoit Boissinot + + * src/NetworkManagerSystem.h + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + src/nm-device.c + - (nm_generic_device_add_ip6_link_address, + nm_system_device_add_ip6_link_address): remove + +2008-04-15 Dan Williams + + Patch from Benoit Boissinot + + * src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + src/NetworkManagerSystem.h + - flush_routes -> flush_ip4_routes + - flush_addresses -> flush_ip4_addresses + + * src/NetworkManagerSystem.c + src/nm-device.c + src/vpn-manager/nm-vpn-connection.c + - flush only IPv4 addresses; don't touch IPv6 routes and addresses + +2008-04-15 Dan Williams + + Remove exposure of wireless-tools mode types in the API. + + * include/NetworkManager.h + - Define NM80211Mode enum + + * introspection/generic-types.xml + - Describe NM_802_11_MODE enum + - Remove IW_MODE_* enum + + * introspection/nm-access-point.xml + libnm-glib/nm-access-point.c + libnm-glib/nm-access-point.h + - 'mode' is now of type NM80211Mode, a DBUS_TYPE_UINT + + * introspection/nm-device-802-11-wireless.xml + libnm-glib/nm-device-802-11-wireless.c + libnm-glib/nm-device-802-11-wireless.h + - 'mode' is now of type NM80211Mode, a DBUS_TYPE_UINT + + * libnm-util/nm-setting-wireless.c + src/NetworkManagerAP.c + src/NetworkManagerAP.h + src/nm-device-802-11-wireless.c + src/nm-device-802-11-wireless.h + test/nm-tool.c + - Use NM80211Mode not IW_MODE_* + +2008-04-15 Dan Williams + + Enhance nm-online based on a patch from Bill Nottingham. + + * test/nm-online.c + - Add a '-q' option + - Add help messages and option summary + - Add long-format options + - Add a '-x' option to exit if NM isn't running or isn't connecting + +2008-04-15 Tambet Ingo + + * libnm-util/nm-setting.c (nm_setting_duplicate): Implement. + + * libnm-util/nm-connection.c (nm_connection_remove_setting): Implement. + +2008-04-15 Dan Williams + + * nm-setting-ip4-config.c + - (ip4_addresses_from_gvalue): handle NULL address array + + * nm-setting-8021x.c + - (verify_tls, verify_ttls): warn on failed verification + +2008-04-10 Dan Williams + + * src/nm-gsm-device.c + - (automatic_registration): accept "+CREG: 0,0" + - (automatic_registration_response): fail on "+CREG: 0,0" + +2008-04-10 Tambet Ingo + + * libnm-util/nm-setting-wired.c (get_property): Fix a typo. + +2008-04-10 Tambet Ingo + + * system-settings/plugins/ifcfg-suse/parser.c (make_wireless_security_setting): + Make it compile again by commenting out broken code that at first didn't work and + now didn't compile either. + +2008-04-08 Dan Williams + + * libnm-glib/nm-object-cache.c + libnm-glib/nm-settings.c + src/dhcp-manager/nm-dhcp-manager.c + system-settings/plugins/ifcfg-fedora/plugin.c + system-settings/plugins/ifcfg-suse/plugin.c + system-settings/src/nm-system-config-hal-manager.c + libnm-util/nm-utils.c + - Remove usage of GStaticMutex since gcc-4.3 hates it and because we're + not threadsafe anyway + +2008-04-08 Dan Williams + + * system-settings/src/main.c + - (load_stuff, device_added_cb, device_removed_cb): device added/removed + callbacks take a device type too + +2008-04-08 Dan Williams + + The system settings service will now create a new default DHCP connection + for wired devices that have no existing applicable connection. + + * system-settings/src/nm-system-config-hal-manager.c + system-settings/src/nm-system-config-hal-manager.h + - (nm_system_config_hal_manager_get_type_for_udi): new function + + * system-settings/src/dbus-settings.c + system-settings/src/dbus-settings.h + - (nm_sysconfig_settings_get_connections): new function + - (nm_sysconfig_settings_is_device_managed): new function + + * system-settings/src/main.c + - (load_stuff): check for wired devices that need a default connection + - (get_details_for_udi): get interface and MAC address from HAL + - (add_default_dhcp_connection): add a default connection for a wired + device if needed + - (device_added_cb, device_removed_cb): do the right thing with + wired devices and their default connections on HAL device events + +2008-04-07 Dan Williams + + * libnm-glib/nm-device.c + libnm-glib/nm-device.h + - Proxy the 'managed' property + +2008-04-07 Dan Williams + + * src/nm-gsm-device.c + src/nm-cdma-device.c + - (state_changed_cb): when entering UNAVAILABLE state, schedule an idle + handler to transition to DISCONNECTED + +2008-04-07 Dan Williams + + Patch from Bill Nottingham + + * dispatcher-daemon/NetworkManagerDispatcher.c + - ignore backup/packaging crufy (rh #440143) + +2008-04-07 Dan Williams + + * include/NetworkManager.h + - Remove the DOWN and CANCELLED device states + - Add UNMANAGED and UNAVAILABLE device states + - Document the device states + + * introspection/nm-device.xml + src/nm-device-interface.c + src/nm-device-interface.h + - Add the 'managed' property + + * test/nm-tool.c + - (detail_device): print out device state + + * src/NetworkManagerSystem.h + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerMandriva.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - (nm_system_device_get_system_config, nm_system_device_get_disabled + nm_system_device_free_system_config): remove; they were unused and + their functionality should be re-implemented in each distro's + system settings service plugin + + * src/nm-gsm-device.c + src/nm-gsm-device.h + src/nm-cdma-device.c + src/nm-cdma-device.h + - (*_new): take the 'managed' argument + + * src/nm-device.c + - (nm_device_set_address): remove, fold into nm_device_bring_up() + - (nm_device_init): start in unmanaged state, not disconnected + - (constructor): don't start device until the system settings service + has had a chance to figure out if the device is managed or not + - (nm_device_deactivate, nm_device_bring_up, nm_device_bring_down): + don't set device state here, let callers handle that as appropriate + - (nm_device_dispose): don't touch the device if it's not managed + - (set_property, get_property, nm_device_class_init): implement the + 'managed' property + - (nm_device_state_changed): bring the device up if its now managed, + and deactivate it if it used to be active + - (nm_device_get_managed, nm_device_set_managed): do the right thing + with the managed state + + * src/nm-hal-manager.c + - (wired_device_creator, wireless_device_creator, modem_device_creator): + take initial managed state and pass it along to device constructors + - (create_device_and_add_to_list): get managed state and pass to + type creators + + * src/nm-device-802-11-wireless.c + - (real_can_activate): fold in most of + nm_device_802_11_wireless_can_activate() + - (can_scan): can't scan in UNAVAILABLE or UNMANAGED + - (link_timeout_cb): instead of deactivating, change device state and + let the device state handler to it + - (real_update_hw_address): clean up + - (state_changed_cb): when entering UNAVAILABLE state, schedule an idle + handler to transition to DISCONNECTED if the device isn't rfkilled + + * src/nm-device-802-3-ethernet.c + - (set_carrier): move above callers and get rid of prototype + - (device_state_changed): when entering UNAVAILABLE state, schedule an + idle handler to transition to DISCONNECTED if the device has a + carrier + - (real_update_hw_address): clean up + - (link_timeout_cb, ppp_state_changed): change state instead of calling + deactivation directly as deactivation doesn't change state anymore + + * src/NetworkManagerPolicy.c + - (schedule_activate_check): yay, remove wireless_enabled hack since + the NMManager and wireless devices work that out themselves now + - (device_state_changed): change to a switch and update for new device + states + - (device_carrier_changed): remove; device handles this now through + state changes + - (device_added): don't care about carrier any more; the initial + activation check will happen when the device transitions to + DISCONNECTED + + * src/nm-manager.c + - (dispose): clear unmanaged devices + - (handle_unmanaged_devices): update unmanaged device list and toggle + the managed property on each device when needed + - (system_settings_properties_changed_cb): handle signals from the + system settings service + - (system_settings_get_unmanaged_devices_cb): handle callback from + getting the unmanaged device list method call + - (query_unmanaged_devices): ask the system settings service for its + list of unmanaged devices + - (nm_manager_name_owner_changed, initial_get_connections): get unmanaged + devices + - (manager_set_wireless_enabled): push rfkill state down to wireless + devices directly and let them handle the necessary state transitions + - (manager_device_state_changed): update for new device states + - (nm_manager_add_device): set initial rfkill state on wireless devices + - (nm_manager_remove_device): don't touch the device if it's unmanaged + - (nm_manager_activate_connection): return error if the device is + unmanaged + - (nm_manager_sleep): handle new device states correctly; don't change + the state of unavailable/unmanaged devices + + * libnm-glib/nm-device-802-11-wireless.c + - (state_changed_cb): update for new device states + +2008-04-07 Dan Williams + + * marshallers/nm-marshal.list + - Add VOID:STRING,UINT marshaller for system settings HAL manager + +2008-04-07 Dan Williams + + * system-settings/src/main.c + - (unmanaged_devices_changed_cb, register_plugin): proxy changes from + plugins to the dbus settings object + - (load_stuff): start the dbus service after grabbing unmanaged devices + - (dbus_reconnect, dbus_cleanup): make HAL manager aware of dbus events + - (log_handler, logging_setup, logging_shutdown): log output to syslog + - (main): switch default logging to syslog with a 'debug' option to + output to console; start up the HAL manager + +2008-04-07 Dan Williams + + * introspection/nm-settings-system.xml + introspection/Makefile.am + - Define the unmanaged devices interface for the system settings service + + * system-settings/src/nm-system-config-hal-manager.c + system-settings/src/nm-system-config-hal-manager.h + system-settings/src/nm-system-config-hal-manager-private.h + system-settings/src/Makefile.am + - Add a lightweight HAL manager object for tracking network devices for + the purpose of determining unmanaged devices and which devices need + the default DHCP connections + + * system-settings/src/nm-system-config-interface.c + system-settings/src/nm-system-config-interface.h + - (nm_system_config_interface_init): add the HAL manager as an argument + - (nm_system_config_interface_get_unmanaged_devices): implement + - Define 'unmanaged-devices-changed' signal + + * system-settings/src/dbus-settings.c + system-settings/src/dbus-settings.h + - Implement the unmanaged devices interface; some cleanups + + * system-settings/plugins/ifcfg-suse/plugin.c + - Fixup for plugin interface changes + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (get_ether_device_udi): new function; find the device that has + a specified MAC address and return its UDI + - (get_udi_for_connection): new function; try to find the specific + device a connection is locked to, if any + - (device_added_cb, device_removed_cb): update unmanaged device list in + response to HAL events + - (get_unmanaged_devices): new function; return unmanaged device list + - (build_one_connection): set the connection's locked device, if any + - (write_auto_wired_connection): remove + - (kill_old_auto_wired_file): remove the ifcfg-Auto Wired file if found + - (handle_connection_changed): alert listeners that the unmanaged device + list has changed + - (init): fixup for plugin interface changes, implement unmanaged devices + + * system-settings/plugins/ifcfg-fedora/parser.c + system-settings/plugins/ifcfg-fedora/parser.h + - (connection_data_free): clean up connection UDI + +2008-04-07 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (make_ip4_setting): fix parsing of DNS servers + +2008-04-05 Dan Williams + + * Makefile.am + configure.in + marshallers/Makefile.am + marshallers/nm-marshal-main.c + marshallers/nm-marshal.list + - Consolidate marshallers + + * libnm-glib/nm-marshal-main.c + libnm-glib/nm-marshal.list + src/marshallers/Makefile.am + src/marshallers/nm-marshal-main.c + src/marshallers/nm-marshal.list + - Remove + + * libnm-glib/Makefile.am + src/Makefile.am + src/dhcp-manager/Makefile.am + src/ppp-manager/Makefile.am + src/supplicant-manager/Makefile.am + src/vpn-manager/Makefile.am + - Use consolidated marshallers + +2008-04-04 Dan Williams + + * src/nm-hal-manager.c + src/nm-hal-manager.h + - (hal_init): don't look for hardware here + - (nm_hal_manager_start): new function; look for hardware here instead, + which can be done at a later time than hal_init() + + * src/NetworkManager.c + - (main): start HAL manager after entering the main loop + +2008-04-03 Dan Williams + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - (nm_exported_connection_get_id): new function + - (impl_exported_connection_get_id): use nm_exported_connection_get_id() + +2008-04-02 Dan Williams + + * src/nm-device-interface.c + src/nm-device-interface.h + src/nm-device.c + src/nm-device.h + - Rename check_connection_conflicts() to check_connection_compatible() + + * src/nm-device-802-11-wireless.c + - (real_check_connection_conflicts): remove + - (real_check_connection_compatible): implement; match MAC address + + * src/nm-device-802-3-ethernet.c + - (real_check_connection_conflicts): remove + - (real_check_connection_compatible): implement; match MAC address + - (real_get_best_auto_connection): correctly handle PPPoE cases + + * src/nm-manager.c + - (check_connection_allowed): remove; unused until PolicyKit integration + - (internal_activate_device): check whether the connection is compatible + with the device before trying to activate it + +2008-04-02 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (read_mac_address): new function; read in MAC address and stuff it + into the connection + - (add_one_wep_key): remove debug spew + - (make_wireless_security_setting): validate the default TX key; don't + add the wireless-security setting if the connection doesn't need + security; don't leak the keys shvarFile on error cases + - (make_wireless_setting, make_wired_setting): populate device's MAC + address + +2008-04-02 Dan Williams + + * libnm-util/nm-setting-connection.c + libnm-util/nm-setting-connection.h + - (set_property, get_property, nm_setting_connection_class_init): remove + the 'lockdown' property; it's functionality will be replaced by + PolicyKit instead + +2008-04-01 Dan Williams + + Patch from Per Øyvind Karlsen + + * configure.in + initscript/Makefile.am + initscript/Mandriva/Makefile.am + initscript/Mandriva/networkmanager.in + initscript/Mandriva/networkmanagerdispatcher.in + src/backends/Makefile.am + src/backends/NetworkManagerMandriva.c + system-settings/plugins/Makefile.am + - Add Mandriva support + +2008-03-31 Dan Williams + + * src/vpn-manager/nm-vpn-service.c + - (nm_vpn_service_daemon_exec): add an error argument so that spawn + errors can be passed back to the caller; also no longer scheduled + as an idle handler, but called directly; and bump up VPN service + spawn timeout, 2s is really short + - (nm_vpn_service_activate): don't schedule the VPN service activation, + but call it directly so that errors are reported on return from + ActivateConnection() and don't get lost. If scheduled as an idle + handler, clients don't have the time to query NM for the new VPN + connection's properties before the VPN connection is torn down again + if the service couldn't be launched, and therefore launch errors + get lost. + +2008-03-31 Dan Williams + + * src/vpn-manager/nm-vpn-connection.c + - (device_state_changed): send correct state on device failure too + - (plugin_state_changed): failed state means unexpected disconnection, + thus if the service goes away while the VPN connection is activated + that's a failure too + +2008-03-31 Dan Williams + + * src/vpn-manager/nm-vpn-manager.c + src/vpn-manager/nm-vpn-manager.h + - Make VPNManager errors more available; add a service-start-failed error + +2008-03-31 Dan Williams + + * libnm-glib/nm-client.c + libnm-glib/nm-client.h + - (activate_cb): pass the new active connection to callback; fix + message when no callback is specified + +2008-03-30 Dan Williams + + * libnm-util/nm-setting-wireless-security.c + - (need_secrets): only require key0 if the transmit key index is also + 0 + - (verify): reject non-NULL but zero-length WEP keys; these are invalid + +2008-03-29 Dan Williams + + * libnm-util/nm-setting-8021x.c + libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-vpn-properties.c + libnm-util/nm-setting-vpn.c + libnm-util/nm-setting-wireless-security.c + libnm-util/nm-setting-wireless.c + libnm-util/nm-utils.c + src/dhcp-manager/nm-dhcp-manager.c + src/nm-activation-request.c + src/nm-ip4-config.c + src/nm-manager.c + src/nm-properties-changed-signal.c + src/ppp-manager/nm-pppd-plugin.c + src/supplicant-manager/nm-supplicant-interface.c + src/vpn-manager/nm-vpn-connection.c + - consistently use nm-dbus-glib-types.h + +2008-03-29 Dan Williams + + * src/vpn-manager/nm-vpn-connection.c + - (nm_vpn_connection_class_init): PROP_SPECIFIC_OBJECT should be boxed, + not string + + * src/nm-activation-request.c + - (nm_act_request_class_init): PROP_SPECIFIC_OBJECT should be boxed, + not string + +2008-03-29 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.c + - (access_point_added_proxy): create new APs if not found + +2008-03-29 Dan Williams + + * libnm-glib/nm-client.c + - (proxy_name_owner_changed): tell wireless devices about rfkill state + before freeing them + +2008-03-29 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - Fix parsing of WEP keys; ifcfg files use indexes [1...4] rather than + [0...3]; also handle KEY correctly in combination with DEFAULTKEY + +2008-03-29 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (get_one_wep_key, make_wireless_security_setting): handle "KEY" too + +2008-03-27 Dan Williams + + * nm-object.c + - (nm_object_queue_notify): don't notify multiple times for the same + property + + * nm-object-private.h + - (handle_ptr_array_return): return NULL if the given array is NULL or + if it has zero elements + + * nm-ip4-config.c + - (finalize): use g_ptr_array_foreach() when freeing domains + - (nm_ip4_config_get_domains): use handle_ptr_array_return() + + * nm-active-connection.c + - (nm_active_connection_get_devices): use handle_ptr_array_return() + + * nm-device-802-11-wireless.c + nm-device-802-11-wireless.h + - (nm_device_802_11_wireless_get_access_points): return const; use + handle_ptr_array_return() + + * nm-types.c + - (nm_object_array_demarshal): always create an array, even of length + zero, to distinguish between "NM returned no items" and "haven't + asked NM yet" + + * nm-client.c + - (dispose): free active connections too + - (proxy_name_owner_changed): free active connections too when NM goes + away + - (nm_client_get_devices): return const; use handle_ptr_array_return() + - (nm_client_get_active_connections): use handle_ptr_array_return() + +2008-03-26 Dan Williams + + Rework VPN connection handling for a more consistent D-Bus API. The + VPNManager object has been removed, and active VPN connections are now the + same as any other active connection. The Manager object's ActivateConnection + and DeactivateConnection methods are used to start and stop a VPN connection, + and the VPNConnection objects are subclasses of the ActiveConnection objects. + When activating a VPN connection, pass the path of the active connection + to which the VPN connection is tied in the 'specific_object' argument. + + Consequently, the libnm-glib API has been reworked to match this arrangement, + with the VPNManager object removed, and the NMVPNConnection objects now + being subclasses of NMActiveConnection. + +2008-03-25 Dan Williams + + Patch from Björn Martensen + + * initscript/Arch/networkmanager.in + initscript/Arch/networkmanager-dispatcher.in + - Updates for Arch Linux (gnome.org #523701) + +2008-03-25 Dan Williams + + * libnm-glib/nm-ip4-config.c + libnm-glib/nm-active-connection.c + libnm-glib/nm-access-point.c + - Use nm_object_queue_notify() instead of g_object_notify() + + * libnm-glib/nm-device.c + - (demarshal_ip4_config): distinguish between successful but missing + ip4-config request, and unsuccessful and missing ip4-config request + - (nm_device_get_ip4_config): don't try to demarshal a NULL ip4-config + path + - Use nm_object_queue_notify() instead of g_object_notify() + + * libnm-glib/nm-device-802-11-wireless.c + - (demarshal_active_ap): distinguish between successfull but missing + active-ap request, and unsuccessful and missing active-ap request + - (dispose, clean_up_aps): consolidate AP list and active AP clearing + code + - (nm_device_802_11_wireless_set_wireless_enabled): add a private hook + for the NMClient to notify the device that wireless is disabled, + and therefore to clear the AP list and active AP + - Use nm_object_queue_notify() instead of g_object_notify() + + * libnm-glib/nm-client.c + - (poke_wireless_devices_with_rf_status): new function + - (update_wireless_status): notify wireless devices of the rfkill status + so they can clean up if needed + - Use nm_object_queue_notify() instead of g_object_notify() + +2008-03-25 Dan Williams + + * libnm-glib/nm-object.c + libnm-glib/nm-object-private.h + - (nm_object_queue_notify): add helper to batch & postpone GObject notify + signals to an idle handler + - (nm_object_get_property): add a timeout to the D-Bus method call + +2008-03-25 Dan Williams + + * introspection/nm-device-cdma.xml + introspection/nm-device-gsm.xml + introspection/Makefile.am + introspection/all.xml + - Add introspection for CDMA and GSM devices for PropertiesChanged signal + + * src/nm-gsm-device.h + src/nm-gsm-device.c + src/nm-cdma-device.h + src/nm-cdma-device.c + src/Makefile.am + - Implement PropertiesChanged signals + + * libnm-glib/nm-cdma-device.c + libnm-glib/nm-cdma-device.c + - Attach to PropertiesChanged signals + +2008-03-24 Dan Williams + + * libnm-glib/nm-client.c + - (client_device_added_proxy): add new devices to the internal device + list so they appear to clients + +2008-03-24 Dan Williams + + Massive fixup of libnm-glib to: + a) have all objects (with the exception of VPN) cache their properties and + update them asynchronously on PropertiesChanged signals from NM + b) return internal const data for most attributes/properties instead of + allocated values that the caller must free + c) cache wrapped objects such that a given D-Bus path will always map to the + same GObject returned by libnm-glib + d) remove a few signals and move them to GObject property notifications + e) match recent NM D-Bus API changes for activation/deactivation + f) remove some private functions from libnm-glib headers + +2008-03-20 Dan Williams + + * src/nm-manager.c + - (nm_manager_update_state, manager_device_state_changed, + nm_manager_activate_device, connection_added_default_handler, + impl_manager_activate_connection, impl_manager_deactivate_connection): + queue PropertyChanged singals when the active connections change + +2008-03-20 Dan Williams + + * introspection/nm-manager.xml + introspection/nm-manager-client.xml + - (ActivateConnection): return the object path of the active connection + on success + - (GetActiveConnections): remove + - (DeactivateConnection): new function; deactivate a currently active + connection + - Add an ActiveConnections property which returns an array of + active connection object paths + + * introspection/nm-device.xml + - (Deactivate): remove + + * introspection/all.xml + - Add ActiveConnection introspection + + * introspection/nm-active-connection.xml + - Add the ActiveConnection object + + * include/NetworkManager.h + - Add the Connection.Active D-Bus interface + + * src/nm-device-interface.c + - (impl_device_deactivate): remove + + * src/nm-activation-request.c + src/nm-activation-request.c + src/Makefile.am + - Implement the Connection.Active D-Bus interface + + * src/nm-manager.c + - (get_property, nm_manager_class_init): add ACTIVE_CONNECTIONS property + - (nm_manager_activate_device): return the active connection path + - (connection_added_default_handler, impl_manager_activate_connection): + return the active connection to the caller + - (add_one_connection_element, impl_manager_get_active_connections): + remove + - (impl_manager_deactivate_connection): new function; deactivate an + active connection + + * libnm-glib/nm-device.c + libnm-glib/nm-device.h + - Remove Deactivate() function + +2008-03-19 Dan Williams + + * introspection/nm-manager.xml + introspection/nm-manager-client.xml + - Rename the ActivateDevice method to ActivateConnection to better + reflect it's usage; it's arguments get reordered a bit too + - Convert GetActiveConnections method return from a struct to a dict + + * include/NetworkManager.h + - Define the dict keys for return value of GetActiveConnections + + * src/nm-manager.c + - impl_manager_activate_device -> impl_manager_activate_connection + - (add_one_connection_element): return a populated hash table, not + a structure + + * libnm-glib/nm-client.c + libnm-glib/nm-client.h + - nm_client_activate_device -> nm_client_activate_connection + - nm_client_free_active_connection_element -> nm_client_free_active_connections_element + - (nm_client_get_active_connections): return a GSList of GHashTables, + instead of the custom structures. Each element of the returned list + must be freed with nm_client_free_active_connections_element() + +2008-03-18 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + system-settings/plugins/ifcfg-fedora/parser.h + system-settings/plugins/ifcfg-fedora/plugin.c + - Read settings from /etc/sysconfig/network-scripts/ instead of using + profiles. DNS servers and searches must now be stored in the ifcfg + files themselves + +2008-03-18 Tambet Ingo + + * src/ppp-manager/nm-ppp-manager.c (nm_ppp_manager_update_secrets): Don't + print out username and password, it's supposed to be a secret. + + * src/nm-device-802-3-ethernet.c (ppp_state_changed): Handle authentication + request and set the device state accordingly. + +2008-03-18 Tambet Ingo + + * src/nm-device-802-3-ethernet.c: Implement wired 802.1x authentication. + + * libnm-util/nm-setting-wireless-security.h: Fix a typo. + +2008-03-18 Dan Williams + + * src/vpn-manager/nm-vpn-connection.c + - (get_secrets_cb): handle new GetSecrets return format + +2008-03-18 Dan Williams + + Adapt system settings service for split 802.1x. + + * system-settings/src/nm-system-config-interface.h + - clarify return value of get_secrets() + + * system-settings/src/dbus-settings.c + - (string_to_gvalue, destroy_gvalue, add_one_secret_to_hash): remove + - (check_for_secrets): check if there actually secrets returned by a + plugin + - (exported_connection_get_secrets): just return the plugin-returned + hash of settings' secrets if it looks valid + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (get_secrets): add split secrets with correct format to reply hash + + * system-settings/plugins/ifcfg-fedora/parser.c + system-settings/plugins/ifcfg-fedora/parser.h + - (copy_one_cdata_secret, connection_data_copy_secrets, + connection_data_free, connection_data_add): keep secrets for + different settings in different hashes + +2008-03-17 Tambet Ingo + + Clean up activating device deactivation. + + * src/nm-device.c (real_activation_cancel_handler): Remove. The same thing + should be done whether the device activation gets cancelled or the device + is just getting deactivated. + (nm_device_activation_cancel): Remove. + (nm_device_deactivate_quickly): Handle the case where device is activating. + + * src/nm-device-802-11-wireless.c (real_activation_cancel_handler): Remove. + It does the exact same thing as real_deactivate_quickly(). + +2008-03-17 Dan Williams + + Split the 802.1x bits out of the wireless-security setting so they are + generalized enough for wired 802.1x to use too. + + * introspection/nm-exported-connection.xml + - GetSecrets now returns 'a{sa{sv}}' (a hash of settings hashes) instead + of just a hash of the secrets for one setting + + * libnm-util/nm-setting-wireless-security.c + libnm-util/nm-setting-wireless-security.h + - Remove 802.1x-specific stuff + - Added leap-username and leap-password properties for old-school LEAP + + * src/nm-device.c + src/nm-device.h + - (connection_secrets_updated_cb): take a list of updated settings names, + not just one + + * src/supplicant-manager/nm-supplicant-config.c + src/supplicant-manager/nm-supplicant-config.h + - (nm_supplicant_config_add_setting_wireless_security): remove 802.1x + specific stuff; fix for updated LEAP bits; punt 802.1x stuff + to nm_supplicant_config_add_setting_8021x() + - (nm_supplicant_config_add_setting_8021x): add an 802-1x setting to + the supplicant config + + * src/nm-device-802-11-wireless.c + - (build_supplicant_config): pass in the 802.1x setting too, if any + - (real_connection_secrets_updated): take a list of updated settings + names, not just one + + * src/nm-device-802-3-ethernet.c + src/nm-cdma-device.c + src/nm-gsm-device.c + - (real_connection_secrets_updated_cb): take a list of updated settings + names, not just one + + * src/nm-activation-request.c + src/nm-activation-request.h + - (nm_act_request_class_init): the 'connection-secrets-updated' signal + now passes a list of updated settings names, not just one + - (update_one_setting): new function; handle one updated setting + - (get_secrets_cb): handle multiple settings returned from the + settings service; have to be careful of ordering here as there are + some dependencies between settings (ex. wireless-security and 802.1x + in some cases) + + * src/marshallers/nm-marshal.list + - new marshaller for connection-secrets-updated signal + + * libnm-util/nm-setting-8021x.c + - Add back the 'pin' and 'psk' settings, for EAP-SIM and EAP-PSK auth + methods + - (verify): a valid 'eap' property is now required + + * libnm-util/nm-connection.c + - (register_default_settings): add priorities to settings; there are + some dependencies between settings, and during the need_secrets + calls this priority needs to be respected. For example, only the + wireless-security setting knows whether or not the connection is + going to use 802.1x or now, so it must be asked for secrets before + any existing 802.1x setting is + - (nm_connection_lookup_setting_type): expose + + * libnm-util/nm-setting-wireless.c + - (verify): should verify even if all_settings is NULL; otherwise won't + catch the case where there is missing security + + * libnm-util/nm-setting-wireless-security.c + - Remove everything to do with 802.1x + - Add old-school LEAP specific properties for username and password + - (need_secrets): rework LEAP secrets checking + - (verify): rework for LEAP and 802.1x verification + +2008-03-17 Dan Williams + + * src/NetworkManagerPolicy.c + - (auto_activate_device): always remove the current activation check + from the pending activation list, otherwise when the policy gets + destroyed on NM exit it will attempt to free the already freed + activation check + +2008-03-14 Tambet Ingo + + * src/backends/NetworkManagerSlackware.c + (nm_system_device_setup_static_ip4_config): Remove, it's unused. + + * src/backends/NetworkManagerSuSE.c: Add missing includes. + +2008-03-14 Dan Williams + + * src/nm-manager.c + - (nm_device_interface_get_iface): g_object_get() will return an + allocated value, so this function must not return const + - (nm_device_interface_activate): free returned iface + +2008-03-14 Tambet Ingo + + * libnm-util/Makefile.am: Add new files to build. + + * libnm-util/nm-connection.c: Register NMSetting8021x. + + * libnm-util/nm-setting-8021x.c + * libnm-util/nm-setting-8021x.h: Implement. + +2008-03-14 Tambet Ingo + + * libnm-util/Makefile.am: Add new files to build. + + * libnm-util/nm-connection.c: Register NMSetting8021x. + + * libnm-util/nm-setting-8021x.c + * libnm-util/nm-setting-8021x.h: Implement. + +2008-03-14 Tambet Ingo + + * src/NetworkManagerPolicy.c (auto_activate_device): Don't leak device and + data. + +2008-03-14 Dan Williams + + * include/wireless-helper.h + include/Makefile.am + - One place for all the junk needed for #including wireless.h + + * test/nm-tool.c + src/NetworkManagerAP.c + src/wpa.c + src/Makefile.am + libnm-util/nm-utils.c + libnm-util/nm-setting-wireless.c + libnm-glib/nm-device-802-11-wireless.c + libnm-glib/nm-access-point.c + libnm-glib/libnm-glib-test.c + - include wireless-helper.h, not iwlib.h + + * configure.in + - Don't need libiw really, just need to check for wireless.h + + * src/kernel-types.h + - Remove; used types moved into wpa.c + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_update_signal_strength, + real_get_generic_capabilities, nm_device_802_11_wireless_get_mode, + nm_device_802_11_wireless_set_mode, + nm_device_802_11_wireless_get_frequency, + nm_device_802_11_wireless_get_ssid, + nm_device_802_11_wireless_set_ssid, + nm_device_802_11_wireless_get_bitrate, + nm_device_802_11_wireless_get_bssid, + nm_device_802_11_wireless_disable_encryption): use ioctl() directly + instead of iwlib functions + +2008-03-14 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (impl_ppp_manager_need_secrets): since it's asynchronous now, it + should only take the DBusGMethodInvocation argument, not user/pass + too. With dbus-glib, async functions only take 2 C arguments since + the real dbus method arguments get passed back with + dbus_g_method_return() + +2008-03-13 Tambet Ingo + + * system-settings/plugins/ifcfg-suse/plugin.c (update_default_routes): + Adapt the changes of NMSettingIP4Config. + +2008-03-13 Dan Williams + + * src/NetworkManagerUtils.c + src/NetworkManagerUtils.h + - (nm_ether_ntop): replacement for iw_ether_ntop() + + * src/NetworkManagerAP.c + src/nm-device-802-11-wireless.c + src/nm-device-802-3-ethernet.c + - s/iw_ether_ntop/nm_ether_ntop/g + +2008-03-13 Dan Williams + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): never set the default route through an + IPv4LL addressed device + +2008-03-13 Dan Williams + + * NetworkManagerUtils.c + NetworkManagerUtils.h + - Remove NMSock stuff + - Remove the completion stuff + + * nm-device.c + nm-device.h + NetworkManager.c + NetworkManagerSystem.c + autoip.c + nm-device-802-11-wireless.c + nm-device-802-3-ethernet.c + - Remove NMSock and completion stuff + - Remove nm_ioctl_info() + +2008-03-12 Dan Williams + + * src/nm-device.c + - (merge_ip4_config): avoid duplicates + +2008-03-12 Dan Williams + + * libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - Remove 'manual' and 'autoip' properties + - Add 'method' property + - (verify): fix verification with 'method' + - (finalize): free 'method' + - (set_property, get_property, nm_setting_ip4_config_class_init): fix + up for 'method' + + * src/nm-device.c + - (real_act_stage3_ip_config_start): check IP4Config method + - (nm_device_new_ip4_autoip_config): add a note about not sucking in + the future + - (merge_ip4_config): IP settings are valid with DHCP too + - (real_act_stage4_get_ip4_config): handle all IP4Config methods + - (real_act_stage4_ip_config_timeout): don't do autoip on DHCP timeout + + * src/nm-device-802-11-wireless.c + - (real_act_stage3_ip_config_start): remove; autoip only on demand + - (real_act_stage4_get_ip4_config): just chain up to parent; autoip + only on demand + + * system-settings/plugins/ifcfg-fedora/parser.c + system-settings/plugins/ifcfg-suse/parser.c + - (make_ip4_setting): fix up for 'method' + +2008-03-12 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + system-settings/plugins/ifcfg-fedora/parser.h + - (get_ifcfg_name): ignore more file suffixes + - (is_wireless_device): fix check for ifcfgs that have no TYPE + +2008-03-12 Dan Williams + + * configure.in + - Bring in the bits of gnome-common we actually use (all 15 lines) + +2008-03-12 Dan Williams + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (write_auto_wired_connection): new function; write out an auto + wired connection file since the applet isn't doing it any more + - (reload_all_connections): write out the auto wired connection file + if there aren't any wired connections already + - (init): don't leak a GError + +2008-03-12 Dan Williams + + * src/nm-device-interface.c + - (nm_device_interface_activate): print the ID of the connection + that's about to be activated + +2008-03-12 Dan Williams + + Harmonize the 802.11 bitrate API + + * introspection/nm-access-point.xml + - 'Rate' -> 'MaxBitrate'; clarify units + + * introspection/nm-device-802-11-wireless.xml + - Clarify units of 'Bitrate' + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + - (set_property, get_property, nm_ap_class_init): rename 'rate' + property to 'max-bitrate' + - (foreach_property_cb): convert rate to Kb/s + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_get_bitrate): return rate in Kb/s + + * libnm-glib/nm-access-point.c + libnm-glib/nm-access-point.h + - 'rate' -> 'max-bitrate' + + * test/nm-tool.c + libnm-glib/libnm-glib-test.c + - Fix up for these changes + +2008-03-12 Dan Williams + + * src/nm-device.c + - (nm_device_set_ip4_config): don't send property notifications when + the ip4 config is set to NULL; it causes a PropertyChanged signal + which dbus-glib can't parse because the value is NULL, which isn't + a legal object path. Setting the IP4 config to NULL is only + valid when deactivating a device anyway, so the device state change + will alert listeners that the ip4 config is invalid. + +2008-03-12 Dan Williams + + * src/nm-properties-changed-signal.c + - (add_to_string): better handling of NULL objects + +2008-03-12 Dan Williams + + Move the 'carrier' property from NMDevice to NMDevice8023Ethernet; + convert the libnm-glib NMDevice8023Ethernet to cached properties + + * introspection/nm-device-802-3-ethernet.xml + - New 'Carrier' property + - New 'PropertiesChanged' signal + + * introspection/nm-device.xml + - Remove 'Carrier' property + - Remove 'CarrierChanged' signal + + * src/nm-device-interface.c + src/nm-device-interface.h + - (nm_device_interface_init): remove 'carrier' property and + 'carrier-changed' signal + + * src/nm-device.c + src/nm-device.h + - (nm_device_get_carrier, nm_device_set_carrier): remove + - (nm_device_activate_stage5_ip_config_commit): don't bother updating + the link here; wired device will handle that + - (handle_dhcp_lease_change): don't bother updating link here + - (get_property, nm_device_class_init): remove carrier property + + * src/nm-device-802-11-wireless.c + - (real_update_link, nm_device_802_11_wireless_class_init): remove + real_update_link(); wireless devices don't use carrier at all + - (link_timeout_cb, supplicant_iface_state_cb_handler, + supplicant_iface_connection_state_cb_handler, + supplicant_mgr_state_cb_handler): remove anything to do with carrier + + * src/nm-device-802-3-ethernet.c + src/nm-device-802-3-ethernet.h + - (nm_device_802_3_ethernet_carrier_on, + nm_device_802_3_ethernet_carrier_off, constructor): use set_carrier() + instead of nm_device_set_carrier() + - (device_state_changed): update link from sysfs on activation; + replaces real_update_link() + - (real_update_link): remove, replaced by device_state_changed() + - (nm_device_802_3_ethernet_get_carrier, set_carrier): new functions + - (nm_device_802_3_ethernet_get_speed): move up with other getters/setters + - (real_get_generic_capabilities, real_can_interrupt_activation): use + new get_carrier function + - (get_property): add 'carrier' property + - (nm_device_802_3_ethernet_class_init): add 'carrier' property and + hook into property-changed signal helper + + * src/NetworkManagerPolicy.c + - (device_carrier_changed): will only ever be called with a wired device + - (device_added): only hook up to carrier-changed for wired devices + + * libnm-glib/nm-device.c + libnm-glib/nm-device.h + - (constructor, nm_device_class_init): remove carrier-changed signal + - (device_carrier_changed_proxy): remove; unused + - (nm_device_get_carrier): remove; carrier a property of wired devices + + * libnm-glib/nm-device-802-3-ethernet.c + libnm-glib/nm-device-802-3-ethernet.h + - Convert to cached properties like AP and Wireless objects + - (nm_device_802_3_ethernet_get_hw_address): now returns a 'const char *' + instead of a 'char *', return value should not be freed + - (nm_device_802_3_ethernet_get_carrier): return current carrier status + - (constructor): hook into properties-changed helper + - (set_property, get_property): new functions + - (nm_device_802_3_ethernet_class_init): export GObject properties + + * test/nm-tool.c + - (detail_device): strdup the wired hardware address too since it's + cached now + + * libnm-glib/libnm-glib-test.c + - (dump_wired): strdup the wired hardware address too since it's + cached now + +2008-03-12 Dan Williams + + * libnm-util/nm-setting-ip4-config.c + libnm-util/nm-setting-ip4-config.h + - (set_property, get_property, nm_setting_ip4_config_class_init): add + the 'autoip' property from the spec + +2008-03-11 Dan Williams + + * src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + - (nm_generic_device_get_use_dhcp): remove + +2008-03-11 Dan Williams + + * src/nm-device.c + - (nm_device_deactivate): don't need to munge DNS here; that gets done + already in nm_device_set_ip4_config() + - (handle_dhcp_lease_change): fail the device if setting the IP4Config + due to a DHCP rebind fails + - (nm_device_set_ip4_config): send property notifications when the + ip4 config changes + - (get_property): only report IP4Config property during valid states + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): ignore devices that don't have an ip4 + config; add parameter 'force_update' to allow callers to specify + that changes should be made even if the default device doesn't change + - (device_ip4_config_changed): update DNS and routing when the device's + IP4Config changes, like for DHCP updates + - (device_added): listen for ip4-config property changes + +2008-03-11 Dan Williams + + Fix address handling as a result of DHCP rebind/renew/reboot. + + * src/NetworkManagerSystem.c + - (check_one_address): delete an address if it doesn't match a given + one for the same interface + - (nm_system_device_set_from_ip4_config): don't flush the default route, + be smarter about flushing addresses (only flush ones that don't + match the one we're about to apply) + + * src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerSuSE.c + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerGentoo.c + - (nm_system_delete_default_route): remove + + * src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + - (nm_generic_enable_loopback): fix the loopback device label + - (nm_generic_delete_default_route): remove; no longer used + +2008-03-11 Dan Williams + + * src/nm-device-interface.h + - Delimit property name words with '-', otherwise g_object_notify() + doesn't work the way we expect + +2008-03-11 Tambet Ingo + + * src/nm-hal-manager.c (create_device_and_add_to_list): Don't ignore USB devices. + +2008-03-11 Dan Williams + + * src/NetworkManagerPolicy.c + - (update_routing_and_dns): don't change anything if the default device + hasn't changed; print something out when switching the default route + and DNS + +2008-03-10 Tambet Ingo + + Implement PPPoE. + + * src/ppp-manager/nm-ppp-manager.c (create_pppd_cmd_line): Use PPPoE service + setting. Use "nic-$eth". + + * src/NetworkManagerPolicy.c (auto_activate_device): Move the check of whether + the device is activating here to fix a race condition. + + * src/ppp-manager/nm-pppd-plugin.c (get_credentials): Implement. + + * src/ppp-manager/nm-ppp-manager.c (impl_ppp_manager_need_secrets): Implement. + (ppp_watch_cb): Emit a signal to notify pppd is not running anymore. + (nm_ppp_manager_start): Take activation request instead of connection, we might + need it for asking secrets. + (nm_ppp_manager_update_secrets): Implement. + + * src/nm-serial-device.c (real_act_stage2_config): Send activation request to + ppp manager start. It might be needed for asking secrets. + + * src/nm-device-802-3-ethernet.c (real_connection_secrets_updated): Implement. + (ppp_state_changed): Handle pppd daemon disappearing. + (pppoe_stage2_config): Send activation request to ppp manager start. + + * libnm-util/nm-setting-pppoe.c (nm_setting_pppoe_class_init): Fix a typo. + + * introspection/nm-ppp-manager.xml: Make NeedSecrets method async, return only + username and password. + +2008-03-10 Dan Williams + + * src/nm-device.c + - (handle_dhcp_lease_change): apply an IP4 config to a device in + response to a DHCP lease change + - (dhcp_state_changed): handle DHCP lease changes while activated + - (nm_device_set_ip4_config): remove a previously set named config + when setting an ip4 config + +2008-03-10 Dan Williams + + * src/nm-serial-device.c + - (nm_serial_device_send_command): report errno on error + - (get_reply_got_data): limit the size of the overall buffer + - (wait_for_reply_info_destroy): destroy result string + - (wait_for_reply_got_data): append received data to an overall buffer + until timeout, filled buffer, or error instead of keeping a per-call + buffer. Some devices send data slowly enough that this function + gets called multiple times for the same command stream. + - (nm_serial_device_wait_for_reply): initialize overall buffer for + wait_for_reply_got_data() here + +2008-03-10 Dan Williams + + * src/nm-cdma-device.c + - (do_dial, init_modem): handle errors from + nm_serial_device_send_command_string() + + * src/nm-gsm-device.c + - (do_dial, manual_registration, automatic_registration_get_network, + automatic_registration, enter_pin, check_pin, init_modem): handle + errors from nm_serial_device_send_command_string() + +2008-03-10 Dan Williams + + Patch based on ideas suggested by Bas Zoetekouw + + * src/named-manager/nm-named-manager.c + - (compute_searches): prefer searches before domains + - (compute_domain): new function + - (rewrite_resolv_conf): write out the 'domain' and 'searches' options + - (merge_one_ip4_config): if there are no searches in the source config, + merge domains of the source config into the target config + - (compute_nameservers): make formatting of resolv.conf a bit nicer + +2008-03-10 Dan Williams + + * src/nm-serial-device.c + - (get_reply_got_data): clean up indentation, shrink serial buffer + - (wait_for_reply_got_data): try to handle slower serial devices where + the reply is broken up into multiple reads by concatenating replies + together until either an error is received or the search string is + found + +2008-03-10 Dan Williams + + * src/nm-device.c + - (nm_device_bring_down): deactivate the device if it's activating too, + not just if it's already activated. This makes sure that everything + from an association attempt is cleaned up (like DHCP for example) + +2008-03-10 Dan Williams + + * src/nm-serial-device.c + - (config_fd): report error from TCSETA + - (nm_serial_device_open): fail when config_fd() fails + +2008-03-10 Dan Williams + + * src/nm-ip4-config.c + - (nm_ip4_config_init): allocate searches list + - (finalize): free searches list + +2008-03-09 Dan Williams + + Patch from Bas Zoetekouw + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_get_ip4_config): handle domain-search option too + +2008-03-09 Dan Williams + + Patch from Bas Zoetekouw + + * src/nm-ip4-config.c + src/nm-ip4-config.h + - (nm_ip4_config_add_search, nm_ip4_config_get_search, + nm_ip4_config_get_num_searches): add 'searches' as distinct from + domains. 'searches' is the correct way to store multiple search + domains, whereas 'domains' is really just supposed to store one + domain. Some sites abuse the DHCP 'domain-name' option to push + search domains to the client. + - (nm_ip4_config_add_domain): group with related functions (my patch) + +2008-03-09 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (dhclient_run): send interface-specific config files to dhclient + +2008-03-07 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (is_wireless_device): new function; test a device for wireless + extensions + - (parser_parse_file): if the ifcfg file doesn't have a TYPE tag, + test the device for wireless extensions to determine the type + +2008-03-07 Dan Williams + + Change manager's StateChange signal to StateChanged for consistency. + + * introspection/nm-manager.xml + - Add 'StateChanged' signal + - Move 'StateChange' down to the deprecated section + + * src/nm-hal-manager.c + - (nm_hal_manager_new): connect to 'state-changed' instead + + * src/NetworkManagerPolicy.c + - (nm_policy_new): connect to 'state-changed' instead + + * src/nm-manager.c + src/nm-manager.h + - (nm_manager_update_state): emit both 'state-changed' and 'state-change' + - (nm_manager_class_init): add 'state-changed' and not the deprecation + of 'state-change' + + * libnm-glib/nm-client.c + libnm-glib/nm-client.h + - (constructor, nm_client_class_init, client_state_changed_proxy): + track and proxy 'state-changed' instead of 'state-change' + +2008-03-07 Dan Williams + + First pass of multiple active device support. Expect bugs. + + * src/nm-ip4-config.c + src/nm-ip4-config.h + - (nm_ip4_config_get_secondary, nm_ip4_config_set_secondary): remove; + there are better ways to do this in the named manager + + * src/nm-device.c + src/nm-device.h + - (nm_device_can_activate): return whether the device can activate a + connection right now; taking into account things like carrier state + and rfkill state + - (nm_device_get_best_auto_connection): renamed from + nm_device_get_best_connection + - (real_act_stage4_get_ip4_config): MTU stuff is now handled in the + device subclasses themselves, so that each device can override the + MTU from it's NMSetting subclass if needed + - (nm_device_set_ip4_config): set MTU when setting up routes and stuff + in NetworkManagerSystem.c, not here + + * src/named-manager/nm-named-manager.c + src/named-manager/nm-named-manager.h + - (nm_named_manager_name_owner_changed, + nm_named_manager_dbus_connection_changed): fix for changes to + rewrite_resolv_conf() + - (compute_nameservers): don't need the NMNamedManager at all, remove + from parameter list + - (merge_one_ip4_config): new function; merge ip4 configs together + - (rewrite_resolv_conf): write out resolv.conf from all the stored + ip4 configs; the VPN config takes precedence, then the best + device config, then the rest of the configs + - (get_domain_for_config): take the NMNamedManager as an argument + to check whether the config is the VPN config + - (add_ip4_config_to_named): fixups for removal of the 'secondary' + attribute from ip4 configs + - (add_all_ip4_configs_to_named): add all the configs in priority order + - (remove_ip4_config_from_named): fix for changes to + get_domain_for_config() + - (nm_named_manager_add_ip4_config): assign the config to the right slot + based on its type; callers must pass in the type now + - (get_last_default_domain): remove, unused + - (nm_named_manager_remove_ip4_config): handle config slots correctly + + * src/nm-device-802-11-wireless.c + - (real_can_activate): new function + - (real_get_best_auto_connection): renamed from real_get_best_connection + - (real_act_stage4_get_ip4_config): handle MTU override + + * src/nm-device-802-3-ethernet.c + - (real_can_activate): new function + - (real_get_best_auto_connection): renamed from real_get_best_connection + - (real_act_stage4_get_ip4_config): new function; handle MTU override + + * src/vpn-manager/nm-vpn-connection.c + - (nm_vpn_connection_ip4_config_get): don't need to set the 'secondary' + attribute on the ip4 config + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): remove + - (nm_policy_device_change_check): remove + - (update_default_route): new function; set the default route via + the specified device + - (get_device_priority): new function; return the priority number of + a device type WRT which one should have the default route. Order is + (highest to lowest) wired, wireless, GSM, CDMA. + - (update_routing_and_dns): new function; determine which device should + have the default route, then update the routing table and DNS + - (maybe_auto_activate_device): new function; if a device is now + available for activation, find out what connection it would like to + activate and do it + - (schedule_activate_check): new function; if a device can be activated + now, schedule the activation. Each device may have only one + pending activation at a given time. + - (device_state_changed): if activation was canceled, try again, + possibly with another connection; if the device was activated, + update routing and DNS; if the device was deactivated, try again + with another connection + - (device_carrier_changed): if there is no carrier, deactivate the + device; otherwise schedule an activation check for the device + - (wireless_networks_changed): schedule an activation check for the + device + - (device_added): keep track of the signal handler IDs so they can + be removed when the device goes away + - (device_removed): remove any signal handlers that might be attached + to the device; update routing and DNS + - (schedule_activate_all): new function + - (connections_added, connection_added, connection_updated): when + connections change, schedule all devices for an activation check + - (connection_removed): when a device is deactivated because its + connection was removed, schedule another activation check for it + - (nm_policy_destroy): destroy pending activations and disconnect + all device signal handlers + + * src/nm-manager.c + - (nm_manager_activate_device): if the device was already actived, + deactivate it + - (deactivate_old_device): remove + - (connection_added_default_handler, impl_manager_activate_device): + don't deactivate other devices when activating this one + + * src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerSuSE.c + src/backends/NetworkManagerDebian.c + - (nm_system_get_mtu): remove; MTU should be provided through the + distro's system settings service plugin instead + - (nm_system_device_add_default_route_via_device): remove + - (nm_system_device_add_default_route_via_device_with_iface): remove + - (nm_system_device_replace_default_route): new function; call + generic implementation + + * src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + - (nm_generic_device_add_default_route_via_device, + nm_generic_device_add_default_route_via_device_with_iface): remove + - (nm_generic_device_replace_default_route): replace the default route + with the given route via some gateway + + * src/NetworkManagerSystem.c + src/NetworkManagerSystem.h + - (nm_system_device_set_from_ip4_config): let the policy handle updates + to routing and DNS; but set the MTU here + - (nm_system_vpn_device_set_from_ip4_config): set the route with the + ip_iface of the active device; use the standard MTU setting function + - (nm_system_set_mtu): remove + - (nm_system_device_set_mtu): consolidate MTU setting code in one place + +2008-03-07 Tambet Ingo + + Rework the interaction between ppp manager and pppd plugin. Register a well + known DBUS service in manager and let the plugin call it's methods instead + of listening plugin's signals. + + * src/ppp-manager/nm-pppd-plugin.c: Call ppp-manager dbus methods instead + of emitting signals. + + * src/ppp-manager/nm-ppp-manager.c: Implement dbus service here. + + * src/ppp-manager/Makefile.am: Build nm-ppp-manager-glue.h. + + * src/nm-serial-device.c (real_act_stage2_config): Pass NMConnection to + nm_ppp_manager_start(). + + * introspection/nm-ppp-manager.xml: New file. + + * src/nm-device-802-3-ethernet.c (nm_device_802_3_ethernet_get_speed): Handle + the case correctly where driver is trying to send -1 for the speed, which gets + casted to u16 and thus is always > 0. + +2008-03-07 Dan Williams + + * src/nm-hal-manager.c + - (nm_get_device_driver_name): use net.originating_device first, fall + back to physical device. HAL has deprecated physical_device. + + * libnm-glib/nm-device.c + - (get_product_and_vendor): use net.originating_device first, fall + back to physical device. HAL has deprecated physical_device. + - (nm_device_update_description): s/physical_device_udi/orig_dev_udi + +2008-03-07 Dan Williams + + * src/nm-netlink.c + - (nm_netlink_get_default_handle): mistakenly removed too much code in + last commit; fix that + - (get_link_cache): print error string + +2008-03-07 Dan Williams + + * src/nm-netlink.c + - (nm_netlink_get_default_handle): NMNetlinkMonitor now uses libnl, + don't need this hack any more (Benoit Boissinot) + +2008-03-06 Dan Williams + + * autogen.sh + - Die gnome-common, die + +2008-03-04 Dan Williams + + Patch from Michael Biebl + + * NetworkManager.pc.in + - doesn't actually depend on dbus-1 + + * libnm-util/nm-utils.h + - remove unused #include + + * libnm-glib/libnm_glib.pc.in + - depends on glib and dbus-glib + +2008-03-02 Dan Williams + + * src/NetworkManagerPolicy.c + - s/device_state_changed_idle_id/update_state_id/ + +2008-03-02 Dan Williams + + * src/nm-device.c + src/nm-device.h + src/nm-device-802-11-wireless.c + src/nm-device-802-3-ethernet.c + src/NetworkManagerPolicy.c + - s/link_active/carrier + - nm_device_set_active_link() -> nm_device_set_carrier() + - nm_device_has_active_link() -> nm_device_get_carrier() + +2008-03-02 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (make_wireless_setting): fail connection creation on missing SSID + +2008-02-29 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): ensure that a previously active + device with a system connection has a link before denying a switch + to a user connection + +2008-02-29 Dan Williams + + * src/nm-device-802-11-wireless.c + - (link_timeout_cb): try again if scanning; deactivate the device when + activated if the link dies + - (supplicant_iface_connection_state_cb_handler): bump link timeout to + 15 seconds + +2008-02-29 Dan Williams + + * src/nm-device-802-11-wireless.c + src/nm-device-802-11-wireless.h + - (nm_device_802_11_wireless_reset_scan_interval): remove, unused + elsewhere; fold into the sole user in nm-device-802-11-wireless.c + - (device_cleanup): reset the scan interval lower when the device + deactivates + - (can_scan): base decision mostly off device state, not supplicant + interface state since the supplicant interface state isn't a + great indicator of whether the device is active or not + - (request_wireless_scan): clean up; schedule the next scan here + - (schedule_scan): only back the scan interval off if a new scan + actually gets scheduled; and make scan intervals tighter when the + device is disconnected + - (supplicant_iface_state_cb_handler): fold in the bits of + nm_device_802_11_wireless_reset_scan_interval() by resetting scan + interval to minimum + - (activation_success_handler): reset scan interval to something + reasonable + +2008-02-28 Saleem Abdulrasool + + reviewed by: Steev + + * configure.in: + * src/backends/NetworkManagerGentoo.c: + (nm_system_restart_mdns_responder): + Howl is no longer a supported mDNS provider + +2008-02-28 Tambet Ingo + + Get rid of a bunch of unused distro specific functions. + +2008-02-28 Tambet Ingo + + Implement suse plugin for system settings daemon. + + * system-settings/plugins/ifcfg-suse/*: Implement. + + * system-settings/plugins/Makefile.am: Add ifcfg-suse to subdirs when targeting + suse. + + * configure.in: Check (without failing) for gio. + Create ifcfg-suse plugin's Makefile. + +2008-02-20 Dan Williams + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_compare): accept compare flags and pass them to the + setting compare function + + * libnm-util/nm-setting.c + libnm-util/nm-setting.h + - (nm_setting_compare): accept compare flags; ignore properties that are + marked fuzzy + + * libnm-util/nm-setting-connection.c + libnm-util/nm-setting-wireless.c + libnm-util/nm-setting-ppp.c + libnm-util/nm-setting-wired.c + - Mark some setting properties as ignorable when doing a fuzzy compare + + * src/nm-device.c + - (device_activation_precheck): use exact compare + +2008-02-20 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): get scope off the connection, not + using the manager helper + + * src/nm-manager.c + src/nm-manager.h + - (get_scope_for_proxy): rename from get_type_for_proxy() + - (connection_get_settings_cb): set scope and path on connection, not + using GObject data items + - (get_connection_for_proxy): don't need to return path, since that + can be gotten from the connection + - (get_connection_for_proxy): get path off the connection, not from + parameters + - (connection_removed_cb, connection_updated_cb): don't need to get + path from get_connection_for_proxy(); get scope off the connection + instead of using GObject data items + - (connection_added_default_handler, add_one_connection_element): use + nm_connection_get_path() not nm_manager_get_connection_dbus_path() + - (nm_manager_get_connection_dbus_path): remove + - (nm_manager_get_connection_scope): remove + +2008-02-20 Dan Williams + + * Global rename of NMConnectionSettings -> NMExportedConnection to cut down + on confusing names + + * Add 'path' and 'scope' properties to NMConnection since both NM and the + applet were having to hack this in anyway. Remove the 'path' stuff from + NMExportedConnection + + * Internally rename NMConnectionType -> NMConnectionScope + + * Provide default implementations of the 'get_id' and 'get_settings' methods + of NMExportedConnection + +2008-02-15 Dan Williams + + * src/nm-device-802-11-wireless.c + - (device_cleanup): release the AP list here too so that the AP list + doesn't survive across suspend/resume and up/down. There is some + room for optimization, for example blow the list away when the card + brought back up, but only if the device has only been down for a + minute or more. + +2008-02-15 Dan Williams + + * src/nm-hal-manager.c + - (modem_device_creator): recognize new HAL modem capabilities + +2008-02-12 Dan Williams + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (watch_path): handle IN_DELETE_SELF too + - (handle_connection_changed): notify when removing a connection + - (stuff_changed): don't warn on unknown inotify watches; handle the + case of a file moving out of the profile directory + +2008-02-12 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (make_ip4_setting): bring IPv4 setting handling more up to spec + +2008-02-12 Dan Williams + + * libnm-util/nm-utils.c + - (nm_utils_convert_uint_array_to_string): don't die on NULL array, it's + just any empty array + +2008-02-12 Dan Williams + + * system-settings/src/nm-system-config-interface.c + system-settings/src/nm-system-config-interface.h + - (load_connections): get_connections() should now return an allocated + GSList that the system settings service will free + + * system-settings/plugins/ifcfg-fedora/plugin.c + system-settings/plugins/ifcfg-fedora/parser.h + system-settings/plugins/ifcfg-fedora/parser.c + - Fix up inotify issues; handle keys-* files, handle new files appearing + in the profile directory, handle resolv.conf file changes + +2008-02-10 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (real_bring_up): save the supplicant interface state signal id + - (real_bring_down): disconnect from the supplicant interface state + signal + +2008-02-07 Dan Williams + + * initscript/RedHat/NetworkManager.in + initscript/RedHat/NetworkManagerDispatcher.in + - Add new-style LSB init headers + +2008-02-07 Dan Williams + + * system-settings/src/dbus-settings.c + system-settings/src/dbus-settings.h + - (add_one_secret_to_hash): copy secrets out of the plugin-returned hash + table of secrets + - (connection_settings_get_secrets): consolidate error returns into + one place; use the new get_secrets() plugin interface function to + get secrets from the plugin itself rather than using GObject data + magic + + * system-settings/src/main.c + - (connection_added_cb, connection_removed_cb, free_plugin_connections, + load_connections): keep a private list of the plugin-returned + connections, don't use the plugin's GSList + + * system-settings/plugins/ifcfg-fedora/plugin.c + - (watch_path): watch the path, not the filename (duh) + - (reload_all_connections): use the direct hash/equal functions; the + ones for int aren't appropriate here + - (get_secrets, system_config_interface_init): implement the + get_secrets() function + - (build_one_connection, find_connection_by_path): ifcfg file path is + now in the connection's ConnectionData instead of being a GObject + data property + - (handle_profile_item_changed): ifcfg file path is now in the + connection's ConnectionData instead of being a GObject data property; + be sure to copy secrets over from the new connection to the existing + connection when updating the connection's settings + - (init): sc_plugin_inotify_init() returns success/fail, not the inotify + file descriptor + + * system-settings/plugins/ifcfg-fedora/parser.c + system-settings/plugins/ifcfg-fedora/parser.h + - (connection_data_get, copy_one_cdata_secret, clear_one_cdata_secret, + connection_data_copy_secrets, connection_data_free, + connection_data_add): new functions; connection data manipulation + - (make_wireless_security_setting): stuff secrets into the + connection data, not as GObject data items; make sure to close + the keys ifcfg file + - (wireless_connection_from_ifcfg, wired_connection_from_ifcfg): add + connection data to the connection + +2008-02-07 Dan Williams + + * system-settings/src/nm-system-config-interface.c + system-settings/src/nm-system-config-interface.h + - Add a get_secrets() interface function to retrieve secrets for a + specific setting of a specific connection. Document the interface + a bit more too. + +2008-02-07 Dan Williams + + * src/nm-device-802-11-wireless.c + - (handle_auth_or_fail): new function; consolidate device activation + failure check after a certain number of failures getting secrets + - (supplicant_connection_timeout_cb, real_act_stage2_config, + real_act_stage4_ip_config_timeout): use handle_auth_or_fail() to fail + the connection if secrets were requested more than a few times + - (real_act_stage3_ip_config_start): don't clear the wireless secrets + tries here; otherwise they are cleared before the IP configure + timeout, which happens with open system WEP when key is wrong + - (activation_success_handler): clear wireless secrets tries here too + +2008-02-07 Dan Williams + + * src/NetworkManagerPolicy.c + - (connection_updated): clear invalid tag when connection gets updated + to allow that connection to be tried again + - (nm_policy_new): save signal ids so they can be disconnected when + the policy is destroyed + - (nm_policy_destroy): stop any in-progress state change idle handler, + and disconnect all signals from the manager object so that none + of the policy functions gets called after the policy is destroyed + +2008-02-06 Dan Williams + + * src/nm-manager.c + - (finalize): remove devices a bit earlier; clean up system settings + poke + - (nm_manager_name_owner_changed): clean up system settings poke when + the service appears, and try to restart it if it fails + - (poke_system_settings_daemon_cb): try to get the system settings + service started through D-Bus service activation + - (initial_get_connections): start the system settings daemon if it's + not already running + +2008-02-05 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless): send scan_ssid=1 for + broadcast networks too + +2008-02-04 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (make_wireless_security_setting): fix spelling; unencrypted networks + need key_mgmt set too + - (parser_parse_file): validate ifcfg file name and don't try to parse + .bak files; ensure that an error is set whenever NULL gets returned + +2008-02-04 Dan Williams + + * system-settings/src/Makefile.am + - Install D-Bus service activation file for the system settings + service + + * system-settings/src/org.freedesktop.NetworkManagerSystemSettings.service + - D-Bus service activation file for system settings service + +2008-02-04 Dan Williams + + * system-settings/src/main.c + - (parse_config_file): parse a config file + - (main): accept --config option and read plugins from config file + +2008-02-04 Dan Williams + + * system-settings/plugins/ifcfg-fedora/plugin.c + - Change reported name to 'ifcfg-fedora' + - Use IFCFG_PLUGIN_NAME + + * system-settings/plugins/ifcfg-fedora/plugin.c + - Remove PLUGIN_NAME, use IFCFG_PLUGIN_NAME instead + +2008-02-04 Dan Williams + + * system-settings/plugins/ifcfg-fedora/parser.c + - (get_ifcfg_name): new function; factor out ifcfg name finding code + - (make_connection_setting): use get_ifcfg_name() + - (make_wireless_security_setting): handle shadow key files + - (get_one_wep_key): treat empty string as NULL + +2008-02-04 Dan Williams + + * src/supplicant-manager/nm-supplicant-manager.c + - (poke_supplicant_cb): reschedule the poke as a timeout, don't let + glib automatically reschedule + - (nm_supplicant_manager_init): immediately try to start the supplicant + - (nm_supplicant_manager_name_owner_changed): immediately try to restart + the supplicant + +2008-02-01 Dan Williams + + * src/NetworkManagerPolicy.c + - (device_state_changed): schedule a change check when a device gets + deactivated so something happens if you disconnect GSM/CDMA + +2008-01-31 Dan Williams + + * src/nm-device-802-11-wireless.h + src/nm-device-802-11-wireless.c + - (ap_list_get_ap_by_ssid, is_associated, + nm_device_802_11_wireless_ap_list_get_ap_by_ssid, + nm_device_802_11_wireless_ap_list_get_ap_by_obj_path): remove + - (nm_device_802_11_wireless_get_activation_ap): collapse + nm_device_802_11_wireless_ap_list_get_ap_by_obj_path() into this + function + +2008-01-30 Dan Williams + + * system-settings/plugins/ifcfg + * system-settings/plugins/ifcfg-fedora + - Move the ifcfg plugin to ifcfg-fedora + +2008-01-24 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.c + - (get_access_point): move the "/" check here; check for invalid path + too + - (nm_device_802_11_wireless_set_active_ap): leave the "/" check up + to get_access_point() + - (access_point_added_proxy, access_point_removed_proxy): don't try + to send signals for non-existent access points + +2008-01-24 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_set_active_ap): path of "/" means no AP + +2008-01-23 Dan Williams + + * libnm-glib/libnm_glib.c + - (libnm_glib_init): make thread joinable + - (libnm_glib_ctx_free): join thread on exit to clean up memory + +2008-01-23 Dan Williams + + * test/libnm_glib_test.c + - (signal_handler, setup_signals): trap SIGINT and SIGTERM + - (main): set up signal handlers; call libnm_glib_shutdown + +2008-01-21 Dan Williams + + * include/NetworkManager.h + - Add CDMA mobile broadband card device type + + * src/nm-hal-manager.c + - (modem_device_creator): handle both CDMA and GSM modems; the device + must now be tagged with 'cdma' or 'gsm' capability + + * src/nm-cdma-device.c + src/nm-cdma-device.h + src/Makefile.am + - Add the CDMA mobile broadband card device class + + * libnm-util/nm-connection.c + - (register_default_settings): add NMSettingCdma + + * libnm-util/nm-setting-cdma.c + libnm-util/nm-setting-cdma.h + libnm-util/Makefile.am + - Add the CDMA mobile broadband card setting class + + * libnm-glib/nm-cdma-device.c + libnm-glib/nm-cdma-device.h + libnm-glib/Makefile.am + - Add the CDMA mobile broadband card GLib proxy class + + * libnm-glib/nm-client.c + - (get_device): handle CDMA devices too + +2008-01-21 Dan Williams + + * src/ppp-manager/nm-ppp-manager.c + - (ip4_config_get): set peer address too + + * src/ppp-manager/nm-pppd-plugin.c + - (nm_ip_up): try harder to get the peer's address + + * src/NetworkManagerSystem.c + - (nm_system_device_set_from_ip4_config): if the IP4Config has a peer + address, use that too. Otherwise, some PPP connections won't work. + +2008-01-19 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): system connections override user + connections; don't activate a user connection if there's a currently + active system connection, and new, better system connections always + interrupt user connections + +2008-01-19 Dan Williams + + * src/nm-manager.h + - (nm_manager_get_connection_type): new function + +2008-01-19 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_get_best_connection): collapse find_best_connection() into this + function + +2008-01-19 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (real_get_best_connection): collapse find_best_connection() into this + function + +2008-01-18 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (find_best_connection): check MAC address too + - (real_get_best_connection): let autoconnect=True connections activate + for devices that don't have carrier detection + + * src/nm-device-802-11-wireless.c + - (find_best_connection): check MAC address too + +2008-01-18 Dan Williams + + * system-settings/plugins/ifcfg/parser.c + - (make_connection_setting): interpret ON_BOOT=y as 'autoconnect=True' + +2008-01-17 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (nm_device_802_3_ethernet_carrier_on, + nm_device_802_3_ethernet_carrier_off): ignore any spurious netlink + carrier events that might come in for devices that don't support + carrier detect + +2008-01-17 Dan Williams + + * src/nm-device-interface.c + - (nm_device_interface_check_connection_conflicts): need to actually + get the interface, not cast to the object + + * src/nm-device.c + - (nm_device_check_connection_conflicts): need to get the device class, + not cast the device to the device class + +2008-01-17 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_check_connection_conflicts): ignore connections that aren't + wireless connections + +2008-01-17 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): clear change check idle here + - (device_change_check_done): remove + - (schedule_change_check): simplify + +2008-01-17 Dan Williams + + * src/nm-manager.c + - (check_connection_allowed): take an NMDeviceInterface instead of + an NMDevice object as an argument + - (nm_manager_activate_device): pass an NMDeviceInterface to + check_connection_allowed() + +2008-01-13 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_get_access_points): fix memory leak + +2008-01-12 Dan Williams + + * src/nm-device-802-11-wireless.c + - (activation_success_handler): if a match was found in the scan list + and that match is a hidden AP, update that AP's SSID + +2008-01-11 Dan Williams + + * src/NetworkManagerAP.c + - (nm_ap_new_fake_from_connection): mark fake APs as fake + + * src/nm-device-802-11-wireless.c + - (get_active_ap): do two passes over the scan list if the caller + requests that hidden APs get matched too; during the second pass + when matching hidden APs, ignore the SSID since hidden APs in the + scan list don't have an SSID yet + - (periodic_update): move some checks to + nm_device_802_11_periodic_update() because not all callers need them + - (nm_device_802_11_periodic_update): move some checks here from + perodic_update() + - (merge_scanned_ap): if the current AP is fake, then don't do strict + matching on incoming scan results, because the fake AP's flags + might be slightly different (yet still compatible) with the incoming + scan result's flags and they might actually be the same AP; update + the rate on merged APs too + - (activation_success_handler): update the frequency of the fake AP + on successful connection; match hidden APs too since if the + current AP is fake, there might already be a scan result in the + scan list for the desired AP, just without it's SSID filled in yet + +2008-01-10 Dan Williams + + * src/NetworkManagerAP.c + - (foreach_property_cb): catch more hidden SSID formats + +2008-01-10 Dan Williams + + Fix gnome.org #464215. Requires the kernel patch titled + "Introduce WEXT scan capabilities" but will handle the patch not being + present, you'll just continue to have problems with hidden SSIDs when + using mac80211-based drivers. + + * src/supplicant-manager/nm-supplicant-config.h + src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless): new parameter to indicate + whether the driver supports SSID scans or not. If it does, and if + the AP is hidden, use ap_scan=1 instead of ap_scan=2 + + * src/nm-device-802-11-wireless.c + - (constructor): check whether or not the driver supports SSID scans + - (build_supplicant_config): pass driver SSID scan capability when + building the wireless bits of the supplicant config + +2008-01-09 Dan Williams + + * src/nm-device.c + src/nm-device.h + - (device_activation_precheck, check_connection_complete): remove this + virtual function; incomplete connections should be invalid by + definition, complete-ness should be checked in the setting's + verify function + + * src/nm-serial-device.c + src/nm-gsm-device.c + - (real_check_connection_complete): remove + + * libnm-util/nm-setting-serial.c + - (verify): new function; ensure there is a PPP setting too + + * libnm-util/nm-setting-gsm.c + - (verify): ensure there is a serial setting too + +2008-01-06 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_get_ip4_config): handle DHCP-provided MTU + (gnome.org #332953) + +2008-01-04 Dan Williams + + * src/named-manager/nm-named-manager.c + - (rewrite_resolv_conf, add_ip4_config_to_named): use primary IP4Config's + nameservers if the secondary config doesn't have any + (gnome.org #346833) + +2008-01-02 Tambet Ingo + + * libnm-util/nm-setting-serial.c (nm_setting_serial_class_init): Mark the properties + with G_PARAM_CONSTRUCT so that they get the default values. + + * src/nm-gsm-device.c: Add preliminary support for monitoring device. It only monitors + the monitoring device and prints out the output for now. Or more precicely, doesn't + do absolutely anything right now since the montoring device argument is never set. + + * src/nm-serial-device.c (serial_debug): Implement. It's very verbose and thus + requires it's own knob to turn it on. + (config_fd): Add NMSettingSerial to the arguments list. + (nm_serial_device_open): Ditto. + (get_reply_got_data): Ignore the terminators at the beginning of the output. + (nm_serial_device_get_io_channel): Implement. + + * src/nm-manager.c: Add NMDBusManager to the private data of the NMManager. Asking + a new reference every time (and forgetting to release it sometimes) is a pain and + it's not like NMManager could work without dbus. + (nm_manager_add_device): Register the added device on dbus here. + + * src/nm-hal-manager.c (modem_device_creator): Pass NULL for now for the monitoring + device. + + * src/nm-device.c (constructor): Don't export the device here, instead export + it when it's added to the NMManager's device list. + +2007-12-31 Dan Williams + + * src/nm-device-interface.c + src/nm-device-interface.h + - (nm_device_interface_check_connection_conflicts): new function + + * src/nm-device.c + src/nm-device.h + - (nm_device_check_connection_conflicts): new function + - (device_activation_precheck): don't require subclasses to implement + check_connection_complete() + - check_connection() -> check_connection_complete() + + * src/nm-device-802-11-wireless.c + - (real_check_connection): remove; unused + - (real_check_connection_conflicts): implement, handle lockdown for + system connections + + * src/nm-device-802-3-ethernet.c + - (real_check_connection): remove; unused + + * src/nm-manager.c + - (check_connection_allowed): new function + - (nm_manager_activate_device): ensure the connection being requested + is allowed to be activated + + * src/nm-serial-device.c + src/nm-gsm-device.c + - real_check_connection() -> real_check_connection_complete() + +2007-12-27 Dan Williams + + * src/nm-device-interface.c + src/nm-device-interface.h + - (nm_device_interface_error_quark, nm_device_interface_error_get_type): + normalize and expand errors + - (nm_device_interface_init): register errors so they can be marshalled + through dbus-glib + - (nm_device_interface_activate): ensure that failure of activation + returns an error + + * src/nm-device.c + src/nm-device.h + - (device_activation_precheck): implementations of check_connection() + now take a GError and must fill it in if the check fails. Return + more descriptive error if the requested connection is already + activating + - (nm_device_activate): actually try to return descriptive errors on + failures + + * src/nm-device-802-11-wireless.c + src/nm-device-802-3-ethernet.c + src/nm-serial-device.c + src/nm-gsm-device.c + - (real_check_connection): return more descriptive errors on failure + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): print activation errors in the logs + + * src/nm-manager.c + - (nm_manager_error_quark, nm_manager_error_get_type, + nm_manager_class_init): new errors + - (nm_manager_activate_device): handle errors + - (nm_manager_error_new): removed + - (wait_for_connection_expired, connection_added_default_handler, + impl_manager_activate_device): better error handling + +2007-12-27 Dan Williams + + Fixes gnome.org #466954 + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - Allow 'frequency' network property + + * src/supplicant-manager/nm-supplicant-config.c + src/supplicant-manager/nm-supplicant-config.h + - (nm_supplicant_config_add_setting_wireless): add 'adhoc_freq' argument + for callers to specify the frequency an Ad-Hoc network should operate + on. Some drivers require this to successfully create an Ad-Hoc + network. + + * src/nm-device-802-11-wireless.c + - (iw_freq_to_uint32): new function; convert a struct iw_freq into a + guint32 value in MHz + - (constructor, nm_device_802_11_wireless_get_frequency): use + iw_freq_to_uint32() + - (find_supported_frequency): new function; find a free supported + frequency for a user-created Ad-Hoc network + - (build_supplicant_config): if no frequency was specified for a user- + created Ad-Hoc network, find a free one to use + - (real_act_stage1_prepare): mark Ad-Hoc connections that don't have + a specific object as user-created + +2007-12-27 Dan Williams + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + - (nm_utils_security_valid): add 'adhoc' argument and handle security + for adhoc networks + +2007-12-24 Dan Williams + + * libnm-util/nm-setting-wireless.c + - (verify): add 802.11a channels 7, 8, 9, 11, 12, 16, 34, 165, 183, 184, + 185, 187, 188, 192, and 196 + +2007-12-24 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_get_frequency): handle drivers that return + a channel # instead of a frequency + +2007-12-24 Dan Williams + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + - (nm_ap_new_fake_from_connection): pass band to channel_to_freq() + - (freq_to_channel): handle split band tables + - (channel_to_freq): handle split band tables, take a band argument + +2007-12-24 Dan Williams + + * libnm-util/nm-setting-connection.h + libnm-util/nm-setting-connection.c + - Add 'lockdown' member + +2007-12-22 Dan Williams + + * libnm-util/nm-setting-wireless.c + - (nm_setting_wireless_class_init): add missing 'rate' property + specification + +2007-12-18 Dan Williams + + Base the NMNetlinkMonitor class on libnl instead of hand-rolled netlink. + + * src/nm-netlink-monitor.c + src/nm-netlink-monitor.h + - Remove handrolled netlink, use libnl instead + + * src/nm-device-802-3-ethernet.c + - (constructor, nm_device_802_3_ethernet_carrier_off, + nm_device_802_3_ethernet_carrier_on): use new names + +2007-12-17 Dan Williams + + * configure.in + - Bump requirement for libnl to 1.0-pre8 (which works with newer kernels + and fixes memory leaks) + + * src/nm-netlink.c + - (nm_netlink_get_default_handle): handle new versions of libnl that + automatically handle the netlink PID + +2007-12-17 Dan Williams + + Patch from Michael Biebl + + * configure.in + src/ppp-manager/Makefile.am + - fix up install dir of pppd plugin + - clean up configure.in a bit + +2007-12-12 Dan Williams + + * system-settings/src/nm-system-settings.conf + - Allow non-root clients (like the applet) to read settings + +2007-12-10 Tambet Ingo + + * Replace all occurences of 'UMTS' with 'GSM'. + +2007-12-07 Dan Williams + + * src/nm-serial-device.c + - (real_is_up): serial devices are always "up" + +2007-12-07 Dan Williams + + * src/nm-netlink.c + src/NetworkManagerSystem.c + - (new_nl_handle): ensure that the same netlink pid is never chosen + twice (gnome.org #491047) + - Make more robust against allocation-related failures should they occur + +2007-12-07 Dan Williams + + Noticed by Christian Persch + + Always chain up to parent object in dispose and finalize handlers. + (gnome.org #433112) + +2007-12-07 Dan Williams + + * src/nm-device-802-11-wireless.c + - Wrap #include of linux/mii.h to fix redefined structures due to + incorrect kernel headers (gnome.org #350061) + +2007-12-06 Tambet Ingo + + * src/nm-umts-device.c (real_act_stage1_prepare): Flash the modem (drop DTR) + before doing anything else. + (init_modem): Move modem initialization here. + + * src/nm-serial-device.c (ppp_state_changed): React on pppd state changes. + (nm_serial_device_flash): Implement. + + * src/ppp-manager/nm-ppp-manager.c (name_owner_changed): Fix the typoes: the state + changes signal is "StateChanged" and not "Status". + (ppp_exit_code, ppp_status_changed): Remove the debug output, it's working fine now. + +2007-12-06 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless_security): reorganize a bit + to only send some options when they make sense; also send phase2 + option to the supplicant (possible fix for rh #399631) + +2007-12-06 Tambet Ingo + + * src/NetworkManagerSystem.c (nm_system_device_set_from_ip4_config): Change the + arguments: This whole file shouldn't really know anything about NMDevices, it + should deal only with device interfaces. Devices might have different ifaces for + different stuff and this place shouldn't know anything about it. + + * src/NetworkManagerPolicy.c: Get rid of leftover global variable global_policy. + (global_state_changed): Implement. In the current NM it's not really important, + but will be required in the case of multiple active devices. (Or even better, + if stuff like that gets moved out from NM). + + * src/vpn-manager/nm-vpn-connection.c (connection_state_changed): Don't call + nm_system_device_set_from_ip4_config() directly, use nm_device_set_ip4_config() + instead. + + * src/nm-device.c: Add a ip_face protected member. It's used for 'multi-interface' + devices like serial devices (ttyS0 and ppp0 for example). + (nm_device_get_ip_iface): Implement. Default to the device iface if ip_iface is not + set. + (nm_device_set_ip_iface): Implement. + (nm_device_activate_stage5_ip_config_commit): Move all the extra actions that happen + after setting ip4_config from here ... + (nm_device_set_ip4_config): ... to here. The reason behind it is that no other code + than this function should call nm_system_device_set_from_ip4_config() because no + other code has enough information on which arguments to use. So instead, other code + could just set the new ip4 config using this function and everyone is happy. + + * src/nm-umts-device.c: Store the pending ids so that we can remove pending actions + if we happen to get deactivated while something is pending. + (automatic_registration): Handle the response that indicates pending network + registration and wait until the pending registration is done. + (real_deactivate_quickly): If there's a pending operation, cancel it. + + * src/nm-serial-device.c (ppp_ip4_config): Set the ip_iface when the iface is up ... + (real_deactivate_quickly): ... and remove it when it's down. + (nm_serial_device_get_reply): Return the timeout id so that the callers can remove + it if needed. + (nm_serial_device_wait_for_reply): Ditto. + +2007-12-05 Tambet Ingo + + * src/nm-umts-device.c (dial_done): Fix the typoes in warnings. + (get_network_done): Remove newline, nm_info() does it already. + (real_act_stage1_prepare): Turn the modem echo off. + + * src/NetworkManagerSystem.c (nm_system_device_set_from_ip4_config): In case of serial + device, set the route to the device interface. This is a hack. + + * src/nm-serial-device.c (nm_serial_device_send_command_string): Only append carriage + return, no need for a new-line. + (ppp_ip4_config): Store the ip4 config to be set in the next stage. + Change the device iface here (ugh). + (real_act_stage4_get_ip4_config): Implement. + (real_deactivate_quickly): Free the pending ip4 config if it's still pending. + Restore the device iface. + + * src/NetworkManagerPolicy.c (nm_policy_device_change_check): Do nothing if the active + device is not wired or wireless (eg, automatically upped) device. + + * src/ppp-manager/nm-ppp-manager.c (ip4_config_get): Don't make the config secondary, + it isn't. + (nm_ppp_manager_start): Don't let pppd to set the default route, we want to do it. + + * src/nm-hal-manager.c (get_creator): Make sure the device has required capability + before calling it's is_device_fn(). + +2007-12-05 Dan Williams + + * libnm-util/nm-utils.c + - (nm_utils_register_value_transformations, + nm_utils_convert_gvalue_hash_to_string): better debug output of + GHashTables of GValues too + +2007-12-04 Dan Williams + + * initscript/RedHat/NetworkManager.in + - No longer start named; it's D-Bus interface is going away + +2007-12-04 Dan Williams + + Patch from Michael Biebl + + * system-settings/plugins/ifcfg/Makefile.am + system-settings/src/main.c + system-settings/src/Makefile.am + - Put system settings plugins in NM plugins dir + + * src/ppp-manager/Makefile.am + src/ppp-manager/nm-ppp-manager.c + - Move pppd plugin to NM plugins dir + +2007-12-04 Dan Williams + + * libnm-util/nm-setting-vpn-properties.h + - Clarify usage of the 'data' member of the setting + + * libnm-util/nm-setting-vpn-properties.c + - (nm_setting_vpn_properties_init): initialize the 'data' hash table + - (set_property): just remove all the settings; don't recreate the has + - (update_one_secret): don't need to create the hash table here since + it should always be present + +2007-12-03 Tambet Ingo + + Implement PIN and PUK requesting. + + * src/nm-umts-device.c (enter_pin_done): Request the secret again if it failed. + (enter_pin): Handle PIN and PUK requests. + (real_act_stage1_prepare): Clear the secret type. + (real_connection_secrets_updated): Implement this class method to get + notified when new secrets arrive. + (nm_umts_device_class_init): Add private data back to the umts device class + to store the required secret type. + +2007-12-01 Dan Williams + + * system-settings/plugins/ifcfg/parser.c + - (parser_parse_file): don't try to verify NULL connections + +2007-12-01 Dan Williams + + * system-settings/src/main.c + - (load_connections, add_connection_to_settings): actually export + plugin-provided connections over D-Bus so NM can get them + +2007-12-01 Dan Williams + + * system-settings/plugins/ifcfg/parser.c + system-settings/plugins/ifcfg/parser.h + system-settings/plugins/ifcfg/plugin.c + - Hook up more inotify bits (untested) + +2007-11-29 Dan Williams + + * system-settings/src/nm-system-config-interface.h + system-settings/src/nm-system-config-interface.c + - (nm_system_config_interface_init, + nm_system_config_interface_get_connections): add + + * system-settings/src/main.c + - (load_plugins, load_connections, main): use a GSList for plugins + to ensure priority ordering + + * system-settings/plugins/ifcfg/parser.c + - (ifcfg_error_quark): move to plugin.c, and rename + + * system-settings/plugins/ifcfg/plugin.h + system-settings/plugins/ifcfg/plugin.c + - (ifcfg_plugin_error_quark): move here from parser.c + - rework connection loading and initialization + - Add preliminary inotify support for network profile config file + +2007-11-28 Tambet Ingo + + Merge the beginnings of the new GSM card support. + + * src/ppp-manager/nm-ppp-manager.c (nm_ppp_manager_stop): Remove the + ppp watch source before killing pppd - If this happens from g_object_unref() + then the ppp manager is already destroyed by the time the watch callback runs. + + * src/nm-hal-manager.c: Add a device_type_name string to the device + creators, so that we can print a nice human readable string when a + device is added. + + * src/nm-umts-device.c (automatic_registration_get_network): Query + for the activated network, not much is done with the result thought. + + * src/nm-serial-device.c (nm_serial_device_get_reply): Implement. + (ppp_ip4_config): Change the device state to activated here for now. + (real_check_connection): Make sure the connection includes ppp setting. + + * libnm-glib/nm-client.c (get_device): Handle umts devices. + + * libnm-glib/Makefile.am: Add the new files to build. + + * libnm-glib/nm-umts-device.c: + * libnm-glib/nm-umts-device.h: Implement. + +2007-11-26 Tambet Ingo + + * src/nm-umts-device.c (automatic_registration_get_network): For now, dial + immediately, nm_serial_device_get_reply() isn't implemented correctly yet. + + * src/nm-serial-device.c (wait_for_reply_info_destroy): Don't try to remove + the timeout source - this function is only called when the timeout source has + been removed. + (nm_serial_device_wait_for_reply): Allocate the duplicate responses array + to be big enough to contain the terminating zero element as well. + The timeout argument is meant to be in seconds now. + (real_deactivate_quickly): Implement. + + * src/NetworkManager.conf: Allow root to own + "org.freedesktop.NetworkManager.PPP", deny it for everybody else. + + * libnm-util/nm-setting-umts.c: Network type and band properties are ints, + (not unsigned ints). + + * libnm-util/nm-setting-serial.c (nm_setting_serial_class_init): Fix a + small issue with parity bounds - capital letters have lower ascii codes + than lower case letters. + + * libnm-util/nm-connection.c (register_default_settings): Register serial + and umts settings. + +2007-11-22 Tambet Ingo + + Remove the "index" property from devices as not all device types have this. + + * include/NetworkManager.h (NM_DBUS_PATH_DEVICE): Remove. + + * src/nm-hal-manager.c (nm_get_device_index_from_hal): Remove. + (wired_device_creator): Get the device interface from hal to create the device. + (wireless_device_creator): Ditto. + + * src/nm-device.c (nm_device_init): Remove the index member. + (constructor): Remove the checks for index property, make interface property + a require constructor property. + Use the HAL udi for DBus path for devices. + (nm_device_get_index): Remove. + (set_property): Remove index handling. + (get_property): Ditto. + (nm_device_get_dbus_path): Remove. + + * src/nm-device-interface.c (nm_device_interface_init): Remove the index + property. + + * src/nm-device-802-3-ethernet.c (nm_device_802_3_ethernet_link_activated): + Access the device index through it's interface. + (nm_device_802_3_ethernet_link_deactivated): Ditto. + (nm_device_802_3_ethernet_new): Remove the useless argument test_dev. Remove + index argument. Add interface argument. + + * src/nm-device-802-11-wireless.c (nm_device_802_11_wireless_new): Remove + the useless test_dev argument. Remove index argument. Add interface arugment. + + * src/NetworkManagerSystem.c (nm_system_device_set_from_ip4_config): Get the + device index through interface. + (nm_system_set_mtu): Ditto. + + * introspection/nm-device.xml: Remove the "Index" property. + +2007-11-21 Tambet Ingo + + * src/nm-serial-device.c: + * src/nm-serial-device.c: + * src/nm-umts-device.c: + * src/nm-umts-device.h: Implement. + + * src/nm-hal-manager.c (nm_get_device_driver_name): libhal_free_string the string + allocated by libhal. + (modem_device_creator): Implement. + (register_built_in_creators): Register the modem creator. + + * src/nm-device-802-11-wireless.c (nm_device_802_11_wireless_new): + Remove the unused test_dev argument. + + * src/nm-device-802-3-ethernet.c (nm_device_802_3_ethernet_new): Ditto. + + * src/Makefile.am: Add new files to build. + Link in ppp-manager. + + * libnm-util/nm-setting-umts.c: + * libnm-util/nm-setting-umts.h: + * libnm-util/nm-setting-serial.c: + * libnm-util/nm-setting-serial.h: Implement. + + * libnm-util/Makefile.am: Add new files to build. + +2007-11-28 Dan Williams + + Patch from Zdeněk Jurka + + Support DHCP-provided static routes. + + * src/nm-ip4-config.h + src/nm-ip4-config.c + - Add get/set functions for static routes + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_get_ip4_config): extract static routes from the + DHCP response + + * src/NetworkManagerSystem.c + - (nm_system_device_set_from_ip4_config): set any static routes on the + interface when applying the IP4Config + +2007-11-28 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_act_stage1_prepare): mark APs created for hidden networks + as non-broadcasting + +2007-11-27 Dan Williams + + * system-settings/src/nm-system-config-interface.h + - Note how to store secrets on NMSetting objects + + * system-settings/src/dbus-settings.c + - (connection_settings_get_secrets): implement + +2007-11-27 Dan Williams + + * system-settings/plugins/ifcfg/Makefile.am + system-settings/plugins/ifcfg/parser.c + system-settings/plugins/ifcfg/parser.h + system-settings/plugins/ifcfg/plugin.c + - Parse wireless connections too + + * system-settings/src/dbus-settings.c + system-settings/src/dbus-settings.h + system-settings/src/main.c + - Handle connection update/removal if the plugin supports it + +2007-11-27 Dan Williams + + * src/nm-dbus-manager.h + src/nm-hal-manager.c + - Include the correct headers now that NetworkManagerDbusUtils.h doesn't + do it for them + + * src/Makefile.am + src/NetworkManagerDbusUtils.c + src/NetworkManagerDbusUtils.h + - Remove these two source files; they are unused + +2007-11-27 Dan Williams + + * src/vpn-manager/nm-vpn-manager.c + - (impl_vpn_manager_connect): fix system settings check (found by + James M. Leddy) + +2007-11-26 Dan Williams + + * Fix warnings so everything compiles with --enable-more-warnings + +2007-11-25 Dan Williams + + * system-settings/* + - Rework structure and code to use GModule-loaded plugins and a plugin + interface that plugins export to the system settings service + +2007-11-21 Dan Williams + + * system-settings/* + - Add Soren's system settings service. Needs work for distros other + than Fedora; the backends from NM should mostly migrate to here + and be converted to GObjects + +2007-11-21 Dan Williams + + * libnm-util/nm-setting-vpn-properties.c + - (set_property): must deep-copy the given settings hash, otherwise + double-free errors occur when the setting is disposed of + +2007-11-21 Dan Williams + + * src/vpn-manager/nm-vpn-act-request.h + src/vpn-manager/nm-vpn-act-request.c + - Remove; unused + +2007-11-20 Dan Williams + + * libnm-util/nm-utils.c + - (nm_utils_convert_strv_to_string, nm_utils_convert_uint_array_to_string, + nm_utils_convert_ip4_addr_struct_array_to_string, + nm_utils_register_value_transformations): print out the readable + values of more types of properties of NMSettings subclasses + +2007-11-20 Dan Williams + + * libnm-util/nm-setting-ip4-config.c + - (ip4_addresses_from_gvalue, ip4_addresses_to_gvalue, + nm_setting_ip4_config_class_init): apparently dbus-glib can't + marshal GValueArrays inside collections, so switch to types that it + can actually marshal/demarshal + +2007-11-16 Dan Williams + + * libnm-util/nm-setting-wireless-security.c + - (verify_tls, verify_ttls, verify_identity, verify_nai): do some + minimal verification of EAP methods too + - (verify): verify phase1 eap methods too + +2007-11-15 Dan Williams + + * libnm-glib/nm-device.h + libnm-glib/nm-device.c + - (nm_device_get_product, nm_device_get_vendor): should be returning + const char * + +2007-11-15 Dan Williams + + * libnm-glib/nm-device.c + - (get_product_and_vendor): don't try to free things that should be + freed + +2007-11-15 Dan Williams + + * src/NetworkManagerUtils.c + - (nm_ethernet_address_is_valid): unbreak previous fix + +2007-11-15 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless_security): handle PEAP + options + +2007-11-15 Dan Williams + + * src/NetworkManagerUtils.c + - (nm_ethernet_address_is_valid): fix style, clarify + - (nm_ethernet_addresses_are_equal): don't try to memcmp NULLs + + * src/nm-device-802-11-wireless.c + - (get_active_ap): handle failure from nm_device_802_11_wireless_get_bssid() + - (nm_device_802_11_wireless_get_ssid, + nm_device_802_11_wireless_get_bssid, + nm_device_802_11_wireless_get_bitrate): zero the wreq structure + before calling the ioctl; fixes valgrind-reported jump depends on + uninitialized value errors + +2007-11-15 Dan Williams + + * libnm-util/nm-setting.c + - (nm_setting_to_hash, one_property_cb): revert previous commit, it's + unecessary to serialize 'name' + + * src/nm-activation-request.c + - (get_secrets_cb): fix cases where a full NMSetting is returned from + the GetSecrets call + +2007-11-15 Dan Williams + + * libnm-util/nm-setting-connection.h + libnm-util/nm-setting-connection.c + - Rename the 'name' property to 'id', because it conflicted with the + NMSetting superclass' 'name' property. + + * libnm-util/nm-setting.c + - (nm_setting_to_hash): serialize the 'name' property + - (one_property_cb): ignore 'name' on deserialization of a connection + + * src/nm-device-802-11-wireless.c + src/vpn-manager/nm-vpn-connection.c + src/NetworkManagerPolicy.c + - Fix up for NMSettingConnection 'name'->'id' changes + +2007-11-13 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.h + libnm-glib/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_get_hw_address): return should be const + + * test/nm-tool.c + libnm-glib/libnm-glib-test.c + - Fixes for above change + +2007-11-12 Dan Williams + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - Allow fragment_size option + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - (nm_supplicant_config_add_setting_wireless_security): use a lower + EAP fragment size than the default to help some TLS connections + +2007-11-12 Dan Williams + + Make certs actually work. The private key is now a secret, and should be + decrypted when requested by NM. The private key and phase2 private key + passwords are no longer interesting to NM because they should be used by + the settings service to decrypt the private key itself before passing it + to NM, and hence have been removed as fields. + + * libnm-util/nm-setting-wireless-security.h + libnm-util/nm-setting-wireless-security.c + - Remove private-key-passwd and phase2-private-key-passwd from + properties + - (need_secrets_password, need_secrets_eappsk, need_secrets_sim, + need_secrets): use property #defines instead strings to keep things + consistent + - (need_secrets_tls): if a client certificate is present but no + private key, request the private key + - (set_property, get_property, nm_setting_wireless_security_class_init): + remove private key password stuff, mark private keys as secret + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - Remove private_key_passwd and private_key2_passwd from opt_table + +2007-11-09 Dan Williams + + Fix vpn-properties setting update_secrets call for new NMSetting stuff. + Since the vpn-properties are managed and known by the VPN daemons themselves, + libnm-util doesn't know what's secret and what's in the setting's 'data' + member. + + * libnm-util/nm-setting.h + libnm-util/nm-setting.c + - Add the ability for subclasses to override update_one_secret + + * libnm-util/nm-setting-vpn-properties.c + - Override update_one_secret and just copy the values into the + internal table + +2007-11-09 Dan Williams + + * libnm-glib/nm-settings.h + libnm-glib/nm-settings.c + - (nm_settings_new_error): remove + - (nm_settings_error_quark): add; instead of nm_settings_new_error, + clients should use g_set_error() with NM_SETTINGS_ERROR + +2007-11-09 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless_security): private key + passwords are never sent to wpa_supplicant, because the supplicant + should never be reading random files from the disk. Clients like + the applet are required to decrypt the private keys and send NM + the decrypted blobs. + +2007-11-08 Dan Williams + + * libnm-util/nm-setting-wireless-security.h + libnm-util/nm-setting-wireless-security.c + - Add 'private-key-decrypted' and 'phase2-private-key-decrypted' + members to 802-11-wireless-security structure. This should be used + to indicate that the values in private-key and phase2-private-key + are already decrypted by the user agent, and that no + private-key-passwd or phase2-private-key-passwd should be expected. + It is not meant to be a stored configuration value, but meant to + be set when the conneciton is sent to NM over dbus. + +2007-11-08 Dan Williams + + * libnm-util/nm-connection.h + libnm-util/nm-connection.c + - (nm_connection_need_secrets): add argument to return hints + + * src/nm-device-802-11-wireless.c + - (link_timeout_cb, supplicant_connection_timeout_cb, + real_act_stage2_config, real_act_stage4_ip_config_timeout): handle + nm_connection_need_secrets() change + +2007-11-07 Tambet Ingo + + Rework NMSetting structures: Move each setting to it's own file. + Convert to GObject. Remove home grown setting types and use GTypes. + Use GObject property introspection for hash conversion, enumerating + properties, etc. + + * libnm-util/nm-setting-connection.[ch] + * libnm-util/nm-setting-ip4-config.[ch] + * libnm-util/nm-setting-ppp.[ch] + * libnm-util/nm-setting-vpn.[ch] + * libnm-util/nm-setting-vpn-properties.[ch] + * libnm-util/nm-setting-wired.[ch] + * libnm-util/nm-setting-wireless.[ch] + * libnm-util/nm-setting-wireless-security.[ch] + + New files, each containing a setting. + + * libnm-util/nm-setting-template.[ch]: A template for creating new + settings. To use it, just replace 'template' with the new setting + name, and you're half-way done. + + * libnm-util/nm-setting.c: Convert to GObject and use GObject + introspection instead of internal types and tables. + + * libnm-util/nm-connection.c: Adapt the new NMSetting work. + + * libnm-util/nm-param-spec-specialized.[ch]: Implement. Handles + GValue types defined by dbus-glib for composed types like collections, + structures and maps. + + * src/*: The API of NMSetting and NMConnection changed a bit: Getting + a setting from connection takes the setting type now. Also, since + the settings are in multiple files, include relevant settings. + +2007-10-31 Saleem Abdulrasool + + * configure.in: + * src/backends/NetworkManagerGentoo.c: + (nm_system_restart_mdns_responder): Implement restarts for other mdns + providers in Gentoo. + +2007-10-31 Dan Williams + + * libnm-util/nm-connection.c + - (gvalue_to_string): handle UINT32 arrays + +2007-10-31 Dan Williams + + * libnm-glib/nm-device.h + libnm-glib/nm-device.c + - (nm_device_get_description): remove + - (nm_device_get_product, nm_device_get_vendor): add + - (nm_device_update_description): new function (private); walk HAL + devices to get product and vendor IDs for a specific device + +2007-10-31 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_get_mode): ignore ENODEV errors + +2007-10-29 Dan Williams + + * src/nm-hal-manager.c + - (device_added, device_new_capability): ignore device additions while + asleep. Fixes crash caused when NM goes to sleep, a network device + kernel module is unloaded and reloaded and recognized by NM again. + +2007-10-26 Dan Williams + + Patch from Helmut Schaa (and more bits from me) + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + libnm-glib/nm-access-point.c + libnm-glib/nm-access-point.h + - Make 'rate' property a guint32 to better match with WEXT and + wpa_supplicant and to allow representation of higher bitrates + + * src/nm-device-802-11-wireless.c + introspection/nm-device-802-11-wireless.xml + libnm-glib/nm-device-802-11-wireless.c + libnm-glib/nm-device-802-11-wireless.h + - Make 'bitrate' property a guint32 to match AP 'rate' property type + + * src/nm-device-802-3-ethernet.c + src/nm-device-802-3-ethernet.h + introspection/nm-device-802-3-ethernet.xml + libnm-glib/nm-device-802-3-ethernet.c + libnm-glib/nm-device-802-3-ethernet.h + - Make 'speed' property a guint32 to match other speed/rate types + - Make nm_device_802_3_ethernet_get_speed() static + + * test/nm-tool.c + - Update for the changes above + +2007-10-26 Dan Williams + + * src/named-manager/nm-named-manager.c + - (rewrite_resolv_conf): clean up error handling to avoid double-free by + not calling fclose() twice on some error conditions + +2007-10-26 Dan Williams + + * src/nm-activation-request.c + - (dispose): clean up indentation; get the right DBusGProxy object to + cancel the GetSecrets pending call on. Need to use the Secrets + proxy, not the regular connection proxy. Otherwise the GetSecrets + pending call doesn't get canceled, and pressing Cancel in the + applet's password dialog could cause get_secrets_cb() to be called + after the activation request has already been destroyed + +2007-10-24 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_blob): pass blob data and length for + verification + - (get_hash_cb): use GByteArrays rather than GArrays; easier to follow + +2007-10-24 Dan Williams + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - (opt_table): max length for certificates should be 65536 + +2007-10-24 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + - (blob_free): correctly free blob data after use + - (call_set_blobs): use the right D-Bus interfaace for setBlobs + +2007-10-24 Dan Williams + + * libnm-util/nm-setting.c + - (setting_wireless_security_need_secrets): Fix lookup table logic for + EAP method need secrets + +2007-10-24 Dan Williams + + * src/backends/NetworkManagerRedHat.c + - (nm_system_update_dns): be a lot smarter about telling nscd to restart + +2007-10-23 Dan Williams + + * libnm-util/nm-setting.c + libnm-util/nm-setting.c + - (nm_setting_compare): implement + - (default_setting_compare_fn, do_one_compare, compare_gvalue_hash, + compare_one_hash_gvalue): compare the contents of a setting + + * libnm-util/nm-connection.c + - (nm_connection_compare): implement + +2007-10-23 Dan Williams + + * src/nm-activation-request.c + - (get_secrets_cb): handle getting a setting back that is more than + just secrets (ie, user changed auth or EAP method or something) + +2007-10-23 Dan Williams + + * libnm-util/nm-setting.c + libnm-util/nm-setting.h + - (nm_setting_verify): new function; verify one setting + - (nm_settings_verify_all): rename from nm_settings_verify() + - (setting_connection_verify, setting_wireless_verify): allow NULL + all_settings + + * libnm-util/nm-connection.c + - (nm_connection_replace_settings, nm_connection_verify, + nm_connection_new_from_hash): handle nm_settings_verify() rename + +2007-10-23 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_act_stage2_config): use pre-increment on 'tries' to get the + desired behavior + +2007-10-23 Dan Williams + + * src/supplicant-manager/nm-supplicant-settings-verify.c + - eap_allowed, phase2_allowed: harmonize with allowed values from + nm-settings.c + +2007-10-23 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_act_stage2_config): after the first association failure, + if the connection still needs secrets ask the user for them + explicitly. After the fourth association failure due to bad + secrets, fail the connection entirely. Handles the GetSecrets + loop that NM gets into when the provided secrets don't match up + with the connection details. + +2007-10-23 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless_security): only add + WPA-specific options when WPA is in use + +2007-10-23 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless_security): 'password' + secret doesn't need to be unhexified + +2007-10-23 Dan Williams + + * libnm-util/nm-setting.c + - (setting_wireless_security_need_secrets): ensure auth_alg is !NULL + before trying to do something with it + +2007-10-23 Dan Williams + + * src/nm-device-802-11-wireless.c + - (merge_scanned_ap): handle NULL ssids returned from nm_ap_get_ssid() + +2007-10-23 Dan Williams + + * src/nm-device-802-11-wireless.c + - (merge_scanned_ap): use libnm-util empty SSID check to catch more + non-SSID-broadcasting APs + +2007-10-23 Dan Williams + + * src/NetworkManagerAP.c + - (match_cipher, security_compatible): remove + - (nm_ap_check_compatible): use nm_utils_ap_security_compatible() from + libnm-util instead + +2007-10-23 Dan Williams + + * libnm-util/nm-utils.c + libnm-util/nm-utils.h + - (nm_utils_ap_security_compatible): common function for checking + whether a specific AP is compatible with an NMConnection + +2007-10-23 Dan Williams + + * libnm-util/nm-setting.c + - (setting_wireless_security_need_secrets, need_secrets_phase2, + need_secrets_tls, need_secrets_sim, need_secrets_eappsk, + need_secrets_password, setting_wireless_security_verify): fix + need_secrets for IEEE 802.1x and WPA-EAP by implementing need + secrets logic for each supported EAP method + +2007-10-23 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless_security): fix wpa_supplicant + config option name, should be "private_key2_passwd" + +2007-10-22 Tambet Ingo + + Implement support for static IP addresses, additional/overridden DNS and + DNS domain search lists. + + * libnm-util/nm-setting.c (uint_array_to_gvalue): Implement. + (ip4_addresses_to_gvalue): Implement. + (convert_array_to_byte_array): Implement. + (nm_setting_populate_from_hash_default): Handle NM_S_TYPE_UINT_ARRAY and + NM_S_TYPE_IP4_ADDRESSES. + (nm_setting_hash): Ditto. + (default_setting_clear_secrets): Add a default case for the switch: IP address + shouldn't be secret, ever. + (setting_ip4_config_verify): Update, requires addresses in case of manual + configurations. + (setting_ip4_config_destroy): Free stuff. + + * src/nm-device.c (merge_ip4_config): Implement. + (real_act_stage4_get_ip4_config): Merge IP4 configuration from NMConnection. + +2007-10-22 Dan Williams + + * libnm-util/nm-setting.c + - (setting_wireless_security_verify): allow WEP-40 and WEP-104 as + pairwise cipher options for Dynamic WEP + +2007-10-21 Dan Williams + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + - Rename 'articifical' -> 'fake' since that's what they are until + noticed in scans + - (nm_ap_new_fake_from_connection): new function to create a 'fake' AP + from the attributes in an NMConnection object + - (security_compatible): better handle Dynamic WEP and LEAP; handle + WPA Enterprise + - (nm_ap_match_in_list): find a matching AP in a scan list + + * src/nm-device-802-11-wireless.c + - (get_active_ap): add an 'ignore_ap' argument to ignore a specific + AP when searching the scan list; match on frequency and mode too + - (nm_device_802_11_wireless_get_frequency): implement + - (merge_scanned_ap): replace duplicate matching logic with + nm_ap_match_in_list() + - (real_act_stage1_prepare): handle a NULL specific object; ie where + the user is trying to connect to a hidden network that is not yet + known from the scan list + - (activation_success_handler): now that the card knows the AP's BSSID, + there may already be a scanned AP in the scan list that is what + we really wanted to connect to, but didn't know at the time. Use + that instead of the 'fake' AP created at activation start and get + rid of the 'fake' AP + - (cull_scan_list): don't remove fake APs + +2007-10-21 Dan Williams + + * src/nm-activation-request.h + src/nm-activation-request.c + - (nm_act_request_set_specific_object): new function; allow setting the + specific object if one isn't set yet + +2007-10-20 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.h + src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_init, nm_supplicant_config_finalize): add a hash + table to store blobs + - (nm_supplicant_config_add_blob): new function; add blob to internal + blob hash table + - (nm_supplicant_config_get_blobs): new function; get stored blobs + - (nm_supplicant_config_add_setting_wireless_security): handle + options that use certificates (ie, blobs) + + * src/nm-device-802-11-wireless.c + - (build_supplicant_config): pass a UID (just use the connection path) + to the supplicant config as now required + + * src/supplicant-manager/nm-supplicant-interface.c + - (add_network_cb, call_set_blobs, set_blobs_cb, call_set_network): if + there are any blobs to send to wpa_supplicant, send those first + before sending the network configuration + +2007-10-19 Dan Williams + + Split the GetSecrets() call off to a separate D-Bus interface so that it + can be more easily locked down with D-Bus policy. Only 'root' (ie, NM) + should be able to call GetSecrets(). + + * include/NetworkManager.h + - Define the connection secrets D-Bus interface + + * src/vpn-manager/nm-vpn-connection.c + - (clear_need_auth): get the right proxy object for the connection + secrets interface + - (get_connection_secrets): use the connection secrets proxy; send + empty hints in get secrets request + + * src/nm-activation-request.c + - (nm_act_request_request_connection_secrets): use the connection + secrets proxy; send empty hints in get secrets request + + * src/nm-manager.c + src/nm-manager.h + - (connection_get_settings_cb): set the connection secrets proxy on + the connection object too + - (internal_new_connection_cb): create the connection secrets proxy + + * introspection/nm-settings-connection.xml + - Define Connection.Secrets interface and move GetSecrets there + - Add a 'hints' argument to GetSecrets + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - (impl_connection_settings_get_secrets): add 'hints' argument + +2007-10-19 Dan Williams + + * src/nm-device.c + - (constructor): add message about what path a device is exported as + to help in debugging rh #339011 + +2007-10-17 Dan Williams + + * libnm-util/nm-utils.h + libnm-util/nm-utils.c + - (nm_utils_security_valid): common function to help find the intersection + of capabilities of devices and (optionally) access points + +2007-10-17 Dan Williams + + * src/nm-device-802-11-wireless.c + - (get_wireless_capabilities): add missing braces so that WPA capabilities + don't get erroneously cleared + +2007-10-17 Dan Williams + + * src/nm-manager.h + src/nm-manager.c + src/nm-hal-manager.c + - (device_removed, finalize, nm_manager_remove_device, + nm_manager_sleep): add a 'deactivate' argument to + nm_manager_remove_device() to fully deactivate devices when necessary + (ie, always except when waking up) + +2007-10-16 Dan Williams + + * libnm-util/nm-setting.c + - (setting_wireless_security_verify): fix phase2_auth methods; 'sim' + also isn't valid phase2 autheap method + +2007-10-16 Dan Williams + + * libnm-glib/nm-client.c + - (update_wireless_status): consolidate updates of wireless status + - (constructor): use update_wireless_status() + - (manager_running): set wireless status off when NM goes away; requery + the wireless status when NM comes back + +2007-10-16 Dan Williams + + * libnm-glib/nm-client.c + - (nm_client_activate_device): actually use the fixed-up specific + object path + +2007-10-16 Dan Williams + + * src/nm-hal-manager.c + - (killswitch_getpower_reply, nm_hal_manager_destroy): only print out + killswitch error messages once + +2007-10-16 Dan Williams + + * src/nm-manager.c + - (manager_set_wireless_enabled): don't allow wireless to be enabled + if it's disabled in hardware; don't touch network devices while + NM is asleep + +2007-10-16 Dan Williams + + * libnm-util/nm-client.c + - (nm_client_activate_device): convert NULL specific_object to "/", + which is used in place of NULL + + * src/nm-manager.c + - (impl_manager_activate_device): convert "/" specific_object back into + NULL + +2007-10-16 Tambet Ingo + + Implement a generic NMSetting creator from setting name. + While at it, get rid of all nm_setting_foo_new_from_hash() functions and + add a virtual function 'populate_fn'. + + * libnm-util/nm-connection.c (nm_connection_create_setting): Implement. + (register_default_creators): Register setting creators instead of functions + that create and then populate. + (parse_one_setting): Use the common setting creator and then setting specific + poplulation function. + + * libnm-util/nm-setting.c: Get rid of nm_setting_foo_new_from_hash() functions, + they all looked exactly the same. + Add a 'populate_fn' virtual function to NMSetting. + Use default virtual functions in case they are not overriden. + (nm_setting_populate_from_hash): Implement. + + * src/nm-device.c (real_act_stage3_ip_config_start): Don't hard code the setting + name, use a defined string. + (real_act_stage4_get_ip4_config): Ditto. + +2007-10-16 Tambet Ingo + + * src/nm-hal-manager.c (killswitch_getpower_reply): The type returned from + HAL is int, not uint. + +2007-10-15 Tambet Ingo + + Implement killswitch polling through HAL. + + * src/nm-manager.c: Add wireless hardware status property. Add + 'properties-changed' signal for changes in wireless and wireless hardware + state changes. + + * src/nm-hal-manager.c: Poll hal for killswitch statuses in every 6 seconds + and update NMManager's wireless hardware state when it has changed. + (nm_hal_manager_new): Don't try to add initial devices here - (hal_init) + already does that. + + * libnm-glib/nm-client.c: Add wireless hardware status property. Cache the + values of wireless state and wireless hardware state. Listen for the + 'properties-changed' signals, update the cached values and emit notify. + + * include/NetworkManager.h: Fix a typo in a comment. + +2007-10-14 Dan Williams + + * libnm-util/nm-setting.c + - (setting_wireless_security_need_secrets): handle LEAP secrets + +2007-10-13 Dan Williams + + * libnm-util/nm-setting.h + libnm-util/nm-setting.c + src/supplicant-manager/nm-supplicant-config.c + - Make the 'proto' field of the 802-11-wireless-security field a + string list + +2007-10-12 Tambet Ingo + + Rework the "properties-changed" signal listening implementation. + Add a generic implementation to NMObject class that listens for + the signal and calls property setters of the target NMObject. + + * libnm-glib/nm-object.c (nm_object_handle_properties_changed): Implement. + + * libnm-glib/nm-device-802-11-wireless.c: Move the GObject consturction + code to the end of file so that all the static functions are available + without extra declarations. + Remove the "properties-changed" signal handling and use the framework from + NMObject. + Implement property setters for properties that change with + "properties-changed" signal. + + * libnm-glib/nm-access-point.c: Ditto. + +2007-10-12 Tambet Ingo + + Rework the "properties-changed" signal implementation. + In classes that need to use it, just emit "GObject::notify" and the new + framework takes care of the rest to make the signal available on dbus. + The framework queues the notifications and tries to send as many together + in one signal as possible. + + * src/nm-properties-changed-signal.c: + * src/nm-properties-changed-signal.h: Implement. + + * src/Makefile.am: Add new files to build. + + * src/NetworkManagerAP.c: Use the general framework for properties-changed + signal. + + * src/nm-device-802-11-wireless.c: Ditto. + +2007-10-10 Dan Williams + + * src/nm-manager.c + - (wait_for_connection_expired): ensure info is valid + - (connection_added_default_handler): Should only remove pending + connection info when the manager has the connection that it's + waiting for. Fixes segfault in wait_for_connection_info(). + +2007-10-10 Dan Williams + + * libnm-util/nm-setting.c + libnm-util/nm-setting.h + - Add a default 'user_name' field to the VPN setting, which VPN plugins + can use if they choose. Should be filled in by the settings service + on-the-fly with the currently logged in user's username + +2007-10-10 Dan Williams + + * src/nm-device-802-11-wireless.c + - (merge_scanned_ap): make sure non-SSID-broadcasting APs are marked + as such, because even if the manager fills in the SSID, NM still + has to indicate to wpa_supplicant that the AP isn't broadcasting + its SSID + +2007-10-10 Tambet Ingo + + Move ppp-manager over to dbus-glib. The big deal is that it was the last piece of + code that used NM's own version of dbus signal handling and custom dictionary + marshalling/unmarshalling. With this change, all that obsolete code can disappear + and we get to maintain over 2000 lines less code. + + * libnm-util/dbus-dict-helpers.c: + * libnm-util/dbus-dict-helpers.h: Remove. + + * src/ppp-manager/nm-pppd-plugin.c: Convert it to use dbus-glib. + + * src/ppp-manager/nm-pppd-plugin.xml: Implement. + + * src/ppp-manager/nm-ppp-manager.c: Use dbus-glib instead of home-brewed dbus signal + handlers. + + * src/nm-dbus-manager.c: Remove all the manual dbus signal handling. + + * configure.in: Remove test/libnm-util/Makefile creation. + + * test/Makefile.am: Remove libnm-util from SUBDIRS. + + * test/libnm-util/: Remove the whole directory. + +2007-10-10 Tambet Ingo + + * src/NetworkManagerPolicy.c (nm_policy_new): Initialize the + device_state_changed_idle_id variable or it would contain some random value and the + schedule_change_check calls would not do anything. + +2007-10-09 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_iface_scanned_ap_cb): set the non-broadcast flag elsewhere + - (merge_scanned_ap): only have the manager fill the SSID if the AP + isn't broadcasting its SSID; set the non-broadcast flag here; fix + merging of non-SSID-broadcasting APs + +2007-10-09 Tambet Ingo + + * libnm-util/nm-utils.c (nm_utils_is_empty_ssid): Convert the ssid type to + "guint8 *" since it's usually used with GByteArray->data. + (nm_utils_ssid_to_utf8): Add it back, the applet needs it. + +2007-10-09 Tambet Ingo + + * src/NetworkManagerUtils.c + (nm_utils_is_empty_ssid): + (nm_utils_escape_ssid): + (nm_utils_same_ssid): Remove. These functions are copied and pasted in a + lot of places, so they belong to libnm-utils instead. + + Now with 100% less compiler warnings: + + * libnm-util/nm-utils.c (nm_dbus_escape_object_path): Remove, unused. + (nm_dbus_unescape_object_path): Ditto. + (nm_utils_ssid_to_utf8): Ditto. + (nm_utils_is_empty_ssid): Move here from src/NetworkManagerUtils.c + (nm_utils_escape_ssid): Ditto. + (nm_utils_same_ssid): Ditto. + + * src/nm-manager.c: Include 'netinet/ether.h' for ether_aton_r. + (add_one_connection_element): Remove an unused variable. + (impl_manager_get_active_connections): Ditto. + + * src/NetworkManagerPolicy.c (get_device_connection): Remove an unused + variable. + + * src/nm-dbus-manager.c (nm_dbus_manager_start_service): Remove a leftover + from the previous commit. + + * src/nm-device-802-11-wireless.c (set_current_ap): Remove unused variable. + (real_act_stage1_prepare): Ditto. + (activation_success_handler): Ditto. + (get_property): Ditto. + + * src/nm-device-802-3-ethernet.c (real_get_best_connection): Remove unused + variable. + + * src/ppp-manager/nm-pppd-plugin.c (nm_ip_up): Remove the check for 'ifname', + it's always set. + + * src/supplicant-manager/nm-supplicant-config.c + (nm_supplicant_config_add_setting_wireless): Cast the GByteArray's 'guint8 *' + to expected "char *". + (nm_supplicant_config_add_setting_wireless): Ditto. + (nm_supplicant_config_remove_option): Remove, not used. + + * libnm-glib/libnm-glib-test.c (dump_access_point): Frequency is a guint32, + not double. + (test_wireless_enabled): Ifdef out unused function. + (device_deactivate): Ditto. + (device_state_changed): Ditto. + (nm_utils_is_empty_ssid): Remove, it's now in libnm-utils. + (nm_utils_escape_ssid): Ditto. + + * test/nm-tool.c (nm_utils_escape_ssid): Remove, it's now in libnm-utils. + (nm_utils_is_empty_ssid): Ditto. + + * libnm-glib/nm-client.c (nm_client_free_active_connection_element): Remove + unused variable. + + * libnm-util/nm-setting.c (setting_wireless_destroy): Remove unused variable. + (setting_vpn_properties_update_secrets): Ditto. + (int_to_gvalue): Ifdef out for now, not used. + (byte_to_gvalue): Ditto. + + * libnm-util/dbus-dict-helpers.c (_nmu_dbus_add_dict_entry_string_array): + Unused, remove. + +2007-10-08 Tambet Ingo + + * src/NetworkManager.c (main): When dbus manager doesn't want to start, complain + about dbus manager, not named manager. + Make sure hal_manager and dbus_mgr are created before trying to unreference. + + * src/nm-dbus-manager.c: There was an issue with priv->proxy: We have a signal + handler for it's 'destroy' signal - we use it to catch disconnects from dbus. + However, the same signal is emitted when we destroy it and there's + nm_dbus_manager_cleanup -> destroy_cb -> nm_dbus_manager_cleanup cycle. + + (nm_dbus_manager_cleanup): Let go of the DBusGProxy before + releasing the DBusGConnection, since proxy needs a conneciton. + (destroy_cb): Set the private proxy to NULL before cleaning up the manager. + +2007-10-08 Dan Williams + + * src/NetworkManager.c + - (main): error on unknown command-line options + +2007-10-08 Dan Williams + + Reimplement the invalid connection list. Don't try to re-activate a + connection that just failed or was canceled. + + * src/nm-device.c + - (connection_secrets_failed_cb): fail device activation, don't just + deactivate the device. Listeners have to know about the failure. + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): exclude invalid connections from + the connection list given to a device's get_best_connection() + method + - (device_state_changed): tag failed connections as invalid; clear the + tag from successful connections + +2007-10-08 Dan Williams + + Fix problems with interrupted activation. Previously, choosing an AP + from the menu, then choosing another one before the first connection was + successful wouldn't deactivate the device before starting the new connection + on that same device. + + * src/NetworkManagerPolicy.c + - (deactivate_old_device, device_state_changed, state_changed, + nm_policy_new): wrong place to deactivate old devices + + * src/nm-manager.c + - (pending_connection_info_destroy, finalize, + wait_for_connection_expired): decouple destruction of the pending + connection info from the manager device + - (connection_added_default_handler): deactivate any active or + activating device before starting a new activation + - (impl_manager_activate_device): deactivate any active or activating + device before starting a new activation; be sure not to leak + pending connection info if a new activation request arrives but + there's already a pending one in-process + +2007-10-08 Dan Williams + + * src/NetworkManagerAP.h + src/NetworkManagerAP.c + - (nm_ap_has_manufacturer_default_ssid): remove, unused. User clients + should handle default SSIDs and whether or not to autoconnect + to them + +2007-10-08 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): print out connection name where + possible + +2007-10-08 Dan Williams + + * src/nm-device-802-11-wireless.c + src/nm-device-802-11-wireless.h + - (nm_device_802_11_wireless_class_init, merge_scanned_ap): new + 'hidden-ap-found' signal (for internal use only) that allows the + NMManager to fill in the AP's SSID if a connection has that AP's + BSSID in its seen-bssids list + + * src/nm-manager.c + - (manager_hidden_ap_found, nm_manager_add_device): attach to a + wireless device's hidden-ap-found signal and fill in the APs SSID + if possible + +2007-10-07 Dan Williams + + * src/nm-manager.c + src/nm-manager.h + - Add a 'connections-added' signal to batch together updates of large + numbers of connections, like when reading from a settings service + the first time. Otherwise, the policy would just activate the first + suitable connection it saw rather than waiting for the full list + to arrive. + - (nm_manager_class_init): register new signal + - (get_type_for_proxy, connection_get_settings_cb, + get_connection_for_proxy): centralize places where a proxy's setting + service is determined + - (free_get_settings_info): if the call being freed is the last call + in a pending call group, fire off the connections-added signal + - (internal_new_connection_cb): add call to a pending call group if + requested + - (list_connections_cb): always create a call group here, because this + call results in a batch of new connections + - (initial_get_connections): start getting system connections first + - (nm_manager_connections_destroy, emit_removed): actually emit the + removed signal when destroying connections + + * src/NetworkManagerPolicy.c + - (nm_policy_new, connections_added): handle connections-added signal + from the manager + +2007-10-06 Dan Williams + + * src/nm-device-802-11-wireless.c + - (constructor): fix leaked socket + +2007-10-06 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): fix connection list reffing. Each + connection in the list returned by nm_manager_get_connections() is + reffed, but they weren't getting unreffed before returning + +2007-10-06 Dan Williams + + * src/nm-manager.c + - (connections_to_slist): sort connections first on autoconnect, then + on timestamp + +2007-10-06 Dan Williams + + * libnm-util/nm-connection.c + - (gvalue_to_string): handle UINT64 + +2007-10-06 Dan Williams + + * src/NetworkManagerPolicy.c + - (connection_updated, nm_policy_new): recheck state when a connection + gets updated + +2007-10-06 Dan Williams + + * src/nm-manager.c + src/nm-manager.h + - (nm_manager_get_connection_dbus_path): make static + - (nm_manager_update_connections): remove; unused + - Add a connection-updated signal + - (new_connection_cb, connection_updated_cb, nm_manager_class_init): + handle connection object updates + +2007-10-06 Dan Williams + + * src/NetworkManagerPolicy.c + - (connection_removed): deactivate removed connections + +2007-10-06 Dan Williams + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_replace_settings): new function + +2007-10-06 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_get_active_access_point): don't segfault + on error when getting the active access point over D-Bus from NM + +2007-10-05 Dan Williams + + * libnm-util/nm-setting.c + - (setting_wireless_verify, setting_wireless_destroy): add seen_bssids + to the NMSettingWireless table; it's now a string array not an array + of byte arrays + +2007-10-05 Dan Williams + + * libnm-glib/nm-device-802-11-wireless.c + - Cache properties and update cached properties on D-Bus signals from NM + +2007-10-05 Dan Williams + + * src/nm-device-802-11-wireless.c + - (set_current_ap): consolidate current_ap handling code into one place + to ensure that PropertiesChanged signals are emitted in all cases + - (periodic_update, real_deactivate_quickly, real_act_stage1_prepare, + nm_device_802_11_wireless_dispose): use set_current_ap() + +2007-10-05 Dan Williams + + * libnm-glib/nm-access-point.c + libnm-glib/nm-access-point.h + - (nm_access_point_get_hw_address): return 'const char *', not 'char *' + because the value is cached internally now. Callers should not + free the internal value. + - Make signal name defines private + + * test/nm-tool.c + libnm-glib/libnm-glib-test.c + - Don't free value returned from nm_access_point_get_hw_address() + +2007-10-04 Dan Williams + + * introspection/nm-device-802-11-wireless.xml + src/nm-device-802-11-wireless.h + src/nm-device-802-11-wireless.c + - Add a PropertiesChanged signal for wireless device + - Store currently associated access point + - (periodic_update): generalize; update rate here too and emit the + correct PropertiesChanged signal when stuff changes + - (real_deactivate_quickly, nm_device_802_11_wireless_dispose, + real_activation_cancel_handler): clear current_ap when device is + deactivated + - (link_to_specific_ap, get_ap_blacklisted, + nm_device_802_11_wireless_get_best_ap): remove obsolete and unused + code + - (nm_device_802_11_wireless_get_bitrate): make static; unused anywhere + outside this file + - (real_set_hw_address): emit property changed signal if the card's + MAC address changes + - (real_act_stage1_prepare): set the initial current_ap to the AP + the card is supposed to be connecting to + - (activation_success_handler): send out property updates on successful + activation + - (get_property): pull bitrate from cached value; use OBJECT_PATH type + for ACTIVE_ACCESS_POINT property because sometimes there won't be + one and dbus-glib doesn't like marshalling NULL G_TYPE_OBJECTs + - (nm_device_802_11_wireless_class_init): ACTIVE_ACCESS_POINT property + is now boxed; add PropertiesChanged signal + +2007-10-04 Dan Williams + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_verify): new function + +2007-10-04 Dan Williams + + * libnm-util/nm-setting.c + - (nm_settings_verify): use #defines when possible rather than strings + - (setting_connection_verify): ensure that 'name' and 'type' are valid + - (setting_vpn_verify): tighter validity check on 'service_type' + +2007-10-04 Dan Williams + + * libnm-glib/nm-settings.c + - (nm_connection_settings_class_init): provide correct type for argument + to the Updated signal so that dbus-glib knows how to marshal it + +2007-10-03 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (real_get_best_connection): don't create automatic connections + internally; clients should provide a setting that applies to + the device with 'autoconnect: True'. Problem was that these + internally auto-created connections don't have a proxy or service + name becuase they weren't created by a settings daemon, and therefore + clients have no idea what to do with them. + +2007-10-03 Dan Williams + + * src/nm-device-802-11-wireless.c + src/nm-device-802-11-wireless.h + introspection/nm-device-802-11-wireless.xml + - GetActiveNetworks -> GetAccessPoints + - ActiveNetwork -> ActiveAccessPoint + - NetworkAdded -> AccessPointAdded + - NetowrkRemoved -> AccessPointRemoved + + * libnm-glib/nm-device-802-11-wireless.c + libnm-glib/nm-device-802-11-wireless.h + - network-added signal -> access-point-added + - network-removed signal -> access-point-removed + - nm_device_802_11_wireless_get_active_network() -> + nm_device_802_11_wireless_get_active_access_point() + - nm_device_802_11_wireless_get_network_by_path() -> + nm_device_802_11_wireless_get_access_point_by_path() + - nm_device_802_11_wireless_get_networks() -> + nm_device_802_11_wireless_get_access_points() + + * libnm-glib/libnm-glib-test.c + test/nm-tool.c + src/NetworkManagerPolicy.c + - Fixups for Network -> AccessPoint + +2007-10-03 Dan Williams + + Add a GetActiveConnections() method on the Manager object. + + * src/nm-manager.c + src/nm-manager.h + introspection/nm-manager.xml + - (connection_get_settings_cb): keep connection type around too + - (impl_manager_get_active_connections, add_one_connection_element): + implement; returns all active connections and what devices they + apply to + + * libnm-glib/nm-client.c + libnm-glib/nm-client.h + introspection/nm-manager-client.xml + - (nm_client_get_devices): GPtrArray elements are allocated and owned + by the caller; free here to avoid memory leak + - (nm_client_get_active_connections): implement; return the list of + active connections + - (nm_client_free_active_connection_element): implement; free an element + of the GSList returned by nm_client_get_active_connections() + +2007-10-03 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_update_bssid): remove + - (get_active_ap): new function; find the AP in the scan list which + matches the current BSSID and SSID of the wireless device + - (nm_device_802_11_periodic_update): get current AP using + get_active_ap() and print AP roam messages + +2007-10-01 Dan Williams + + * libnm-util/nm-setting.h + - Add a 'timestamp' option to NMSettingConnection + - Add a UINT64 type + + * libnm-util/nm-setting.c + - (uint64_to_gvalue): new function + - (nm_setting_populate_from_hash, nm_setting_hash, + default_setting_clear_secrets): handle UINT64 type + - con_table: add 'timestamp' member + +2007-10-01 Dan Williams + + * src/nm-manager.c + - (impl_manager_activate_device): ensure the D-Bus method sends a return + value when the connection can be activated immediately + +2007-10-01 Dan Williams + + * libnm-glib/nm-device.c + - (nm_device_class_init): actually tell glib about the carrier-changed + signal + +2007-10-01 Dan Williams + + * configure.in + src/marshallers/Makefile.am + src/marshallers/nm-marshal.list + src/marshallers/nm-marshal-main.c + - Consolidate glib marshallers into one place + + * src/dhcp-manager/Makefile.am + src/dhcp-manager/nm-dhcp-manager.c + src/supplicant-manager/Makefile.am + src/supplicant-manager/nm-supplicant-manager.c + src/supplicant-manager/nm-supplicant-interface.c + src/ppp-manager/Makefile.am + src/ppp-manager/nm-ppp-manager.c + src/vpn-manager/Makefile.am + src/vpn-manager/nm-vpn-connection.c + src/Makefile.am + - Use consolidated marshallers + + * src/dhcp-manager/nm-dhcp-marshal.list + src/dhcp-manager/nm-dhcp-marshal-main.c + src/supplicant-manager/nm-supplicant-marshal-main.c + src/supplicant-manager/nm-supplicant-marshal.list + src/nm-marshal-main.c + src/nm-marshal.list + src/ppp-manager/nm-ppp-marshal-main.c + src/ppp-manager/nm-ppp-marshal.list + src/vpn-manager/nm-vpn-marshal-main.c + src/vpn-manager/nm-vpn-marshal.list + - Remove + +2007-10-01 Dan Williams + + * include/NetworkManagerVPN.h + - define VPN connection state change reason codes + + * src/vpn-manager/Makefile.am + src/vpn-manager/nm-vpn-marshal.list + src/vpn-manager/nm-vpn-marshal-main.c + - Add marshallers for StateChanged signal + + * introspection/nm-vpn-connection.xml + - New Banner property + - StateChanged signal now includes a 'reason' argument + + * src/vpn-manager/nm-vpn-connection.c + src/vpn-manager/nm-vpn-connection.h + - Add a "Banner" property that contains the returned VPN server login + banner (if any); valid only in the ACTIVATED state + - (nm_vpn_connection_set_state, nm_vpn_connection_disconnect): now takes + a 'reason' argument and emits that reason along with the + state-changed signal + - Fix up calls to nm_vpn_connection_set_state() to include a reason + - (nm_vpn_connection_ip4_config_get): save banner for later + - (nm_vpn_connection_get_banner, get_property, + nm_vpn_connection_class_init): implement Banner property + + * src/vpn-manager/nm-vpn-service.c + - (nm_vpn_service_connections_stop): take a reason argument; copy the + connection list because elements may get added/removed from it + while iterating over the list + - (connection_state_changed): signal now includes the 'reason' argument + + * libnm-glib/nm-vpn-connection.c + libnm-glib/nm-vpn-connection.h + - (nm_vpn_connection_get_banner): new function + - (state_changed_proxy): handle reason argument + +2007-09-28 Tambet Ingo + + * src/nm-manager.c: + * src/nm-manager.h: + Implement device activation through NMManager. + Implement "pending device activation" here - If the connection isn't found, + we try to wait for up to 5 seconds for the connection to be provided. + Add NMConnectionType argument to "connection-added" and "connection-removed" + signals. + (nm_manager_get): Remove. Finally. + + * src/nm-activation-request.c: + * src/nm-activation-request.h: + Remove all the deferred activation code. + + * src/nm-device.c: Remove all the deferred activation code. Once the device + activation is started, it's started. Update the activation virtual function + signature. + + * src/nm-device-interface.c: + * src/nm-device-interface.h: + Device activation now takes only NMActRequest argument. + Don't expose device activation directly on dbus, it's supposed to go through + NMManager now. + + * src/NetworkManagerPolicy.c (nm_policy_device_change_check): Make the code + a bit more compact. + Use the new device activation methods through NMManager. + + * introspection/nm-manager-client.xml: + * introspection/nm-manager.xml: + * libnm-glib/nm-client.c: + * libnm-glib/nm-client.h: + Add device activation method. + + * libnm-glib/nm-device.c: + * libnm-glib/nm-device.h: + * introspection/nm-device.xml: + Remove device activation method. It's done through NMManager now. + + * src/vpn-manager/nm-vpn-manager.c (impl_vpn_manager_connect): Use the shiny + new (nm_manager_get_device_by_path) function, get rid of our own )find_device). + +2007-09-28 Dan Williams + + * libnm-glib/nm-vpn-connection.c + - (nm_vpn_connection_get_state): try to update state if the current + state is UNKNOWN + +2007-09-27 Dan Williams + + Patch from Bill Nottingham + + * src/supplicant-manager/nm-supplicant-config.c + - (ADD_STRING_VAL): use correct length for binary blobs when sending + data to the supplicant + +2007-09-27 Dan Williams + + * src/NetworkManagerSystem.c + - (nm_system_vpn_device_set_from_ip4_config): clean up indentation; + and all address manipulation here should be happening on the + _VPN_ device, not the active device + +2007-09-26 Dan Williams + + * src/nm-manager.c + src/nm-manager.h + src/nm-activation-request.c + src/nm-activation-request.h + - Move the GetSecrets stuff out of the NMManager instance because it + doesn't really need to be there and complicates things + + * src/nm-device.c + - (connection_secrets_failed_cb, device_activation_go): connect to the + connection-secrets-failed signal and deactivate the device if + the GetSecrets call fails + + * src/nm-device-802-11-wireless.c + - (link_timeout_cb, supplicant_connection_timeout_cb, + real_act_stage2_config, real_act_stage4_ip_config_timeout): request + secrets and give correct hints about whether new secrets should be + asked for by the client or not + +2007-09-26 Dan Williams + + * src/vpn-manager/nm-vpn-connection.c + - (nm_vpn_connection_set_state, clear_need_auth, finalize, + connection_secrets_updated_cb, get_secrets_cb): don't need to attach + to the secrets-updated signal of the NMConnection since updating + the secrets is done within the scope of the NMVPNConnection object + already + - (get_connection_secrets): fix an uninialized variable usage error + +2007-09-26 Dan Williams + + * libnm-util/nm-setting.c + - (setting_vpn_properties_update_secrets): implement so VPN secrets + actually get updated when the user enters them + +2007-09-26 Dan Williams + + * libnm-glib/nm-vpn-plugin.c + - (impl_vpn_plugin_need_secrets): fix logic when no secrets are needed + +2007-09-26 Dan Williams + + * include/NetworkManagerVPN.h + - Add a NEED_AUTH state + + * src/vpn-manager/nm-vpn-connection.c + - Implement the NEED_AUTH state. First ask the VPN service plugin if + the connection needs secrets, and if so, then ask the settings + service to fill in the secrets. Then start the connection. + +2007-09-26 Dan Williams + + * src/vpn-manager/nm-vpn-manager.c + - (new_vpn_error, impl_vpn_manager_connect): set errors + +2007-09-26 Dan Williams + + * introspection/nm-vpn-plugin.xml + libnm-glib/nm-vpn-plugin.c + libnm-glib/nm-vpn-plugin.h + - (impl_vpn_plugin_need_secrets): implement a call that should return + the name of the NMSetting in an NMConnection that may require + secrets specific to that VPN plugin + +2007-09-26 Dan Williams + + * src/nm-manager.c + src/nm-manager.h + - (nm_manager_get_connection_secrets): make static, unused outside + the file + - Provide NM_MANAGER_CONNECTION_PROXY_TAG for other users + +2007-09-26 Tambet Ingo + + * libnm-glib/nm-vpn-plugin.c (nm_vpn_plugin_connect): Update the plugin activation + method. + (impl_vpn_plugin_connect): Convert properties hash to NMConnection, activate, and + unreference the connection. + + * introspection/nm-vpn-plugin.xml: Modify the 'Connect' method arguments: instead of + passing properties hash and routes string list, pass NMConnection (in hashed form). + + * src/vpn-manager/nm-vpn-connection.c (nm_vpn_connection_get_routes): Return routes + as GSList, no need to copy stuff around anymore. + (nm_vpn_connection_activate): Update the plugin activation method. + + * src/NetworkManagerSystem.c (nm_system_vpn_device_set_from_ip4_config): Convert + routes argument to GSList. + +2007-09-26 Tambet Ingo + + * src/nm-manager.c (manager_device_state_changed): Listen to device' NEED_AUTH + state and try to get the secrets. + + * src/NetworkManagerPolicy.c (nm_policy_auto_get_best_device): Get the list of + connections from NMManager and let the device to choose the best from the list. + Since the connection list is sorted by system ones first and user ones later, + the devices still prefer system connections like they did before. + (deactivate_old_device): Implement. When a device starts activation, we have a + policy (for now at least) to deactivate any other device that might be either + active or still activating. + + * src/vpn-manager/nm-vpn-manager.c: Add NMManager back to the private structure. + It's set on construction, there will be no other way to access it. + + * src/nm-device-802-11-wireless.c: Don't touch NMManager, NMManager can listen to + device events and drive the device, not the other way around. + + * src/nm-device-802-3-ethernet.c: Ditto. + + * src/nm-device.c (nm_device_get_best_connection): The connections list is now + sent along, pass it on to virtual functions. + + * src/nm-device-interface.c (nm_device_interface_get_iface): Implement. It's static + for now, but should really be public instead of nm_device_get_iface() since iface + is a property of the DeviceInterface, not Device. + (impl_device_activate): Don't touch NMManager! + +2007-09-26 Jürg Billeter + + * initscript/paldo/NetworkManager.in: + * initscript/paldo/NetworkManagerDispatcher.in: + * src/backends/NetworkManagerPaldo.c: (nm_system_enable_loopback), + (nm_system_flush_loopback_routes): update paldo backend + +2007-09-26 Tambet Ingo + + * src/nm-device-802-3-ethernet.c (real_get_best_connection): Don't leak NMManager. + The problem with leaking NMManager is that on shutdown, it doesn't get destroyed, + which means none of the devices get brought down properly, which in turn leaves + DHCP client running. + + * src/nm-device-802-11-wireless.c (real_get_best_connection): Ditto. + (supplicant_connection_timeout_cb): Ditto. + +2007-09-25 Dan Williams + + * src/nm-device.c + - (device_activation_go): small hack to work around race when + activating deferred connections; should solve this in a better way + +2007-09-25 Dan Williams + + * introspection/nm-device.xml + libnm-glib/nm-device.c + libnm-glib/nm-device.h + - Add 'Carrier' property to exported NMDevice objects + + * src/nm-device-interface.h + src/nm-device-interface.c + src/nm-device.c + - Add a 'carrier' property to internal NMDevice objects + +2007-09-25 Dan Williams + + * src/nm-device-802-11-wireless.c + - (ap_auth_enforced): also return the encryption status of the AP so + that callers can differentiate easily between unencrypted APs + and encrypted ones, in addition to whether the AP has an + authenticator + - (link_timeout_cb, supplicant_connection_timeout_cb, + real_act_stage4_ip_config_timeout): handle unencrypted APs better, + previously would request secrets from unencrypted APs at times + +2007-09-25 Dan Williams + + * src/nm-manager.c + - (nm_manager_update_state): new function; updates state and emits + appropriate signals ensuring a state-change signal for the same state + never gets emitted twice in a row. + - (manager_device_state_changed): handle more device state to get a + better picture of the overall NM state + +2007-09-25 Dan Williams + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - (new_error -> nm_settings_new_error): make public so that subclasses + can use the same error domain. Also pass a valid error code to + g_error_new_literal() so that libdbus doesn't assert when converting + the GError into a DBusError + - (impl_settings_list_connections, impl_connection_settings_get_id, + impl_connection_settings_get_settings, + impl_connection_settings_get_secrets): use new error creator + function + +2007-09-25 Dan Williams + + * src/NetworkManager.c + - (nm_signal_handler, main): don't ignore SIGTERM/SIGINT during startup + +2007-09-25 Dan Williams + + * src/supplicant-manager/nm-supplicant-manager.c + - (poke_supplicant_cb, nm_supplicant_manager_init, + nm_supplicant_manager_dispose, nm_supplicant_manager_name_owner_changed, + nm_supplicant_manager_startup): when the supplicant isn't running, + try to start it periodically via system bus activation. Fixes + a problem where if wpa_supplicant goes away, NM gets stuck waiting + for the supplicant to come back + +2007-09-25 Dan Williams + + Ensure that old activation requests are forgotten about; previously + hitting Cancel in the password dialog would deactivate whatever device + that password was requested for, even if that wasn't the currently + activating connection. + + * src/nm-manager.c + src/nm-manager.h + - (nm_manager_get_connection_secrets): track the pending call + object so it can be canceled later if needed + - (nm_manager_cancel_get_connection_secrets): cancel a pending + GetSecrets call for a particular connection + + * src/nm-activation-request.c + - (dispose): cancel any outstanding GetSecrets calls on the + connection + +2007-09-25 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): handle devices that have a + deferred activation. These devices are not really active _yet_, + but need to be treated as such here. Don't interrupt them + automatically. + + * src/nm-device-interface.c + - (impl_device_activate): handle devices that have a deferred activation + like activating or active devices. When multiple active devices + get committed, the device shouldn't be deactivated until the + connection details are available to avoid DoS and such. Currently, + any active, activating, or deferred activation device is deactivated + here before starting the new activation request. + +2007-09-25 Dan Williams + + Properly re-query secrets from the settings daemon when stuff fails. + + * src/nm-device-802-11-wireless.c + - (ap_auth_enforced): handle static WEP correctly here by differentiating + between Shared Key and Open System auth modes + - (link_timeout_cb, supplicant_connection_timeout_cb, + real_act_stage4_ip_config_timeout): clear existing secrets and + request new ones when something fails due to a suspected wrong key + - (real_act_stage2_config): fix for new request_new argument to + nm_manager_get_connection_secrets() + + * src/nm-manager.c + src/nm-manager.h + - (nm_manager_get_connection_secrets): return error status; pass + new request_new argument on to the settings daemon + + * introspection/nm-settings-connection.xml + - New 'request_new' argument to the GetSecrets call that hints to the + settings daemon to ask the user for completely new secrets + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - (impl_connection_settings_get_secrets): handle new 'request_new' + argument + +2007-09-25 Dan Williams + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_clear_secrets): new function; clear secrets out of + each NMSetting in an NMConnection + + * libnm-util/nm-setting.h + libnm-util/nm-setting.c + - (nm_setting_clear_secrets, default_setting_clear_secrets): clear + secrets out of an NMSetting + - (nm_setting_connection_new, nm_setting_ip4_config_new, + nm_setting_wired_new, nm_setting_wireless_new, + nm_setting_wireless_security_new, nm_setting_ppp_new, + nm_setting_vpn_new, nm_setting_vpn_properties_new): set clear_secrets + to default handler default_setting_clear_secrets() + +2007-09-25 Dan Williams + + * src/nm-activation-request.c + src/nm-activation-request.h + - (nm_act_request_is_deferred): new function + +2007-09-24 Dan Williams + + * src/nm-device-802-11-wireless.c + - (activation_success_handler): update signal strength immediately + after activation + +2007-09-24 Dan Williams + + * libnm-util/nm-setting.c + - (verify_wep_key): 40-bit WEP keys are 10 bytes long, not 13 + +2007-09-24 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): don't interrupt activation of a + device by deactivating it because it doesn't have a "best connection". + Since autoconnect=False connections aren't automatically chosen, + NM would interrupt activation of such a connection because it + would never be "best" due to autoconnect=False. + +2007-09-24 Dan Williams + + * src/nm-manager.c + - (nm_manager_get_connection_secrets): Add a long timeout so the user + actually has some time to enter a key before the GetSecrets call + times out + +2007-09-24 Dan Williams + + * introspection/nm-manager.xml + src/nm-manager.c + - (impl_manager_legacy_state): fix 'state' method call return value + +2007-09-24 Matthias Clasen + + * test/Makefile.am: Install nm-tool + +2007-09-24 Dan Williams + + Patch from Ross Burton + + * test/nm-tool.c + callouts/nm-dhcp-client-action.c + src/nm-netlink.c + src/vpn-manager/nm-vpn-connection.c + libnm-glib/libnm-glib-test.c + - warning fixes + +2007-09-24 Dan Williams + + * libnm-util/nm-utils.h + libnm-util/nm-utils.c + - (nm_dbus_send_with_callback_replied, nm_dbus_send_with_callback): + remove, unused + +2007-09-23 Dan Williams + + * vpn-daemons/vpnc/properties/nm-vpnc.c + - Update for new VPN properties API bits; instead of passing around + a lot of random things, everything goes into the NMConnection + object. + +2007-09-23 Dan Williams + + * libnm-util/nm-setting.c + - Correctly dispose of settings objects if creating them from a hash + table fails + +2007-09-23 Dan Williams + + * libnm-util/nm-setting.c + - (property_value_destroy, nm_setting_vpn_properties_new): initialize + the hash table in a standard manner. Clients of libnm-util should + only call g_hash_table_remove_all(), never destroy the hash table + and recreate it. + +2007-09-22 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_bring_up): update signal strength every 6 seconds, not 2. No + real reason to do it so often, and reduces wakeups for clients. + +2007-09-21 Dan Williams + + * src/nm-device-802-11-wireless.c + - (build_supplicant_config): wpa_supplicant requires the option + key_mgmt=NONE for unencrypted networks + - (real_act_stage2_config): clarify log message on activation + +2007-09-21 Dan Williams + + * test/nm-supplicant-test.c + test/Makefile.am + - Remove supplicant test binary; no longer applicable + +2007-09-21 Dan Williams + + * src/supplicant-manager/nm-supplicant-manager.c + - (nm_supplicant_manager_init): poke the supplicant at startup to + activate it on the system bus + +2007-09-20 Dan Williams + + * initscript/RedHat/NetworkManager.in + - dhcdbd is no longer used, so don't try to start it from the initscripts + +2007-09-20 Dan Williams + + * src/nm-device.c + - (nm_device_is_activating): work around a race between auto-activation + and the user activating the same device that is being auto-activated + +2007-09-20 Dan Williams + + * src/nm-device-interface.c + - (impl_device_activate): until multiple active device support lands, + ensure only one device can be active at a time + +2007-09-20 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + src/supplicant-manager/nm-supplicant-config.h + - (nm_supplicant_config_add_option): hide secrets from system logs + +2007-09-20 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): re-enable the wireless device change + checking code; insted of checking for SSIDs, check for the same + connection instead + +2007-09-20 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_iface_connection_state_cb_handler): don't use the card's + composite link state when determining when to start the disconnection + timer; that link state is already based on the supplicant interface's + status which is exactly what's already being examined, plus the link + state is a conglomeration of various things that we don't want here + +2007-09-20 Dan Williams + + * libnm-glib/nm-access-point.c + - (handle_property_changed): strength is a UCHAR + +2007-09-20 Dan Williams + + * src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_add_setting_wireless_security): uppercase + string list keywords too since that's what wpa_supplicant wants + +2007-09-20 Dan Williams + + * libnm-util/nm-setting.c + - (convert_strv_to_slist): dupe the values in the list because since + the list is a boxed value, it'll get destroyed when it's container + (like a hash table or whatever) gets destroyed + +2007-09-20 Tambet Ingo + + * libnm-util/nm-setting.h: Change the type of NMSettingVPN->routes to + GSList. + + * libnm-util/nm-setting.c (setting_vpn_destroy): Free routes too. + + * src/nm-manager.c (connection_get_settings_cb): No need to use weakref, + just use (g_object_set_data_full). + + * src/vpn-manager/nm-vpn-connection.c (nm_vpn_connection_get_routes): Now + that NMSettingVPN->routes is a GSList, convert it to char **. + (nm_vpn_connection_ip4_config_get): Free routes when done. + (nm_vpn_connection_activate): Ditto. + + * src/nm-device-802-11-wireless.c (real_connection_secrets_updated) + (real_act_stage2_config): Use defined setting names. + +2007-09-20 Dan Williams + + * src/nm-device-802-11-wireless.c + src/nm-manager.c + src/nm-manager.h + - Pass an NMDeviceInterface into nm_manager_get_connection_secrets() + so that the device can be deactivated if secrets are wrong + +2007-09-20 Dan Williams + + * introspection/nm-settings-connection.xml + libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - Make GetSecrets asynchronous on the server side + +2007-09-20 Dan Williams + + * src/nm-manager.h + src/nm-device.c + - (nm_device_activate): actually check if a given connection + exists before assuming it doesn't + +2007-09-20 Tambet Ingo + + * libnm-util/nm-connection.c (register_default_creators): Use defined + setting names. Register NMSettingVPN and NMSettingVPNProperties. + + * libnm-util/nm-setting.c: Define property name strings, use them. + Implement NMSettingVPN and NMSettingVPNProperties settings. + Implement NM_S_TYPE_GVALUE_HASH. + (nm_setting_populate_from_hash): Handle NM_S_TYPE_GVALUE_HASH. + (setting_connection_verify): Rename 'devtype' property to 'type'. + + * introspection/nm-vpn-manager.xml: Use NMConnection for VPN service + properties. + + * src/vpn-manager/nm-vpn-service.c: Ditto. + + * src/vpn-manager/nm-vpn-connection.c: Ditto. + + * src/vpn-manager/nm-vpn-manager.c (nm_vpn_manager_connect): Ditto. + (nm_vpn_manager_new): Remove NMManager argument, it's easy enough to get. + + * src/nm-device-802-11-wireless.c (find_best_connection): Use defined setting + names. NMSettingConnection->devtype got renamed to 'type'. + + * src/nm-device-802-3-ethernet.c (find_best_connection): + (real_get_best_connection): Ditto. + + * src/NetworkManager.c (main): Update the vpn manager creation arguments. + + * libnm-glib/nm-vpn-manager.[ch]: Update. + +2007-09-19 Dan Williams + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + introspection/nm-access-point.xml + - Change strength-changed signal into a properties-changed signal + for all properties, not just strength. Export that signal over dbus + so listeners don't have to poll NM for changes. + - (nm_ap_export_to_dbus, nm_ap_new): not every NMAccessPoint should + get exported over D-Bus, so break up the logic and let other bits + decided when to export the AP + - (nm_ap_new_from_ap): remove, unused + + * src/nm-device-802-11-wireless.c + - (merge_scanned_ap): only export APs that are actually on the device + list, not every AP created internally + + * libnm-glib/nm-access-point.c + libnm-glib/nm-access-point.h + - Cache properties internally and only hit DBus when needed. Get + property updates from NM signals + +2007-09-16 Dan Williams + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_for_each_setting_value): new function; iterate over + each setting's value and call a user-provided function with details + about that value + + * libnm-util/nm-setting.c + libnm-util/nm-setting.h + - (nm_setting_enumerate_values): new function; enumerate the values + of a specific NMSetting subclass for a user-provided function with + details about that value + - Change wep_tx_keyidx to a uint32 + - Create settings value tables for each setting defining their type, + key name, offset into the NMSetting subclass' structure, and whether + they are required and/or a secret + - (nm_setting_populate_from_hash): generic function to populate an + NMSetting from a GHash table, make all settings use it + - (nm_setting_hash): generic function to derive a GHashTable from + an NMSetting object, make all settings use it + +2007-09-14 Dan Williams + + Remove unused stuff in libnm-util + + * configure.in + libnm-util/Makefile.am + libnm-util/cipher-private.h + libnm-util/cipher-wep-ascii.c + libnm-util/cipher-wep-ascii.h + libnm-util/cipher-wep-hex.c + libnm-util/cipher-wep-hex.h + libnm-util/cipher-wep-passphrase.c + libnm-util/cipher-wep-passphrase.h + libnm-util/cipher-wpa-psk-hex.c + libnm-util/cipher-wpa-psk-hex.h + libnm-util/cipher-wpa-psk-passphrase.c + libnm-util/cipher-wpa-psk-passphrase.h + libnm-util/cipher.c + libnm-util/cipher.h + libnm-util/dbus-helpers.c + libnm-util/dbus-helpers.h + libnm-util/gnome-keyring-md5.c + libnm-util/gnome-keyring-md5.h + libnm-util/sha1.c + libnm-util/sha1.h + src/nm-device-802-11-wireless.c + test/libnm-util/Makefile.am + test/libnm-util/test-ciphers.c + test/libnm-util/test-dbus-helpers.c + test/libnm-util/test-inputs.h + - Removed + +2007-09-14 Dan Williams + + * libnm-util/dbus-method-dispatcher.c + libnm-util/dbus-method-dispatcher.h + - Remove, unused + +2007-09-14 Dan Williams + + Implement deferred activation support in the device class. + + * src/nm-device-interface.c + src/nm-device-interface.h + - (nm_device_interface_activate): take more arguments to support + deferred activation; callers must pass one of (connection) OR + (service_name, connection_path) + - (impl_device_activate): connection validation is punted to the device + to be able to handle deferred activation. Yes, this means errors + don't get returned from the Activate() dbus call, and yes, that + should be fixed somehow later. + + * src/nm-device.c + src/nm-device.h + - (clear_act_request): clear additional deferred activation stuff too + - (deferred_activation_timeout_cb): new function; clean up when + deferred activation times out. + - (deferred_activation_start_cb): new function; when the connection + finally becomes available, start device activation + - (nm_device_activate): attach to the right signals of the activation + request if we need to defer activation until the connection is valid + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): update for additional arguments + required for nm_device_interface_activate(). Pass NULL for these + though because this function already knows exactly which + NMConnection to use + +2007-09-14 Dan Williams + + Implement deferred activation handling in the NMActRequest class. When a + client wants to activate a device but must create the NMConnection details + on the fly, there likely hasn't been enough time yet for NM to receive the + new connection signal and grab all the connection details. So the + activation is deferred (and bounded by a timer) for a while, and if the + connection appears within the window, it is activated. + + * src/nm-activation-request.c + src/nm-activation-request.h + - (nm_act_request_class_init): two new signals to support deferred + activation, to allow the listener to handle both timeout and success + - (nm_act_request_new_deferred): new function, starts the deferred + activation timeout handler and listens to the NMManager for + new-connection signals to notice when the connection comes in + +2007-09-14 Dan Williams + + * src/nm-manager.h + src/nm-manager.c + - (nm_manager_get_connection_service_name, + nm_manager_get_connection_dbus_path): get details about a connection + known internally by the NMManager + - (nm_manager_class_init): fix connection add/remove signal marshalers + because NMConnection is now a GObject subclass + - Use constant for the gobject data tag used on NMConnection objects for + storing the associated DBusGProxy + +2007-09-14 Dan Williams + + * utils/Makefile.am + utils/nm-utils.c + utils/nm-utils.h + src/supplicant-manager/Makefile.am + src/dhcp-manager/Makefile.am + src/backends/Makefile.am + src/named-manager/Makefile.am + src/ppp-manager/Makefile.am + src/vpn-manager/Makefile.am + test/libnm-util/Makefile.am + test/test-common/Makefile.am + - Remove utils/; it was unused + +2007-09-13 Dan Williams + + * libnm-glib/nm-vpn-manager.h + libnm-glib/nm-vpn-manager.c + - (nm_vpn_manager_connect): take routes as a GSList, not a char ** + +2007-09-13 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (real_bring_down, nm_device_802_3_ethernet_dispose): disconnect from + netlink monitor carrier signals on dispose, not bring down. The + carrier signals should be handled over the entire lifetime of the + device anyway, not created/destroyed on up or down. + +2007-09-13 Dan Williams + + * libnm-glib/nm-device.c + libnm-glib/nm-device.h + - (nm_device_activate): take a connection object path rather than an + NMConnection because NMConnection isn't exported over D-Bus and + therefore it dbus-glib can't automatically get an object path from it + +2007-09-13 Dan Williams + + * libnm-util/nm-setting.c + - (nm_setting_wired_new): set autonegotiate to TRUE by default + +2007-09-13 Tambet Ingo + + * autogen.sh: NetworkManagerMain.h is gone, check for NetworkManager.c. + +2007-09-12 Tambet Ingo + + * src/vpn-manager/nm-vpn-connection.[ch]: + * src/vpn-manager/nm-vpn-manager.[ch]: + * src/vpn-manager/nm-vpn-service.[ch]: Rewrite the vpn handling code. Using + dbus-glib, GObjects, signals etc. + + * libnm-glib/nm-vpn-manager.[ch]: + * libnm-glib/nm-vpn-connection.[ch]: Now that the NM implementation changed + so much, rewrite these too. + + * libnm-glib/Makefile.am: Add new files to build, build new binding files for + the new introspection files. + + * libnm-glib/nm-client.[ch]: Remove all VPN related stuff from here. + + * libnm-glib/nm-dbus-utils.[ch]: Renamed from nm-utils.[ch] that was shadowing + the header with the same name from libnm-utils. + + * libnm-glib/nm-vpn-plugin.[ch]: Implement. + + * libnm-util/Makefile.am: Add nm-utils.[ch] to build. + + * introspection/nm-vpn-plugin.xml: Implement. + + * introspection/nm-vpn-connection.xml: Implement. + + * introspection/nm-vpn-manager.xml: Implement. + + * src/NetworkManagerSystem.c (nm_system_vpn_device_set_from_ip4_config): Remove + the named manager argument, it can just as easily get it as the caller. + (nm_system_vpn_device_unset_from_ip4_config): Ditto. + + * src/vpn-manager/nm-dbus-vpn.[ch]: Remove. + + * src/nm-dbus-manager.h: Fix up the name_owner signal signature. + + * src/dhcp-manager/nm-dhcp-manager.c (garray_to_string): Remove, use one from + libnm-utils. + + * libnm-util/nm-connection.c: Ditto. + + * src/NetworkManagerMain.h: Remove, it's finally empty. + + * configure.in: Remove utils/ from build. + + * include/NetworkManagerVPN.h: Add some more defines to reduce the amount + of hard-coded strings. + + * utils/: Move it over to libnm-util. + + * test/Makefile.am: Link against libnm-util now that util/ is gone. + + * dispatcher-daemon/Makefile.am: Ditto. + + * src/Makefile.am: Ditto. + +2007-09-12 Dan Williams + + Wireless connections can be made with config data from the applet now. + + Yay. + + * src/supplicant-manager/nm-supplicant-config.h + src/supplicant-manager/nm-supplicant-config.c + - (nm_supplicant_config_new): kill unused init parameter 'iface' + - (nm_supplicant_config_add_setting_wireless, + nm_supplicant_config_add_setting_wireless_security): new functions; + add key/value pairs from the settings objects to the supplicant + config + + * src/nm-device-802-11-wireless.c + - (cull_scan_list): fix check to not prune currently associated AP + - (build_supplicant_config, real_act_stage2_config): call the functions + of the NMSupplicantConfig that parse settings objects rather than + doing it manually here + +2007-09-12 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + src/supplicant-manager/nm-supplicant-marshal.list + - (nm_supplicant_interface_class_init): fix stupid mistake, the + "connection-error" signal arguments should be STRING not CHAR + +2007-09-12 Dan Williams + + * src/NetworkManagerUtils.c + src/NetworkManagerUtils.h + - (nm_utils_hexstr2bin): new function + +2007-09-11 Dan Williams + + * src/nm-manager.c + - (connection_get_settings_cb): emit connection-added signal + - (connection_removed_cb): uncomment bits for system settings service, + send connection-removed when appropriate + - (nm_manager_get_connection_secrets, get_secrets_cb): don't clobber + the stack by trying to g_object_set_data() on something that's + not a GObject; handle case where settings service returns + empty settings hash table + +2007-09-11 Dan Williams + + * src/NetworkManagerPolicy.c + - (connection_added, connection_removed): trigger device change checks + on connection changes + +2007-09-11 Dan Williams + + * src/nm-activation-request.c + - (connection_secrets_updated_cb): fix c&p error in signal emission + +2007-09-11 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_connection_secrets_updated): fix erroneous check + +2007-09-11 Dan Williams + + * introspection/nm-device.xml + libnm-glib/nm-device.c + libnm-glib/nm-device.c + - Fix Activate call argument borkage; Activate takes 3 arguments + +2007-09-11 Dan Williams + + * libnm-glib/nm-access-point.c + libnm-glib/nm-access-point.c + - (nm_access_point_get_frequency): now returns guint32 to match + property change on 2007-09-10 + +2007-09-11 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_new): s/index/idx, stupid system header + somewhere defines 'index' and I missed this one when I fixed the + shadow declaration errors earlier + +2007-09-11 Dan Williams + + * libnm-util/nm-connection.c + - (nm_connection_update_secrets, need_secrets_check): move + 802-11-wireless-security need_secrets checks to the setting object + itself, where it belongs + + * libnm-util/nm-setting.c + libnm-util/nm-setting.h + - (nm_setting_need_secrets): new function + - (setting_wireless_security_verify, + nm_setting_wireless_security_new_from_hash): make 'key-mgmt' required + - (setting_wireless_security_need_secrets): mostly copy code over + from nm-connection.c + +2007-09-11 Dan Williams + + * libnm-util/nm-setting.c + libnm-util/nm-setting.h + - (nm_setting_update_secrets): new function; add a virtual function that + subclasses can implement to update their secrets + - (setting_wireless_security_update_secrets): implement that function + for the 802-11-wireless-security subclass + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + - (nm_connection_update_secrets): update secrets for a Setting and + emit a signal on success + + * src/nm-manager.c + src/nm-manager.h + src/nm-marshal.list + - (connection_get_settings_cb): enable system settings bits + - (nm_manager_get_connection_secrets, get_secrets_cb): add function + to request secrets from the settings dbus service and to + push those secrets to the NMConnection itself + + * src/nm-activation-request.c + src/nm-activation-request.h + - Attach to the 'secrets-updated' signal of the NMConnection that's + currently being activated, and proxy that signal to other listeners. + Goes through the activation request because the activation request + is the thing that manages the lifetime of the NMConnection that's + being activated. + + * src/nm-device-802-11-wireless.c + - (real_connection_secrets_updated): implement the connection secrets + updated notification and restart activation when secrets are + received + - (real_act_stage2_config): request secrets from the settings dbus + service if secrets are needed + + * src/nm-device.c + src/nm-device.h + - (clear_act_request, nm_device_activation_cancel, + nm_device_deactivate_quickly, nm_device_dispose): consolidate places + where the activation request is cleared + - (nm_device_activate, connection_secrets_updated_cb): attach to the + updated secrets signal of activation request and add a function + that subclasses can override to handle it easily + +2007-09-11 Tambet Ingo + + * src/backends/NetworkManagerSuSE.c: Fix a build issue caused by the + removal of NetworkManagerAPList. + +2007-09-10 Dan Williams + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + introspection/nm-access-point.xml + - Change 'freq' property to a guint32 instead of a double since we + weren't using the floating point bits anyway + +2007-09-10 Dan Williams + + * NetworkManagerAP.c + NetworkManagerAP.h + NetworkManagerPolicy.c + NetworkManagerSystem.c + NetworkManagerUtils.c + NetworkManagerUtils.h + nm-device-802-11-wireless.c + nm-device-802-3-ethernet.c + nm-hal-manager.c + nm-manager.c + vpn-manager/nm-dbus-vpn.c + - Warning fixes; casts and removal of unused variables + +2007-09-10 Dan Williams + + * include/NetworkManager.h + - Kill NMNetworkType; AP types don't matter any more + + * src/NetworkManagerAPList.c + src/NetworkManagerAPList.h + src/Makefile.am + - Kill; NMAccessPointList has outlived it's usefulness + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + - (match_cipher, security_compatible, nm_ap_check_compatible): new + functions; check if an NMConnection object is compatible with the + settings of this AP + - (freq_to_channel, channel_to_freq): utility functions for + channel <-> frequency conversion + + * src/nm-device.c + src/nm-device.h + - (nm_device_get_best_connection): pass the specific object around + (which might be the object path of a specific AP to connect to). + The get_best_connection() call should populate this on return + if needed (wireless does). + + * src/nm-device-802-3-ethernet.c + - (real_get_best_connection): handle specific_object argument + + * src/NetworkManager.c + src/NetworkManagerMain.h + - Remove unused includes + + * src/nm-device-802-11-wireless.c + src/nm-device-802-11-wireless.h + - Convert the ap_list into a GSList from an NMAccessPointList + - No need for caching the 'activation_ap' since this is now determined + from the specific_object of the activation request, which is + populated from the get_best_connection() call or from a user request + - (nm_device_802_11_wireless_update_bssid): fix warning + - (get_wireless_capabilities): fix error message format arguments + - (nm_device_802_11_wireless_copy_allowed_to_dev_list): remove, unused + - (find_best_connection, real_get_best_connection): implement + - (ap_list_get_ap_by_ssid, nm_device_802_11_wireless_ap_list_print): + move here from NetworkManagerAPList + - (ap_need_secrets): remove; moved to nm-connection.c where it belongs + - (real_act_stage1_prepare): just ensure an AP exists, connection is + already verified earlier + - (real_act_stage2_config): use nm_connection_need_secrets() + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): handle specific objects + - (create_connection): remove; automatic connection creation functionality + is handled by the Connection objects + - (nm_policy_device_change_check): handle specific_object + + * libnm-util/nm-connection.c + - (wireless_sec_need_secrets, nm_connection_need_secrets): implement + +2007-09-10 Dan Williams + + * src/nm-manager.c + - (query_connections): fix uninitialized variable problem that caused + segfault + - (nm_manager_add_device): take devices down on startup so that we can + be assured that nm_device_is_up() won't short-circuit the init + process. Hack until the is_up check gets split into two pieces + that aren't behaviorally confusing. + +2007-09-09 Dan Williams + + * introspection/nm-device.xml + - The 'Activate' method now takes 3 arguments, a service name for the + settings service (user or system), the object path of the connection + to activate, and the specific object to activate, if any + + * src/nm-device-interface.c + - (nm_device_interface_error_quark, nm_device_interface_error_get_type): + Add error bits + - (impl_device_activate): adapt to new Activate arguments; validate + the service name and get the Connection object from the NMManager + before starting to activate the device with the specified connection + + * src/nm-device-802-3-ethernet.c + - (real_get_best_connection): find the best connection, or create a + default one if no existing connections can be used + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): Get the device's best connection + and only pick the device if it has one + - (nm_policy_device_change_check): disable wireless bits for now until + wireless get_best_connection() can be implemented (replacing "best_ap"); + don't create a default connection here as the device subclass will do + that if needed + + * src/nm-manager.h + src/nm-manager.c + - (nm_manager_get): make NMManager a singleton and expose the getter + internally + - Rework internal NMManager connection handling to use the same + routines for both the system and user settings services. Most calls + take a new NMConnectionType argument specifying either system or user + connections + - (nm_manager_get_connection_by_object_path): new function; get a + connection keyed on its object path + + * src/NetworkManager.c + - (main): use nm_manager_get() + +2007-09-09 Dan Williams + + * src/nm-device.h + src/nm-device.c + - (nm_device_get_best_connection): new function; get best connection + for the device at that time + +2007-09-09 Dan Williams + + * src/nm-device-interface.h + - Add NMDeviceInterfaceError with an UnknownConnection error + +2007-09-09 Dan Williams + + Stupid mistake on my part; object path and interface for settings service + and connection objects can be the same, only the service name must be + different for the system and user settings services. + + * include/NetworkManager.h + src/nm-manager.c + introspection/nm-settings-connection.xml + introspection/nm-settings.xml + libnm-glib/nm-settings.c + - (nm_connection_settings_init, query_user_connections, + new_connection_cb): Unify NetworkManagerSettings and Connection + interface name and object path + +2007-09-06 Dan Williams + + * libnm-glib/nm-object.c + - (nm_object_get_string_property, nm_object_get_object_path_property, + nm_object_get_int_property, nm_object_get_uint_property, + nm_object_get_boolean_property, nm_object_get_byte_property, + nm_object_get_double_property, nm_object_get_byte_array_property): + clear GValues after copying their contents, fixes memory leaks + after every property access because dbus-glib copies the values + from the DBusMessage into the GValue already. + +2007-09-06 Dan Williams + + * introspection/nm-access-point.xml + - Fix WpaFlags and RsnFlags property names to be what dbus-glib expects + them to be. There's some magic property name parsing going on in + dbus-glib that breaks up property names based on studly-caps and + puts - between words. + + * libnm-glib/nm-access-point.c + - (nm_access_point_get_wpa_flags, nm_access_point_get_rsn_flags): + Fix property names + +2007-09-06 Dan Williams + + * src/nm-manager.c + - (nm_manager_user_connections_destroy): clear the user connections hash + table, don't destroy it + - (finalize): only destroy the hash table on NMManager finalization + +2007-09-02 Dan Williams + + * include/NetworkManager.h + libnm-glib/nm-settings.c + - defines for the user settings daemon D-Bus bits + + * src/NetworkManager.c + - Remove stuff that referred to the old NetworkManagerInfo service + + * src/vpn-manager/nm-dbus-vpn.h + - Move old NMI defines to the only place they are used still + + * libnm-util/nm-connection.c + libnm-util/nm-connection.h + src/nm-activation-request.c + - Make NMConnection a GObject subclass so we can do spiffy stuff with it + + * src/nm-manager.c + src/nm-manager.h + - Get connections and their settings from the user settings daemon + at the appropriate times + +2007-09-02 Dan Williams + + * libnm-util/nm-setting.c + - (nm_settings_verify): correct setting name is 'connection', not 'info' + - (setting_wireless_hash): set the right value on the item + +2007-09-02 Dan Williams + + * test/Makefile.am + test/nminfotest.c + - Remove, no longer useful + +2007-08-30 Dan Williams + + * src/Makefile.am + src/NetworkManagerDbus.c + src/NetworkManagerDbus.h + src/vpn-manager/nm-dbus-vpn.c + - Remove, no longer necessary. Move last bits to the only place its + used, in nm-dbus-vpn.c + + * src/NetworkManagerAPList.c + src/nm-device.c + src/NetworkManager.c + src/nm-device-802-11-wireless.c + src/vpn-manager/nm-vpn-manager.c + src/vpn-manager/nm-vpn-service.c + src/NetworkManagerPolicy.c + src/nm-manager.c + - Remove usage of NetworkManagerDbus.h, and kill the obfuscation + that was message_is_error() + +2007-08-30 Dan Williams + + * libnm-util/sha1.c + - Include config.h to get defines for endiannes (gnome.org #420216) + +2007-08-30 Dan Williams + + Patch from Philip Withnall + + * src/ppp-manager/Makefile.am + - use -fPIC (gnome.org #471825) + +2007-08-29 Dan Williams + + * include/NetworkManager.h + - Keep NMConnection object path in sync + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - Break D-Bus object registration out of the init function, because + every object that's exported over D-Bus needs to use the _same_ + DBusConnection. Otherwise, each object would get a different object + path tree and wouldn't be callable. + +2007-08-29 Dan Williams + + * libnm-util/nm-setting.h + libnm-util/nm-setting.c + libnm-util/nm-connection.c + src/NetworkManagerPolicy.c + - 'info' settings object should be 'connection' says the spec + at NetworkManagerConfigurationSpecification + +2007-08-29 Dan Williams + + * libnm-glib/nm-settings.c + libnm-glib/nm-settings.h + - make the dbus path a property of the object, and autogenerate it. + It can't be composed of the 'id' field becuase that's not available + yet during the GObject creation in nm_connection_settings_init() + +2007-08-29 Dan Williams + + * introspection/nm-settings-connection.xml + introspection/nm-settings.xml + - Service name -> NetworkManagerUserSettings because two services + can't share part of the same path. I'm not really sure how we'll use + the same code with the system-settings daemon... + +2007-08-28 Dan Williams + + * src/nm-device-interface.c + src/nm-device-interface.h + - Kill one more bit of NMData + +2007-08-28 Dan Williams + + * src/NetworkManagerSystem.h + src/nm-device.c + src/nm-device.h + src/nm-hal-manager.c + src/NetworkManager.c + src/nm-device-802-11-wireless.c + src/nm-hal-manager.h + src/nm-device-802-3-ethernet.c + src/vpn-manager/nm-vpn-service.h + src/vpn-manager/nm-vpn-manager.c + src/vpn-manager/nm-vpn-manager.h + src/vpn-manager/nm-vpn-service.c + src/nm-device-802-11-wireless.h + src/NetworkManagerMain.h + src/nm-device-802-3-ethernet.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerFrugalware.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerSuSE.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerDebian.c + - Kill NMData + +2007-08-28 Dan Williams + + * src/NetworkManagerMain.h + src/nm-device-802-11-wireless.c + src/NetworkManager.c + - Remove invalid AP list from NMData; need to rework this somewhat, but + for now we should set the 'invalid' property on individual APs, and when + we need to invalidate a whole ESS, set the 'invalid' on every member of + that ESS + +2007-08-28 Dan Williams + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + - Remove 'fallback' tag, to be replaced by NMConnection/NMSettings + 'autoconnect' property instead + + * src/NetworkManager.c + src/NetworkManagerMain.h + src/NetworkManagerPolicy.c + src/NetworkManagerPolicy.h + - Remove the 'allowed_ap_list', which should be replaced by + NMConnection/NMSettings instead, since _those_ are the allowed + things that NM can connect to + + * src/nm-device-802-11-wireless.c + - Remove both allowed_ap_list usage and 'fallback' checking + +2007-08-28 Dan Williams + + * src/nm-device.c + src/named-manager/nm-named-manager.c + src/named-manager/nm-named-manager.h + src/NetworkManager.c + src/vpn-manager/nm-vpn-manager.c + src/NetworkManagerMain.h + src/NetworkManagerSystem.c + - Remove the named-manager object from NMData structure in preparation + for NMData's timely death. Make the NMNamedManager the singleton that + it really is + +2007-08-28 Dan Williams + + Remove NMAPSecurity objects, they are replaced with flags on the APs for + each AP's capabilities, and by NMConnection/NMSettings objects for user + defined connections. + + * include/NetworkManager.h + - Redefine 802.11 security properties. There are now device capabilities + and AP flags and AP security flags. It was way to unclear before. + + * src/Makefile.am + src/nm-ap-security-leap.h + src/nm-ap-security-leap.c + src/nm-ap-security-wpa-eap.c + src/nm-ap-security-wpa-eap.h + src/nm-ap-security-private.h + src/nm-ap-security-wpa-psk.c + src/nm-ap-security-wpa-psk.h + src/nm-ap-security-wep.c + src/nm-ap-security-wep.h + src/nm-ap-security.c + src/nm-ap-security.h + - Removed, to be replaced with NMConnection/NMSettings objects + + * src/nm-dbus-nmi.c + src/nm-dbus-nmi.h + - Removed, to be replaced by code that talks to the new info daemon + interface and gets NMConnection/NMSettings objects + + * src/backends/NetworkManagerSuSE.c + - Remove usage of NMAPSecurity; should be replaced by a system-level + info-daemon that does the same thing but talks the new info-daemon + D-Bus interface + + * src/NetworkManagerAP.h + src/NetworkManagerAP.c + src/NetworkManagerAPList.c + libnm-glib/libnm-glib-test.c + - Remove usage of NMAPSecurity objects and adjust to new flags for + WPA/RSN + + * libnm-glib/nm-access-point.c + libnm-glib/nm-access-point.h + introspection/nm-access-point.xml + test/nm-tool.c + - Adjust to new flags for AP security + + * utils/nm-utils.c + utils/nm-utils.h + src/vpn-manager/nm-dbus-vpn.c + - Remove D-Bus pending call stuff from nm-utils and put it in the VPN + stuff which is the only place it's used + + * src/nm-device-interface.c + src/nm-device-interface.h + introspection/nm-device.xml + src/nm-activation-request.c + src/nm-activation-request.h + src/nm-device.c + - Add a new 'specific_object' argument that hints to NM what actual + AP or other device-specific thing the connection should apply to. + NMConnection objects can apply to more than one actual device/AP. + + * libnm-util/nm-connection.c + * libnm-util/nm-connection.h + - Add 'have_secrets" call stubs + + * libnm-util/cipher.h + - Move NM_AUTH_TYPE_* defines here for now + + * src/nm-device-802-11-wireless.c + - Remove usage of NMAPSecurity, to be replaced with NMConnection/ + NMSettings objects + + * src/NetworkManagerDbus.c + * src/NetworkManagerPolicy.c + - Remove usage of update_allowed_networks, should be pushing data in + a different manner + +2007-08-27 Tambet Ingo + + * src/nm-manager.c (impl_manager_get_devices): Duplicate the device path, + dbus-glib frees it when the call is done. + +2007-08-26 Dan Williams + + * introspection/nm-device.xml + - Add 'Index' property on NMDevice objects (forgot to do this earlier) + +2007-08-26 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (constructor): move connection of interface-connected/disconnected + signals here from real_bring_up(). Should be listening to netlink + for carrier events no matter what the initial state of the device + is. + +2007-08-26 Dan Williams + + * src/nm-netlink-monitor.c + - (nm_netlink_monitor_class_init): fix marshalling types for + interface-connected/interface-disconnected + - (nm_netlink_monitor_event_handler): clean up carrier on/off + check + +2007-08-26 Dan Williams + + Convert to using interface indexes as the primary method of identifying + devices inside NetworkManager. Indexes are (?) stable, but devices can + be renamed at any time. Device object paths now refer to the device + index rather than the name, and you can map those two manually if you like + by looking in the /sys/class/net//ifindex file. Also moves most + netlink-related code to nm-netlink.c, and cleans up nm-netlink-monitor.c + to use interface indexes rather than names. + +2007-08-26 Dan Williams + + * src/nm-netlink-monitor.h + - Remove one last bit of wireless-event signal + +2007-08-26 Dan Williams + + * src/nm-netlink-monitor.c + - (nm_netlink_monitor_class_init, nm_netlink_monitor_event_handler): + don't need the 'wireless-event' signal anymore since that's all + handled by wpa_supplicant + +2007-08-25 Dan Williams + + It's 2007. Remove support for drivers that don't support wireless scanning. + + * test/nm-tool.c + include/NetworkManager.h + src/NetworkManagerUtils.c + src/NetworkManagerPolicy.c + src/nm-device-802-11-wireless.c + - Remove special handling for non-scanning devices and mark them + as unsupported/unhandled + +2007-08-20 Dan Williams + + * src/nm-device-802-11-wireless.c + src/nm-device-802-3-ethernet.c + - (real_is_up): move device-specific tests before generic IFF_UP test, + because when the card is pulled or the module removed, the device + is already !IFF_UP and then device-specific cleanup (removing + the supplicant interface, periodic checks, etc) never gets done + +2007-08-20 Dan Williams + + * src/nm-manager.c + - (nm_manager_remove_device): bring device down before disconnecting + signal handlers, so that the 'state' signal will get broadcast when + the device enters the DOWN state + - (manager_device_state_changed): add NM_DEVICE_STATE_DOWN to the list + of states that cause the NMManager to recheck its state + +2007-08-20 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + - (interface_disconnect_done): don't try to dispose of the net proxy + when it may already have been disposed of + +2007-08-20 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_get_ssid): don't traceback and die when + the SSID isn't available; this can happen when the card is pulled + or the module unloaded, during the post-removal deactivation + paths, when the ioctl returns ENODEV + +2007-08-20 Dan Williams + + * src/nm-device-802-11-wireless.c + - (merge_scanned_ap): only merge the AP with another if the SSID, BSSID, + frequency, and mode match. Applets are now responsible for grouping + access points + +2007-08-20 Dan Williams + + * src/NetworkManagerAP.c + * src/NetworkManagerAP.h + - (nm_ap_print_self): new function + + * src/NetworkManagerAPList.c + - (nm_ap_list_print_members): call nm_ap_print_self() rather than trying + to do it all here + +2007-08-17 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (real_bring_down): don't try to dispose of stuff that might not + exist + +2007-08-17 Dan Williams + + * src/NetworkManagerAP.c + - (nm_ap_set_user_addresses): uppercase any BSSID passed in from the + applet. This ensures that the case between the seen-bssids and + the bssids reported by the driver match. + +2007-08-17 Dan Williams + + * src/nm-device-802-11-wireless.c + - (device_cleanup): disconnect the interface in wpa_supplicant before + we dispose of the interface proxy in NM + +2007-08-16 Dan Williams + + * libnm-glib/nm-client.c + - (nm_client_init): create VPN connections hash table with key free + function + - (proxy_vpn_connection_added): VPN connections hash table key should + be a duplicated value, not the same memory address as the VPN + connection name. This is because the VPN connection name could + potentially be freed and set to something else during the lifetime + of the NMVPNConnection object. + +2007-08-16 Tambet Ingo + + * src/ppp-manager/nm-ppp-manager.c (pppd_child_setup): Implement. + (nm_ppp_manager_start): Use g_spawn_async() since we're not doing anything + with the file descriptors. Send a child setup function to change the pppd + progress group. + +2007-08-15 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + - (try_remove_iface): new function, ask wpa_supplicant to remove + an interface + - (nm_supplicant_interface_dispose): call try_remove_iface() when + disposing of the NMSupplicantInterface. Otherwise weird stuff + happens on hotplug if wpa_supplicant doesn't tear down and readd + the interface internally + +2007-08-15 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_bring_down): move most of this function into device_cleanup() + so that it can be called from elsewhere + - (nm_device_802_11_wireless_dispose): clean up device periodic timers + and stuff on dispose. These would normally get cleaned up when + the device is marked down and deactivated, but when the device is + hot-unplugged, it's already down and real_down() never gets run + +2007-08-15 Dan Williams + + * src/nm-dbus-nmi.c + - (nm_dbus_get_user_key_for_network_cb): fix incorrect refcounting that + caused a reference leak on device for which NM requested a key + +2007-08-15 Dan Williams + + * libnm-glib/nm-client.c + - (nm_client_get_best_vpn_state): fix leakage of the vpn connection list + +2007-08-15 Tambet Ingo + + * src/ppp-manager: Implement ppp-manager. It's sort of dead code for now since + nothing is using it at the moment, but it'll be all useful and stuff later on. + + * libnm-util/nm-setting.h: Define NMSettingPPP. + + * libnm-util/nm-setting.c: Implement NMSettingPPP. + + * libnm-util/nm-connection.c (register_default_creators): Register ppp setting. + + * src/Makefile.am: Add ppp-manager to SUBDIRS. + + * configure.in: Require ppp headers. Build Makefile for ppp-manager. + + * introspection/Makefile.am: Add nm-manager-client.xml to EXTRA_DIST. + +2007-08-14 Tambet Ingo + + * libnm-glib/Makefile.am: Use nm-manager-client.xml to produce nm-client-bindings. + + * introspection/nm-manager-client.xml: Add a horrible horrbile hack to work around + an issue with dbus-glib bindings generator. The issue is, the generated C caller + functions for dbus methods "Sleep(bool)" and "sleep()" both have the same function + name and different arguments and it won't compile anymore. To fix this, we now have + two copies of nm-manager.xml file. nm-manager.xml contains the actual interface, + that is new API + compatibility API and used by the daemon. The other, + nm-manager-client.xml is only the new API without compatibility bits and is used + by libnm-glib to make it compile. + + * introspection/nm-manager.xml: Define compatibility methods (sleep, wake, state). + + * src/nm-manager.c (impl_manager_legacy_sleep) + (impl_manager_legacy_wake, impl_manager_legacy_state): Implement the compatibility + interface functions for 0.6 branch. + +2007-08-14 Dan Williams + + * src/NetworkManagerAP.c + - (nm_ap_new_from_properties): fix mistaken check of return value + from memcmp (should expect 0) + +2007-08-14 Dan Williams + + (force-commit to fix wrong comment and partial commit of r2685; this + commit actually applies to r2685) + + * src/NetworkManagerUtils.c + - (nm_utils_same_ssid): add "ignore_trailing_null" parameter which + ignores trailing nulls in the SSID to work around mismatches in + expectations between WEXT and what the info-daemon passes back. The + info-daemon would pass back the correct length, but due to the + ESSID length issues with WEXT 22 and greater and wpa_supplicant, + the device would always have an SSID + 1 depending on what versions + of wpa_supplicant, the kernel, and NM you have. This was most often + visible by just quitting the applet and relaunching, which caused + NM to reassociated to the same network over again when reloading + the save networks. + + * src/NetworkManagerPolicy.c + src/NetworkManagerUtils.h + src/nm-device-802-11-wireless.c + - Update for new parameter to nm_utils_same_ssid() + +2007-08-14 Dan Williams + + * src/NetworkManagerAP.c + - (nm_ap_new_from_properties): ignore BSSs with invalid BSSIDs. Today + I encountered a BSS that wasn't just hiding it's ESSID, it was + setting the BSSID to all 0s. That confused the heck out of NM, + plus it's useless and probably out-of-spec. + +2007-08-14 Dan Williams + + * callouts/Makefile.am + src/dhcp-manager/nm-dhcp-manager.c + src/dhcp-manager/nm-dhcp-manager.h + src/dhcp-manager/Makefile.am + - Change install location of nm-dhcp-client.action to ${prefix}/libexec + +2007-08-14 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (dhclient_run): don't pass -x to dhclient until we figure out if + it's really needed, get rid of unused xtra_args parameter + +2007-08-14 Dan Williams + + * include/NetworkManagerVPN.h + src/vpn-manager/nm-dbus-vpn.c + src/vpn-manager/nm-dbus-vpn.h + src/vpn-manager/nm-vpn-act-request.c + src/vpn-manager/nm-vpn-act-request.h + src/vpn-manager/nm-vpn-service.c + src/vpn-manager/nm-vpn-service.h + libnm-glib/nm-vpn-connection.c + libnm-glib/nm-vpn-connection.h + libnm-glib/nm-client.h + - Rename NM_VPN_STATE_* -> NM_VPN_SERVICE_STATE_* and NMVPNState -> + NMVPNServiceState to clarify what they apply to + - Rename NM_VPN_ACT_STAGE_* -> NM_VPN_CONNECTION_STATE_* and + NMVPNActStage -> NMVPNConnectionState for the same reason + + * libnm-glib/nm-client.c + - Constant + type renames from above + - Properly handle NameOwnerChanged/manager_running signals + for NM service; only emit when state really changes + - Use hash tables correctly so that the key (which was previously owned + by the D-Bus message) now has the same lifetime as the value, since + the key is now taken from the the NMVPNConnection itself. This + really fixes the double-VPN names in the applet + +2007-08-13 Dan Williams + + Patch from Michael Biebl + + * po/POTFILES.in + po/POTFILES.skip + - Update for vpn-properties move + +2007-08-13 Dan Williams + + * libnm-glib/nm-client.c + - Convert internal VPN connection tracking from a list to a hash table + to easily avoid duplicates + - (nm_client_get_vpn_connections): now returns an allocated GSList that + must be freed by the caller, like nm_client_get_devices() + - (nm_client_remove_vpn_connection): don't let the removal signal + leak through for NMVPNConnection objects that aren't actually + tracked. + - (manager_running): throw away VPN connection list when NM goes away, + like with the device list + +2007-08-13 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - Stop any dhclient instance that might be already running for a + particular interface before starting an NM spawned dhclient. Fixes + dhclient processes left over if NM crashes, stuff like that. + +2007-08-13 Dan Williams + + * src/NetworkManagerAP.c + - (finalize): don't try to g_array_free (NULL, ...), which happened + when the AP wasn't broadcasting it's SSID + +2007-08-13 Rodrigo Moya + + * include/NetworkManager.h: added DBus path for connection settings. + + * libnm-glib/nm-settings.[ch] (nm_settings_signal_new_connection, + nm_connection_settings_signal_updated, + nm_connection_settings_signal_removed): new functions to wrap the + objects' signals. + (nm_connection_settings_init): register GObject with DBus. + (nm_connection_settings_get_dbus_object_path): new function. + + * libnm-glib/Makefile.am: added libnmutil to link flags. + +2007-08-13 Tambet Ingo + + * configure.in: Remove checks for dhcdbd as it's killed! killed! killed! + + * gnome/*: Remove. The nm-vpn-properties directory is now part of nm-applet, + libnm_glib directory got merged with libnm-glib/. + + * libnm-glib/libnm-glib.pc.in: Rename to libnm_glib.pc.in. + + * libnm-glib/Makefile.am: Add legacy libnm_glib.[ch] to the build. + Rename the library from libnm-glib to libnm_glib to maintain the library API + compatibility with 0.6 branch. + + * Makefile.am: Remove gnome/ SUBDIR. + + * gnome/libnm_glib/libnm_glib.[ch]: Move to libnm-glib/. + + * src/Makefile.am: Remove the WPA_SUPPLICANT_BIN define. + + * dispatcher-daemon/Makefile.am: Link the binary with libnm_glib. + + * configure.in: Remove GNOME checks, NetworkManager does not need any of these + anymore. + Remove checks for wpa_supplicant binary, it's used over dbus. + Remove gnome/ directory files form AC_OUTPUT, that directory is getting moved. + + * test/Makefile.am: Remove define WPA_SUPPLICANT_BIN. + Link the binaries with libnm_glib.la. + +2007-08-12 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): fix policy to deactivate old device + before activating new one, at least until the multiple active + device support lands + +2007-08-12 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_new): hook up to connection-added / connection-removed + signals instead of connections-changed + +2007-08-12 Dan Williams + + Kill dhcdbd until it's dead, dead, dead. Based on a patch from + Robert Frank + + * src/dhcp-manager/nm-dhcp-manager.c + src/dhcp-manager/nm-dhcp-manager.c + src/nm-device.c + - Spawn and communicate with dhclient directly, through means of a + custom dhclient callout script. Process callout D-Bus signals + with dbus-glib instead of hand-rolled dbus. DHCP timeouts are now + sent via gobject signals rather than being driven by the dhcp manager + directly. + +2007-08-12 Dan Williams + + * callouts/nm-dhcp-client-action.c + - (build_message): ignore non-DHCP-related environment variables + +2007-08-12 Dan Williams + + * Makefile.am + configure.in + callouts/Makefile.am + callouts/nm-dhcp-client-action.c + callouts/nm-dhcp-client.conf + - Add dhclient-executed callout that takes the place of dhclient-script + and dhcdbd, pushing DHCP options out to the system bus as a signal that + NM then listens for + +2007-08-09 Tambet Ingo + + [Based on patch by Helmut Schaa ] + + * libnm-glib/nm-client.h: + * libnm-glib/nm-object.h: + * libnm-glib/nm-vpn-connection.h: + * libnm-glib/nm-settings.h: + * libnm-glib/nm-device.h: + * libnm-glib/nm-ip4-config.h: + * libnm-glib/nm-access-point.h: + * libnm-glib/nm-device-802-3-ethernet.h: + * libnm-util/nm-setting.h: + * libnm-util/nm-connection.h: Add G_BEGIN_DECLS / G_END_DECLS to support C++. + + * libnm-glib/nm-object.c (nm_object_get_byte_property): Implement. + + * libnm-glib/nm-access-point.c: Strength has type char. + + * gnome/vpn-properties/Makefile.am: Remove GNOME_DISABLE_DEPRECTATED for now + to fix build. GnomeDruid is deprecated in recent libgnomeui. + + * introspection/nm-access-point.xml: Strength property is char, not int. + + * src/NetworkManagerAP.c (set_property): Set strength from char. + (get_property): Handle hidden APs (with empty SSID). + Get strength value from char. + (nm_ap_class_init): Strength property has char type. + +2007-08-03 Rodrigo Moya + + * introspection/Makefile.am: + * introspection/nm-settings.xml: + * introspection/nm-settings-connection.xml: added Settings interfaces. + + * libnm-glib/nm-settings.[ch]: + * libnm-glib/Makefile.am: added abstract class for Settings interfaces + containing the DBus implementation. + +2007-07-26 Dan Williams + + Patch from Bernhard Miklautz + + * src/NetworkManagerSystem.c + - (nm_system_device_set_ip4_route): don't add the route if it's on the + same subnet (#437396) + +2007-07-26 Dan Williams + + Patch from Kelemen Gábor + + * gnome/vpn-properties/nm-vpn-properties.c + - Fix translatable strings (#445865) + +2007-07-26 Dan Williams + + Patch from Andreas Hanke + + * configure.in + - Remove useless junk (#412530) + +2007-07-10 Christopher Aillon + + Patch from Robert Buchholz : + + * configure.in: + * Makefile.am: + * introspection/Makefile.am: + Make make distcheck work again. + +2007-06-27 Dan Williams + + * Make SSIDs GByteArrays everywhere + * Rename "essid" -> "ssid" everywhere that's appropriate + * Refcount activation_ap member of the 802.11 wireless device class + +2007-06-27 Tambet Ingo + + * libnm-glib/nm-object.[ch]: Add these to the SVN, oops. + +2007-06-22 Tambet Ingo + + * src/nm-device-802-11-wireless.c (merge_scanned_ap): Don't advertise constantly + that we got a new AP when we just update existing AP properties. + +2007-06-21 Tambet Ingo + + * libnm-glib/Makefile.am: Add NMObject to build, remove nm-utils.[ch]. + + * nm-utils.[ch]: Remove. + + * libnm-glib/nm-object.c: Implement a base class for all libnm-glib dbus-aware + objects for easy property access and dbus connection handling. + + * libnm-glib/nm-client.c: Derive from NMObject. + + * libnm-glib/nm-device.c: Ditto. + + * libnm-glib/nm-device-802-3-ethernet.c: Changes for being based on NMObject. + + * libnm-glib/nm-device-802-11-wireless.c: Ditto. + + * libnm-glib/nm-ip4-config.c: Ditto. + + * libnm-glib/nm-access-point.c: Ditto. + + * libnm-util/nm-connection.c (nm_connection_compare): Add a stub for connection + comparision. Currently used by the device activation code to determine if the new + activation is the same as the old one. + + * src/nm-dbus-nmi.c (nm_dbus_get_user_key_for_network): Don't use the obsolete and + wrong way of getting the dbus path for AP. Fixes the issue where the applet isn't + able to ask password for the AP. + + * src/nm-device.c (nm_device_activate): Change the logic here - instead of giving + up if the device is already connected, tear down it's connection (if it isn't the + same as new one) and start the activation. + + * src/nm-manager.c: Add the beginnings of NMConnection storage and signals. + + * src/NetworkManagerAP.c (nm_ap_init): Set the default values to AP memebers, fixes + the issue where all APs are always listed as encrypted. + + * src/NetworkManagerDbus.c (nm_dbus_get_object_path_for_network): Remove. APs have + their own registered paths. + + * test/nm-tool.c (detail_device): Don't try to get active network from wireless + device if it's not connected - dbus-glib will happily crash trying to marshal NULL. + +2007-06-13 Tambet Ingo + + * src/NetworkManagerAP.c (foreach_property_cb): Set WEP capabilities too! + (0 & 0 == 0, doh) + + * src/nm-device.c (nm_device_state_changed): Emit the signal before handling it + because the handling code will cause the next state change and signal listeners + get the signals in wrong order. + + * src/NetworkManagerPolicy.c (nm_policy_device_change_check): Get the "old_dev" + correctly in case of pending activation. + + * src/nm-device-802-11-wireless.c (nm_device_802_11_wireless_set_activation_ap): + Convert the essid byte array to string correctly, including the terminating NULL. + + * src/NetworkManagerPolicy.c (create_connection): Create wireless ssid and + mode with correct types. + + * src/nm-dbus-nmi.c (nm_dbus_get_user_key_for_network): Fix a typo, pass the + constructed info to dbus call instead of the activation request. + +2007-06-11 Christopher Aillon + + Patch from Christian Persch + + * libnm-glib/Makefile.am: + * dispatcher-daemon/Makefile.am: + Use the correct variables, the correct paths, and correct ordering. (446315) + +2007-06-11 Tambet Ingo + + * src/nm-device.c: Make the activation stage virtual functions take NMDevice + argument. The activation request is easy to retrieve. + + * src/nm-activation-request.c: Convert to GObject. Do not include half of NM headers + just to be a convenient location for devices to store random stuff. + +2007-06-11 Christopher Aillon + + Patch from Alex Smith + + * src/backends/NetworkManagerFrugalware.c: + Update the FrugalWare backend to fix a few segfaults. (#392642) + +2007-06-08 Tambet Ingo + + * libnm-util/nm-setting.c: Implement NMSettingWirelessSecurity. + + * libnm-util/nm-connection.c (register_default_creators): Register wireless security + setting. + (gvalue_to_string): Recognize G_TYPE_UCHAR and GSList. + +2007-06-06 Tambet Ingo + + * libnm-util/nm-setting.c: Get rid of dump virtual functions, that can happen + automagically. + Implement NMSettingIP4Config. + Finish NMSettingWired by adding all known members. + (setting_wired_verify): Implement. + Finish NMSettingWireless by adding all known members. + (setting_wireless_verify): Implement. + + * libnm-util/nm-connection.c: Register "ipv4" setting. + (nm_connection_dump): Implement. Instead of requiring every NMSetting to implement + dump function, we can introspect the GHashTable which is used for sending connections + over dbus. + + * src/nm-device-802-11-wireless.c (nm_device_802_11_wireless_set_activation_ap): + Take GByteArray for essid, it's really not a string. + + * src/nm-device.c (real_act_stage3_ip_config_start): Get information from NMSettings. + Start DHCP request if setting is not passed or if it states that DHCP should be used. + (real_act_stage4_get_ip4_config): If settings are provided, use them, even if it + means overriding the values we got from DHCP. + (real_activation_cancel_handler): Cancel DHCP transaction only if it has started, doh. + (nm_device_deactivate_quickly): Ditto. + + * src/nm-device-interface.c (impl_device_activate): Dump the connection structure + for debugging. + +2007-05-07 Tambet Ingo + + * libnm-glib/Makefile.am: Link with libnm-util to gain access to + NMConnection. + + * libnm-glib/nm-device-802-11-wireless.c: + (nm_device_802_3_ethernet_activate): Remove. + + * libnm-glib/nm-device-802-3-ethernet.c + (nm_device_802_3_ethernet_activate): Remove. + + * libnm-glib/nm-device.c (nm_device_activate): Implement. + + * src/nm-device-802-3-ethernet.c: Implement the new activation using + NMConnection. + + * src/nm-device-802-11-wireless.c: Store an activation AP once the + activation has started. + Implement the new activation using NMConnection. + + * src/nm-activation-request.c: Store a generic connection object instead + of a wireless-specific AP. + + * src/NetworkManagerPolicy.c (create_connection): Implement. Depending + on device type, create a device specific connection object suitable for + device activation. + + * src/nm-device.c (nm_device_activate): Re-implement. Call the device + specific check to validate the connection and on success start the + activation. + + * src/nm-device-interface.h: Add a activate virtual function to the + interface definition. + + * src/nm-device-interface.c (nm_device_interface_activate): Implement. + (impl_device_activate): Implement. + + * introspection/nm-device.xml: Add a generic device activation interface + that accepts an abstract NMConnection structure that has device-specific + information in it. + + * introspection/nm-device-802-3-ethernet.xml: Remove the wired-specific + activation interface. + + * introspection/nm-device-802-11-wireless.xml: Remove the wireless-specific + activation interface. + + * libnm-util/nm-connection.c: + * libnm-util/nm-connection.h: + * libnm-util/nm-setting.c: + * libnm-util/nm-setting.h: Add. + + * libnm-util/Makefile.am: Build the added files. + + * src/nm-dbus-manager.c + (proxy_name_owner_changed, nm_dbus_manager_class_init): Remove the + DbusConnection argument from 'name-owner-changed' signal. The manager + is already passed as a first argument to the signal and the connection + is easy enough to get from it. + + * src/vpn-manager/nm-vpn-service.c (nm_vpn_service_name_owner_changed): + Update the signature of the function. + + * src/vpn-manager/nm-vpn-manager.c (nm_name_owner_changed_handler): + Ditto. + + * src/NetworkManager.c: Ditto. + + * src/named-manager/nm-named-manager.c + (nm_named_manager_name_owner_changed): Ditto. + + * src/supplicant-manager/nm-supplicant-manager.c + (nm_supplicant_manager_name_owner_changed): Ditto. + + * src/nm-hal-manager.c (name_owner_changed): Ditto. + + * src/dhcp-manager/nm-dhcp-manager.c + (nm_dhcp_manager_name_owner_changed): Ditto. + + * src/nm-hal-manager.c: Add a list of device detectors and creators + to make it easier to add new devices. Each device type has it's own + entry in the table so adding new device types is only a matter of + implementing a couple of functions, one for device detection and the + other for device creation. + +2007-04-25 Dan Williams + + * initscript/RedHat/NetworkManager.in: remove trailing backslash + (gnome.org #432401) + +2007-03-30 Dan Williams + + * src/NetworkManagerSystem.c + - (nm_system_device_set_ip4_route): clean up and fix argument + to nm_dev_sock_open() + +2007-03-28 Tambet Ingo + + * src/supplicant-manager/nm-supplicant-config.c (get_hash_cb): Marshal the + data to correct types instead of always using string. + + * src/NetworkManagerAP.c (get_property): AP is encrypted if capabilities does + _not_ have NM_802_11_CAP_PROTO_NONE. + (foreach_property_cb): Set AP capabilities if it's not set or if the protocol + is not set. + +2007-03-27 Tambet Ingo + + * libnm-glib/Makefile.am: Fix the build issue. + +2007-03-26 Tambet Ingo + + * libnm-glib/nm-vpn-connection.h: + * libnm-glib/nm-vpn-connection.c: Implement. + + * libnm-glib/nm-client.c: Add VPN support. + + * src/vpn-manager/nm-dbus-vpn.c (dbus_message_handler): Implement DBUS message + handler for VPN. + + * src/vpn-manager/nm-vpn-manager.c (nm_vpn_manager_new): Register VPN interface + on DBUS again. + +2007-03-26 Dan Williams + + * src/NetworkManagerAPList.c + * src/nm-device-802-11-wireless.c + * src/NetworkManagerAP.c: + - Store last seen as glong instead of GTimeVal. + - Fix the upper bound of capabilities, it's a bitfield. + +2007-03-16 Tambet Ingo + + * libnm-glib/nm-device.c (nm_device_get_description): Implement. + + * libnm-glib/nm-client.c (nm_client_manager_is_running): Implement. Also add a + "manager-running" signal that notifies the appearance/disappearance of NM. + (nm_client_sleep): Implement. + + * libnm-glib/nm-device.c: + * libnm-glib/nm-device-802-11-wireless.c: + * libnm-glib/nm-device-802-3-ethernet.c: + + Don't inherit from DBusGProxy, add a proxy to private + data. The reason is, classes inherited from NMDevice wouldn't get any dbus signals + for anything but their own dbus interface. DBusGProxy objects support only one + interfaces and to work around this, NMDevice has spearate proxy for each dbus + interface. The nice side effect of this change is that we do not create a new + DBusGProxy object for each property access. + +2007-03-15 Tambet Ingo + + * src/nm-device-802-11-wireless.c (constructor): Initialize the iw_ext structures + with zeroes before passing them to functions - the functions never do that and + reading the values back may produce wrong values. + (real_bring_up): Store the signal handler id ... + (real_bring_down): ... So that it can be removed here. + Disconnect the supplicant interface here as well. + (nm_device_802_11_wireless_ap_list_get_ap_by_obj_path): Use the dbus object path + from the access point instead of old $device/Networks/$essid. + + * src/nm-manager.c (nm_manager_get_state): Return NM_STATE_CONNECTED when the + device state is connected (instead of just having link/carrier). + + * src/nm-activation-request.c: Don't store NMData in activation request, it's + already easily accessible through the device. + + * src/NetworkManagerAP.c (nm_ap_init): Construct the dbus object path here and + store it within the object. + (nm_ap_get_dbus_path): Export it to public as well. + + * src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get): Keep the ownership + of the singleton. + +2007-03-12 Dan Williams + + Get rid of 2 second poll of sysfs 'carrier' file for wired devices. Useless + for non-carrier-detect capable devices, and useless for carrier-detect + devices since we get notifications from netlink about carrier status anyway. + + * src/nm-device-802-3-ethernet.c + - remove 'link_source_id' member from private data + - (probe_link): remove and collapse into real_update_link() + - (nm_device_802_3_periodic_update): remove + - (real_is_up): check for sup_iface rather than link_source_id + - (real_bring_up): return gboolean for success/fail; require that + sup_iface be valid for device bringup to succeed + - (real_bring_down): zero out link signal ids + + * src/nm-device.c + - (nm_device_activate_stage2_device_config): fail activation if device + bringup fails + - (real_act_stage4_get_ip4_config): fail activation if device bringup + fails + - (nm_device_bring_up): return success/fail + + * src/nm-device.h + - bring_up now returns success/fail + + * src/nm-device-802-11-wireless.c + - (real_bring_up): return success from bringup + +2007-03-07 Dan Williams + + Patch from Simon Geard (Gnome.org #394956) + * src/nm-ap-security-wpa-psk.c + - (real_write_supplicant_config): work with PSKs that may contain + zeros in the binary format rather than treating it as a string + +2007-03-02 Tambet Ingo + + * libnm-glib/nm-device-802-11-wireless.c + (nm_device_802_11_wireless_get_capabilities): Implement. + + * libnm-glib/nm-device.c (nm_device_get_capabilities): Implement. + + * src/nm-device-802-11-wireless.c: Add "WirelessCapabilities" property. + + * src/named-manager/nm-named-manager.c (remove_one_zone_from_named): Unref the + reply only if it's not NULL. Not sure why this started happening right now. + + * src/nm-manager.c (device_stop_and_free): Remove. No need to have different + code paths for when devices get removed on shutdown or when a device is just + removed. + (finalize): Don't use a g_slist_foreach() when removing devices, the list data + gets freed so any signal from a device (disconnected for instance) would invoke + NMState update which would crash. + (nm_manager_remove_device): Bring the device down when it gets removed. + + * src/NetworkManagerPolicy.c (nm_policy_auto_get_best_device): Remove + the unused dev_type. + + * src/nm-hal-manager.c (create_device_and_add_to_list): Don't keep the + reference to the added device, NMManager will own it (if it wants). + + * test/nm-tool.c: Rewrite using libnm-glib. + + * libnm-glib/nm-device-802-11-wireless.c: Cache networks (bssids) list. + We get signalled when it changes. + + * libnm-glib/nm-client.c: Cache NMState and device list, we get signalled + when it changes. + + * libnm-glib/nm-device.c: Cache the device state property. + + * libnm-glib/nm-access-point.c: Cache the strength property. + + * src/nm-device-802-11-wireless.c: Fix wireless device scanning scheduler. + The new algorithm is to start from SCAN_INTERVAL_MIN (currently defined as 0) + and add a SCAN_INTERVAL_STEP (currently 20 seconds) with each successful scan + until SCAN_INTERVAL_MAX (currently 120 seconds) is reached. Do not scan while + the device is down, activating, or activated (in case of A/B/G cards). + Remove some old dead ifdef'ed out code that used to configure wireless devices, + it's all done through supplicant now. + + * src/supplicant-manager/nm-supplicant-interface.c: Fix the reference + counting issues with pending calls which caused leaks and crashes when + interface was removed (now that the interface actually gets removed). + + * src/nm-call-store.c: Make a copy of data before running a foreach + with user callback on it - The most common usage pattern is to cancel + (and thus remove) all pending calls with foreach which would modify + the hash table we're iterating over. + + * src/nm-manager.c: When a device is added, make sure it is "up". When + it's removed or disabled due to disabling wireless or networking, bring + it down. + + * include/NetworkManager.h: Add new device state NM_DEVICE_STATE_DOWN. + + * src/nm-device-802-11-wireless.c: + * src/nm-device-802-3-ethernet.c: + * src/nm-device.c: + - Remove "init" virtual function, all gobjects have a place for that + already (constructor). + - Replace "start" virtual function with "bring_up", devices can be + brought up and down more than just on startup now. + - Add "is_up" virtual function. + - Implement one way to bring a device down instead of previous 4 different + ways, each of witch did something different. + + * src/NetworkManagerUtils.c (nm_dev_sock_open): This doesn't need an NMDevice, + all it needs is the device interface. + + Get rid of NMData.dev_list (3 members to go). + Get rif of NMData in a lot of places. + + * gnome/libnm_glib/libnm_glib.c: Make it compile again. + +2007-02-23 Dan Williams + + Patch from Andy Whitcroft (Gnome.org #410426) + + * src/NetworkManagerAP.c + - (add_capabilities_from_cipher): fix addition of WEP capabilities by + OR-ing rather than AND-ing + +2007-02-20 Tambet Ingo + + * libnm-glib/nm-device-802-11-wireless.c: Add "network-added" and + "network-removed" signals. + + * libnm-glib/libnm-glib.pc.in: Require NetworkManager >= 0.7.0. + + * libnm-glib/nm-access-point.c: Add "strength-changed" signal, emit it + when receiving the signal from dbus. + + * src/nm-device-802-11-wireless.c (get_property): Fix PROP_ACTIVE_NETWORK + property. + + * src/NetworkManagerPolicy.c (state_changed): Fix a typo to make the + deactivation of the previously activated device working again. + + * src/nm-activation-request.c: Remove NMActStage property and it's getter + and setter. + + * src/nm-device.c (nm_device_is_activated): Remove. + state == NM_DEVICE_STATE_ACTIVATED is just as easy to use. + + * include/NetworkManager.h: Remove NM_DBUS_NO_DEVICES_ERROR, + NM_DBUS_NO_DIALUP_ERROR, NM_DBUS_NO_NETWORKS_ERROR, + NM_DBUS_NO_ACTIVE_DEVICE_ERROR, NM_DBUS_NO_ACTIVE_NET_ERROR errors and + NM_DBUS_SIGNAL_STATE_CHANGE signal. + Remove NMNetworkStatus and NMActStage enums. + +2007-02-19 Tambet Ingo + + * src/vpn-manager/nm-vpn-manager.c: Handle the DBUS state changes itself. + Handle device state changes and disconnect VPN if it's device deactivates. + + * src/nm-dbus-nm.c: + * src/nm-dbus-nm.h: + * src/nm-dbus-device.c: + * src/nm-dbus-device.c: + * src/nm-dbus-net.c: + * src/nm-dbus-net.h: Remove. All of it is implemented byt the new dbus API. + + * src/NetworkManagerMain.h: Get rid of all but 3 properties of NMData. + + * src/nm-device.c (nm_device_get_by_udi): + (nm_device_get_by_iface): Remove. This doesn't belong here and is already + implemented in the correct location (NMManager). + Rip out all the test_device stuff. + + * src/NetworkManagerPolicy.c: Remove the leftover activation success and + failure handlers, it's all done by NMDevice already. + + * src/NetworkManager.c: Move the signal handling here from nm-logging.c + Remove the iochannel hack to route the unix signals to the main thread since + we're not threaded anymore. + + * src/NetworkManagerAP.c: Implement HWAddress property. + + * src/NetworkManagerDbus.c: Remove the dbus signal sending code, it happens + automatically with dbus-glib. + + * src/nm-netlink-monitor.c: + * src/nm-netlink-monitor.h: + - Move it low in the class hierarchy, don't reference any NM types. + - Remove private data from the header. + - Use type safe checks in public API methods. + - Make it a singleton so we don't have to pass the single reference around. + +2007-02-16 Tambet Ingo + + * introspection/nm-ip4-config.xml: Implement. + + * libnm-glib/libnm-glib-test.c: Use new DBUS API in tests. + + * libnm-glib/nm-ip4-config.c: + * libnm-glib/nm-ip4-config.c: Implement. + + * src/nm-ap-security[-*]: Remove circular dependencies between APs and AP + securities. APs reference security. + + * src/nm-device-802-11-wireless.c: Implement missing properties that need to + be exported over DBUS. + + * src/nm-device-802-3-ethernet.c: Ditto. + + * src/NetworkManagerAP.c: + * src/NetworkManagerAP.h: + - Convert to GObject, export over DBUS. + + * src/nm-ip4-config.h: + * src/nm-ip4-config.h: + - Convert to GObject, export over DBUS. + +2007-02-12 Dan Williams + + Patch from Helmut Schaa + + * vpn-daemons/pptp/configure.in + vpn-daemons/pptp/Makefile.am + vpn-daemons/openvpn/configure.in + vpn-daemons/openvpn/Makefile.am + vpn-daemons/vpnc/configure.in + vpn-daemons/vpnc/Makefile.am + - Add --without-gnome switch which disables building gnome bits + +2007-02-12 Tambet Ingo + + * libnm-glib/nm-device.c (nm_device_get_use_dhcp): Remove. + + * libnm-glib/nm-access-point.c (nm_access_point_is_broadcast): Remove. + + * introspection/nm-device-802-3-ethernet.xml: Rename 'Address' property to + 'HwAddress'. + + * introspection/nm-device.xml: Remove 'UseDhcp' property. + + * introspection/nm-access-point.xml: Remove 'Broadcast' property. + + Totally break NetworkManager. Please use 0.6 branch until futher notice. + + * src/: + - Remove old low-level dbus interface implementations and replace them + with dbus-glib one. + + * configure.in: + - Require dbus-glib >= 0.72. + - Plug in new sources to build. + + * libnm-glib/: + - Implement GObject wrappers on top of DBUS glib auto-generated bindings + to make it more convenient to use from GObject based programs. + + * introspection/: + - Implement DBUS XML introspection files, used by both NM and libnm-glib. + +2007-02-09 Tambet Ingo + + * src/nm-device-802-11-wireless.c: + - Add "network-added" and "network-removed" signals. + - Use gobject boilerplate macros to define the GObject. + - Implement wireless device activation. + - Remove activation_failure_handler and activation_success_handler + and instead listen on state-changed signals and run the same code + from there. + + * src/nm-device.c: + - Implment NMDeviceInterface::deactivate. + - Remove activation_failure_handler and activation_success_handler + virtual methods. Each device which is interested in these events + can just listen on it's state changed signals. + + * src/NetworkManagerPolicy.c: + - Move a bit more NMData usage to NMManager. + - Remove activation scheduling bits. + - Add listeners for wireless device's "network-added" and + "network-removed" signals. + - Listen device changed signals and deactivate currently activated + device when another device start activating (for now). + - Remove (nm_policy_schedule_device_change_check): There's never a need + for calling this, the policy code knows exactly when this should happen, + by listening on events from NMManager and NMDevices. + + * src/nm-device-802-3-ethernet.c (nm_device_802_3_ethernet_activate): + Implement. + + * src/nm-dbus-nm.c (nm_dbus_nm_set_active_device): Call the activation + method on the specific device instead of going to through policy code + and determining the device type by passed in AP's existance. + + * src/nm-device-interface.c (nm_device_interface_deactivate): Implement the + abstract NMDevice deactivation. + +2007-02-08 Tambet Ingo + + * src/NetworkManager.c: + - Set up all the shiny new managers. + + * src/NetworkManagerPolicy.c: + - Add the beginnings of new NMPolicy code. Instead of requireing all + classes to call into policy code, make the policy code kind of like + a supervisor that monitors what's going on and drives the whole NM. + + * src/nm-hal-manager.c: + * src/nm-hal-manager.h: + - Collect all libhal code scattered around NM to this one class. + - Listen libhal and NMManager events and add/remove devices to + NMManager. + + * src/nm-manager.c: + * src/nm-manager.h: + - Implment a replacement for NMData. NMData is now officially + deprecated. + +2007-02-05 Tambet Ingo + + * src/nm-device-802-11-wireless.c (supplicant_iface_scan_result_cb): + * src/supplicant-manager/nm-supplicant-interface.h + * src/supplicant-manager/nm-supplicant-interface.c + (nm_supplicant_interface_class_init): Change the "scan-result" signal's + argument to boolean from enum. + + Make NMDevice abstract class, remove almost all references to it's + subclasses (the last place gets removed with new policy manager). Add + NMDeviceInterface (which NMDevice implements) so that when we have + NMDevice exported over DBUS, there's a common NMDevice interface which + all instances have, plus there's a device specific interface for each + specific type. + Remove functions (nm_device_is_802_3_ethernet) and + (nm_device_is_802_11_wireless). There are already standard GObject macros + for type safe checks. + Use the updated supplican manager API. + + * src/nm-device-interface.h: + * src/nm-device-interface.c: + * src/nm-call-store.h: + * src/nm-call-store.c: Implement. + + * src/supplicant-manager/nm-supplicant-interface.c: + * src/supplicant-manager/nm-supplicant-interface.h: + * src/supplicant-manager/nm-supplicant-manager.c: + * src/supplicant-manager/nm-supplicant-manager.h: + - Remove all private data type references from public header files. + - Remove all references to other NM classes, this class is just a + proxy between wpa_supplicant and NM so it doesn't have to know + any internals. + - Convert to dbus-glib bindings. + - Type safe checks for public methods' arguments. + - Store pending DBUS call ids to NMCallStore. + + * src/supplicant-manager/nm-supplicant-config.c: + - Store config values in a GHashTable instead of GSList. + + * src/NetworkManagerMain.h: Remove all references to DHCP manager. + + * src/NetworkManager.c: Don't initialize the DHCP manager, it's a + singleton now. + + * src/nm-device.c: Use the new DHCP manager API. + + * src/nm-activation-request.c: + * src/nm-activation-request.h: + - Remove all dhcp related properties and methods. + + * src/dhcp-manager/nm-dhcp-marshal-main.c: Add. + + * src/dhcp-manager/nm-dhcp-marshal.list: Add. + + * src/dhcp-manager/nm-dhcp-manager.c: + * src/dhcp-manager/nm-dhcp-manager.h: + - Convert it to GObject since we need to signal state changes. + - Remove all references to other NM classes, this class is one + of the lowest classes in our hierarchy. + - One less class to use NMActRequest. + - Make it singleton, one less user of NMData. + - Remove a couple of sleep() calls. + - Convert a bunch of low-level dbus API calls to dbus-glib calls. + One less class to use the NM's custom tailored signal handlig. + + * Makefile.am: Generate marshallers, add them to build. + +2007-02-02 Dan Williams + + * configure.in + gnome/Makefile.am + nm-applet.desktop + Makefile.am + - Remove last bits referencing gnome applet + +2007-02-02 Dan Williams + + * src/vpn-manager/nm-vpn-service.c + - (nm_vpn_service_stage4_ip4_config_get): use uint32 arrays for DNS + and NBNS server addresses + +2007-02-02 Tambet Ingo + + * src/nm-dbus-manager.c: + * src/nm-dbus-manager.h: + - Convert all internal DBUS code to use dbus-glib bindings. + - Remove GObject properties, we don't need them here. + - Don't explicitly set things to NULL after freeing, glib is + happy to do it if asked nicely (G_DEBUG=gc-friendly). + - Make public API argument checks type safe. + - Remove unnecessary (and wrong) cast to GObject for the first + argument to g_signal_* calls - The first argument is a gpointer. + - Export DBusGConnection to other cool classes that (are going to) + use dbus-glib. + +2007-01-26 Dan Williams + + * libnm-util/dbus-dict-helpers.c + libnm-util/dbus-dict-helpers.h + - Coordinate style with wpa_supplicant version to minimize diff + - Add uint32 array support + - (nmu_dbus_dict_append_uint32_array): new function + - (nmu_dbus_dict_begin_string_array, nmu_dbus_dict_string_array_add_element, + nmu_dbus_dict_end_string_array): bring over from wpa_supplicant + version; allow adding string array elements individually + + * test/libnm-util/test-dbus-dict-helpers.c + - Test uint32 arrays + +2007-01-27 Jürg Billeter + + * src/backends/NetworkManagerPaldo.c + - (nm_system_update_dns): clear nscd hosts cache + +2007-01-04 Dan Williams + + Threading removal related cleanups: + + - Use the glib default main context. Remove the device main context + member from NMDevice, and the main_context member from NMData. Change + all the idle and timeout scheduler functions to use plain + g_idle_add() and g_timeout_add(). + + - As a side-effect of the first change, nm_dbus_manager_get() no longer + takes an argument; fix that up too. + + - Remove all locking, which is useless since we no longer use threads. For + example, nm_get_device_by_iface_locked() has been removed. The global + device list lock, the AP List lock, and all static locks in + NetworkManagerPolicy.c have been removed. The locking utility functions + in NetworkManagerUtils.c have also been removed. + + - Other cleanups in spacing and code style + +2007-01-01 Dan Williams + + Found by Bill Moss: + + * src/supplicant-manager/nm-supplicant-interface.c + - (nm_supplicant_interface_disconnect): fix cleanup logic when + the supplicant interface wasn't already disconnected. Always + call removeNetwork and disconnect unless the supplicant interface + is in the DISCONNECTED or INACTIVE state. + +2006-12-28 Dan Williams + + Use a single thread for everything. With the move to wpa_supplicant + and communication over D-Bus, there's no reason for multiple threads. + Almost all of the blocking code has been removed, with one exception in + the DHCP manager and a few in the VPN manager. This commit removes the + per-device worker thread and fixes activation cancellation in the absence + of threads. Further removal of thread-related code would be removing + any locking code (like the device list lock) and simplification of logic + around areas of code or data structures that are currently locked. + + * autoip.c + dhcp-manager/nm-dhcp-manager.c + nm-device-802-11-wireless.c + nm-device-802-3-ethernet.c + nm-device.c + nm-device.h + - Remove usage of multiple threads + +2006-12-19 Dan Williams + + Big wpa_supplicant + dbus update; need latest wpa_supplicant from CVS + plus a few other patches from wpa_supplicant bugzilla. + + * src/Makefile.am + src/NetworkManagerPolicy.c + src/NetworkManagerUtils.c + src/NetworkManagerUtils.h + src/nm-ap-security-leap.c + src/nm-ap-security-wep.c + src/nm-ap-security-wpa-eap.c + src/nm-ap-security-wpa-psk.c + src/nm-ap-security.c + src/nm-ap-security.h + src/nm-device-802-11-wireless.c + src/nm-device-802-11-wireless.h + src/supplicant-manager/nm-supplicant-config.c + src/supplicant-manager/nm-supplicant-config.h + src/supplicant-manager/nm-supplicant-interface.c + src/supplicant-manager/nm-supplicant-interface.h + src/supplicant-manager/nm-supplicant-marshal.list + src/supplicant-manager/nm-supplicant-settings-verify.c + src/supplicant-manager/nm-supplicant-settings-verify.h + - Move all connection management and association handling to + wpa_supplicant over dbus, rather than spawning a private copy + +2006-12-19 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check, nm_policy_schedule_device_change_check): + better locking of the device change check handler ID. Incorrect + locking was causing lost device change requests + +2006-12-18 Dan Williams + + * libnm-util/dbus-dict-helpers.c + - (_nmu_dbus_dict_entry_get_array, _nmu_dbus_dict_entry_get_string_array, + _nmu_dbus_dict_entry_get_byte_array): replace usage of + dbus_message_iter_get_array_len() (Gnome.org #382898) + +2006-12-18 Dan Williams + + * gnome/libnm_glib/libnm_glib.c + - Change dbus_connection_close() -> dbus_connection_unref() + +2006-12-11 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + - (iface_state_cb, wpas_iface_get_state): new functions; query initial + wpa_supplicant interface state + - (nm_supplicant_interface_add_cb): query initial wpa_supplicant interface + state before transitioning to READY state + +2006-12-04 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_iface_scanned_ap_cb): fix parsing of hidden APs due to + odd length of ESSID returned from ieee80211 stack-based drivers + +2006-12-04 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_iface_scanned_ap_cb): remove erroneous & from WPA & RSN + IE handling blocks that cause mis-parsing of the IE + +2006-12-04 Dan Williams + + * src/nm-device-802-11-wireless.c + - (init_supplicant_interface): new function; pull supplicant interface + setup code out into standalone function since it must be called from + two different places + - (real_init): sup_mgr is now in private object data; get and track + the supplicant manager object over the NMDevice subclass' lifetime + and register a signal handler for its state signals; only try to + initialize the supplicant interface if the supplicant manager is in + the IDLE state (and therefore is ready for requests) + - (request_wireless_scan): reschedule the scan request if (a) there is + no supplicant interface yet (meaning wpa_supplicant isn't running + or isn't ready yet), or (b) if the supplicant interface isn't ready + for requests yet + - (supplicant_iface_connection_state_cb): new function; stub for + handling supplicant interface connection state signals + - (supplicant_mgr_state_cb): do the right thing when wpa_supplicant + comes and goes + - (nm_device_802_11_wireless_dispose): clean up spacing; release the + supplicant manager object that's being tracked starting with this + commit + +2006-12-04 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + - (nm_supplicant_interface_set_property): track signal handler ID + - (nm_supplicant_interface_dispose): remove signal handler on dispose + +2006-12-04 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.[ch] + - (nm_supplicant_interface_get_state): new function + +2006-12-04 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.c + - (bssid_properties_cb): don't treat DBus errors as valid + scanned AP messages + +2006-12-04 Dan Williams + + * src/supplicant-manager/nm-supplicant-interface.[ch] + - (nm_supplicant_interface_get_connection_state): new function + - define new supplicant connection states + - send a signal when the supplicant connection state changes + +2006-12-03 Dan Williams + + * src/supplicant-manager/Makefile.am + src/supplicant-manager/nm-supplicant-connection.h + src/supplicant-manager/nm-supplicant-connection.c + src/supplicant-manager/nm-supplicant-config.h + src/supplicant-manager/nm-supplicant-config.c + src/supplicant-manager/nm-supplicant-types.h + src/supplicant-manager/nm-supplicant-interface.h + src/supplicant-manager/nm-supplicant-interface.c + - Rename NMSupplicantConnection -> NMSupplicantConfig + +2006-12-03 Dan Williams + + Patch from Gabor Kelemen (Gnome.org #381890) + + * po/POTFILES.in + po/POTFILES.skip + - Move VPN-related translatables to .skip + + * vpn-daemons/pptp/po/POTFILES.in + - Update with new translatables + +2006-12-02 Dan Williams + + Patch from Christian Persch + + * gnome/applet/Makefile.am + gnome/applet/applet-dbus-devices.c + gnome/applet/applet-notifications.c + gnome/applet/applet.c + gnome/applet/applet.h + gnome/applet/main.c + - Be a GtkStatusIcon on GTK+ >= 2.10 + +2006-12-02 Dan Williams + + * gnome/applet/applet.c + - (nma_update_info): fix two unecessary allocations + +2006-12-02 Dan Williams + + Patch from Michael Biebl + * configure.in + man/NetworkManager.1.in + man/NetworkManagerDispatcher.1.in + man/NetworkManager.8.in + man/NetworkManagerDispatcher.8.in + - Add .SH NAME stanzas + - Move NM & NM Dispatcher manpages to section 8 (admin) + +2006-12-02 Dan Williams + + Patch from Christian Persch + + * configure.in + - Check for GTK+ 2.10 in preparation for GtkStatusIcon patch + +2006-11-29 Tambet Ingo + + Patch by Timo Hoenig : + * src/nm-dbus-manager.c (nm_dbus_manager_start_service): Make it work with + DBUS-1.0. + + * src/supplicant-manager/Makefile.am: Add nm-supplicant-marshal here, since + we can't use the one from the main source directory. + +2006-11-27 Dan Williams + + Patch from Christian Persch + + * gnome/applet/applet-dbus-devices.c + - (hal_info_product_cb): fix memleak; free duped string. + Gnome.org #379908 + +2006-11-27 Dan Williams + + Patch from Christian Persch + + * gnome/applet/menu-items.c + - (network_menu_item_update): use gtk_progress_bar_set_fraction() + as gtk_progress_set_percentage is deprecated. Should + work as far back as GTK+ 2.4. Gnome.org #379780 + +2006-11-26 Dan Williams + + Scan using wpa_supplicant over DBus. + + * src/nm-device-802-11-wireless.c + - remove wireless extensions netlink event handler bits + (wireless_event_helper, nm_device_802_11_wireless_event) + - remove wireless extensions scan event handler bits + (process_scan_results, add_new_ap_to_device_list, hexstr2bin, + hex2byte, hex2num, request_and_convert_scan_results, + free_process_scan_cb_data, scan_results_timeout, + schedule_scan_results_timeout, cancel_scan_results_timeout) + - Rename nm_device_802_11_wireless_scan() -> request_wireless_scan() + and request scans from the supplicant interface rather than directly + - Move functionality of convert_scan_results() to cull_scan_list() and + supplicant_iface_scanned_ap_cb() + - (supplicant_iface_scan_result_cb): new function; schedule a new scan + at the scan interval when the current scan has finished + - (supplicant_iface_state_cb): start scanning when the supplicant + interface enters the READY state, and stop scanning when it + enters the DOWN state + - (cull_scan_list): weed out old access points from the scan list + - (supplicant_iface_scanned_ap_cb): convert a supplicant scanned access + point into an NMAccessPoint and merge it into the device's scan list + + * src/supplicant-manager/nm-supplicant-interface.c + src/supplicant-manager/nm-supplicant-interface.h + - Add a new signal "scan-result" which is issued when the supplicant + notifies NM that a scan has completed + - Add a new signal "scanned-ap" that notifies listeners of a new access + point found in the scan. Called once for each access point that + the supplicant interface object receives from the supplicant as a + result of the "scanResults" method call + - (wpas_iface_query_scan_results): don't wait 4s before querying + for the initial scan results + - (scan_request_cb): new function; send listeners the result + (success, error) of a wireless scan request + - (nm_supplicant_interface_request_scan): new function; ask the + supplicant to perform an immediate wireless scan + +2006-11-25 Dan Williams + + * src/supplicant-manager/Makefile.am + - Since we're including NetworkManagerMain.h in nm-supplicant-interface.c, + add HAL cflags/includes and named-manager includes directory + + * src/supplicant-manager/nm-supplicant-interface.h + - New state STARTING to handle transition from INIT to READY where + the addInterface pending call is still outstanding + + * src/supplicant-manager/nm-supplicant-interface.c + - track pending calls differently since we may have more than one + going on at any given time + - request scan results from wpa_supplicant; but don't do it more often + than every 4 seconds. Drivers that do background scanning + (like the 'ipw' drivers) send a continuous stream of scan completion + notifications, so we don't want to hammer the supplicant or dbus + with requests for all scan results every time we get a completion + notification. + +2006-11-25 Dan Williams + + * src/supplicant-manager/nm-supplicant-types.h + - new file; move all supplicant manager object typedefs here for + #include sanity + + * src/supplicant-manager/nm-supplicant-interface.c + src/supplicant-manager/nm-supplicant-interface.h + - new file; an object that interfaces an NMDevice object to the + supplicant and handles signals from the supplicant. This object + does all necessary DBus communication with wpa_supplicant. + + * src/supplicant-manager/nm-supplicant-manager.c + src/supplicant-manager/nm-supplicant-manager.h + - Actually do something. Track the state of the wpa_supplicant service + and deal with its comings & goings. Handle life events of + supplicant interfaces too. + - Move NMSupplicantManager typedef to nm-supplicant-types.h + + * src/supplicant-manager/nm-supplicant-connection.h + - Move NMSupplicantConnection typedef to nm-supplicant-types.h + + * src/supplicant-manager/Makefile.am + - Add new files to build, and add libnm-util to includes + + * src/nm-marshal.list + - New marshaler type: VOID:UINT,UINT + + * src/nm-device-802-3-ethernet.c + - (real_init): grab a supplicant interface + - (nm_device_802_3_ethernet_dispose): release the supplicant interface + - (supplicant_iface_state_cb): new function, stub for handling + supplicant interface state changes + + * src/nm-device-802-11-wireless.c + - (real_init): grab a supplicant interface + - (nm_device_802_11_wireless_dispose): release the supplicant interface + - (supplicant_iface_state_cb): new function, stub for handling + supplicant interface state changes + + * src/NetworkManager.c + - (main): create and keep the supplicant manager around for the lifetime + of NetworkManager + + * src/Makefile.am + - Link to the supplicant manager sub-library and use the supplicant + manager includes + +2006-11-25 Dan Williams + + Rework DBus manager signal handling to be more flexible. Previously, + only one signal handler could be registered for a particular interface. + The DBus manager now reference counts DBus bus matches and allows multiple + clients to register signal handlers for the same interface and sender. + + * src/NetworkManager.c + - (main): track NMI signal handler ID and remove it when we quit + + * src/NetworkManagerMain.h + - Keep track of NMI signal handler ID + + * src/nm-dbus-manager.c + src/nm-dbus-manager.h + - rework signal handling; each signal handler references one signal + match, but a signal match may be referenced by one or more + signal handlers. Matches are refcounted and are destroyed when the + last signal handler that references the match is removed. This is + necessary because two signal handlers may end up requiring the same + dbus bus match, so the match must live until the last signal handler + is destroyed (for example, with the wpa_supplicant network interface + dbus interface). + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_new): track DHCP signal handler id + - (nm_dhcp_manager_dispose): remove DHCP signal handler + + * src/vpn-manager/nm-vpn-service.c + - (nm_vpn_service_add_watch): track VPN service signal handler id + - (nm_vpn_service_remove_watch): remove VPN service signal handler + +2006-11-25 Dan Williams + + Suggested by Helmut Schaa + + * src/vpn-daemons/nm-vpn-service.c + - (supplicant_child_setup): new function + - (supplicant_exec): make child process use a new process group id + + * src/nm-device-802-11-wireless.c + - (nm_vpn_service_child_setup): new function + - (nm_vpn_service_stage1_daemon_exec): make child process use a new + process group id + +2006-11-19 Dan Williams + + Patch from Dan Berrange Gnome.org #377262 + * gnome/vpn-properties/nm-vpn-properties.c + - clean up after renamed VPN connection + +2006-11-19 Dan Williams + + Patch from Dan Berrange Gnome.org #377205 + * gnome/applet/applet-dbus-vpn.c + - (nma_dbus_vpn_properties_cb): sort VPN connections + + * gnome/vpn-properties/nm-vpn-properties.c + - (init_app): sort VPN connections + +2006-11-09 Dan Williams + + * src/NetworkManagerAPList.c + - (nm_ap_list_copy_one_essid_by_address): fix bug due to previous + code cleanup in revision 1.56; the split of the !nm_ap_get_essid() + from the nm_ap_list_get_ap_by_address() call was incorrect and + broke hidden SSID matching. Found by Bill Moss. + +2006-10-25 Dan Williams + + * src/nm-dbus-nm.c + - (nm_dbus_nm_set_active_device): return an empty success message on + success, rather than falling through to the error case. + +2006-10-25 Dan Williams + + * src/NetworkManagerUtils.c + - (nm_utils_supplicant_request_with_check): suppress messages for the + "SCAN" command + +2006-10-24 Dan Williams + + Reduce the number of times the Gnome applet wakes up, especially when + it's doing absolutely nothing and is hidden. Initial patch by + Chris Aillon. + + * gnome/applet/applet-dbus.c + - (nma_dbus_filter): when NM isn't around, or when it goes away, + kill the redraw timeout. When NM starts up, start the redraw + timeout. Also, if we get kicked off the bus for some reason, + start the reconnection timeout if one's not already running. + - (nma_dbus_init): better handling of error conditions, don't leak + a half-initialized dbus connection + - (nma_dbus_connection_watcher): consolidate places we reinitialize + the applet's data, just call nm_dbus_init_helper() + - (nma_start_dbus_connection_watch): new function, starts a periodic + timeout that calls nma_dbus_connection_watcher() + - (nma_dbus_init_helper): if we get a successful connection, kill the + reconnection timeout, and don't start the reconnection timeout + unconditionally anymore + + * gnome/applet/applet-dbus.h + - Expose nma_start_dbus_connection_watch() + + * gnome/applet/applet.c + - (nma_update_state): no longer static, called from applet-dbus.c for + immediate UI updates on certain events + - (nma_set_running): new function; take over setting applet->running, + when not running (ie, NM is not active), don't activate the redraw + timeout because we're not showing the applet anyway. When we are + running (ie, NM is active), and only when we're running, start the + redraw timeout. + - (nma_destroy): kill the redraw timeout by setting 'not running', and + kill any reconnection timeout + - (nma_get_instance): move one-off dbus initialization code here since + nm_dbus_init_helper() gets called more than once, possibly by the + reconnection timeout function too. And, when we start up, if we + can't get a connection to the bus, start the reconnection timeout. + But don't start the redraw timeout yet, only do that when we get + NM's state and find out if it's running or not. + + * gnome/applet/applet.h + - Add the reconnection GSource ID + - Add prototypes for nma_set_running() and the no-longer-static + nma_update_state() + +2006-10-24 Dan Williams + + * src/vpn-daemons/nm-dbus-vpnc.c + - (nm_dbus_vpn_update_one_connection_cb): unregister pending call in + pending call tracker + - (nm_dbus_vpn_connections_update_cb): unregister pending call in + pending call tracker; register one-vpn-connection update pending + call in pending call tracker + - (nm_dbus_vpn_update_one_vpn_connection): register one-vpn-connection + update pending call in pending call tracker + - (nm_dbus_vpn_connections_update_from_nmi): register vpn-connections + update pending call in pending call tracker; don't block waiting + for call to return + +2006-10-19 Robert Love + + * src/backends/NetworkManagerSuSE.c: Don't ever restart nscd; just + refresh the cache. + +2006-10-14 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (get_ip4_string, get_ip4_uint32s): have the caller pass + the dbus connection and the device object path rather than + constructing it inside both functions. Saves a bit of memory + and clarifies a failure path. + - (nm_dhcp_manager_get_ip4_config): grab the dbus connection + and allocate device path here rather than each of the two + functions above. + +2006-10-13 Dan Williams + + * src/NetworkManager.c + - (nm_name_owner_changed_handler): handle NMI coming and going, + this somehow droppout in the refactor + +2006-10-13 Dan Williams + + * Huge DBus refactor: + - Create a "DBus Manager" object which manages the connection and + sends signals on NameOwnerChanged and connection/disconnection events, + handles reconnection to the bus if NM gets kicked off, and abstracts + signal handling + - Remove DBusConnection members from places where they are no + longer needed due to the refactor, like the dbus-connection + property of the named manager, and from NMData + - Reformats a bunch of the code to gnome style + (8-space tabs, braces on same line as statement, 80-col width). + Consider it open season to reformat any bits to gnome style. + style that aren't already. + +2006-10-13 Dan Williams + + * src/supplicant-manager/Makefile.am + - Add new files + + * src/supplicant-manager/nm-supplicant-manager.[ch]: + - Make it a minimal GObject + + * src/supplicant-manager/nm-supplicant-settings-verify.[ch]: + - Verify settings destined for wpa_supplicant + + * src/supplicant-manager/nm-supplicant-connection.[ch]: + - Minimal GObject to track wpa_supplicant controlled device + connections + +2006-10-13 Wouter Bolsterlee + + * gnome/applet/applet.c: (nma_update_info), + (nma_act_stage_to_pixbuf), (nma_update_state): + Mark missing strings for translation. Fixes bug #343306. + +2006-10-01 Dan Williams + + * src/vpn-manager/nm-vpn-manager.c + - (nm_vpn_manager_load_services): split and clean up + for readability and correctness. Restrict VPN service + files to ending in ".name", as was meant from the + beginning (but not coded in). Better error reporting. + +2006-10-01 Dan Williams + + * utils/nm-utils.h + - Clean up formatting of debug/info/warning log messages + +2006-09-27 Robert Love + + Patch by Tambet Ingo : + * gnome/vpn-properties/nm-vpn-properties.c: Make Renaming a VPN entry + actually work. + +2006-09-07 Dan Williams + + * test/Makefile.am + test/libnm-util/Makefile.am + test/nm-supplicant-test.c + - Add test program emulating the way NM drives wpa_supplicant + to help debug supplicant issues + +2006-08-24 Dan Williams + + * configure.in + src/Makefile.am + src/supplicant-manager/Makefile.am + src/supplicant-manager/nm-supplicant-manager.c + src/supplicant-manager/nm-supplicant-manager.h + - Add skeleton bits of the wpa_supplicant manager + +2006-08-24 Dan Williams + + Patch from Ed Catmur: + * src/NetworkManagerUtils.c + - (nm_utils_ip4_netmask_to_prefix): don't infinitely loop + if netmask is 0 (Gnome #352634) + +2006-08-17 Robert Love + + * src/backends/NetworkManagerSuSE.c: Do not restart ypbind; our ypbind + package is now DBUS-enabled and listens for the NM signals. + +2006-08-14 Dan Williams + + * Patch from Christian Persch + * configure.in + po/LINGUAS + vpn-daemons/openvpn/po/LINGUAS + vpn-daemons/openvpn/configure.in + vpn-daemons/pptp/po/LINGUAS + vpn-daemons/pptp/configure.in + vpn-daemons/vpnc/po/LINGUAS + vpn-daemons/vpnc/configure.in + - Convert to LINGUAS method so translators don't have to modify + configure.in, just stuff in po/. Gnome #343132, requires intltool + 0.35 or higher + +2006-08-14 Dan Williams + + Patch from Alex Smith + * configure.in + src/backends/Makefile.am + src/backends/NetworkManagerFrugalware.c + - Add support for Frugalware + +2006-08-13 Dan Williams + + Patch from Valentine Sinitsyn + * src/nm-device-802-11-wireless.c + - (supplicant_exec): spawn wpa_supplicant without debug spew + Gnome #346875 + +2006-08-13 Dan Williams + + Patch from Valentine Sinitsyn + * src/nm-ap-security.c + src/nm-ap-security.h + - Add authentication_required bits for subclasses to specify whether + or not real authentication is required for connections, i.e. whether + the AP rejects us when an encryption key is wrong or not. + + * src/nm-ap-security-wep.c + src/nm-ap-security-wpa-eap.c + src/nm-ap-security-wpa-psk.c + src/nm-ap-security-leap.c + - Implement authentication_required appropriately for each method + + * src/nm-device-802-11-wireless.c + - Be smarter about when to request a key; for example, using a wrong key + in WEP shared key mode previously just timed out and did not request + a new key + +2006-08-13 Dan Williams + + * gnome/libnm_glib/libnm_glib.c + - dbus_connection_disconnect() -> dbus_connection_close() for + dbus >= 0.90 + +2006-08-07 Dan Williams + + Patch from Antony J Mee + * src/NetworkManagerSystem.c + - Respect specified MTU. Gnome #344967 + +2006-08-07 Dan Williams + + * src/vpn-manager/nm-vpn-service.c + - Simplify print_vpn_config() arguments + + Patch from Antony J Mee + * src/vpn-manager/Makefile.am + src/vpn-manager/nm-vpn-service.c + - Add new API for passing VPN config options as a dict. Gnome #344967 + +2006-08-06 Dan Williams + + * gnome/applet/applet-dbus-devices.c + gnome/applet/applet-dbus-vpn.c + gnome/applet/applet-dbus.c + gnome/applet/applet-dbus.h + src/nm-dbus-nmi.c + utils/nm-utils.c + utils/nm-utils.h + - Make pending call tracking code generic, + so we can use it in NM as well as the applet + +2006-08-06 Dan Williams + + * src/nm-activation-request.c + - Refcount pending call objects + +2006-08-06 Dan Williams + + Patch from Christan Chiesa + * configure.in + - Tell sha1.c to use bigendian mode on PPC + +2006-08-04 Robert Love + + Glib Memory Slices! + * configure.in: Require glib 2.10 or later. + * src/NetworkManager.c, src/NetworkManagerAP.c, src/nm-ip4-config.c, + src/NetworkManagerAPList.c, src/NetworkManagerDbus.c, + src/NetworkManagerDbusUtils.c, src/nm-dbus-nmi.c, src/wpa.c, + src/nm-device-802-11-wireless.c: Convert applicable g_malloc and + g_new calls to g_slice_new. Likewise for g_free to g_slice_free. + Memory Slices are the greatest thing since bread slices. + * src/NetworkManagerAP.c: Also, fix memory leak. + +2006-08-01 Robert Love + + * gnome/applet/main.c: Shutdown all VPN connections on logout. + +2006-07-31 Robert Love + + * src/backends/interface_parser.c: Declarations must begin the block. + +2006-07-24 Dan Williams + + Patch from Timothée Lecomte + * src/backends/Makefile.am + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerGeneric.c + src/backends/NetworkManagerGeneric.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - Genericize common backend functions + +2006-07-18 Robert Love + + * configure.in: Add "--with-notify" option to allow disabling of + libnotify support. + +2006-07-13 Dan Williams + + Patch from Thiago Bauermann + * gnome/applet/applet.glade + gnome/applet/Makefile.am + gnome/applet/nm-gconf-wso.c + gnome/applet/nm-gconf-wso-leap.c + gnome/applet/nm-gconf-wso-leap.h + gnome/applet/wireless-security-manager.c + gnome/applet/wso-leap.c + gnome/applet/wso-leap.h + include/NetworkManager.h + libnm-util/dbus-helpers.c + libnm-util/dbus-helpers.h + src/Makefile.am + src/NetworkManagerAP.c + src/nm-ap-security.c + src/nm-ap-security-leap.c + src/nm-ap-security-leap.h + - Add LEAP authentication support + +2006-07-13 Dan Williams + + Patch from Timothée Lecomte + * configure.in + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + src/backends/NetworkManagerSuSE.c + - Convert hardcoding of 'ip' path to configure-time + detected one + +2006-07-12 Leonid Kanter + + * configure.in: added ru to ALL_LINGUAS + +2006-07-10 Dan Williams + + Patch from Valentine Sinitsyn + * src/nm-device.c + - (real_act_stage3_ip_config_start): don't infinite loop when + dhcdbd isn't running (Gnome #346845) + +2006-07-09 Dan Williams + + * gnome/applet/applet.c + - (nma_destroy): don't pass NULL to notify_notification_close + (RH #197917) + +2006-07-09 Dan Williams + + * gnome/applet/applet.c + - (nma_about_cb): remove empty documenters tab (Gnome #341324) + +2006-07-04 Tor Krill + + Patch from Valentine Sinitsyn + * src/backends/NetworkManagerArch.c: (nm_system_update_dns), + (nm_system_restart_mdns_responder), (ArchReadConfig), + (nm_system_device_get_system_config): + - Explicitly check for DHCP configuration + - Check if daemons are running before starting them + +2006-06-25 Dan Williams + + * libnm-util/dbus-dict-helpers.[ch] + test/libnm-util/test-dbus-dict-helpers.c + - Add string array support + +2006-06-24 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_process_signal): clean up spacing + +2006-06-21 Dan Williams + + * src/nm-dbus-device.c + - (nm_dbus_device_get_driver): don't try to stuff a NULL + through dbus + +2006-06-21 Raivis Dejus + + * configure.in: Added 'lv' to ALL_LINGUAS + +2006-06-19 Dan Williams + + * src/NetworkManagerAP.c + - Clarify usage of user_created + + * src/nm-ap-security-wep.c + src/nm-ap-security-wpa-eap.c + src/nm-ap-security-wpa-psk.c + src/nm-ap-security.c + src/nm-ap-security.h + - s/user_created/adhoc, because we really do mean adhoc + + Patch from Bernard Blackham + * src/nm-device-802-11-wireless.c + - (supplicant_send_network_config): instead of user_created, + use adhoc, and do AP_SCAN 2 for adhoc networks + +2006-06-18 Robert Love + + * gnome/applet/nm-gconf-wso-wpa-eap.c: Don't set the Gconf keys unless + we have a value to set. Gconf generates a warning if `val' is NULL. + * src/nm-ap-security-wpa-eap.c: Don't set the key for an Enterprise AP + unless we actually received a valid private key file passphrase or + password. Otherwise, we don't know to later ask the applet to pull + the key from the keyring. + +2006-06-17 Dan Williams + + * libnm-util/dbus-dict-helpers.[ch] + test/libnm-util/test-dbus-dict-helpers.c + - Fixes for zero-length byte arrays + - Replace return values of 0 with FALSE for clarity + - Test zero-length byte arrays + +2006-06-17 Dan Williams + + * libnm-util/dbus-dict-helpers.[ch] + test/libnm-util/test-dbus-dict-helpers.c + - Add helpers for byte arrays + - Rework bits of the testcase + +2006-06-16 Dan Williams + + * libnm-util/Makefile.am + * libnm-util/dbus-dict-helpers.[ch] + - Add some helpers to take the pain out of using dict types in + dbus. + + * test/libnm-util/Makefile.am + * test/libnm-util/test-dbus-dict-helpers.c + - Test cases for the dict helper functions + +2006-06-15 Robert Love + + * gnome/applet/nm-gconf-wso-wpa-eap.c: Don't set the key unless there + is a non-empty key to set. Elsewhere, pass an empty string via DBUS + if there is no key to pass. + * libnm-util/dbus-helpers.c: Given the above, we can trust always + receiving a non-NULL key. + +2006-06-14 Robert Love + + * src/nm-ap-security-wpa-eap.c: In real_copy_constructor(), actually + copy the strings. + + +2006-06-14 Dan Williams + + Patch from Lorenzo Colitti gnome.org #344825 + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_set_essid): only wait for orinoco cards + or ones where the driver is unknown + - (supplicant_exec): don't wait for supplicant startup here + - (supplicant_interface_init): finer grained polling for supplicant + startup + +2006-06-13 Robert Love + + * gnome/applet/applet-dbus-info.c: Don't set the fallback bit to FALSE + if it is currently set to TRUE. Otherwise, we will reset the value + when we connect normally. + * src/nm-device-802-11-wireless.c: For the roaming code, make sure that + the old BSSID is valid, too. The recently added ESSID check may not be + sufficient (we can remove it?). What we really want to catch is the + case of going from all-zeros to the BSSID of some other network, which + happens on failure. + +2006-06-09 Dan Williams + + * src/NetworkManagerSystem.[ch] + - (nm_system_device_set_up_down_with_iface): remove 'dev' argument, + it was unused and pointless + - (nm_system_vpn_device_set_from_iface, nm_system_device_set_up_down): + fix for set_up_down_with_iface change + + * src/vpn-manager/nm-vpn-connection.c + - (nm_vpn_connection_deactivate): fix for set_up_down_with_iface change + + * src/backends/NetworkManagerPaldo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSuSE.c + src/backends/NetworkManagerArch.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerGentoo.c + - (nm_system_enable_loopback): use set_up_down_with_iface where + appropriate + - (nm_system_flush_loopback_routes): use flush_routes_with_iface + where appropriate + +2006-06-09 Dan Williams + + Patch from Peter Jones: + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_update_bssid): make sure that the + SSID hasn't changed from what we expect before automatically + updating the saved BSSID from a new AP + +2006-06-08 Robert Love + + Add 'fallback' support. NetworkManager will attempt to brute-force + connect to networks marked as fallback if there are no better wireless + connections available. This is useful as a method of last resort, to + work around driver problems, and for use with hidden networks. + * gnome/applet/applet-dbus-devices.c, + gnome/applet/applet-dbus-devices.h: Add fallback parameter. + * gnome/applet/applet-dbus-info.c: Retrieve fallback bit from Gconf and + pass it on via DBUS. + * gnome/applet/applet.c: No fallback by default. + * gnome/applet/applet.glade, gnome/applet/other-network-dialog.c: + Update other-network-dialog to add UI checkbox toggling fallback. + * src/NetworkManagerAP.c, src/NetworkManagerAP.h: Remove "trusted" + propery from AP object. Add "fallback" property to AP object. + * src/nm-dbus-nm.c: Grab the fallback parameter via DBUS. + * src/nm-dbus-nmi.c: Grab the fallback parameter via DBUS. + * src/nm-device-802-11-wireless.c: Break out blacklist logic into + separate function. Add get_best_fallback_ap() for returning an AP + on which to attempt fallback. + * src/backends/NetworkManagerSuSE.c: Set stored network as fallback. + * test/nm-set-fallback: New file. Sets a given network as fallback. + +2006-06-07 Robert Love + + * gnome/applet/gconf-helpers.c: Bug fix: nm_gconf_helper_get_bool() + checked that the return type was GCONF_VALUE_STRING, not the correct + GCONF_VALUE_BOOL, and thus it never worked. + * src/NetworkManagerAPList.c: Before concluding that two networks are + identical based on their BSSID, make sure that the BSSID in question + is actually valid. Specifically, an empty or all zero BSSID does not + cut it. + * gnome/applet/applet-dbus-info.c, gnome/applet/other-network-dialog.c, + src/nm-dbus-nmi.c, src/nm-device-802-11-wireless.c: White space and + similar invariant clean up. + +2006-06-02 Robert Love + + * gnome/applet/applet.c: Update copyright years. Add Novell. + +2006-05-28 Dan Williams + + * gnome/applet/applet.glade + gnome/vpn-properties/nm-vpn-properties.glade + - Set window icons on dialogs (Gnome.org #333420) + +2006-05-28 Christian Persch + + * gnome/vpn-properties/nm-vpn-properties.glade: + * vpn-daemons/openvpn/properties/nm-openvpn-dialog.glade: + * vpn-daemons/pptp/properties/nm-pptp-dialog.glade: + * vpn-daemons/vpnc/properties/nm-vpnc-dialog.glade: + - Make the VPN properties pages prettier and more HIG + compliant. Gnome Bug #336913. + +2006-05-28 Dan Williams + + Patch from Christian Persch + * gnome/vpn-properties/nm-vpn-properties.c + * gnome/vpn-properties/nm-vpn-properties.glade + - HIG-ification love (Gnome.org #336846) + +2006-05-28 Dan Williams + + Patch from Christian Persch + * configure.in + gnome/vpn-properties/nm-vpn-properties.c + - (main): Fix option parsing. Gnome.org #336847 + +2006-05-28 Dan Williams + + * gnome/vpn-properties/nm-vpn-properties.c + - (find_vpn_ui_by_service_name): protect against NULL service names + - (update_edit_del_sensitivity): protect against NULL service names + Gnome.org #341306 + +2006-05-28 Dan Williams + + Patch from Chris Fuller : + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_dispose): add a is_initialized member and + don't dispose of wireless-specific stuff unless it is actually + initialized. Gnome.org #341263 + +2006-05-28 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): don't switch devices if the "best" + AP is essentially the same as the current activation request, but + the current activation request isn't done activating yet. Fixes + multiple requests for keyring password on startup for Gnome applet. + Gnome.org #341297 + +2006-05-26 Nicolas Trangez + + * src/NetworkManager.c: use GOptions instead of getopt + * configure.in: bump glib required version to >= 2.6 for GOption + support + +2006-05-25 Robert Love + + * src/nm-device.h: Introduce nm_ioctl_info(), which defines to + nm_info() if IOCTL_DEBUG is set and a no-op if not. We can use this + instead of dumping ifdef's throughout the code. + * src/NetworkManagerSystem.c, src/nm-device-802-11-wireless.c, + src/nm-device-802-3-ethernet.c, src/nm-device.c: Remove ifdef's and + use nm_ioctl_info() in lieu. + +2006-05-25 Robert Love + + Patch Valentine Sinitsyn to fix GNOME bug #342400: + * libnm-util/Makefile.am: Only build gnome-keyring-md5.{c,h} if we are + not using gcrypt. Otherwise, we get a linker error. + +2006-05-25 Robert Love + + Patch Valentine Sinitsyn to fix GNOME bug #342398: + * configure.in, gnome/Makefile.am, Makefile.am: Add "--without-gnome" + configure flag to disable building of the GNOME-based applet. + +2006-05-25 Robert Love + + * gnome/applet/nm-device.c, gnome/applet/nm-device.h: Rename function + parameter from link, because it shadows a global variable with some + older versions of glibc. Yes, glibc is now fixed and, yes, glibc + should never have exported to the entire system a common four letter + word. But we here at NetworkManager are team players. Fixes + GNOME bug #336532. + +2006-05-25 Arangel Angov + + * configure.in: Added mk.po, Macedonian translation. + +2006-05-24 Robert Love + + * examples/python/systray/eggtrayicon.c, gnome/applet/eggtrayicon.c, + gnome/applet/passphrase-dialog.c, gnome/applet/vpn-password-dialog.c, + src/NetworkManager.c: Include and not . + +2006-05-24 Robert Love + + * gnome/applet/Makefile.am, gnome/vpn-properties/Makefile.am, + libnm-util/Makefile.am, src/Makefile.am, + vpn-daemons/openvpn/auth-dialog/Makefile.am, + vpn-daemons/openvpn/properties/Makefile.am, + vpn-daemons/pptp/auth-dialog/Makefile.am, + vpn-daemons/pptp/properties/Makefile.am, + vpn-daemons/vpnc/auth-dialog/Makefile.am, + vpn-daemons/vpnc/properties/Makefile.am: Do not override what the + user passed for --datadir, if anything, when setting the GNOME locale + directory. It should be a function of the specified datadir and not + the prefix. + +2006-05-24 Robert Love + + * gnome/applet/main.c, gnome/vpn-properties/nm-vpn-properties.c, + src/NetworkManager.c: Take care to call bindtextdomain with the + location of msgid files. + * src/Makefile.am: Set GNOMELOCALEDIR to the location of GNOME mo + files. + +2006-05-22 Robert Love + + * src/nm-device-802-11-wireless.c: Don't chain up to the parent's + stage4_timeout on failure unless the wireless network is Ad-Hoc. + 99% of the time there is a real problem with wireless, and a + seemingly successful connection via Zeroconf just confuses the user. + And that 1% of the time the network is probably Ad-Hoc, anyhow. + +2006-05-22 Robert Love + + * src/backends/NetworkManagerSuSE.c: Reload, do not restart, ypbind and + autofs on interface up if NIS is configured. On interface down, do + nothing. + +2006-05-22 Robert Love + + * gnome/applet/applet.c: Zero out the icon pointers before we set them, + to avoid calling g_object_unref() on stale pointers on error in + nma_icons_free(). This happens because we short-circuit loaded the + icons on the first failure but then free all icons. Normally we have + no issue because the icons were zero'ed out malloc, but we have stale + pointer data after nma_icon_theme_changed(). + * gnome/applet/main.c: Return error code if nma_new() failed. + +2060-05-21 Dan Williams + + * initscript/NetworkManager.in + - Ensure both dhcdbd and named are started before NM + +2006-05-21 Dan Williams + + * configure.in + - Bump version to 0.7 to signify we are in 0.7 development + +2006-05-21 Dan Williams + + Patch from Adam Schreiber + * gnome/vpn-properties/nm-vpn-properties.c + - (main): correct Gnome program name (gnome.org #342498) + +2006-05-21 Dan Williams + + Fix gnome.org #330832 based on patch from Crispin Flowerday + + * src/NetworkManagerDbus.[ch] + - nm_dbus_get_device_from_object_path -> nm_dbus_get_device_from_escaped_object_path: + clarify that function's argument should be an escaped dbus object + path, and look for path segment end before returning a match + * src/nm-dbus-nm.c: + - Fix up users of nm_dbus_get_device_from_escaped_object_path() + +2006-05-17 Robert Love + + Functionality to differentiate Ad-Hoc networks from infrastructure + networks in the applet, by displaying a special icon: + * gnome/applet/applet-dbus-devices.c: Set the mode for new networks. + * gnome/applet/applet.c: Pass 'applet' to network_menu_item_update(). + * gnome/applet/menu-items.c: Set a special icon in the scan list for + ad-hoc networks. TODO: Add a third icon representing "encrypted and + Ad-Hoc". Right now, we display the same icon for all Ad-Hoc wireless + networks, encrypted or not. + * gnome/applet/wireless-network.c, gnome/applet/wireless-network.h: New + accessor functions to get and set the mode of a given network, + wireless_network_get_mode() and wireless_network_set_mode(). + +2006-05-17 Robert Love + + Functionality to automatically add BSSIDs to the allowed-MAC list as + one roams from access point to access point on a given network: + * src/NetworkManagerUtils.c: Add nm_ethernet_addresses_are_equal(), + helper function to compare two ether_addr structures and return TRUE + if they contain the same MAC address. + * src/NetworkManagerUtils.h: Add nm_ethernet_addresses_are_equal() + prototype. + * src/nm-device-802-11-wireless.c: New function to update the BSSID + stored with the current AP. If the BSSID has indeed changed, we + send it out to the applet, allowing the allowed-MAC list to grow + automatically in response to roaming. + +2006-05-16 Robert Love + + * src/backends/NetworkManagerSuSE.c: Don't touch ypbind or autofs + unless dhcp:DHCLIENT_MODIFY_NIS_CONF is set to "yes". + +2006-05-13 Dan Williams + + * src/nm-device-802-3-ethernet.c + - (real_get_generic_capabilities): Don't ignore devices that can't do + carrier detect (Debian bug #366373) + +2006-05-11 Dan Williams + + Patch from Michael Biebl + * src/backends/NetworkManagerDebian.c + - Debian backend fixups + +2006-05-10 Robert Love + + * src/backends/NetworkManagerSuSE.c: Fix double free (Novell #173442). + +2006-05-09 Robert Love + + * gnome/applet/nm-gconf-wso-wpa-eap.c: Fix FIXME: Save the WPA EAP + private certificate passphrase, if any, in the GNOME Keyring. + * libnm-utils/dbus-helpers.c: Update. + +2006-05-05 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_set_wep_enc_key): convert to + nm_device_802_11_wireless_disable_encryption() since that's all + we use it for anymore; we don't ever set WEP keys ourselves. + - (real_deactivate_quickly): reset SSID and encryption keys + - (real_deactivate): move SSID and encryption key reset to + real_deactivate_quickly(), which gets run before us anyway + +2006-05-05 Robert Love + + * src/NetworkManager.c: Set the umask to 0022 when daemonizing, in case + root has a wacky default of its own (or, more common, a user has a + bad umask and uses su/sudo to restart NetworkManager). Anything + other than 0022 does not do what we want with, for example, + resolv.conf. This problem is amplified by our judicious use of + fopen(), which uses mode 0666 -- implying that the only way to get + the permissions we want is with a umask of 0022. + +2006-05-05 Dan Williams + + * gnome/libnm_glib/libnm_glib.c + - Don't suck CPU when dbus isn't around by scheduling idle handlers + to reconnect; instead wait a bit more with each reconnect attempt + up to a max of one minute. + +2006-05-04 Ryan Lortie + + * gnome/applet/passphrase-dialog.c (update_button_cb): Get the SSID of + the WirelessNetwork structure using the proper function instead of + just casting it directly to (const char *) (gnome.org #336991) + +2006-05-03 Robert Love + + * src/backends/NetworkManagerSuSE.c: Respect the variable + dhcp:DHCLIENT_MODIFY_RESOLV_CONF, not + config:MODIFY_RESOLV_CONF_DYNAMICALLY, when deciding whether or not + to dynamically update /etc/resolv.conf. + +2006-05-02 Peter Jones + + * vpn-daemons/vpnc/src/nm-vpnc-service.c: Allow rekeying. + +2006-05-02 Robert Love + + Patch by Timo Hoenig; + * tests/nm-online.c: Print pretty status indicator as timeout winds + down. Also fix possible race between DBUS startup and failure + return. + +2006-05-01 Robert Love + + * gnome/applet/applet-compat.c: Warn if the returned escaped ESSID is + empty, too. + +2006-04-27 Jeremy Katz + + * src/nm-device.c (discover_device_type): Actually use the hal + device type instead of ioctl poking + +2006-04-26 Robert Love + + * tests/nm-online.c: New file. Simple utility that returns exit status + noting whether the connection is offline or online. If offline on + start, it waits 30 seconds (or a command-line given value) for an + online signal. If it times out, it again returns offline. This is + useful for scripts that want to wait for network connections. + +2006-04-25 Robert Love + + * src/nm-ap-security-wep.c: Bug fix: We stopped setting the + key mode (the authentication algorithm), e.g. open or shared, when we + moved to using wpa_supplicant. wpa_supplicant defaults to open, so + only shared was broken. If the user specified a shared key, set it + explicitly, otherwise let wpa_supplicant go with the default. + +2006-04-24 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_set_essid): fix setting of "any" essid + +2006-04-24 Dan Williams + + Commit the async scanning patch + + * src/nm-device-802-11-wireless.c + - get rid of scan_mutex + - (wireless_event_helper): act on wireless scan events + - (real_start): schedule a pending scan + - (link_to_specific_ap): fake the link to the AP during a scan + - (nm_device_802_11_wireless_update_signal_strength): ignore signal + strength during scans + - (nm_device_get_frequency, nm_device_set_frequency, nm_device_get_bitrate, + nm_device_set_bitrate): unused with new scanning code, disable + - (nm_device_wireless_schedule_scan): removed + - (nm_device_wireless_process_scan_results): renamed to convert_scan_results() + - (request_and_convert_scan_results): new function; retrieve scan + results from the driver and schedule the processing function + - (scan_results_timeout): timeout triggered when card doesn't send + a scan results wireless event during a certain interval + - (schedule_scan_results_timeout): new function; schedule the scan + results timeout + - (cancel_scan_results_timeout): new function; cancel the scan + results timeout + - (nm_device_802_11_wireless_scan): if wpa_supplicant is running, ask it + to do the scanning. Otherwise, just request a scan but don't + grab results here; instead schedule a timeout for scan results and + let netlink notify us of scan completion events + - (nm_device_wireless_schedule_scan): new function; schedule a wireless scan + - (cancel_pending_scan): new function; cancel a pending wireless scan + - (supplicant_status_cb): ignore disconnect events while scanning + - (supplicant_exec): wait a bit longer for the supplicant to start up + - (nm_device_802_11_wireless_dispose): cancel pending scans and results + timeouts + - (get_scan_results): removed; folded into request_and_convert_scan_results() + +2006-04-24 Dan Williams + + * gnome/applet/applet-dbus.c + - Disable the pending call debug stuff, seems under control now + +2006-04-20 Robert Love + + Fix bug where hidden ESSID's would not show up in the applet, even + if NMI provided a BSSID -> ESSID mapping from Gconf. This occurred + because nm_policy_device_list_update_from_allowed_list() would merge + the data, putting a name to the hidden networks, but never notify NMI + of the changes. Simple fix is to invoke the function + nm_dbus_signal_wireless_network_change() if we make a mapping. + * src/NetworkManagerAPList.c: Call the function + nm_dbus_signal_wireless_network_change() if we made a successful + BSSID to ESSID mapping, notifying the applet of the "new" network. + * src/NetworkManagerAPList.h: Update the prototypes for both + nm_ap_list_copy_essids_by_address() and + nm_ap_list_copy_one_essid_by_address(). + +2006-04-20 Robert Love + + * gnome/applet/applet-dbus-info.c: Don't bail out if the timestamp is + not set. Just return zero. + +2006-04-20 Robert Love + + * gnome/vpn-properties/nm-vpn-properties.c: Satisfy TODO: Ensure that + only one copy of nm-vpn-properties is running at a time via the 'ol + X selection trick. This prevents the user from opening two "VPN + Connections" windows from within the applet, which leads to mass + hysteria. + * clipboard.c: New file, implementing simple X selection logic. + * clipboard.h: New file. + * gnome/vpn-properties/Makefile.am: Add clipboard.{c,h} + +2006-04-18 Nicolas Trangez + + * backends/NetworkManagerGentoo.c: Small cleanups and enhancements + * configure.in + initscript/Gentoo/Makefile.am + initscript/Gentoo/NetworkManagerDispatcher.in + - New script + * initscript/Gentoo/NetworkManager.in: small dependency fixup from + Gentopia + +2006-04-16 Dan Williams + + Patch from Paul Blazejowski + * configure.in + initscript/Slackware/Makefile.am + initscript/Slackware/rc.networkmanager-dispatcher.in + initscript/Slackware/rc.networkmanager.in + - Update slackware initscripts + +2006-04-10 Robert Love + + * gnome/vpn-properties/nm-vpn-properties.c: Intercept and short-circuit + the "delete_event" signal on the druid's parent window and handle it + our way, lest using the WM to close the druid results in a series of + bloody and ultimately lethal errors. + +2006-04-10 Robert Love + + * gnome/vpn-properties/nm-vpn-properties.c: Validate VPN settings on + 'Back' too or else the 'Forward' option is initially disabled despite + valid input. + +2006-04-06 Robert Love + + Fix bad but simple bug where an active modem connection did not update + NM's connection state, breaking any app that did online/offline: + * src/NetworkManagerMain.h: Add 'modem_active' member to NMData, + represented whether a dial up connection is active, or not. + * src/nm-dbus-nm.c: Set and unset 'modem_active' in response + to modem activation and deactivation. + * src/NetworkManagerDbus.c: When asked our state, do not return + disconnected if the modem is active. + +2006-04-04 Robert Love + + * gnome/applet/applet.c: Remove the 'Remove' option that I added to the + applet. It just confuses the crap out of people and does not make a + lot of sense, as the daemon still runs. + +2006-04-02 Tor Krill + + * initscript/Arch/networkmanager.in: Added checks for HAL and dhcdbd + in start of service. + * src/backends/NetworkManagerArch.c: (nm_system_get_mtu): Added to + get Archlinux backend up to date. + +2006-03-29 Robert Love + + Patch by Vinay R and Robert Love , + to add support for per-route MSS and improve support for per-interface + MTU: + * src/NetworkManagerSystem.c: Modify nm_system_device_set_ip4_route to + optionally take an MSS parameter and set it for the given route. + Remove nm_system_device_set_ip4_route_with_iface. Pass in the + NMIP4Config's stored MSS, if any. + * src/nm-ip4-config.c: Add 'mtu' and 'mss' to NMIP4Config, representing + the interface's MTU and the route's MSS, respectively. Add functions + nm_ip4_config_get_mtu, nm_ip4_config_set_mtu, nm_ip4_config_get_mss, + and nm_ip4_config_set_mss for retrieving and setting the MTU and the + MSS. + * src/nm-ip4-config.h: Add prototypes for nm_ip4_config_get_mtu, + nm_ip4_config_set_mtu, nm_ip4_config_get_mss, and + nm_ip4_config_set_mss. + * src/vpn-manager/nm-vpn-service.c: Modify to receive the MSS from the + VPN daemon. + * src/backends/NetworkManager{Arch,Debian,Gentoo,RedHat,Slackware,SUSE}.c: + Change the retval of nm_system_get_mtu to guint32. + * src/dhcp-manager/nm-dhcp-manager.c: Set the MTU on the new DHCP-given + NMIP4Config to the MTU provided by the system, if any. TODO: If DHCP + servers can specify MTU's, we should set it here if the MTU was not + provided. + +2006-03-27 Jürg Billeter + + * configure.in: + * initscript/Makefile.am: + * initscript/paldo/Makefile.am: + * initscript/paldo/NetworkManager.in: + * initscript/paldo/NetworkManagerDispatcher.in: + * src/backends/Makefile.am: + * src/backends/NetworkManagerPaldo.c: + - Add paldo support + +2006-03-27 Dan Williams + + Patch from Christian Persch + * gnome/applet/applet.glade + - HIG fixes; mostly for spacing and borders (gnome.org #336220) + +2006-03-27 Dan Williams + + Patch from Diffe + * src/backends/NetworkManagerSlackware.c + - Don't restart howl, since it's been replaced by Avahi + in most distributions + +2006-03-27 Dan Williams + + Patch from Tor Krill + * configure.in + initscript/Makefile.am + src/backends/Makefile.am + src/backends/NetworkManagerArch.c + initscript/Arch/Makefile.am + initscript/Arch/networkmanager-dispatcher.in + initscript/Arch/networkmanager.in + - Add Arch Linux support, fixes gnome.org #335147 + +2006-03-27 Dan Williams + + Patch from Diffe + * initscript/Slackware/rc.networkmanager + - update, fixed gnome.org #333368 + +2006-03-27 Robert Love + + * gnome/applet/other-network-dialog.c: Do not allow the user to try to + create WPA-EAP Ad-Hoc networks because such an action makes no sense. + +2006-03-27 Robert Love + + Patch by Jürg Billeter : + * src/nm-logging.c: Add printf modifier to fix warning on 64-bit + systems. + * src/nm-netlink-monitor.c: Include instead of + as we prefer glibc over kernel headers, if possible. + +2006-03-27 Robert Love + + Patch by Jon Escombe : + * gnome/applet/nm-gconf-wso.c: Add missing NM_AUTH_TYPE_WPA_EAP case. + * gnome/applet/nm-gconf-wso-wpa-eap.c: If retrieving the gconf values + fail, don't bail out. We don't expect all of the various WPA-EAP + values to be present. + * src/nm-ap-security.c: We need to match all capabilities for each + encryption type, not any one of them. + +2006-03-27 Robert Love + + * src/backends/NetworkManagerSuSE.c: Revert 2006-03-17 commit and again + restart, not reload, ypbind. Unfortunately there is no superior + solution. + +2006-03-24 Christopher Aillon + + * gnome/applet/applet-notifications.c: + When displaying a notification, make sure to get rid of the + previous notification so as to not have competing bubbles, + and stop leaking the old one. + + * gnome/applet/applet.c: + * gnome/applet/applet.h: + Add a new 'notification' member to the applet, and zero it out + and free it appropriately. + +2006-03-23 Robert Love + + Patch by j : + * gnome/applet/applet.glade: Don't set the invisible_char property, + which simply overrides the GTK default. By and by, this behavior + ought to be fixed in Glade. + +2006-03-22 Robert Love + + * src/dhcp-manager/nm-dhcp-manager.c: Bump timeout to 45 seconds. + +2006-03-22 Robert Love + + Bug fix by Timo Hoenig : + * gnome/applet/applet-dbus.c: Let the applet reconnect to DBUS on + disconnect. Otherwise, we have the daemon surviving DBUS restarts + and the applet going AWOL. + +2006-03-22 Robert Love + + * src/dhcp-manager/nm-dhcp-manager.c: Create NM_DHCP_TIMEOUT + preprocessor define and use it instead of open-coded the DHCP + timeout, which is currently 25 seconds, everywhere. + +2006-03-22 Robert Love + + Implement "Dynamic WEP", which is basically WPA authentication and WEP + key exchange via WPA, ostensibly providing good security without + requiring hardware that supports full WPA. Also, add UI elements to + allow the user to select the pairwise & group cipher for WPA Enterprise + networks, too: + * gnome/applet/applet.glade: Update glade file. + * gnome/applet/nm-gconf-wso-wpa-eap.c: Serialize and deserialize the + key type, too, to and from gconf. + * gnome/applet/wireless-security-option.c: Add "wpa_eap" parameter to + wso_wpa_create_key_type_model(), noting whether we are handling PSK + or EAP configuration, and in the latter case add in "Dynamic WEP" if + the capabilities match. + * gnome/applet/wso-private.h: Update wso_wpa_create_key_type_model()'s + prototype. + * gnome/applet/wso-wpa-eap.c: Manage UI elements for the key type and + serialize from UI to DBUS. + * gnome/applet/wso-wpa-psk.c: Cannot fail and always returns at least + one element. + * libnm-util/dbus-helpers.c: Update nmu_security_serialize_wpa_eap(), + nmu_security_serialize_wpa_eap_with_cipher(), and + nmu_security_deserialize_wpa_eap() to take a "key_type" parameter and + serialize/deserialize the key type via DBUS as the new third DBUS + parameter. + * libnm-util/dbus-helpers.h: Update prototypes. + * src/nm-ap-security-wpa-eap.c: Deserialize the key type from DBUS, + too. If the key type is WEP104, do Dynamic WEP, which means + "IEEE8021X" for "key_mgmt". Also add support for user-specified + pairwise and group ciphers (fixes a FIXME). + +2006-03-21 Robert Love + + * src/NetworkManagerSystem.c, src/NetworkManagerSystem.h: Add + nm_system_get_mtu(), which returns a user-provided or system-mandated + MTU value for a given device, if any, or zero if no such value + exists. Add nm_system_set_mtu() to set the MTU for a given device + if we have a provided value. + * src/nm-device.c: Set the MTU of devices. + * src/backends/NetworkManagerSuSE.c: Read MTU, if any, from sysconfig. + * src/backends/NetworkManagerDebian.c, + src/backends/NetworkManagerGentoo.c, + src/backends/NetworkManagerRedHat.c, + src/backends/NetworkManagerSlackware.c: Implement stub functions. + +2006-03-21 Robert Love + + * src/backends/NetworkManagerSuSE.c: Strip hypens from hex key in + configuration file. + +2006-03-17 Robert Love + + * src/backends/NetworkManagerSuSE.c: Do "rcypbind reload" to send the + signal SIGHUP to ypbind, not "rcypbind restart" to physically restart + it, in case it is not running in the first place. We just want its + configuration reloaded. Also, do not "rcypbind stop" on device down. + +2006-03-15 Robert Love + + * gnome/applet/applet.glade, gnome/applet/wso-wep-ascii.c, + gnome/applet/wso-wep-hex.c, gnome/applet/wso-wep-passphrase.c: The + label "WEP 40/128-bit" is inconsistent because the physical key size + is 40 or 104-bits, to which a 24-bit initialisation vector is + appended, forming a 64 or 128-bit traffic key. Thus, the label ought + to read "40/104" or "64/128". I do not care much which, but most + users think of "silver" and "gold" encryption as 64 and 128-bits, so + let's stick with that. Thus, s/"40/128"/"64/128"/g. Also, since our + WEP passphrase support only handles 128-bit keys, and any future + 64-bit passphrase support will require a new option (no way to auto- + detect the target key size), explicitly label our passphrase support + "WEP 128-bit Passphrase". + +2006-03-15 Robert Love + + * src/dhcp-manager/nm-dhcp-manager.c: Do not start dhcdbd, but rely on + the system init scripts (or some other mechanism) starting it (or a + compatible DBUS service) before NetworkManager runs. This means that + distributions might need to update their init scripts. This fixes + possible races and is quite a bit cleaner. + * initscript/SUSE/networkmanager.in: Update to start dhcdbd before + starting the NetworkManager daemon. + + +2006-03-14 Robert Love + + * src/backends/NetworkManagerSuSE.c: Check that we have a valid AP + before adding anything. + +2006-03-13 Robert Love + + * gnome/vpn-properties/nm-vpn-properties.c: Hide the next page's + widgets, too, if they exist, in case the user hit the back button. + Fixes a bug where the details page contains the widgets of multiple + VPN modules (Novell bug #157048). + +2006-03-13 Robert Love + + Patch by Timo Hoenig : + * dispatcher-daemon/NetworkManagerDispatcher.c: Let the dispatcher + daemon survive DBUS restarts, too. + +2006-03-10 Robert Love + + * gnome/applet/applet.glade: Add toggles to show/obfuscate the + passphrase or key. + * gnome/applet/wso-wep-ascii.c, gnome/applet/wso-wep-hex.c, + gnome/applet/wso-wep-passphrase.c, gnome/applet/wso-wpa-eap.c, + gnome/applet/wso-wpa-psk.c: Show and obfuscate passphrases and keys + in response to "toggled" signal on new toggle. + +2006-03-10 Robert Love + + * src/nm-ap-security-wpa-eap.c: Pass fake empty strings for + serialization if strings are NULL, lest DBUS get angry. + +2006-03-10 Robert Love + + * src/nm-ap-security-wpa-eap.c: Don't log the password. + +2006-03-09 Robert Love + + * src/backends/NetworkManagerSuSE.c: Read in WEP and WPA static + configurations. + +2006-03-09 Dan Williams + + Track pending call requests in the applet, and report how many are + outstanding, and how long each completed one takes. + + * gnome/applet/applet-dbus-devices.c + gnome/applet/applet-dbus-vpn.c + - Track pending calls + + * gnome/applet/applet-dbus.[ch] + - Remove some unused enums + - (nma_dbus_send_with_callback, nma_dbus_send_with_callback_replied): + new functions to track dbus pending calls and spit out some + statistics about them + +2006-03-09 Robert Love + + * src/NetworkManagerAP.c, src/NetworkManagerAP.h: Have the function + nm_ap_set_timestamp() take the second and micro-second parameters as + direct arguments, which avoids both a dynamic memory allocation and a + structure-to-structure copy! Add a new interface, the aptly named + nm_ap_set_timestamp_via_timestamp(), to set the timestamp from an + existing GTimeVal, as nm_ap_set_timestamp() once did, for use with + the return from nm_ap_get_timestamp(). New users should use the new + nm_ap_set_timestamp(), not nm_ap_set_timestamp_via_timestamp(), for + the extreme benefit to performance. + * src/NetworkManagerAPList.c, src/nm-dbus-nmi.c, + src/backends/NetworkManagerSuSE.c: Use the new functions as needed. + +2006-03-08 Robert Love + + * gnome/applet/applet.glade: Hide the password entry text with + asterisks. + +2006-03-08 Robert Love + + * src/NetworkManagerSystem.h, src/nm-device.c, NetworkManagerDebian.c, + NetworkManagerRedHat.c, NetworkManagerGentoo.c, + NetworkManagerSlackware.c: Pass nm_system_device_get_system_config() + a second argument, NMData. + * src/nm-ap-security.h, src/nm-ap-security.c: Export nm_ap_security_new. + * src/backends/NetworkManagerSuSE.c: Add wireless networks from ifcfg-* + config files as trusted. + +2006-03-06 Robert Love + + * gnome/applet/Makefile.am: Define AUTOSTARTDIR. + * gnome/applet/applet.c: Add 'Remove' option to the right click menu, + to exit the applet. As a sweet side-effect, idea courtesy of Chris + Rivera, detect if the applet was auto-started. If so, ask the user + if he or she would like to stop automatically running the applet on + login. If so, disable autostart. + +2006-03-06 Robert Love + + * NetworkManager.pc.in: Provide an -I to the NetworkManager include + directory in CFLAGS so developers can actually use NetworkManager.h. + +2006-03-06 Robert Love + + * src/dhcp-manager/nm-dhcp-manager.c: Use preprocessor defines and not + open-coded integer constants. Add state_to_string() to map a given + state to a textual description, and provide that when notifying of + state change. + * src/dhcp-manager/nm-dhcp-manager.h: Provide defines for the dhcdbd + states, copied and cleaned up from dhcdbd.d. Ideally, we would use + this header directly, but it is currently not installed on most + systems. + +2006-03-05 Dan Williams + + Process netlink messages in device subclasses rather than in + NetworkManager.c. Also add support for recognizing Wireless Events. + + * configure.in + - Find GLIB_GENMARSHAL + + * src/Makefile.am + - Since we're marshalling custom types for wireless event signals, + we get to create our own marshallers using GLIB_GENMARSHAL + + * src/NetworkManager.c + - (nm_monitor_wired_link_state): renamed to nm_monitor_setup + - (nm_monitor_setup): renamed from nm_monitor_wired_link_state, and + cut down somewhat. We no longer process signals here. + - (nm_data_new): create the netlink monitor here, and remove a + useless call to nm_policy_schedule_device_change_check() + - (nm_data_free): get rid of the netlink monitor here + - (nm_device_link_activated, nm_device_link_deactivated): removed + - (main): don't create the netlink monitor here, let nm_data_new + do that. Call nm_policy_schedule_device_change_check() right + before we jump to the mainloop to figure out which device + to use first + + * src/NetworkManagerSystem.[ch] + - (nm_system_get_rtnl_index_from_iface, nm_system_get_iface_from_rtnl_index): + convert back and forth from interface names to interface + indexes + + * src/nm-device-802-11-wireless.c + - (real_init): connect to wireless-event signals from the netlink + monitor object + - (nm_device_802_11_wireless_event): new function, schedule handler + for wireless event signals from the netlink monitor object. We + want the handler to run in the device's context + - (wireless_event_helper): handle wireless-event signals from netlink + - (nm_device_802_11_wireless_dispose): disconnect wireless-event + signal handler + + * src/nm-device-802-11-wireless.h + - remove unused prototype for nm_device_802_11_wireless_new + + * src/nm-device-802-3-ethernet.c + - (real_init): new function; set up signal handlers for link events + - (nm_device_802_3_ethernet_link_activated): new function, schedule + handler for netlink link activated events on device's main loop + - (link_activated_helper): when we get a link activated event, set + the device's link to be active + - (nm_device_802_3_ethernet_link_deactivated): new function; schedule + handler for netlink link deactivated events on device's main loop + - (link_deactivated_helper): when we get a link deactivated event, set + the device's link to be inactive + - (nm_device_802_3_ethernet_dispose): disconnect signal handler on + dispose + + * src/nm-device-802-3-ethernet.h + - remove unused prototype for nm_device_802_3_ethernet_new + + * src/nm-device.[ch] + - (nm_get_device_by_iface_locked): variant of nm_get_device_by_iface + but locks the device list + - (nm_device_set_active_link): a little bit of cleanup and de-indenting + + * src/nm-netlink-monitor.[ch] + - (nm_netlink_monitor_class_install_signals): New signal + "wireless-event" + - (nm_netlink_monitor_new): keep reference to NMData so we can get + at the device list + - (nm_netlink_monitor_event_handler): expand for wireless events too + + * src/nm-marshal-main.c + - Include generated nm-marshal.c and nm-marshal.h + + * src/nm-marshal.list + - List of custom marshal functions + +2006-03-05 Dan Williams + + * gnome/applet/applet-notifications.h + - Protect prototype of nma_send_event_notification() because it + includes libnotify-specific types + - Include libnotify/libnotify.h too, since we technically need it + + * gnome/applet/applet.c + - (nma_show_vpn_failure_dialog): fix usage of g_return_if_fail + - (nma_show_vpn_login_banner_dialog): add some error checking + +2006-03-04 Dan Williams + + Clean up activation cancellation. Should be a lot faster now. Observed + an issue with wireless devices between stage 2 and 3 of activation, where + activation would be cancelled, but the device thread wouldn't notice until + the supplicant association timed out. Reorganize activation such that + a cancellation handler gets immediately scheduled in the device's thread, + and devices have a chance to perform any custom cleanup too. + + * src/nm-device.[ch] + - (activation_cancel_handler): new device-type-specific function + for cleaning up device-type-specific stuff on cancellation + - (cancel_activation): removed + - (nm_device_activation_cancel): subsume functionality of + real_cancel_activation, but instead of doing anything, punt + operation to a handler that's run in device-thread context + - (nm_device_schedule_activation_handle_cancel): fix spelling of + a warning message + - (activation_handle_cancel_helper): cancellation handler run in + device-thread context, calls device-type-specific cancelation, + then tears down the activation request + - (real_activation_cancel_handler): generic cancellation handler, + deals with cancelling any in-process DHCP request + - (nm_device_activate_stage1_device_prepare, + nm_device_activate_stage2_device_config, + nm_device_activate_stage3_ip_config_start, + nm_device_activate_stage4_ip_config_get, + nm_device_activate_stage4_ip_config_timeout, + nm_device_activate_stage5_ip_commit): don't call + nm_device_schedule_activation_handle_cancel() any more, since + cancellation will have been already scheduled for us by + nm_device_activation_cancel(). Just exit the function and + assume that the cancel handler will be called next. + + * src/nm-device-802-3-ethernet.c + - (real_act_stage2_config): remove; didn't do anything anyway + + * src/nm-device-802-11-wireless.c + - (supplicant_status_cb): ensure we don't do anything if the activation + got cancelled + - (real_activation_cancel_handler): implement; cancel user key request + on activation cancellation + +2006-03-04 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_send_network_config): assume that drivers that don't + support WPA pretty much suck, and can't handle NM scanning + along with wpa_supplicant. + +2006-03-03 Robert Love + + * configure.in: Bump version to 0.6.0. + * NEWS: Update. + +2006-03-03 Robert Love + + * configure.in: Require DBUS 0.60 or later. + +2006-03-03 Dan Williams + + Fix a crash if an "Other wireless network" was chosen, failed, then + chosen again from the applet's menu. If the other network wasn't + noticed in a scan, it wouldn't have any capabilities, but would still + be listed because the user forced the network. To fix this, we set + sensible capabilities on the forced network, which will get overwritten + with the correct ones if the network shows up later in a scan. + + * src/nm-ap-security.h + - Add a new "get_default_capabilities_func" member to the + NMAPSecurity class + + * src/nm-ap-security.c + - (nm_ap_security_get_default_capabilities): new function + + * src/nm-ap-security.c + src/nm-ap-security-wep.c + src/nm-ap-security-wpa-psk.c + src/nm-ap-security-wpa-eap.c + - Implement get_default_capabilities_func() for all, which + uses the information contained in a specific NMAPSecurity + object to determine default AP capabilites necessary + to support that object + + As a secondary measure, we now prune artificial access points that fail + to be activated right away. The thing failed, and we have no scan data for + it, so it's pretty much useless since security information is only saved + in the applets when a connection is successful. + + * src/NetworkManagerAPList.c + - (nm_ap_list_merge_scanned_ap): mark any ap noticed in a scan + not artificial. If we see it, it's no longer a figment of the + user's imagination :) + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_failed): send along the failed AP if we + have it + + * src/nm-device-802-11-wireless.c + - (real_activation_failure_handler): remove artificial APs from + the device list, because activation failed + +2006-03-02 Robert Love + + Add support for retrieving both the per-device speed and the + per-network maximum supported rate. Then change the getProperties + DBUS API for both networks and devices to report this informaiton. + Finally, display the information via both nm-applet and nm-tool: + * gnome/applet/applet-dbus-devices.c: Grab the speed from getProperties + and set it. + * gnome/applet/applet.c: Display the device's speed in the 'Connection + Information' dialog. + * gnome/applet/applet.glade: Update the UI to show per-device speed. + * gnome/applet/nm-device.c, gnome/applet/nm-device.h: Add interfaces + network_device_get_speed() and network_device_set_speed() for + retrieving and setting, respectively, a network device's current + speed. + * src/nm-dbus-device.c: Send the device's speed on getProperties. + * src/nm-device-802-11-wireless.c: Return the rate in Mb/s, not Kb/s, + in the function nm_device_802_11_wireless_get_bitrate() -- it does + not matter (yet) what the units are, because we only feed it its own + output. Implement SIOCGIRATE and set the per-network maximum + supported rate during scanning. + * src/nm-device-802-11-wireless.h: Export the function + nm_device_802_11_wireless_get_bitrate(). + * src/nm-device-802-3-ethernet.c, src/nm-device-802-3-ethernet.h: Add + function nm_device_802_3_ethernet_get_speed() for returning an + 802.3's current speed, in Mb/s. + * test/nm-tool.c: Display the per-device current speed, if available, + and the per-network maximum rate. + +2006-03-02 Dan Williams + + * src/nm-device-802-11-wireless.c + - (nm_device_802_11_wireless_set_scan_interval): don't scan-spam the + card when it gets initialized. Since devices don't get added to + the scan list until they are initialized, this function wasn't + setting the intitial scan interval correctly, and was leaving + it at 0. This caused cards to get many scan requests in a short + amount of time when they were initialized + +2006-03-02 Robert Love + + * gnome/applet/applet.c: Do not set the pixbuf if we don't have an + active device. But do not do what we used to do and override the + state, which caused the dreaded icon race of '05. + +2006-03-02 Robert Love + + Commit Dan's update of my previous commit: + * src/nm-device-802-11-wireless.c: Always set the mode, because the + set_mode() function itself does the check. But do only set the + frequency if in Ad-Hoc mode. + +2006-03-02 Robert Love + + Patch by Brian Magnuson : + * src/nm-device-802-11-wireless.c: During scanning, only set the + wireless mode to infrastructure if it is not currently in + infrastructure mode. For some driver, setting the mode is a costly + operation, apparently. + +2006-03-01 Rodrigo Moya + + * Makefile.am: use the correct dir for autostart mechanism. + +2006-02-28 Dan Williams + + Patch from Brian Magnuson + * gnome/applet/applet.c + - (nma_show_vpn_failure_dialog): fix errors left over from + libnotify support changes + +2006-02-28 Dan Williams + + * src/vpn-manager/nm-vpn-act-request.[ch] + - (nm_vpn_act_request_is_activated): don't use a switch/case for + just one value + - (nm_vpn_act_request_is_failed): new function; return whether or + not the vpn activation request has failed + + * src/vpn-manager/nm-vpn-manager.c + - (nm_vpn_manager_deactivate_vpn_connection): tell the vpn service + daemon to kill the connection when the activation request fails. + Fixes issue where NM would get confused if the VPN activation + request timed out, and would not allow further VPN connections + on that service. + +2006-02-28 Dan Williams + + * gnome/applet/applet.c + - (nma_menu_add_vpn_menu): until the NM VPN manager can deal with + overlapping connection requests, disable all VPN menu items + but the active VPN connection + +2006-02-28 Dan Williams + + * src/vpn-manager/nm-vpn-connection.c + - (nm_vpn_connection_set_parent_device): fix C&P error which + called g_object_unref() on the connection's parent device + when it should have been ref-ed instead. Fixes crash with + repeated vpn connect requests + +2006-02-28 Christopher Aillon + + * gnome/applet/applet.glade: + Mark a few strings non-translatable, since they shouldn't be. + +2006-02-28 Dan Williams + + * src/vpn-manager/nm-vpn-service.c + - (nm_vpn_service_start_connection): if the vpn service daemon is + already running, don't blindly ask it to connect, but wait until + it's in the STOPPED state first. Fixes an assertion when user + starts a second vpn connection without stopping the first. + - (nm_vpn_service_stage2_daemon_wait): ensure the vpn service's + dbus service exists before continuing with the connection + process, and reduce latency while waiting for it to become + available + - (nm_vpn_service_schedule_stage2_daemon_wait): reduce latency + waiting for the vpn service daemon to become available + - General log message cleanups; show progress via "Stage x of 4" + rather than not telling anyone how many stages there are + +2006-02-28 Robert Love + + * src/NetworkManagerSystem.h: Add nm_system_should_modify_resolv_conf. + * src/backends/NetworkManagerSuSE.c: Implement the interface + nm_system_should_modify_resolv_conf() for SUSE. + * src/backends/NetworkManagerDebian.c, + src/backends/NetworkManagerGentoo.c, + src/backends/NetworkManagerRedHat.c, + src/backends/NetworkManagerSlackware.c: Add stub. + * src/named-manager/Makefile.am: Grab includes from src. + * src/named-manager/nm-named-manager.c: Allow backends to disable the + automatic updating of resolv.conf. This is useful for testing, + broken static configurations, and administrator lock-down. + +2006-02-28 Dan Williams + + * src/nm-device-802-11-wireless.c + - Move all the wpa_supplicant-related management stuff into its + own struct, just for oranization's sake + - (supplicant_exec): when exec-ing wpa_supplicant, connect its stdout + to a GIOChannel/GSource + - (supplicant_log_stdout): new function; grab output from the + wpa_supplicant stdout pipe and write it to our logs. + +2006-02-27 Christopher Aillon + + * src/nm-device-802-11-wireless.c: + Err, fix thinko in my previous commit. + +2006-02-28 Robert Love + + * gnome/applet/wso-wpa-eap.c: Fix misc. FIXME statements. + +2006-02-28 Robert Love + + * libnm-util/dbus-helpers.c, src/nm-ap-security-wpa-eap.c, + src/nm-ap-security-wpa-psk.c, gnome/applet/nm-gconf-wso-wpa-eap.c, + gnome/applet/nm-gconf-wso-wpa-eap.c: Fix FIXMEs: Callers of the DBUS + deserializers are responsible for freeing the returned DBUS strings. + +2006-02-27 Christopher Aillon + + * src/nm-device-802-11-wireless.c: + The scan list is being pruned prematurely. We should prune after + the device has gone MIA for three scans, not one. Split out the + interval to realtime seconds function to better serve this. + +2006-02-27 Robert Love + + * dispatcher-daemon/NetworkManagerDispatcher.c, src/NetworkManager.c: + Open the pid file O_TRUNC, so if it already exists we truncate it to + zero length. Also, be more verbose about warnings generated during + writing out the pid file. Finally, always write out the pid file if + in daemon mode. Use "--pid-file" to override the default. + +2006-02-27 Robert Love + + Patch by R. Vinay : + * gnome/vpn-properties/nm-vpn-properties.c: Remove the gconf key + 'last_attempt_success' when removing a VPN connection, too. (Fixes + Novell bug #153628). + +2006-02-27 Robert Love + + * gnome/applet/applet.glade: Set "activates_default" on passphrase + entry so user can hit after entering passphrase (Novell bug + #153738). + +2006-02-27 Dan Williams + + * gnome/applet/* + - Mass search/replace of: + nmwa -> nma + NMWirelessApplet -> NMApplet + NM_*_WIRELESS_APPLET -> NM_*_APPLET + (it ain't just for wireless anymore, ma!) + - Fix duplicate function name printing when using nm_warning + - wireless-applet.glade -> applet.glade + +2006-02-27 Dan Williams + + * dispatcher-daemon/NetworkManagerDispatcher.c + - Accept --pid-file with a path to a pidfile, write it out on + startup, and delete it on shutdown + + * src/NetworkManager.c + - Accept --pid-file with a path to a pidfile, write it out on + startup, and delete it on shutdown + - Move nm_print_usage() lower + + * initscripts/RedHat/NetworkManager.in + - Use new --pid-file option + - Fix service stopping to wait a bit for NM to quit + + * initscripts/RedHat/NetworkManagerDispatcher.in + - Use new --pid-file option + +2006-02-26 Dan Williams + + * src/Makefile.am + - make and install nm-crash-logger + + * src/nm-logging.[ch] + - New files; consolidate logging and crash handling + + * src/nm-crash-logger.c + src/gdb-cmd + - Standalong crashlogger for NM, grab a backtrace + using GDB + + * src/NetworkManager.[ch] + - Remove signal handling and put it into nm-logging.c + +2006-02-26 Dan Williams + + * configure.in + gnome/applet/Makefile.am + - Conditionalize all the notify stuff + + Merge most of Chris Aillon's notification patch: + + * gnome/applet/applet-notifications.[ch] + - New files; show a notification + + * gnome/applet/applet-dbus-devices.[ch] + - (nmwa_dbus_device_activated, nmwa_dbus_device_activated_cb, + nmwa_dbus_device_deactivated, nmwa_dbus_device_deactivated_cb): + new functions, do the right thing when a device change occurs + + * gnome/applet/applet-dbus.c + - (nmwa_dbus_filter): Split out DeviceNowActive and DeviceNoLongerActive + signals, so we can handle them specially + + * gnome/applet/applet.[ch] + - nmwa_schedule_vpn_login_banner -> nmwa_show_vpn_login_banner + - nmwa_schedule_vpn_failure_alert -> nmwa_show_vpn_failure_alert + - (nmwa_notify_state): remove + - (nmwa_update_state); remove call to nmwa_notify_state, since the + notification work is now done when the appropriate dbus signals + are received. + - (nmwa_show_vpn_login_banner, nmwa_show_vpn_failure_alert): don't + defer execution of the notification/dialog stuff. That was an + artifact of the previous multi-threaded nature of the applet + and is now pointless. + - (nmwa_notify_vpn_failure, nmwa_notify_vpn_login_banner): remove, + no longer needed. Function folded into applet-notifications.c + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): send the AP along with the device + status change signal, if the connection is wireless. Should + fix the race where applet would show a connection to "unknown" + +2006-02-25 Robert Love + + Add WPA Enterprise support: + * gnome/applet/Makefile.am: Build the files nm-gconf-wso-wpa-eap.c and + nm-gconf-wso-wpa-eap.h. + * gnome/applet/nm-gconf-wso-wpa-eap.c, + gnome/applet/nm-gconf-wso-wpa-eap.h: Add WPA Enterprise Gconf + serialization and deserialization. + * gnome/applet/nm-gconf-wso-wpa-psk.c, gnome/applet/nm-gconf-wso.c, + gnome/applet/wireless-security-option.c, gnome/applet/wso-wpa-psk.c, + gnome/applet/wso-wpa-psk.h: Clean up, support new defines. + * gnome/applet/wireless-applet.glade: Add UI for configurating security + settings related to WPA Enterprise. + * gnome/applet/wireless-security-manager.c: Invoke wso_wpa_eap_new() to + instantiate WPA Enterprise wireless-security-option. + * gnome/applet/wso-wpa-eap.c, gnome/applet/wso-wpa-eap.h: New files. + Implement WPA Enterprise wireless-security-option object. + * include/NetworkManager.h: Add new NM_AUTH_TYPE_* and NM_EAP_METHOD_* + defines. Cleanup. + * libnm-util/cipher-wpa-psk-hex.c, + libnm-util/cipher-wpa-psk-passphrase.c: Cleanup. + * libnm-util/dbus-helpers.c, libnm-util/dbus-helpers.h: Add + nmu_security_serialize_wpa_eap() to serialize input to DBUS method, + nmu_security_serialize_wpa_eap_with_cipher() to serialize input + including the cipher to DBUS method, and + nmu_security_deserialize_wpa_eap() to deserialize from DBUS return + to output. + * src/Makefile.am: Build the files nm-ap-security-wpa-eap.c and + nm-ap-security-wpa-eap.h + * src/NetworkManagerAP.c: Add NM_AUTH_TYPE_WPA_EAP to + NM_802_11_CAP_KEY_MGMT_802_1X cipher to capability mapping. + * src/nm-ap-security-wpa-eap.c, src/nm-ap-security-wpa-eap.h: New + files. Implement NMAPSecurityWPA_EAP object. + * src/nm-ap-security-wpa-psk.c: Cleanup. + * src/nm-ap-security.c: Support NM_AUTH_TYPE_EAP cipher and instantiate + an NMAPSecurityWPA_EAP object via the method + nm_ap_security_wpa_eap_new_deserialize(). + * src/nm-dbus-nm.c: Cleanup. + * test/nm-tool.c: Display "Enterprise" for wireless networks providing + WPA Enterprise support. + +2006-02-24 Robert Love + + Patch from Timo Hoenig : + * src/NetworkManagerDbus.c: Survive DBUS restarts like a champ. + +2006-02-24 Robert Love + + Patch from Dan Winship : + * gnome/applet/eggtrayicon.c: Update EggTrayIcon code. Set the gdk + area to transparent. + +2006-02-21 Dan Williams + + * gnome/applet/applet.[ch] + gnome/applet/applet-dbus.c + - Implement notification support for VPN messages too + +2006-02-21 Dan Williams + + * gnome/applet/applet-dbus-info.c + - Clean up warning messages to not double-print the function + +2006-02-21 Dan Williams + + * gnome/applet/applet-compat.c + - (convert_one_entry): accept entries without a key_type and + convert them to unencrypted networks + +2006-02-21 Dan Williams + + * gnome/libnm_glib/libnm_glib.c + - Use __func__ everywhere we can + - Code cleanups + - Use dbus pending calls rather than blocking + - Reduce busywaits for our thread to start and stop + (gnome.org #330562) + - (libnm_glib_dbus_init): Use dbus_bus_get_private() so we don't + stomp on others using the default shared dbus connection. + Fixes #rh177546# and gnome.org #326572 + +2006-02-21 Dan Williams + + Patch from Rodney Dawes + * configure.in + gnome/applet/Makefile.am + gnome/applet/applet.c + - Add libnotify support if '--enable-notify=yes' is passed + at configure time + +2006-02-16 Kang Jeong-Hee + + * configure.in (ALL_LINGUAS): ko added. (Korean) + +2006-02-15 Robert Love + + * src/nm-device-802-11-wireless.c: Use LOCALSTATEDIR preprocessor + define, not an open-coded "/var", for WPA_SUPPLICANT_GLOBAL_SOCKET + and WPA_SUPPLICANT_CONTROL_SOCKET. + +2006-02-15 Robert Love + + * src/nm-device-802-11-wireless.c, src/nm-device.c: When printing debug + information about what connection stage we are at, provide the total + number of stages, e.g. "Stage 2 of 5", so users know how far along + they are if they experience problems. + +2006-02-15 Robert Love + + * gnome/vpn-properties/Makefile.am: Define SYSCONFDIR preprocessor + define to $sysconfdir. + * gnome/vpn-properties/nm-vpn-properties.c: Make sure we hide the VPN + editing dialog, vpn_edit_widget, which fixes a bug where editing one + type of VPN and then editing another results in a mangled dialog + box containing the widgets from both VPNs (fixes Novell #150854). + Also, some misc. cleanup and use SYSCONFDIR not open coded directory. + +2006-02-14 Robert Love + + * src/NetworkManager.c: Call closelog() on daemon shutdown to close + syslog's file descriptor. + +2006-02-14 Robert Love + + Fix bug around since the change to "deal with APs changing settings on + us," checked in on the fifth of February in the year of the dog, + wherein connecting to non-broadcast encrypted networks always fails + because nm_ap_get_encrypted() always returns FALSE, even when the user + provided a key, because the newly-created fake AP does not have any + capabilities set, which is a sypmtom of security settings not matching + capabilities (Novell bug #150784): + * src/NetworkManagerAP.c, src/NetworkManagerAP.h: Add new interface, + nm_ap_add_capabilities_from_security(), which sets the given AP's + capabilities off the given security settings. Also improve our + handling of capabilities w.r.t. NM_802_11_CAP_PROTO_NONE and + NM_AUTH_CIPHER_AUTO. + * src/nm-device-802-11-wireless.c: Call the function + nm_ap_add_capabilities_from_security() to ensure that capabilities + match newly updated security settings. + +2006-02-14 Robert Love + + * src/nm-device-802-11-wireless.c: Clean up nm_warning calls: Print the + error as a string, not an integer, if possible; do not print the + function name twice; always give the interface, if possible; misc. + cleanup. + +2006-02-12 Dan Williams + + Patch from Tom Parker + * src/NetworkManagerSystem.h + - Remove prototype for nm_system_device_setup_static_ip4_config(), + no longer used + + * src/backends/NetworkManagerDebian.c + - Remove some dead code (nm_system_device_setup_static_ip4_config) and + unused variables + +2006-02-12 Dan Williams + + * vpn-daemons/openvpn/intltool-extract.in + vpn-daemons/openvpn/intltool-merge.in + vpn-daemons/openvpn/intltool-update.in + vpn-daemons/pptp/intltool-extract.in + vpn-daemons/pptp/intltool-merge.in + vpn-daemons/pptp/intltool-update.in + - Remove from CVS, they should get created by intltoolize, + shouldn't they? + +2006-02-12 Dan Williams + + * vpn-daemons/pptp/src/pppd/patchlevel.h + * vpn-daemons/pptp/src/nm-pptp-service-pppd-plugin.c + - Rename VERSION -> PPPD_VERSION to avoid conflict with the + Makefile-defined VERSION + +2006-02-09 Dan Williams + + Patch from: Vinay A R + * src/vpn-manager/nm-vpn-act-request.[ch] + - Added 'routes' and 'routes_count' to struct NMVPNActRequest since + IPSec VPNs require them for std gateway. + - (nm_vpn_act_request_new): takes arguments for 'user_routes' + and 'user_routes_count' + - (nm_vpn_act_request_get_user_routes): new function; gets user + defined routes from NMVPNActRequest object, returns the string + array of routes. + + * src/vpn-manager/nm-vpn-manager.[ch] + - (nm_vpn_manager_activate_vpn_connection): take additional arguments + for 'user_routes' and 'user_routes_count' + + * src/vpn-manager/nm-dbus-vpn.c + - (nm_dbus_vpn_activate_connection): gets 'user_routes' from + nm_dbus_vpn_get_routes() to pass to nm_vpn_manager_activate_vpn_connection() + + * src/vpn-manager/nm-vpn-service.c + - (nm_vpn_service_stage3_connect): pass user routes over dbus to + the vpn daemon + + Modifications by Dan: + * src/vpn-manager/nm-vpn-service.c + - (nm_vpn_service_stage3_connect): ensure that we don't pass NULL string + arrays into dbus + + * vpn-daemons/vpnc/src/nm-vpnc-service.c + * vpn-daemons/pptp/src/nm-pptp-service.c + * vpn-daemons/openvpn/src/nm-openvpn-service.c + - Grab user routes from dbus message + - Free all string arrays we got from dbus + +2006-02-07 Robert Love + + Patch by Stefan Seyfried : + * libnm-util/cipher.c: Fix off-by-one error in cipher_bin2hexstr. + +2006-02-06 Robert Love + + * src/nm-device-802-11-wireless.c: Fix leak in supplicant_status_cb(). + +2006-02-06 Robert Love + + * src/NetworkManagerUtils.c: kill_newline(): 'l' is unsigned so the + test ">=" is never false. If no newline is found, we loop forever. + We can just check for ">" because the following if() will see the + zero-th argument if the while() gets that far. + +2006-02-05 Dan Williams + + Refine handling of non-broadcast networks. + + * src/NetworkManagerAPList.c + - (nm_ap_list_merge_scanned_ap): unconditionally copy the 'broadcast' + property from scanned AP to the AP from the device list + + * src/nm-device-802-11-wireless.c + - (supplicant_send_network_config): use ap_scan=1 for all networks + except non-SSID-broadcasting and Ad-Hoc networks. Use + ap_scan=2 for those. Also, don't set scan_ssid for Ad-Hoc + networks since those don't have APs. + - (add_new_ap_to_device_list): if there's no valid SSID, mark the + AP as non-SSID-broadcasting + - (process_scan_results): don't handle non-SSID-broadcasting here + +2006-02-05 Dan Williams + + * src/nm-device-802-11-wireless.c + - (get_supplicant_timeout): new function; return + NM_SUPPLICANT_TIMEOUT * 2 for cards that support more than + 14 channels. These are likely a/b/g cards, like Atheros, and + slow as hell to scan. + - (supplicant_timeout_cb, supplicant_monitor_start): use + get_supplicant_timeout() + +2006-02-05 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - Loose a commit race with Robert; make sure size check + uses size of DHCP_SERVICE_LEN, not hardcoded 15 + +2006-02-05 Robert Love + + Patch by Christoph Brill : + * src/dhcp-manager/nm-dhcp-manager.c: Replace two open coded defines + with DHCP_SERVICE_NAME. + +2006-02-05 Dan Williams + + Remove anything having to do with device_setup_func from the + AP security objects, since it's no longer used. + + * src/nm-ap-security.h + - Kill device_setup_func and nm_ap_security_device_setup() + + * src/nm-ap-security-wep.c + src/nm-ap-security-wpa-psk.c + - (real_device_setup): remove + + * src/nm-ap-security.c + - (real_device_setup): remove + - (nm_ap_security_device_setup): remove + + * src/nm-device-802-11-wireless.[ch] + - (nm_device_802_11_wireless_set_wep_enc_key): make static + - (set_wireless_config, wireless_configure_adhoc): remove; unused + and done by wpa_supplicant now anyway + +2006-02-05 Dan Williams + + * src/nm-device-802-11-wireless.c + - (ap_need_key, real_act_stage2_config): deal with APs changing + settings on us. Previously NM would loop asking for the + key but getting the same one back. Now, if the NMI-supplied + cipher doesn't overlap with the scanned AP capabilities, + we request a completely new key from the user. + +2006-02-05 Dan Williams + + * src/NetworkManagerUtils.c + - (nm_utils_supplicant_request_with_check, nm_utils_supplicant_request): + Handle newline killing better + +2006-02-05 Dan Williams + + * gnome/applet/nm-gconf-wso.c + - (real_serialize_dbus): return TRUE, not 0. Fixes serialization + of unencrypted access point security info. + +2006-02-03 Robert Love + + * src/NetworkManagerUtils.c: Even for debugging, we should not log the + user's encryption key, so we print the err_msg_cmd not the command, + if available. So long as SUPPLICANT_DEBUG is default, this makes + sense. + +2006-02-03 Christopher Aillon + + * initscript/RedHat/NetworkManagerDispatcher.in: + * initscript/RedHat/NetworkManager.in: modify the pidfile location + Patch from Dan Walsh + +2006-02-03 Robert Love + + * dispatcher-daemon/NetworkManagerDispatcher.c, + dispatcher-daemon/Makefile.am: Don't hardcode the location of /etc + but use the sysconfdir. + +2006-02-03 Robert Love + + * src/nm-device-802-11-wireless.c, src/nm-device-802-11-wireless.h: + Make nm_device_802_11_wireless_get_essid() return 'const char *' not + 'char *'. + * src/nm-ip4-config.c, src/nm-ip4-config.h: Make the functions + nm_ip4_config_get_hostname() and + nm_ip4_config_get_nis_domain() return 'const char *' not 'char *'. + * src/backends/NetworkManagerSuSE.c: Fix up for above. Also, do not + leak g_strdup() result. + +2006-02-03 Robert Love + + * src/NetworkManagerAP.c: In nm_ap_new(), default new networks to + broadcast == TRUE. Also, copy broadcast and artificial properties + from source network to destination in nm_ap_copy(). + * src/nm-device-802-11-wireless.c: Don't set broadcast flag to TRUE, + since we now default new networks to non-hidden. + +2006-02-03 Dan Williams + + * gnome/applet/main.c + - (main): change the NEVER->ALWAYS so we start at the + beginning of the session, if being session-managed + +2006-02-03 Dan Williams + + * gnome/applet/main.c + - (main): in a variation on Robert's patch, change + RESTART_IMMEDIATELY -> RESTART_NEVER. Should do what + he wants. + +2006-02-02 Robert Love + + * src/Makefile.am: If we aren't going to create the run directory at, + uh, run-time, create it during install. Then users just doing + 'make install' are cool, too. While we are here, create the + dispatcher.d directory, too. + * src/nm-device-802-11-wireless.c: Let the Makefile define and pass in + the exact run directory. + * Makefile.am: Install nm-applet.desktop. + +2006-02-02 Robert Love + + * src/NetworkManagerAP.c: Add 'broadcast' property to the NMAccessPoint + structure, which denotes whether or not the AP is hidden. This is a + superset of 'artificial' -- we need 'broadcast' because a hidden AP + can show up in the scan list. Add nm_ap_get_broadcast() and + nm_ap_set_broadcast() accessor interfaces. + * src/NetworkManagerAP.h: Add prototypes for nm_ap_get_broadcast() and + nm_ap_set_broadcast(). + * src/nm-dbus-net.c: Add new argument, boolean broadcast, to the + "getProperties" method, which denotes whether or not the given + network is hidden. + * src/nm-device-802-11-wireless.c: Set broadcast to FALSE when creating + an artificial network. Set broadcast to TRUE when scanning returns + an ESSID and FALSE when not. + * gnome/applet/applet-dbus-devices.c: Retrieve 'broadcast' argument + from "getProperties" method on a network. Possible TODO is to + somehow display this. + * test/nm-tool.c: Display "Hidden" if the AP does not broadcast. + +2006-02-02 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_interface_init): don't try to create + /var/run/NetworkManager, since that should be done by + the distro package. Causes problems for stuff like SELinux + +2006-02-02 Robert Love + + Patch by Sureshkumar T : + * src/vpn-manager/nm-vpn-connection.c, src/NetworkManagerSystem.c: + Check for and handle empty string for iface. + +2006-02-01 Robert Love + + * configure.in, man/nm-tool.1.in, man/Makefile.am: Add nm-tool(1) + manpage. + +2006-01-31 Dan Williams + + * nm-applet.desktop + - Add --sm-disable to Exec arguments, presuming that when + using autostart, we don't want session management + +2006-01-31 Robert Love + + * src/NetworkManagerAP.c: Add two new manufacturer default network + names: linksys-a and linksys-g. These are found (at least) on the + Linksys WAP55AG, which does both 802.11a and 802.11b, each with their + own ESSID. + +2006-01-31 Robert Love + + * src/NetworkManagerAP.c: Optimize the function + nm_ap_has_manufacturer_default_essid(). I did not like its resulting + machine code. This is the first in a series of code tweaks aiming to + generate better machine code and make NetworkManager all the better. + Just kidding. Who has time to go through the assembly generated for + every function? I certainly don't. I have a wife, a kid, a job, + a mortgage, a mistress. But this function was so bad, I was called + to arms. Like the book. + +2006-01-31 Robert Love + + * src/nm-device-802-11-wireless.c: Set "scan_ssid 1" if the requested + AP is not broadcasting, to scan with probe request frames. Required + for non-broadcast networks. + +2006-01-31 Robert Love + + * src/nm-device-802-11-wireless.c: Make the wpa_supplicant a + preprocessor define (still 20s). Fix message text in nm_info() + s/too too/took too/. + +2006-01-30 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_monitor_start): increase connect/auth timeout to + 20 seconds from 10 seconds + +2006-01-30 Dan Williams + + * src/Makefile.am + - Define LOCALSTATEDIR + + * src/nm-device-802-11-wireless.c + - (supplicant_exec): tell wpa_ctrl_open() to stick the local control + socket where we want it to + + * src/wpa_ctrl.[ch] + - (wpa_ctrl_open): accept location to put local control socket + +2006-01-30 Robert Love + + * src/dhcp-manager/nm-dhcp-manager.c: Pass TRUE for ignore_error in + get_ip4_string() for "domain_name". + +2006-01-30 Robert Love + + * gnome/applet/nm-gconf-wso-wpa-psk.c, gnome/applet/nm-gconf-wso.c, + gnome/applet/wireless-security-option.c, include/NetworkManager.h, + libnm-util/cipher-wpa-psk-hex.c, src/nm-ap-security-wpa-psk.c, + libnm-util/cipher-wpa-psk-passphrase.c, src/nm-ap-security.c: Add + support for "Automatic" pairwise and group cipher configuration by + letting wpa_supplicant handle the details. Add UI elements, new + cipher type NM_AUTH_CIPHER_AUTO, and backend support. Works like a + charm. Note this does more than add a nice feature, it fixes a bug. + Apparently, some people have AP's where the pairwise cipher does not + match the group cipher. Insane, but true. + +2006-01-30 Dan Williams + + * gnome/applet/applet-dbus-devices.c + - (nmwa_dbus_device_get_driver_cb, nmwa_dbus_device_get_driver): new + functions, grab device driver name from NetworkManager + - (nmwa_dbus_device_properties_cb): call functions to get driver + + * gnome/applet/applet.c + - (nmwa_update_info): show driver name in Connection Information + dialog + + * gnome/applet/nm-device.[ch] + - (network_device_get_driver, network_device_set_driver): add + accessors for driver name + + * gnome/applet/wireless-applet.glade + - Add line for driver name to Connection Information dialog + + * src/nm-dbus-device.c + - (nm_dbus_device_get_driver): new function to return driver name + - (nm_dbus_device_methods): hook up driver name function to dbus + + * test/nm-tool.c + - (get_driver_name): new function + - (detail_device): grab and show driver name + +2006-01-30 Robert Love + + * gnome/applet/applet.c: Apparently gtk_message_dialog_new_with_markup + does not parse the markup if it is not part of the format. + +2006-01-30 Robert Love + + * gnome/applet/passphrase-dialog.c: If wsm_set_capabilities() returns + FALSE, we have no security options for this dialog, so we throw up + an error dialog instead of a broken passphrase dialog. Fixes + Novell #138404. + * gnome/applet/wireless-security-manager.c, + gnome/applet/wireless-security-manager.h: If wsm_set_capabilities() + does not add any security options, not even NONE, print a warning + and return FALSE. This let's functions constructing a dialog bail + out if the device's capabilities and the network's requirements have + zero overlap. + +2006-01-27 Robert Love + + * configure.in: Require wpa_supplicant. Detect location of binary and + use it. Override with "--with-wpa_supplicant=foo". + * src/Makefile.am, src/nm-device-802-11-wireless.c: Do not hardcode the + path to wpa_supplicant but use the auto-detected or user-provided + value from configure. + +2006-01-27 Robert Love + + * src/backends/NetworkManagerSuSE.c: If DHCLIENT_SET_HOSTNAME is set + but the DHCP server did not return a hostname, try to look up our + name via DNS and set the system hostname to that. + +2006-01-27 Dan Williams + + * src/backends/NetworkManagerRedHat.c + - Add NM_CONTROLLED system network script support for RH/Fedora + +2006-01-27 Dan Williams + + * src/backends/NetworkManagerGentoo.c + - (nm_system_device_get_disabled): add missing function. + Gnome BZ #328780 + +2006-01-27 Clytie Siddall + + * configure.in: Added vi in ALL_LINGUAS line. + +2006-01-26 Robert Love + + * src/Makefile.am, src/kernel-types.h: Now that two different source + files are feeling the crack-addled leakage of kernel types such as + u32 and s8 -- superior to __u64 and __u8, to be sure, but not valid + types in user-space -- define a header and include it as needed. + * src/nm-device-802-3-ethernet.c: Include kernel-types.h + * src/nm-device-802-3-ethernet.h: Remove defines. + * src/wpa.c: Remove defines and include kernel-types.h. + +2006-01-26 Robert Love + + * TODO: Update. WPA support is in the bag and HAL restarts (should) + work. + +2006-01-26 Robert Love + + * configure.in: Change '-Wno-unused' to '-Wno-unused-parameter' + * gnome/applet/applet-compat.c, gnome/applet/applet-dbus-devices.c, + gnome/applet/applet-dbus-info.c, gnome/applet/applet-dbus.c, + gnome/applet/applet.c, gnome/applet/applet.h, src/nm-dbus-device.c, + gnome/applet/nm-gconf-wso-wep.c, gnome/applet/nm-gconf-wso-wpa-psk.c, + gnome/applet/nm-gconf-wso.c, gnome/applet/nm-gconf-wso.h, + gnome/applet/other-network-dialog.c, src/nm-device.c, test/nm-tool.c, + gnome/applet/passphrase-dialog.c, src/nm-device-802-11-wireless.c, + gnome/applet/wireless-security-manager.c, src/nm-ip4-config.c, + gnome/applet/wireless-security-option.c, src/nm-ap-security.c, + gnome/applet/wso-wep-ascii.c, gnome/applet/wso-wep-hex.c, + gnome/applet/wso-wep-passphrase.c, gnome/applet/wso-wpa-psk.c, + libnm-util/dbus-helpers.c, src/NetworkManagerAP.c, src/nm-dbus-nmi.c, + src/NetworkManagerSystem.c, src/nm-ap-security-wep.c, + src/nm-device-802-11-wireless.h, test/libnm-util/test-ciphers.c, + src/named-manager/nm-named-manager.c, test/test-common/test-common.c: + Kill unused variables, labels, and static functions. Don't pass + string literals as the format string for printf-like functions. + +2006-01-25 Dan Williams + + * gnome/applet/wireless-applet.glade + - Remove WPA2 Checkbox + + * gnome/applet/wireless-security-manager.c + - (wsm_set_capabilities): split up sections for wpa and wpa2. + This means the Wireless Security menu now has two WPA options, + one for "WPA Personal" and one for "WPA2 Personal" + + * gnome/applet/wso-wpa-psk.[ch] + - (wso_wpa_psk_new): remove stuff for WPA2 checkbox, and use + 'wpa2' argument to determine WPA version to use + - (append_dbus_params_func): pass stored WPA version to cipher + rather than using the (removed) checkbox + +2006-01-24 Robert Love + + * src/dhcp-manager/nm-dhcp-manager.c: Null-out the original byte array + before we g_strdup(), not the ultimate string. + +2006-01-23 Dan Williams + + * src/NetworkManagerAP.[ch] + - (nm_ap_new_from_ap): copy original essid too + - (nm_ap_unref): free original essid + - (nm_ap_get_orig_essid): new function + - (nm_ap_set_essid): Convert essid to UTF-8 for display and dbus, + but keep original essid around too + + * src/nm-device-802-11-wireless.c + - (supplicant_send_network_config): send wpa_supplicant the + _original_ essid, and not as a string, but in hex. Should + allow us to connect to more APs that use wierd character + encodings for their essids + + * utils/nm-utils.[ch] + - (nm_utils_essid_to_utf8): make a best-effort to convert the essid + to UTF-8. If it's not already valid UTF-8, we check LANG and + use the current locale as a hint for what encoding the essid + might be in. Obviously not 100% accurate, but the idea here is + that if a user's locale is ex. ja_JP, they are more likely than + not to be in Japan, where access points will likely be in some + Japanese encoding. + +2006-01-23 Dan Williams + + * libnm-util/cipher-private.h + libnm-util/cipher.c + libnm-util/cipher.h + - (cipher_bin2hexstr, cipher_hexstr2bin): make public + +2006-01-23 Robert Love + + Patch by Timo Hoenig : + * dhcp-manager/nm-dhcp-manager.c, nm-device.c, nm-ip4-config.c, + nm-ip4-config.h, NetworkManagerSystem.h: Save the hostname reported + by DHCP and pass it to the backends, allowing distribution-specific + behavior with respect to the DHCP-supplied hostname (if nothing else, + some distributions might not want to set the hostname). + * backends/NetworkManagerSuSE.c: Set the hostname if the variable + DHCLIENT_SET_HOSTNAME is set to "yes" in /etc/sysconfig/network/dhcp. + Also update our NIS behavior. + * backends/NetworkManagerDebian.c, backends/NetworkManagerGentoo.c, + backends/NetworkManagerRedHat.c, backends/NetworkManagerSlackware.c: + Add stub functions. + +2006-01-23 Robert Love + + * Makefile.am, nm-applet.desktop: Add autostart .desktop file, now that + gnome-session does autostart. TODO: We need to install this to + $prefix/share/autostart/. + +2006-01-22 Dan Williams + + * src/NetworkManagerAP.[ch] + src/nm-dbus-nmi.c + src/nm-device-802-11-wireless.c + - Make nm_ap_get_essid return "const char *" + +2006-01-22 Dan Williams + + * src/NetworkManagerAP.[ch] + - (nm_ap_get_matched, nm_ap_set_matched): remove + + * src/NetworkManagerAPList.[ch] + - (nm_ap_list_diff): removed + - (nm_ap_list_merge_scanned_ap): move AP dbus signal logic here, + deal with access points changing essids on us + + * src/nm-device-802-11-wireless.c + - (add_new_ap_to_device_list): move AP dbus signal logic to + src/NetworkManagerAPList.c + - (real_can_interrupt_activation): new function; allow interruption + of device activation if we are waiting for a network key + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): allow interruption of currently + activating devices if the device allows it. Previous behavior + would refuse to activate a just-plugged wired device if a + wireless device was waiting for a key. + + * src/nm-device.[ch] + - (nm_device_can_interrupt_activation): new function; ask devices + whether their activation can be interrupted + +2006-01-20 Robert Love + + * Makefile.am, configure.in: Add new man subdirectory. + * man, man/NetworkManager.1.in, man/NetworkManagerDispatcher.1.in, + man/Makefile.am: Add man pages for NetworkManager and its + crime-solving bumbling buddy, NetworkManagerDispatcher. + * man/.cvsignore: Add. + * initscript/Debian/NetworkManager, + initscript/Gentoo/NetworkManager.in, + initscript/RedHat/NetworkManager.in, + initscript/RedHat/NetworkManagerDispatcher.in, + initscript/SUSE/networkmanager-dispatcher.in, + initscript/SUSE/networkmanager.in: Update for /usr/sbin not /usr/bin. + +2006-01-20 Robert Love + + * src/NetworkManagerDbus.c: Fail if NM's DBUS service is already taken, + instead of queuing. This prevents the running of multiple NM + daemons concurrently, which does not work whatsoever and results in + neither daemon working correctly. Also, we don't handle queuing and + name-owner-changes, anyhow. + +2006-01-20 Robert Love + + * src/Makefile.am: Install the NetworkManager daemon to sbin, not bin. + * dispatcher/Makefile.am: Install the NetworkManagerDispatcher daemon + to sbin, not bin. + +2006-01-19 Robert Love + + * configure.in: Require hal 0.5.0 or later. + +2006-01-18 Robert Love + + * src/NetworkManager.c, src/NetworkManagerSystem.h, src/nm-device.c: + Allow backends to flag a device (in whatever distro-dependent way + they so desire) as disabled. NM will ignore any such device. + * src/backends/NetworkManagerDebian.c, + src/backends/NetworkManagerRedHat.c, + src/backends/NetworkManagerSlackware.c: Add stub function + nm_system_device_get_disabled() that always returns FALSE (enabled). + * src/backends/NetworkManagerSuSE.c: Add system_disabled field to the + SUSE-specific configuration structure. Fill it in from the + NM_CONTROLLED variable in the system networking scripts. If this var + exists and is "no", we ignore the device. + +2006-01-17 Robert Love + + * configure.in: Remove 'no' language. Replaced by 'nb', which is + identical for NM. For a full discussion, see the thread at + http://mail.gnome.org/archives/gnome-i18n/2004-August/msg00006.html. + +2006-01-17 Dan Williams + + * src/nm-device.c + - (nm_device_class_init): connect a default act_stage4_ip_config_timeout + function. Fixes crash when wired DHCP fails. + +2006-01-16 Robert Love + + * src/Makefile.am: Don't install NMLoadModules + * src/NMLoadModules, test/NMLoadModules: Move the NMLoadModules script + from src/ to test/ as no one uses it anymore. Note that I would be + fine with removing it altogether. + +2006-01-16 Robert Love + + * gnome/applet/eggtrayicon.c, src/nm-device.c, src/nm-ap-security.c, + gnome/applet/nm-gconf-wso-wep.c, gnome/applet/nm-gconf-wso-wpa-psk.c, + gnome/applet/nm-gconf-wso.c, src/nm-device-802-3-ethernet.c, + gnome/vpn-properties/nm-vpn-properties.c, src/nm-ap-security-wep.c, + src/nm-ap-security-wpa-psk.c, src/nm-device-802-11-wireless.c, + src/nm-netlink-monitor.c: Don't miss any initializers on structure + declarations, ever. + * gnome/applet/applet.c: Remove useless check (NMState is unsigned and + NM_STATE_DISCONNECTED is zero). + +2006-01-16 Robert Love + + * src/nm-device-802-11-wireless.c: argv[3], not argv[4]. Fix + uninitialized parameter and buffer overflow. Novell #143496. + +2006-01-16 Dan Williams + + Apply the PtP Address bits of a patch from Tim Niemueller + + * src/nm-ip4-config.[ch] + - Add ip4_ptp_address member to object + - (nm_ip4_config_copy): copy ptp address too + - (nm_ip4_config_get_ptp_address, nm_ip4_config_set_ptp_address): + new functions + - (nm_ip4_config_to_rtnl_addr): use ptp address when asked to, + rather than local tunnel ip address + + * src/vpn-manager/nm-vpn-service.c + - (print_vpn_config): update for PtP address + - (nm_vpn_service_stage4_ip_config_get): switch parsing to + DBusMessageIters in preparation for getting routes from the VPN + service daemons too + + * vpn-daemons/openvpn/src/nm-openvpn-service-openvpn-helper.c + - (send_config_info): update for PtP address, clean up code + - (main): update for PtP address, clean up code, fix typo + + * vpn-daemons/openvpn/src/nm-openvpn-service.c + - (nm_openvpn_dbus_process_helper_ip4_config): update for PtP address + + * vpn-daemons/pptp/src/nm-pptp-service-pppd-plugin.c + - (pptp_ip_up): update for PtP address + + * vpn-daemons/pptp/src/nm-pptp-service.c + - (nm_pptp_dbus_process_helper_ip4_config): update for PtP address + + * vpn-daemons/vpnc/src/nm-vpnc-service.c + - (print_vpn_config): update for PtP address + - (nm_vpnc_dbus_process_helper_ip4_config): update for PtP address + +2006-01-16 Dan Williams + + * gnome/applet/applet.c + - (nmwa_add_networks_helper): don't indicate an active network + if NM is disconnected or asleep + +2006-01-16 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): switch devices if we lose the link + on an ethernet device. + +2006-01-16 Dan Williams + + * gnome/applet/wso-wpa-psk-hex.[ch] + - Renamed -> wso-wpa-psk.[ch] + + * gnome/applet/wso-wpa-psk.[ch] + - New files + + * gnome/applet/wso-wpa-psk-passphrase.[ch] + - Removed, rolled into wso-wpa-psk.[ch] + + * gnome/applet/Makefile.am + - Updated for above changes + + * gnome/applet/wireless-applet.glade + - Consolidate WPA-PSK options into one notebook + widget, and make dialogs invisible by default + to fix screen oddities + + * gnome/applet/wireless-security-manager.c + - (wsm_set_capabilities): create the new wpa-psk widget rather + than both the old hex & passphrase ones + +2006-01-16 Dan Williams + + * gnome/applet/other-network-dialog.c + - (nmwa_ond_init): Change text to refer to "name" rather than "ESSID" + +2006-01-16 Dan Williams + + * gnome/applet/applet.c + - (nmwa_show_vpn_login_banner_dialog, nmwa_show_vpn_failure_dialog, + nmwa_driver_notify, show_warning_dialog): fix up focus-stealing + prevention to realize window before trying to get server + time + + * gnome/applet/other-network-dialog.c + - (nmwa_other_network_dialog_run): fix up focus-stealing + prevention to realize window before trying to get server + time + + * gnome/applet/passphrase-dialog.c + - (nmi_passphrase_dialog_new): fix up focus-stealing + prevention to realize window before trying to get server + time + +2006-01-16 Robert Love + + Patch from Timo Hoenig + + * gnome/applet/wireless-security-option.c + - (wso_wpa_create_key_type_model): clarify AES-CCMP algorithm name + +2006-01-16 Dan Williams + + * libnm-util/cipher-wpa-psk-passphrase.c + - (cipher_wpa_psk_passphrase_new): correct passphrase length, should + be 8 - 63 characters inclusive + +2006-01-16 Dan Williams + + * src/nm-dbus-nm.c + - (nm_dbus_nm_sleep): bring device down after quick deactivation + +2006-01-13 Robert Love + + Patch by T Sureshkumar : + * src/NetworkManagerSystem.c: Don't assert iface != NULL, allowing VPN + modules that do not use an interface. + +2006-01-13 Dan Williams + + * src/nm-device.c + src/nm-device.h + - Allow subclasses to implement deactivate_quickly() + - (nm_device_deactivate_quickly): call subclass + deactivate_quickly() methods + - (nm_device_set_active_link): small cleanups, and don't + deactivate the device right away because we risk a deadlock + when called from device thread, waiting for the device + thread to cancel activation + + * src/nm-device-802-11-wireless.c + - (real_deactivate_quickly): new function + - (nm_device_802_11_wireless_class_init): hook in real_deactivate_quickly + - (real_deactivate): move supplicant cleanup to real_deactivate_quickly + so that we kill the supplicant when we sleep too + - (supplicant_interface_init): work around naive naming attempts of + wpa_ctrl when naming sockets + +2006-01-13 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_cleanup): delete old device control sockets too + - (supplicant_get_device_socket_path): new function to consolidate + locations that need a path to a device's control socket + +2006-01-12 Robert Love + + * src/backends/NetworkManagerSuSE.c: Put the ppp device in the + description so that the description is unique for each + pair (device,provider). Fixes Novell #142773. + +2006-01-12 Dan Williams + + * src/nm-device-802-11-wireless.c + - (supplicant_exec): ensure GError is correctly initialized + Reported by Diego González (gnome.org #326708) + +2006-01-11 Robert Love + + * src/nm-device-802-3-ethernet.c: In case local copies of glibc do not + define if_mii(), open code the same results, and do so without any + type punning. + +2006-01-11 Robert Love + + * gnome/applet/wireless-security-manager.c: Fix crash by not asserting + that wso_foo_new() returned non-NULL. Instead, only append the new + wso to wsm->options if the wso is non-NULL. The crux is that we + assume that the relevant key types are implied by WEP and WPA as + appropriate. To be sure, they should be, but we should not expect + drivers to not be oozing piles of wolf fecal matter. + +2006-01-11 Robert Love + + * configure.in: Add the gcc flags '-Wshadow' and '-Wfloat-equal'. + * gnome/applet/applet.c, gnome/vpn-properties/nm-vpn-properties.c, + src/NetworkManagerAPList.c, src/NetworkManagerDbus.c, + src/NetworkManagerPolicy.c, src/NetworkManagerSystem.c, + src/nm-dbus-device.c, src/nm-device-802-3-ethernet.c, + src/nm-ip4-config.c, src/vpn-manager/nm-vpn-manager.c, + test/nmtestdevices.c: Fix shadowed variable usage as appropriate. + * src/nm-device-802-11-wireless.c: Fix floating point comparison by + comparing values within DBL_EPSILON. Also fix shadowed variable + usage. + +2006-01-11 Dan Williams + + Add options for WPA2 and WPA1+CCMP (AES). + + * gnome/applet/wireless-applet.glade + - Add UI bits for WPA+CCMP + + * gnome/applet/other-network-dialog.c + - (nmwa_ond_init): pass capabilities into the WirelessSecurityManager, + and don't allow creation of WPA2 Ad-Hoc networks since + wpa_supplicant doesn't support them + + * gnome/applet/wireless-security-manager.c + - (wsm_set_capabilities): Add WPA2 options, and pass capability + on to the specific wireless security option being created + + * gnome/applet/wireless-security-option.[ch] + - (wso_wpa_create_key_type_model): new utility function to create + the model required for WPA Key Type combo box + + * gnome/applet/wso-private.h + gnome/applet/wireless-security-option.h + - Move private function prototypes into wso-private.h + + * gnome/applet/wso-wpa-psk-hex.[ch] + gnome/applet/wso-wpa-psk-passphrase.[ch] + - (append_dbus_params_func): get WPA version from checkbox and pass + it to the dbus serialization helper + - (key_type_combo_changed_cb): Set the cipher's WE Cipher when the + key type combo changes + - (wso_wpa_psk_hex_new): set up the key type combo with the correct + model and options + + * libnm-util/cipher-wpa-psk-hex.c + libnm-util/cipher-wpa-psk-passphrase.c + - (cipher_wpa_psk_hex_set_we_cipher, cipher_wpa_psk_passphrase_set_we_cipher): + new function; allow the cipher to be changed after object creation + + * src/nm-ap-security-wpa-psk.c + - (set_description): Do WPA2 descriptions too + + * src/nm-ap-security.c + - (nm_ap_security_new_from_ap): allow CCMP with WPA1 too + +2006-01-11 Robert Love + + * src/nm-device-802-3-ethernet.c: Use the if_mii() inline function that + is defined in to return the mii_ioctl_data structure + from the ifreq structure in lieu of an open coded solution. Removes + a life-threatening type-punning. + * configure.in: Remove '-Wno-strict-aliasing' as we no longer pun any + types, ever, whatsoever, baby. + +2006-01-11 Robert Love + + * gnome/applet/applet-dbus-devices.c, gnome/applet/applet-dbus.c, + gnome/applet/applet.c, gnome/applet/applet.h: Consolidating + assignments to applet->nm_state into a new nmwa_set_state() function + for both cleanliness and to help debugging. + +2006-01-10 Robert Love + + * src/autoip.c: Fix FIXME. In performing the link-local zeroconf IP + assignment dance, we want to sleep between PROBE_MIN and PROBE_MAX + seconds, exclusive. That is, we want to sleep x seconds such that + 1 < x < 2. + +2006-01-10 Robert Love + + * gnome/applet/applet-dbus-info.c: Remove FIXME, we do not have to free + the attr fields according to the example in the email available at + mail.gnome.org/archives/desktop-devel-list/2004-May/msg00230.html. + Conversely, we do have to free 'name', so we do so, fixing a leak. + +2006-01-10 Robert Love + + * src/nm-device-802-11-wireless.c, src/nm-device-802-3-ethernet.c: Make + sure that we close the socket! + +2006-01-10 Robert Love + + * src/nm-device-802-11-wireless.c, src/nm-device-802-11-wireless.h, + src/nm-device-802-3-ethernet.c, src/nm-device-802-3-ethernet.h, + src/nm-device.c: Fix a FIXME! Reimplement the function + nm_device_update_hw_address() in device subclass variants, + nm_device_802_3_ethernet_set_address() and + nm_device_802_11_wireless_set_address(), hook them up, and use them. + This fixes the existing bug where MAC addresses are all zeros. + +2006-01-10 Robert Love + + * gnome/applet/applet-dbus-devices.c, gnome/applet/applet-dbus.h, + gnome/applet/applet.c, gnome/applet/applet.h: Add 'Enable Networking' + option to give users ability to globally disconnect and put NM to + sleep. This is useful as a 'lockdown mode' for flying, security, and + clean disconnect. + +2006-01-09 Robert Love + + * src/nm-device-802-3-ethernet.h: The kernel headers and + leak the kernel-only types u16, u32, et al. + User-space does not supply these types, so we have to define them + ourselves. The relevant kernel maintainer refused to accept a patch + switching these headers to the proper C99 types. + +2006-01-09 Dan Williams + + Apply Robert's 'tray icon redo' patch with fixes + * gnome/applet/applet.c + gnome/applet/applet.h + - Instead of using a menu bar + menu item, simulate menu + behavior using a popup menu. Highlight the area around + the icon more like a menu too, by playing with the + applet's size requisition + +2006-01-09 Timo Hoenig + * libnm-util/dbus-helpers.c + libnm-util/dbus-helpers.h + - (nmu_create_dbus_error_message): rename parameter 'namespace' + to 'exception_namespace' (:namespace is a keyword in + C++) + +2006-01-09 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): don't autoswitch away from + Ad-Hoc networks, since there's really no concept of + "link" + + * src/nm-dbus-nm.c + - (nm_dbus_nm_create_wireless_network): mark created networks + as Ad-Hoc networks + + * src/nm-device-802-11-wireless.c + - (real_activation_success_handler): add user-created Ad-Hoc + networks to the device's scan list + +2006-01-08 Dan Williams + + We now require a patch for wpa_supplicant to support Ad-Hoc + networks: + http://people.redhat.com/dcbw/wpa_supplicant-ctrl-iface-ap-scan.patch + + * src/nm-device-802-11-wireless.c + - (supplicant_send_network_config): turn off wpa_supplicant's + scanning. Fixes Ad-Hoc networks. + +2006-01-08 Dan Williams + + * src/nm-ap-security.c + src/nm-ap-security.h + - Add a user_created argument to the write_supplicant_config + functions + + * src/nm-ap-security-wep.c + src/nm-ap-security-wpa-psk.c + src/nm-device-802-11-wireless.c + - Make Ad-Hoc mode somewhat work, at least write the + correct options to wpa_supplicant + +2006-01-08 Dan Williams + + * src/nm-device-802-11-wireless.c + - Remove unused code from the old device activation path + +2006-01-08 Dan Williams + + * libnm-util/dbus-helpers.c + - (nmu_security_serialize_wpa_psk): pass a blank key through + dbus when key == NULL + +2006-01-08 Dan Williams + + * gnome/applet/nm-gconf-wso-wpa-psk.c + - (nm_gconf_wso_wpa_psk_new_deserialize_dbus): feed + correct arguments to nmu_security_deserialize_wpa_psk() + + * src/nm-ap-security-wpa-psk.c + - (nm_ap_security_wpa_psk_new_deserialize): feed correct + arguments to nmu_security_deserialize_wpa_psk() + +2006-01-08 Dan Williams + + * gnome/applet/wso-wpa-psk-hex.c + gnome/applet/wso-wpa-psk-passphrase.c + - Hook up the append_dbus_params_func() function + +2006-01-08 Dan Williams + + * src/nm-device-802-11-wireless.c + - (get_wireless_capabilities): correctly detect driver WPA + capabilities + +2006-01-08 Dan Williams + + * gnome/applet/Makefile.am + gnome/applet/wso-wpa-psk-hex.c + gnome/applet/wso-wpa-psk-hex.h + - New files, implement WPA-PSK Hex key input + + * gnome/applet/wireless-applet.glade + - Change existing wpa-psk stuff to wpa-psk-hex + - Add new widgets for wpa-psk-passphrase + + * gnome/applet/wireless-security-manager.c + - (wsm_set_capabilities): enable WPA options + + * gnome/applet/wso-wpa-psk-passphrase.c + - (wso_wpa_psk_passphrase_new): use correct glade widgets + for WPA-PSK passphrase + +2006-01-08 Dan Williams + + * include/NetworkManager.h + - Add NMI_DBUS_USER_KEY_CANCELED_ERROR as a constant for + applet/info-daemons + + * gnome/applet/passphrase-dialog.c + - Use the constant. Fixes a bug where the arguments to + dbus_message_new_error() were incorrect + + * src/nm-dbus-nmi.c + - Use the constant + +2006-01-07 Dan Williams + + * src/nm-device-802-11-wireless.c + - Add a link timeout so we allow the supplicant time to + reassociate if it can, before we deactivate the card + - Fix up link status and link updating so things work better + +2006-01-07 Dan Williams + + * src/nm-device-802-11-wireless.c + - Switch over to using wpa_supplicant + - Add a timeout of 10s for association of the supplicant + - Start the monitor callback of the supplicant + +2006-01-07 Dan Williams + + * src/NetworkManagerUtils.c + - (nm_utils_supplicant_request, + nm_utils_supplicant_request_with_check): + pass correct buffer length to wpa_ctrl_request() + +2006-01-07 Dan Williams + + * src/nm-device-private.h + src/nm-device.c + - (nm_device_activate_schedule_stage3_ip_config_start): make + this function available to subclasses + +2006-01-06 Robert Love + + * src/NetworkManagerPolicy.c: Always prefer wired to wireless, as the + user plugging in a network cable signals their preference for to + switch, unless the user explicitly selected a wireless network and + therefore signaled their preference for said wireless network over + wired. In other words, do exactly what makes sense. + +2006-01-06 Robert Love + + * src/NetworkManagerDevice.c, src/NetworkManagerDevice.h, + src/NetworkManagerDevicePrivate.h, src/NetworkManagerWireless.c, + src/NetworkManagerWireless.h: Remove, no longer used and they keep + showing up in my greps. + +2006-01-06 Robert Love + + * gnome/applet/applet-dbus-devices.c, + gnome/applet/other-network-dialog.c, gnome/applet/wso-none.c, + libnm-util/dbus-helpers.c, libnm-util/dbus-helpers.h, + src/nm-dbus-nm.c: Fix several issues. 'Connect to Other' and 'Create + New Network' both failed in the non-encrypted case because we were + not appending the security options to the DBUS message. And + 'Connect to Other' was also failing in the encrypted case because + we were not incrementing to the next DBUS parameter. All fixed. + Thanks to dcdw for some debugging help. + +2006-01-06 Robert Love + + * gnome/applet/applet-dbus-devices.c, gnome/applet/applet.c, + gnome/applet/applet-dbus-devices.h, src/nm-dbus-nm.c: Remove global + hangup code and add per-device hangup. Tie last commit into the + GNOME applet. TODO: Save, understand, and respond to the state of + each dialup device. + +2006-01-06 Robert Love + + Patch by Timo Hoenig : + * src/NetworkManagerSystem.h, src/nm-dbus-nm.c: Add interfaces to + hangup specific dialup devices. + * src/backends/NetworkManagerDebian.c, + src/backends/NetworkManagerGentoo.c, + src/backends/NetworkManagerRedHat.c, + src/backends/NetworkManagerSlackware.c: Add stub backend. + * src/backends/NetworkManagerRedHat.c, + src/backends/NetworkManagerSuSE.c: Add specific backend interface to + hangup specific dialup devices. + +2006-01-04 Robert Love + + * gnome/applet/applet-dbus-devices.c, + gnome/applet/applet-dbus-devices.h, gnome/applet/applet.c, + src/nm-dbus-nm.c: Expose a menu item for hanging up active dialup + connections. + +2006-01-04 Dan Williams + + First dump of wpa_supplicant-related code. It's not hooked up to + anything yet though. Thanks to Kay Sievers for + wpa_supplicant_wrapper.c, which formed the basis for this work, + and to Jouni Malinen for writing wpa_ctrl.c and wpa_ctrl.h. + + * src/Makefile.am + src/wpa_ctrl.[ch] + - Add wpa_ctrl stuff from wpa_supplicant so we can talk to it + + * src/NetworkManagerUtils.[ch] + - (nm_utils_supplicant_request, nm_utils_supplicant_request_with_check): + Add convenience functions for talking to wpa_supplicant + + * src/nm-ap-security.[ch] + src/nm-ap-security-wep.c + src/nm-ap-security-wpa-psk.[ch] + - Update and implement real_write_supplicant_config functions + in all security types + - (nm_ap_security_wpa_psk_new_from_ap): implement in + nm-ap-security-wpa-psk.c + + * src/nm-device-802-11-wireless.c + - (supplicant_cleanup, supplicant_watch_cb, supplicant_monitor_status_cb, + wpa_supplicant_start, wpa_supplicant_interface_init, + wpa_supplicant_send_network_config): add functions to talk to + wpa_supplicant and write network config to it + +2006-01-04 Robert Love + + * src/NetworkManagerDialup.h: add 'type' field and NM_DIALUP_TYPE + values so that distribution-backends can differentiate between the + various types (modem, ISDN, et cetera) of dialup device that they + support. + * src/backends/NetworkManagerSuSE.c: perform isdnctrl on interface, as + needed. + +2006-01-03 Dan Williams + + * src/NetworkManagerPolicy.c + src/nm-device.[ch] + src/nm-device-802-11-wireless.c + - Move wireless-specific activation failure and success code + into wireless device class + +2006-01-03 Robert Love + + Patch by Preggna S: + * src/NetworkManagerSystem.c, src/vpn-manager/nm-vpn-connection.c: + IPsec does not require that a VPN client be bound to an interface, + due to the use of the in-kernel IPSec bits. So make the tunnel + device optional. + +2006-01-03 Dan Williams + + * src/NetworkManagerAP.c + - (nm_ap_add_capabilities_from_ie): presume no WEP unless + the WPA IE specifies that WEP is supported + + * src/nm-device-802-11-wireless.c + - (process_scan_results): don't mark an AP as supporting WEP + if there's already other encryption capability info + +2006-01-03 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - Recognize activation cancellation when waiting for DHCP + configuration from dhcdbd + - Ignore non-dhcdbd messages + + * src/nm-device.c + - (real_act_stage3_ip_config_start): return to correct behavior + of letting the dhcp-manager notify us of failure or + success rather than incorrectly doing that ourselves + - (nm_device_activate_stage4_ip_config_get): deal with + activation cancellation a bit earlier + +2006-01-03 Dan Williams + + * src/nm-device-802-11-wireless.c + src/nm-device.[ch] + - Add hooks to subclasses for stage3_ip_config_start and + stage4_ip_config_timeout + + * src/nm-device-802-3-ethernet.c + - (real_get_generic_capabilities): make devices NM-supported + by default + +2006-01-03 Robert Love + + * src/backends/NetworkManagerSuSE.c: update to newer API (no more + nm_device_get_hw_address); use inet_aton in lieu of inet_addr as the + latter cannot differentiate between error and the address -1; misc. + clean up. + +2006-01-03 Dan Williams + + * src/NetworkManager.c + - Move link-checking/probing into the device subclasses + themselves + + * src/nm-device.[ch] + src/nm-device-802-11-wireless.c + src/nm-device-802-3-ethernet.c + - Do periodic link checking in device subclasses rather + than being triggered from NetworkManager.c + - discover_wireless_capabilities -> get_wireless_capabilities + - discover_generic_capabilities -> get_generic_capabilities + - Device subclass activation routines now return a value of type + NMActStageReturn to indicate what step to perform next + - Devices now override stage4_get_ip4_config if they choose + +2006-01-01 Dan Williams + + * src/nm-device-802-11-wireless.c + - (real_init): don't chain up to parent init because we don't + need to do that anymore + + * src/nm-device.c + - (discover_device_type): fix arguments to ioctl() to correctly + pass interface name + - (nm_device_new): consolidate generic device initialization into + nm_device_new() + - (real_init): remove, consolidated to nm_device_new() + - (nm_device_deactivate, real_deactivate): consolidate + +2006-01-01 Dan Williams + + * src/nm-activation-request.c + - Change dhcp_state member of the NMActRequest structure + from guint8 to guint32 + + * src/dhcp-manager/nm-dhcp-manager.[ch] + - (nm_dhcp_manager_get_state_for_device): return guint32 rather + than guint8 to match the dbus argument. Turns out we were + overwriting memory since we were passing in only a guint8 + +2005-12-31 Dan Williams + + * refactor NMDevice into a GObject-based framework with separate + objects for wired and wireless. The following files are no + longer used but should stick around for a bit so we don't + loose code through the cracks: + NetworkManagerDevice.c + NetworkManagerDevice.h + NetworkManagerWireless.c + NetworkManagerWireless.h + + The intent here is to allow each device type to manage its own + connection & activation life-cycle, ie to allow wireless devices + to interface with wpa_supplicant, etc. There's a fair bit of + encapsulation breakage right now that should gradually get pulled + back into each device, along with things like periodic property + updates and link probing. + +2005-12-29 Dan Williams + + * include/NetworkManager.h + - Add NM_802_11_CAP_PROTO_NONE since we need to recognize + between networks that don't have any encryption at all + +2005-12-29 Dan Williams + + * test/test-common.c + test/test-common.h + test/Makefile.am + - Move to a test-common subdirectory + + * test/libnm-util/test-ciphers.c + - Move test data to test-inputs.h + - Test WPA ciphers too + + * test/libnm-util/test-dbus-helpers.c + - Test serialization/deserialization of ciphers + +2005-12-29 Dan Williams + + * gnome/applet/applet-dbus-devices.c + - Replace 'enc' parameter with 'capabilities' for wireless networks + in dbus calls to NM + - Set capabilities on WirelessNetwork objects + - Receive and save type-specific device capabilities too + + * gnome/applet/applet-dbus-info.c + gnome/applet/applet-dbus.c + - Passphrase dialog no longer a singleton; new instance gets created + on each request. Updates to deal with that. + + * gnome/applet/applet.c + - (nmwa_has_encrypted_networks_helper): use AP capabilities rather + than single 'encrypted' flag + - (nmwa_menu_add_vpn_menu): if NM isn't connected, disable any VPN + menu items + - Passphrase dialog updates per above + + * gnome/applet/menu-items.c + - (network_menu_item_update): use AP capabilities to determine + encryption + + * gnome/applet/nm-device.[ch] + - Add accessors for type-specific device capabilities + + * gnome/applet/other-network-dialog.c + - Rework to respect device capabilities. i.e., if the device doesn't + support WPA, remove that option from the security dropdown + + * gnome/applet/passphrase-dialog.c + - Massive rework so that a new instance is created each time + it's used, to support wireless network capabilities + + * gnome/applet/wireless-network.[ch] + - Add accessors and members for wireless network capabilities + + * gnome/applet/wireless-security-manager.[ch] + - (wsm_set_capabilities): called after creation to set which + security options get shown to the user + +2005-12-29 Dan Williams + + * libnm-util/cipher-wpa-psk-passphrase.c + - (cipher_wpa_psk_passphrase_hash_func): return key as hex string + like other ciphers + +2005-12-23 Dan Williams + + * gnome/applet/applet-dbus-info.c + - (nmi_dbus_get_key_for_network): if there's no entry in + GConf for a network, assume we want a new key + - (nmi_save_network_info): serialize wireless security info + into GConf so its saved + + * src/nm-dbus-nm.c + - Fix warning as we may not be passed security info when + connecting to a wireless network + +2005-12-23 Dan Williams + + * gnome/applet/applet-compat.c + - Fix bugs in GConf entry conversion + + * gnome/applet/applet-dbus-info.c + - (nmi_dbus_get_network_properties): handle case of the BSSID + list being zero-length + + * libnm-util/cipher-* + libnm-util/dbus-helpers.c + - All ciphers must now return hashed keys as UTF-8 valid + hexadecimal strings, ie "8f3dae4023". They are pushed + through dbus as strings too. + - Consolidate various functions that do bin->hex and hex->bin + conversion into cipher.c + + * src/nm-ap-security-wep.c + src/nm-ap-security-wpa-psk.c + - Handle NULL keys since we may not know keys right away + + * src/nm-dbus-nmi.c + - (nm_dbus_get_network_data_cb): actually advance to the start + of the wireless security info before we try to deserialize it + + * libnm-util/test-ciphers.c + - Update cipher tests for the change to UTF-8 hexadecimal strings + +2005-12-22 Dan Williams + + * gnome/applet/applet-compat.[ch] + - Convert old-format GConf and keyring entries + when the applet starts up. + + * gnome/applet/applet.c + - (nmwa_get_instance): Call the conversion function + on startup before dbus is initialized + +2005-12-22 Dan Williams + + * gnome/applet/applet-dbus-info.c + - Remove nmi_dbus_create_error_message() in favor of + nmu_create_dbus_error_message() + - (nmi_dbus_get_network_properties): Error message cleanups + - (nmi_dbus_get_network_properties): BSSIDs are now in the 'bssids' + gconf key rather than 'addresses', since they really are BSSIDs + - (nmi_dbus_get_network_properties): Dispose of the security + object when we're done with it + +2005-12-21 Dan Williams + + * Consolidate the info-daemon's "updateNetworkInfo" and + "addNetworkAddress" calls into just "updateNetworkInfo" + +2005-12-21 Dan Williams + + * Make connection after key retrieval work again + +2005-12-21 Dan Williams + + * gnome/applet/nm-gconf-wso* + - Make the serialize functions return gboolean + rather than int + + * gnome/applet/nm-gconf-wso.c + - (nm_gconf_wso_dispose, nm_gconf_wso_finalize): fix up + parent class handling so we don't segfault + + * src/NetworkManagerAP.[ch] + - (nm_ap_get_capabilities): new function, return capabilities + now that something can use them + - (nm_ap_set_encrypted): assume that an access point supports + both WEP104 and WEP40 if its set encrypted. FIXME: can + we even tell whether it just supports WEP40? + + * src/NetworkManagerDevice.c + - (ap_need_key): resurrect and update for the New World Order + - (nm_device_wireless_get_activation_ap): if we're not given + security info to use, create some based on access point + capabilities + + * src/nm-ap-security-wep.c + - (nm_ap_security_wep_new_from_ap): create a new object + based on a certain access point's capabilities + + * src/nm-ap-security.c + - (nm_ap_security_new_from_ap): delegate creation of a new + object based on access point capabilities to a subclass + - (nm_ap_security_copy_properties): don't segfault if we + don't have a key yet + + * src/nm-dbus-nm.c + - (nm_dbus_nm_set_active_device): provide more informative + output when errors occur. Also construct security info + for a given access point if we weren't given any + +2005-12-21 Žygimantas Beručka + + * configure.in: Added Lithuanian to ALL_LINGUAS. + +2005-12-21 Dan Williams + + * test/libnm-util + - Add some testcases for WEP ciphers + +2005-12-17 Dan Williams + + * Fix bugs + +2005-12-17 Dan Williams + + * include/NetworkManager.h + - Finally kill NMEncKeyType + + * gnome/applet/applet-dbus-info.c + - (nmi_save_network_info): convert to NMGConfWSO + + * gnome/applet/nm-gconf-wso-*.c + - Implement gconf serialization functions + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): fix up meaning of + automatic/user_requested + +2005-12-17 Dan Williams + + * gnome/applet/* + - More applet cleanups + - Use the dbus-method-dispatcher + + * libnm-util/dbus-method-dispatcher.[ch] + - Generalize the implementation from NM in + NetworkManagerUtils.c + +2005-12-16 Dan Williams + + * gnome/applet/* + - Fix up the passphrase dialog to use all the + WirelessSecurityOption stuff (untested) + +2005-12-16 Dan Williams + + * Move nm_gconf_get_*_helper() functions to separate files, + gconf-helpers.c & gconf-helpers.h + + * New NMGConfWSO objects for managing the gconf side of things. + Eventually these should be merged with the + WirelessSecurityOption objects and a common base (that can + serialize/deserialize from dbus & gconf) should be + refactored out, but for now they are separate. + +2005-12-16 Robert Love + + * src/backends/NetworkManagerSuSE.c: Do not invoke ypbind or autofs + binaries unless they exist (nm_spawn_process() emits a warning if + asked to spawn a non-existant process). + +2005-12-16 Dan Williams + + * gnome/applet/applet-dbus-info.c + - Clean up lots of gconf-related code + +2005-12-16 Robert Love + + * Makefile.am: Build fix: Reorder 'SUBDIRS' so our deps are right. + +2005-12-16 Dan Williams + + * nm_device_set_enc_key -> nm_device_set_wep_enc_key + + * Fix up NM -> NMI get-user-key dbus calls in NM (applet + bits still to be done) + +2005-12-16 Dan Williams + + * Finally move info-daemon related stuff out of + NetworkManagerDbus.c to nm-dbus-nmi.c + +2005-12-16 Dan Williams + + * Kill auth_method for access points, since that's now done + by NMAPSecurity objects + + * Add a copy-constructor of sorts to NMAPSecurity + (how do you do this properly in glib???) + +2005-12-15 Dan Williams + + * Exorcise encryption key hashing on APs + * Use libnm-util's serialization/deserialization in both the + applet and NM + * Random other stuff + +2005-12-15 Robert Love + + * gnome/applet/menu-items.c: A new icon, "network-wireless-encrypted" + is being added to the icon naming spec, so let's use that (Tango CVS + has the icon). Because it is new, however, we fall back to the + current "gnome-lockscreen" if the new icon is not around, thus + behavior is the same. + * gnome/applet/applet.c: Remove setup_stock(). We do not need the + factory junk. + +2005-12-15 Robert Love + + * src/gnome/applet.c: Don't show the 'Help' menu item until we have, + well, help to give. Couple other misc. bits. + +2005-12-15 Dan Williams + + * libnm-util/dbus-helpers.[ch] + - Make this the one-stop-shop for serializing/deserializing + AP & connection security settings over dbus. Both NM + and applets should use this to ensure consistent dbus + API going forwared. + +2005-12-15 Robert Love + + Patch by Timo Hoenig : + * src/NetworkManagerDbus.c + - (nm_dbus_signal_filter) return DBUS_HANDLER_RESULT_HANDLED + if HAL jumps off the system bus. Otherwise libdbus + (dbus_connection_dispatch) will try to run the filter + function of our libhal context which is already freed. + +2005-12-15 Alexander Shopov + + * configure.in: Added "bg" (Bulgarian) to ALL_LINGUAS + +2005-12-14 Dan Williams + + * include/NetworkManager.h + src/NetworkManagerWireless.c + - Rearrange 802.11 wireless-specific capabilities again + + * src/Makefile.am + - Forgot to add wpa.c/wpa.h to the makefiles + + * src/NetworkManagerAP.[ch] + - Implement access point capabilities and parse the + WPA/RSN IEs into the capability bitfield + - Switch the "encrypted" attribute to utilize the bitfield + and capabilities rather than being independent + + * src/NetworkManagerDevice.c + - (nm_device_wireless_get_activation_ap): break it horribly + until we can push NMAPSecurity objects into access point + objects and through the activation chain + - Stuff WPA & RSN IEs into AP capabilities + + * src/nm-dbus-nm.c + - Take a shot at actually making setActiveDevice work + + * src/wpa.[ch] + - Make the API a bit saner + +2005-12-14 Dan Williams + + * include/NetworkManager.h + - Add 802.11-specific capability for 802.1x key + management + + * src/wpa.[ch] + - Pull in WPA IE and RSN IE parsing code from + wpa_supplicant so we can determine access point + capabilities + - Move WPA-related constants here from NetworkManagerAP.h + and NetworkManagerDevice.c + + * src/NetworkManagerDevice.c + src/NetworkManagerAP.[ch] + - Use WPA-related constants from wpa.h + +2005-12-14 Dan Williams + + * include/NetworkManager.h + - Update and split 802.11 wireless-specific capabilities from + generic device capabilities + + * src/NetworkManagerDevice.c + src/NetworkManagerDevicePrivate.h + - (nm_device_wireless_discover_capabilities): Move 802.11 + wireless-specific capability checks to + NetworkManagerWireless.c + - Rename NMDeviceWirelessOptions -> NMDevice80211WirelessOptions + - Rename NMDeviceWiredOptions -> NMDevice80211EthernetOptions + + * src/NetworkManagerWireless.[ch] + - (nm_802_11_wireless_discover_capabilities): Check extended + 802.11 wireless-specific capabilities of the driver + +2005-12-14 Robert Love + + Patch from Stefan Scheler : + * src/NetworkManagerDevice.c: call backend code to activate and + deactivate NIS. + * src/NetworkManagerSystem.h: add new NIS interfaces. + * src/backends/NetworkManagerDebian.c, + src/backends/NetworkManagerGentoo.c, + src/backends/NetworkManagerRedHat.c, + src/backends/NetworkManagerSlackware.c: add stub functions for NIS + support. + * src/backends/NetworkManagerSuSE.c: add NIS support, baby. + +2005-12-14 Dan Williams + + * src/nm-ap-security*.[ch] + - Add AP security abstractions to NetworkManager + + * src/nm-dbus-device.c + - Begin to parse new format dbus messages from the applet + and construct an AP security object from the message + + * libnm-util/dbus-helpers.c + - Use message iters so we can append the key as a fixed + array of bytes, which actually works rather than + using dbus_message_append_args() as we were before + +2005-12-14 Dan Williams + + * src/NetworkManagerDbus.c + gnome/applet/applet-dbus.c + - Fix up dbus service replacement options. The applet + should allow replacement, NM itself should not. + +2005-12-13 Robert Love + + * src/named-manager/nm-named-manager.c: Revert earlier commit. + Instead, fail silently if config is NULL by not asserting and not + returning FALSE. Also, make sure we always fclose() the file. + +2005-12-13 Robert Love + + Patch by Stefan Scheler : + * src/nm-ip4-config.h, src/nm-ip4-config.c, + src/dhcp-manager/nm-dhcp-manager.c: Add support for setting up NIS + via DHCP. Still need the backends to commit the NIS domain name and + and servers to yp.conf as needed. + +2005-12-13 Robert Love + + * src/vpn-manager/nm-dbus-vpn.c: Do not call the lengthy-named function + nm_vpn_manager_remove_connection() unless vpn is non-NULL. + +2005-12-13 Robert Love + + * src/named-manager/nm-named-manager.c: Don't unref the config until + after we call rewrite_resolv_conf(), because get_last_default_domain() + needs to access the config. Fixes "rewrite_resolv_conf: assertion + `config != NULL' failed" assertion failures and "Could not commit DNS + changes" warnings. + +2005-12-12 Dan Williams + + * libnm-util/dbus-helpers.[ch] + libnm-util/Makefile.am + - new helper calls to consolidate locations where + NM's setDevice method is called + + * gnome/applet/applet-dbus-devices.c + gnome/applet/wireless-security-option.c + gnome/applet/wso-* + - Implement dbus message param append function for + all wireless security options + +2005-12-12 Robert Love + + * libnm-util/cipher-wep-passphrase.c, + libnm-util/cipher-wpa-psk-passphrase.c, src/NetworkManagerAP.c, + src/NetworkManagerAP.h, src/NetworkManagerDevice.c, + src/NetworkManagerWireless.c, src/NetworkManagerWireless.h: Treat + all WEP/WPA keys as "char *" and not explicitly signed or unsigned. + When handling keys, we don't care what the sign is. The compiler + guarantees us that we get our 8-bits, which is all we care about. + * configure.in: Remove "-Wno-pointer-sign" flag. We are sign-aware! + +2005-12-12 Dan Williams + + * gnome/applet/applet-dbus-devices.[ch] + gnome/applet/applet.c + gnome/applet/other-network-dialog.c + gnome/applet/wireless-security-manager.[ch] + gnome/applet/wireless-security-option.[ch] + gnome/applet/wso-* + - Push the wireless security options further into the applet + +2005-12-12 Robert Love + + * src/dhcp-manager/nm-dhcp-manager.c: Do not fail if DHCP does not + return any name servers. That is perfectly valid. (Novell #134369). + +2005-12-11 Dan Williams + + * gnome/applet/wso-* + gnome/applet/wireless-security-option.* + gnome/applet/Makefile.am + - split each security option out so we can eventually + have each one build up their own dbus message + arguments to send to NM + +2005-12-11 Dan Williams + + * Make validation of the key work correctly + +2005-12-11 Dan Williams + + * Hook more bits of the Other Network Dialog up to the + wireless security manager stuff, and restructure + bits of the dialog so there's less code. + +2005-12-10 Dan Williams + + * gnome/applet/Makefile.am + - Add libnm-util to includes + - Add libnm-util to link list + - Add wireless-security-common.* to compile list + + * gnome/applet/other-network-dialog.c + - Convert to using the WirelessSecurityManager code and + widgets + + * gnome/applet/passphrase-dialog.c + - Comment out references to stuff in the glade file that + cause runtime errors until it can be fixed up + to use the WirelessSecurityManager code + + * gnome/applet/wireless-applet.glade + - Rename some widgets + - Add widgets for the WirelessSecurityManager code + - Remove passphrase-related stuff since that's now + handled by the WirelessSecurityManager code + +2005-12-10 Dan Williams + + * gnome/applet/applet-dbus-devices.c + - Print out error message details for dbus pending call callbacks + - Move nmwa_dbus_update_devices() up + + * gnome/applet/applet-dbus-vpn.c + - Print out error message details for dbus pending call callbacks + +2005-12-10 Dan Williams + + * libnm-util/* + - More fixups + - Remove cipher-manager.* because we don't need it + - Forgot to add gnome-keyring-md5 files to compile list + +2005-12-09 Dan Williams + + * libnm-util/* + configure.in + Makefile.am + - Add a utility library for clients of NetworkManager. It's + only targetted at applets for the moment, and contains + a generalized 802.11 cipher framework for different + types of keys (WEP & WPA Hex, ASCII, Passphrase) + +2005-12-09 Robert Love + + * src/NetworkManagerDevice.c: handle error better in + nm_device_set_mode(). + +2005-12-08 Robert Love + + * include/NetworkManager.h: add WPA capabilities constants + * src/NetworkManagerDevice.c: detect if wireless devices support WPA + or WPA2 and add the capabilities bits as appropriate. + +2005-12-08 Robert Love + + * initscript/SUSE/networkmanager-dispatcher.in: new initscript for + NetworkManagerDispatcher. + * configure.in, initscript/SUSE/.cvsignore, + initscript/SUSE/Makefile.am: support new networkmanager-dispatcher + initscript. + +2005-12-08 Robert Love + + * initscript/SUSE/networkmanager.in: Do not start 'networking' service. + +2005-12-08 Robert Love + + * src/NetworkManagerDevice.c: We want to fall back on and default to + IW_MODE_AUTO, not -1, which is more in line with our previous + behavior. Otherwise, we try to set the wireless mode to -1 in + nm_device_set_mode(). + +2005-12-07 Robert Love + + * gnome/applet/applet-dbus-info.c, include/NetworkManager.h, + src/NetworkManagerAP.c, src/NetworkManagerAP.h, + src/NetworkManagerAPList.c, src/NetworkManagerDbus.c, + src/NetworkManagerDevice.c, src/NetworkManagerDevice.h, + src/nm-dbus-nm.c: Convert NM_DEVICE_AUTH_METHOD_* to use the + wireless-tools constants directly. UNKNOWN is now -1 and NONE is + zero. + +2005-12-07 Robert Love + + * src/backends/NetworkManagerSuSE.c: In static configurations, if the + supplied IP is invalid, fall back to DHCP. + +2005-12-07 Dan Williams + + * Convert NETWORK_MODE_* constants to IW_MODE_* + * Make all the get_mode/set_mode functions take and return 'int' + * Convert D-BUS calls that pass mode to DBUS_TYPE_INT32 rather than UINT32 + +2005-12-07 Robert Love + + * src/NetworkManagerDevice.c: strncpy() buffer check. + * src/NetworkManagerUtils.c: be anal about syslog() formatting. + +2005-12-06 Dan Williams + + * gnome/applet/applet-dbus.c + - (set_vpn_last_attempt_status): remove, now in applet-dbus-vpn.c + + * gnome/applet/applet-dbus-vpn.c + - (nmwa_dbus_vpn_set_last_attempt_status): new, from applet-dbus.c + - (nmwa_dbus_vpn_update_vpn_connection_stage): set last_attempt_success + to TRUE here if stage was ACTIVATED + +2005-12-06 Dan Williams + + * Change nm_device_is_* functions to better names: + nm_device_is_wireless() -> nm_device_is_802_11_wireless() + nm_device_is_wired() -> nm_device_is_802_3_ethernet() + +2005-12-06 Dan Williams + + * Change naming of NMDeviceType to something more sensible: + NM_DEVICE_TYPE_DONT_KNOW -> NM_DEVICE_TYPE_UNKNOWN + NM_DEVICE_TYPE_WIRED_ETHERNET -> NM_DEVICE_TYPE_802_3_ETHERNET + NM_DEVICE_TYPE_WIRELESS_ETHERNET -> NM_DEVICE_TYPE_802_11_WIRELESS + +2005-12-06 Dan Williams + + * Move NetworkManager.h -> include/NetworkManager.h + * Split out VPN stuff into include/NetworkManagerVPN.h + * Fix up makefiles to include new location + * Fix up sources to include NetworkManagerVPN.h + +2005-12-06 Dan Williams + + Various changes in the applet to move VPN connection "state" -> "stage", + which it actually is. I'd like to change the signal as well when we + break compat in the near future. + +2005-12-06 Dan Williams + + Slackware patches from Paul Blazejowski + * initscript/Slackware/rc.networkmanager + - Cosmetic fix + + * src/backends/NetworkManagerSlackware.c + - Kill dhcpcd when starting so that dhclient can bind to DHCP on + interfaces + +2005-12-05 Robert Love + + * src/NetworkManager.c: don't call nm_data_free() when there is nothing + to free, particularly here as it just barfs. + +2005-12-05 Dan Williams + + * gnome/applet/applet-dbus.c + - Work with dbus 0.6 too + +2005-12-03 Dan Williams + + * src/NetworkManagerUtils.[ch] + src/nm-ip4-config.c + - move ip4_netmask_to_prefix() to NetworkManagerUtils.c + - consolidate code into nm_utils_ip4_addr_to_nl_addr() + +2005-12-01 Robert Love + + * gnome/applet/main.c, gnome/vpn-properties/nm-vpn-properties.c: We + need a NULL for the '...' parameter, too, to fill the so-called + sentinel. + +2005-12-01 Robert Love + + * src/NetworkManagerSystem.c: If iface_to_rtnl_link() returns NULL, the + interface is already gone, so don't call rtnl_link_change() to down + it (which will segfault, anyhow). + +2005-11-22 Robert Love + + * src/backends/NetworkManagerSuSE.c: Don't fall back to DHCP if the + gateway is not set, just print a little note. Configurations without + gateways are valid. + +2005-11-22 Robert Love + + * README: update + +2005-11-20 Ilkka Tuohela + + * configure.in: Added Finnish translation to ALL_LINGUAS + +2005-11-14 Robert Love + + * vpn-daemons/openvpn: initial checkin of OpenVPN VPN Module, by Tim + Niemueller . + +2005-11-08 Dan Williams + + Patch from Bill Moss + * src/NetworkManagerDevice.c + - (nm_device_activate_stage5_ip_config_commit): fix ordering + of nm_policy_schedule_activation_finish() to prevent a + race condition that causes the link to be dropped + +2005-11-08 Dan Williams + + Patch from Bill Moss + * src/NetworkManagerAPList.c + src/NetworkManagerDevice.c + src/NetworkManagerDbus.c + - Replace occurances of ether_ntoa_r() with iw_ether_ntop() so + we get more readable ether/mac addresses + +2005-11-02 Christopher Aillon + + * gnome/applet/main.c: Don't set the restart command. This fixes + the issue where the restart command was getting copies of all its + arguments for each time the applet was restarted. + +2005-11-02 Robert Love + + * gnome/applet/applet.c: Only send the DBUS setWirelessEnabled method + if the widget state differs from our saved state. This ensures we + do not enter an endless loop of death and destruction. Also, this + guarantees us that we enforce the widget state. + +2005-11-02 Robert Love + + * gnome/applet/applet.c: add nmwa_enable_wireless_set_active(). + * gnome/applet/applet-dbus-devices.c: invoke the new function + nmwa_enable_wireless_set_active() to ensure that the state of the + 'Enable Wireless' checkbox matches the daemon's state. This is a + concern because the daemon remembers the state. + +2005-11-02 Robert Love + + * gnome/applet/applet.c: Make menu item "Enable Wireless" not "Wireless + Enabled", as checkboxes should be actions/commands not positive + statements, otherwise they are confusing in the unselected case. See + examples in GNOME HIG, Chapter 6. + +2005-11-02 Robert Love + + * gnome/applet/applet.c: When wireless is disabled, act it. Do not + show a list of wireless networks or the wireless devices or the + "Create Wireless ..." menus. Aside from this cosmetics, this fixes + a bad bug: If wireless is disabled and the user picks a wireless + network, NM will switch to the network, only to immediately switch + back, as wireless is disabled. This also reassures people that NM + is not scanning (it is not -- I verified). Fixes Novell bug #130041. + +2005-11-02 Christopher Aillon + + * gnome/applet/applet.c: + * gnome/applet/applet.h: + Partial backout of Dan's timeout animation patch. + Timeout IDs cannot legally be 0, so revert the code in place to handle + a timeout ID of 0 to denote the timeout isn't running. + +2005-11-02 Christopher Aillon + + * src/NetworkManagerPolicy.c: + (nm_policy_device_change_check) Clarify wireless switch nm_info text + +2005-10-28 Robert Love + + * vpn-daemons/vpnc/properties/nm-vpnc-dialog.glade: Change label to + "Import Saved Configuration..." to make it clear that importing is + not the next step, but an option. As an aside, a nice TODO would be + to move Importing out of the vpn-specific dialog and into the main + property editor, as Importing goes with Adding, but that will require + some rearchitecting of the VPN stuff I suspect. + +2005-10-27 Dan Williams + + Start using libnl. You need 1.0-pre3 or higher. Eventually + we should replace most of the distro-specific backend code + with libnl stuff. + + Get it here: http://people.suug.ch/~tgr/libnl/ + + * configure.in + src/Makefile.am + - Add checks for libnl pkgconfig file + - Use LIBNL_LIBS & LIBNL_CFLAGS + + * src/NetworkManagerSystem.c + src/nm-ip4-config.[ch] + - Use libnl rather than ioctl() for most things + - Remove unused functions + +2005-10-27 Robert Love + + * src/backends/NetworkManagerSuSE.c: fix warning message text + +2005-10-27 Christopher Aillon + + * gnome/applet/applet.c: Use the copyright symbol instead of (C) + +2005-10-27 Christopher Aillon + + * gnome/applet/applet.c: The applet's about dialog can advertise our + project page + +2005-10-26 Christopher Aillon + + * gnome/applet.c: Also use translator credits if we don't have + the new GtkAboutDialog (older versions of GTK+) + +2005-10-26 Robert Love + + * dispatcher-daemon/NetworkManagerDispatcher.c: print actual error string on daemon() + failure; correct usage text for "--no-daemon" + +2005-10-25 Dan Williams + + * src/NetworkManagerDevice.c + - (get_scan_results): cleanups, deal cleanly with ENODATA signifying + no scan results + - (free_process_scan_cb_data): unref the device when freeing results + - (nm_device_wireless_process_scan_results): free scan results a bit later + so we don't unref the device underneath ourselves + +2005-10-25 Dan Williams + + * Back out 2005-10-24 commit from Tor Krill. Patch + causes nameservers never to be removed from named. + +2005-10-24 Dan Williams + + Clean up wireless scanning and wireless link probing. + + * src/NetworkManagerDevice.c + - (nm_device_probe_wireless_link_state): instead of calling nm_get_best_ap(), + just see if there's an activation request on the device, and check the + current link against the activation request access point's ESSID. + - (link_to_specific_ap): increase the # of failed links we tolerate from 3 to 6 + - (nm_device_wireless_process_scan_results): actually free our scan data, and + don't call process_scan_results() on zero-length data + - (nm_device_set_wireless_scan_interval): increase the init scan interval to + 15 seconds (from 10) + +2005-10-24 Dan Williams + + Cleanup some applet stuff: + + - Animation timeouts. If NM died while the applet was animating, + the applet would not hide itself. This is now fixed. + + - Remove some dead code + + - Remove nmi_passphrase_dialog_schedule_cancel() and convert uses + to nmi_passphrase_dialog_cancel() since we no longer use threads. + + - Track animation timeout using a gboolean rather than the timeout's + ID, since timeout IDs can legally be 0. + +2005-10-24 Dan Williams + + * src/backends/interface_parser.c + - Add void to function declarations that need it + to match patch from Engin AYDOGAN + + * src/backends/interface_parser.h + - Remove unused prototype for ifparser_interfaces() + + Patch from Engin AYDOGAN + * src/backends/interface_parser.h: + - Compile fixes for gcc 4.0.2 (add void) + +2005-10-24 Dan Williams + + Patch from Tor Krill + * src/named-manager/nm-named-manager.c + - Write more than just the first nameserver to /etc/resolv.conf + - Write out valid /etc/resolv.conf on exit + +2005-10-21 Christopher Aillon + + * gnome/applet/applet-dbus-vpn.c: + Get rid of spurious newlines in debug console output + +2005-10-21 Christopher Aillon + + * src/backends/NetworkManagerGentoo.c: + Fix path to killall. Patch from Dave Shanker + +2005-10-20 Robert Love + + * src/NetworkManagerDevice.c: Use fabs() and DBL_EPSILON to avoid a + direct comparison of floating point values, which is never correct. + Also some misc. cleanup. + +2005-10-19 Robert Love + + * vpn-daemons/vpnc/nm-vpnc.desktop.in: add fields + +2005-10-19 Robert Love + + * gnome/vpn-properties/nm-vpn-properties.c: Correctly set the + sensitivity of the buttons. Specificaly, do the right thing if + there are no entries. + +2005-10-19 Christopher Aillon + + * configure.in: Update check for adequate wireless-tools + with an AC_TRY_COMPILE for the new symbols we use. + +2005-10-19 Dan Williams + + * src/NetworkManagerDevice.c + - (process_scan_results): don't drop the last (or only) + access point we see + +2005-10-19 Christopher Aillon + + * src/backends/NetworkManagerSlackware.c: + Patch from Nico + - Update the Slackware backend. + +2005-10-18 Christopher Aillon + + * gnome/applet/other-network-dialog.c: Use g_get_host_name () + if we've got GLib 2.8.0 + +2005-10-18 Robert Love + + * src/NetworkManagerDevice.c: invoke the long-in-the-tooth named + function nm_schedule_state_change_signal_broadcast() when we + deactivate a device, too. + +2005-10-18 Robert Love + + * gnome/applet/applet.c: nmwa_context_menu_update(): 'iface' could + be used uninitialized. + +2005-10-18 Christopher Aillon + + * test/libnm_glib_test.c: Test unregistering, too. + +2005-10-17 Christopher Aillon + + * configure.in: Bump to 0.5.0 + +2005-10-17 Dan Williams + + * NetworkManager.h + - Remove WPA-related constants so they aren't part of the + upcoming release. + +2005-10-17 Christopher Aillon + + * gnome/applet/applet.c: + * gnome/applet/applet.h: + Desensitize the 'Connection Information' menu item when there is + no active connection. + +2005-10-17 Christopher Aillon + + * gnome/libnm_glib/libnm_glib.c: + Make libnm_glib_unregister_callback () actually unregister the callback + +2005-10-17 Robert Love + + * src/NetworkManagerDevice.c: Actually wait 20s, as we intend, not + two seconds -- tries is updated every 1/10 of a second, not every + second.. + +2005-10-17 Christopher Aillon + + * gnome/applet/applet-dbus-info.c: + Let D-BUS know that we haven't handled a message when we haven't. + +2005-10-17 Robert Love + + * src/nm-ip4-config.c: use GPOINTER_TO_UINT and not a straight cast + in order to remain 64-bit clean. + +2005-10-17 Christopher Aillon + + * gnome/applet/applet-dbus-info.c: + Find network encryption keys asynchronously + +2005-10-17 Robert Love + + * src/backends/NetworkManagerDebian.c, + src/backends/NetworkManagerRedHat, + src/backends/NetworkManagerSuSE.c: allow '#' as a valid resolv.conf + comment delimiter. + +2005-10-17 Robert Love + + * src/backends/NetworkManagerSuSE.c: use SYSCONFDIR not open-coded + "/etc" + +2005-10-17 Christopher Aillon + + * src/NetworkManagerDevice.c: (process_scan_results) + Fix logic that checks to see whether we have an ESSID. + +2005-10-15 Dan Williams + + Move scanning code into NetworkManager rather than use iwlib's + iw_scan() function, so that we can figure out AP capabilities. + + * NetworkManager.h + - Add AP capability bits + + * src/NetworkManagerAP.[ch] + - Add capability field to NMAccessPoint structure + - Add WPA & RSN Information Element fields and accessor + functions to NMAccessPoint + + * src/NetworkManagerDevice.c + - Remove usage of iw_scan + - Add scanning code to NetworkManager rather than use + iw_scan() from iwlib + + * src/NetworkManagerUtils.[ch] + - (nm_dispose_scan_results): remove, unused + +2005-10-14 Christopher Aillon + + * gnome/libnm_glib/libnm_glib.c: + * gnome/libnm_glib/libnm_glib.h: + Use guint instead of gint for callback IDs. + +2005-10-12 Christopher Aillon + + * gnome/applet/applet.c: + Fix icon animation smoothness issues. nmwa_redraw_timeout gets called + every 1000ms. It will unconditionally call nmwa_update_state which + kills the existing animation timeout and registers a new one with a + callback to draw a new frame every 100ms. There are 11 connecting + icon frames, so the last 2 frames kept getting dropped. Only reset + the animation timeout if we aren't animating. + +2005-10-11 Dan Williams + + * gnome/applet/applet-dbus-devices.c + - (nmwa_dbus_update_device_info_from_hal), (hal_net_physdev_cb): + We want to grab the product & vendor from net.physical_dev + rather than info.parent. + +2005-10-11 Dan Williams + + * src/NetworkManagerDevice.c + - Use the driver's WE version for scanning rather than + the WE version NM was compiled with. Fixes random + crashes in iw_scan () in iwlib. + +2005-10-10 Dan Williams + + * Remove nm_system_load_device_modules() from backend files + and from NetworkManager.c + +2005-10-10 Dan Williams + + * src/NetworkManagerPolicy.c + - Fix some bugs introduced by the capabilities patch + +2005-10-10 Dan Williams + + * gnome/applet/applet-dbus-info.c + - (nmi_dbus_get_network_key): hide the menu when putting up + the keyring dialog. (not sure if the code is right...) + +2005-10-09 Dan Williams + + Patch from Bill Moss + * src/NetworkManagerDevice.c + - (nm_device_set_user_key_for_network): don't try to set auth + mode on the AP from the allowed list if it's NULL + +2005-10-09 Dan Williams + + * Replace the "driver support level" stuff with capabilities. The + capability field is a bitfield that is more flexible than the + old driver support level thing. It's mostly so we can easily + figure out what supports WPA and what doesn't, but should be + quite useful later. + +2005-10-09 Dan Williams + + * test/nmtest.c + - Removed + + * test/nm-tool.c + test/Makefile.am + - Added new "nm-tool" tool that gives quite a bit more + information + +2005-10-07 Robert Love + + * gnome/applet/applet-dbus-info.c, gnome/applet/applet.c, + gnome/applet/applet.h, gnome/vpn-properties/nm-vpn-properties.c, + src/dhcp-manager/nm-dhcp-manager.c, test/libnm_glib_test.c, + test/nmtest.c test/nmtestdevices.c: mark functions 'static' as + appropriate + +2005-10-07 Robert Love + + * configure.in: Change our compile flags for the betterment of mankind. + Add "-Wstrict-prototypes" because we comply anyhow and missing a + prototype is very bad on 64-bit platforms as types default to int but + sizeof(int) != sizeof(long) and add "-Wmissing-prototypes" & + "-Wmissing-declarations" to warn if we define an exported function + but fail to put it in a header. + +2005-10-07 Robert Love + + * src/NetworkManagerWireless.c: remove stale, unused function, who goes + by the name nm_update_device_wireless_timeouts() and once tried, + without success, to steal my pet turtle. + +2005-10-07 Robert Love + + * Cleanup prototypes: put some functions in header files and mark + others as 'static' -- feel free to invert + * src/vpn-manager/nm-dbus-vpn.c: remove prototype of + nm_vpn_manager_vpn_connection_list_copy() + * src/vpn-manager/nm-vpn-act-request.c: remove prototype of + nm_vpn_service_get_dbus_connection() + * src/vpn-manager/nm-vpn-manager.h: add prototypes for + nm_vpn_manager_vpn_connection_list_copy() + * src/vpn-manager/nm-vpn-service.c: make + nm_vpn_service_act_request_failed() and + nm_vpn_service_stage2_daemon_wait() static + * src/vpn-manager/nm-vpn-service.h: add prototype for + nm_vpn_service_get_dbus_connection() + +2005-10-06 Christopher Aillon + + * gnome/applet/applet.c: + * gnome/applet/applet.h: + * gnome/applet/icons/Makefile.am: + Convey information about the current connection stage in the + icons themselves instead of creating a separate progress bar. + +2005-10-04 Robert Love + + * src/nm-dbus-device.c: Use iw_ether_ntop(), not ether_ntoa_r(), to + convert an ether_addr structure's MAC into a string, because the + latter will drop leading zero's and uses lower-case, e.g. 7:3b:4 + versus 07:3B:04, while the former will not. + +2005-10-04 Robert Love + + * gnome/applet/applet-dbus-devices.c, gnome/applet/applet.c, + gnome/applet/nm-device.c, gnome/applet/nm-device.h, + gnome/applet/wireless-applet.glade, src/nm-dbus-device.c: Display + default route in the 'Connection Information' dialog, send primary + and secondary name servers in in "getProperties" DBUS method, add + network_device_{get,set}_{primary,secondary}_dns(), The primary and + secondary domain name servers are crucial pieces of information + that a user might need in debugging a network problem. + +2005-10-04 Robert Love + + * gnome/applet/applet-dbus-devices.c, gnome/applet/applet.c, + gnome/applet/nm-device.c, gnome/applet/nm-device.h, + gnome/applet/wireless-applet.glade, src/nm-dbus-device.c: Display + default route in the 'Connection Information' dialog, send default + route in "getProperties" DBUS method, add network_device_set_route(), + and network_device_get_route(). The Gateway is a crucial piece of + connection-related information that a user might need in debugging a + network problem. + +2005-10-03 Robert Love + + * src/backends/NetworkManagerSuSE.c: Fix Glib error, GError must be + NULL. + +2005-10-02 Dan Williams + + * Shorten time taken to sleep by fastpathing bits of device deactivation + necessary for sleep. + + * Fix issue where deactivating a device might deactivate the active + VPN connection, even if the VPN was not using the device. + +2005-10-02 Dan Williams + + * gnome/applet/applet.c + - Adjust signal strength -> icon mapping values slightly + (so that 51% signal doesn't show a 75% icon) by adding + 5% to the values. ex: > 5% now shows 25% icon, > 30% + shows 50% icon, etc. + +2005-09-29 Robert Love + + * src/NetworkManager.c: removed unused variable. + +2005-09-28 Dan Williams + + Support for named + DBus, using Red Hat DBus patches for named. You + can find those patches here, with "dbus" in the patch's filename: + + http://cvs.fedora.redhat.com/viewcvs/devel/bind/ + + Don't forget the named dbus service file either. + + Instead of writing a config file and spawing a named process, NM will + use an already-running dbus-enabled named if it finds one. NM will + update named's forwarder configuration on the fly using dbus. + + If there is no dbus-enabled named running, NM will automatically fall + back to writing the most-recent DNS server information to /etc/resolv.conf + and calling nm_system_update_dns() to kick the system's resolver. + + Accordingly, all named-related configure-time options have been removed. + +2005-09-26 Robert Love + + * src/backends/NetworkManagerSuSE.c, (nm_system_get_dialup_config): Add + ISDN support! + * src/backends/NetworkManagerSuSE.c, (verify_and_return_provider): Fix + bug in error path if "ASKPASSWORD" is "no". + +2005-09-26 Robert Love + + * src/named-manager/nm-named-manager.c: only '#' is officially a valid + comment in /etc/resolv.conf -- ';' is not. + +2005-09-19 Dan Williams + + * src/backends/NetworkManagerRedHat.c: + * src/backends/NetworkManagerDebian.c: + * src/backends/NetworkManagerSlackware.c: + * src/backends/NetworkManagerGentoo.c: + * src/backends/NetworkManagerSUSE.c: + Fix invocations of "/sbin/ip address" to use short form instead + +2005-09-19 Christopher Aillon + + * src/nm-dbus-device.c: Don't assert when getting + addresses of a not yet connected interface. + + * gnome/applet/applet.c: Free icons if loading fails. + Use translator-credits so translators can make themselves known. + +2005-09-15 Christopher Aillon + + * src/NetworkManagerAP.c: + * src/NetworkManagerAP.h: + * src/NetworkManagerDevice.c: + Set a blacklist for certain common manufacturer default ESSIDs: + APs with these ESSIDs are extremely likely to be completely + different networks: connecting to one should not make NM + auto-connect to every other AP with the same default ESSID. + +2005-09-12 Christopher Aillon + + * gnome/applet/wireless-applet.glade: + The passphrase entry should also activate the default + + * src/gnome-keyring-md5.c: Updated code from gnome-keyring + + * gnome/applet/applet-dbus-devices.c: + * gnome/applet/applet.c: + * gnome/applet/nm-device.c: + * gnome/applet/nm-device.h: + * src/NetworkManagerUtils.c: + * src/NetworkManagerUtils.h: + * src/nm-dbus-device.c: + I've got a fever, and the only cure for it is less ioctl. + Make NM push IP data rather than make the applet open a socket + to the device. + +2005-09-10 Christopher Aillon + + * gnome/applet/applet.c: + * gnome/applet/applet-dbus-devices.c: + * gnome/applet/applet-dbus-info.c: + * gnome/applet/passphrase-dialog.c: + * gnome/libnm_glib/libnm_glib.c: + * gnome/vpn-properties/nm-vpn-properties.c: + * src/autoip.c: + * src/backends/NetworkManagerRedHat.c: + * src/named-manager/nm-named-manager.c: + * src/NetworkManagerAPList.c: + * src/NetworkManager.c: + * src/NetworkManagerDbus.c: + * src/NetworkManagerDevice.c: + * src/NetworkManagerPolicy.c: + * src/NetworkManagerSystem.c: + * src/nm-dbus-device.c: + * src/nm-dbus-nm.c: + * src/vpn-manager/nm-vpn-manager.c: + * src/vpn-manager/nm-vpn-service.c: + * test/libnm_glib_test.c: + * test/nminfotest.c: + * test/nmtestdevices.c: + Fix a bunch of 'unused variable' compiler warnings + + * NetworkManager.h: + * gnome/applet/applet-dbus-info.c: + * gnome/applet/applet-dbus-info.h: + * gnome/applet/applet.c: + * gnome/applet/applet.h: + * src/NetworkManager.c: + * src/NetworkManagerDbus.c: + * src/NetworkManagerDbus.h: + * src/NetworkManagerDevice.c: + * src/NetworkManagerDevice.h: + * src/NetworkManagerMain.h: + * src/NetworkManagerWireless.c: + * src/NetworkManagerWireless.h: + * src/nm-dbus-nm.c: + Make NetworkManager be smart about how frequently to scan + based on its current state. Remove the UI for choosing when + to scan. Scanning still may disabled completely by the user + via the "Wireless Enabled" menu item. + +2005-09-09 Christopher Aillon + + * gnome/applet/applet.c: + Also overlay the vpn connecting icons onto the wired icon, + when appropriate. + + * gnome/vpn-properties/nm-vpn-properties.glade: + Clean up a few strings to use better grammar and proper casing. + +2005-09-08 Christopher Aillon + + * gnome/applet/vpn-connection.c: + * gnome/applet/vpn-connection.h: + Add nmwa_vpn_connection_is_activating () + + * gnome/applet/applet.c: + * gnome/applet/applet.h: + * gnome/applet/icons/nm-vpn-connecting*.png: + Add new VPN connecting icons from Diana Fong , letting + the user know something's happening between clicking the VPN item and it + actually being connected. + +2005-09-07 Christopher Aillon + + * gnome/applet/applet-dbus-info.c: need to free attributes in the + failure case as well. + +2005-09-07 Rodrigo Moya + + * gnome/panel/eggtrayicon.[ch]: + * examples/python/systray/eggtrayicon.[ch]: updated code from libegg. + +2005-09-07 Dan Williams + + Patch from Bill Moss + * src/applet-dbus.c + - (nmwa_dbus_filter): strip whitespace from beginning + and end of VPN login banner + +2005-09-07 Dan Williams + + * The great VPN Manager rewrite of 2005 + +2005-09-07 Christopher Aillon + + * gnome/applet/menu-items.c: + * gnome/applet/nm-device.c: + * gnome/applet/wireless-network.c: + * gnome/libnm_glib/libnm_glib.c: + * src/NetworkManagerDbusUtils.c: + * vpn-daemons/vpnc/src/nm-vpnc-service.c: + g_malloc0 doesn't return NULL + +2005-09-06 Dan Williams + + Patch from Tomislav Vujec + * src/NetworkManagerDevice.c + - (nm_get_device_by_udi): don't return a device when we + actually didn't find what we were looking for + +2005-09-06 Christopher Aillon + + * gnome/applet/applet-dbus-devices.c: + * gnome/applet/applet-dbus-devices.h: + * gnome/applet/applet-dbus.c: + * src/NetworkManagerDbus.c: + * src/NetworkManagerDbus.h: + * src/NetworkManagerDevice.c: + * src/nm-dbus-device.c: + Make NM push updates about active device strength when it changes, + rather than having the applet poll every 2s. + +2005-09-05 Christopher Aillon + + * gnome/applet/applet-dbus-devices.c: Remove duplicate call to + network_device_set_strength + +2005-09-04 Dan Williams + + Patch from Bill Nottingham + * src/NetworkManagerDevice.c + - (nm_device_activation_cancel): reset the quit_activation flag + +2005-09-04 Dan Williams + + * src/nm-activation-request.c + - (nm_act_request_unref): actually free the structure, + which we didn't seem to be doing before + +2005-09-04 Dan Williams + + Patch from John Palmieri + * gnome/applet/applet-dbus-devices.c + - Fix up unreffing of DBusMessage objects + +2005-09-04 Dan Williams + + Patch from John Palmieri + * gnome/applet/nm-device.c + - (nm_device_unref): clear network_device's memory _before_ freeing it + +2005-09-02 Christopher Aillon + + * gnome/applet/applet.c: Use a check menu item for Wireless Enabled + +2005-09-02 Bill Nottingham + + * src/backends/NetworkManagerRedHat.c: use nm_warning, not nm_error + +2005-09-01 Dan Williams + + * src/NetworkManager.c + - (nm_remove_device_from_list): rename to nm_remove_device + - (nm_hal_device_removed): call nm_remove_device() + + * src/NetworkManagerDevice.c + - Change the NMWirelessScanCB member 'reschedule' which + wasn't used to 'force' to indicate that we need to + force a scan when adding a device + + * src/nm-dbus-nm.c + - (nm_dbus_nm_sleep): Deactivate all devices and remove them + from the device list + - (nm_dbus_nm_wake): Re-add all devices to the device list + +2005-09-01 Robert Love + + * gnome/applet/applet.c: nmwa_update_info: iface is used uninitialized + and the check "!iface" in the error case is probably never true. + +2005-09-01 Dan Williams + + Patch from Bill Nottingham + * src/backends/NetworkManagerRedHat.c + - Add initial dialup support to Red Hat/Fedora backend + +2005-09-01 Dan Williams + + * gnome/applet/applet-dbus-devices.c + - Sort both wireless networks and devices again, which got + broken when removing threading + +2005-09-01 Christopher Aillon + + * gnome/applet/applet.c: + Only show the "Stop/Start All Wireless Devices" menuitem + if we actually have wireless devices. + + * gnome/applet/applet-dbus-info.c: + * gnome/applet/applet.c: + * gnome/applet/other-network-dialog.c: + * gnome/applet/vpn-password-dialog.c: + Drop the gtk_dialog_run () calls in favor of connecting to + "response" signals, needed now that the applet is not threaded. + +2005-08-31 Dan Williams + + Patch from Bill Moss + * src/NetworkManagerDevice.c + - (nm_device_wireless_scan): fix scan timeout values + +2005-08-30 Dan Williams + + * gnome/applet/wireless-applet.glade + - HIG-ify the Other Wireless Networks dialog a bit more + - Fix some potential segfaults in the info dialog + +2005-08-30 Dan Williams + + * gnome/applet/applet-dbus-devices.c + - Remove nmwa_dbus_get_hal_device_string_property(); unused + +2005-08-30 Dan Williams + + * gnome/applet/applet-dbus.[ch] + - Remove all the nmwa_dbus_call_method_xxxx functions since + they weren't being used anyway + +2005-08-30 Bastien Nocera + + * test/nmtestdevices.c: (print_usage), (main): + Check the number of arguments, and fix a typo + +2005-08-29 Dan Williams + + Patch from Dumitru Ciobarcianu + * gnome/applet/applet.c + - Define GTK_STOCK_INFO for GTK 2.6 and lower + +2005-08-29 Dan Williams + + * gnome/applet/* + - Don't use threads any more. Anything that blocks + (like gtk_dialog_run()) will have to get fixed up which + should happen quickly. We really only had threads to make + the animation smooth, and when everything got converted over + to DBus Pending Calls, the need for threads kind of went away + +2005-08-29 Christopher Aillon + + * gnome/applet/applet.c: Draw VPN connections as radio items + since we don't yet support multiple VPNs. + * gnome/applet/other-network-dialog.c: Use stock icon for Connect + * gnome/vpn-properties/nm-vpn-properties.c: Use stock icon for Delete + +2005-08-29 Dan Williams + + Patch from j@bootlab.org + - Make --without-named work + - Make --with-dhcdbd work correctly + +2005-08-27 Josep Puigdemont i Casamajó + + * configure.in: Added "ca" to ALL_LINGUAS. + +2005-08-26 Christopher Aillon + + * Fix up VPN state handling between the applet and NetworkManager, + so that the applet doesn't show a VPN as connected when one + really is not + - The applet no longer has a pointer to the active VPN's + name, but tracks each VPNs state individually + - NM no longer has a "getActiveVPNConnection" method + - NM no longer broadcasts the "VPNConnectionChange" signal + - NM now broadcasts a "VPNConnectionStateChange" signal + whenever the state of a VPN changes + +2005-08-26 Dan Williams + + * gnome/applet/applet-dbus-devices.c + gnome/applet/applet-dbus-vpn.c + - Remove calls to dbus_pending_call_ref() because we already + "own" the pending call + - Remove calls to dbus_pending_call_get_completed() because + when we are in the callback, the pending call is completed + by definition + +2005-08-22 Dan Williams + + Patch by Bill Moss + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_cancel_transaction): Give dhcdbd/dhclient + some time to send out a RELEASE if they like + +2005-08-22 Dan Williams + + Noticed by Bill Moss + * src/NetworkManagerDbus.c + - (nm_dbus_get_user_key_for_network_cb): deactivate the device + instead of just cancelling its activation + + * src/NetworkManagerDevice.c + - (nm_device_deactivate): some small cleanups + - (nm_device_set_user_key_for_network): deactivate the device + instead of just cancelling its activation + +2005-08-22 Dan Williams + + Noticed by Bill Moss + * src/NetworkManagerDevice.c + - (nm_device_wireless_scan): fix scan timeout, we were + waiting way too long for scans to complete + +2005-08-22 Dan Williams + + Patch from j@bootlab.org: + * src/backends/NetworkManagerDebian.c + - Make the Debian backend work for static IP again + +2005-08-20 Christopher Aillon + + * gnome/applet/other-network-dialog.c: + The "Create New Network" and "Connect to Other Network" + dialogs share alot of code, but shouldn't share a window + title. Give them different ones. + + * gnome/applet/wireless-applet.glade: + * vpn-daemons/vpnc/auth-dialog/gnome-two-password-dialog.c: + Some more minor UI tweaks. + +2005-08-19 Christopher Aillon + + * gnome/applet/other-network-dialog.c: + * gnome/applet/wireless-applet.glade: + Also need mnemonic widgets, and underline enabled. + +2005-08-19 Dan Williams + + * vpn-daemons/vpnc/nm-vpnc-service.c + - (vpnc_watch_cb): remove no-longer-relevant comment + - (write_config_option): new function, helper to write + config options to vpnc's stdin + - (nm_vpnc_config_write): use the new helper, make the + code shorter + +2005-08-19 Christopher Aillon + + * gnome/applet/passphrase-dialog.c: + * gnome/applet/wireless-applet.glade: + Make the passphrase dialog response based, and treat + responses other than OK (such as Esc, [X]) as a cancel. + +2005-08-18 Christopher Aillon + + * initscript/Gentoo/NetworkManager: + * initscript/RedHat/NetworkManager: + * initscript/RedHat/NetworkManagerDispatcher: + * initscript/SUSE/networkmanager: + CVS remove these in place of .in replacements + + * configure.in: + * initscript/Gentoo/NetworkManager.in: + * initscript/RedHat/NetworkManager.in: + * initscript/RedHat/NetworkManagerDispatcher.in: + * initscript/SUSE/networkmanager.in: + These scripts now are generated so they work still when + NM is built using a bindir other than /usr/bin + +2005-08-18 Dan Williams + + * gnome/applet/main.c + - Revert previous change for --no-session since + --sm-disable does the same thing + +2005-08-18 Dan Williams + + * gnome/applet/applet-dbus-info.c + - (nmi_dbus_create_error_message): new function + - (nmi_dbus_get_key_for_network): correctly use dbus error creation + functions. Also don't check for both device _and_ network before + asking for a user's key, because we may not have gotten all our + networks back from NM quite yet (due to the dbus pending calls + coming in later). Fixes a hang in NM/nm-applet. + + * src/NetworkManagerDbus.c + - (nm_dbus_get_user_key_for_network_cb): handle error conditions in a + slightly more sane manner, even though we are still broken for + certain other error conditions. + - (nm_dbus_get_user_key_for_network): need to pass the network's essid + to the info-daemon too + + * src/NetworkManagerDevice.c + - Fix some debug messages to be info messages instead + +2005-08-18 Dan Williams + + * gnome/applet/main.c + - Add new "--no-session" parameter that disables applet + session management, ie for testing + +2005-08-18 Christopher Aillon + + * gnome/applet/other-network-dialog.c: + * gnome/applet/wireless-applet.glade: More mnemonics + +2005-08-17 Robert Love + + * initscript/SUSE/networkmanager: update + +2005-08-17 Dan Williams + + * Tag NM_0_4_1_RELEASE + +2005-08-17 Christopher Aillon + + * gnome/applet/applet.c: More translatable string cleanup + + +2005-08-17 Dan Williams + + * gnome/applet/applet-dbus-info.c + - (nmi_dbus_get_key_for_network): Grab new "new_key" parameter + from the dbus message, which tells us to unconditionally + ask the user for a new key. Otherwise, we pull the key from + the keyring and return it. If we fail to get the key from the + keyring, we ask the user for a new key. + - (nmi_dbus_get_network_key): new function to grab the key for + an essid from the keyring. + - (nmi_dbus_get_network_properties): don't access the keyring here. + Also, don't return any key in the dbus message. + + * src/NetworkManagerDbus.[ch] + - (nm_dbus_get_user_key_for_network): Add "new_key" parameter to + indicate that we unconditionally want a new key. This function + is now also used to get keys from the info-daemon which are + pre-stored, not just for asking the user for a new key. The + "new_key" parameter indicates whether or not we wish to ask the + user for a new key. + - (nm_dbus_get_network_data_cb): we no longer get a key from the + info-daemon in the return message, so use NULL instead. The + key will be filled in at connect time by calling + nm_dbus_get_user_key_for_network() + + * src/NetworkManagerDevice.c + - (nm_device_wireless_configure): update for "new_key" param to + nm_dbus_get_user_key_for_network(). We initially set new_key + to FALSE to see if we have a stored key in the info-daemon, but + if the connection is unsuccessful at this stage we request a + new one + +2005-08-17 Dan Williams + + * gnome/applet/icons/nm-no-connection.png + gnome/applet/icons/nm-device-wired.png + - Use Diana's new RJ45 connector icons + +2005-08-17 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_device_change_check): clarify switching rules if + both new and old devices are valid; mainly, don't switch + away from user-requested wireless connection back to a wired + one + +2005-08-17 Dan Williams + + * gnome/applet/Makefile.am + - Relocate the applet to /usr/bin since it is no longer + executed by anything, but directly by the user + +2005-08-17 Dan Williams + + Patch from Bill Moss + + * gnome/applet/applet-dbus-info.[ch] + - (nmi_save_network_info): save timestamp for network if it + was a change requested by the user + - (nmi_dbus_update_network_info): get user_requested from dbus + message and pass to nmi_save_network_info() + + * gnome/applet/applet.c + - (nmwa_update_network_timestamp): remove + - (nmwa_menu_item_activate): don't set timestamp on networks + here, only after a successful connect in nmi_save_network_info() + + * src/NetworkManagerDbus.[ch] + - (nm_dbus_update_network_info): pass user_requested into the + dbus message + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): pass user_requested to + nm_dbus_update_network_info() + +2005-08-16 Robert Love + + * gnome/applet/applet.c: Better "Dial Up" menu item. + +2005-08-16 Robert Love + + * gnome/applet/applet.c: use GTK_STOCK_INFO not PROPERTIES for the + "Connection Information" menu item. + +2005-08-16 Dan Williams + + Patch from j@bootlab.org + * vpn-daemons/vpnc/Makefile.am: Fix for autoreconf + + * configure.in: allow specifying the path to dhcdbd + +2005-08-16 Robert Love + + Patch from j@bootlab.org + * src/backends/NetworkManagerDebian.c, src/backends/interface_parser.c, + src/backends/interface_parser.h: Debian dialup support. + +2005-08-16 Christopher Aillon + + * vpn-daemons/vpnc/properties/nm-vpnc-dialog.glade: + * gnome/applet/applet.c: Add some mnemonics for VPNC + + * vpn-daemons/.cvsignore: fix this up a little bit + +2005-08-16 Robert Love + + * src/backends/NetworkManagerSuSE.c: improve the SUSE-backend dial up + support. + +2005-08-16 Christopher Aillon + + * gnome/applet/applet.c: Split markup out of translatable strings + and clean up logic a little bit. (fixes #309012) + +2005-08-15 Christopher Aillon + + * gnome/vpn-properties/nm-vpn-properties.c: + * gnome/vpn-properties/nm-vpn-ui-interface.h: + * vpn-daemons/vpnc/properties/nm-vpnc.c: + Makeshift fix to remove newlines from translatable strings. + Note that we now return an allocated string, so callers of + get_confirmation_details () must now call g_free () on the + result. (fixes #309033). + +2005-08-12 Robert Love + + * gnome/applet/applet-dbus.c: remove newlines from translatable + strings--not needed here anyway. (fix b.g.o #309011) + * src/nm-netlink.monitor.c: don't translate "%s" (fix b.g.o #172391) + +2005-08-11 Robert Love + + * gnome/applet/applet.c: mark string as translatable. + +2005-08-11 Robert Love + + * initscript/SUSE/networkmanager: update. + +2005-08-11 Dan Williams + + * src/nm-dhcp-manager.c + - (nm_dhcp_manager_get_ip4_config): if for some reason we don't get + an gateway returned from DHCP, try to use the address of the DHCP + server as the gateway instead. Found by Ralf Ertzinger. + +2005-08-10 Robert Love + + * gnome/applet/applet.c: Make applet->dbus_thread joinable so we can + wait for it on exit; call exit() in nmwa_destroy() to jump ship. + +2005-08-10 Dan Williams + + Patch from Bill Moss + * Consolidate writes of access point information updates to the info daemon + so that we only do it when the connection to the access point was + successful. Also consolidates updates to GConf in the Gnome applet. + + * src/nm-netlink-monitor.c + - Silence compile warning when calling g_object_new() + +2005-08-08 Dan Williams + + Patch from Steev : + * src/backends/NetworkManagerGentoo.c + - Stub new dialup backend functions + +2005-08-08 Dan Williams + + Patch from Colin Slater: + * src/backends/NetworkManagerGentoo.c + - (nm_system_update_dns): Fix exit status check for restarting + nscd + +2005-08-05 Robert Love + + * NetworkManager.h, + gnome/applet/applet-dbus-devices.c, + gnome/applet/applet-dbus-devices.h, + gnome/applet/applet-dbus.c, + gnome/applet/applet.c, + gnome/applet/applet.h, + src/NetworkManager.c, + src/NetworkManagerMain.h, + src/NetworkManagerSystem.h, + src/backends/NetworkManagerRedHat.c, + src/backends/NetworkManagerSuSE.c, + src/nm-dbus-nm.c: basic dialup support using distro infrastructure + +2005-08-05 Robert Love + + * gnome/applet/other-network-dialog.c: default the adhoc network to the + machine's hostname to make adhoc creation idiot-proof. + +2005-08-04 Robert Love + + * gnome/applet/other-network-dialog.c: fix leak. "label" needs to be + freed. + +2005-08-04 Dan Williams + + * gnome/applet/applet-dbus-info.c + gnome/applet/applet-dbus-info.h + - (nmi_dbus_update_network_auth_method->nmi_save_network_info): generalize + to store key, key type, and auth method rather than just auth method + - (nmi_dbus_update_network_info): new function + - (nmi_dbus_info_message_handler): updateNetworkAuthMethod -> updateNetworkInfo + + * gnome/applet/passphrase-dialog.c + - (nmi_passphrase_dialog_ok_clicked): call nmi_save_network_info() instead + of saving the info ourselves + + * gnome/libnm_glib/libnm_glib.c + - Remove the stupid version check for dbus + + * src/NetworkManagerAP.c + src/NetworkManagerAP.h + - (nm_ap_get_enc_key_source): return 'const char *' rather than 'char *' + + * src/NetworkManagerDbus.c + src/NetworkManagerDbus.h + - (nm_dbus_update_network_auth_method -> nm_dbus_update_network_info): Update + more than just the auth method + + * src/NetworkManagerDevice.c + - Update network info at the appropriate times + +2005-07-29 Ray Strode + + * src/NetworkManager.c (nm_info_handler): don't use input as format + string (Spotted by Ian Jackson). + +2005-07-27 Dan Williams + + * src/nm-dbus-nm.c + src/nm-dbus-net.c + - Random cleanups of spacing + + * gnome/applet/applet.h + gnome/applet/other-network-dialog.c + gnome/applet/passphrase-dialog.c + - Conslidate usage of NMWAEncryptionKeyTypes enum + + Patch from Bill Moss: + - Make Other Wireless Networks work again with encryption keys + +2005-07-26 Dan Williams + + Patch from Steev : + * src/backends/NetworkManagerGentoo.c + src/backends/Makefile.am + - Fix up Gentoo backend + +2005-07-26 Robert Love + + * src/backends/NetworkManagerSuSE.c: misc. cleanup + +2005-07-25 Robert Love + + * gnome/applet/applet.c: make the "Wired" menu item a radio button, + in the same group as the wireless networks, since they are all + mutually exclusive. + +2005-07-24 Ray Strode + + * src/nm-netlink-monitor.c (nm_netlink_monitor_new): + remove unneeded NULL arg from g_object_new(). Any + warnings caused by not having the extra NULL are just a + result of a bug in glib 2.7.0 - 2.7.2. + +2005-07-22 Robert Love + + * gnome/libnm_glib/libnm_glib.c: support D-BUS version 0.35, too + +2005-07-22 Robert Love + + * src/nm-netlink-monitor.c: g_object_new() needs at least three + parameters (gcc 4.0.2 warning fix). + +2005-07-18 Robert Love + + Suggested by Aaron Bockover (abockover@novell.com) + * gnome/applet/other-network-dialog.c: ASCII is an acronym, thus + s/Ascii/ASCII + * gnome/applet/passphrase-dialog.c: ditto + * gnome/applet/wireless-applet.glade: ditto + +2005-07-13 Dan Williams + + Patch from Ray Strode + * vpn-daemons/vpnc/nm-vpnc-service.c + - Don't let vpnc daemonize, fixes some races with PID file reading + +2005-07-13 Dan Williams + + Patch from Ray Strode + * Random cleanups for strict CFLAGS + +2005-07-07 Dan Williams + + Patch from Derek Atkins + * src/nm-dbus-net.c: + - (nm_dbus_get_ap_from_object_path): differentiate similar ESSIDs + +2005-07-07 Dan Williams + + Patch from Jos Dehaes + * src/backends/NetworkManagerGentoo.c + - Gentoo backend Static IP nameserver fixes + - General Gentoo backend goodness + +2005-07-07 Dan Williams + + Patch from Bastien Nocera: + * gnome/applet/applet.c + - Fix up error reporting when icons or glade files are missing + +2005-07-07 Robert Love + + * gnome/applet/applet.c: do not draw the VPN menu's seperator if there + are not any VPN connections above it. + +2005-07-07 Robert Love + + * gnome/applet/applet.c: whoops, left some "dog" debugging code in. + +2005-07-05 Robert Love + + * src/NetworkManagerSystem.c: bail out if asked to set a gateway of + zero. + +2005-07-05 Robert Love + + * src/NetworkManagerDevice.c: use link-local (autoip) on DHCP failure + on wired or unencrypted wireless. + +2005-07-01 Robert Love + + * src/NetworkManagerSystem.c: Print the error via strerror(). + +2005-06-30 Robert Love + + * gnome/vpn-properties/nm-vpn-properties.c: display an error dialog and + then exit if the glade file is not found. currently the application + just hangs. + +2005-06-30 Robert Love + + * src/nm-dbus-nm.c: Patch by Bill Moss to + explicitly up all interfaces on wake from sleep. + +2005-06-30 Robert Love + + * gnome/applet/applet.c: Add right-click menu item "Connection Info" + with information about the currently active connection. + * gnome/applet/applet.h: (ditto) + * gnome/applet/wireless-applet.glade: (ditto), new file + +2005-06-30 Robert Love + + * src/NetworkManagerDevice.c: g_malloc0 cannot fail. + * src/nm-dbus-nm.c: print when we sleep and wake up. + * gnome/applet/menu-items.c: whitespace, misc. cleanup. + * configure.in: look in "/usr/sbin" for dhcdbd, too. (it shouldn't be + in /sbin unless D-BUS is, folks). + * README: update to reflect nm-applet replacing NetworkManagerInfo. + +2005-06-27 Robert Love + + * src/nm-dbus-nm.c: fix "setWirelessEnabled" call for the enabling + case. + +2005-06-27 Robert Love + + * gnome/applet/applet.c: make the 'Wireless Network Discovery' menu + items radios. + +2005-06-26 Robert Love + + * src/NetworkManagerDevice.c: be specific about which device in + nm_info() message. + +2005-06-23 Adam Weinberger + + * src/nm-netlink-monitor.c: correct spelling error. + +2005-06-23 Robert Love + + * gnome/applet/applet-dbus-info.c: gnome keyring support! + * gnome/applet/passphrase-dialog.c: more of that keyring! + +2005-06-23 Robert Love + + * configure.in: remove extraneous GNOMEKEYRING directives. + * gnome/applet/Makefile.am: s/GNOMEKEYRING/GNOME_KEYRING/. + * gnome/applet/applet.c: nmwa_icons_init: make style local. + * gnome/applet/passphrase-dialog.c: whitespace. + +2005-06-23 Robert Love + + * src/NetworkManagerDevice.c: division in assignment was flipped. + +2005-06-23 David Zeuthen + + * gnome/applet/vpn-password-dialog.c (child_stdout_data_cb): Send a + signal to the child to indicate that we got what we wanted when we + see two new-lines right after each other. + (nmwa_vpn_request_password): Pass a structure with several members + instead of just the passwords + +2005-06-23 Dan Williams + + * src/NetworkManager.c + src/NetworkManagerMain.h + - (nm_get_hal_ctx): new function, move Hal initialization code here + - (nm_hal_init): new function, init libhal context then add devices + - (nm_hal_deinit): new function, clean up libhal context + - (nm_data_free): Move Hal cleanup here + - (main): check whether Hal is running, and if so, get a list of + network devices from it + + * src/NetworkManagerDbus.c + - (nm_dbus_signal_filter): trap NameOwnerChanged signals for Hal, + and when it appears, get a list of network devices from it. If + Hal goes away, clean up the libhal context + +2005-06-22 Robert Love + + * dispatcher-daemon/NetworkManagerDispatcher.c: fix FIXME: check + permissions of scripts before executing. + +2005-06-21 Robert Love + + * initscript/SUSE/networkmanager: update. + * src/backends/NetworkManagerSuSE.c: cleanup. + +2005-06-21 Robert Love + + * gnome/applet/applet.c: use menu mnemonics. + * gnome/applet/menu-items.c: (ditto) + +2005-06-21 Robert Love + + * applet/applet-dbus-devices.c: mark non-static functions static. + * applet/applet-dbus-vpn.c: (ditto) + * applet/applet.c: (ditto) + * applet/nm-device.h: (ditto) + * applet/other-network-dialog.c: (ditto) + * applet/passphrase-dialog.c: (ditto) + * NetworkManager.c: (ditto) + * NetworkManagerDbus.c: (ditto) + * NetworkManagerDevice.c: (ditto) + * NetworkManagerPolicy.c: (ditto) + * NetworkManagerUtils.c: (ditto) + * NetworkManagerWireless.c: (ditto) + * NetworkManagerWireless.h: (ditto) + * nm-netlink-monitor.c: (ditto) + * applet/applet-dbus-info.c: (ditto), add FIXME's. + * vpn-manager/nm-dbus-vpn.c: (ditto), remove shadowed variable. + * autoip.c: include autoip.h. + * autoip.h: new file. define get_autoip(). + * nm-netlink-monitor.h: define nm_netlink_close_connection(). + * NetworkManagerDbus.h: remove duplicate definitions. + +2005-06-20 Robert Love + + * Makefile.am: Add missing intltool-foo.in generated files to + EXTRA_DIST so that 'distcheck' works. Also add DISTCLEANFILES + with the start of stuff to cleanup on 'distclea'. + * configure.in: add AC_PROG_INTLTOOL macro so that we do the intltool + stuff right and 'distcheck' works. + * po/POTFILES.in: Remove examples/python/systray/eggtrayicon.c. If + we keep it, we need to add all of examples/* to EXTRA_DIST and do + Makefile.am for each. And systray/Makefile needs to be redone. + +2005-06-19 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_wireless_process_scan_results): scan every 20s when + disconnected and scanning is ALWAYS_SCAN or WHEN_UNASSOCIATED + +2005-06-19 Dan Williams + + * WEXT_DEBUG->IOCTL_DEBUG, extend checking to all ioctl() calls + +2005-06-18 Ray Strode + + * src/nm-netlink-monitor.c + (nm_netlink_monitor_event_handler): check for the presence + of either error condition not both. + + (nm_netlink_monitor_error_handler): emit error signal if + error occurs. + + (nm_netlink_monitor_event_handler), + (nm_netlink_monitor_error_handler), + (nm_netlink_monitor_disconnect_handler): if an + assertion fails disconnect the event handler to prevent + infinite loops. + + * src/nm-netlink-monitor.h: add new error condition + NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA + +2005-06-18 Ray Strode + + * src/nm-netlink-monitor.c + (nm_netlink_monitor_event_handler): remove bogus < 0 + check on unsigned value and return early if the kernel + didn't send any bytes. + +2005-06-17 Robert Love + + * initscript/SUSE/networkmanager: Change the Provides and default + run levels + +2005-06-16 Dan Williams + + Patch from Robert Love: + * gnome/applet/applet.c + - Beautify some applet menu item names + +2005-06-17 David Zeuthen + + * gnome/vpn-properties/nm-vpn-ui-interface.h: Require users of this + API to define NM_VPN_API_SUBJECT_TO_CHANGE to acknowledge API churn. + Also add new methods can_export, import_file and export. + + * gnome/vpn-properties/nm-vpn-properties.glade: Add an Export button + to the main UI + + * gnome/vpn-properties/nm-vpn-properties.c: + Define NM_VPN_API_SUBJECT_TO_CHANGE so we can actually include + nm-vpn-ui-interface.h. + (update_edit_del_sensitivity): Also update "Export" sensitivity + (add_vpn_connection): Also add new SVC_NAME column + (import_settings): New function + (retrieve_data_from_selected_connection): New function + (edit_cb): Use retrieve_data_from_selected_connection to simplify + this function + (export_cb): New function + (init_app): Also setup the "export" widget + (main): Support the --import-service and --import-file commandline + arguments + + * gnome/libnm_glib/libnm_glib.c (libnm_glib_dbus_filter): Also support + D-BUS 0.34 + +2005-06-16 Dan Williams + + Patch from Robert Love: + * gnome/applet/menu-items.c + - (network_menu_item_new): pass -1 as wireless network + menu items height size request rather than ascent / 2 + +2005-06-16 Dan Williams + + * Clean up wording in Wireless Scan Methods menu items and constants + +2005-06-16 Robert Love + + * po/POTFILES.in + - remove gtkcell* files + +2005-06-15 Dan Williams + + Patch from Robert Love: make the applet stetic + + * gnome/applet/Makefile.am + - Don't compile the gtkcellview and gtkcellrendererprogress files + + * gnome/applet/gtkcellview.h + gnome/applet/gtkcellview.c + gnome/applet/gtkcellrendererprogress.h + gnome/applet/gtkcellrendererprogress.c + - Removed + + * gnome/applet/menu-items.c + - Progress bars are 5:1 size ratio + - Use GTK progress bars rather than internal ones + +2005-06-15 Dan Williams + + Patch from Robert Love: + * initscript/SUSE/networkmanager + - Fix typo + +2005-06-15 Dan Williams + + * src/backends/NetworkManagerSuSE.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerDebian.c + - (set_ip4_config_from_resolv_conf): Fix typo I made, '==' -> '=' + +2005-06-15 Dan Williams + + * src/backends/NetworkManagerDebian.c + - Add nm_system_device_get_use_dhcp() to debian backend + + Patch from Kay Sievers: + * src/backends/NetworkManagerSuSE.c + - Update debian backend for static IP nameservers + + * src/NetworkManagerDevice.c + - Actually set the device to use static IP or DHCP rather + than always DHCP + +2005-06-15 Dan Williams + + Patch from Thom May: + * src/backends/NetworkManagerDebian.c + - Update debian backend for static IP nameservers + +2005-06-15 Dan Williams + + Patches from Robert Love: + * gnome/applet/wireless-applet.glade + - Tighten up wording + + * src/NetworkManagerDevice.c + - Remove misplaced ';' + + * configure.in + initscript/Makefile.am + initscript/SUSE/Makefile.am + initscript/SUSE/networkmanager + - Add SUSE initscript + +2005-06-12 David Zeuthen + + * gnome/vpn-properties/nm-vpn-ui-interface.h: New file + + * gnome/vpn-properties/nm-vpn-properties.glade: New file + + * gnome/vpn-properties/nm-vpn-properties.c: New file + + * gnome/vpn-properties/Makefile.am: New file + + * src/vpn-manager/nm-vpn-manager.h: Rework prototypes to take an + array of passwords + + * src/vpn-manager/nm-vpn-manager.c + (nm_vpn_manager_activate_vpn_connection): Take an array of passwords + instead of just a single one + + * src/vpn-manager/nm-dbus-vpn.c: + (nm_dbus_vpn_get_vpn_connection_properties): Also append service_name + here + (nm_dbus_vpn_activate_connection): Rework to take an array of passwords + + * gnome/applet/vpn-password-dialog.h (nmwa_vpn_request_password): + Change the interface here to give a list of passwords. Also, don't + require username, but do require service + + * gnome/applet/vpn-password-dialog.c: Look up the VPN .name files for + the binary for the auth-dialog and use that instead of putting up a + dialog asking for a single password + + * gnome/applet/vpn-connection.[ch]: Don't remember the user_name, + however do remember the service + + * gnome/applet/main.c (main): Setup i18n + + * gnome/applet/applet.c (nmwa_update_state): Add a line "VPN + connection to '%s'" to the tooltip if we are connected using VPN + (nmwa_menu_vpn_item_activate): Check last_attempt_success gconf + key to determine whether we the auth-dialog needs to + reprompt. Also cope with the fact that the auth-dialog now returns + an array of passwords. + (nmwa_menu_configure_vpn_item_activate): New handler for + "Configure VPN..." menu item + (nmwa_menu_add_vpn_menu): Add the "Configure VPN..." menu item + (is_vpn_available): New function to determine if we got any + NM-compatible VPN software installed + (nmwa_menu_add_devices): Use is_vpn_available to add VPN menu + items only if we have NM-compatible VPN software installed + (nmwa_gconf_vpn_connections_notify_callback): Slightly rework the + logic for detecting when VPN connections are removed + + * gnome/applet/applet-dbus.h: Removed the prototypes for + nmwa_dbus_vpn_activate_connection, nmwa_dbus_vpn_deactivate_connection + since these are defined elsewhere + + * gnome/applet/applet-dbus.c (set_vpn_last_attempt_status): New + function used to keep track of whether the last attempt succeded + (nmwa_dbus_filter): Update last_attempt according to whether the + VPN connection could be established or not + + * gnome/applet/applet-dbus-vpn.h (nmwa_dbus_vpn_deactivate_connection): + Change prototype to take an array of passwords, not just a single + password + + * gnome/applet/applet-dbus-vpn.c (nmwa_dbus_vpn_properties_cb): Only + update service, not user + (nmwa_dbus_vpn_remove_one_vpn_connection): Check that applet-> + dbus_active_vpn_name is not NULL before using it + (nmwa_dbus_vpn_activate_connection): Send the passwords as a + string array instead of assuming a single password + + * gnome/applet/applet-dbus-info.c: + (nmi_dbus_get_vpn_connection_properties): Use the logged in user for + user name; don't read from gconf + + * gnome/applet/Makefile.am: Also export SYSCONFDIR and + VPN_NAME_FILES_DIR + + * gnome/Makefile.am (SUBDIRS): Add vpn-properties + + * configure.in: Add checks for gmodule-2.0. + Generate gnome/vpn-properties/Makefile. Don't generate any Makefile's + in vpn-daemons nor vpn-daemons/vpnc. We have separate autotooled + projects under vpn-daemons now. See vpn-daemons/vpnc/Changelog + for details + + * vpn-daemons/Makefile.am: Removed + + * vpn-daemons/README: New file to describe extensions points for VPN + software + +2005-06-10 Dan Williams + + * src/backends/NetworkManagerRedHat.c + - (get_current_profile_name): new function, grab current network profile name from + /etc/sysconfig/network + - (set_ip4_config_from_resolv_conf): new function, parse a resolv.conf and + update an IP4 Config structure's settings from it + - (nm_system_device_get_system_config): if we're using static IP on this device, + get DNS info from current network profile + +2005-06-09 Dan Williams + + Patch from Robert Love: + * src/NetworkManagerDevice.c + src/NetworkManagerUtils.c + - 64-bit build fixes + +2005-06-09 Dan Williams + + Patch from Kay Sievers and Robert Love: + * configure.in + src/backends/Makefile.am + src/backends/NetworkManagerSuSE.c + - Add SuSE support + +2005-06-09 Dan Williams + + * NetworkManager.h + - Add NMWirelessScanMethod enum for scan methods + + * gnome/applet/applet-dbus-devices.c + - (nmwa_dbus_update_scanning_enabled_cb): remove + - (nmwa_dbus_update_scanning_enabled): remove + - (nmwa_dbus_update_devices): don't call nmwa_dbus_update_scanning_enabled() anymore + since it got removed + - (nmwa_dbus_enable_scanning): remove + + * gnome/applet/applet-dbus-info.c + - (nmi_dbus_signal_update_scan_method): new function, signal NetworkManager to + update the wireless scanning method from NMI + - (nmi_dbus_get_wireless_scan_method): new function, return wireless scanning + method value to NetworkManager + - (nmi_dbus_info_message_handler): respond to the "getWirelessScanMethod" method call + + * gnome/applet/applet-dbus-info.h + - Add prototype for nmi_dbus_signal_update_scan_method + + * gnome/applet/applet.c + - (scanning_menu_update): new function, update one GtkCheckMenuItem from the + Wireless Scanning menu based on current wireless scan method + - (nmwa_menu_scanning_item_activate): new function, callback for GTK "activate" + signal for Wireless Scanning menu items, tell NetworkManager the new method + and update our menu items to make sure the right one is checked + - (nmwa_set_scanning_enabled_cb): remove + - (nmwa_context_menu_update): remove references to pause_scanning_item + - (nmwa_context_menu_create): remove pause_scanning_item, and add new Wireless + Scanning menu item + - (nmwa_gconf_get_wireless_scan_method): new method, pull wireless scanning method + from GConf + - nmwa_gconf_networks_notify_callback -> nmwa_gconf_info_notify_callback: generalize + so we get notified of preference values too + - (nmwa_get_instance): monitor GCONF_PATH_WIRELESS rather than GCONF_PATH_WIRELESS_NETWORKS + + * gnome/applet/applet.h + - GCONF_PATH_WIRELESS added, one level below GCONF_PATH_WIRELESS_NETWORKS + - Add wireless scan method member to applet data + - Remove pause_scanning_item, add Wireless Scanning submenu + + * src/NetworkManager.c + - (nm_data_new): default to NM_SCAN_METHOD_ON + - (main): grab scanning method from NMI if we can + + * src/NetworkManagerDbus.c + - (nm_dbus_update_wireless_scan_method_cb): new function, callback from + nm_dbus_update_wireless_scan_method() + - (nm_dbus_update_wireless_scan_method): new function to grab scanning method + from NMI + - (nm_dbus_nmi_is_running): redundant function, removed + - (nm_dbus_signal_filter): trap "WirelessScanMethodUpdate" signal, grab scanning method + when NMI comes back + + * src/NetworkManagerDevice.c + - (nm_device_is_activated): return TRUE if the device is activated + - (nm_device_wireless_scan): don't scan if the scan method is OFF, or if its AUTO + and we are activated + + * src/nm-dbus-nm.c + - (nm_dbus_nm_set_scanning_enabled): removed + - nm_dbus_nm_get_scanning_enabled -> nm_dbus_nm_get_wireless_scan_method + - (nm_dbus_nm_methods_setup): remove [get | set] ScanningEnabled and add "getWirelessScanMethod" + +2005-06-09 Dan Williams + + * NetworkManager.h + src/vpn-manager/nm-vpn-service.c + - NM_VPN_STATE_ERROR -> NM_VPN_STATE_UNKNOWN (more consistent with other enums) + +2005-05-27 Dan Williams + + * vpn-daemons/vpnc/nm-vpnc-service.c + - (vpnc_watch_cb): wait a bit before trying to read vpnc's pidfile. + Should fix the bug where the VPN connection terminates the first time. + +2005-05-20 Dan Williams + + * NetworkManager.h + - Differentiate VPN config signals between bad VPN config options + and bad IP config + + * gnome/applet/applet-dbus-info.h + - Add prototypes for wireless network and vpn connection update functions + + * gnome/applet/applet-dbus.c + - (nmwa_dbus_filter): trap new VPN config error signals from NetworkManager + + * gnome/applet/applet.c + - (nmwa_schedule_vpn_failure_dialog): new dialog text for new VPN config + error signals + - (nmwa_gconf_networks_notify_cb): re-enable wireless network change notify + propogation to NetworkManager + - (nmwa_gconf_vpn_connections_notify_cb): re-enable vpn connection change + notify propogation to NetworkManager + + * src/NetworkManagerDbus.c + - (nm_dbus_update_one_allowed_network): make sure to specify which AP list we + are updating so a network can be removed from it if necessary + + * src/vpn-manager/nm-vpn-manager.c + - (nm_vpn_manager_process_signal): trap new vpn config error signals + + * vpn-daemons/vpnc/nm-vpnc-service.c + - (nm_vpnc_dbus_signal_failure): generalize function for all VPN error signals + - (nm_vpnc_dbus_signal_launch_failed): remove + - (nm_vpnc_dbus_signal_connect_failed): remove + - (nm_vpnc_helper_timer_cb): update for new generalized error signal function + - (nm_vpnc_schedule_helper_timer): increase timeout to 10s + - (vpnc_watch_cb): don't whine about exit code if vpnc exited cleanly, update + for new generalized error signal function, remove config file stuff + - (nm_vpnc_start_vpnc_binary): grab a stdin pipe to vpnc after spawning it so + we can write configuration options to it + - (nm_vpnc_config_file_generate): removed + - (nm_vpnc_config_write): write configuration options to the vpnc stdin pipe + - (nm_vpnc_config_options_validate): validate the config options we receive + from NetworkManager to block potential exploits + - (nm_vpnc_dbus_handle_start_vpn): call option validation function before + starting vpnc + - (nm_vpnc_dbus_process_helper_config_error): actually propogate config error + to NetworkManager + +2005-05-16 Dan Williams + + * vpn-daemons/vpnc/nm-vpnc-service-vpnc-helper.c + - (main): Work correctly with vpnc 0.3.3 by exiting if the "reason" code + is not "connect" + +2005-05-16 Dan Williams + + Patch from Tomislav Vujec + * gnome/applet/applet-dbus-info.c + - (nmi_dbus_get_vpn_connection_routes): new function, pull routes out of + GConf and pass them to NetworkManager. New key is 'routes' under + the VPN connection, and should be a string list + + * src/NetworkManagerSystem.c + - (nm_system_vpn_device_set_from_ip4_config): if user-defined routes exist, + set them on the device when we set the rest of the VPN config. Ensure + they are in the correct format since they are passed directly to the + command line. + + * src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerDebian.c + - (nm_system_device_add_route_via_device_with_iface): new function + + * src/vpn-manager/nm-dbus-vpn.c + - (nm_dbus_vpn_get_routes): grab VPN routes from NetworkManagerInfo + + * src/vpn-manager/nm-vpn-manager.c + - (nm_vpn_manager_handle_ip4_config_signal): grab routes from NMI and pass + them into the IP4 config functions + +2005-05-15 Dan Williams + + From Filip Miletic: + * po/sr.po + po/sr@Latn.po + configure.in + - Serbian translation added + +2005-05-15 Dan Williams + + * dispatcher-daemon/NetworkManagerDispatcher.c + - (main): sync arguments with NetworkManager and the applet, now use + "--no-daemon" rather than "daemon=no" + - (nmd_print_usage): Fix script path in usage message + +2005-05-15 Dan Williams + + * src/NetworkManagerDevice.[ch] + src/NetworkManagerPolicy.c + src/NetworkManager.c + src/nm-dbus-nm.c + - Remove the "just_added" parameter from nm_device_deactivate(). We no + longer send the DeviceNoLongerActive signal unconditionally, but only + when the device is actually active. + + * dispatcher-daemon/NetworkManagerDispatcher.c + - (nmd_execute_scripts): convert to GLib directory functions from opendir(), + and simplify the logic + - (nmd_get_device_name): copy value from dbus reply so we don't segfault when + we free it later on + + * initscript/RedHat/Makefile.am + initscript/RedHat/NetworkManagerDispatcher + - Add initscript for NetworkManagerDispatcher + + + Patch from Bill Moss: + * dispatcher-daemon/NetworkManagerDispatcher.c + - Remove IP4AddressChange signal code including nmd_get_device_ip4_address() + + * src/NetworkManagerDbus.c + - (nm_dbus_signal_device_ip4_address_change): remove. If the device goes up, + and DeviceNowActive gets signaled, then the device has a new IP address + anyway. There's no need for a separate signal. + + * src/NetworkManagerDevice.c + - (nm_device_update_ip4_address): Don't send IP4AddressChange signal + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): Send DeviceNowActive signal when the device + activates successfully. This kind of went missing when I reworked the + activation code. + +2005-05-15 Dan Williams + + * configure.in + - Check for dhcdbd and error if its not found + + * src/dhcp-manager/Makefile.am + src/dhcp-manager/nm-dhcp-manager.c + - Use path to dhcdbd that configure found + +2005-05-14 Dan Williams + + * gnome/applet/nm-device.c + - (network_device_sort_wireless_networks, sort_networks_function): New functions to + sort wireless networks alphabetically + + * gnome/applet/applet-dbus-devices.c + - (mwa_dbus_devices_lock_and_copy): Sort network device's wireless network lists + before copying them over to the GUI + +2005-05-14 Dan Williams + + * src/NetworkManager.c + - (device_stop_and_free): Deactivate VPN connections before deactivating devices, + fixes a deadlock on shutdown with a VPN connection active. This function locks + the device list, as does nm_get_active_device() which is called from + nm_vpn_manager_deactivate_vpn_connection(). + +2005-05-14 Dan Williams + + * NetworkManager.h + - Add signals for VPN Launch and Connect failures + + * gnome/applet/applet-dbus.c + - (nmwa_dbus_filter): Trap new VPN launch & connect failure signals + + * gnome/applet/applet.c + - (nmwa_show_vpn_failure_dialog): generalize old nmwa_show_vpn_login_failure_dialog() + function to handle all VPN failure messages + - (nmwa_schedule_vpn_failure_dialog): generalize old nmwa_schedule_vpn_login_failure_dialog() + function to hanlde all VPN failure messages + - (show_warning_dialog): work around focus-stealing prevention + + * gnome/applet/other-network-dialog.c + gnome/applet/passphrase-dialog.c + - (update_button_cb): Make sure the OK button is enabled when it should be, fixes + problem where it never enabled for ASCII Key and Hex Key types + + * gnome/applet/wireless-applet.glade + - Add window title to Other Wireless Network Dialog + + * src/vpn-manager/nm-dbus-vpn.c + - (nm_dbus_vpn_signal_vpn_failed): generalize old nm_dbus_vpn_signal_vpn_login_failed() + function to handle all VPN failure messages + + * src/vpn-manager/nm-vpn-manager.c + - (nm_vpn_manager_process_signal): trap and proxy VPN launch & connect failure signals too + + * vpn-daemons/vpnc/nm-vpnc-service.c + - (nm_vpnc_dbus_signal_launch_failed): new function + - (nm_vpnc_dbus_signal_connect_failed): new function + - (nm_vpnc_helper_timer_cb): signal connect failure on timeout + - (vpnc_watch_cb): signal connection failure when vpnc exits with connection failure + - (nm_vpnc_start_vpnc_binary): search a number of locations for vpnc + - (nm_vpnc_dbus_handle_start): send launch failure signal when we fail to launch vpnc + +2005-05-11 Dan Williams + + * vpn-daemons/vpnc/nm-vpnc-service.c + - (nm_vpnc_start_vpnc_binary): NULL-ify GError before using it + - (nm_vpnc_config_file_generate): Attempt to ensure that the path for the config + file exists before trying to write it out. + +2005-05-10 Dan Williams + + * gnome/applet/applet-dbus-device.c + - (nmwa_dbus_set_device): remove check for valid key and key type, which + prevented just entering ESSID and leaving key and key type up to + NetworkManager (which should have them already cached) + +2005-05-08 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): Don't set NM_ACT_STAGE_ACTIVATED here, instead... + - (nm_policy_schedule_activation_finish): Set NM_ACT_STAGE_ACTIVATED here to + fix a situation where NM is told to terminate and the device stops activation, + but the main thread isn't aware of that because it would never have run + nm_policy_activation_finish() to set the ACTIVATED flag, because the main loop + had already quit. + + * src/NetworkManagerDevice.c + - (nm_device_probe_wired_link_state): cosmetic fixes + - (nm_device_activate_stage5_ip_config_commit): Don't check link state if + we've failed to activate or been canceled. + - (nm_ac_test): nm_debug -> nm_info for "waiting for device to cancel" message + +2005-05-08 Dan Williams + + * src/NetworkManagerWireless.c + - (nm_wireless_qual_to_percent): Fix #if -> #ifdef, print out the "updated" + value of WEXT quality structures, and add a debug message when we cannot + determine any quality % at all + +2005-05-08 Dan Williams + + * src/dhcp-manager/nm-dhcp-manager.c + - (nm_dhcp_manager_begin_transaction): Tell dhclient to release leases when + it goes down. + +2005-05-06 Dan Williams + + * gnome/applet/applet-dbus-device.c + gnome/applet/applet-dbus-info.c + gnome/applet/applet-dbus.c + gnome/applet/applet.c + gnome/applet/applet.h + - (nmwa_get_device_for_nm_device) -> (nmwa_get_device_for_nm_path) + + * gnome/applet/applet-dbus.c + - (nmwa_dbus_filter): trap DeviceCarrierOn/DeviceCarrierOff signals + so we notice when wired device's carriers come back on. Should + fix issue with wired devices being grayed out even if the cable + is in, for devices that support carrier detection. + + * gnome/applet/applet.c + - (nmwa_driver_notify): bash focus-stealing prevention in the face + - (nmwa_act_stage_to_pixbuf): Clarify wireless ACT_STAGE_DEVICE_CONFIG + tooltip message + - (nmwa_menu_item_activate, nmwa_menu_add_device_item, nmwa_menu_item_data_free): + Fix situation where applet wouldn't respond to menu selections + + * src/NetworkManager.c + src/NetworkManagerDevice.c + src/NetworkManagerDbus.c + src/NetworkManagerDbus.h + - (nm_dbus_signal_device_status_change) -> (nm_dbus_schedule_device_status_change_signal) + + * src/NetworkManagerDbus.c + - (nm_dbus_send_network_not_found, nm_dbus_schedule_network_not_found_signal): + Remove, no longer used or relevant + - (nm_dbus_signal_device_status_change): Better signal enum->string matching + - (nm_dbus_schedule_device_status_change_signal): add + + * src/NetworkManagerDevice.c + - (nm_device_worker_thread_stop): don't try to join a NULL worker thread + - (nm_device_set_link_active): Fix up switching for non-carrier-detect devices, + ie don't deactivate them unless explicitly told to by the user. Also send + CARRIER_OFF / CARRIER_ON signals when link changes + - (nm_device_set_essid, nm_device_set_enc_key, nm_device_is_up, nm_device_set_mode): + Don't print error message when device is no longer around + - (nm_device_deactivate): kill any current DHCP process attached to this device, + not just during activation + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): Ignore semi-supported devices completely from + auto-device-selection. + - (nm_policy_device_change_check): Don't interrupt semi-supported devices + + * src/NetworkManagerSystem.c + - (nm_system_device_set_up_down_with_iface): Quiet first warning message when device + is no longer present (Bill Moss) + + * src/backends/shvar.c + - (svOpenFile): Open read-only to make SELinux happy + + * src/backends/NetworkManagerRedHat.c + - (nm_system_device_get_system_config): Use SYSCONFDIR rather than hardcoding + the path to the ifcfg-* files + +2005-05-05 Dan Williams + + * Expose activation stages to NetworkManager clients, like the applet + * Add Diana's progress icons to the applet, cued off NM activation stage + * Use more descriptive tooltips, cued off NM activation stage + +2005-05-05 Ray Strode + + * src/nm-netlink-monitor.c: + - Use clear_event_source instead of g_nullify_pointer() again. + +2005-05-05 Dan Williams + + * gnome/applet/main.c + - Fix session management so the applet is actually managed now + + * gnome/applet/passphrase-dialog.c + - (nmi_passphrase_dialog_show): bash focus-stealing prevention in the face + +2005-05-05 Dan Williams + + Patch from Bill Moss: + * gnome/libnm_glib/libnm_glib.c + - Fix for dbus-0.33 + +2005-05-05 Dan Williams + + Suggestion from Bill Moss: + * src/NetworkManagerSystem.c + - (nm_system_device_set_up_down_with_iface): ignore ENODEV + + + * src/NetworkManager.c + - (nm_data_free): move destruction of the various managers after + release of device list, because deactivating and freeing a device + requires at least the named manager + - (nm_poll_and_update_wireless_link_state): + (nm_device_link_activated): + (nm_device_link_deactivated): + don't grab the device list lock when actually updating device + link status or strength, since nm_device_set_link_active() + needs to call nm_get_active_device(), which also locks the device list. + + * src/NetworkManagerDevice.c + - (nm_device_set_link_active): if a device's link switches from off->on, + and it's wired, and the active device is wireless (or there is no + active device), activate the new device whose link just came on + - (link_to_specific_ap): try to smooth over intermittency in wireless links + my only calling the link to the current ap "failed" when more than 2 + consecutive link checks have failed + +2005-05-04 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_probe_wireless_link_state): don't lock the scan mutex here + but let link_to_specific_ap() do the locking where it needs + + Patch from Bill Moss: + * src/NetworkManagerSystem.c + - Set MTU of VPN devices to 1412 + +2005-05-04 Dan Williams + + * Remove NM_STATE_SCANNING from NetworkManager.h and applet code + + * Fix some holes in device activation and retaining the currently connected + access point + +2005-05-03 Dan Williams + + * Kill dhcpcd. We now use "dhcdbd", a dbus daemon that controls dhclient. + This means that NetworkManager shouldn't have DHCP issues anymore. It also + means you need dhcdbd, which you can get here (get the latest one): + + http://people.redhat.com/jvdias/dhcdbd/ + + Technically NetworkManager can use any DHCP daemon that uses the same DBUS + interface as dhcdbd. + + * Rewrite device activation to facilitate the new DHCP infrastructure and + future improvements. Its now "activation request" based, ie there is a single + activation request composed of the device, access point, and other info which + follows the entire activation process. There are 5 stages of the activation + process which correspond to: + + 1) Device preparation + 2) Device configuration (bring it up, set ESSID/Key/etc) + 3) IP Config Start (fire off DHCP if we're using it) + 4) IP Config Get (grab config from DHCP or static config files) + 5) IP Config Commit (set device's IP address, DNS, etc) + + Note that there is no longer a "scanning" step, since the access point must + be known _before_ activation starts. If the access point drops out or does + not exist for some reason, the entire activation process fails and must be + restarted for a different access point or device. + + Patch from Bill Moss: + * gnome/applet/applet.c + - Fix type of vpn_failure dialog -> vpn_banner dialog + +2005-04-27 Dan Williams + + * gnome/applet/applet-dbus-vpn.c + gnome/applet/applet.c + gnome/applet/applet.h + - Fix up active VPN handling so that we reliably know when a VPN + connection has been deactivated + + * src/vpn-manager/nm-vpn-manager.c + - Remove duplicate VPNConnectionChange signal + +2005-04-27 Dan Williams + + Patch from Peter Jones: + * Remove usage of varargs to fix crashes on PPC (RH #154336) + + Patch from Bill Moss: + * src/NetworkManagerSystem.c + - Fix checking of return value from ioctl() + +2005-04-27 Dan Williams + + * Fix choosing of wireless networks and "Other wireless network..." from the applet + * Warn and exit if icons cannot be found + +2005-04-27 Dan Williams + + Patch from Tom Parker: + * Update debian backend + +2005-04-27 Dan Williams + + * Merge the applet and the info-daemon, and move the converged + applet under gnome/applet + * Move libnm_glib to gnome/libnm_glib + * Convert most dbus calls between the applet, info-daemon, and NM + into async calls + * Fix a few things valgrind noticed + * Make NM broadcast state more reliably + +2005-04-22 Pawan chitrakar + + * configure.in: Added ne in ALL_LINGUAS + +2005-04-15 Dan Williams + + * libnm_glib/libnm_glib: Fix up for dbus-0.32, and remove + code for dbus 0.2x versions + +2005-04-15 Dan Williams + + Patches from Tom Parker: + - Fix memleaks + - Join with worker thread rather than polling for its exit + + Patch from Bill Moss: + - Cull duplicate ESSIDs from the scan list, taking highest strength AP + +2005-04-15 Dan Williams + + - Fixes to pass 'make distcheck' + +2005-04-15 Dan Williams + + Initial VPN Support + - supports 'vpnc' + - reworks device IP configuration, backend files have changed and will need + to be updated for all distributions. I will try to do what I can for + them, but I cannot test them. + + - Move named directory to src/named-manager + - Make backends directory self-contained + +2005-04-06 Dan Williams + + Add debug code for socket/file descriptor leaks. We register every socket + that we open (except for stuff in dhcpcd/) for tracking, and print out the + list of sockets that we forgot to close on shutdown. This also consolidates + about 4 places where we opened sockets into 1 function in NetworkManagerUtils.c + +2005-04-06 Dan Williams + + * dhcpcd/dhcpcd.c + - (dhcp_interface_free): fix a file descriptor leak that may have + caused network drivers to not unload due to refcounts > 0 + +2005-04-04 Dan Williams + + * panel-applet/NMWirelessAppletDbus.c + - (nmwa_dbus_call_nm_method): remove some commented code + + * src/NetworkManagerAPList.[ch] + - (nm_ap_list_remove_ap_by_essid): new function + + * src/NetworkManagerDevice.c + - (nm_device_wireless_force_use): remove access points from the ignore list + when the user forces them + + * src/nm-dbus-device.c + - (nm_dbus_device_get_active_network): fix up escaping of object paths + +2005-04-04 Dan Williams + + Patch from Tom Parker: include "nm-utils.h" for backend files that need it + +2005-04-04 Dan Williams + + * src/NetworkManagerDevice.c: + - (nm_completion_scan_has_results): restore pre-completion-patch behavior + of only erroring after the second consecutive scan times out. Also + don't exit when the card requires more time than we can give it, just + log the event and continue. + +2005-04-01 Steve Murphy + + * configure.in: Added "rw" to ALL_LINGUAS. + +2005-04-01 Dan Williams + + Perform scans during device activation, if needed. Both activation + and scans run in the same GMainContext. Therefore, if an access point + is not found by the time the device starts activation, it will not + be available until after activation. We now try to scan during + activation (in nm_wa_test) every 15s so that all available access + points are more likely to be found and available for the activation + procedure. + + Also change nm_wireless_link_state_handle() to only update the "best" + AP if we are not forcing a device and if we are not about to change + state. This attempts to work around a race when forcing a device, + where the forced AP would get cleared out too soon by the link state + checking timeout in the main thread, and the activation attempt with + that AP would fail. + +2005-04-01 Dan Williams + + * po/POTFILES.in + - Update with new translatables + +2005-03-31 Dan Williams + + * panel-applet/NMWirelessAppletDbus.c + - Fix device names now that hal has changed device parenting for + network devices. + +2005-03-31 Dan Williams + + Tighten up handling of wireless devices that don't support wireless + scanning (ie, Orinoco). Due to restructuring of code, these devices + hadn't been doing pseudo-scanning for a while either and would just + spin waiting for an access point. They are now manual devices where + the user must choose the access point from the menu every time. All + "allowed" access points are listed in the applet's menu regardless + of whether or not they can be seen by the card, since it can't scan + anyway. + + * src/NetworkManager.c + - (nm_wireless_link_state_handle): new function, but only update + the "best" ap for non-scanning devices when its not activating, + and when no device is being forced on the card + - (nm_link_state_monitor): split wireless link state handling out + into separate function + + * src/NetworkManagerDevice.c + - (nm_device_copy_allowed_to_dev_list): new function + - (nm_device_new): populate non-scanning cards' AP lists with + access points from the "allowed" list + - (nm_device_new): don't start a scanning timeout for devices that + can't scan + - (nm_device_activation_schedule_finish): new parameter, should be + the AP that failed to be connected to, pass it on to the + activation finish function in NetworkManagerPolicy.c + - (nm_device_activate_wireless): don't ever try to get a new AP + for non-scanning devices, just fail. The user must choose + a new access point manually. + - (nm_device_activate): grab the AP that failed connection and + pass it on + - (nm_device_update_best_ap): Clear the best AP if we don't have + a link to it, user must manually choose a new one + - (nm_device_do_pseudo_scan): remove function + - (nm_device_wireless_process_scan_results): remove bits for non- + scanning cards since they never get here + - (nm_device_wireless_scan): remove bits for non-scanning devices, + and fake the scan list for test devices a bit earlier + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): use the failed_ap that we get + passed rather than getting the best_ap from the card, which + may have changed since we were scheduled + - (nm_policy_allowed_ap_list_update): for non-scanning devices, + update their scan list directly from the allowed list when + we get updates to the allowed list from NetworkManagerInfo + + * src/NetworkManagerPolicy.h + - New member for failed access point in NMActivationResult + + ------------------------------------- + + Driver Notification patch: notifies the user when their driver + sucks. Gives them the option to ignore further insertions + of the card that has the sucky driver. + + * NetworkManager.h + - Remove the SEMI_SUPPORTED member from the NMDriverSupportLevel + enum and replace it with NO_CARRIER_DETECT and + NO_WIRELESS_SCAN + + * panel-applet/NMWirelessApplet.[ch] + - Merge essid.glade -> wireless-applet.glade + - Implement the "Your driver sucks" notification dialog + + * panel-applet/NMWirelessAppletDbus.c + - Change stuff from getSupportsCarrierDetect->getDriverSupportLevel + - Grab hardware address for each device from NM too + - Check whether the driver for each device sucks or not whenever + a new device is noticed + + * panel-applet/NMWirelessAppletOtherNetworkDialog.c + - Deal with stuff being in wireless-applet.glade now rather than essid.glade + + * src/NetworkManager.c + - Fix a double-unref on device removal + + * src/NetworkManagerUtils.c + - Set appropriate driver support level on a device that doesn't + support scanning or carrier detection + + * src/nm-dbus-device.c + - New "getHWAddress" dbus method on devices + - getSupportsCarrierDetect -> getDriverSupportLevel + +2005-03-31 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_wireless_scan): Fix leak of scan results in some + instances + +2005-03-29 Dan Williams + + * src/NetworkManager.c + - (nm_poll_and_update_wireless_link_state): make code less indented + + Patch from Bill Moss: + * src/NetworkManager.c + - (nm_device_update_link_state): Update signal strength on wireless + devices every time we update link state too. + +2005-03-29 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_set_essid): Work around Orinoco cards which need + extra time after setting the ESSID + +2005-03-29 Dan Williams + + * src/NetworkManagerDevice.c + - Merge one more bit of Peter Jones' completion patch + +2005-03-29 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_force_use): Fix possible segfault + +2005-03-29 Dan Williams + + * src/NetworkManagerDevice.c + - Use iw_get_ext() where we should rather than iw_set_ext() + +2005-03-29 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_set_up_down): remove check for unsupported devices + that caused NM to not bring devices up when they were + added to the device list. + +2005-03-28 Dan Williams + + * src/NetworkManagerDevice.c + - (mdio_read): Fix two bugs that caused all devices to fail + the MII carrier detection support checks + +2005-03-26 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_wireless_scan): Remove duplicated scanning code + +2005-03-25 Dan Williams + + * panel-applet/NMWirelessApplet.c + - (nmwa_about_cb): Add some more contributors + - (nmwa_update_state): show the applet when there's no connection + - Enable the "Stop/Resume all wireless devices" option in the + context menu + - New "no connection" icon + + * src/NetworkManager.c + - (nm_poll_and_update_wireless_link_state): don't do anything if + wireless is disabled or we're asleep + + * src/NetworkManagerDHCP.c + - Remove trailing "\n" on debug messages + + * src/NetworkManagerDbus.c + - (nm_dbus_network_status_from_data): new state "asleep" + + * src/NetworkManagerDevice.c + - Merge most of Peter Jones' "completion" patch that greatly reduces + latency and wait times for most operations + - (nm_device_wireless_scan): Don't scan when asleep + + * src/NetworkManagerPolicy.c + - (nm_policy_get_best_device): return no device when asleep + - (nm_policy_allowed_ap_list_update): From Bill Moss: merge properties + for all wireless devices on update, not just active device + + * src/NetworkManagerUtils.c + - Merge Peter Jones' "completion" patch + + * src/nm-dbus-nm.c + - (nm_dbus_nm_set_wireless_enabled): bring down wireless devices when + we're told to disable them + - (nm_dbus_nm_sleep, nm_dbus_nm_wake): new functions for sleep/wake + + * utils/nm-utils.h + - New variants of the warn/info/error/debug print functions that can take + variables rather than static strings + +2005-03-24 Dan Williams + + * src/NetworkManagerUtils.c + - (nm_get_device_driver_name): driver names are now on the parents of + "Network Interface" objects, so look for them there + +2005-03-24 Dan Williams + + * test/nmtest.c + - Escape some forgotten object paths before we shove them through dbus + +2005-03-24 Dan Williams + + * dhcpcd/dhcpcd.[ch] + src/NetworkManagerDHCP.c + - Switch names from "*_record_*" -> "*_element_*" to clarify things a bit + (ie, dhcp_option_record_len -> dhcp_option_element_len) + + * src/NetworkManagerDbus.c + - spacing cleanups + + * src/nm-dbus-dhcp.c + - Make the API suck less. There is now only 1 type of each function, + ie only "getInteger" and no longer also "getIntegerv". All types + are returned encapsulated in a DBUS_TYPE_ARRAY, even for options + that will never have more than 1 element. This should simplify + things greatly. + + * test/nm-dhcp-opt-test.c + - Make the tool not segfault + - adapt to new DHCP Options API + +2005-03-22 Dan Williams + + * src/NetworkManager.c + - (nm_wired_link_deactivated): actually ignore netlink events from + wireless devices. + +2005-03-22 Dan Williams + + * src/NetworkManager.c + - (nm_wired_link_activated): actually ignore netlink events from + wireless devices. + +2005-03-17 Dan Williams + + Patch from Tom Parker: + * src/nm-netlink-monitor.c + - Include unistd.h + * info-daemon/NetworkManagerInfoDbus.c + - (nmi_dbus_update_network_auth_method): free GConf values + + Patch from Nathaniel McCallum : + * src/NetworkManagerDevice.c + - (nm_device_set_wireless_config): wait for successful + association longer for some cards (Atheros a/b/g) + +2005-03-15 Ray Strode + + * src/NetworkManager.c: + (sigterm_pipe_handler): + remove bogus FIXME + +2005-03-15 Ray Strode + + * src/NetworkManagerDbus.c: + Fix some sign weirdness that gcc4 doesn't like, + and add a header file so PPC can hopefully find + SIGTRAP + +2005-03-14 Ray Strode + + Fourth (probably working) cut at porting to + dbus 0.30 api and new hal. This cut adds + some new logging macros to make debugging + easier. + + * dispatcher-daemon/NetworkManagerDispatcher.c: + * info-daemon/NetworkmanagerInfo.c: + * info-daemon/NetworkManagerInfoPassphraseDialog.c: + * info-daemon/NetworkManagerInfoVPN.c: + * src/NetworkManager.c: + * src/NetworkManagerAP.c: + * src/NetworkManagerAPList.c: + * src/NetworkManagerDHCP.c: + * src/NetworkManagerDbus.c: + * src/NetworkManagerDevice.c: + * src/NetworkManagerPolicy.c: + * src/NetworkManagerSystem.c: + * src/NetworkManagerUtils.c: + * src/NetworkManagerWireless.c: + * src/autoip.c: + * src/nm-dbus-nm.c: + * src/backends/NetworkManagerDebian.c: + * src/backends/NetworkManagerGentoo.c: + * src/backends/NetworkManagerRedHat.c: + * src/backends/NetworkManagerSlackware.c: + use new logging macros. + + * dispatcher-daemon/NetworkManagerDispatcher.c: + (nmd_dbus_filter): s/dbus_free/g_free/ + + * info-daemon/Makefile.am: link in utils library. + * info-daemon/NetworkmanagerInfo.c: use new logging + macros. + (nmi_dbus_get_network): don't assume enumerations + are 32-bit. + (nmi_dbus_nmi_message_handler): don't free what + doesn't belong to us. + + * libnm_glib/libnm_glib.c: + (libnm_glib_get_nm_status): + (libnm_glib_init): don't free what doesn't + belong to us. + (libnm_glib_dbus): strdup result, so it doesn't get + lost when message is unref'd. + + * panel-applet/NMWirelessAppletDbus.c: + (nmwa_dbus_update_devices): s/dbus_free/g_free/ + + * src/NetworkManager.c: + (nm_monitor_wired_link_state): request initial status + dump of all cards when we start up, instead of relying + on /sys/.../carrier. + (nm_info_handler), (nm_set_up_log_handlers): + log handlers to specify what syslog priorites + the logging macros default to. + + * src/NetworkManagerAPList.c: + (nm_ap_list_populate_from_nmi): + s/dbus_free_string_array/g_strfreev/ + + * src/NetworkManagerDbus.c: + (nm_dbus_get_network_object): + validate d-bus message argument types. + Advance message iterator after reading argument, + prepend instead of append to GSList. + + * src/NetworkManagerDevice.c: + (nm_device_probe_wired_link_status): + remove redundant /sys in /sys path. remove wrong + contents == NULL means has carrier assumption. + + * src/nm-netlink-monitor.c + (nm_netlink_monitor_request_status): implement + function to ask kernel to dump interface link + status over netlink socket. + + * test/*.c: s/dbus_free/g_free/ + + * utils/nm-utils.h: + (nm_print_backtrace): new macro to print backtrace. + (nm_get_timestamp): new macro to get sub-second precise + unix timestamp. + (nm_info), (nm_debug), (nm_warning), (nm_error): + new logging functions. nm_info just prints, + nm_debug includes timestamp and function, + nm_warning includes function, nm_error includes + backtrace and sigtrap. + +2005-03-11 Ray Strode + + Third (unfinished, partially working) cut at porting to + dbus 0.30 api and new hal. + + * info-daemon/NetworkManagerInfoDbus.c: + don't free null arrays. + + * panel-applet/NMWirelessAppletDbus.c: + * src/nm-dbus-device.c: + * src/nm-dbus-net.c: + * src/NetworkManagerDbus.c: more + STRING -> OBJECT_PATH fun + * src/NetworkManagerDevice.c: + * src/NetworkManagerDevice.h: + (rename nm_device_get_link_active): rename to + nm_device_has_active_link + (nm_device_wireless_link_active): rename to + nm_device_probe_wireless_link_state + (nm_device_wired_link_active): rename to + nm_device_probe_wired_link_state. Rewrite to + use carrier file since hal doesn't maintain + link state anymore. + (nm_device_update_link_active): rename to + nm_device_update_link_state + * src/NetworkManagerPolicy.c + (nm_policy_activation_finish): check for NULL + MAC address. + + * src/Makefile.am: + * src/NetworkManagerMain.h: + * src/NetworkManager.c: + * src/nm-netlink-monitor.c: + * src/nm-netlink-monitor.h: New class to support + monitoring wired ethernet link status, since HAL + doesn't export that information anymore. + +2005-03-09 Ray Strode + + Second (unfinished, unworking) cut at porting to + dbus 0.30 api. + + * dispatcher-daemon/NetworkManagerDispatcher.c: + * info-daemon/NetworkManagerInfoDbus.c: + * panel-applet/NMWirelessAppletDbus.c: + * src/NetworkManagerDbusUtils.c: + * src/NetworkManagerDbusUtils.h: + * src/nm-dbus-device.c: + * src/nm-dbus-nm.c: + * test/nmtest.c: support dbus "object path" type + + * configure.in: + * Makefile.am: + * info-daemon/Makefile.am: + * libnm_glib/Makefile.am: + * panel-applet/Makefile.am: + * dispatcher-daemon/Makefile.am + * src/Makefile.am: + * test/Makefile.am: + * utils/Makefile.am: + * utils/nm-utils.c: + * utils/nm-utils.h: new utils static lib + +2005-03-07 Ray Strode + + * info-daemon/NetworkManagerInfoDbus.c: + * libnm_glib/libnm_glib.c: + * panel-applet/NMWirelessAppletDbus.c: + * src/NetworkManager.c: + * src/NetworkManagerDbus.c: + * src/NetworkManagerDevice.c: + * src/NetworkManagerUtils.c: + * src/nm-dbus-device.c: + * src/nm-dbus-dhcp.c: + * src/nm-dbus-net.c: + * src/nm-dbus-nm.c: + * test/nminfotest.c: + First (unfinished, unworking) cut at porting to dbus 0.30 api. + +2005-03-04 Dan Williams + + * configure.in + - Mark HEAD as 0.4 + +2005-03-04 Dan Williams + + Patch from Peter Jones: + - Make stuff work with gcc 4.0 + +2005-02-28 Maxim Dziumanenko + + * uk.po: Added "uk" (Ukrainian) to ALL_LINGUAS. + +2005-02-27 Jim Huang + + * configure.in: Added "zh_TW" (Traditional Chinese) to ALL_LINGUAS. + +2005-02-27 Dan Williams + + Patch from Bill Moss: + * panel-applet/NMWirelessAppletDbus.c + - Make sure strength for current access point is up-to-date when we + update the gui data model + +2005-02-27 Alessio Frusciante + + * configure.in: Added "it" (Italian) to ALL_LINGUAS. + +2005-02-27 Dan Williams + + * src/backends/NetworkManagerRedHat.c + - (nm_system_init): Kill any dhclient processes lying around as well + as stopping 'nifd' if its already been started. NetworkManager + subsumes the functions of nifd (kicking mDNSResponder, autoip) + +2005-02-27 Dan Williams + + * panel-applet/NMWirelessApplet.c + - (nmwa_destroy): Really mean to destroy GUI data model first, then + dbus data model, not the GUI data model twice. + +2005-02-27 Dan Williams + + * panel-applet/NMWirelessApplet.[ch] + panel-applet/NMWirelessAppletDbus.[ch] + - Move to incremental network updates. Instead of blowing away our list + of devices every time we get a signal from NetworkManager, we now + incrementally add/remove networks when NetworkManager notifies us that + a new network has appeared or disappered. Strength updates now happen + on-the-fly for each access point as well. There are now two copies of + data from NetworkManager: one for the dbus side, and one for the gui side. + When the dbus side data is modified, it is copied over to the gui side + so we don't have to hold the data_mutex for long periods of time (and + therefore block animation of the applet's icon). + - Clean up some memleaks too + + * panel-applet/NMWirelessAppletOtherNetworkDialog.c + - Minor code beautification + + * src/NetworkManagerAPList.c + - (nm_ap_list_merge_scanned_ap): return whether or not the access point is + completely new and whether or not an existing one's strength was updated. + Try to fix multiple access points and signal strength by using the highest + signal strength in each scan for any given ESSID. + + * src/NetworkManagerDbus.[ch] + - (nm_dbus_signal_wireless_network_change): consolidate signals that deal with + wireless networks; now we have only WirelessNetworkUpdate which includes + a UINT32 for Appeared, Disappeared, or StrengthChanged (see NetworkManager.h). + - Kill usage of DbusMessageIter + + * src/NetworkManagerDevice.c + - (nm_device_wireless_process_scan_results): Use the same timestamp for all APs + in the same scan result list. Copy ESSIDs-by-address earlier on, for each + AP rather than all-at-once. Also don't ever remove the AP a card is + currently associated with from the network list. + - Update for new signals during scan, send out Appeared, Disappeared, or + StrengthChanged when necessary. + +2005-02-25 Dan Williams + + * README + - Line break the README + +2005-02-25 Dan Williams + + * panel-applet/NMWirelessAppletOtherNetworkDialog.c + - Remove usage of gtk_window_set_default_size() + + * panel-applet/essid.glade + - Stick default size here + - Add in random crap that current glade wants to add in now + +2005-02-25 Dan Williams + + * src/backends/NetworkManagerRedHat.c + - For non-caching-nameserver/non-named case, ensure that nscd is running + and that we actually tell nscd to reload the hosts cache when it changes + +2005-02-25 Dan Williams + + * info-daemon/NetworkManagerInfoDbus.c + - (nmi_dbus_get_network_properties): whack usage of DbusMessageIter + + * test/nminfotest.c + - Whack usage of DbusMessageIter + - Clean up DbusError and DbusMessage handling and freeing + - Remove unused unregister handler + + * test/nmtest.c + - Whack usage of DbusMessageIter + + * test/nmtestdevices.c + - Whack usage of DbusMessageIter + +2005-02-25 Dan Williams + + * NetworkManager.h + - New signal type NMNetworkStatus in preparation for the "WirelessNetworkUpdate" + signal + +2005-02-25 Dan Williams + + * named/nm-named-manager.c + - Ensure that pid and watch variables for child named process get cleared out + when the child goes away. + +2005-02-22 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): Deactivate a device if its activation fails, + and NULL out data->active_device so that we have to choose another one. + This may make NetworkManager keep attempting to connect to a wired network + if it fails, but if it keeps failing the wired network has more problems than + just NetworkManager. + + * src/backends/NetworkManagerRedHat.c + - (nm_system_update_dns): fix to actually run nscd -i hosts when nscd + is already running + + * named/nm-named-manager.c + - (rewrite_resolv_conf): Call nm_system_update_dns() when not using + named so that the distro can flush whatever name service caching + daemon it uses + +2005-02-21 Dan Williams + + * src/NetworkManagerDHCP.[ch] + - (nm_device_dhcp_remove_timeouts): new function + + * src/NetworkManagerDevice.c + - Use nm_device_dhcp_remove_timeouts() everywhere that we need to + remove the DHCP timeouts. + +2005-02-21 Dan Williams + + * panel-applet/NMWirelessApplet.[ch] + panel-applet/menu-info.[ch] + - Give the panel applet some major love: menu items are no longer + subclasses of GtkCheckMenuItem, they are actual GtkCheckMenuItems. + This allows the applet to actually reflect theme changes correctly, + since themeing of subclassed items in GTK _sucks_. + +2005-02-18 Dan Williams + + * libnm_glib/libnm_glib.[ch] + test/libnm_glib_test.c + - Clean up libnm_glib API a bit, callback is now passed a libnm_glib_ctx + and its data, and doesn't have to free the callback data anymore + +2005-02-18 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Revert 2005-02-18 William Jon McCann fix for standard + copyright string until it passes 'make distcheck'. + With standard copyright string, xgettext complains + about "Non-ASCII string at ...". + +2005-02-18 Dan Williams + + * panel-applet/essid.glade + panel-applet/NMWirelessAppletOtherNetworksDialog.c + - Correct spelling of "adaptor"->"adapter" + +2005-02-18 William Jon McCann + + * panel-applet/NMWirelessApplet.c: Use GTK_CHECK_VERSION() macro. + (nmwa_about_cb): Use standard copyright string. Update comment + text to reflect that it is a notification area applet. Remove + leading newline in authors list. + (nmwa_menu_show_cb, nmwa_setup_widgets): Populate menu on show + instead of on parent menu item activation. Fixes #167550. + +2005-02-18 William Jon McCann + + * panel-applet/essid.glade: Capitalize items as per HIG. + Fixes #167632 + +2005-02-16 William Jon McCann + + * panel-applet/gtkcellrendererprogress.[ch]: Only compile these + files for GTK 2.4 or lower, since now public in GTK 2.6. + + * panel-applet/essid.glade: Don't specify window size. + +2005-02-17 Dan Williams + + Caught by Bill Moss: + * dhcpcd/client.c + - Time remaining for DHCP transaction calculation was incorrectly + inside a #ifdef DEBUG + +2005-02-15 Christophe Merlet + + * configure.in: Added fr (French) to ALL_LINGUAS. + +2005-02-14 Dan Williams + + * src/NetworkManagerDHCP.c + - (set_domain_searches): Fix free of invalid pointer + +2005-02-14 Dan Williams + + Patch from Peter Jones: + * dhcpcd/client.c + - Ensure we return RET_DHCP_CEASED everywhere we should + * dhcpcd/udpipgen.c + - Use faster TOS for IP packets + - Don't set ip_id since we're UDP + + Patch from Tomislav Vujec: + * src/nm-dbus-dhcp.c + test/nm-dhcp-opt-test.c + - Clean up warnings to enable cvs tree compilation. + +2005-02-14 Tomislav Vujec + + * configure.in + po/hr.po + - Add the Croatian locale. + +2005-02-14 Colin Walters + + * src/NetworkManagerDHCP.c (set_domain_searches): Handle space-separated + list of domains to search. + + * src/NetworkManagerMain.h (NMData): Handle multiple domain searches. + +2005-02-13 Dan Williams + + * dhcpcd/client.c + - Debug output cleanups of DHCP option printing and parsing. + +2005-02-13 Dan Williams + + Patch from Dan Reed: DHCP options D-BUS API + Exposes the DHCP options that a device receives to clients over D-BUS. + + * configure.in + - A few cleanups + + * dhcpcd/client.h + - Correct names, option length, and types for DHCP options + + * dhcpcd/dhcpcd.[ch] + - Clarify function names that access DHCP options & data + + * src/NetworkManagerDHCP.c + - Use new DHCP data access functions + + * src/NetworkManagerDbus.c + - Message handler for DHCP functions + + * src/nm-dbus-dhcp.[ch] (new) + - DHCP dbus methods + + * test/nm-dhcp-opt-test.c + - Test DHCP D-BUS API and return all present DHCP options + +2005-02-12 Dan Williams + + * test/Makefile.am + test/nmclienttest.c + test/nmtest.c + - Move nmclienttest.c -> nmtest.c + +2005-02-12 Dan Williams + + * dhcpcd/buildmsg.c + - Pad DHCP packets until they are at least 300 bytes in size. + +2005-02-11 Dan Williams + + * dhcpcd/client.c + - (dhcp_init): only print out client ID and class ID if they are specified + + * src/NetworkManagerDbus.[ch] + src/nm-dbus-nm.[ch] + src/nm-dbus-device.[ch] + src/nm-dbus-net.[ch] + - Move NM, Device, and Net functions to separate files and use the + dbus method list stuff in NetworkManagerDbusUtils.c to do + method dispatching + + * src/NetworkManagerDbusUtils.c + - Add new validate_method called before each dispatch (if present) + that can validate the method call + + * src/NetworkManagerWireless.c + - (nm_wireless_qual_to_percent): Fix misplaced "!" that caused signal + levels never to be evaluated + + Patch from j@bootlab.org + * src/NetworkManagerDevice.c + - Add typedef for "u64" + + * src/backends/NetworkManagerDebian.c + - Copy in Dave Woodhouse's fixes for IPv6 + +2005-02-11 Dan Williams + + Patch from Dave Woodhouse for IPv6: + * src/NetworkManagerUtils.c + - (nm_ethernet_address_is_valid): Check for prism54 dummy MAC address + and multicast addresses + + * src/NetworkManagerDevice.c + - (nm_device_set_up_down): make sure our cached MAC address is up-to-date + after bringing up a card. + +2005-02-10 Dan Williams + + Patch from Dave Woodhouse: + * src/NetworkManagerSystem.h + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerSlackware.c + - New nm_system_device_add_ip6_link_address() function to add link-local + address on an interface. Stubbed in Debian, Gentoo, and Slackware. + + * src/backends/NetworkManagerRedHat.c + - (nm_system_device_add_ip6_link_address): implement + - (nm_system_device_flush_addresses): revert to previous behavior of + flushing all addresses + +2005-02-10 Dan Williams + + Patch from Tom Parker: + * src/NetworkManagerDevice.c + - Remove the "#include " since both the ethtool.h and + mii.h headers are broken, and instead use our own typedefs + +2005-02-10 Dan Williams + + * dhcpcd/buildmsg.c + - (fill_host_and_class_id): only fill in client and class IDs if + they are set by callers. + + * dhcpcd/client.c + - (class_id_setup): don't autogenerate a class ID, only use one + we're given, if any. + - (client_id_setup): don't autogenerate a client ID, only use one + we're given, if any. + + * dhcpcd/dhcpcd.c + - (dhcp_interface_init): ensure that client options are correctly + NULL terminated + + * src/NetworkManagerDHCP.c + - (nm_device_dhcp_request): pass hostname to dhcp library + +2005-02-10 Dan Williams + + * dhcpcd/client.c + - #rh147661# Don't send kernel version in DHCP requests + + * src/NetworkManagerSystem.h + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + - Remove the nm_system_device_run_dhcp() and nm_system_device_stop_dhcp() + functions, they are no longer used anyway + + * src/backends/NetworkManagerRedHat.c + - (nm_system_device_flush_addresses): only flush "scope global" and "scope site" + addresses in an attempt to keep IPv6 local-scope addresses around + +2005-02-10 Dan Williams + + * src/NetworkManager.c + - (nm_create_device_and_add_to_list): change the add message slightly + + * src/NetworkManagerUtils.c + - (nm_get_wireless_driver_support_level, nm_get_wired_driver_support_level): + Return driver name to calling function + - (nm_get_driver_support_level): print out the driver a device is using + during the support check + + Patch from Dave Woodhouse: + * dhcpcd/udpipgen.c + - (in_cksum): copy last byte of odd-sized packets into a + 'u_short' rather than a 'u_char', should fix wrong checksums + on big-endian platforms + +2005-02-09 Dan Williams + + * Clean up usage of GSList objects and looping through their members + * Clean up DHCP rebind/renew timeouts, hopefully they will work correctly + now. + * Fix problem where even if scanning was turned off, card would still + cycle through frequencies. + +2005-02-08 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Fix for gtk 2.4 + +2005-02-08 Dan Williams + + Patch from Bill Moss + * panel-applet/NMWirelessApplet.c + - Restore correct ESSID in tooltips + +2005-02-07 Dan Williams + + * panel-applet/NMWirelessApplet.[ch] + - Add a context menu that contains: + Pause/Resume Wireless Scanning + Stop/Start All Wireless Devices + About... + - Grab active device strength off active device, + not its network + + * panel-applet/NMWirelessAppletDbus.[ch] + - Add DBUS accessors for "getSupportsCarrierDetect", "setScanningEnabled", + "getScanningEnabled", "setWirelessEnabled", and "getWirelessEnabled" + - Update active device strength every 2 seconds, not every 1 second + + * panel-applet/menu-info.c + - Only disable wired devices in the menu when they support carrier detection, + and don't currently have a link. Non-carrier-detect devices will always + remain choosable + + * src/Makefile.am + src/NetworkManagerDbusUtils.[ch] + - Add new new dbus utils sources + + * src/NetworkManager.c + - Fixes for new link detection, we no longer need to call nm_device_update_link_active() + with the boolean parameter + - Set scanning_enabled & wireless_enabled to TRUE + + * src/NetworkManagerDbus.c + - Use new dbus util method dispatcher functions for org.freedesktop.NetworkManager methods + - Implement scanning & wireless enable/disable calls + - Remove the dbus vtable unregister handlers, weren't doing anything with them anyway + + * src/NetworkManagerDevice.c + - New link detection stuff again... + o Create device's mainloop earlier (but don't run it earlier) + o Hook up new carrier-detect support stuff + o Add in the ethtool & mii support detection code + - Don't scan if scanning is disabled + + * src/NetworkManagerPolicy.c + - Never automatically choose a device that doesn't support carrier detection + - Don't automatically choose a wireless device if wireless is disabled + +2005-02-07 Dan Williams + + * libnm_glib/libnm_glib.c + - Small cleanup in element list iteration + +2005-02-07 Dan Williams + + * src/NetworkManagerWireless.c + - (nm_wireless_qual_to_percent): Fix up wireless quality calculations + to be in line with the WEXT quality specification + +2005-02-02 Dan Williams + + Patch from Nathan Fredrickson + * Fix up compile for deprecation of libgnomeui + - Switch to from + - Remove includes + - Use gtk_window_set_default_icon_from_file() rather than + gnome_window_set_default_icon_from_file() + + * named/nm-named-manager.c + - (generate_named_conf): Fix return-nothing in non-void + function + +2005-02-02 Dan Williams + + * Clean up unused variables and the like + +2005-02-02 Dan Williams + + * src/NetworkManagerAPList.c + - (nm_ap_list_merge_scanned_ap): merge strength too + + * src/NetworkManagerUtils.c + - (nm_lock_mutex, nm_register_mutex_desc): new calls to facilitate debugging + of locking issues by printing out prettier information than g_mutex_lock + - Print out names of mutexes registered with nm_register_mutex_desc() + - (nm_try_lock_mutex): don't do the waiting thing when trying to lock, causes + us to seemingly block here for too long + + * src/NetworkManager.c + src/NetworkManagerAPList.c + src/NetworkManagerDevice.c + - Convert to using nm_lock_mutex/nm_unlock_mutex rather than the glib variants + so we get better debug information printed + + * src/NetworkManagerDbus.c + - (nm_dbus_devices_handle_request): reduce usage of nm_device_need_ap_switch() + since it sometimes has locking side effects + - (nm_device_get_association_pause_value): Reduce 802.11a card pause value to 8s + from 10s + - (nm_device_need_ap_switch): If we can't acquire the scan lock, return saying + we don't need a switch. This gets called often enough that we can't block + until the scan mutex is acquired, because we'll block on device activation + and a few other things, which hangs main thread for too long. + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): reduce the possiblity that + nm_device_need_ap_switch() will be called + +2005-02-02 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Display name of wireless network we are connecting to or connected to + in the tooltip of the applet + +2005-02-02 Dan Williams + + * src/NetworkManagerDHCP.c + - Hopefully fix double-default-route problem by cleaning up the default + route added by DHCP code right before the DHCP transaction begins + +2005-02-02 Dan Williams + + * named/nm-named-manager.c + - Write out valid resolv.conf when we exit + +2005-02-01 Dan Williams + + Patch from Colin Walters: + * named/nm-named-manager.c + - Make multi-domain search options work + +2005-01-31 Dan Williams + + * info-daemon/NetworkManagerInfoDbus.c + - (nmi_dbus_nmi_message_handler): make sure 'dialog' exists before using it + + * src/NetworkManagerDevice.c + - (nm_device_new): Don't store the entire range struct, use only what we need + (which is currently avg_quality, max_quality, and frequencies). Also + zero device structure when we've free'd it to maybe expose errors down + the line. + - (nm_device_update_signal_strength): grab the scan mutex before getting + quality data from the card since quality will be useless during a scan. + Call updated wireless qual-to-percent function with values stored in + nm_device_new() earlier. + - Remove some unused functions (nm_device_get_max_quality(), nm_device_get_noise(), + nm_device_get_bad_crypt_packets()) + - (nm_device_activate_wireless_adhoc): use new frequency values we go in + nm_device_new() + - (get_initial_auth_method): always use the Auth method that's in the allowed + list if available. Problem was this: when the WEP key is wrong, NM will + try OS then SK modes, and then get stuck in SK mode after that. This + should reset it. + - (nm_device_wireless_process_scan_results): work with new qual-to-percent + function + + * src/NetworkManagerWireless.c + - (nm_wireless_qual_to_percent): try to make this function actually work and + mimic iwlib behavior. Use card's idea of quality divided by max_qual + if that's all present, otherwise fall back to signal-to-noise ratios. + +2005-01-29 Dan Williams + + * initscript/RedHat/NetworkManager + - Don't spit out sysctl stuff to console + + * libnm_glib/libnm_glib.c + - (libnm_glib_init): call dbus_g_thread_init() + + * panel-applet/NMWirelessAppletDbus.c + - (nmwa_dbus_worker): call dbus_g_thread_init() + + * src/NetworkManager.c + - (main): call dbus_g_thread_init() + + * src/NetworkManagerAPList.c + - (nm_ap_list_print_members): use LOG_ERR instead of LOG_DEBUG + so we can actually see what's there in a normal syslog + + * src/NetworkManagerDevice.c + - (nm_device_activate_wireless): print out the "waiting for access point" + message only once, then say what access point we actually got after + the wait. + - (nm_device_need_ap_switch): If a scan is in progress when we're in this + function, wait until the scan is done. Scans may change the ESSID of + the card, making this function think we need to switch access points + - (nm_device_wireless_process_scan_results): for artificial access points + don't check against the card's ESSID, but the best_ap's ESSID. This + prevents collisions with the scanning code, which may change the card's + ESSID and cause the access point to get dropped from the device's AP + list. Also increase the keep-around time to 2m from 60s since the max + scan interval could be 60s in some cases. + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): Don't add invalid MAC addresses to GConf + - (nm_policy_allowed_ap_list_update): When we update, make sure we copy over + the new properties and ESSIDs to the device's AP list. Fixes some races + between NM and NMI. + +2005-01-27 Dan Williams + + * info-daemon/NetworkManagerInfoDbus.c + - (nmi_dbus_add_network_address): if the network doesn't yet exist in + GConf, make a minimal entry for it (essid & timestamp) + + * src/NetworkManagerAPList.c + - (nm_ap_list_populate_from_nmi): Don't try to grab network data if + NetworkManagerInfo isn't running + + * src/NetworkManagerDbus.[ch] + - (nm_dbus_nmi_is_running): new function + + * src/NetworkManagerDevice.c + - (nm_device_wireless_force_use): Don't set the created AP's MAC + address to garbage. + + * src/NetworkManagerPolicy.c + - (nm_policy_activation_finish): On successful activation, make sure + the "best" AP has a MAC address, and don't tell NMI to add the + current AP's MAC address to GConf if the AP is an Ad-hoc AP. + - (nm_policy_allowed_ap_list_update): Update a wireless card's "best" + access point after refreshing our allowed list if it doesn't already + have a "best" access point. + +2005-01-25 Dan Williams + + * panel-applet/NMWirelessAppletDbus.c + - (nmwa_dbus_filter): Fix dbus 0.23 ServiceOwnerChanged checks + so we check for NM_DBUS_SERVICE rather than not for it + + * libnm_glib/libnm_glib.c + - (libnm_glib_dbus_filter): Fix for dbus 0.23, trapping + ServiceOwnerChanged signal + +2005-01-25 Dan Williams + + * configure.in + - Check DBUS version in configure, and set the C macros + DBUS_VERSION_[MAJOR,MINOR,MICRO] + + * info-daemon/NetworkManagerInfoDbus.c + - Remove #if 0-d section of code that quit NMI if NM went away. + + * panel-applet/NMWirelessAppletDbus.c + - Trap the "ServiceOwnerChanged" signal that's new in dbus-0.23 + + * src/NetworkManager.c + src/NetworkManagerMain.h + src/NetworkManagerDbus.c + - Trap the "ServiceOwnerChanged" signal that's new in dbus-0.23 + - Make updating of our Allowed Wireless Network lists from NMI + an idle function in the main thread now, with a high priority. + +2005-01-24 Dan Williams + + * panel-applet/gtkcellview.[ch] + panel-applet/menu-info.c + - Fix GTK version checks to be <= rather than < + + * test/Makefile.am + - Include the libtool archive of libnm_glib rather than + trying to pull in the .so + +2005-01-24 Dan Williams + + * src/NetworkManagerDevice.c + src/NetworkManagerDevicePrivate.h + - Block nm_device_new() until our device's worker thread has had a + chance to start up. Fixes a race between main thread and worker + thread starting that caused activation requests to get lost. + +2005-01-24 Dan Williams + + * initscript/RedHat/NetworkManager + - Remove the ### BEGIN INIT INFO section, which caused chkconfig + to add the NM startup script at priority 50, which was + way too early + +2005-01-24 Colin Walters + + * named/named.conf: Use any port for query source instead of + restricting to port 53. + +2005-01-24 Dan Williams + + * initscript/RedHat/NetworkManager + - Remove the ### BEGIN INIT INFO section, which caused chkconfig + to add the NM startup script at priority 50, which was + way too early + +2005-01-24 Dan Williams + + Patch from Tom Parker + * Fix up compile warnings & errors in the wireless applet + +2005-01-24 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Convert 24x24 icons back to 22x22 and use the 22x22 ones + +2005-01-24 Dan Williams + + * panel-applet/gtkcellview.[ch] + - Only compile these files for GTK 2.4 or lower, since + GtkCellView is now public in GTK 2.6. Fixes crasher + when choosing "Other Wireless Networks" from the panel + applet menu + +2005-01-21 Dan Williams + + * src/NetworkManager.c + - Daemonize earlier so that glib doesn't get confused (?) + +2005-01-21 Dan Williams + + * panel-applet/NMWirelessApplet.[ch] + panel-applet/NMWirelessAppletDbus.c + panel-applet/menu-info.c + src/NetworkManagerDevice.c + - Disable wired devices in the menu when they have no link. + +2005-01-21 Dan Williams + + * Cache last-known-good wireless authentication method in + NetworkManagerInfo, and use that method first during + wireless device activation. Should speed up devices that + need Shared Key authentication method since Open System is + now the default. + + * Remove the hack to not do full activation on wired connections + that are active when we launch, it causes too many problems + with name resolution and was a hack in the first place. + + * Re-work wireless device activation again somewhat to have a + clearer chain of events and to use last-known-good + authentication method of the access point. Also provide + better status throughout activation to ensure the applet + can tell the user exactly what's going on. + + * Remove the "find wireless network" code and now simply attempt + to activate with that access point. This reduces the delay + between selecting "Other wireless Network" and actually + connecting to that network. + + * Correctly stop the device's worker thread when its removed. + +2005-01-21 Dan Williams + + * dhcpcd/client.c + - Clean up some of the debug messages + +2005-01-21 Dan Williams + + * Add new icons, more frames of animation + * Remove some hacks to get the panel applet to display correct + status, an NM update will soon follow that will fix the + real issue. + +2005-01-19 Kjartan Maraas + + * panel-applet/NMWirelessApplet.c: #include must be + the first include for working i18n. Also, don't include it in .h files + * panel-applet/NMWirelessApplet.h: Same + * panel-applet/NMWirelessAppletOtherNetworkDialog.c: Same + * panel-applet/menu-info.c: Same + +2005-01-18 Dan Williams + + * dhcpcd/client.c + - Remove some debug messages + - Wrap others in #ifdef DEBUG/#endif + + * src/NetworkManager.c + - Remove some debug messages + - Clarify some debug messages + - Remove code related to old single-thread wireless scanning + + * src/NetworkManagerAP.[ch] + - New AP property "last_seen" to track how recently an AP was + found in a scan + - Start using 'const' more in function arguments + + * src/NetworkManagerAPList.[ch] + - (nm_ap_list_merge_scanned_ap): new, selectively update attributes + of an AP found in an AP list from a source AP, or if not found + in the list add the source AP + - (nm_ap_list_combine): remove, no longer needed + + * src/NetworkManagerDevice.c + - Each device now has a "worker" thread from start to end of its life. + Scanning for wireless devices now happens in that thread, + not in a single "wireless scanning thread" for all devices as + previously. Activation consists of adding an idle handler to the + thread's main loop/context, which gets run at the next available + opportunity. + - Wireless scanning is also simplified, there is now only one list of + access points per wireless device, and APs older than 60s are + removed from the list. Previously, we kept results for the last + 3 scans and merged whole lists, which was complicated. + - Cleaned up activation debug messages. + - Wireless activation and access-point search routines now use Open System + authentication before trying Shared Key. + - Removed some code in nm_device_update_best_ap() that could cause cards + to loose their link to the access point. + - Scanning now uses a backoff algorithm, where the inverval becomes + progressively longer between scans when the list of scanned access + points doesn't change. A change will revert to the shortest scan + interval (20s). + + * src/NetworkManagerWireless.[ch] + - Remove code related to old single-thread wireless scanning + +2005-01-18 Colin Walters + + * src/NetworkManagerDHCP.c (set_nameservers): Free and clear list + of older nameservers. + +2005-01-18 Colin Walters + + * named/nm-named-manager.c (generate_named_conf): Many fixes + to config file generation. + (safer_kill): Remove, was too much trouble for little gain. + (nm_named_manager_start): Run named as NM_NAMED_USER. + + * configure.in: Add option --with-named-user. + +2005-01-14 Colin Walters + + Patch from ed@catmur.co.uk (Ed Catmur) + + * named/nm-named-manager.c: Add "context" property. + Use it to add child watch source in specific GMainContext. + + * src/NetworkManager.c (nm_data_new): Initialize + named with correct main context. Start named only + after forking. + +2005-01-14 Colin Walters + + * named/nm-named-manager.c (generate_named_conf): Write config + and pid files into NM_NAMED_DATA_DIR; this allows things to + work better with FC3 named SELinux policy. Also fix up silly + format error. + + * configure.in: Add --with-named-dir option. + +2005-01-14 Colin Walters + + * configure.in: Make named support require passing --with-named. + + * named/nm-named-manager.c: Support writing resolv.conf directly + without running named. + +2005-01-13 Dan Williams + + * named/nm-named-manager.c + - Use syslog(LOG_WARNING) rather than g_warning() (gnome.org #163961) + + * src/NetworkManagerDevice.c + - Rework wireless link detection code to be more reliable + +2005-01-12 Dan Williams + + * initscripts/RedHat/NetworkManager + - Change initial level to "-" rather than "345" so that + we don't activate ourselves by default on install + +2005-01-12 Dan Williams + + * libnm_glib/ + - Client library for applications using glib + + * configure.in + various Makefiles + - Split NM_CFLAGS and NM_LIBS into separate variables + like DBUS_*, HAL_* and GLIB_* + + * src/NetworkManager.c + src/NetworkManagerMain.h + - (nm_schedule_status_signal_broadcast): at the earliest convenience, + broadcast a status changed signal over DBUS from the main thread. + Still unused anywhere for the moment. + + Patch from j@bootlab.org + * panel_applet/NMWirelessAppletDbus.c + src/NetworkManagerDbus.c + - Correct INT32->UINT32 mistmatch between NM and the panel applet + for the "getMode" method call + +2005-01-10 Dan Williams + + * src/NetworkManagerDevice.c + - Minor fixups & corrections to "auto" frequency mode, make it + less chatty with syslog + +2005-01-10 Dan Williams + + * src/NetworkManagerDevice.c + - Implement "auto" frequency/channel support, since cards like Atheros + can't use other frequencies at all when you've told it to use a + specific one, even for scanning. + - Grab the scan mutex around places where we can't tolerate wireless + settings changing underneath us, like nm_device_wireless_network_exists() + and nm_device_activate_wireless() + + * src/NetworkManagerWireless.c + - Back scan interval off to 20s instead of 14s + +2005-01-09 Dan Williams + + * src/NetworkManagerDevice.c + - Don't set mode/freq/bitrate if that mode/freq/bitrate is + already set. Stops some drivers like Atmel from continually + reloading the firmware, which they do upon every configuration + change. + +2005-01-09 Dan Williams + + * dhcpcd/client.c + - Use correct timeout value + + * info-daemon/NetworkManagerInfoDbus.c + src/NetworkManagerDbus.c + - Consolidate communication between NM and NMI by doing only 1 dbus + method call to get Wireless Network info from NMI instead of 6 + + * src/NetworkManager.c + - Make sure to cancel activation when we receive a SIGTERM, otherwise + when we didn't have an AP to use, we'd wait for one forever without + quitting + + * src/NetworkManagerDevice.c + - nm_device_activation_cancel(): Fix a race between dhcp and quitting + activation, dhcp might not have started yet but we don't quit activation + before starting it, so the quit signal gets lost + +2005-01-07 Dan Williams + + * dhcpcd/client.c + - Rework the DHCP client code to be much less chatty when + it receives non-DHCP UDP packets during the DHCP run + (reported by and preliminary patches from Bill Moss) + + * Move wireless scanning to a separate thread. This thread forwards the + results to the main thread when done where they are integrated into + the device's access point lists. This keeps the main thread (which + does all the DBUS communication) from being blocked for long periods + of time by wireless scanning. + + * Make state modification an idle routine in the main loop, and trigger + state changes rather than polling for them. + + * src/backends/NetworkManagerGentoo.c + - Fix up invalid C90 code (reported by Christoph Ruessler) + + * src/NetworkManagerDevice.c + - Revert IPv6 patch for wired devices from 2004-12-22 for + router advertisements, causing problems and infinite loop + during "best" device determination due to link going up/down + (reported by Bill Moss) + + Apply patch from Peter Jones + * src/NetworkManagerDevice.c + - Shortcut for link-checking for ipw2x00 cards + - Split out association check into separate routine + +2004-01-05 Colin Walters + + * named/named.conf: Add PID_FILE. + + * named/nm-named-manager.c: Always generate a pid + file, since older BIND versions don't support + "pid-file none". + +2005-01-01 Satoru SATOH + + * configure.in (ALL_LINGUAS): Added ja (Japanese). + +2004-12-22 Dan Williams + + * src/NetworkManagerDevice.c + - Silently fail when setting bitrate doesn't work + + + Patches from j@bootlab.org: + * src/backends/NetworkManagerDebian + - Update backend to match functionality in RedHat backend + * src/NetworkManagerDevice.c + - Take down then bring up wired devices after connection so + they send out ipv6 router advertisements + +2004-12-21 Colin Walters + + * panel-applet/NMWirelessAppletDbus.c (nmwa_dbus_update_devices): Correctly + test for NETWORK_MODE_ADHOC; spotted by: Greg . + +2004-12-21 Colin Walters + + * configure.in: Correct named detection. + +2004-12-21 Colin Walters + + * src/NetworkManager.c (nm_data_new): Initialize named. + Also, set up a signal handler for SIGINT/SIGTERM, and exit + the mainloop when these signals are received. + (nm_data_free): Unref named. + (sigterm_handler, sigterm_pipe_handler): New functions for + exiting mainloop. + + * src/NetworkManagerMain.h (NMData): Add signal handling and + nameserver bits. + + * src/NetworkManager.c (nm_device_unref): Quit device mainloop on + unref. + + * src/NetworkManagerDHCP.c (set_nameservers): New function; + set nameservers from DHCP response data. + (set_domain_search): Set domain search from DHCP response. + (nm_device_dhcp_configure): Invoke them. + + * src/NetworkManagerSystem.c + (nm_system_device_update_resolv_conf): Delete. Deleting + code is totally sweet. + + * src/Makefile.am (NetworkManager_LDADD): Add libnamed. + + * named/nm-named-manager.h, named/nm-named-manager.c: New files; + implements an object which controls a nameserver. Currently + uses bind 9. + + * configure.in: Check for named. + + * Makefile.am (SUBDIRS): Add named dir. + + * named/named.conf: New template config file. + +2004-12-20 Colin Walters + + * src/NetworkManagerPolicy.c (nm_policy_get_best_device): Fix usage of '==' + instead of '='. + +2004-12-17 Dan Williams + + * Ad Ad-Hoc networking mode support. In Ad-Hoc mode, we only try to get + link-local addresses instead of doing DHCP. + + * In the panel applet, there's a new "Create new Wireless Network..." item + + * The panel applet also sticks around now even if NetworkManager dies, but + it doesn't hide its icon when NM isn't around. Not hiding the icon is + a bug, I'll fix that later. + + * We also don't use 'nscd' anymore in the RH backend, it was impeding name + lookups after a switch rather than actually doing them. + + * Clean up some of those warnings in nm_ap_list_* functions + + * Delay between scans changed to 15s instead of 10s + +2004-12-15 Dan Williams + + Patch from Tom Parker + * Add autoip/Link Local Addressing support when we fail to get a DHCP + address + + * Longer pause after setting ESSID on cards that support a larger number + of channels to give the card time to find the right channel + + * Add system hook to restart mDNSResponder (or whatever the local implementation + of Multicast DNS is) when we activate interfaces + +2004-12-15 Dan Williams + + * Rework the DHCP code again to revert to sending full ethernet frames + rather then relying on the kernel to do the right thing with our + packets. + +2004-12-06 Dan Williams + + * dhcpcd/client.c + - Fix some minor errors in dhcp_handle_transaction() that caused + unexpected early timeouts of DHCP transactions + + * dhcpcd/client.h + - DHCP retransmit time from 4s -> 5s + +2004-12-05 Dan Williams + + * Major rework of the DHCP code, taking some cues from pump. We don't + write raw Ethernet packets anymore, which simplifies the code quite + a bit. The new code should be more robust, not hang in recvfrom() + as much, and generally work better. This also means that we need + to force HAL/dbus to use a created GMainContext rather than the + default context, since having the DHCP renew/rebind thread using + its own GMainContext seemed to give dbus a fit. There is also more + debugging information printed from the DHCP loop to help with future + problems. + + * Also, if the DHCP server doesn't give us the "routersOnSubnet" option, + assume that the default gateway should be the DHCP server. + + Patch from Matthew Schick + * src/backends/NetworkManagerGentoo.c + - Fix compilation error due to missing "ip4_broadcast" + +2004-12-03 Dan Williams + + * initscript/Makefile.am + * initscript/Debian/NetworkManager + * initscript/Gentoo/NetworkManager + * initscript/RedHat/NetworkManager + * initscript/NMLaunchHelper.c + - Remove NMLaunchHelper, if you need to wait until the network + comes up, use the dead code from CVS. + +2004-12-01 Colin Walters + + * configure.in: Suck in gcc warnings code from Rhythmbox, + but use fewer default flags, and in particular add -Wno-unused, + since the codebase has a lot of unused variables. + + * test/nmtestdevices.c (create_device): + * test/nminfotest.c (get_network_string_property) + (get_networks_of_type): + * test/nmclienttest.c (main): + * src/NetworkManagerDbus.c (nm_dbus_create_error_message): + * initscript/NMLaunchHelper.c (get_nm_status): + * info-daemon/NetworkManagerInfoPassphraseDialog.c (update_button_cb): + * info-daemon/NetworkManagerInfoDbus.c (nmi_dbus_create_error_message): + Fix declarations after statements. + +2004-12-01 Colin Walters + + * info-daemon/NetworkManagerInfoDbus.c (nmi_dbus_return_vpn_password): New method. + (nmi_dbus_get_vpn_userpass): New method. + (nmi_dbus_nmi_message_handler): Invoke it. + + * info-daemon/NetworkManagerInfoDbus.h (nmi_dbus_return_vpn_password): Prototype. + + * info-daemon/NetworkManagerInfoVPN.h, + info-daemon/NetworkManagerInfoVPN.c: New files; responds + to requests for VPN passwords. + + * configure.in (GNOME_KEYRING_LIBS): Check for gnome-keyring. + +2004-12-01 Colin Walters + + * test/nmtestdevices.c, test/nmclienttest.c: Add missing + includes. + +2004-12-01 Colin Walters + + * panel-applet/NMWirelessAppletDbus.c + (nmwa_dbus_update_active_device_strength): Fix missing + return value. + +2004-12-01 Colin Walters + + * panel-applet/NMWirelessApplet.c: Add missing include. + +2004-12-01 Colin Walters + + * src/NetworkManagerWireless.c (nm_wireless_qual_to_percent): + Remove useless CLAMP (); the value is unsigned, and the case tests + qual->qual < 100, so the value must always be between 0 and 100. + +2004-12-01 Colin Walters + + * dhcpcd/buildmsg.c, dhcpcd/dhcp_test.c: Add missing includes. + +2004-11-22 Colin Walters + + * src/backends/NetworkManagerRedHat.c (nm_system_update_dns): Run + "nscd -i hosts" to invalidate the host cache instead of restarting nscd, + which is essentially a noop since nscd caches hosts on disk too. + +2004-11-22 Colin Walters + + * src/Makefile.am (NetworkManager_SOURCES): Add + NetworkManagerDevicePrivate.h. + +2004-11-22 Dan Williams + + * src/NetworkManagerDevicePrivate.h + - Split out the NMDevice struct to a different file so that stuff like + NetworkManagerDHCP.c and NetworkManagerSystem.c can use it + + * dhcpcd/client.c + - fprintf->syslog + - (dhcpSendAndRecv): do non-blocking sends and receives, and check to see if we + need to cancel the dhcp request during the send and recv + + * dhcpcd/client.h + - Move the DHCP option enum to dhcpcd.h + + * src/NetworkManagerDHCP.c + - Split out the actual IP/netmask/etc setting code + - New Renew/Rebind functions + - New timer setup function for renew/rebind operations + + * src/NetworkManagerDevice.c + - For device activation, if we are using DHCP then keep the activation thread + alive until device deactivation. We need to renew/rebind the DHCP address + after the T1 (renew) and T2 (rebind) times have expired. + - Increase some timeouts after bringing wireless cards up/down + +2004-11-17 Dan Williams + + * Cache access point MAC addresses in NetworkManagerInfo after you've explicitly + connected to them. Then, after a scan, match up non-ESSID-broadcasting access + points with any cached MAC addresses from NetworkManagerInfo. Allows us to + show known access points that don't broadcast their ESSID in the menus without + any user intervention whatsoever. + + * info-daemon/NetworkManagerInfoDbus.c + - (nmi_dbus_get_network_addresses, nmi_dbus_add_network_address): new functions + for dbus method calls "getNetworkAddresses" and "addNetworkAddress" + + * src/NetworkManagerAP.[ch] + - Add a "user_addresses" data member to the NMAccessPoint structure + - (nm_ap_get_user_addresses, nm_ap_set_user_addresses): new functions for accessing + the user_addresses data member + + * src/NetworkManagerAPList.c + - (nm_ap_list_get_ap_by_address): check user_addresses list too, instead of just + the AP's reported address + - (nm_ap_list_update_network): grab the user_addresses list from NetworkManagerInfo + + * src/NetworkManagerDHCP.c + - Increase DHCP timeout from 25s -> 30s + + * src/NetworkManagerDbus.[ch] + - (nm_dbus_get_network_addresses, nm_dbus_add_network_address): have NMI get/set + user addresses + + * src/NetworkManagerDevice.c + - (nm_device_set_wireless_config): bring down the interface, wait 4s, bring it up, + wait 2s, then configure it. Sometimes Prism54 cards will freeze up with + "mgnt tx queue full", seemingly in response to NM controlling the card too much. + So, we take the card down to clear it out. + - (nm_device_do_normal_scan): Copy over AP ESSIDs from the allowed access point list + too, since that's where the user_addresses are + + * src/NetworkManagerPolicy.c + - (nm_state_modification_monitor): Tell NMI to add an AP's hardware address to + that wireless networks' user_addresses list upon successful activation + +2004-11-16 Dan Williams + + * src/NetworkManagerDevice.[ch] + - (nm_device_clear_activation_fail): new function + + * src/NetworkManagerPolicy.c + - (nm_state_modification_monitor): clear the activation_failed flag on devices + when we've dealt with the failure so the user doesn't get failure-dialog-spammed + +2004-11-16 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_activate_wireless): Unref best_ap upon success so we don't + leak the structure, better updating of now_scanning status + - (nm_device_wireless_network_exists): Rewrite for better/faster checking + +2004-11-15 Dan Williams + + Major rework of link detection code. We now use DHCP + as part of the link detection which proves to be much more robust, + and also supports Open System authentication for wireless networks. + + We no longer use external DHCP client programs. Instead, we use + our own DHCP client, based on substantially reworked bits of 'dhcpcd' + which was written by: + Yoichi Hariguchi + Sergei Viznyuk + http://www.phystech.com/download/ + It resides in the "dhcpcd" directory and was refactored into a general + purpose DHCP client library by me. + + Also misc fixes (CPPFLAGS->AM_CPPFLAGS, move some stuff around), + move src/backends/NetworkManagerSystem.h -> src/NetworkManagerSystem.h + +2004-11-15 Dan Williams + + Patch from Tom Parker : + + * src/NetworkManagerDevice.c + - Less output to console when no access + points are found during a scan + +2004-11-15 Dan Williams + + Patch from Tom Parker : + + * src/backends/interface_parser.c + - Use g_strdup () + - Check for inp == NULL + - use syslog () + +2004-11-13 Colin Walters + + Patch from Tom Parker : + + * src/Makefile.am (CPPFLAGS): Switch to AM_CPPFLAGS. + + * src/backends/NetworkManagerRedHat.c: Switch to + including shvar.h instead of shvar.c. + + * src/backends/NetworkManagerDebian.c: Don't include + interface_parser.c in source file. + + (libnmbackend_la_SOURCES): Don't include shvar.[ch] + and interface_parser.[ch]. + * src/Makefile.am (libnmbackend_la_SOURCES) : + Include shvar.c and shvar.h here. + (libnmbackend_la_SOURCES) : Include + interface_parser.c and interface_parser.h here. + +2004-11-12 Colin Walters + + * configure.in: Strip out TARGET_DISTRO and + SYSTEM_BACKEND_FILE variables. Switch to Automake + conditionals. + + * src/Makefile.am (noinst_LTLIBRARIES): Add libnmbackend.la. + (libnmbackend_la_SOURCES): Use Automake conditionals + to add distro-specific files. + + * initscript/Makefile.am (SUBDIRS): Update to + use conditionals. + +2004-11-12 Colin Walters + + Patches from j bootlab org + + * src/Makefile.am (EXTRA_NetworkManager_SOURCES): + Add interface_parser.[ch]. + + * src/backends/NetworkManagerDebian.c (nm_system_device_run_dhcp): Invoke + dhclient with "-lf /var/lib/dhcp/dhclient-%s.leases". + +2004-11-12 Colin Walters + + * info-daemon/NetworkManagerInfoDbus.c (nmi_dbus_service_init): Delete + call to nmi_dbus_is_running too, not necessary anymore. + * info-daemon/NetworkManagerInfoDbus.c: Include stdlib.h to + pick up exit(). + +2004-11-11 Colin Walters + + * info-daemon/NetworkManagerInfoDbus.c (nmi_dbus_is_running): + Delete. + (nmi_dbus_service_init): Call dbus_bus_acquire_service with + the DBUS_SERVICE_FLAG_PROHIBIT_REPLACEMENT flag, and + then check the result for DBUS_SERVICE_REPLY_SERVICE_EXISTS. + This avoids a race condition that made it pretty easily + possible to get two NetworkManagerInfo daemons running. + +2004-11-11 Colin Walters + + * src/NetworkManager.c (main): Use daemon(3). + + * info-daemon/NetworkManagerInfo.c (main): Ditto. + + * dispatcher-daemon/NetworkManagerDispatcher.c (main): Ditto. + +2004-11-10 Dan Williams + + Patches from j bootlab org + * src/NetworkManagerDevice.c + - (nm_device_activate_wireless): wait 5 seconds before attempting to detect + whether the card has a link or not, some cards are slow + - (nm_device_activation_configure_ip): make ipv6 work a bit better + + * info-daemon/NetworkManagerInfoPassphraseDialog.c + - Disable the "Login" button on the passphrase dialog until the user + enters a valid passphrase or key + + Patches from Tom Parker + * src/backends/NetworkManagerDebian.c + - Add static IP support to the debian backend + + * src/backends/interface_parser.[ch] + - Parse debian interface config files + +2004-11-08 Dan Williams + + * src/NetworkManagerDevice.c + - Some random fprintf->syslog conversions + - (nm_device_wireless_network_exists): double-check for network + - (nm_device_find_and_use_essid): Copy over encryption key no matter what + + * src/NetworkManagerWireless.[ch] + - (nm_wireless_[128|64]bit_ascii_to_hex): make "ascii" argument unsigned again + so that the binary->ascii conversion works (if unsigned, the bitshift + will fill with zeros, which is what's required). Also mask bitshift + result with 0xF for futher assurance. + +2004-11-06 Dan Williams + + * src/NetworkManagerUtils.c + - (nm_get_wireless_driver_support_level): default to + FULLY_SUPPORTED rather than UNSUPPORTED, forgot to + flip this when changing from whitelist->blacklist of + wireless drivers + +2004-11-05 Dan Williams + + Patch from Robert Paskowitz: + * src/backends/NetworkManagerGentoo.c + - Update static IP config code + +2004-11-05 Dan Williams + + * info-daemon/NetworkManagerInfoDbus.c + src/NetworkManagerDbus.[ch] + src/NetworkManagerDevice.c + - Keep track of the # of attempts to get the WEP key + from the user and pass that along to the info daemon + +2004-11-05 Dan Williams + + * src/NetworkManagerUtils.c + - Blacklist wireless cards rather than whitelisting them. + - Grab driver name from HAL rather than trying to find it + ourselves. + +2004-11-03 Dan Williams + + * panel-applet/NMWirelessAppletOtherNetworkDialog.c, + - Disable OK button until valid data is entered + for encryption stuff too + + * panel-applet/NMWirelessApplet.c + - Report card strength for current AP if the card + doesn't report strength data for scanned access + points + + * src/NetworkManagerDevice.c + - Smooth out cards reported quality, Atmel card was + intermittently reporting no quality data but soon + recovers + + * src/NetworkManagerWireless.c + - Better quality data percentage calculation. Atmel + cards (mine at least) seem to report the quality + in percentage format already, so honor that + + Patch from + * NetworkManager.h + info-daemon/NetworkManagerInfoPassphraseDialog.c + info-daemon/passphrase.glade + panel-applet/NMWirelessAppletOtherNetworkDialog.c + panel-applet/essid.glade + src/NetworkManagerAP.c + src/NetworkManagerDevice.c + src/NetworkManagerWireless.[ch] + - Support ASCII WEP keys, in both 40/64 bit and 104/128 bit + +2004-11-03 Dan Williams + + * src/NetworkManagerDevice.[ch] + - (nm_device_set_enc_key): Add parameter to set Authentication + Mode (Open System, Shared Key, or None). We're still using + Shared Key for now though. + +2004-11-02 Bryan Clark + + * panel-applet/menu-info.c: change from bold text to light + colored, may cause problems with some themes, i've tested a lot + and they seem fine. + + * panel-applet/NMWirelessApplet.c: fix strength tooltip + +2004-11-01 Colin Walters + + * src/NetworkManagerWireless.h, src/NetworkManagerWireless.c + (nm_wireless_128bit_key_from_passphrase): Add const. + + * src/NetworkManagerAP.h, src/NetworkManagerAP.c + (nm_ap_set_enc_key_source): Add const. + +2004-11-01 Colin Walters + + * .cvsignore: Update. + +2004-10-29 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_wireless_network_exists): Actually use the encryption + key we got from the applet when attempting to find a wireless network + - Don't bring devices down so much since on some cards it triggers + firmware hotplugs each time + + * src/NetworkManagerDbus.c + - (nm_dbus_nm_set_active_device): free the passphrase we may have gotten + from the caller + +2004-10-29 Dan Williams + + * src/NetworkManager.c + - (nm_hal_device_property_modified): unlock a locked active + wireless device when a wired connection gets a link. + (Means you'll switch to wired whenever you plug in no + matter what). + +2004-10-29 Dan Williams + + * panel-applet/NMWirelessAppletOtherNetworksDialog.[ch] + - New files, implement the "Other wireless network" dialog + + * panel-applet/NMWirelessApplet.c + - Move "other wireless network" dialog to separate file + + * panel-applet/NMWirelessAppletDbus.[ch] + - Take key and key_type paramaters for the set_device function + + * panel-applet/essid.glade + - Add UI bits for encryption settings + + * src/NetworkManagerDbus.c + - Retrieve key and key_type params for "setActiveDevice" method call + and pass them on + - unref AP returned from nm_device_get_best_ap() when needed + + * src/NetworkManagerDevice.c + - (nm_device_get_best_ap): ref the ap before returning it + - unref AP returned from nm_device_get_best_ap() when needed + - (nm_device_activate_wireless): add "ap" parameter so we don't + need to call nm_device_get_best_ap() here, it was pretty much + redundant anyway + - (AP_NEED_KEY): break second link check condition out into separate + function, and fix segfault when ap->enc_key_source was NULL + - (nm_device_find_and_use_essid): take key and key_type parameters and + pass them along to nm_device_wireless_network_exists(). If the + network does exist, set the passed-in key+key_type on the AP + + * src/NetworkManagerPolicy.c + - unref AP returned from nm_device_get_best_ap() when needed + +2004-10-28 Dan Williams + + * src/NetworkManagerUtils.c + - (nm_spawn_process): Fix a potential dereference of NULL + + Patches from Peter Jones: + + * src/NetworkManagerDevice.c + - (nm_device_test_wireless_extensions): Better check for + wireless devices + + * src/NetworkManagerUtils.c + - (nm_spawn_process): Pass in valid stdout and stderr so + executed programs don't randomly SIGPIPE and fail + - (nm_get_wired_driver_support_level): quash hal warning + when checking for USB ethernet device + +2004-10-27 Dan Williams + + * info-daemon/NetworkManagerInfo.c + info-daemon/NetworkManagerInfoDbus.c + info-daemon/NetworkManagerInfoPassphraseDialog.c + panel-applet/NMWirelessApplet.c + - Properly escape gconf keys + + * src/NetworkManager.c + - remove unused variables + + * src/NetworkManagerAP.c + - (nm_ap_new_from_ap): Don't redundantly set new APs + refcount since it got set in nm_ap_new() + + * src/NetworkManagerAPList.c + - (nm_ap_list_combine): Give up ownership of newly created + access points to the ap list, fixes memleak + + * src/NetworkManagerDevice.c + - Remove cached_ap_list4 member since its not really needed + - (nm_device_wireless_network_exists): Try to get correct + encryption status of a found AP if its already in our + device list + - (nm_device_do_normal_scan): Clean up scanning a bit, make + memory allocs/deallocs a bit clearer and shorter-lived + +2004-10-26 Ray Strode + + * panel-applet/NMWirelessApplet.c: + (custom_essid_item_selected): kill some compiler + warnings + +2004-10-26 John (J5) Palmieri + + * info-daemon/NetworkManagerInfoDbus.c + - (nmi_dbus_is_running): New function for determining if nmi is already running + - (nmi_dbus_service_init): exit if another instance of nmi is already running + +2004-10-23 Dan Williams + + * info-daemon/NetworkManagerInfoDbus.c + - Trap the "DeviceActivationFailed" signal + + * docs/NetworkManager DBUS API.txt + - Add "DeviceActivationFailed" signal + + * panel-applet/NMWirelessAppletDbus.c + - Quash the "NetworkManager service not available" message + + * src/NetworkManagerDbus.[ch] + - Add the "DeviceActivationFailed" signal + + * src/NetworkManagerDevice.c + - Add support for activation_failed flag + - Fix deadlock where activation thread didn't clean itself up, making + main thread still believe it was alive forever (didn't reset activation + flags like activating, just_activated, etc when IP configuration + failed) + + * src/NetworkManagerPolicy.c + - Implement logic for DeviceActivationFailed signal, and when activation fails + for wireless networks, try to fall back to some other access point + +2004-10-23 Dan Williams + + * panel-applet/NMWirelessApplet.[ch] + - Place the GtkMenuBar inside a GtkEventBox, and add the Event Box + to the applet object, so we can get tooltips + - Add tooltips (RH #136866) + + * src/NetworkManagerDevice.c + - When trying to find a wireless network, try to connect with encryption + turned on first, so that we can more accurately detect whether or not + we need to use encryption for the actual association later on + +2004-10-21 Dan Williams + + * Add some support for telling NetworkManagerInfo to tell the user + that they are using a device that's not fully supported + + * Fix some assertions in debug messages due to null access point args + +2004-10-21 Dan Williams + + * src/NetworkManagerDevice.c + - Don't try to activate/bring up/down unsupported + devices + + * src/NetworkManagerUtils.c + - Fix case of PCI ID checks for driver support levels + +2004-10-21 Dan Williams + + * NetworkManager.h + - New file, now contains commonly used structures and bits + for the dbus API of NetworkManager + + * Makefile.am + - Deliver NetworkManager.h to ${includedir}/NetworkManager + + * src/NetworkManager.h + - Rename -> src/NetworkManagerMain.c + + * Various fixups all around to use NetworkManager.h and new + src/NetworkManagerMain.h, remove redundant bits that got + moved into NetworkManager.h + + * src/NetworkManagerDevice.[ch] + src/NetworkManagerUtils.[ch] + src/NetworkManagerPolicy.c + src/NetworkManagerDbus.c + - Whitelist wireless drivers, and blacklist some wired + drivers. Also blacklist cipsec and ethernet-over-usb + devices at this time (RH #135722, RH #135648) + - Don't leak unsupported devices out over dbus, or allow + them to be set as the active device. Skip over them + during automatic device picking + + * test/nmclienttest.c + - Clean up the dbus code a lot + +Tue Oct 19 14:20:29 2004 Jonathan Blandford + + * configure.in: post release bump. + +Tue Oct 19 14:19:24 2004 Jonathan Blandford + + * configure.in: + * NEWS: Released NetworkManager-0.3.1 + +2004-10-18 Dan Williams + + Patches from Thom May: + * test/nmtestdevices.c + - Include + * src/backends/NetworkManagerDebian.c: + - (nm_system_device_run_dhcp, nm_system_device_stop_dhcp) + (nm_system_device_flush_routes, nm_system_device_flush_addresses) + Move to using g_strdup_printf rather than arbitrary buffers + - (nm_system_device_setup_static_ip4_config) Implement function. + - (nm_system_kill_all_dhcp_daemons) Use killall -q rather than killall + +2004-10-17 Dan Williams + + * info-daemon/NetworkManagerInfoDbus.c + - Display name of network in the "network not found" dialog + + * panel-applet/NMWirelessAppletDbus.c + - (nmwa_dbus_call_nm_method): new function replaces all other + nmwa_dbus_get_[string|string_array|int|boolean] methods + - nmwa_dbus_get_network_name() and nmwa_dbus_get_device_name() + consolidated into nmwa_dbus_get_object_name() + +2004-10-15 Dan Williams + + * src/NetworkManagerDbus.c + info-daemon/NetworkManagerInfoDbus.c + - Display an error dialog when the user tries to use an + "Other wireless network" that's not found. + +2004-10-15 Dan Williams + + * panel-applet/NMWirelessApplet.[ch] + - Fix up corner cases in applet state, making it + look more responsive. Change state to "connecting" when + the user is forcing a device too. + +2004-10-15 Dan Williams + + * src/NetworkManagerAPList.c + - (nm_ap_list_update_network): Disown AP after the list takes ownership + + * src/NetworkManagerDbus.c + - (nm_dbus_nm_set_active_device): Simplify the device setting logic + + * src/NetworkManagerDevice.c + - Disown APs after the device's AP list takes ownership + +2004-10-15 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Update our applet state from the GUI thread + + * panel-applet/NMWirelessAppletDbus.c + - Greatly simplify the locking to make the GUI thread + smoother. Update a private copy of the device list + and active device and only when done talking to + NetworkManager turn it over to the GUI thread. + +2004-10-15 Dan Williams + + * src/NetworkManagerAP.[ch] + - Add "artificial" get/set functions, set for APs that + aren't discovered as part of a scan but instead + discovered by force-setting the ESSID + + * src/NetworkManagerDevice.[ch] + - (nm_device_wireless_network_exists): pass back whether + or not the discovered AP was encrypted. Also, try + falling back to encrypted mode on the card if unencrypted + association doesn't work + - (nm_device_find_and_use_essid): If the network requested + did in fact exists, but it wasn't in our scan list, add + an "artificial" entry for it. Some Cisco cards don't + see non-ESSID-broadcasting APs in their scan but can still + associate with them if you know the ESSID, this works around + that behavior + - (nm_device_do_normal_scan): Carry "artificial" APs over from scan + to scan if the card is currently associated with that AP + +2004-10-15 Dan Williams + + ---- We have a website ---- + http://people.redhat.com/dcbw/NetworkManager + + Patch from Robert Paskowitz: + * src/NetworkManager.c + - (main): Make sure we are run as root + * src/NetworkManagerDevice.c + - Fix type in ad-hoc setting function + + Patch from Thom May: + * src/backends/NetworkManagerDebian.c + - Make Debian backend compile again + +2004-10-14 Dan Williams + + * Tagged NetworkManager-0_3 + +2004-10-14 Dan Williams + + Patch from Robert Paskowitz: + * NEWS + src/NetworkManagerDevice.[ch] + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSlackware.c + - Add support for grabbing and using a broadcast address + from system config files + - Some Gentoo backend fixes for grabbing network config + - Fix LOG_WARN->LOG_WARNING + +2004-10-14 Dan Williams + + * NEWS: a few small fixes in the credits + +Thu Oct 14 19:12:58 2004 Jonathan Blandford + + * NEWS: prep for release. + +Thu Oct 14 16:47:12 2004 Jonathan Blandford + + * panel-applet/NMWirelessAppletDbus.c + (nmwa_dbus_update_device_wireless_networks): remove warnings. + +Thu Oct 14 16:40:39 2004 Jonathan Blandford + + * panel-applet/NMWirelessApplet.c (animation_timeout): Make + applet->state == APPLET_STATE_NO_NM animation. + + * panel-applet/NMWirelessApplet.c (custom_essid_item_selected): + set the text correctly. + +2004-10-14 Dan Williams + + * src/NetworkManager.c + - Only accept and manager 802.3 and 802.11 devices + + * src/NetworkManagerDbus.[ch] + - (nm_dbus_nm_set_active_device): move most of the actual activation + logic into NetworkManagerDevice.c + - (nm_dbus_network_status_from_data): new function + - (nm_dbus_signal_network_status_change): new function, unused for now + - (nm_dbus_nm_message_handler): use nm_dbus_network_status_from_data () now + + * src/NetworkManagerDevice.[ch] + - (nm_device_find_and_use_essid): new function. Search for, and if found use, + a random ESSID. + +2004-10-14 John (J5) Palmieri + + * info-daemon/NetworkManagerInfo.c + - (main): Added session management + +2004-10-14 Dan Williams + + * panel-applet/NMWirelessAppletDbus.[ch] + - Expose network_device_[un]ref() + - Expose wireless_network_[un]ref() + - (wireless_network_new_with_essid): new function, create and return + a wireless network with a particular essid + + * panel-applet/NMWirelessApplet.c + - Hook up the "other network" dialog to do something + +Wed Oct 13 19:31:53 2004 Jonathan Blandford + + * panel-applet/NMWirelessApplet.c: Add an essid dialog. It + doesn't work yet, but it looks okay. + + * panel-applet/icons/*png: Resize to 22x22 and install in the + right place. + +2004-10-13 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Add function to print out applet_state in a readable + manner + + * src/NetworkManager.c + - (main): Don't segfault when nm_dbus_init() fails, we had + a left-over call to hal_shutdown() into which we passed NULL + + * src/NetworkManagerAP.c + - (nm_ap_set_essid): Allow NULL essids + + * src/NetworkManagerAPList.[ch] + - More use of nm_ap_list_[un]lock () + - (nm_ap_list_get_ap_by_essid): don't warn when looking for a NULL + network/essid, just return nothing. Also skip over NULL + essid access points in the list when searching + - (nm_ap_list_get_ap_by_address): new function + - (nm_ap_list_update_network): set the access point's key source to + NULL when the key returned from NetworkManagerInfo is NULL or + of 0 length + - nm_ap_list_update_keys() -> nm_ap_list_update_properties(), and + copy timestamp over too + - (nm_ap_list_copy_essids_by_address): new function, attempt to + find the correct ESSID for a blank-essid access point by searching + through another list and matching access point MAC addresses + - (nm_ap_list_diff): exclude blank-essid access points from the diffs + + * src/NetworkManagerDbus.c + - (nm_dbus_nm_set_active_device): deal with random networks the user + may specify. This is mainly for access points that don't + broadcast their essid. So if the user tells us to associate with + some random ESSID that's not in our access point list, we find + out if the access point does in fact exist (by attempting association + and then matching that access point's MAC address with the essid the + user gave us) and then we switch to it. + - (nm_dbus_devices_handle_request): don't add blank-essid access points + to the returned list of networks for the "getNetworks" method + + * src/NetworkManagerDevice.[ch] + - Extra debugging info for link detection + - (nm_device_ap_list_get_ap_by_address): new function, return an AP + based on MAC address + - (nm_device_get_path_for_ap): ignore blank-essid access points + - (nm_device_wireless_network_exists): new function, find out whether + a random ESSID exists by attempting to associate with it + - (nm_device_do_normal_scan): allow blank-essid access points in our + device list as long as they have an AP MAC address we can use. + Also send WirelessNetwork[Dis]Appeared signals for non-active + devices too. Lets the applet update more frequently. + + * src/backends/NetworkManagerGentoo.c + - Patch from: Robert Paskowitz + - Update backend code for Gentoo + - Implement nm_system_device_update_config_info () + + * test/nmclienttest.c + - (set_network_device): new function, takes a command-line argument + and tells NetworkManager to use that wireless network + +Wed Oct 13 John (J5) Palmieri + + * info-daemon/NetworkManagerInfo.c (nmi_spawn_notification_icon): Stop respawning + if the notification icon crashes 5 times within 5 seconds of each respawn + +Tue Oct 12 22:53:04 2004 Jonathan Blandford + + * panel-applet/NMWirelessApplet.c (nmwa_update_state): remove + g_print. + +Tue Oct 12 22:44:15 2004 Jonathan Blandford + + * panel-applet/NMWirelessApplet.h: Change the name of the icons. + + * panel-applet/NMWirelessApplet.c: (animation_timeout), + (nmwa_update_state), (nmwa_destroy), (nmwa_setup_widgets), + (nmwa_icons_free), (nmwa_icons_load_from_disk), (nmwa_icons_init): + Change the name of the icons. + + * panel-applet/menu-info.c: (nm_menu_wired_class_init), + (nm_menu_wired_expose_event), (nm_menu_network_class_init), + (nm_menu_wireless_class_init), (nm_menu_wireless_new), + (nm_menu_wireless_expose_event): Really bad hack to get the style + to draw in the right color. + +Tue Oct 12 John (J5) Palmieri + + * info-daemon/NetworkManagerInfo.c (main): Add child watch to respawn + Notification if it crashes + +Fri Oct 8 07:19:55 2004 Jonathan Blandford + + * panel-applet/NMWirelessAppletDbus.c (nmwa_dbus_get_double): + (nmwa_dbus_get_string): remove unused functions + + * panel-applet/NMWirelessApplet.c (nmwa_about_cb): + (nmwa_cancel_timeout), (nmwa_get_menu_pos), (nmwa_factory): + remove unused functions + + * panel-applet/NMWirelessApplet.c: Rewrite icon code. + +2004-10-12 Dan Williams + + * panel-applet/NMWirelessAppletDbus.c + - New functions: + wireless_network_new + wireless_network_copy + network_device_new + network_device_copy + + * src/NetworkManagerDevice.[ch] + - New functions: + nm_device_set_mode_managed + nm_device_set_mode_adhoc + - Use these functions where appropriate + - When creating a new wireless device, force the card + to managed/Infrastructure mode as soon as possible + +2004-10-12 Dan Williams + + * src/NetworkManagerDevice.c + - Force wireless cards into Infrastructure mode before we use them + +2004-10-12 Dan Williams + + * TODO + - Remove bit about static IP address support + + * src/NetworkManagerUtils.c + - (nm_spawn_process): Add some error reporting + + * src/NetworkManagerDevice.c + - (nm_device_activation_configure_ip): hook up to the static config + routines in the backends + + * src/backends/NetworkManagerRedHat.c + - (nm_system_device_update_config_info): use shvar.c routines to + parse the config file iformation, not our own + - (nm_system_device_setup_static_ip4_config): new function, based + heavily on 'ifup' script and 'ipcalc' tool code. Set up a device + with a static IP address and gateway + + * src/backends/shvar.[ch] + - Parser (filched from initscripts package) for ifcfg-* files + + * src/backends/NetworkManagerSystem.h + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerSlackware.c + - Stub nm_system_device_update_config_info() and nm_system_device_setup_static_ip4_config() + +2004-10-11 Dan Williams + + * TODO + - Remove bit about more robust AP diffing since I just implemented it + +2004-10-11 Dan Williams + + * src/NetworkManagerAP.c + - (nm_ap_new, nm_ap_new_from_ap): Don't crash when we don't have + enough RAM to allocate new AP structures, but return NULL instead + + * src/NetworkManagerAPList.[ch] + - (nm_ap_list_is_empty): new function + - (nm_ap_list_combine): new function, combine two access point lists + - (nm_ap_list_copy_keys): new function, copy keys from one list + into another + + * src/NetworkManagerDevice.[ch] + - Rename some functions to be clearer: + nm_device_get_best_ap_frozen -> nm_device_is_best_ap_frozen + nm_device_just_activated -> nm_device_is_just_activated + nm_device_activating -> nm_device_is_activating + nm_device_now_scanning -> nm_device_is_scanning + - Cache the last 4 scans so that the access point list is more stable. + We combine the lastest two scans and use that as the AP list, + and diff that combined list against the combination of the earliest + two cached scans for the WirelessNetworkAppeared/Dissappeared signals + +2004-10-08 John (J5) Palmieri + + * info-daemon/NWManagerInfo.h + - (struct NetworkManagerInfo): add shutdown_timeout GSource + + * info-daemon/NWManagerInfoDbus.c + - (shutdown_callback): new function + - (nmi_dbus_filter): Create a 30 second timeout until shutdown + if NetworkManager goes away. Kill the timeout + if NetworkManager restarts before the 30 seconds + are up. + - (nmi_dbus_service_init): + - call gtk_main_quit if NetworkManager is not running + - add filters to monitor dbus service creations and + deletions + +2004-10-08 John (J5) Palmieri + + * panel-applet/NMWirelessApplet.c + - (nmwa_update_state): Hide notification icon if we are only + showing one wired card and no wireless interfaces + (Red Hat Bug #134895) + + * panel-applet/NMWirelessAppletDbus.c + - (nmwa_dbus_filter): changed exit to gtk_main_quit () + + * info-daemon/NWManagerInfo.c + - (main): Terminated the notification_icon_cmd array with a NULL + +2004-10-08 Hendrik Brandt + + * configure.in (ALL_LINGUAS): Added de (German). + +2004-10-08 Dan Williams + + * src/NetworkManagerDevice.c + - Be a bit more robust about link checking, ie make sure that + the WEP key we were given actually has some data in it + +2004-10-08 Dan Williams + + * info-daemon/NetworkManagerInfo.c (main): + - Initialize GError object to NULL + +2004-10-08 Dan Williams + + * panel-applet/NMWirelessAppletDbus.c + - Die if NetworkManagerInfo dies, since it manages our lifetime + +2004-10-08 Dan Williams + + * info-daemon/NetworkManagerInfo.[ch] + info-dameon/NetworkManagerInfoDbus.[ch] + info-daemon/NetworkManagerInfoPassphraseDialog.[ch] + - Preserve original label text in the passphrase dialog so that + it actually gets updated with the new network name the next + time around. Previously, we were overwriting it so you'd get + the wrong network name to enter a key for + - Add a "Key Type" combo to the passphrase dialog, user selects + encryption key type now, type is stored in GConf too + - Adjust NM<->NMI DBUS protocol to pass the key type back to NM too + + * src/NetworkManagerAP.[ch] + - Remove all the encyption method magic. It's now set by the user + and NetworkManager retrieves the type of encryption key from + NetworkManagerInfo + + * src/NetworkManagerAPList.[ch] + src/NetworkManagerDbus.[ch] + - Adjust to new way of setting encryption key and method + - Pull encryption method down from NMI along with key + + * src/NetworkManagerDevice.[ch] + - Removed encryption method fallback magic as the method is now + determined by the user. This greatly simplifies the connection + logic. + - More robust connection/link logic. Besides removing the encryption + method fallback magic, check whether or not the card is receiving + invalidly encrypted packets, which usually indicates that we have + a bad WEP key set. + - Don't blindly forge ahead when DHCP fails (still not completely fixed) + + * test/nminfotest.c + - Test out new "Key Type" stuff in the NMI passphrase dialog + +2004-10-07 Dan Williams + + * info-daemon/NetworkManagerInfo.conf + - Allow root user to run NMI too + +2004-10-06 Dan Williams + + * src/NetworkManagerDevice.[ch] + src/NetworkManagerDbus.c + doc/NetworkManager DBUS API.txt + - Add a new status tag "scanning", which is set when there + is no active network connection, but NetworkManager is + looking for an access point to associate with + + * panel-applet/main.c + - Cast the applet appropriately for gtk_widget_show_all () + +Mon Oct 4 12:55:41 2004 Jonathan Blandford + + * panel-applet/eggtrayicon.[ch]: + * panel-applet/main.c: Add missing file + +2004-10-04 Dan Williams + + * src/NetworkManagerDevice.[ch] + - Add a slightly more robust method of determining if the WEP key + is correct or not, by checking the WEP-discarded packet count + on the card + + * info-daemon/NetworkManagerInfo.c + - (nmi_gconf_notify_callback): Fix GConf essid escaping, should + un-escape values we pull out rather than escaping them + +2004-10-03 Marcel Telka + + * configure.in (ALL_LINGUAS): Added sk. + +Fri Oct 1 18:26:03 2004 Jonathan Blandford + + * panel-applet/menu-info.c (nm_menu_wired_class_init): update look + and feel. We should be back to working, and have a good, clean + look. + +2004-09-30 Dan Williams + + * info-daemon/NetworkManagerInfo.c + info-daemon/NetworkManagerInfoDbus.c + test/nminfotest.c + - Escape ESSIDs in gconf + + * src/NetworkManagerDevice.c + - Fix pseudo-scanning to use netowrk list from info daemon + +Wed Sep 29 18:18:24 2004 Jonathan Blandford + + * configure.in: Add a temporary --enable-notification-icon. This + will prolly go away. + + * info-daemon/Makefile.am: + * info-daemon/NetworkManagerInfo.c: + * info-daemon/NetworkManagerInfo.h: Use a notification icon. + + * panel-applet/Makefile.am: + * panel-applet/NMWirelessApplet.c: Turn into a notification icon + * panel-applet/NMWirelessApplet.h: + +Tue Sep 28 16:35:20 2004 Jonathan Blandford + + * panel-applet/NMWirelessApplet.c: Fix deadlock. Add a separator + before 'select custom ESSID'. + + * panel-applet/menu-info.c: Start rewrite for better headers. Not + fully complete, but syncing in prep for merge. + + * panel-applet/icons/*png: New images + +2004-09-28 Dan Williams + + * src/NetworkManager.c + src/NetworkManagerDevice.c + src/NetworkManagerPolicy.c + - Don't blow away an active wired connection on startup + +2004-09-28 Bryan Clark + + Changes from J5 + + * info-daemon/NetworkManagerInfo.conf: fixed own permissions + + * info-daemon/NetworkManagerInfoDbus.c: added service name to + syslog output + +Wed Sep 22 14:19:48 2004 Jonathan Blandford + + * panel-applet/NMWirelessApplet.c: Only add essid's if we actually + have a wireless card. + +Wed Sep 22 14:05:48 2004 Jonathan Blandford + + * panel-applet/NMWirelessApplet.c: move the custom essid item. + Also, get the right device strings. + +Wed Sep 22 13:51:45 2004 Jonathan Blandford + + * panel-applet/menu-info.c (nm_menu_network_draw_indicator): Flip + the logic to make this right. + + * panel-applet/NMWirelessApplet.c (sort_networks_function): sort + devices so that wired networks are always first. + +2004-09-22 + + * initscript/Debian/.cvsignore: + * initscript/Slackware/.cvsignore: + Added new cvsignores for Makefile, Makefile.in + + * test/.cvsignore: + Added nmtestdevices + + * src/NetworkManagerDevice.c: + * src/NetworkManager.c: + Updated the wireless/wired HAL device strings from net.ethernet to + net.80203 or net.80211 depending on wired or wireless respectively + + * examples/python/NetworkManager.py: + s/Quality/Strength/ + + * examples/python/systray/network_tray.py: + Lots of little changes and fixes. been rotting for a while so I + figured I'd finally sync them all with CVS + +Tue Sep 21 18:05:34 2004 Jonathan Blandford + + * configure.in: Add graphics + + * panel-applet/Makefile.am: Add graphics + + * panel-applet/icons/*: Add graphics + + * panel-applet/NMWirelessApplet.c: Use new menu times to display + the icons fully lined up. + + * panel-applet/menu-info.c: + * panel-applet/menu-info.h: Add another menu type. + +Fri Sep 17 14:04:34 2004 Jonathan Blandford + + * panel-applet/NMWirelessApplet.c: Redo the menu item code. + + * panel-applet/menu-item.[ch]: Wireless menu item. + +2004-09-15 John (J5) Palmieri + + * info-daemon/NetworkManagerInfo.conf + - Created a more robust security policy for the DBus service + - everything is denied by default + - root can own and send to the service + - users logged in at the console can send to the service + +2004-09-13 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_get_essid): use iw_get_basic_config() rather than + iw_get_ext (SIOCGIWESSID) since prism54 cards don't like + the latter + +2004-09-13 Dan Williams + + * TODO: fix typo + + * docs/NetworkManager DBUS API.txt + - Update for new signal strength changes + + * panel-applet/NMWirelessApplet.c + - Make panel icon show strength of the current connection + - Cleanups and memleak fixes + + * panel-applet/NMWirelessApplet.h + - Add data members for signal strength on devices and networks + + * panel-applet/NMWirelessAppletDbus.c + - Free more DBusErrors + - Update for new signal strength changes + - Make devices and networks more like real objects, use ref/unref methods + - Actually unlock the mutex when updating the active device + + * src/NetworkManagerAP.c + - Change AP functions and data members from "quality"->"strength" + + * src/NetworkManagerDbus.c + - Kill "getMaxQuality" and "getQuality" methods + - Add "getStrength" methods for Networks and Devices + + * src/NetworkManagerDevice.[ch] + - Add accessors for device strength + - Add functions to update strength for a device. Note that not all drivers + actually support signal strength for scanned access points (Atmel drivers + being one) + - Calculate signal strength for each AP during scan + + * src/NetworkManagerWireless.[ch] + - Add function to return signal strength % from a device and a raw quality struct + + * test/nmclienttest.c + - Update for new signal strength changes + +2004-09-11 Dan Williams + + * src/NetworkManager.c + - Fix race condition between initscripts and NM on card insertion + which could cause a card to keep an IP address and routes around + even when it was not the active device + + * src/NetworkManagerDbus.c + - Fix compile errors, free more DBusErrors + +2004-09-11 Dan Williams + + * docs/NetworkManager DBUS API.txt + - Add an explanation of NM's API + + * src/NetworkManagerDbus.c + - Free some more DBusErrors if needed + +2004-09-11 Dan Williams + + * panel-applet/NMWirelessApplet.c + panel-applet/NMWirelessAppletDbus.c + - Start using NetworkDevice/WirelessNetwork structures in more places + - Update for unified device/network forcing in NetworkManager + + * src/NetworkManager.c + - some code consolidation + + * src/NetworkManagerDbus.c + - (nm_dbus_nm_set_active_device): "setActiveDevice" now takes either one + or two arguments: the first is the NM ID of the device to switch to, + and the second (optional) argument is the ESSID of a wireless network + to use as well. + - Get rid of "setNetwork" method due to above change + + * src/NetworkManagerDevice.c + - (nm_device_new): perform scan and update best AP on device creation + - nm_device_activation_cancel_if_needed()->nm_device_activation_should_cancel() + - nm_device_activation_signal_cancel()->nm_device_activation_cancel(), and + spin waiting for cancellation to finish before returning + + * src/NetworkManagerPolicy.c + - Changes here clarify the situations in which a device switch occurs, and + make sure to keep using a forced device and network if the user gives + us one + - Remove old unused code + +2004-09-11 Martin Willemoes Hansen + + * configure.in: Added Danish (da) to ALL_LINGUAS. + +2004-09-09 Dan Williams + + * panel-applet/NMWirelessAppletDbus.c + - Pull fresh devices and networks from NM when wireless networks + change. Provides faster feedback of a forced wireless network + + * src/NetworkManagerDbus.c + - Return error when "getMaxQuality" is called on a wired device + - Make best_ap freezing actually work again, and signal cancellation + of activation if there's already a device activation when the user + freezes the best_ap + + * src/NetworkManagerDevice.c + - Don't clear out the best_ap for wireless devices when the link goes + down, that's done elsewhere + - Kill any dhcp daemons when cancelling device activation since they + may be stuck waiting for a DHCP address, and since we're cancelling + activation we don't care about that anymore + + * src/NetworkManagerPolicy.c + - Make sure to unref the device we ref earlier (we refed it to make sure + it stuck around during device activation and such) + - If we were going to change the best device, but its activating currently + (and therefore the change didn't occur due to the check earlier) + we mark the state changed to we come back to it later when device + activation has canceled and its no longer activating + + * src/backends/NetworkManagerRedHat.c + - SIGKILL dhcp daemons rather than SIGTERM-ing them + +2004-09-09 Bryan Clark + + * info-daemon/passphrase.glade: + set passphrase input to activates_default : True + + * examples/python/systray/network_tray.py + (network_tray.sort_networks): + + Added support for having wireless always scanning + +2004-09-09 Dan Williams + + NOTE: this commit changes the behavior of wireless devices in + NetworkManager. They are now up all the time, scanning all + the time. Only the active device has an IP address and routing + information set up however. Also, NetworkManager will no longer + opportunistically switch wireless networks when a better one + comes in range, it will remain associated with one wireless network + until that one drops out. + + * panel-applet/NMWirelessApplet.c + panel-applet/NMWirelessAppletDbus.c + - List all wireless cards and their respective networks + + * src/NMLoadModules + - Use full path to /sbin/ip + + * src/NetworkManager.c + - Keep wireless devices up all the time so they can scan + + * src/NetworkManagerDbus.c + - On a WirelessNetworkUpdate signal from NMI, don't update + the "best" AP + + * src/NetworkManagerDevice.c + - (nm_device_set_link_active): clear out the best ap for + wireless devices when the link is set to FALSE + - Scan on all wireless cards, all the time + - (nm_device_activation_worker): split out the wireless card + link-waiting code to a separate function + - Keep wireless cards up even if device activation fails + - Don't update the "best" ap as much + + * src/NetworkManagerPolicy.c + - Don't update the best ap when checking if its frozen, + let link checking clear out a frozen best ap for us + + * src/NetworkManagerWireless.c + - Scan on all wireless cards, all the time + +2004-09-09 Francisco Javier F. Serrador + + * configure.in: Added 'es' (Spanish) to ALL_LINGUAS. + +2004-09-09 Ankit Patel + + * configure.in: Added 'gu' (Gujarati) to ALL_LINGUAS. + +2004-09-09 Pablo Saratxaga + + * configure.in: Added Walloon (wa) to ALL_LINGUAS. + +2004-09-08 Bryan Clark + + * examples/python/NetworkManager.py: + added CONNECTED, CONNECTING, and DISCONNECTED states + added methods to return number of devices of a single type + + * examples/python/systray/network_tray.py: + did some tweaks to get the menu looking near what it is supposed + to look like. Also did a Airo card hack to make it show the + correct AP quality + +2004-09-08 Dan Williams + + * panel-applet/no-networkmanager.png + panel-applet/Makefile.am + panel-applet/NMWirelessApplet.c + - Add a "NetworkManager not running" icon and use it + - Use new consolidated GConf keys rather than Preferred/Trusted + + * TODO: update + + * info-daemon/NetworkManagerInfo.c + info-daemon/NetworkManagerInfoDbus.[ch] + info-daemon/NetworkManagerInfoPassphraseDialog.c + - There are now no longer two separate lists of wireless networks, + but one list where each network is "trusted" or not trusted + - Add a "getNetworkTrusted" dbus method + - "WirelessNetworkUpdate" signal now sent rather than + "PreferredNetworkUpdate/TrustedNetworkUpdate" signals + - Start freeing some dbus errors (not completed yet) + + * info-daemon/passphrase.glade + - Remove the "don't show" hints for pager and taskbar + - Add a title since its going to be in the taskbar + + * src/NetworkManager.[ch] + src/NetworkManagerAPList.[ch] + - There are now no longer two separate lists of wireless networks, + but one list where each network is "trusted" or not trusted + + * src/NetworkManagerAP.[ch] + - Add get/set "trusted" accessors and data bit + + * src/NetworkManagerDbus.[ch] + - Add function to get "trusted" status of a network from NetworkManagerInfo + - Trap new WirelessNetworkUpdate signal rather than old separate signals + + * src/NetworkManagerDevice.[ch] + - Add per-device config data (ip4 addr, gateway, netmask) and accessors + - (nm_device_new): Get device config from backend when initializing devices + - (nm_device_activation_worker): Split out device configuration on + activation to deal with static/dynamic IP differences, and try encryption + fallbacks on a device if the encryption method for the best AP is not good + - (nm_device_update_best_ap): convert to new consolidated access point lists from + NetworkManagerInfo, and copy over latest NMI info to best_ap when setting it + + * src/NetworkManagerWireless.c + - libgcrypt code wasn't converting the MD5 digest to an ascii string, fix it + + * src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSystem.h + - (nm_system_device_update_config_info): Add function to get device configuration + from system data in ifcfg-* files + + * src/backends/NetworkManagerDebian.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerSlackware.c + - Add stub functions for getting device configuration + +2004-09-07 Dan Williams + + * src/backends/NetworkManagerRedhat.c + src/backends/NetworkManagerSlackware.c + - Use full path to /sbin/ip everywhere + +2004-09-07 Dan Williams + + Patch from: Narayan Newton + + * configure.in + initscript/Makefile.am + initscript/Slackware/Makfile.am + initscript/Slackware/rc.networkmanager + src/Makefile.am + src/backends/NetworkManagerSlackware.c + - Add Slackware support + +2004-09-07 Dan Williams + + Patches below from: + + Mark Roach + Thom May + + * configure.in + initscript/Debian/NetworkManager + initscript/Debian/Makefile.am + - Initscript for Debian + + * src/backends/NetworkManagerDebian.c + - Add missing system init function to allow compilation + on Debian + +2004-09-03 Raphael Higino + + * configure.in: Added 'pt_BR' to ALL_LINGUAS. + +2004-09-03 Akagic Amila + + * configure.in: Added 'bs' to ALL_LINGUAS. + +2004-09-02 Colin Walters + + * src/backends/NetworkManagerRedHat.c (nm_system_device_run_dhcp) + (nm_system_device_stop_dhcp, nm_system_device_flush_routes): Use + g_strdup_printf instead of arbitrarily sized buffers. + +2004-09-01 Colin Walters + + * NetworkManager.pc.in: New file. + + * Makefile.am, .cvsignore, configure.in: Add NetworkManager.pc. + +2004-09-01 Amanpreet Singh Alam + + * configure.in: Punjabi(pa) is added to po/. + +2004-08-31 Dan Williams + + * Remove 'debug' extern global from all files since we now + use syslog() + + * src/NetworkManager.[ch] + - Break out routine that get the net.interface property from HAL, + removing that logic from nm_create_device_and_add_to_list() + - (nm_create_device_and_add_to_list): make this a bit more general so + it doesn't do the talking to HAL. Also add arguments to facilitate + the create of test devices. + - (nm_data_mark_state_changed): rename from nm_data_set_state_modified() + - (nm_data_new, main, nm_print_usage): add new argument "--enable-test-devices" + which makes NetworkManager listen for dbus commands to create test + devices, which have no backing hardware. Use when you're on a plane + for example, and/or forgot your wireless card at home. Test devices + _cannot_ be created unless NM is started with --enable-test-devices. + + * src/NetworkManagerDbus.[ch] + - New "getLinkActive" method for devices + - New "setLinkActive" method for devices (only works on test devices) + - New "createTestDevice" method on NetworkManager object to create a test + device of a specified type (ie wired, wireless). UDI is created from + scratch, as is the interface name. Only works when NM is started with + --enable-test-devices switch. + - New "removeTestDevice" method on NetworkManager object which removes a + test device. Only works when NM is started with --enable-test-devices + + * src/NetworkManagerDevice.[ch] + - Logic to facilitate test devices. Add variables to NMDevice struct to indicate + whether a device is a test device or not, and what its link status is. + - Deal with test devices in most functions. For those that work directly on hardware + special-case test devices. + - (nm_device_new): don't create a test device if test devices weren't enabled on the + command-line. + - (nm_device_update_link_active): split out logic for wired and wireless device link + checking to separate functions to facilitate test device link checking. + - (nm_device_set_enc_key): Since some drivers for wireless cards are daft and + don't make a distinction between System Authentication and Encryption + (namely Cisco aironet), we use Open System auth when setting a WEP key + on the card. We don't deal with Shared Key auth yet. + - (nm_device_activation_worker): split the activation cancel check logic out into + a separate routine nm_device_activation_cancel_if_needed() + - (nm_device_activation_signal_cancel): rename from nm_device_activation_cancel() + - (nm_device_fake_ap_list): Test wireless devices obviously cannot scan, so create + a list of fake access points that they can "see" + - (nm_device_is_test_device): return whether or not a device is a test device + + * src/NetworkManagerPolicy.c + - (nm_policy_get_best_device): attempt to deal with wireless network selection, + previously if you "locked"/forced NM to use a wireless device but then + selected a wireless network for NM to use, it would switch to a wired device. + So, if the active device is wireless and it has a "forced" best AP, use it + if the "forced" best AP is still valid + - (nm_state_modification_monitor): deal with NULL best devices, for example + there were no usable network devices, or the last one was removed + + * src/backends/NetworkManager*.c + - Deal with test devices, mostly just return success for operations like getting + a DHCP address + + * test/nmtestdevices.c + - Test tool to create/remove/link-switch test devices + +2004-08-30 Bryan Clark + + * examples/python/NetworkManager.py: + added convience functions has_wired_device and has_wireless_device + + * examples/python/systray/network_tray.py: + cleaned up a bunch of cruft, added support for listing wireless + networks just like the real applet. This is probably all I'm + going to work on this applet from now on. + TODO: add support for actually changing networks and devices + + * examples/python/NetworkManager.py (NetworkManager.get_device): + changed "nm.networks" into a dict from a list so I can store all + the cool information about networks in there + + * examples/python/systray/network_tray.py: + Added nice message when you try to run without running make first + + * examples/python/NetworkManager.py: + Bug fixes to the code so we get all the device information + that we need in get_device() + + * examples/python/NMTester.py: + Fixed _print_device_list to print_device_list + +2004-08-29 Seth Nickell + + * configure.in: + + Actually properly setup the Debian backend in configure. + +2004-08-29 Colin Walters + + * test/nminfotest.c: Include string.h and stdlib.h. + (get_network_string_property, get_networks_of_type): Return NULL. + + * test/nmclienttest.c (get_device_name, get_active_device): Return + NULL. + + * src/backends/NetworkManagerRedHat.c (nm_system_device_stop_dhcp): Just + use strlen, fgets always NULL-terminates the string. + + * src/NetworkManagerDbus.c (nm_dbus_nmi_filter, + dbus_message_get_member): Remove /* in comment. + + * src/NetworkManagerUtils.c (LOCKING_DEBUG): Ditto. + + * src/NetworkManager.c (quit): Unused, delete. + (nm_data_free): Cast arg to GFunc. + + * panel-applet/NMWirelessAppletDbus.c: Need to include + string.h, and dbus-glib-lowlevel.h (the latter is needed + for dbus_connection_setup_with_g_main at present). + (nmwa_dbus_update_wireless_network_list): Parenthesize + assignment in conditional. + (nmwa_dbus_worker): Return NULL. + + * panel-applet/NMWirelessApplet.c (nmwa_redraw) + (nmwa_get_menu_pos, nmwa_toplevel_menu_activate) + (nmwa_menu_add_text_item, nmwa_setup_widgets): Kill unused variables. + (nmwa_populate_menu): Return NULL on failure, instead of just + return; + + * initscript/NMLaunchHelper.c (g_timeout_add): Cast arg to GSourceFunc. + + * info-daemon/NetworkManagerInfoNetworksDialog.c (nmi_networks_dialog_init): Kill unused + variables. + + * info-daemon/NetworkManagerInfo.c (nmi_print_usage): Unused, + delete. + +2004-08-29 Colin Walters + + * src/NetworkManagerDbus.c (nm_dbus_get_network_timestamp): Return + a GTimeVal instead of time_t. This is easier to work with, + since time_t may be a long or double, we don't know. + + * src/NetworkManagerDbus.h: Update prototype. + + * src/NetworkManagerAP.c (struct NMAccessPoint): Store a GTimeVal + instead of time_t. + (nm_ap_get_timestamp): Update to return GTimeVal. + (nm_ap_set_timestamp): Update to take GTimeVal. + + * src/NetworkManagerDevice.c (nm_device_update_best_ap): Update + to handle GTimeVal. + + * src/NetworkManagerAPList.c (nm_ap_list_update_network): Handle + GTimeVal change. + (nm_ap_list_print_members): Fix warnings in printf format. + +2004-08-29 Colin Walters + + * panel-applet/NMWirelessApplet.c: Include config.h. + +2004-08-29 Colin Walters + + * configure.in: Generate config.h. + + * configure.in: Dump dependency on OpenSSL; we can't + use it since this package is GPL: + http://www.gnome.org/~markmc/openssl-and-the-gpl.html + Instead, check for libgcrypt, use it if available, + otherwise use included MD5 code. + + * src/gnome-keyring-md5.h, src/gnome-keyring-md5.c: + Suck in from gnome-keyring, munge a bit. + + * src/Makefile.am (NetworkManager_SOURCES) : Include + gnome-keyring-md5.h gnome-keyring-md5.c. + (NetworkManager_LDADD) : Add dep on LIBGCRYPT_LIBS. + + * src/NetworkManagerWireless.c (nm_md5): New function, uses + libgcrypt or included gnome-keyring md5 bits. + (nm_wireless_128bit_key_from_passphrase): Use nm_md5. + +2004-08-28 Kjartan Maraas + + * configure.in: Add «nb» and «no» to ALL_LINGUAS. + +2004-08-27 Bryan Clark + + * examples/python/systray/Makefile: + + Updated the clean section + + * examples/python/systray/trayiconmodule.c: + * examples/python/systray/trayicon.override: + * examples/python/systray/network_tray.py: + * examples/python/systray/eggtrayicon.h: + * examples/python/systray/eggtrayicon.c: + * examples/python/systray/Makefile: + * examples/python/README: + * examples/python/NetworkManager.py: + * examples/python/NMTester.py: + + Initial commit of these python example files + +Fri Aug 28 2004 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Make current device bold + - Show more user-friendly device name if we got one from hal + + * panel-applet/NMWirelessAppletDbus.c + - Grab "info.product" key from hal for network devices + - Cache the current active device + +2004-08-27 Adam Weinberger + + * configure.in: Added en_CA to ALL_LINGUAS. + +2004-08-27 Christian Rose + + * configure.in: Added "sv" to ALL_LINGUAS. + +Thu Aug 26 2004 Dan Williams + + * Tag NetworkManager-0.2 + +Thu Aug 26 17:23:16 2004 Jonathan Blandford + + * initscripts/Makefile.am + * configure.in: Make pass distcheck + + * po/ChangeLog: added + +Thu Aug 26 2004 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Remove debugging code + - Enable device switching from menus + + * panel-applet/NMWirelessAppletDbus.[ch] + - Method for asking NM to switch devices + + * src/NetworkManagerDevice.c + - Set dev->activating earlier, avoids race between + the dbus signal of "DeviceActivating" and setting + dev->activating (which is what NM's "status" method call + looks at) + +Thu Aug 26 2004 Dan Williams + + * panel-applet/NMWirelessApplet.[ch] + - Rework menu code to add devices to menu, and to show + signal strength for each access point. Code cleanups + too. + + * panel-applet/NMWirelessAppletDbus.c + - Grab network devices from NetworkManager too + - Grab quality information from NM for wireless networks + + * src/NetworkManagerDbus.[ch] + - Add dbus methods for getting the HAL UDI from a device and + for getting its base quality, if its wireless + - Consolidate some functions (wireless network notifications, + device notifications) + - Add method for requesting NM to use a particular device + + * src/NetworkManager.c + - Change for function consolidations from NetworkManagerDbus.c + - Implement active device locking and user-requested devices + (ie, tell NM to use a particular device instead of the one + it autochose) + + * src/NetworkManagerDevice.c + - Add method for getting the base quality of a device, if its + wireless + - Grab device base quailty info from iwlib during scans + + * src/NetworkManagerPolicy.c + - Use a user-requested device rather than the auto-chosen device + if we are told to + +Thu Aug 26 15:12:36 2004 Jonathan Blandford + + * Makefile.am: add po as a supdir + + * autogen.sh: use gnome-autogen.sh + + * initscript/Gentoo/.cvsignore: + * initscript/RedHat/.cvsignore: Shut up cvs + + * panel-applet/Makefile.am: Define GNOMELOCALEDIR for bonobo. + + * panel-applet/NMWirelessApplet.c: (nmwa_populate_menu), + (nmwa_fill): Use gettext. + + * configure.in: add gettext support + * po/.cvsignore: + * po/NetworkManager.pot: + * po/POTFILES.in: + +2004-08-26 Seth Nickell + + * panel-applet/NMWirelessApplet.c: (nmwa_destroy), + (nmwa_menu_item_activate), (nmwa_toplevel_menu_activate), + (nmwa_add_menu_item), (nmwa_menu_item_data_free), + (nmwa_dispose_menu_items), (nmwa_populate_menu), + (nmwa_setup_widgets), (do_not_eat_button_press), (nmwa_new): + * panel-applet/NMWirelessApplet.h: + + Use a menu bar instead of a button for the main clickable + thingy. + +2004-08-25 Dan Williams + + * src/NetworkManagerDevice.c + - (nm_device_set_enc_key): always set device to "open" mode instead of + turning encryption off, because the Cisco driver doesn't associate + with WEP-enabled access points unless we are in "open" + +2004-08-25 Dan Williams + + * src/NetworkManagerWireless.c + - Don't try to defererence blank passphrases + +2004-08-25 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Rebuild the menu whenever a user clicks + +2004-08-25 Dan Williams + + * panel-applet/NMWirelessApplet.c + - (nmwa_udpate_state): Set panel icon to "wired" (for lack of better ones) + when NM isn't around or when its not connected + + * src/NetworkManagerDevice.c + - (nm_device_activation_worker): Make sure to reset dev->activating if we get + canceled. + +2004-08-25 Dan Williams + + * panel-applet/NMWirelessAppletDbus.c + - (nmwa_dbus_get_bool, nmwa_dbus_get_network_encrypted): correct method name + for getting encryption, and don't stop on "val" once we've gotten it + from NetworkManager. Short form: encryption should now show up. + +2004-08-25 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Set ESSID on a gconf trusted network too when force-setting the wireless + network to associate with + +2004-08-25 Dan Williams + + * panel-applet/* + - Rework the panel applet to do all DBUS communication in a separate + thread + +2004-08-25 Dan Williams + + * info-daemon/NetworkManagerInfo.[ch] + - Remove "get_next_priority" function + + * info-daemon/NetworkManagerInfoDbus.[ch] + - Convert "priority" functions to "timestamp" + +2004-08-25 Dan Williams + + * src/NetworkManagerAP.[ch] + - Add a "enc_method_good" member and accessors to an Access Point + to signal when we've found the correct encryption method + for an access point + - Add a "timestamp" member and accessors, remove "priority" member + and accessors (use timestamps instead) + - Rename "wep_key"->"enc_key" + - (nm_ap_get_enc_key_hashed): new, return the correct mangled key + for a specified encryption method using the access points + source encryption key/passphrase + + * src/NetworkManagerAPList.c + - When updating a network with dbus, grab timestamp now instead of + priority + + * src/NetworkManagerDBus.[ch] + - Add signal for "DeviceActivating" + - Switch priority->timestamp + + * src/NetworkManagerDevice.c + - Change references of "wep_key" -> "enc_key" or "key" + - Signal DeviceActivating when starting activation + - When activating a wireless device, if the access point we are connecting + to is encrypted, and we have a source key, try to generate a mangled + key and use that (ie, generate real WEP key from a passphrase) + - Rework device activation to fallback to other encryption methods if + a previous one didn't work (ie, try mangling a key as a 104-bit passphrase + first, then if that doesn't work fall back to direct hex key). + - (nm_device_update_best_ap): fix a deadlock, and use timestamps instead of + priority. We now prefer the latest access point used, rather than using + a priority scheme + - (nm_device_do_normal_scan): make the encryption method "unknown" on access + points we've just discovered, and merge in correct info from the global + access point lists + +2004-08-25 Seth Nickell + + Patch from Matthew Garrett for adding + Debian support. + + * src/Makefile.am: + * src/backends/NetworkManagerDebian.c: (nm_system_device_run_dhcp), + (nm_system_device_stop_dhcp), (nm_system_device_flush_routes), + (nm_system_device_flush_addresses), (nm_system_enable_loopback), + (nm_system_delete_default_route), + (nm_system_kill_all_dhcp_daemons), (nm_system_update_dns), + (nm_system_load_device_modules): + +2004-08-24 Dan Willemsen + + * src/NetworkManager.c + src/backends/NetworkManagerGentoo.c + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerSystem.h + - Implement preliminary Gentoo support, adding a + nm_system_init function to the backend specification + + * configure.in + - Distribution auto-detection, lowercase any user-fed + distribution names + + * initscript/.cvsignore + initscript/Makefile.am + initscript/RedHat/Makefile.am + initscript/RedHat/NetworkManager + initscript/Gentoo/Makefile.am + initscript/Gentoo/NetworkManager + - Refactored initscript code separately for each + distribution + +2004-08-23 Dan Williams + + * configure.in + src/Makefile.am + src/NetworkManagerDevice.c + src/NetworkManager.c + src/NetworkManagerUtils.[ch] + src/backends/NetworkManagerSystem.h + src/backends/NetworkManagerRedHat.c + src/backends/NetworkManagerGentoo.c + - Refactor system-specific code into separate backends for + each distribution + +2004-08-23 Dan Willemsen + + * dispatcher-daemon/NetworkManagerDispatcher.c + info-daemon/NetworkManagerInfo.[ch] + info-daemon/NetworkManagerInfoDbus.c + info-daemon/NetworkManagerInfoPassphraseDialog.c + src/NetworkManager.c + src/NetworkManagerAP.c + src/NetworkManagerAPList.c + src/NetworkManagerDbus.c + src/NetworkManagerDevice.c + src/NetworkManagerPolicy.c + src/NetworkManagerUtils.[ch] + src/NetworkManagerWireless.c + - Used syslog functions for logging instead of NM_DEBUG_DISPLAY & fprintf + + * src/NetworkManager.c + - Fixed usage wording for --no-daemon + +2004-08-23 Dan Williams + + * panel-applet/NMWirelessApplet.c + - Update our state every second to get more responsive panel icon + - (nmwa_update_state): remove bogus applet->pix_state = PIX_WIRED that + was causing our marching ants status blips to never move when + looking for a wireless network + + * src/NetworkManagerDevice.c + - (nm_device_activation_begin): return if activation has already begun + - (nm_device_do_normal_scan): merge WEP key and priority from the + trusted/preferred network into the device's access point when the + scan list is processed + +2004-08-23 Dan Williams + + * initscript/NetworkManager + - Use NMLaunchHelper rather than sleeping + + * initscript/NMLaunchHelper.c + Makefile.am + - Add helper program that exits only when NM activates a device, + or 10 seconds have passed, whichever happens first. This + stops the boot processes until we have a network connection, + which NM can't do because it daemonizes and brings the connection + up in the background. Allows stuff like NFS to not die. + +2004-08-20 Dan Williams + + * info-daemon/NetworkManagerInfoPassphraseDialog.c + - (nmi_passphrase_dialog_ok_clicked): when updating the wep key + for a network, set the essid as well since it may not exist yet + - (nmi_passphrase_dialog_init): don't star out the passphrase field, + since WEP keys/passphrases are long and prone to entry-error + + * panel-applet/Makefile.am + panel-applet/wired.png + - Add (pulled from system-config-network temporarily) + + * panel-applet/NMWirelessApplet.[ch] + - Show wired picture when a wired connection is used + - Rename wireless icon enums, adding WIRELESS + + * src/NetworkManagerDevice.c + - (nm_device_activate_wireless): unset encryption before bringing + down the card and setting the essid + - (nm_device_activatin_worker): request a key from the user if the + AP we are connecting to is encrypted but we don't have a key + for it yet + - (nm_device_set_user_key_for_network): fix missing '== 0' for a + strcmp() that prevented a user-entered key from actually getting + used + +2004-08-16 Dan Williams + + * initscript/NetworkManager + - Check for /sbin/ip + - Do sysctl magic that network service does + - sleep 4s after start to allow network time to come up [hack] + + * src/Makefile.am + src/NMLoadModules + - Load all network device kernel modules (hal doesn't know devices + are ethernet until the module is loaded, and therefore we don't know) + + * src/NetworkManager.c + - (main): daemonize later, launch NMLoadModules to alert HAL of our + network devices, and bring up the loopback device explicitly + + * src/NetworkManagerUtils.[ch] + - (nm_enable_loopback): new function + +2004-08-13 Dan Williams + + * configure.in + panel-applet/Makefile.am + - Fix up cleanfiles and server_DATA/server_in_files + + * README + - Update with some comments on theory of operation + + * CONTRIBUTING + Makefile.am + - Add CONTRIBUTING + +2004-08-12 Dan Williams + + * info-daemon/passphrase.glade + - Set window title to " " + + * panel-applet/Makefile.am + panel-applet/keyring.png + - Deliver to correct place + + * panel-applet/NMWirelessApplet.[ch] + - Add comments + - Remove applet->have_active_device as its no longer used + - (nmwa_load_theme): load keyring.png too + - (error_dialog): remove + - (show_warning_dialog): subsume functionality of error dialog too + - (nmwa_destroy, nmwa_new): create and dispose of an application-wide GConfClient + - (nmwa_handle_network_choice): add to deal with user clicking on an item from + the networks menu + - (nmwa_menu_item_activated): GtkMenuItem "activate" signal handler + - (nmwa_button_clicked, nmwa_setup_widgets): create and populate the menu on startup + and when we get broadcasts of changed wireless access points only, not when the + user clicks on the button to display the menu (too long of a wait) + - (nmwa_add_menu_item): Make active network bold, and place a keyring icon beside + networks that are encrypted + - (nmwa_dispose_menu, nmwa_menu_item_data_free): dispose of the data we place on each + menu item with g_object_set_data() + + * panel-applet/NMWirelessAppletDbus.[ch] + - (nmwa_dbus_get_bool): add method to return boolean value from dbus message + - (nmwa_dbus_get_active_network): add (nmwa_dbus_get_string() wrapper to get active network) + - (nmwa_dbus_add_networks_to_menu): clean up, only show one instance of each ESSID in the menu + - (nmwa_dbus_set_network): force NetworkManager to use a particular network for wireless cards + - (nmwa_dbus_init, nmwa_dbus_filter): Trap network appear/disappear and device + activation/deactivation signals and rebuild the menu when they happen + + * src/NetworkManager.c + - (main): use new nm_spawn_process() rather than system() + + * src/NetworkManagerDbus.c + - (nm_dbus_devices_handle_request): don't compare AP structure addresses directly, but essids + instead. Since we can now force best_aps to stick around, the AP structure to which + dev->options.wireless.best_ap points to won't necessarily be in the device's device list + if a scan has happened since the best_ap was frozen. Also add "setNetwork" method + to freeze the best_ap. + + * src/NetworkManagerDevice.[ch] + - (nm_device_activation_worker): Use new nm_spawn_process() call rather than system() + - (nm_device_*_best_ap): add freeze/unfreeze/get_frozen functions, and don't really update + the best_ap in nm_device_update_best_ap() if the best_ap is frozen AND in the device's + ap list + + * src/NetworkManagerUtils.[ch] + - (nm_spawn_process): add replacement for system() usage + +2004-08-11 Dan Williams + + * panel-applet/NMWirelessApplet.[ch] + - Fix up copyright and credits to include Bastien and Eskil, + who created the gnome-applets wireless applet, from whose + skeleton this one was created + - Rework nmwa_update_state()/nmwa_draw() so that state and which + pixmap to draw is computed during nmwa_update_state() + - Applet now shows itself all the time due to panel packing issues + which caused the applet to previously never come back after hiding. + When a wired device is the active device, the applet shows "not connected" + + * panel-applet/NMWirelessAppletDbus.[ch] + - Clean up error messages and show what function they are from + - nmwa_dbus_get_active_wireless_device()->nmwa_dbus_get_active_device() + - Add new device type getters, and a status getter + + * src/NetworkManagerDbus.c + - (nm_dbus_devices_handle_request): Don't return an active network unless that + network is actually in the device's ap list + - (nm_dbus_nm_message_handler): Fix silly mistake returning status + + * src/NetworkManagerDevice.c + - (nm_device_update_best_ap): If the best AP is NULL, clear out the ESSID of the + card + + * test/nmclienttest.c + - Report status of NetworkManager too + +2004-08-11 Dan Williams + + * info-daemon/NetworkManagerInfo.c: + - (main): clean up Seth's code style + + * info-daemon/NetworkManagerInfoDbus.c: + - Use the more aptly-named path/service/interface constants from NetworkManager + - Don't return empty strings ("") as object paths ever, instead return errors + + * panel-applet/NMWirelessApplet.c: + - Clean up Seth's code style + + * src/NetworkManager.[ch] + - (nm_remove_device_from_list): remove anything having to do with pending_device + - (main, nm_print_usage): change --daemon=[yes|no] -> --no-daemon + + * src/NetworkManagerAPList.[ch] + - Move Iter struct right above the iter functions to preserve opacity + - (nm_ap_list_remove_ap): implement + - (nm_ap_list_update_network): deal with errors returned from nm_dbus_get_network_priority(), + remove AP if NetworkManagerInfo doesn't know anything about it + - (nm_ap_list_diff): user NMAPList iterators + - (nm_ap_list_print_members): implement debugging function + + * src/NetworkManagerDbus.[ch] + - (nm_dbus_nm_get_active_device): remove anything to do with pending_device + - (nm_dbus_get_user_key_for_network): remove DBusPendingCall stuff (unused), + and move the actual key setting stuff into NetworkManagerDevice.c + - (nm_dbus_get_network_priority): return -1 now on errors + - (nm_dbus_nmi_filter): fix strcmp() error that caused PreferredNetworkUpdate signals to + get lost, and force the active device to update its "best" ap when AP lists change + - (nm_dbus_nm_message_handler): Update conditions for returning "connecting" for a "status" + method call due to pending_device member removal + + * src/NetworkManagerDevice.[ch] + - Move NMDevice structure to the top + - Add a wireless scan mutex and a best_ap mutex to the Wireless Options structure + - Remove Pending Action stuff from everywhere + - (nm_device_activation_*): We now "begin" activation and start a thread to do the + activation for us. This thread blocks until all conditions for activation have + been met (ie for wireless devices, we need a valid WEP key and a "best" ap), and + then setup up the interface and runs dhclient. We have to do this because there + is no guaruntee how long dhclient takes, and while we are blocking on it, we cannot + run our main loop and respond to dbus method calls or HAL device removals/inserts + - (nm_device_set_user_key_for_network): Move logic here from NetworkManagerDbus.c so we + can tell nm_device_activation_worker() that we've got a key + - (nm_device_*_best_ap): lock access to best_ap member of Wireless Options structure + - (nm_device_get_path_for_ap): dumb it down so the list doesn't lock against itself when + diffing (AP appear/disappear signal functions make sure the AP is actually in the device's list) + - (nm_device_update_best_ap): move logic from nm_wireless_is_ap_better() here + + * src/NetworkManagerPolicy.c + - Remove anything to do with pending_device + - Adjust device activation to deal with activation-in-worker-thread + + * src/NetworkManagerUtils.c + - Clean up locking debugging a bit + + * src/NetworkManagerWireless.[ch] + - (nm_wireless_is_ap_better): remove, stick logic in nm_device_update_best_ap(). This function + was badly named and is better as a device function + + * panel-applet/.cvsignore: add + +2004-08-09 Seth Nickell + + * panel-applet/NMWirelessApplet.c: (nmwa_timeout_handler), + (nmwa_button_clicked), (nmwa_populate_menu), (nmwa_setup_widgets), + (nmwa_new): + * src/NetworkManagerDbus.c: (nm_dbus_nmi_filter): + + Don't load the menus until clicked on (also removes a call outside + normal code paths at first load). + + Hide applet when NM is not present. + + Improve printf debugging stuff. + +2004-08-09 Dan Williams + + * dispatcher-daemon/NetworkManagerDispatcher.c: + - Covert uses of dbus_message_iter_* over to dbus_message_get_args + - Use constants for NetworkManager interface, service, and path + +2004-08-09 Dan Williams + + * src/NetworkManagerDbus.c: + - (nm_dbus_nm_get_active_device, nm_dbus_nm_get_devices): Never return an empty object path, + instead return an error message + - (nm_dbus_devices_handle_request): Return error when getActiveNetwork/getNetworks is called + on a wired device. Also never return an empty object path, instead return an error message + +2004-08-06 Seth Nickell + + * panel-applet/NMWirelessApplet.c: (nmwa_new): + + Check the error code when getting a connection. + + * panel-applet/NMWirelessAppletDbus.c: (nmwa_dbus_init): + + Check if the NM service exists when initializing (rather than + assuming it does not). + + * src/NetworkManagerDbus.c: (nm_dbus_init): + + Don't acquire the well-known service name until we have + registered object/path handlers and can actually receive + calls. + +2004-08-06 Dan Williams + + * panel-applet/* + - Add panel applet + + * src/NetworkManagerPolicy.c + src/NetworkManager.c + - Get access point lists from NetworkManagerInfo on-demand, + and look for ServiceCreate/ServiceDeleted signals to see when + we should query NMI for lists + * src/NetworkManagerAPList.c + - Make sure to init the list's mutex + - Convert traversals of the list over to the list iter functions + + * src/NetworkManagerDbus.[ch] + - Use more aptly-named path/service/interface constants + - Treat both active and pending devices the same for "getActiveDevice" + - Add a "status" method returning "connected", "connecting", or "disconnected" + + * src/NetworkManagerDevice.c + - Honor "ignored" network list when picking best ap to use + +2004-08-06 Seth Nickell + + * aclocal.m4: + + Autogenerated, remove from CVS. + + * autogen.sh: + + Don't hardcode automake version. + + * configure.in: + * info-daemon/Makefile.am: + * info-daemon/NetworkManagerInfo.c: (main): + + Use GnomeProgram et al. for doing session management. + Use popt stuff for argument parsing rather than doing + it manugally. + +2004-08-05 Dan Williams + + * test/nminfotest.c + - Update to new NMI dbus API, check different network types + + * info-daemon/NetworkManagerInfoDbus.c + - Update to new NM dbus API, ie network type sent in query message + +2004-08-05 Dan Williams + + * An assload of changes + +2004-08-02 Dan Williams + + * TODO + - new task: proper logging support + + * info-daemon/NetworkManagerInfo.c + - Correct spelling of "canceled" + - Correct casting of objects for g_signal_connect() + + * info-daemon/NetworkManagerInfoDbus.c + - Add defines for NetworkManager namespace and object path, and use them + - Add filter function to trap new signals from NetworkManager: + WirelessNetworkAppeared, WirelessNetworkDisappeared + + * info-daemon/passphrase.glade + - Change name of "ok" button to "Login to Network..." + - Mark invisible + + * src/NetworkManager.c + - Code and debug message cleanups + - Rename "nm_add_current_devices"->"nm_add_initial_devices" + - (nm_add_initial_devices) Check returned string array of devices + and don't try to add devices if array is NULL + - (main) Initialize libhal a bit later, make code a bit clearer + + * src/NetworkManagerAP.[ch] + - New accessor and data member "matched": used to speed up AP list + diffing + - New accessor and data member "enc_method": will be used during key + fallback to cache which passphrase->key conversion actually works + so we don't have to do it every time + + * src/NetworkManagerAPList.[ch] + - (nm_ap_list_find_ap_in_list) New: find an AP by essid in an AP list + - (nm_ap_list_diff) New: given two lists of access points, find the differences + between them, and send WirelessNetworkAppeared/Disappeared signals over + dbus in response to those differences + + * src/NetworkManagerDbus.[ch] + - (nm_dbus_get_object_path_from_ap) New: given a device and an access point, + make an object path for that access point (NOTE that we don't yet check to + make sure that access point is actually in the device's AP list yet) + - (nm_dbus_get_ap_from_object_path) Renamed from nm_dbus_get_network_from_object_path + - (nm_dbus_signal_wireless_network_appeared, nm_dbus_signal_wireless_network_disappeared) + New: signal appearance/disappearance of wireless networks + - (nm_dbus_set_user_key_for_network) Mark the network/ap as invalid if the user cancelled + key entry + + * src/NetworkManagerDevice.[ch] + - (nm_device_ap_list_clear) Use nm_ap_list_free rather than doing it ourselves + - (nm_device_ap_list_get) New: return the AP list (static function) + - (nm_device_do_normal_scan) Destroy old AP list later, so that we can diff the + new one resulting from the scan with the old one + + * src/NetworkManagerWireless.c + - (nm_wireless_is_most_prefered_ap) "invalid" access points cannot be "best" access points + + * test/nminfotest.c + - #define object paths and namespaces and use the #defines rather than static strings + - Test out user-key functionality of NetworkManagerInfo too + +2004-07-29 Dan Williams + + * info-daemon/NetworkManagerInfoDbus.c + src/NetworkManagerDbus.c + - Update to current DBus (ie don't use decomposed paths when registering + object paths/fallbacks) + +2004-07-27 Dan Williams + + * Remove various Makefile.in files + + * TODO + - Add some more items + + * configure.in + - Add checks for OpenSSL/md5 headers and libs + + * src/Makefile.am + - Use OpenSSL CFLAGS + + * src/NetworkManagerAP.[ch] + - Remove 'stamp' functions, replace with 'invalid' functions + to support user cancelling WEP key entry + + * src/NetworkManagerDbus.c + - Remove 'stamp' return functions + - Treat returned user key as a passphrase and convert to a WEP key, + but don't actually use the WEP key yet. We use the returned user + key as a hexadecimal WEP key until we can figure out a UI for + passphrase-vs-hex key + + * src/NetworkManagerWireless.[ch] + - Add passphrase-to-128bit-key function + +2004-07-27 Dan Williams + + * TODO + - Add a couple of items + +2004-07-27 Dan Williams + + * info-daemon/NetworkManagerInfo.c + - Update allowed network's GConf key when user enters a WEP key explicitly + + * info-daemon/NetworkManagerDbus.c + - Fix some comments + - nmi_dbus_get_allowed_networks(): kill warning + +2004-07-27 Dan Williams + + * initscript/Makefile.in + - Remove + + * initscript/Makefile.am + - Add correct rules to install the init.d initscript + + * info-daemon/NetworkManagerInfoDbus.c + - Remove debug fprintf + + * src/NetworkManagerDbus.[ch] + - Remove debug fprintfs + - Add macros for NetworkManagerInfo object path/namespace + - Use said macros instead of constant strings + +2004-07-27 Dan Williams + + * initscript/.cvsignore + - Add + + * info-daemon/Makefile.am + - Install .glade files and keyring.png + - Fix stupid omission of a \ that caused half the flags not to be + passed to gcc + + * info-daemon/NetworkManagerInfo.c + - gtk_signal_connect->g_signal_connect + - Alert NetworkManagerInfo to new glade file location + +2004-07-27 Dan Williams + + * test/nmclienttest.c + test/nminfotest.c + - Add missing headers + - Add GPL message at top + +2004-07-27 Dan Williams + + * src/NetworkManagerAPList.[ch] + src/Makefile.am + - Add. Deal with allowed network list additions, deletions, and updates + + * dispatcher-daemon/NetworkManagerDispatcher.c + - Add missing header + + * info-daemon/NetworkManagerInfo.[ch] + - Add missing header + - Implement the GConf notify callback to signal NetworkManager of an allowed + network change + - Better error checking + + * info-daemon/NetworkManagerInfoDbus.[ch] + - Add missing header + - Convert to using dbus_message_append_args/dbus_message_get_args + - Implement nmi_dbus_signal_update_allowed_network() to signal NetworkManager + that an allowed network changed. We don't want to signal on individual + keys _inside_ an allowed network really, just want NM to query the info + daemon for updated info on all keys. + - Better error checking + + * src/NetworkManager.[ch] + - Add missing header + - Move allowed_ap_list free functions to NetworkManagerAPList.[ch] + - Zero out NMData structure on free + - No longer use a thread for allowed_ap_list updating, instead its now done + through dbus queries against NetworkManagerInfo + - Populate allowed_ap_list initially before adding existing network devices + to the device list, so wireless devices can get their "best" AP + + * src/NetworkManagerDbus.[ch] + - Convert to using dbus_message_append_args/dbus_message_get_args + - Better error checking + - Implement Allowed Network info functions to request allowed network + info from NetworkManagerInfo + - Implement the filter function to process signals from NetworkManagerInfo + about changing allowed networks + + * src/NetworkManagerDevice.c + - Fix file descriptor leak in nm_device_update_ip4_address() + +2004-07-27 Dan Williams + + * .cvsignore + src/.cvsignore + test/.cvsignore + dispatcher-daemon/.cvsignore + info-daemon/.cvsignore + - Add .cvsignore files to reduce noise when diffing + +2004-07-24 Dan Williams + + * src/NetworkManager.[ch] + src/NetworkManagerDbus.[ch] + src/NetworkManagerDevice.[ch] + src/NetworkManagerPolicy.c + src/NetworkManagerWireless.[ch] + - Add many more g_return_if_fail()/g_return_val_if_fail() checks + - Pass the NMData application data structure through all calls + that need it so we can get rid of nm_get_global_data() + - Change deallocation of the allowed_ap_list GSList in preparation + for not completely clearing it every time we get an update, + but instead getting incremental updates via GConf/dbus + +2004-07-22 Dan Williams + + * configure.in + - Add checks for GConf libs & headers & flags + + * info-daemon/Makefile.am + - Add GConf flags & libs to compile/link stages of NetworkManagerInfo + + * info-daemon/NetworkManagerInfo.[ch] + - Don't use gquarks for data storage, just use normal data storage + - Add gconf bits to watch /system/networking/wireless/allowed_networks + + * info-daemon/NetworkManagerDbus.[ch] + - Add method call for getting allowed networks + - Add method calls for getting an allowed network's essid, priority, and key + - Hook the method calls up to GConf + - Split user key dialog code into separate function (nmi_dbus_get_key_for_network) + - nmi_dbus_nmi_message_handler(): make sure to unref the reply message after sending + + * src/NetworkManagerDbus.[ch] + - Switch for enumeration of networks to using essid instead + + * test/Makefile.am + test/nminfotest.c + - Add test program for NetworkManagerInfo + +2004-07-19 Dan Williams + + * src/NetworkManagerDbus.c + - Switch from indexed device paths to names. Less code, more efficient. + ie "/org/freedesktop/NetworkManager/0" -> "/org/freedesktop/NetworkManager/eth0" + +2004-07-19 Dan Williams + + * dispatcher-daemon/NetworkManagerDispatcher.c + - (nm_dbus_filter): Remove obsolete response to NeedKeyForNetwork signal + +2004-07-19 Dan Williams + + * Makefile.am + - Add info-daemon directory + + * configure.in + - Check for glade libs and headers + - Add info-daemon directory + + * src/NetworkManagerAP.c + - nm_ap_new_from_ap(): Fix bug that resulted in an APs encryption status not getting + copied over to the new AP. + + * src/NetworkManagerDbus.c + src/NetworkManagerDbus.h + - Deal with nm_device_ap_list_get_ap()->nm_device_ap_list_get_ap_by_index() change + - Remove nm_dbus_signal_need_key_for_network() + - Add disabled code for asynchronous user wep key callbacks + - Add functions for getting, setting, and cancelling user key operations + - Remove "setKeyForNetwork" device dbus method call, its on NetworkManager object instead + - Add "setKeyForNetwork" dbus method call on NetworkManager object + + * src/NetworkManagerDevice.c + src/NetworkManagerDevice.h + - nm_device_update_link_active(): revert changes for wireless link detection, the WEP-key-is-wrong + logic is in device activation now + - nm_device_activate(): for wireless devices, if we can't associate with access point (perhaps + key is wrong) trigger get-user-key pending action + - Implement get-user-key pending action stuff, tie to dbus messages + - Rename nm_device_ap_list_get_ap() -> nm_device_ap_list_get_ap_by_index() + - Add nm_device_ap_list_get_ap_by_essid() + - Instead of copying "best" access points, ref them instead so that the key we set + sticks around + + * src/NetworkManagerPolicy.c + - Deal with wrong WEP key, but right access point (and if so, return link_active = TRUE) + - Don't cancel pending actions on a device if its the same device as last iteration + - Only promote pending_device->active_device if activation was successfull + + * src/Makefile.am + - Rename nmclienttest->nmtest + + * info-daemon/Makefile.am + info-daemon/NetworkManagerInfo.c + info-daemon/NetworkManagerInfo.h + info-daemon/NetworkManagerInfoDbus.c + info-daemon/NetworkManagerInfoDbus.h + info-daemon/passphrase.glade + info-daemon/NetworkManagerInfo.conf + info-daemon/keyring.png + - Import sources for info-daemon, which pops up dialog for passphrase/key when + NetworkManager asks for it, and also will (soon) provide "allowed" access point + lists to NetworkManager by proxying user's GConf + + +2004-07-15 Dan Williams + + * src/Makefile.am + - Turn on warnings + + * src/NetworkManager.c + - nm_create_device_and_add_to_list(): call nm_device_deactivate() rather + that doing the deactivation ourselves + - Cancel an pending actions on a device if its being removed + - Break up link state checking a bit, make non-active wireless cards + deactivated to save power + - Remove unused variables + + * src/NetworkManager.h + - Add support for "pending" device + + * src/NetworkManagerAP.h + src/NetworkManagerAP.c + - Add support for determining whether and AP has encryption enabled or not + - AP address is now "struct ether_addr" rather than a string + + * src/NetworkManagerDbus.h + src/NetworkManagerDbus.c + - Add signal NeedKeyForNetwork, method SetKeyForNetwork (testing only) + - Changes for AP address from struct ether_addr->string + + * src/NetworkManagerDevice.h + src/NetworkManagerDevice.c + - Remove unused variables, fix warnings + - Add support for Pending Actions (things that block a device from being "active" + until they are completed). + - First pending action: Get a WEP key from the user + - Add nm_device_is_wire[d|less](), rename nm_device_is_wireless() + - Clean up explicit testing of dev->iface_type to use nm_device_is_wireless() + - Update wireless link checking to try to determine if the AP we are associated + with is correct, but the WEP key we are using is just wrong. If its wrong, + trigger the GetUserKey pending action on the device + - If dhclient can't get an IP address, it brings the device down. Bring it back + up in that case, otherwise we can't scan or link-check on it + - Add IP address change notifications at appropriate points (still needs some work) + - Add nm_device_need_ap_switch(), checks whether we need to switch access points or not + + * src/NetworkManagerPolicy.h + src/NetworkManagerPolicy.c + - Split out "best" access point determiniation into separate function + - Make device activation 2-stage: first the device is pending, then + in the next iteration through it becomes "active" unless it has + pending actions + + * src/NetworkManagerUtils.h + src/NetworkManagerUtils.c + - Clean up unused variables and warnings + - Wrap our debug macros in {} to prevent possible confusion + + * src/NetworkManagerWireless.c + - Forgot to return current best priority, which lead to last available AP always + being chosen no matter what its priority was. Corrected. + +2004-07-15 Dan Williams + + * dispatcher-daemon/Makefile.am + - Turn on warnings + + * dispatcher-daemon/NetworkManagerDispatcher.c + - Remove unused variables due to warnings + - Fix some comments + - Print message on receipt of NeedKeyForNetwork signal (testing only) + +2004-07-06 Dan Williams + + * src/NetworkManager.c + - Add IPv4 address update for active device during link state check + - Don't allow wireless cards to be powered up when they are not the + active device + + * src/NetworkManagerDbus.c + src/NetworkManagerDbus.h + - Add DBUS IPv4 address change signal + - Add DBUS IPv4 address get method for devices + + * src/NetworkManagerDevice.c + - Make setting the WEP key actually work + - Move IP address get/set/update stuff here, per-device + - Power down/bring down wireless device when deactivated + - For scanning wireless devices, if first scan returned ENODATA, try again + + * src/NetworkManagerPolicy.c + - Only set the WEP key for an allowed access point if there is one. + We were setting it to be blank if one wasn't specified. + + * src/NetworkManagerUtils.h + src/NetworkManagerUtils.c + - Move the IP address stuff to NetworkManagerDevice.c + + * dispatcher-daemon/NetworkManagerDispatcher.c + - Add device IPv4 address change notification stuff + +2004-07-05 Dan Williams + + * dispatcher-daemon/NetworkManagerDispatcher.c + - A bit more descriptive state message + - Don't segfault when reading directory + + * src/NetworkManager.h + - Remove NMData desired_ap member, its now + per-device rather than global + + * src/NetworkManager.c + - Remove references to desired_ap + - Move the allowed AP list refresh stuff into a thread + + * src/NetworkManagerDevice.c + src/NetworkManagerDevice.h + - Each wireless device now has a "best ap" + - Make device activate/deactivate functions per-device + - Make wireless scanning per-device + - Add IPv4 address discover functions, stub IPv6 ones + - Move ethernet address validation functions to NetworkManagerUtils.c + - Add wireless access point accessor function + - Get/Set functions for "best ap" + + * src/NetworkManagerPolicy.c + - Move activate/deactivate stuff into NetworkManagerDevice.c, per-device + - Deal with per-device "best ap" rather than data->desired_apa + - Implement allowed access point worker thread + - Add nm_policy_essid_is_allowed() function + + * src/NetworkManagerUtils.c + src/NetworkManagerUtils.h + - Add nm_ethernet_address_is_valid() function + - Add IPv4/IPv6 address get functions + + * src/NetworkManagerWireless.c + src/NetworkManagerWireless.h + - Move scanning stuff into NetworkManagerDevice.c, per-device + +2004-06-29 Dan Williams + + * dispatcher-daemon/NetworkManagerDispatcher.c + - Implement script callout functionality + +2004-06-24 Dan Williams + + * NetworkManager.c + - Spacing cleanups + - Flush device routes and ip addresses when added to the device list + + * NetworkManagerDbus.c + - Spacing cleanups + - Add missing returns in the two signal functions + + * NetworkManagerPolicy.c + - Spacing and variable cleanups + +2004-06-24 Dan Williams + + * Makefile.am + Makefile.in + configure.in + dispatcher-daemon/Makefile.am + dispatcher-daemon/Makefile.in + dispatcher-daemon/NetworkManagerDispatcher.c + - Add a daemon that receives signals from NetworkManager + and will (eventually) call scripts in /etc/somewhere + when devices go up or down. + + * NetworkManager.c + - Spacing cleanups + - Flush device routes and ip addresses when added to the device list + + * NetworkManagerDbus.c + - Spacing cleanups + - Add missing returns in the two signal functions + + * NetworkManagerPolicy.c + - Spacing and variable cleanups + - Rename nm_policy_switch_interface->nm_policy_switch_device + - nm_policy_switch_device(): + Use kill (pid) instead of system ("kill ") + - nm_state_modification_monitor(): + Add wireless essid to output of debug statements + Correct typo in device compare to switch or not (should be !=) + Don't sleep after sending "no longer active" signal, was useless + +2004-06-24 Dan Williams + + * Initial import diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..7d1c323b --- /dev/null +++ b/INSTALL @@ -0,0 +1,365 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..7e345712 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,34 @@ +SUBDIRS = \ + marshallers \ + libnm-util \ + libnm-glib \ + src \ + include \ + introspection \ + callouts \ + system-settings \ + cli \ + tools \ + policy \ + initscript \ + test \ + po \ + man \ + docs \ + examples + +EXTRA_DIST = \ + CONTRIBUTING \ + NetworkManager.pc.in \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in + +DISTCHECK_CONFIGURE_FLAGS = --with-tests=yes --with-docs=yes --with-udev-dir=$$dc_install_base/lib/udev + +DISTCLEANFILES = intltool-extract intltool-merge intltool-update + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = NetworkManager.pc + +ACLOCAL_AMFLAGS = -I m4 diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 00000000..a96aa1af --- /dev/null +++ b/Makefile.in @@ -0,0 +1,863 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/NetworkManager.pc.in \ + $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS TODO compile config.guess config.sub \ + depcomp install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = NetworkManager.pc +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.bz2 +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = -I m4 +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = \ + marshallers \ + libnm-util \ + libnm-glib \ + src \ + include \ + introspection \ + callouts \ + system-settings \ + cli \ + tools \ + policy \ + initscript \ + test \ + po \ + man \ + docs \ + examples + +EXTRA_DIST = \ + CONTRIBUTING \ + NetworkManager.pc.in \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in + +DISTCHECK_CONFIGURE_FLAGS = --with-tests=yes --with-docs=yes --with-udev-dir=$$dc_install_base/lib/udev +DISTCLEANFILES = intltool-extract intltool-merge intltool-update +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = NetworkManager.pc +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +NetworkManager.pc: $(top_builddir)/config.status $(srcdir)/NetworkManager.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-pkgconfigDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 00000000..b27a9b2e --- /dev/null +++ b/NEWS @@ -0,0 +1,236 @@ +============================================== +NetworkManager-0.7.0 +Overview of changes since NetworkManager-0.6.6 +============================================== + +This is a new major stable release of NetworkManager. Notable changes include: + +* Multiple active devices +* Internet connection sharing +* Support for many mobile broadband devices +* Full static IP support +* More reliable connections +* Rich, flexible D-Bus API +* Boot-time connections (no logins required) + + +============================================== +NetworkManager-0.6.2 +Overview of changes since NetworkManager-0.6.2 +============================================== + +0.6.2 is a bug fix release. Note that NetworkManager no longer automatically +runs dhcdbd if it is not running. This means that it is now the system's +responsibility to start dhcdbd prior to NetworkManager, e.g. in the +distribution's NetworkManager initscript. + +* NetworkManager + * Many, many bug fixes (Everyone) + * Dynamic WEP Support (Robert Love) + +* nm-applet + * Many bug fixes (Everyone) + + +============================================== +NetworkManager-0.6.1 +Overview of changes since NetworkManager-0.6.0 +============================================== + +0.6.1 is a minor bug fix release. + +* NetworkManager + * Improved activation cancelation (Dan Williams) + * Workarounds for non-WPA drivers (Dan Williams) + * Fix WPA Enterprise crasher (Robert Love) + +* nm-applet + * Hide password entry fields by default (Robert Love) + * Add toggle to show/hide password field (Robert Love) + * Add 'Remove' option to right-click menu (Robert Love) + +============================================== +NetworkManager-0.6.0 +Overview of changes since NetworkManager-0.5.1 +============================================== + +This releases ushers in WPA support, as well as many other features, bug fixes, +and clean ups. + +We now require libnl, a netlink library (http://people.suug.ch/~tgr/libnl/) and +wpa_supplicant, a WPA supplicant (http://hostap.epitest.fi/wpa_supplicant/). + +Two new VPN modules are part of the distribution: openvpn and pptp. + +* NetworkManager + * WPA and WPA2 support (Dan Williams) + * WPA Enterprise support (Robert Love) + * Rearchitecting, refactoring (Dan Williams) + * wpa_supplicant support (Dan Williams, Kay Sievers) + * NIS support (Robert Love) + * DHCP hostname support (Timo Hoenig) + * ISDN support, improve dial up support (Robert Love) + * Man pages (Robert Love) + * Survive DBUS and HAL restarts (Timo Hoening) + * Generate PID files (Dan Willians) + * Bug fixes and clean ups (the whole gang) + +* nm-applet + * New tray icon look and behavior (Robert Love, Dan Williams) + * New wireless security layer (Dan Williams) + * New "Enable Networking" toggle (Robert Love) + * Display speed of current connection (Robert Love) + * Bug fixes and clean ups (the whole gang) + +============================================== +NetworkManager-0.5.1 +Overview of changes since NetworkManager-0.5.0 +============================================== + +* NetworkManager + * Don't drop the last scanned AP (Dan Williams) + * Broadcast state change when disconnected (Robert Love) + * The Slackware backend now builds (Nico) + * Don't install unsued config files (Dan Williams) + * Add a test for libnm_glib_unregister_callback (Christopher Aillon) + * Requires wireless-tools 28pre9 (Christopher Aillon) + +* nm-applet + * Use g_get_host_name () if we've got it (Christopher Aillon) + * Fix an unitialized variable (Robert Love) + * Fix sensitivity of VPN items (Robert Love) + + +============================================== +NetworkManager-0.5.0 +Overview of changes since NetworkManager-0.4.1 +============================================== + +* NetworkManager + * Initscripts are now generated + * Not waiting as long for scans to complete (Bill Moss). + * Fix several D-BUS object leaks (John Palmieri, Dan Williams, + Christopher Aillon) + * VPN now advertises state changes + * Make --without-named work (j@bootlab.org) + * Make --with-dhcdbd work correctly (j@bootlab.org) + * Fix timeout scan values (Bill Moss) + * Send notifications of device strength changing so clients do + not have to poll. + * Don't return a UDI device if it doesn't exist (Tomislav Vujec) + * Strip whitespace from the VPN banner (Bill Moss) + * VPN Manager rewritten to better support signals (Dan Williams) + * Don't allow clients to determine what states we should be + scanning in, add logic to scan when we need to. + * Blacklist some common ESSIDs such that multiple access points + with these ESSIDs aren't treated as the same network. + * Support for D-BUS enabled named (Dan Williams) + * Only '#' is a valid comment in resolv.conf (Robert Love) + * Don't try to set auth mode on the AP from the allowed list if + it's NULL (Bill Moss) + * Add internal scanning code so we don't have to use iwlib's + code any longer (Dan Williams) + * libnm now uses guints instead of gints for its callback IDs. + * libnm_glib_unregister_callback () now works. + * Fix our scanning interval (Robert Love) + * Updates to backends for Gentoo, SuSE, RedHat, Debian, and + Slackware (Robert Love, Peter Jones, Bill Nottingham, + j@bootlab.org) + - Dialup support in RedHat backend + - ISDN support in SUSE backend + - Other fixes + +* nm-applet + * The applet is no longer threaded (Dan Williams) + * Dialogs no longer block the UI when shown + * Passphrase dialog now treats Esc keypresses properly + * Create Network and Connect to Network dialogs now have + different window titles + * New icons for connecting to a network and to a VPN + (Diana Fong) + * Context menu items have been cleaned up + * Pressing enter in the passphrase entry should activate the + default action. + * Fix icon animation smoothness + * Display more data in the Connection Information dialog + (Robert Love) + + +============================================ +NetworkManager-0.3.1 +Overview of changes since NetworkManager-0.3 +============================================ + +NetworkManager: + + * Debian backend fixes, Thom May + * Build fixes, Thom May + * Better handling of encrypted devices, Dan Williams + * Better handling of user-selected access points, Dan Williams + +NetworkManagerNotification: + + * Simplified D-Bus code, Dan Williams + * Better error handling and feedback, Dan Williams + * Greatly simplify the locking to UI smoother, Dan Williams + +============================================ +NetworkManager-0.3.0 +Overview of changes since NetworkManager-0.2 +============================================ + +NetworkManager: + + * Lots of fixes, Dan Williams + * Support static IP addresses, Dan Williams + - Get broadcast address from config files, Robert Paskowitz + * Support for non-ESSID-broadcasting base stations, Dan Williams + * Only accept and manager 802.3 and 802.11 devices, Dan Williams + * Don't blow away an active wired connection on startup, Dan Williams + * Improve strength calculation, Dan Williams + * Constantly scanning behavior, Dan Williams + * add .pc file, Colin Walters + * move to syslog, Dan Willemsen + * Improve MD5 hashing of 128-bit passphrases, Colin Walters + * DBUS API docs, Dan Williams + * Cleanups, Colin Walters + * Trusted networks, Dan Williams + * New Backends: + - Debian, Thom May and Mark Roach + - Slackware, Narayan Newton + * Fixes and functionality improvements in Gentoo backend, Robert Paskowitz + +Python: + + * Example python code, Bryan Clark. + * python test framework, Bryan Clark + +NetworkManagerInfo: + + * Trusted networks, Dan Williams + * Escape ESSIDs in gconf, Dan Williams + * Lifecycle improvements, John Palmieri + +Translations: + + * New/Improved translations: da de sv en_CA nb no pa bs pt_BR wa gu es + - Thanks to: + Kjartan Maraas + Christian Rose + Adam Weinberger + Amanpreet Singh Alam + Akagic Amila + Raphael Higino + Pablo Saratxaga + Ankit Patel + Francisco Javier F. Serrador + Martin Willemoes Hansen + Hendrik Brandt + +NetworkManagerNotification: + + * Complete rewrite, Jonathan Blandford and John Palmieri + - Now a Notification area + - Simpler menu + - Hook up the "other network" dialog to do something + * New icons, Diana Fong diff --git a/NetworkManager.pc.in b/NetworkManager.pc.in new file mode 100644 index 00000000..01bcdf36 --- /dev/null +++ b/NetworkManager.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +libgnome_serverdir=@libexecdir@ + +Name: NetworkManager +Description: System for maintaining active network connection +Requires: +Version: @VERSION@ +Cflags: -I${includedir}/NetworkManager diff --git a/README b/README new file mode 100644 index 00000000..acb807bf --- /dev/null +++ b/README @@ -0,0 +1,85 @@ + +****************** +2008-12-11: NetworkManager core daemon has moved to git.freedesktop.org! + +git clone git://git.freedesktop.org/git/NetworkManager/NetworkManager.git +****************** + + +Networking that Just Works +-------------------------- + +NetworkManager attempts to keep an active network connection available at all +times. The point of NetworkManager is to make networking configuration and +setup as painless and automatic as possible. NetworkManager is intended to +replace default route, replace other routes, set IP addresses, and in general +configure networking as NM sees fit (with the possibility of manual override as +necessary). In effect, the goal of NetworkManager is to make networking Just +Work with a minimum of user hassle, but still allow customization and a high +level of manual network control. If you have special needs, we'd like to hear +about them, but understand that NetworkManager is not intended for every +use-case. + +NetworkManager will attempt to keep every network device in the system up and +active, as long as the device is available for use (has a cable plugged in, +the killswitch isn't turned on, etc). Network connections can be set to +'autoconnect', meaning that NetworkManager will make that connection active +whenever it and the hardware is available. + +"Settings services" store lists of user- or administrator-defined "connections", +which contain all the settings and parameters required to connect to a specific +network. NetworkManager will _never_ activate a connection that is not in this +list, or that the user has not directed NetworkManager to connect to. + + +How it works: + +The NetworkManager daemon runs as a privileged service (since it must access +and control hardware), but provides a D-Bus interface on the system bus to +allow for fine-grained control of networking. NetworkManager does not store +connections or settings, it is only the mechanism by which those connections +are selected and activated. + +To store pre-defined network connections, two separate services, the "system +settings service" and the "user settings service" store connection information +and provide these to NetworkManager, also via D-Bus. Each settings service +can determine how and where it persistently stores the connection information; +for example, the GNOME applet stores its configuration in GConf, and the system +settings service stores it's config in distro-specific formats, or in a distro- +agnostic format, depending on user/administrator preference. + +A variety of other system services are used by NetworkManager to provide +network functionality: wpa_supplicant for wireless connections and 802.1x +wired connections, pppd for PPP and mobile broadband connections, DHCP clients +for dynamic IP addressing, dnsmasq for proxy nameserver and DHCP server +functionality for internet connection sharing, and avahi-autoipd for IPv4 +link-local addresses. Most communication with these daemons occurs, again, +via D-Bus. + + +Why doesn't my network Just Work? + +Driver problems are the #1 cause of why NetworkManager sometimes fails to +connect to wireless networks. Often, the driver simply doesn't behave in a +consistent manner, or is just plain buggy. NetworkManager supports _only_ +those drivers that are shipped with the upstream Linux kernel, because only +those drivers can be easily fixed and debugged. ndiswrapper, vendor binary +drivers, or other out-of-tree drivers may or may not work well with +NetworkManager, precisely because they have not been vetted and improved by the +open-source community, and becuase problems in these drivers usually cannot +be fixed. + +Sometimes, command-line tools like 'iwconfig' will work, but NetworkManager will +fail. This is again often due to buggy drivers, becuase these drivers simply +aren't expecting the dynamic requests that NetworkManager and wpa_supplicant +make. Driver bugs should be filed in the bug tracker of the distribution being +run, since often distributions customize their kernel and drivers. + +Sometimes, it really is NetworkManager's fault. If you think that's the case, +please file a bug at http://bugzilla.gnome.org and choose the NetworkManager +component. Attaching the output of /var/log/messages or /var/log/daemon.log +(wherever your distribution directs syslog's 'daemon' facility output) is often +very helpful, and (if you can get) a working wpa_supplicant config file helps +enormously. + + diff --git a/TODO b/TODO new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/TODO @@ -0,0 +1 @@ + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 00000000..334107b7 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1674 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, +[m4_warning([this file was generated for autoconf 2.65. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 1995-2002 Free Software Foundation, Inc. +# Copyright (C) 2001-2003,2004 Red Hat, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995, 1996 +# +# Modified to never use included libintl. +# Owen Taylor , 12/15/1998 +# +# Major rework to remove unused code +# Owen Taylor , 12/11/2002 +# +# Added better handling of ALL_LINGUAS from GNU gettext version +# written by Bruno Haible, Owen Taylor 5/30/3002 +# +# Modified to require ngettext +# Matthias Clasen 08/06/2004 +# +# We need this here as well, since someone might use autoconf-2.5x +# to configure GLib then an older version to configure a package +# using AM_GLIB_GNU_GETTEXT +AC_PREREQ(2.53) + +dnl +dnl We go to great lengths to make sure that aclocal won't +dnl try to pull in the installed version of these macros +dnl when running aclocal in the glib directory. +dnl +m4_copy([AC_DEFUN],[glib_DEFUN]) +m4_copy([AC_REQUIRE],[glib_REQUIRE]) +dnl +dnl At the end, if we're not within glib, we'll define the public +dnl definitions in terms of our private definitions. +dnl + +# GLIB_LC_MESSAGES +#-------------------- +glib_DEFUN([GLIB_LC_MESSAGES], + [AC_CHECK_HEADERS([locale.h]) + if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi + fi]) + +# GLIB_PATH_PROG_WITH_TEST +#---------------------------- +dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# GLIB_WITH_NLS +#----------------- +glib_DEFUN([GLIB_WITH_NLS], + dnl NLS is obligatory + [USE_NLS=yes + AC_SUBST(USE_NLS) + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + AC_CHECK_HEADER(libintl.h, + [gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, + [AC_TRY_LINK([ +#include +], + [return !ngettext ("","", 1)], + gt_cv_func_ngettext_libc=yes, + gt_cv_func_ngettext_libc=no) + ]) + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, + [AC_TRY_LINK([ +#include +], + [return !dgettext ("","")], + gt_cv_func_dgettext_libc=yes, + gt_cv_func_dgettext_libc=no) + ]) + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + AC_CHECK_FUNCS(bind_textdomain_codeset) + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dgettext, + gt_cv_func_dgettext_libintl=yes)])]) + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + AC_MSG_CHECKING([if -liconv is needed to use gettext]) + AC_MSG_RESULT([]) + AC_CHECK_LIB(intl, ngettext, + [AC_CHECK_LIB(intl, dcgettext, + [gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv], + :,-liconv)], + :,-liconv) + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + AC_CHECK_FUNCS(bind_textdomain_codeset) + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + AC_DEFINE(HAVE_GETTEXT,1, + [Define if the GNU gettext() function is already present or preinstalled.]) + GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + MSGFMT_OPTS= + AC_MSG_CHECKING([if msgfmt accepts -c]) + GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) + AC_SUBST(MSGFMT_OPTS) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share and + dnl and CATOBJEXT=.gmo in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac]) + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + ]) + + if test "$gt_cv_have_gettext" = "yes" ; then + AC_DEFINE(ENABLE_NLS, 1, + [always defined to indicate that i18n is enabled]) + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is not GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + AC_OUTPUT_COMMANDS( + [case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac]) + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLLIBS) + AC_SUBST(PO_IN_DATADIR_TRUE) + AC_SUBST(PO_IN_DATADIR_FALSE) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +# AM_GLIB_GNU_GETTEXT +# ------------------- +# Do checks necessary for use of gettext. If a suitable implementation +# of gettext is found in either in libintl or in the C library, +# it will set INTLLIBS to the libraries needed for use of gettext +# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable +# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() +# on various variables needed by the Makefile.in.in installed by +# glib-gettextize. +dnl +glib_DEFUN([GLIB_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + + GLIB_LC_MESSAGES + GLIB_WITH_NLS + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) + +# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) +# ------------------------------- +# Define VARIABLE to the location where catalog files will +# be installed by po/Makefile. +glib_DEFUN([GLIB_DEFINE_LOCALEDIR], +[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl +glib_save_prefix="$prefix" +glib_save_exec_prefix="$exec_prefix" +glib_save_datarootdir="$datarootdir" +test "x$prefix" = xNONE && prefix=$ac_default_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +datarootdir=`eval echo "${datarootdir}"` +if test "x$CATOBJEXT" = "x.mo" ; then + localedir=`eval echo "${libdir}/locale"` +else + localedir=`eval echo "${datadir}/locale"` +fi +prefix="$glib_save_prefix" +exec_prefix="$glib_save_exec_prefix" +datarootdir="$glib_save_datarootdir" +AC_DEFINE_UNQUOTED($1, "$localedir", + [Define the location where the catalogs will be installed]) +]) + +dnl +dnl Now the definitions that aclocal will find +dnl +ifdef(glib_configure_in,[],[ +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) +])dnl + +# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) +# +# Create a temporary file with TEST-FILE as its contents and pass the +# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with +# 0 and perform ACTION-IF-FAIL for any other exit status. +AC_DEFUN([GLIB_RUN_PROG], +[cat >conftest.foo <<_ACEOF +$2 +_ACEOF +if AC_RUN_LOG([$1 conftest.foo]); then + m4_ifval([$3], [$3], [:]) +m4_ifvaln([$4], [else $4])dnl +echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD +sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD +fi]) + + +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_PREREQ([2.50]) + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE([nls], + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) +]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/compiler_warnings.m4]) +m4_include([m4/gtk-doc.m4]) +m4_include([m4/intltool.m4]) +m4_include([m4/libnl-check.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/callouts/77-nm-olpc-mesh.rules b/callouts/77-nm-olpc-mesh.rules new file mode 100644 index 00000000..a1a1554c --- /dev/null +++ b/callouts/77-nm-olpc-mesh.rules @@ -0,0 +1,6 @@ +# do not edit this file, it will be overwritten on update + +# The fact that this device is driven by libertas is not currently exposed +# in the sysfs tree..? +KERNEL=="msh*", SUBSYSTEM=="net", DRIVERS=="usb", ATTRS{idVendor}=="1286", ATTRS{idProduct}=="2001", ENV{ID_NM_OLPC_MESH}="1" + diff --git a/callouts/Makefile.am b/callouts/Makefile.am new file mode 100644 index 00000000..6f28f5a7 --- /dev/null +++ b/callouts/Makefile.am @@ -0,0 +1,94 @@ +dbusservicedir = $(DBUS_SYS_DIR) +dbusservice_DATA = \ + nm-dhcp-client.conf \ + nm-dispatcher.conf \ + nm-avahi-autoipd.conf + +libexec_PROGRAMS = \ + nm-dhcp-client.action \ + nm-dispatcher.action \ + nm-avahi-autoipd.action + +nm_dhcp_client_action_SOURCES = \ + nm-dhcp-client-action.c + +nm_dhcp_client_action_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" + +nm_dhcp_client_action_LDADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + + +nm_avahi_autoipd_action_SOURCES = \ + nm-avahi-autoipd-action.c + +nm_avahi_autoipd_action_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" + +nm_avahi_autoipd_action_LDADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + + +nm_dispatcher_action_SOURCES = \ + nm-dispatcher-action.c \ + nm-dispatcher-action.h + +nm_dispatcher_action_CPPFLAGS = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" + +nm_dispatcher_action_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +nm-dispatcher-glue.h: nm-dispatcher.xml + dbus-binding-tool --prefix=nm_dispatcher --mode=glib-server --output=$@ $< + +udevrulesdir = $(UDEV_BASE_DIR)/rules.d +udevrules_DATA = 77-nm-olpc-mesh.rules + +dbusactivationdir = $(datadir)/dbus-1/system-services +dbusactivation_in_files = org.freedesktop.nm_dispatcher.service.in +dbusactivation_DATA = $(dbusactivation_in_files:.service.in=.service) + +%.service: %.service.in + $(edit) $< >$@ + +edit = @sed \ + -e 's|@sbindir[@]|$(sbindir)|g' \ + -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|@localstatedir[@]|$(localstatedir)|g' \ + -e 's|@libexecdir[@]|$(libexecdir)|g' + +dispatcherdir=$(sysconfdir)/NetworkManager/dispatcher.d +install-data-hook: + $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir) + +BUILT_SOURCES = nm-dispatcher-glue.h + +CLEANFILES = $(BUILT_SOURCES) $(dbusactivation_DATA) + +EXTRA_DIST = \ + $(dbusservice_DATA) \ + $(udevrules_DATA) \ + $(dbusactivation_in_files) \ + nm-dispatcher.xml + diff --git a/callouts/Makefile.in b/callouts/Makefile.in new file mode 100644 index 00000000..b392ccd5 --- /dev/null +++ b/callouts/Makefile.in @@ -0,0 +1,825 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +libexec_PROGRAMS = nm-dhcp-client.action$(EXEEXT) \ + nm-dispatcher.action$(EXEEXT) nm-avahi-autoipd.action$(EXEEXT) +subdir = callouts +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(libexecdir)" \ + "$(DESTDIR)$(dbusactivationdir)" "$(DESTDIR)$(dbusservicedir)" \ + "$(DESTDIR)$(udevrulesdir)" +PROGRAMS = $(libexec_PROGRAMS) +am_nm_avahi_autoipd_action_OBJECTS = \ + nm_avahi_autoipd_action-nm-avahi-autoipd-action.$(OBJEXT) +nm_avahi_autoipd_action_OBJECTS = \ + $(am_nm_avahi_autoipd_action_OBJECTS) +am__DEPENDENCIES_1 = +nm_avahi_autoipd_action_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_nm_dhcp_client_action_OBJECTS = \ + nm_dhcp_client_action-nm-dhcp-client-action.$(OBJEXT) +nm_dhcp_client_action_OBJECTS = $(am_nm_dhcp_client_action_OBJECTS) +nm_dhcp_client_action_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_nm_dispatcher_action_OBJECTS = \ + nm_dispatcher_action-nm-dispatcher-action.$(OBJEXT) +nm_dispatcher_action_OBJECTS = $(am_nm_dispatcher_action_OBJECTS) +nm_dispatcher_action_DEPENDENCIES = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(nm_avahi_autoipd_action_SOURCES) \ + $(nm_dhcp_client_action_SOURCES) \ + $(nm_dispatcher_action_SOURCES) +DIST_SOURCES = $(nm_avahi_autoipd_action_SOURCES) \ + $(nm_dhcp_client_action_SOURCES) \ + $(nm_dispatcher_action_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +DATA = $(dbusactivation_DATA) $(dbusservice_DATA) $(udevrules_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +dbusservicedir = $(DBUS_SYS_DIR) +dbusservice_DATA = \ + nm-dhcp-client.conf \ + nm-dispatcher.conf \ + nm-avahi-autoipd.conf + +nm_dhcp_client_action_SOURCES = \ + nm-dhcp-client-action.c + +nm_dhcp_client_action_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" + +nm_dhcp_client_action_LDADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +nm_avahi_autoipd_action_SOURCES = \ + nm-avahi-autoipd-action.c + +nm_avahi_autoipd_action_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" + +nm_avahi_autoipd_action_LDADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +nm_dispatcher_action_SOURCES = \ + nm-dispatcher-action.c \ + nm-dispatcher-action.h + +nm_dispatcher_action_CPPFLAGS = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" + +nm_dispatcher_action_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +udevrulesdir = $(UDEV_BASE_DIR)/rules.d +udevrules_DATA = 77-nm-olpc-mesh.rules +dbusactivationdir = $(datadir)/dbus-1/system-services +dbusactivation_in_files = org.freedesktop.nm_dispatcher.service.in +dbusactivation_DATA = $(dbusactivation_in_files:.service.in=.service) +edit = @sed \ + -e 's|@sbindir[@]|$(sbindir)|g' \ + -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|@localstatedir[@]|$(localstatedir)|g' \ + -e 's|@libexecdir[@]|$(libexecdir)|g' + +dispatcherdir = $(sysconfdir)/NetworkManager/dispatcher.d +BUILT_SOURCES = nm-dispatcher-glue.h +CLEANFILES = $(BUILT_SOURCES) $(dbusactivation_DATA) +EXTRA_DIST = \ + $(dbusservice_DATA) \ + $(udevrules_DATA) \ + $(dbusactivation_in_files) \ + nm-dispatcher.xml + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu callouts/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu callouts/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libexecdir)" && rm -f $$files + +clean-libexecPROGRAMS: + @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +nm-avahi-autoipd.action$(EXEEXT): $(nm_avahi_autoipd_action_OBJECTS) $(nm_avahi_autoipd_action_DEPENDENCIES) + @rm -f nm-avahi-autoipd.action$(EXEEXT) + $(LINK) $(nm_avahi_autoipd_action_OBJECTS) $(nm_avahi_autoipd_action_LDADD) $(LIBS) +nm-dhcp-client.action$(EXEEXT): $(nm_dhcp_client_action_OBJECTS) $(nm_dhcp_client_action_DEPENDENCIES) + @rm -f nm-dhcp-client.action$(EXEEXT) + $(LINK) $(nm_dhcp_client_action_OBJECTS) $(nm_dhcp_client_action_LDADD) $(LIBS) +nm-dispatcher.action$(EXEEXT): $(nm_dispatcher_action_OBJECTS) $(nm_dispatcher_action_DEPENDENCIES) + @rm -f nm-dispatcher.action$(EXEEXT) + $(LINK) $(nm_dispatcher_action_OBJECTS) $(nm_dispatcher_action_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm_avahi_autoipd_action-nm-avahi-autoipd-action.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm_dhcp_client_action-nm-dhcp-client-action.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm_dispatcher_action-nm-dispatcher-action.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +nm_avahi_autoipd_action-nm-avahi-autoipd-action.o: nm-avahi-autoipd-action.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_avahi_autoipd_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_avahi_autoipd_action-nm-avahi-autoipd-action.o -MD -MP -MF $(DEPDIR)/nm_avahi_autoipd_action-nm-avahi-autoipd-action.Tpo -c -o nm_avahi_autoipd_action-nm-avahi-autoipd-action.o `test -f 'nm-avahi-autoipd-action.c' || echo '$(srcdir)/'`nm-avahi-autoipd-action.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_avahi_autoipd_action-nm-avahi-autoipd-action.Tpo $(DEPDIR)/nm_avahi_autoipd_action-nm-avahi-autoipd-action.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-avahi-autoipd-action.c' object='nm_avahi_autoipd_action-nm-avahi-autoipd-action.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_avahi_autoipd_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_avahi_autoipd_action-nm-avahi-autoipd-action.o `test -f 'nm-avahi-autoipd-action.c' || echo '$(srcdir)/'`nm-avahi-autoipd-action.c + +nm_avahi_autoipd_action-nm-avahi-autoipd-action.obj: nm-avahi-autoipd-action.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_avahi_autoipd_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_avahi_autoipd_action-nm-avahi-autoipd-action.obj -MD -MP -MF $(DEPDIR)/nm_avahi_autoipd_action-nm-avahi-autoipd-action.Tpo -c -o nm_avahi_autoipd_action-nm-avahi-autoipd-action.obj `if test -f 'nm-avahi-autoipd-action.c'; then $(CYGPATH_W) 'nm-avahi-autoipd-action.c'; else $(CYGPATH_W) '$(srcdir)/nm-avahi-autoipd-action.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_avahi_autoipd_action-nm-avahi-autoipd-action.Tpo $(DEPDIR)/nm_avahi_autoipd_action-nm-avahi-autoipd-action.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-avahi-autoipd-action.c' object='nm_avahi_autoipd_action-nm-avahi-autoipd-action.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_avahi_autoipd_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_avahi_autoipd_action-nm-avahi-autoipd-action.obj `if test -f 'nm-avahi-autoipd-action.c'; then $(CYGPATH_W) 'nm-avahi-autoipd-action.c'; else $(CYGPATH_W) '$(srcdir)/nm-avahi-autoipd-action.c'; fi` + +nm_dhcp_client_action-nm-dhcp-client-action.o: nm-dhcp-client-action.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_dhcp_client_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_dhcp_client_action-nm-dhcp-client-action.o -MD -MP -MF $(DEPDIR)/nm_dhcp_client_action-nm-dhcp-client-action.Tpo -c -o nm_dhcp_client_action-nm-dhcp-client-action.o `test -f 'nm-dhcp-client-action.c' || echo '$(srcdir)/'`nm-dhcp-client-action.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_dhcp_client_action-nm-dhcp-client-action.Tpo $(DEPDIR)/nm_dhcp_client_action-nm-dhcp-client-action.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp-client-action.c' object='nm_dhcp_client_action-nm-dhcp-client-action.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_dhcp_client_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_dhcp_client_action-nm-dhcp-client-action.o `test -f 'nm-dhcp-client-action.c' || echo '$(srcdir)/'`nm-dhcp-client-action.c + +nm_dhcp_client_action-nm-dhcp-client-action.obj: nm-dhcp-client-action.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_dhcp_client_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_dhcp_client_action-nm-dhcp-client-action.obj -MD -MP -MF $(DEPDIR)/nm_dhcp_client_action-nm-dhcp-client-action.Tpo -c -o nm_dhcp_client_action-nm-dhcp-client-action.obj `if test -f 'nm-dhcp-client-action.c'; then $(CYGPATH_W) 'nm-dhcp-client-action.c'; else $(CYGPATH_W) '$(srcdir)/nm-dhcp-client-action.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_dhcp_client_action-nm-dhcp-client-action.Tpo $(DEPDIR)/nm_dhcp_client_action-nm-dhcp-client-action.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp-client-action.c' object='nm_dhcp_client_action-nm-dhcp-client-action.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_dhcp_client_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_dhcp_client_action-nm-dhcp-client-action.obj `if test -f 'nm-dhcp-client-action.c'; then $(CYGPATH_W) 'nm-dhcp-client-action.c'; else $(CYGPATH_W) '$(srcdir)/nm-dhcp-client-action.c'; fi` + +nm_dispatcher_action-nm-dispatcher-action.o: nm-dispatcher-action.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_dispatcher_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_dispatcher_action-nm-dispatcher-action.o -MD -MP -MF $(DEPDIR)/nm_dispatcher_action-nm-dispatcher-action.Tpo -c -o nm_dispatcher_action-nm-dispatcher-action.o `test -f 'nm-dispatcher-action.c' || echo '$(srcdir)/'`nm-dispatcher-action.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_dispatcher_action-nm-dispatcher-action.Tpo $(DEPDIR)/nm_dispatcher_action-nm-dispatcher-action.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dispatcher-action.c' object='nm_dispatcher_action-nm-dispatcher-action.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_dispatcher_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_dispatcher_action-nm-dispatcher-action.o `test -f 'nm-dispatcher-action.c' || echo '$(srcdir)/'`nm-dispatcher-action.c + +nm_dispatcher_action-nm-dispatcher-action.obj: nm-dispatcher-action.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_dispatcher_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_dispatcher_action-nm-dispatcher-action.obj -MD -MP -MF $(DEPDIR)/nm_dispatcher_action-nm-dispatcher-action.Tpo -c -o nm_dispatcher_action-nm-dispatcher-action.obj `if test -f 'nm-dispatcher-action.c'; then $(CYGPATH_W) 'nm-dispatcher-action.c'; else $(CYGPATH_W) '$(srcdir)/nm-dispatcher-action.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_dispatcher_action-nm-dispatcher-action.Tpo $(DEPDIR)/nm_dispatcher_action-nm-dispatcher-action.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dispatcher-action.c' object='nm_dispatcher_action-nm-dispatcher-action.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_dispatcher_action_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_dispatcher_action-nm-dispatcher-action.obj `if test -f 'nm-dispatcher-action.c'; then $(CYGPATH_W) 'nm-dispatcher-action.c'; else $(CYGPATH_W) '$(srcdir)/nm-dispatcher-action.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dbusactivationDATA: $(dbusactivation_DATA) + @$(NORMAL_INSTALL) + test -z "$(dbusactivationdir)" || $(MKDIR_P) "$(DESTDIR)$(dbusactivationdir)" + @list='$(dbusactivation_DATA)'; test -n "$(dbusactivationdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusactivationdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusactivationdir)" || exit $$?; \ + done + +uninstall-dbusactivationDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbusactivation_DATA)'; test -n "$(dbusactivationdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(dbusactivationdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(dbusactivationdir)" && rm -f $$files +install-dbusserviceDATA: $(dbusservice_DATA) + @$(NORMAL_INSTALL) + test -z "$(dbusservicedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusservicedir)" + @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusservicedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusservicedir)" || exit $$?; \ + done + +uninstall-dbusserviceDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(dbusservicedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(dbusservicedir)" && rm -f $$files +install-udevrulesDATA: $(udevrules_DATA) + @$(NORMAL_INSTALL) + test -z "$(udevrulesdir)" || $(MKDIR_P) "$(DESTDIR)$(udevrulesdir)" + @list='$(udevrules_DATA)'; test -n "$(udevrulesdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(udevrulesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(udevrulesdir)" || exit $$?; \ + done + +uninstall-udevrulesDATA: + @$(NORMAL_UNINSTALL) + @list='$(udevrules_DATA)'; test -n "$(udevrulesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(udevrulesdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(udevrulesdir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(dbusactivationdir)" "$(DESTDIR)$(dbusservicedir)" "$(DESTDIR)$(udevrulesdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dbusactivationDATA install-dbusserviceDATA \ + install-udevrulesDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libexecPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dbusactivationDATA uninstall-dbusserviceDATA \ + uninstall-libexecPROGRAMS uninstall-udevrulesDATA + +.MAKE: all check install install-am install-data-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libexecPROGRAMS clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-hook install-dbusactivationDATA \ + install-dbusserviceDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libexecPROGRAMS \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip install-udevrulesDATA installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-dbusactivationDATA \ + uninstall-dbusserviceDATA uninstall-libexecPROGRAMS \ + uninstall-udevrulesDATA + + +nm-dispatcher-glue.h: nm-dispatcher.xml + dbus-binding-tool --prefix=nm_dispatcher --mode=glib-server --output=$@ $< + +%.service: %.service.in + $(edit) $< >$@ +install-data-hook: + $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/callouts/nm-avahi-autoipd-action.c b/callouts/nm-avahi-autoipd-action.c new file mode 100644 index 00000000..440efade --- /dev/null +++ b/callouts/nm-avahi-autoipd-action.c @@ -0,0 +1,142 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#define NM_AVAHI_AUTOIPD_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" +#define NM_AVAHI_AUTOIPD_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" + +static DBusConnection * +dbus_init (void) +{ + DBusConnection * connection; + DBusError error; + int ret; + + dbus_connection_set_change_sigpipe (TRUE); + + dbus_error_init (&error); + connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error); + if (dbus_error_is_set (&error)) { + fprintf (stderr, "Error: could not get the system bus. Make sure " + "the message bus daemon is running! Message: (%s) %s\n", + error.name, + error.message); + goto error; + } + + dbus_connection_set_exit_on_disconnect (connection, FALSE); + + dbus_error_init (&error); + ret = dbus_bus_request_name (connection, + NM_AVAHI_AUTOIPD_DBUS_SERVICE, + DBUS_NAME_FLAG_DO_NOT_QUEUE, + &error); + if (dbus_error_is_set (&error)) { + fprintf (stderr, "Error: Could not acquire the NM DHCP client service. " + "Message: (%s) %s\n", + error.name, + error.message); + goto error; + } + + if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + fprintf (stderr, "Error: Could not acquire the NM DHCP client service " + "as it is already taken. Return: %d\n", + ret); + goto error; + } + + return connection; + +error: + if (dbus_error_is_set (&error)) + dbus_error_free (&error); + if (connection) + dbus_connection_unref (connection); + return NULL; +} + +int +main (int argc, char *argv[]) +{ + DBusConnection *connection; + DBusMessage *message; + dbus_bool_t result; + char *event, *iface, *address; + + g_type_init (); + + if (argc != 4) { + fprintf (stderr, "Error: expected 3 arguments (event, interface, address).\n"); + exit (1); + } + + event = argv[1]; + iface = argv[2]; + address = argv[3] ? argv[3] : ""; + + if (!event || !iface || !strlen (event) || !strlen (iface)) { + fprintf (stderr, "Error: unexpected arguments received from avahi-autoipd.\n"); + exit (1); + } + + /* Get a connection to the system bus */ + connection = dbus_init (); + if (connection == NULL) + exit (1); + + message = dbus_message_new_signal ("/", NM_AVAHI_AUTOIPD_DBUS_IFACE, "Event"); + if (message == NULL) { + fprintf (stderr, "Error: not enough memory to send autoip Event signal.\n"); + exit (1); + } + + if (!dbus_message_append_args (message, + DBUS_TYPE_STRING, &event, + DBUS_TYPE_STRING, &iface, + DBUS_TYPE_STRING, &address, + DBUS_TYPE_INVALID)) { + fprintf (stderr, "Error: failed to construct autoip Event signal.\n"); + exit (1); + } + + /* queue the message */ + result = dbus_connection_send (connection, message, NULL); + if (!result) { + fprintf (stderr, "Error: could not send send autoip Event signal.\n"); + exit (1); + } + dbus_message_unref (message); + + /* Send out the message */ + dbus_connection_flush (connection); + + return 0; +} + diff --git a/callouts/nm-avahi-autoipd.conf b/callouts/nm-avahi-autoipd.conf new file mode 100644 index 00000000..485ab429 --- /dev/null +++ b/callouts/nm-avahi-autoipd.conf @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/callouts/nm-dhcp-client-action.c b/callouts/nm-dhcp-client-action.c new file mode 100644 index 00000000..f001c9e4 --- /dev/null +++ b/callouts/nm-dhcp-client-action.c @@ -0,0 +1,320 @@ +/* -*- 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 - 2008 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#define NM_DHCP_CLIENT_DBUS_SERVICE "org.freedesktop.nm_dhcp_client" +#define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client" + +/** + * Start a dict in a dbus message. Should be paired with a call to + * {@link wpa_dbus_dict_close_write}. + * + * @param iter A valid dbus message iterator + * @param iter_dict (out) A dict iterator to pass to further dict functions + * @return TRUE on success, FALSE on failure + * + */ +static dbus_bool_t wpa_dbus_dict_open_write(DBusMessageIter *iter, + DBusMessageIter *iter_dict) +{ + dbus_bool_t result; + + if (!iter || !iter_dict) + return FALSE; + + result = dbus_message_iter_open_container( + iter, + DBUS_TYPE_ARRAY, + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, + iter_dict); + return result; +} + +/** + * End a dict element in a dbus message. Should be paired with + * a call to {@link wpa_dbus_dict_open_write}. + * + * @param iter valid dbus message iterator, same as passed to + * wpa_dbus_dict_open_write() + * @param iter_dict a dbus dict iterator returned from + * {@link wpa_dbus_dict_open_write} + * @return TRUE on success, FALSE on failure + * + */ +static dbus_bool_t wpa_dbus_dict_close_write(DBusMessageIter *iter, + DBusMessageIter *iter_dict) +{ + if (!iter || !iter_dict) + return FALSE; + + return dbus_message_iter_close_container(iter, iter_dict); +} + +static dbus_bool_t _wpa_dbus_add_dict_entry_start( + DBusMessageIter *iter_dict, DBusMessageIter *iter_dict_entry, + const char *key, const int value_type) +{ + if (!dbus_message_iter_open_container(iter_dict, + DBUS_TYPE_DICT_ENTRY, NULL, + iter_dict_entry)) + return FALSE; + + if (!dbus_message_iter_append_basic(iter_dict_entry, DBUS_TYPE_STRING, + &key)) + return FALSE; + + return TRUE; +} + + +static dbus_bool_t _wpa_dbus_add_dict_entry_end( + DBusMessageIter *iter_dict, DBusMessageIter *iter_dict_entry, + DBusMessageIter *iter_dict_val) +{ + if (!dbus_message_iter_close_container(iter_dict_entry, iter_dict_val)) + return FALSE; + if (!dbus_message_iter_close_container(iter_dict, iter_dict_entry)) + return FALSE; + + return TRUE; +} + +static dbus_bool_t _wpa_dbus_add_dict_entry_byte_array( + DBusMessageIter *iter_dict, const char *key, + const char *value, const dbus_uint32_t value_len) +{ + DBusMessageIter iter_dict_entry, iter_dict_val, iter_array; + dbus_uint32_t i; + + if (!_wpa_dbus_add_dict_entry_start(iter_dict, &iter_dict_entry, + key, DBUS_TYPE_ARRAY)) + return FALSE; + + if (!dbus_message_iter_open_container(&iter_dict_entry, + DBUS_TYPE_VARIANT, + DBUS_TYPE_ARRAY_AS_STRING + DBUS_TYPE_BYTE_AS_STRING, + &iter_dict_val)) + return FALSE; + + if (!dbus_message_iter_open_container(&iter_dict_val, DBUS_TYPE_ARRAY, + DBUS_TYPE_BYTE_AS_STRING, + &iter_array)) + return FALSE; + + for (i = 0; i < value_len; i++) { + if (!dbus_message_iter_append_basic(&iter_array, + DBUS_TYPE_BYTE, + &(value[i]))) + return FALSE; + } + + if (!dbus_message_iter_close_container(&iter_dict_val, &iter_array)) + return FALSE; + + if (!_wpa_dbus_add_dict_entry_end(iter_dict, &iter_dict_entry, + &iter_dict_val)) + return FALSE; + + return TRUE; +} + +/** + * Add a byte array entry to the dict. + * + * @param iter_dict A valid DBusMessageIter returned from + * {@link wpa_dbus_dict_open_write} + * @param key The key of the dict item + * @param value The byte array + * @param value_len The length of the byte array, in bytes + * @return TRUE on success, FALSE on failure + * + */ +static dbus_bool_t wpa_dbus_dict_append_byte_array(DBusMessageIter *iter_dict, + const char *key, + const char *value, + const dbus_uint32_t value_len) +{ + if (!key) + return FALSE; + if (!value && (value_len != 0)) + return FALSE; + return _wpa_dbus_add_dict_entry_byte_array(iter_dict, key, value, + value_len); +} + + +static const char * ignore[] = {"PATH", "SHLVL", "_", "PWD", "dhc_dbus", NULL}; + +static dbus_bool_t +build_message (DBusMessage * message) +{ + char ** env = NULL; + char ** item; + char ** p; + dbus_bool_t success = FALSE; + DBusMessageIter iter, iter_dict; + + dbus_message_iter_init_append (message, &iter); + if (!wpa_dbus_dict_open_write (&iter, &iter_dict)) + goto out; + + /* List environment and format for dbus dict */ + env = g_listenv (); + for (item = env; *item; item++) { + gboolean ignore_item = FALSE; + const char * val = g_getenv (*item); + + /* Ignore non-DCHP-related environment variables */ + for (p = (char **) ignore; *p && !ignore_item; p++) { + if (strncmp (*item, *p, strlen (*p)) == 0) + ignore_item = TRUE; + } + if (ignore_item) + continue; + + /* Value passed as a byte array rather than a string, because there are + * no character encoding guarantees with DHCP, and D-Bus requires + * strings to be UTF-8. + */ + if (!wpa_dbus_dict_append_byte_array (&iter_dict, + *item, + val ? val : "\0", + val ? strlen (val) : 1)) { + fprintf (stderr, "Error: failed to add item '%s' to signal\n", + *item); + goto out; + } + } + + if (!wpa_dbus_dict_close_write (&iter, &iter_dict)) + goto out; + + success = TRUE; + +out: + g_strfreev (env); + return success; +} + +static DBusConnection * +dbus_init (void) +{ + DBusConnection * connection; + DBusError error; + int ret; + + dbus_connection_set_change_sigpipe (TRUE); + + dbus_error_init (&error); + connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error); + if (dbus_error_is_set (&error)) { + fprintf (stderr, "Error: could not get the system bus. Make sure " + "the message bus daemon is running! Message: (%s) %s\n", + error.name, + error.message); + goto error; + } + + dbus_connection_set_exit_on_disconnect (connection, FALSE); + + dbus_error_init (&error); + ret = dbus_bus_request_name (connection, + NM_DHCP_CLIENT_DBUS_SERVICE, + DBUS_NAME_FLAG_DO_NOT_QUEUE, + &error); + if (dbus_error_is_set (&error)) { + fprintf (stderr, "Error: Could not acquire the NM DHCP client service. " + "Message: (%s) %s\n", + error.name, + error.message); + goto error; + } + + if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + fprintf (stderr, "Error: Could not acquire the NM DHCP client service " + "as it is already taken. Return: %d\n", + ret); + goto error; + } + + return connection; + +error: + if (dbus_error_is_set (&error)) + dbus_error_free (&error); + if (connection) + dbus_connection_unref (connection); + return NULL; +} + +int +main (int argc, char *argv[]) +{ + DBusConnection * connection; + DBusMessage * message; + dbus_bool_t result; + + g_type_init (); + + /* Get a connection to the system bus */ + connection = dbus_init (); + if (connection == NULL) + exit (1); + + message = dbus_message_new_signal ("/", NM_DHCP_CLIENT_DBUS_IFACE, "Event"); + if (message == NULL) { + fprintf (stderr, "Error: Not enough memory to send DHCP Event signal.\n"); + exit (1); + } + + /* Dump environment variables into the message */ + result = build_message (message); + if (result == FALSE) { + fprintf (stderr, "Error: Not enough memory to send DHCP Event signal.\n"); + exit (1); + } + + /* queue the message */ + result = dbus_connection_send (connection, message, NULL); + if (!result) { + fprintf (stderr, "Error: Could not send send DHCP Event signal.\n"); + exit (1); + } + dbus_message_unref (message); + + /* Send out the message */ + dbus_connection_flush (connection); + + return 0; +} + diff --git a/callouts/nm-dhcp-client.conf b/callouts/nm-dhcp-client.conf new file mode 100644 index 00000000..0aeae603 --- /dev/null +++ b/callouts/nm-dhcp-client.conf @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/callouts/nm-dispatcher-action.c b/callouts/nm-dispatcher-action.c new file mode 100644 index 00000000..828d8be1 --- /dev/null +++ b/callouts/nm-dispatcher-action.c @@ -0,0 +1,798 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include "nm-glib-compat.h" +#include +#include +#include +#include +#include + +#include "nm-dispatcher-action.h" + +#define NMD_SCRIPT_DIR SYSCONFDIR "/NetworkManager/dispatcher.d" + +static GMainLoop *loop = NULL; +static gboolean debug = FALSE; + +static gboolean quit_timeout_cb (gpointer user_data); + +typedef struct Handler Handler; +typedef struct HandlerClass HandlerClass; + +GType handler_get_type (void); + +struct Handler { + GObject parent; +}; + +struct HandlerClass { + GObjectClass parent; +}; + +#define HANDLER_TYPE (handler_get_type ()) +#define HANDLER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), HANDLER_TYPE, Handler)) +#define HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HANDLER_TYPE, HandlerClass)) +#define IS_HANDLER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), HANDLER_TYPE)) +#define IS_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HANDLER_TYPE)) +#define HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HANDLER_TYPE, HandlerClass)) + +G_DEFINE_TYPE(Handler, handler, G_TYPE_OBJECT) + +typedef struct { + DBusGConnection *g_connection; + DBusGProxy *bus_proxy; + guint quit_timeout; + gboolean persist; + + Handler *handler; +} Dispatcher; + +static gboolean +nm_dispatcher_action (Handler *obj, + const char *action, + GHashTable *connection, + GHashTable *connection_props, + GHashTable *device_props, + GError **error); + +#include "nm-dispatcher-glue.h" + + +static void +handler_init (Handler *h) +{ +} + +static void +handler_finalize (GObject *object) +{ + G_OBJECT_CLASS (handler_parent_class)->finalize (object); +} + +static void +handler_class_init (HandlerClass *h_class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (h_class); + + gobject_class->finalize = handler_finalize; +} + +/* + * nmd_permission_check + * + * Verify that the given script has the permissions we want. Specifically, + * ensure that the file is + * - A regular file. + * - Owned by root. + * - Not writable by the group or by other. + * - Not setuid. + * - Executable by the owner. + * + */ +static inline gboolean +nmd_permission_check (struct stat *s, GError **error) +{ + g_return_val_if_fail (s != NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + /* Only accept regular files */ + if (!S_ISREG (s->st_mode)) { + g_set_error (error, 0, 0, "not a regular file."); + return FALSE; + } + + /* Only accept files owned by root */ + if (s->st_uid != 0) { + g_set_error (error, 0, 0, "not owned by root."); + return FALSE; + } + + /* Only accept files not writable by group or other, and not SUID */ + if (s->st_mode & (S_IWGRP | S_IWOTH | S_ISUID)) { + g_set_error (error, 0, 0, "writable by group or other, or set-UID."); + return FALSE; + } + + /* Only accept files executable by the owner */ + if (!(s->st_mode & S_IXUSR)) { + g_set_error (error, 0, 0, "not executable by owner."); + return FALSE; + } + + return TRUE; +} + + +/* + * nmd_is_valid_filename + * + * Verify that the given script is a valid file name. Specifically, + * ensure that the file: + * - is not a editor backup file + * - is not a package management file + * - does not start with '.' + */ +static inline gboolean +nmd_is_valid_filename (const char *file_name) +{ + char *bad_suffixes[] = { "~", ".rpmsave", ".rpmorig", ".rpmnew", NULL }; + char *tmp; + int i; + + if (file_name[0] == '.') + return FALSE; + for (i = 0; bad_suffixes[i]; i++) { + if (g_str_has_suffix(file_name, bad_suffixes[i])) + return FALSE; + } + tmp = g_strrstr(file_name, ".dpkg-"); + if (tmp && (tmp == strrchr(file_name,'.'))) + return FALSE; + return TRUE; +} + +static gint +sort_files (gconstpointer a, gconstpointer b) +{ + char *a_base = NULL, *b_base = NULL; + int ret = 0; + + if (a && !b) + return 1; + if (!a && !b) + return 0; + if (!a && b) + return -1; + + a_base = g_path_get_basename (a); + b_base = g_path_get_basename (b); + + ret = strcmp (a_base, b_base); + + g_free (a_base); + g_free (b_base); + return ret; +} + +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); +} + +typedef struct { + char **envp; + guint32 i; +} EnvAddInfo; + +static void +add_one_option_to_envp (gpointer key, gpointer value, gpointer user_data) +{ + EnvAddInfo *info = (EnvAddInfo *) user_data; + char *ucased; + + ucased = g_ascii_strup (key, -1); + info->envp[info->i++] = g_strdup_printf ("DHCP4_%s=%s", ucased, (char *) value); + g_free (ucased); +} + +static char ** +construct_envp (const char *uuid, NMIP4Config *ip4_config, NMDHCP4Config *dhcp4_config) +{ + guint32 env_size = 0; + char **envp; + guint32 envp_idx = 0; + GHashTable *options = NULL; + GSList *addresses, *routes, *iter; + GArray *nameservers; + GPtrArray *domains; + guint32 num, i; + GString *tmp; + + if (!ip4_config) + return g_new0 (char *, 1); + + addresses = (GSList *) nm_ip4_config_get_addresses (ip4_config); + nameservers = (GArray *) nm_ip4_config_get_nameservers (ip4_config); + domains = (GPtrArray *) nm_ip4_config_get_domains (ip4_config); + routes = (GSList *) nm_ip4_config_get_routes (ip4_config); + + env_size = g_slist_length (addresses) + + 1 /* addresses length */ + + 1 /* nameservers */ + + 1 /* domains */ + + 1 /* hostname */ + + g_slist_length (routes) + + 1 /* routes length */ + + 1 /* connection UUID */; + + if (dhcp4_config) { + options = nm_dhcp4_config_get_options (dhcp4_config); + env_size += g_hash_table_size (options); + } + + envp = g_new0 (char *, env_size + 1); + + if (uuid) + envp[envp_idx++] = g_strdup_printf ("CONNECTION_UUID=%s", uuid); + + /* IP4 config stuff */ + for (iter = addresses, num = 0; iter; iter = g_slist_next (iter)) { + NMIP4Address *addr = (NMIP4Address *) iter->data; + char str_addr[INET_ADDRSTRLEN + 1]; + char str_gw[INET_ADDRSTRLEN + 1]; + struct in_addr tmp_addr; + guint32 prefix = nm_ip4_address_get_prefix (addr); + + memset (str_addr, 0, sizeof (str_addr)); + tmp_addr.s_addr = nm_ip4_address_get_address (addr); + if (!inet_ntop (AF_INET, &tmp_addr, str_addr, sizeof (str_addr))) + continue; + + memset (str_gw, 0, sizeof (str_gw)); + tmp_addr.s_addr = nm_ip4_address_get_gateway (addr); + inet_ntop (AF_INET, &tmp_addr, str_gw, sizeof (str_gw)); + + tmp = g_string_sized_new (25 + strlen (str_addr) + strlen (str_gw)); + g_string_append_printf (tmp, "IP4_ADDRESS_%d=%s/%d %s", num++, str_addr, prefix, str_gw); + envp[envp_idx++] = tmp->str; + g_string_free (tmp, FALSE); + } + if (num) + envp[envp_idx++] = g_strdup_printf ("IP4_NUM_ADDRESSES=%d", num); + + if (nameservers && nameservers->len) { + gboolean first = TRUE; + + tmp = g_string_new ("IP4_NAMESERVERS="); + for (i = 0; i < nameservers->len; i++) { + struct in_addr addr; + char buf[INET_ADDRSTRLEN + 1]; + + addr.s_addr = g_array_index (nameservers, guint32, i); + memset (buf, 0, sizeof (buf)); + if (inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { + if (!first) + g_string_append_c (tmp, ' '); + g_string_append (tmp, buf); + first = FALSE; + } + } + envp[envp_idx++] = tmp->str; + g_string_free (tmp, FALSE); + } + + if (domains && domains->len) { + tmp = g_string_new ("IP4_DOMAINS="); + for (i = 0; i < domains->len; i++) { + if (i > 0) + g_string_append_c (tmp, ' '); + g_string_append (tmp, (char *) g_ptr_array_index (domains, i)); + } + envp[envp_idx++] = tmp->str; + g_string_free (tmp, FALSE); + } + + for (iter = routes, num = 0; iter; iter = g_slist_next (iter)) { + NMIP4Route *route = (NMIP4Route *) iter->data; + char str_addr[INET_ADDRSTRLEN + 1]; + char str_nh[INET_ADDRSTRLEN + 1]; + struct in_addr tmp_addr; + guint32 prefix = nm_ip4_route_get_prefix (route); + guint32 metric = nm_ip4_route_get_metric (route); + + memset (str_addr, 0, sizeof (str_addr)); + tmp_addr.s_addr = nm_ip4_route_get_dest (route); + if (!inet_ntop (AF_INET, &tmp_addr, str_addr, sizeof (str_addr))) + continue; + + memset (str_nh, 0, sizeof (str_nh)); + tmp_addr.s_addr = nm_ip4_route_get_next_hop (route); + inet_ntop (AF_INET, &tmp_addr, str_nh, sizeof (str_nh)); + + tmp = g_string_sized_new (30 + strlen (str_addr) + strlen (str_nh)); + g_string_append_printf (tmp, "IP4_ROUTE_%d=%s/%d %s %d", num++, str_addr, prefix, str_nh, metric); + envp[envp_idx++] = tmp->str; + g_string_free (tmp, FALSE); + } + envp[envp_idx++] = g_strdup_printf ("IP4_NUM_ROUTES=%d", num); + + /* DHCP stuff */ + if (dhcp4_config && options) { + EnvAddInfo info; + + info.envp = envp; + info.i = envp_idx; + g_hash_table_foreach (options, add_one_option_to_envp, &info); + } + + if (debug) { + char **p; + + g_message ("------------ Script Environment ------------"); + for (p = envp; *p; p++) + g_message (" %s", *p); + g_message ("\n"); + } + + return envp; +} + +static void +dispatch_scripts (const char *action, + const char *iface, + const char *parent_iface, + NMDeviceType type, + const char *uuid, + NMIP4Config *ip4_config, + NMDHCP4Config *dhcp4_config) +{ + GDir *dir; + const char *filename; + GSList *scripts = NULL, *iter; + GError *error = NULL; + char **envp = NULL; + + if (!(dir = g_dir_open (NMD_SCRIPT_DIR, 0, &error))) { + g_warning ("g_dir_open() could not open '" NMD_SCRIPT_DIR "'. '%s'", + error->message); + g_error_free (error); + return; + } + + while ((filename = g_dir_read_name (dir))) { + char *file_path; + struct stat s; + GError *pc_error = NULL; + int err; + + if (!nmd_is_valid_filename (filename)) + continue; + + file_path = g_build_filename (NMD_SCRIPT_DIR, filename, NULL); + + err = stat (file_path, &s); + if (err) { + g_warning ("Script '%s' could not be stated: %d", file_path, err); + g_free (file_path); + continue; + } + + if (!nmd_permission_check (&s, &pc_error)) { + g_warning ("Script '%s' could not be executed: %s", file_path, pc_error->message); + g_error_free (pc_error); + g_free (file_path); + } else { + /* success */ + scripts = g_slist_insert_sorted (scripts, file_path, sort_files); + } + } + g_dir_close (dir); + + envp = construct_envp (uuid, ip4_config, dhcp4_config); + + for (iter = scripts; iter; iter = g_slist_next (iter)) { + gchar *argv[4]; + gint status = -1; + + argv[0] = (char *) iter->data; + argv[1] = iface ? (char *) iface : "none"; + argv[2] = (char *) action; + argv[3] = NULL; + + if (debug) + g_message ("Script: %s %s %s", (char *) iter->data, iface ? (char *) iface : "(none)", (char *) action); + + error = NULL; + if (g_spawn_sync ("/", argv, envp, 0, child_setup, NULL, NULL, NULL, &status, &error)) { + if (WIFEXITED (status)) { + if (WEXITSTATUS (status) != 0) + g_warning ("Script '%s' exited with error status %d.", + (char *) iter->data, WEXITSTATUS (status)); + } else + g_warning ("Script '%s' exited abnormally.", (char *) iter->data); + } else { + g_warning ("Could not run script '%s': (%d) %s", + (char *) iter->data, error->code, error->message); + g_error_free (error); + } + } + + g_strfreev (envp); + + g_slist_foreach (scripts, (GFunc) g_free, NULL); + g_slist_free (scripts); +} + +static gboolean +nm_dispatcher_action (Handler *h, + const char *action, + GHashTable *connection_hash, + GHashTable *connection_props, + GHashTable *device_props, + GError **error) +{ + Dispatcher *d = g_object_get_data (G_OBJECT (h), "dispatcher"); + NMConnection *connection; + char *iface = NULL, *parent_iface = NULL; + const char *uuid = NULL; + NMDeviceType type = NM_DEVICE_TYPE_UNKNOWN; + NMDeviceState dev_state = NM_DEVICE_STATE_UNKNOWN; + NMDevice *device = NULL; + NMDHCP4Config *dhcp4_config = NULL; + NMIP4Config *ip4_config = NULL; + GValue *value; + + /* Back off the quit timeout */ + if (d->quit_timeout) + g_source_remove (d->quit_timeout); + if (!d->persist) + d->quit_timeout = g_timeout_add_seconds (10, quit_timeout_cb, NULL); + + connection = nm_connection_new_from_hash (connection_hash, error); + if (connection) { + NMSettingConnection *s_con; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + if (s_con) + uuid = nm_setting_connection_get_uuid (s_con); + } else { + g_warning ("%s: Invalid connection: '%s' / '%s' invalid: %d", + __func__, + g_type_name (nm_connection_lookup_setting_type_by_quark ((*error)->domain)), + (*error)->message, (*error)->code); + /* Don't fail on this error yet */ + g_error_free (*error); + *error = NULL; + } + + /* Hostname changes don't require a device */ + if (!strcmp (action, "hostname")) + goto dispatch; + + /* interface name */ + value = g_hash_table_lookup (device_props, NMD_DEVICE_PROPS_INTERFACE); + if (!value || !G_VALUE_HOLDS_STRING (value)) { + g_warning ("Missing or invalid required value " NMD_DEVICE_PROPS_INTERFACE "!"); + goto out; + } + iface = (char *) g_value_get_string (value); + + /* IP interface name */ + value = g_hash_table_lookup (device_props, NMD_DEVICE_PROPS_IP_INTERFACE); + if (value) { + if (!G_VALUE_HOLDS_STRING (value)) { + g_warning ("Invalid required value " NMD_DEVICE_PROPS_IP_INTERFACE "!"); + goto out; + } + parent_iface = iface; + iface = (char *) g_value_get_string (value); + } + + /* Device type */ + value = g_hash_table_lookup (device_props, NMD_DEVICE_PROPS_TYPE); + if (!value || !G_VALUE_HOLDS_UINT (value)) { + g_warning ("Missing or invalid required value " NMD_DEVICE_PROPS_TYPE "!"); + goto out; + } + type = g_value_get_uint (value); + + /* Device state */ + value = g_hash_table_lookup (device_props, NMD_DEVICE_PROPS_STATE); + if (!value || !G_VALUE_HOLDS_UINT (value)) { + g_warning ("Missing or invalid required value " NMD_DEVICE_PROPS_STATE "!"); + goto out; + } + dev_state = g_value_get_uint (value); + + /* device itself */ + value = g_hash_table_lookup (device_props, NMD_DEVICE_PROPS_PATH); + if (!value || (G_VALUE_TYPE (value) != DBUS_TYPE_G_OBJECT_PATH)) { + g_warning ("Missing or invalid required value " NMD_DEVICE_PROPS_PATH "!"); + goto out; + } + device = NM_DEVICE (nm_device_new (d->g_connection, (const char *) g_value_get_boxed (value))); + + /* Get the DHCP4 config */ + if (device && (dev_state == NM_DEVICE_STATE_ACTIVATED)) { + dhcp4_config = nm_device_get_dhcp4_config (device); + ip4_config = nm_device_get_ip4_config (device); + } + +dispatch: + dispatch_scripts (action, iface, parent_iface, type, uuid, ip4_config, dhcp4_config); + + if (device) + g_object_unref (device); + +out: + return TRUE; +} + +static gboolean +start_dbus_service (Dispatcher *d) +{ + int request_name_result; + GError *err = NULL; + gboolean success = FALSE; + + if (!dbus_g_proxy_call (d->bus_proxy, "RequestName", &err, + G_TYPE_STRING, NM_DISPATCHER_DBUS_SERVICE, + G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE, + G_TYPE_INVALID, + G_TYPE_UINT, &request_name_result, + G_TYPE_INVALID)) { + g_warning ("Could not acquire the " NM_DISPATCHER_DBUS_SERVICE " service.\n" + " Message: '%s'", err->message); + g_error_free (err); + goto out; + } + + if (request_name_result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + g_warning ("Could not acquire the " NM_DISPATCHER_DBUS_SERVICE " service " + "as it is already taken. Return: %d", + request_name_result); + goto out; + } + success = TRUE; + +out: + return success; +} + +static void +destroy_cb (DBusGProxy *proxy, gpointer user_data) +{ + g_warning ("Disconnected from the system bus, exiting."); + g_main_loop_quit (loop); +} + +static gboolean +dbus_init (Dispatcher *d) +{ + GError *err = NULL; + DBusConnection *connection; + + dbus_connection_set_change_sigpipe (TRUE); + + d->g_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); + if (!d->g_connection) { + g_warning ("Could not get the system bus. Make sure " + "the message bus daemon is running! Message: %s", + err->message); + g_error_free (err); + return FALSE; + } + + /* Clean up nicely if we get kicked off the bus */ + connection = dbus_g_connection_get_connection (d->g_connection); + dbus_connection_set_exit_on_disconnect (connection, FALSE); + + d->bus_proxy = dbus_g_proxy_new_for_name (d->g_connection, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + if (!d->bus_proxy) { + g_warning ("Could not get the DBus object!"); + goto error; + } + + g_signal_connect (d->bus_proxy, "destroy", G_CALLBACK (destroy_cb), NULL); + + return TRUE; + +error: + return FALSE; +} + +static void +log_handler (const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer ignored) +{ + int syslog_priority; + + switch (log_level) { + case G_LOG_LEVEL_ERROR: + syslog_priority = LOG_CRIT; + break; + + case G_LOG_LEVEL_CRITICAL: + syslog_priority = LOG_ERR; + break; + + case G_LOG_LEVEL_WARNING: + syslog_priority = LOG_WARNING; + break; + + case G_LOG_LEVEL_MESSAGE: + syslog_priority = LOG_NOTICE; + break; + + case G_LOG_LEVEL_DEBUG: + syslog_priority = LOG_DEBUG; + break; + + case G_LOG_LEVEL_INFO: + default: + syslog_priority = LOG_INFO; + break; + } + + syslog (syslog_priority, "%s", message); +} + + +static void +logging_setup (void) +{ + openlog (G_LOG_DOMAIN, LOG_CONS, LOG_DAEMON); + g_log_set_handler (G_LOG_DOMAIN, + G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, + log_handler, + NULL); +} + +static void +logging_shutdown (void) +{ + closelog (); +} + +static void +signal_handler (int signo) +{ + if (signo == SIGINT || signo == SIGTERM) { + g_message ("Caught signal %d, shutting down...", signo); + g_main_loop_quit (loop); + } +} + +static void +setup_signals (void) +{ + struct sigaction action; + sigset_t mask; + + sigemptyset (&mask); + action.sa_handler = signal_handler; + action.sa_mask = mask; + action.sa_flags = 0; + sigaction (SIGTERM, &action, NULL); + sigaction (SIGINT, &action, NULL); +} + +static gboolean +quit_timeout_cb (gpointer user_data) +{ + g_main_loop_quit (loop); + return FALSE; +} + +int +main (int argc, char **argv) +{ + Dispatcher *d = g_malloc0 (sizeof (Dispatcher)); + GOptionContext *opt_ctx; + GError *error = NULL; + gboolean persist = FALSE; + + GOptionEntry entries[] = { + { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, "Output to console rather than syslog", NULL }, + { "persist", 0, 0, G_OPTION_ARG_NONE, &persist, "Don't quit after a short timeout", NULL }, + { NULL } + }; + + opt_ctx = g_option_context_new (NULL); + g_option_context_set_summary (opt_ctx, "Executes scripts upon actions by NetworkManager."); + g_option_context_add_main_entries (opt_ctx, entries, NULL); + + if (!g_option_context_parse (opt_ctx, &argc, &argv, &error)) { + g_warning ("%s\n", error->message); + g_error_free (error); + g_free (d); + return 1; + } + + g_option_context_free (opt_ctx); + + g_type_init (); + setup_signals (); + + if (!debug) + logging_setup (); + + loop = g_main_loop_new (NULL, FALSE); + + if (!dbus_init (d)) + return -1; + if (!start_dbus_service (d)) + return -1; + + d->persist = persist; + d->handler = g_object_new (HANDLER_TYPE, NULL); + if (!d->handler) + return -1; + g_object_set_data (G_OBJECT (d->handler), "dispatcher", d); + + dbus_g_object_type_install_info (HANDLER_TYPE, &dbus_glib_nm_dispatcher_object_info); + dbus_g_connection_register_g_object (d->g_connection, + NM_DISPATCHER_DBUS_PATH, + G_OBJECT (d->handler)); + + if (!persist) + d->quit_timeout = g_timeout_add_seconds (10, quit_timeout_cb, NULL); + + g_main_loop_run (loop); + + g_object_unref (d->handler); + dbus_g_connection_unref (d->g_connection); + g_free (d); + + if (!debug) + logging_shutdown (); + + return 0; +} + diff --git a/callouts/nm-dispatcher-action.h b/callouts/nm-dispatcher-action.h new file mode 100644 index 00000000..39aefd8f --- /dev/null +++ b/callouts/nm-dispatcher-action.h @@ -0,0 +1,33 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#define NM_DISPATCHER_DBUS_SERVICE "org.freedesktop.nm_dispatcher" +#define NM_DISPATCHER_DBUS_IFACE "org.freedesktop.nm_dispatcher" +#define NM_DISPATCHER_DBUS_PATH "/org/freedesktop/nm_dispatcher" + +#define NMD_CONNECTION_PROPS_SERVICE_NAME "service-name" +#define NMD_CONNECTION_PROPS_PATH "path" + +#define NMD_DEVICE_PROPS_INTERFACE "interface" +#define NMD_DEVICE_PROPS_IP_INTERFACE "ip-interface" +#define NMD_DEVICE_PROPS_TYPE "type" +#define NMD_DEVICE_PROPS_STATE "state" +#define NMD_DEVICE_PROPS_PATH "path" + diff --git a/callouts/nm-dispatcher.conf b/callouts/nm-dispatcher.conf new file mode 100644 index 00000000..fd2f0e5a --- /dev/null +++ b/callouts/nm-dispatcher.conf @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/callouts/nm-dispatcher.xml b/callouts/nm-dispatcher.xml new file mode 100644 index 00000000..532ae9f3 --- /dev/null +++ b/callouts/nm-dispatcher.xml @@ -0,0 +1,37 @@ + + + + + + + + INTERNAL; not public API. Perform an action. + + + + + The action being performed. + + + + + + The connection for which this action was triggered. + + + + + + Properties of the connection, including service and path. + + + + + + Properties of the device, including type, path, interface, and state. + + + + + + diff --git a/callouts/org.freedesktop.nm_dispatcher.service.in b/callouts/org.freedesktop.nm_dispatcher.service.in new file mode 100644 index 00000000..b8f5bd1a --- /dev/null +++ b/callouts/org.freedesktop.nm_dispatcher.service.in @@ -0,0 +1,5 @@ +[D-BUS Service] +Name=org.freedesktop.nm_dispatcher +Exec=@libexecdir@/nm-dispatcher.action +User=root + diff --git a/cli/Makefile.am b/cli/Makefile.am new file mode 100644 index 00000000..f2689244 --- /dev/null +++ b/cli/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src + diff --git a/cli/Makefile.in b/cli/Makefile.in new file mode 100644 index 00000000..b4274994 --- /dev/null +++ b/cli/Makefile.in @@ -0,0 +1,620 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = cli +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = src +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cli/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu cli/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am new file mode 100644 index 00000000..572e122f --- /dev/null +++ b/cli/src/Makefile.am @@ -0,0 +1,38 @@ +bin_PROGRAMS = \ + nmcli + +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib + +nmcli_SOURCES = \ + connections.c \ + connections.h \ + devices.c \ + devices.h \ + network-manager.c \ + network-manager.h \ + settings.c \ + settings.h \ + nmcli.c \ + nmcli.h \ + utils.c \ + utils.h + +nmcli_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DNMCLI_LOCALEDIR=\"$(datadir)/locale\" \ + -DG_DISABLE_DEPRECATED + +nmcli_LDADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la + + diff --git a/cli/src/Makefile.in b/cli/src/Makefile.in new file mode 100644 index 00000000..4d26da6d --- /dev/null +++ b/cli/src/Makefile.in @@ -0,0 +1,703 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = nmcli$(EXEEXT) +subdir = cli/src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_nmcli_OBJECTS = nmcli-connections.$(OBJEXT) nmcli-devices.$(OBJEXT) \ + nmcli-network-manager.$(OBJEXT) nmcli-settings.$(OBJEXT) \ + nmcli-nmcli.$(OBJEXT) nmcli-utils.$(OBJEXT) +nmcli_OBJECTS = $(am_nmcli_OBJECTS) +am__DEPENDENCIES_1 = +nmcli_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(nmcli_SOURCES) +DIST_SOURCES = $(nmcli_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib + +nmcli_SOURCES = \ + connections.c \ + connections.h \ + devices.c \ + devices.h \ + network-manager.c \ + network-manager.h \ + settings.c \ + settings.h \ + nmcli.c \ + nmcli.h \ + utils.c \ + utils.h + +nmcli_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DNMCLI_LOCALEDIR=\"$(datadir)/locale\" \ + -DG_DISABLE_DEPRECATED + +nmcli_LDADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cli/src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu cli/src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +nmcli$(EXEEXT): $(nmcli_OBJECTS) $(nmcli_DEPENDENCIES) + @rm -f nmcli$(EXEEXT) + $(LINK) $(nmcli_OBJECTS) $(nmcli_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-connections.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-devices.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-network-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-nmcli.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-settings.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-utils.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +nmcli-connections.o: connections.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-connections.o -MD -MP -MF $(DEPDIR)/nmcli-connections.Tpo -c -o nmcli-connections.o `test -f 'connections.c' || echo '$(srcdir)/'`connections.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-connections.Tpo $(DEPDIR)/nmcli-connections.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='connections.c' object='nmcli-connections.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-connections.o `test -f 'connections.c' || echo '$(srcdir)/'`connections.c + +nmcli-connections.obj: connections.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-connections.obj -MD -MP -MF $(DEPDIR)/nmcli-connections.Tpo -c -o nmcli-connections.obj `if test -f 'connections.c'; then $(CYGPATH_W) 'connections.c'; else $(CYGPATH_W) '$(srcdir)/connections.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-connections.Tpo $(DEPDIR)/nmcli-connections.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='connections.c' object='nmcli-connections.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-connections.obj `if test -f 'connections.c'; then $(CYGPATH_W) 'connections.c'; else $(CYGPATH_W) '$(srcdir)/connections.c'; fi` + +nmcli-devices.o: devices.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-devices.o -MD -MP -MF $(DEPDIR)/nmcli-devices.Tpo -c -o nmcli-devices.o `test -f 'devices.c' || echo '$(srcdir)/'`devices.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-devices.Tpo $(DEPDIR)/nmcli-devices.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='devices.c' object='nmcli-devices.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-devices.o `test -f 'devices.c' || echo '$(srcdir)/'`devices.c + +nmcli-devices.obj: devices.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-devices.obj -MD -MP -MF $(DEPDIR)/nmcli-devices.Tpo -c -o nmcli-devices.obj `if test -f 'devices.c'; then $(CYGPATH_W) 'devices.c'; else $(CYGPATH_W) '$(srcdir)/devices.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-devices.Tpo $(DEPDIR)/nmcli-devices.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='devices.c' object='nmcli-devices.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-devices.obj `if test -f 'devices.c'; then $(CYGPATH_W) 'devices.c'; else $(CYGPATH_W) '$(srcdir)/devices.c'; fi` + +nmcli-network-manager.o: network-manager.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-network-manager.o -MD -MP -MF $(DEPDIR)/nmcli-network-manager.Tpo -c -o nmcli-network-manager.o `test -f 'network-manager.c' || echo '$(srcdir)/'`network-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-network-manager.Tpo $(DEPDIR)/nmcli-network-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network-manager.c' object='nmcli-network-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-network-manager.o `test -f 'network-manager.c' || echo '$(srcdir)/'`network-manager.c + +nmcli-network-manager.obj: network-manager.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-network-manager.obj -MD -MP -MF $(DEPDIR)/nmcli-network-manager.Tpo -c -o nmcli-network-manager.obj `if test -f 'network-manager.c'; then $(CYGPATH_W) 'network-manager.c'; else $(CYGPATH_W) '$(srcdir)/network-manager.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-network-manager.Tpo $(DEPDIR)/nmcli-network-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network-manager.c' object='nmcli-network-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-network-manager.obj `if test -f 'network-manager.c'; then $(CYGPATH_W) 'network-manager.c'; else $(CYGPATH_W) '$(srcdir)/network-manager.c'; fi` + +nmcli-settings.o: settings.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-settings.o -MD -MP -MF $(DEPDIR)/nmcli-settings.Tpo -c -o nmcli-settings.o `test -f 'settings.c' || echo '$(srcdir)/'`settings.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-settings.Tpo $(DEPDIR)/nmcli-settings.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='settings.c' object='nmcli-settings.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-settings.o `test -f 'settings.c' || echo '$(srcdir)/'`settings.c + +nmcli-settings.obj: settings.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-settings.obj -MD -MP -MF $(DEPDIR)/nmcli-settings.Tpo -c -o nmcli-settings.obj `if test -f 'settings.c'; then $(CYGPATH_W) 'settings.c'; else $(CYGPATH_W) '$(srcdir)/settings.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-settings.Tpo $(DEPDIR)/nmcli-settings.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='settings.c' object='nmcli-settings.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-settings.obj `if test -f 'settings.c'; then $(CYGPATH_W) 'settings.c'; else $(CYGPATH_W) '$(srcdir)/settings.c'; fi` + +nmcli-nmcli.o: nmcli.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-nmcli.o -MD -MP -MF $(DEPDIR)/nmcli-nmcli.Tpo -c -o nmcli-nmcli.o `test -f 'nmcli.c' || echo '$(srcdir)/'`nmcli.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-nmcli.Tpo $(DEPDIR)/nmcli-nmcli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nmcli.c' object='nmcli-nmcli.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-nmcli.o `test -f 'nmcli.c' || echo '$(srcdir)/'`nmcli.c + +nmcli-nmcli.obj: nmcli.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-nmcli.obj -MD -MP -MF $(DEPDIR)/nmcli-nmcli.Tpo -c -o nmcli-nmcli.obj `if test -f 'nmcli.c'; then $(CYGPATH_W) 'nmcli.c'; else $(CYGPATH_W) '$(srcdir)/nmcli.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-nmcli.Tpo $(DEPDIR)/nmcli-nmcli.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nmcli.c' object='nmcli-nmcli.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-nmcli.obj `if test -f 'nmcli.c'; then $(CYGPATH_W) 'nmcli.c'; else $(CYGPATH_W) '$(srcdir)/nmcli.c'; fi` + +nmcli-utils.o: utils.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-utils.o -MD -MP -MF $(DEPDIR)/nmcli-utils.Tpo -c -o nmcli-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-utils.Tpo $(DEPDIR)/nmcli-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='nmcli-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c + +nmcli-utils.obj: utils.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-utils.obj -MD -MP -MF $(DEPDIR)/nmcli-utils.Tpo -c -o nmcli-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nmcli-utils.Tpo $(DEPDIR)/nmcli-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='nmcli-utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/cli/src/connections.c b/cli/src/connections.c new file mode 100644 index 00000000..e9aa597d --- /dev/null +++ b/cli/src/connections.c @@ -0,0 +1,1642 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include + +#include "utils.h" +#include "settings.h" +#include "connections.h" + + +/* Available fields for 'con status' */ +static NmcOutputField nmc_fields_con_status[] = { + {"NAME", N_("NAME"), 25, NULL, 0}, /* 0 */ + {"UUID", N_("UUID"), 38, NULL, 0}, /* 1 */ + {"DEVICES", N_("DEVICES"), 10, NULL, 0}, /* 2 */ + {"SCOPE", N_("SCOPE"), 8, NULL, 0}, /* 3 */ + {"DEFAULT", N_("DEFAULT"), 8, NULL, 0}, /* 4 */ + {"DBUS-SERVICE", N_("DBUS-SERVICE"), 45, NULL, 0}, /* 5 */ + {"SPEC-OBJECT", N_("SPEC-OBJECT"), 10, NULL, 0}, /* 6 */ + {"VPN", N_("VPN"), 5, NULL, 0}, /* 7 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN,DBUS-SERVICE,SPEC-OBJECT" +#define NMC_FIELDS_CON_STATUS_COMMON "NAME,UUID,DEVICES,SCOPE,DEFAULT,VPN" + +/* Available fields for 'con list' */ +static NmcOutputField nmc_fields_con_list[] = { + {"NAME", N_("NAME"), 25, NULL, 0}, /* 0 */ + {"UUID", N_("UUID"), 38, NULL, 0}, /* 1 */ + {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 2 */ + {"SCOPE", N_("SCOPE"), 8, NULL, 0}, /* 3 */ + {"TIMESTAMP", N_("TIMESTAMP"), 12, NULL, 0}, /* 4 */ + {"TIMESTAMP-REAL", N_("TIMESTAMP-REAL"), 34, NULL, 0}, /* 5 */ + {"AUTOCONNECT", N_("AUTOCONNECT"), 13, NULL, 0}, /* 6 */ + {"READONLY", N_("READONLY"), 10, NULL, 0}, /* 7 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_CON_LIST_ALL "NAME,UUID,TYPE,SCOPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,READONLY" +#define NMC_FIELDS_CON_LIST_COMMON "NAME,UUID,TYPE,SCOPE,TIMESTAMP-REAL" + + +/* Helper macro to define fields */ +#define SETTING_FIELD(setting, width) { setting, N_(setting), width, NULL, 0 } + +/* Available settings for 'con list id/uuid ' */ +static NmcOutputField nmc_fields_settings_names[] = { + SETTING_FIELD (NM_SETTING_CONNECTION_SETTING_NAME, 0), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRED_SETTING_NAME, 0), /* 1 */ + SETTING_FIELD (NM_SETTING_802_1X_SETTING_NAME, 0), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SETTING_NAME, 0), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, 0), /* 4 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_SETTING_NAME, 0), /* 5 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_SETTING_NAME, 0), /* 6 */ + SETTING_FIELD (NM_SETTING_SERIAL_SETTING_NAME, 0), /* 7 */ + SETTING_FIELD (NM_SETTING_PPP_SETTING_NAME, 0), /* 8 */ + SETTING_FIELD (NM_SETTING_PPPOE_SETTING_NAME, 0), /* 9 */ + SETTING_FIELD (NM_SETTING_GSM_SETTING_NAME, 0), /* 10 */ + SETTING_FIELD (NM_SETTING_CDMA_SETTING_NAME, 0), /* 11 */ + SETTING_FIELD (NM_SETTING_BLUETOOTH_SETTING_NAME, 0), /* 12 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 13 */ + SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0), /* 14 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTINGS_NAMES_ALL NM_SETTING_CONNECTION_SETTING_NAME","\ + NM_SETTING_WIRED_SETTING_NAME","\ + NM_SETTING_802_1X_SETTING_NAME","\ + NM_SETTING_WIRELESS_SETTING_NAME","\ + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME","\ + NM_SETTING_IP4_CONFIG_SETTING_NAME","\ + NM_SETTING_IP6_CONFIG_SETTING_NAME","\ + NM_SETTING_SERIAL_SETTING_NAME","\ + NM_SETTING_PPP_SETTING_NAME","\ + NM_SETTING_PPPOE_SETTING_NAME","\ + NM_SETTING_GSM_SETTING_NAME","\ + NM_SETTING_CDMA_SETTING_NAME","\ + NM_SETTING_BLUETOOTH_SETTING_NAME","\ + NM_SETTING_OLPC_MESH_SETTING_NAME","\ + NM_SETTING_VPN_SETTING_NAME + + +typedef struct { + NmCli *nmc; + int argc; + char **argv; +} ArgsInfo; + +extern GMainLoop *loop; /* glib main loop variable */ + +static ArgsInfo args_info; + +/* static function prototypes */ +static void usage (void); +static void quit (void); +static void show_connection (NMConnection *data, gpointer user_data); +static NMConnection *find_connection (GSList *list, const char *filter_type, const char *filter_val); +static gboolean find_device_for_connection (NmCli *nmc, NMConnection *connection, const char *iface, const char *ap, + NMDevice **device, const char **spec_object, GError **error); +static const char *active_connection_state_to_string (NMActiveConnectionState state); +static void active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpointer user_data); +static void activate_connection_cb (gpointer user_data, const char *path, GError *error); +static void get_connections_cb (NMSettingsInterface *settings, gpointer user_data); +static NMCResultCode do_connections_list (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_connections_status (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_connection_up (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_connection_down (NmCli *nmc, int argc, char **argv); + +static void +usage (void) +{ + fprintf (stderr, + _("Usage: nmcli con { COMMAND | help }\n" + " COMMAND := { list | status | up | down }\n\n" + " list [id | uuid | system | user]\n" + " status\n" + " up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" + " down id | uuid \n")); +} + +/* quit main loop */ +static void +quit (void) +{ + g_main_loop_quit (loop); /* quit main loop */ +} + +static gboolean +nmc_connection_detail (NMConnection *connection, NmCli *nmc) +{ + NMSetting *setting; + GError *error = NULL; + GArray *print_settings_array; + int i; + char *fields_str; + char *fields_all = NMC_FIELDS_SETTINGS_NAMES_ALL; + char *fields_common = NMC_FIELDS_SETTINGS_NAMES_ALL; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + gboolean was_output = FALSE; + + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + print_settings_array = parse_output_fields (fields_str, nmc_fields_settings_names, &error); + if (error) { + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'con list': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'con list': %s; allowed fields: %s"), error->message, NMC_FIELDS_SETTINGS_NAMES_ALL); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return FALSE; + } + + nmc->allowed_fields = nmc_fields_settings_names; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ONLY; + nmc->print_fields.header_name = _("Connection details"); + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTINGS_NAMES_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); + + /* Loop through the required settings and print them. */ + for (i = 0; i < print_settings_array->len; i++) { + int section_idx = g_array_index (print_settings_array, int, i); + + if (nmc->print_output != NMC_PRINT_TERSE && !nmc->multiline_output && was_output) + printf ("\n"); /* Empty line */ + + was_output = FALSE; + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[0].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (setting) { + setting_connection_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[1].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + if (setting) { + setting_wired_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[2].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + if (setting) { + setting_802_1X_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[3].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + if (setting) { + setting_wireless_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[4].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); + if (setting) { + setting_wireless_security_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[5].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (setting) { + setting_ip4_config_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[6].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (setting) { + setting_ip6_config_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[7].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL); + if (setting) { + setting_serial_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[8].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP); + if (setting) { + setting_ppp_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[9].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE); + if (setting) { + setting_pppoe_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[10].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); + if (setting) { + setting_gsm_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[11].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA); + if (setting) { + setting_cdma_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[12].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + if (setting) { + setting_bluetooth_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[13].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH); + if (setting) { + setting_olpc_mesh_details (setting, nmc); + was_output = TRUE; + continue; + } + } + + if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[14].name)) { + setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); + if (setting) { + setting_vpn_details (setting, nmc); + was_output = TRUE; + continue; + } + } + } + + if (print_settings_array) + g_array_free (print_settings_array, FALSE); + + return NMC_RESULT_SUCCESS; +} + +static void +show_connection (NMConnection *data, gpointer user_data) +{ + NMConnection *connection = (NMConnection *) data; + NmCli *nmc = (NmCli *) user_data; + NMSettingConnection *s_con; + guint64 timestamp; + char *timestamp_str; + char timestamp_real_str[64]; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + /* Obtain field values */ + timestamp = nm_setting_connection_get_timestamp (s_con); + timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp); + strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c", localtime ((time_t *) ×tamp)); + nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con); + nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con); + nmc->allowed_fields[2].value = nm_setting_connection_get_connection_type (s_con); + nmc->allowed_fields[3].value = nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM ? _("system") : _("user"); + nmc->allowed_fields[4].value = timestamp_str; + nmc->allowed_fields[5].value = timestamp ? timestamp_real_str : _("never"); + nmc->allowed_fields[6].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); + nmc->allowed_fields[7].value = nm_setting_connection_get_read_only (s_con) ? _("yes") : _("no"); + + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + print_fields (nmc->print_fields, nmc->allowed_fields); + + g_free (timestamp_str); + } +} + +static NMConnection * +find_connection (GSList *list, const char *filter_type, const char *filter_val) +{ + NMSettingConnection *s_con; + NMConnection *connection; + GSList *iterator; + const char *id; + const char *uuid; + + iterator = list; + while (iterator) { + connection = NM_CONNECTION (iterator->data); + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + id = nm_setting_connection_get_id (s_con); + uuid = nm_setting_connection_get_uuid (s_con); + if (filter_type) { + if ((strcmp (filter_type, "id") == 0 && strcmp (filter_val, id) == 0) || + (strcmp (filter_type, "uuid") == 0 && strcmp (filter_val, uuid) == 0)) { + return connection; + } + } + } + iterator = g_slist_next (iterator); + } + + return NULL; +} + +static NMCResultCode +do_connections_list (NmCli *nmc, int argc, char **argv) +{ + GError *error1 = NULL; + GError *error2 = NULL; + char *fields_str; + char *fields_all = NMC_FIELDS_CON_LIST_ALL; + char *fields_common = NMC_FIELDS_CON_LIST_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + gboolean valid_param_specified = FALSE; + + nmc->should_wait = FALSE; + + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + nmc->allowed_fields = nmc_fields_con_list; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error1); + /* error1 is checked later - it's not valid for connection details */ + + if (argc == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error2)) + goto error; + if (error1) + goto error; + valid_param_specified = TRUE; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("System connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + g_slist_foreach (nmc->system_connections, (GFunc) show_connection, nmc); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("User connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + g_slist_foreach (nmc->user_connections, (GFunc) show_connection, nmc); + } + else { + while (argc > 0) { + if (strcmp (*argv, "id") == 0 || strcmp (*argv, "uuid") == 0) { + const char *selector = *argv; + NMConnection *con1; + NMConnection *con2; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + valid_param_specified = TRUE; + if (!nmc->mode_specified) + nmc->multiline_output = TRUE; /* multiline mode is default for 'con list id|uuid' */ + + con1 = find_connection (nmc->system_connections, selector, *argv); + con2 = find_connection (nmc->user_connections, selector, *argv); + if (con1) nmc_connection_detail (con1, nmc); + if (con2) nmc_connection_detail (con2, nmc); + if (!con1 && !con2) { + g_string_printf (nmc->return_text, _("Error: %s - no such connection."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } + break; + } + else if (strcmp (*argv, "system") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error2)) + goto error; + if (error1) + goto error; + valid_param_specified = TRUE; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("System connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + g_slist_foreach (nmc->system_connections, (GFunc) show_connection, nmc); + break; + } + else if (strcmp (*argv, "user") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error2)) + goto error; + if (error1) + goto error; + valid_param_specified = TRUE; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("User connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + g_slist_foreach (nmc->user_connections, (GFunc) show_connection, nmc); + break; + } + else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + } + + if (!valid_param_specified) { + g_string_printf (nmc->return_text, _("Error: no valid parameter specified.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + } + return nmc->return_value; + +error: + if (error1) { + if (error1->code == 0) + g_string_printf (nmc->return_text, _("Error: 'con list': %s"), error1->message); + else + g_string_printf (nmc->return_text, _("Error: 'con list': %s; allowed fields: %s"), error1->message, NMC_FIELDS_CON_LIST_ALL); + g_error_free (error1); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + } + if (error2) { + g_string_printf (nmc->return_text, _("Error: %s."), error2->message); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + g_error_free (error2); + } + + return nmc->return_value; +} + +typedef struct { + NmCli *nmc; + NMConnectionScope scope; +} StatusInfo; + +static void +show_active_connection (gpointer data, gpointer user_data) +{ + NMActiveConnection *active = NM_ACTIVE_CONNECTION (data); + StatusInfo *info = (StatusInfo *) user_data; + GSList *con_list, *iter; + const char *active_path; + NMConnectionScope active_service_scope; + NMSettingConnection *s_con; + const GPtrArray *devices; + GString *dev_str; + int i; + + active_path = nm_active_connection_get_connection (active); + active_service_scope = nm_active_connection_get_scope (active); + + if (active_service_scope != info->scope) + return; + + /* Get devices of the active connection */ + dev_str = g_string_new (NULL); + devices = nm_active_connection_get_devices (active); + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *device = g_ptr_array_index (devices, i); + + g_string_append (dev_str, nm_device_get_iface (device)); + g_string_append_c (dev_str, ','); + } + if (dev_str->len > 0) + g_string_truncate (dev_str, dev_str->len - 1); /* Cut off last ',' */ + + con_list = (info->scope == NM_CONNECTION_SCOPE_SYSTEM) ? info->nmc->system_connections : info->nmc->user_connections; + for (iter = con_list; iter; iter = g_slist_next (iter)) { + NMConnection *connection = (NMConnection *) iter->data; + const char *con_path = nm_connection_get_path (connection); + + if (!strcmp (active_path, con_path)) { + /* This connection is active */ + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con != NULL); + + /* Obtain field values */ + info->nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con); + info->nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con); + info->nmc->allowed_fields[2].value = dev_str->str; + info->nmc->allowed_fields[3].value = active_service_scope == NM_CONNECTION_SCOPE_SYSTEM ? _("system") : _("user"); + info->nmc->allowed_fields[4].value = nm_active_connection_get_default (active) ? _("yes") : _("no"); + info->nmc->allowed_fields[5].value = nm_active_connection_get_service_name (active); + info->nmc->allowed_fields[6].value = nm_active_connection_get_specific_object (active); + info->nmc->allowed_fields[7].value = NM_IS_VPN_CONNECTION (active) ? _("yes") : _("no"); + + info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + print_fields (info->nmc->print_fields, info->nmc->allowed_fields); + break; + } + } + + g_string_free (dev_str, TRUE); +} + +static NMCResultCode +do_connections_status (NmCli *nmc, int argc, char **argv) +{ + const GPtrArray *active_cons; + GError *error = NULL; + StatusInfo *info; + char *fields_str; + char *fields_all = NMC_FIELDS_CON_STATUS_ALL; + char *fields_common = NMC_FIELDS_CON_STATUS_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + nmc->should_wait = FALSE; + + /* create NMClient */ + if (!nmc->get_client (nmc)) + return nmc->return_value; + + active_cons = nm_client_get_active_connections (nmc->client); + + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + nmc->allowed_fields = nmc_fields_con_status; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); + + if (error) { + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'con status': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'con status': %s; allowed fields: %s"), error->message, NMC_FIELDS_CON_STATUS_ALL); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("Active connections"); + print_fields (nmc->print_fields, nmc->allowed_fields); + + if (active_cons && active_cons->len) { + info = g_malloc0 (sizeof (StatusInfo)); + info->nmc = nmc; + info->scope = NM_CONNECTION_SCOPE_SYSTEM; + g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) info); + info->scope = NM_CONNECTION_SCOPE_USER; + g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) info); + g_free (info); + } + +error: + + return nmc->return_value; +} + +/* -------------------- + * These function should be moved to libnm-glib in the end. + */ +static gboolean +check_ethernet_compatible (NMDeviceEthernet *device, NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + NMSettingWired *s_wired; + const char *connection_type; + gboolean is_pppoe = FALSE; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + connection_type = nm_setting_connection_get_connection_type (s_con); + if ( strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME) + && strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) { + g_set_error (error, 0, 0, + "The connection was not a wired or PPPoE connection."); + return FALSE; + } + + if (!strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) + is_pppoe = TRUE; + + s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + /* Wired setting is optional for PPPoE */ + if (!is_pppoe && !s_wired) { + g_set_error (error, 0, 0, + "The connection was not a valid wired connection."); + return FALSE; + } + + if (s_wired) { + const GByteArray *mac; + const char *device_mac_str; + struct ether_addr *device_mac; + + device_mac_str = nm_device_ethernet_get_hw_address (device); + device_mac = ether_aton (device_mac_str); + if (!device_mac) { + g_set_error (error, 0, 0, "Invalid device MAC address."); + return FALSE; + } + + mac = nm_setting_wired_get_mac_address (s_wired); + if (mac && memcmp (mac->data, device_mac->ether_addr_octet, ETH_ALEN)) { + g_set_error (error, 0, 0, + "The connection's MAC address did not match this device."); + return FALSE; + } + } + + // FIXME: check bitrate against device capabilities + + return TRUE; +} + +static gboolean +check_wifi_compatible (NMDeviceWifi *device, NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_WIRELESS_SETTING_NAME)) { + g_set_error (error, 0, 0, + "The connection was not a WiFi connection."); + return FALSE; + } + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + if (!s_wireless) { + g_set_error (error, 0, 0, + "The connection was not a valid WiFi connection."); + return FALSE; + } + + if (s_wireless) { + const GByteArray *mac; + const char *device_mac_str; + struct ether_addr *device_mac; + + device_mac_str = nm_device_wifi_get_hw_address (device); + device_mac = ether_aton (device_mac_str); + if (!device_mac) { + g_set_error (error, 0, 0, "Invalid device MAC address."); + return FALSE; + } + + mac = nm_setting_wireless_get_mac_address (s_wireless); + if (mac && memcmp (mac->data, device_mac->ether_addr_octet, ETH_ALEN)) { + g_set_error (error, 0, 0, + "The connection's MAC address did not match this device."); + return FALSE; + } + } + + // FIXME: check channel/freq/band against bands the hardware supports + // FIXME: check encryption against device capabilities + // FIXME: check bitrate against device capabilities + + return TRUE; +} + +static gboolean +check_bt_compatible (NMDeviceBt *device, NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + const GByteArray *array; + char *str; + const char *device_hw_str; + int addr_match = FALSE; + const char *bt_type_str; + guint32 bt_type, bt_capab; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_BLUETOOTH_SETTING_NAME)) { + g_set_error (error, 0, 0, + "The connection was not a Bluetooth connection."); + return FALSE; + } + + s_bt = NM_SETTING_BLUETOOTH (nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH)); + if (!s_bt) { + g_set_error (error, 0, 0, + "The connection was not a valid Bluetooth connection."); + return FALSE; + } + + array = nm_setting_bluetooth_get_bdaddr (s_bt); + if (!array || (array->len != ETH_ALEN)) { + g_set_error (error, 0, 0, + "The connection did not contain a valid Bluetooth address."); + return FALSE; + } + + bt_type_str = nm_setting_bluetooth_get_connection_type (s_bt); + g_assert (bt_type_str); + + bt_type = NM_BT_CAPABILITY_NONE; + if (!strcmp (bt_type_str, NM_SETTING_BLUETOOTH_TYPE_DUN)) + bt_type = NM_BT_CAPABILITY_DUN; + else if (!strcmp (bt_type_str, NM_SETTING_BLUETOOTH_TYPE_PANU)) + bt_type = NM_BT_CAPABILITY_NAP; + + bt_capab = nm_device_bt_get_capabilities (device); + if (!(bt_type & bt_capab)) { + g_set_error (error, 0, 0, + "The connection was not compatible with the device's capabilities."); + return FALSE; + } + + device_hw_str = nm_device_bt_get_hw_address (device); + + str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + array->data[0], array->data[1], array->data[2], + array->data[3], array->data[4], array->data[5]); + addr_match = !strcmp (device_hw_str, str); + g_free (str); + + return addr_match; +} + +#if 0 +static gboolean +check_olpc_mesh_compatible (NMDeviceOlpcMesh *device, NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + NMSettingOlpcMesh *s_mesh; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_OLPC_MESH_SETTING_NAME)) { + g_set_error (error, 0, 0, + "The connection was not a Mesh connection."); + return FALSE; + } + + s_mesh = NM_SETTING_OLPC_MESH (nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH)); + if (!s_mesh) { + g_set_error (error, 0, 0, + "The connection was not a valid Mesh connection."); + return FALSE; + } + + return TRUE; +} +#endif + +static gboolean +nm_device_is_connection_compatible (NMDevice *device, NMConnection *connection, GError **error) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + + if (NM_IS_DEVICE_ETHERNET (device)) + return check_ethernet_compatible (NM_DEVICE_ETHERNET (device), connection, error); + else if (NM_IS_DEVICE_WIFI (device)) + return check_wifi_compatible (NM_DEVICE_WIFI (device), connection, error); + else if (NM_IS_DEVICE_BT (device)) + return check_bt_compatible (NM_DEVICE_BT (device), connection, error); +// else if (NM_IS_DEVICE_OLPC_MESH (device)) +// return check_olpc_mesh_compatible (NM_DEVICE_OLPC_MESH (device), connection, error); + + g_set_error (error, 0, 0, "unhandled device type '%s'", G_OBJECT_TYPE_NAME (device)); + return FALSE; +} + + +/** + * nm_client_get_active_connection_by_path: + * @client: a #NMClient + * @object_path: the object path to search for + * + * Gets a #NMActiveConnection from a #NMClient. + * + * Returns: the #NMActiveConnection for the given @object_path or %NULL if none is found. + **/ +static NMActiveConnection * +nm_client_get_active_connection_by_path (NMClient *client, const char *object_path) +{ + const GPtrArray *actives; + int i; + NMActiveConnection *active = NULL; + + g_return_val_if_fail (NM_IS_CLIENT (client), NULL); + g_return_val_if_fail (object_path, NULL); + + actives = nm_client_get_active_connections (client); + if (!actives) + return NULL; + + for (i = 0; i < actives->len; i++) { + NMActiveConnection *candidate = g_ptr_array_index (actives, i); + if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), object_path)) { + active = candidate; + break; + } + } + + return active; +} +/* -------------------- */ + +static NMActiveConnection * +get_default_active_connection (NmCli *nmc, NMDevice **device) +{ + NMActiveConnection *default_ac = NULL; + NMDevice *non_default_device = NULL; + NMActiveConnection *non_default_ac = NULL; + const GPtrArray *connections; + int i; + + g_return_val_if_fail (nmc != NULL, NULL); + g_return_val_if_fail (device != NULL, NULL); + g_return_val_if_fail (*device == NULL, NULL); + + connections = nm_client_get_active_connections (nmc->client); + for (i = 0; connections && (i < connections->len); i++) { + NMActiveConnection *candidate = g_ptr_array_index (connections, i); + const GPtrArray *devices; + + devices = nm_active_connection_get_devices (candidate); + if (!devices || !devices->len) + continue; + + if (nm_active_connection_get_default (candidate)) { + if (!default_ac) { + *device = g_ptr_array_index (devices, 0); + default_ac = candidate; + } + } else { + if (!non_default_ac) { + non_default_device = g_ptr_array_index (devices, 0); + non_default_ac = candidate; + } + } + } + + /* Prefer the default connection if one exists, otherwise return the first + * non-default connection. + */ + if (!default_ac && non_default_ac) { + default_ac = non_default_ac; + *device = non_default_device; + } + return default_ac; +} + +/* Find a device to activate the connection on. + * IN: connection: connection to activate + * iface: device interface name to use (optional) + * ap: access point to use (optional; valid just for 802-11-wireless) + * OUT: device: found device + * spec_object: specific_object path of NMAccessPoint + * RETURNS: TRUE when a device is found, FALSE otherwise. + */ +static gboolean +find_device_for_connection (NmCli *nmc, NMConnection *connection, const char *iface, const char *ap, + NMDevice **device, const char **spec_object, GError **error) +{ + NMSettingConnection *s_con; + const char *con_type; + int i, j; + + g_return_val_if_fail (nmc != NULL, FALSE); + g_return_val_if_fail (device != NULL && *device == NULL, FALSE); + g_return_val_if_fail (spec_object != NULL && *spec_object == NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + con_type = nm_setting_connection_get_connection_type (s_con); + + if (strcmp (con_type, "vpn") == 0) { + /* VPN connections */ + NMActiveConnection *active = NULL; + if (iface) { + const GPtrArray *connections = nm_client_get_active_connections (nmc->client); + for (i = 0; connections && (i < connections->len) && !active; i++) { + NMActiveConnection *candidate = g_ptr_array_index (connections, i); + const GPtrArray *devices = nm_active_connection_get_devices (candidate); + if (!devices || !devices->len) + continue; + + for (j = 0; devices && (j < devices->len); j++) { + NMDevice *dev = g_ptr_array_index (devices, j); + if (!strcmp (iface, nm_device_get_iface (dev))) { + active = candidate; + *device = dev; + break; + } + } + } + if (!active) { + g_set_error (error, 0, 0, _("no active connection on device '%s'"), iface); + return FALSE; + } + *spec_object = nm_object_get_path (NM_OBJECT (active)); + return TRUE; + } else { + active = get_default_active_connection (nmc, device); + if (!active) { + g_set_error (error, 0, 0, _("no active connection or device")); + return FALSE; + } + *spec_object = nm_object_get_path (NM_OBJECT (active)); + return TRUE; + } + } else { + /* Other connections */ + NMDevice *found_device = NULL; + const GPtrArray *devices = nm_client_get_devices (nmc->client); + + for (i = 0; devices && (i < devices->len) && !found_device; i++) { + NMDevice *dev = g_ptr_array_index (devices, i); + + if (iface) { + const char *dev_iface = nm_device_get_iface (dev); + if ( !strcmp (dev_iface, iface) + && nm_device_is_connection_compatible (dev, connection, NULL)) { + found_device = dev; + } + } else { + if (nm_device_is_connection_compatible (dev, connection, NULL)) { + found_device = dev; + } + } + + if (found_device && ap && !strcmp (con_type, "802-11-wireless") && NM_IS_DEVICE_WIFI (dev)) { + char *hwaddr_up = g_ascii_strup (ap, -1); + const GPtrArray *aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (dev)); + found_device = NULL; /* Mark as not found; set to the device again later, only if AP matches */ + + for (j = 0; aps && (j < aps->len); j++) { + NMAccessPoint *candidate_ap = g_ptr_array_index (aps, j); + const char *candidate_hwaddr = nm_access_point_get_hw_address (candidate_ap); + + if (!strcmp (hwaddr_up, candidate_hwaddr)) { + found_device = dev; + *spec_object = nm_object_get_path (NM_OBJECT (candidate_ap)); + break; + } + } + g_free (hwaddr_up); + } + } + + if (found_device) { + *device = found_device; + return TRUE; + } else { + if (iface) + g_set_error (error, 0, 0, _("device '%s' not compatible with connection '%s'"), iface, nm_setting_connection_get_id (s_con)); + else + g_set_error (error, 0, 0, _("no device found for connection '%s'"), nm_setting_connection_get_id (s_con)); + return FALSE; + } + } +} + +static const char * +active_connection_state_to_string (NMActiveConnectionState state) +{ + switch (state) { + case NM_ACTIVE_CONNECTION_STATE_ACTIVATING: + return _("activating"); + case NM_ACTIVE_CONNECTION_STATE_ACTIVATED: + return _("activated"); + case NM_ACTIVE_CONNECTION_STATE_UNKNOWN: + default: + return _("unknown"); + } +} + +static const char * +vpn_connection_state_to_string (NMVPNConnectionState state) +{ + switch (state) { + case NM_VPN_CONNECTION_STATE_PREPARE: + return _("VPN connecting (prepare)"); + case NM_VPN_CONNECTION_STATE_NEED_AUTH: + return _("VPN connecting (need authentication)"); + case NM_VPN_CONNECTION_STATE_CONNECT: + return _("VPN connecting"); + case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: + return _("VPN connecting (getting IP configuration)"); + case NM_VPN_CONNECTION_STATE_ACTIVATED: + return _("VPN connected"); + case NM_VPN_CONNECTION_STATE_FAILED: + return _("VPN connection failed"); + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + return _("VPN disconnected"); + default: + return _("unknown"); + } +} + +static const char * +vpn_connection_state_reason_to_string (NMVPNConnectionStateReason reason) +{ + switch (reason) { + case NM_VPN_CONNECTION_STATE_REASON_UNKNOWN: + return _("unknown reason"); + case NM_VPN_CONNECTION_STATE_REASON_NONE: + return _("none"); + case NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED: + return _("the user was disconnected"); + case NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED: + return _("the base network connection was interrupted"); + case NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED: + return _("the VPN service stopped unexpectedly"); + case NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID: + return _("the VPN service returned invalid configuration"); + case NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT: + return _("the connection attempt timed out"); + case NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT: + return _("the VPN service did not start in time"); + case NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED: + return _("the VPN service failed to start"); + case NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS: + return _("no valid VPN secrets"); + case NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED: + return _("invalid VPN secrets"); + case NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED: + return _("the connection was removed"); + default: + return _("unknown"); + } +} + +static void +active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpointer user_data) +{ + NmCli *nmc = (NmCli *) user_data; + NMActiveConnectionState state; + + state = nm_active_connection_get_state (active); + + printf (_("state: %s\n"), active_connection_state_to_string (state)); + + if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { + printf (_("Connection activated\n")); + quit (); + } else if (state == NM_ACTIVE_CONNECTION_STATE_UNKNOWN) { + g_string_printf (nmc->return_text, _("Error: Connection activation failed.")); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + quit (); + } +} + +static void +vpn_connection_state_cb (NMVPNConnection *vpn, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason, + gpointer user_data) +{ + NmCli *nmc = (NmCli *) user_data; + + switch (state) { + case NM_VPN_CONNECTION_STATE_PREPARE: + case NM_VPN_CONNECTION_STATE_NEED_AUTH: + case NM_VPN_CONNECTION_STATE_CONNECT: + case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: + printf (_("state: %s (%d)\n"), vpn_connection_state_to_string (state), state); + break; + + case NM_VPN_CONNECTION_STATE_ACTIVATED: + printf (_("Connection activated\n")); + quit (); + break; + + case NM_VPN_CONNECTION_STATE_FAILED: + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + g_string_printf (nmc->return_text, _("Error: Connection activation failed: %s."), vpn_connection_state_reason_to_string (reason)); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + quit (); + break; + + default: + break; + } +} + +static gboolean +timeout_cb (gpointer user_data) +{ + /* Time expired -> exit nmcli */ + + NmCli *nmc = (NmCli *) user_data; + + g_string_printf (nmc->return_text, _("Error: Timeout %d sec expired."), nmc->timeout); + nmc->return_value = NMC_RESULT_ERROR_TIMEOUT_EXPIRED; + quit (); + return FALSE; +} + +static void +foo_active_connections_changed_cb (NMClient *client, + GParamSpec *pspec, + gpointer user_data) +{ + /* Call again activate_connection_cb with dummy arguments; + * the correct ones are taken from its first call. + */ + activate_connection_cb (NULL, NULL, NULL); +} + +static void +activate_connection_cb (gpointer user_data, const char *path, GError *error) +{ + NmCli *nmc = (NmCli *) user_data; + NMActiveConnection *active; + NMActiveConnectionState state; + static gulong handler_id = 0; + static NmCli *orig_nmc; + static const char *orig_path; + static GError *orig_error; + + if (nmc) + { + /* Called first time; store actual arguments */ + orig_nmc = nmc; + orig_path = path; + orig_error = error; + } + + /* Disconnect the handler not to be run any more */ + if (handler_id != 0) { + g_signal_handler_disconnect (orig_nmc->client, handler_id); + handler_id = 0; + } + + if (orig_error) { + g_string_printf (orig_nmc->return_text, _("Error: Connection activation failed: %s"), orig_error->message); + orig_nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + quit (); + } else { + active = nm_client_get_active_connection_by_path (orig_nmc->client, orig_path); + if (!active) { + /* The active connection path is not in active connections list yet; wait for active-connections signal. */ + /* This is basically the case for VPN connections. */ + if (nmc) { + /* Called first time, i.e. by nm_client_activate_connection() */ + handler_id = g_signal_connect (orig_nmc->client, "notify::active-connections", + G_CALLBACK (foo_active_connections_changed_cb), NULL); + return; + } else { + g_string_printf (orig_nmc->return_text, _("Error: Obtaining active connection for '%s' failed."), orig_path); + orig_nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + quit (); + return; + } + } + + state = nm_active_connection_get_state (active); + + printf (_("Active connection state: %s\n"), active_connection_state_to_string (state)); + printf (_("Active connection path: %s\n"), orig_path); + + if (!orig_nmc->should_wait || state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { + /* don't want to wait or already activated */ + quit (); + } else { + if (NM_IS_VPN_CONNECTION (active)) + g_signal_connect (NM_VPN_CONNECTION (active), "vpn-state-changed", G_CALLBACK (vpn_connection_state_cb), orig_nmc); + else + g_signal_connect (active, "notify::state", G_CALLBACK (active_connection_state_cb), orig_nmc); + + /* Start timer not to loop forever when signals are not emitted */ + g_timeout_add_seconds (orig_nmc->timeout, timeout_cb, orig_nmc); + } + } +} + +static NMCResultCode +do_connection_up (NmCli *nmc, int argc, char **argv) +{ + NMDevice *device = NULL; + const char *spec_object = NULL; + gboolean device_found; + NMConnection *connection = NULL; + NMSettingConnection *s_con; + gboolean is_system; + const char *con_path; + const char *con_type; + const char *iface = NULL; + const char *ap = NULL; + gboolean id_specified = FALSE; + gboolean wait = TRUE; + GError *error = NULL; + + /* Set default timeout for connection activation. It can take quite a long time. + * Using 90 seconds. + */ + nmc->timeout = 90; + + while (argc > 0) { + if (strcmp (*argv, "id") == 0 || strcmp (*argv, "uuid") == 0) { + const char *selector = *argv; + id_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + if ((connection = find_connection (nmc->system_connections, selector, *argv)) == NULL) + connection = find_connection (nmc->user_connections, selector, *argv); + + if (!connection) { + g_string_printf (nmc->return_text, _("Error: Unknown connection: %s."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } + else if (strcmp (*argv, "iface") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + iface = *argv; + } + else if (strcmp (*argv, "ap") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + ap = *argv; + } + else if (strcmp (*argv, "--nowait") == 0) { + wait = FALSE; + } else if (strcmp (*argv, "--timeout") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + errno = 0; + nmc->timeout = strtol (*argv, NULL, 10); + if (errno || nmc->timeout < 0) { + g_string_printf (nmc->return_text, _("Error: timeout value '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + if (!id_specified) { + g_string_printf (nmc->return_text, _("Error: id or uuid has to be specified.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + is_system = (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM) ? TRUE : FALSE; + con_path = nm_connection_get_path (connection); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + con_type = nm_setting_connection_get_connection_type (s_con); + + device_found = find_device_for_connection (nmc, connection, iface, ap, &device, &spec_object, &error); + + if (!device_found) { + if (error) + g_string_printf (nmc->return_text, _("Error: No suitable device found: %s."), error->message); + else + g_string_printf (nmc->return_text, _("Error: No suitable device found.")); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + goto error; + } + + nmc->should_wait = wait; + nm_client_activate_connection (nmc->client, + is_system ? NM_DBUS_SERVICE_SYSTEM_SETTINGS : NM_DBUS_SERVICE_USER_SETTINGS, + con_path, + device, + spec_object, + activate_connection_cb, + nmc); + + return nmc->return_value; +error: + nmc->should_wait = FALSE; + return nmc->return_value; +} + +static NMCResultCode +do_connection_down (NmCli *nmc, int argc, char **argv) +{ + NMConnection *connection = NULL; + NMActiveConnection *active = NULL; + const GPtrArray *active_cons; + const char *con_path; + const char *active_path; + NMConnectionScope active_service_scope, con_scope; + gboolean id_specified = FALSE; + gboolean wait = TRUE; + int i; + + while (argc > 0) { + if (strcmp (*argv, "id") == 0 || strcmp (*argv, "uuid") == 0) { + const char *selector = *argv; + id_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + if ((connection = find_connection (nmc->system_connections, selector, *argv)) == NULL) + connection = find_connection (nmc->user_connections, selector, *argv); + + if (!connection) { + g_string_printf (nmc->return_text, _("Error: Unknown connection: %s."), *argv); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } + else if (strcmp (*argv, "--nowait") == 0) { + wait = FALSE; + } + else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + if (!id_specified) { + g_string_printf (nmc->return_text, _("Error: id or uuid has to be specified.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + con_path = nm_connection_get_path (connection); + con_scope = nm_connection_get_scope (connection); + + active_cons = nm_client_get_active_connections (nmc->client); + for (i = 0; active_cons && (i < active_cons->len); i++) { + NMActiveConnection *candidate = g_ptr_array_index (active_cons, i); + + active_path = nm_active_connection_get_connection (candidate); + active_service_scope = nm_active_connection_get_scope (candidate); + if (!strcmp (active_path, con_path) && active_service_scope == con_scope) { + active = candidate; + break; + } + } + + if (active) + nm_client_deactivate_connection (nmc->client, active); + else { + fprintf (stderr, _("Warning: Connection not active\n")); + } + +error: + nmc->should_wait = FALSE; + return nmc->return_value; +} + +/* callback called when connections are obtained from the settings service */ +static void +get_connections_cb (NMSettingsInterface *settings, gpointer user_data) +{ + ArgsInfo *args = (ArgsInfo *) user_data; + static gboolean system_cb_called = FALSE; + static gboolean user_cb_called = FALSE; + GError *error = NULL; + + if (NM_IS_REMOTE_SETTINGS_SYSTEM (settings)) { + system_cb_called = TRUE; + args->nmc->system_connections = nm_settings_interface_list_connections (settings); + } + else { + user_cb_called = TRUE; + args->nmc->user_connections = nm_settings_interface_list_connections (settings); + } + + /* return and wait for the callback of the second settings is called */ + if ( (args->nmc->system_settings_running && !system_cb_called) + || (args->nmc->user_settings_running && !user_cb_called)) + return; + + if (args->argc == 0) { + if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) + goto opt_error; + args->nmc->return_value = do_connections_list (args->nmc, args->argc, args->argv); + } else { + + if (matches (*args->argv, "list") == 0) { + args->nmc->return_value = do_connections_list (args->nmc, args->argc-1, args->argv+1); + } + else if (matches(*args->argv, "status") == 0) { + if (!nmc_terse_option_check (args->nmc->print_output, args->nmc->required_fields, &error)) + goto opt_error; + args->nmc->return_value = do_connections_status (args->nmc, args->argc-1, args->argv+1); + } + else if (matches(*args->argv, "up") == 0) { + args->nmc->return_value = do_connection_up (args->nmc, args->argc-1, args->argv+1); + } + else if (matches(*args->argv, "down") == 0) { + args->nmc->return_value = do_connection_down (args->nmc, args->argc-1, args->argv+1); + } + else if (matches (*args->argv, "help") == 0) { + usage (); + args->nmc->should_wait = FALSE; + } else { + usage (); + g_string_printf (args->nmc->return_text, _("Error: 'con' command '%s' is not valid."), *args->argv); + args->nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + args->nmc->should_wait = FALSE; + } + } + + if (!args->nmc->should_wait) + quit (); + return; + +opt_error: + g_string_printf (args->nmc->return_text, _("Error: %s."), error->message); + args->nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + args->nmc->should_wait = FALSE; + g_error_free (error); + quit (); + return; +} + + +/* Entry point function for connections-related commands: 'nmcli con' */ +NMCResultCode +do_connections (NmCli *nmc, int argc, char **argv) +{ + DBusGConnection *bus; + GError *error = NULL; + + nmc->should_wait = TRUE; + + args_info.nmc = nmc; + args_info.argc = argc; + args_info.argv = argv; + + /* connect to DBus' system bus */ + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); + if (error || !bus) { + g_string_printf (nmc->return_text, _("Error: could not connect to D-Bus.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + + /* get system settings */ + if (!(nmc->system_settings = nm_remote_settings_system_new (bus))) { + g_string_printf (nmc->return_text, _("Error: Could not get system settings.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + + } + + /* get user settings */ + if (!(nmc->user_settings = nm_remote_settings_new (bus, NM_CONNECTION_SCOPE_USER))) { + g_string_printf (nmc->return_text, _("Error: Could not get user settings.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + + /* find out whether setting services are running */ + g_object_get (nmc->system_settings, NM_REMOTE_SETTINGS_SERVICE_RUNNING, &nmc->system_settings_running, NULL); + g_object_get (nmc->user_settings, NM_REMOTE_SETTINGS_SERVICE_RUNNING, &nmc->user_settings_running, NULL); + + if (!nmc->system_settings_running && !nmc->user_settings_running) { + g_string_printf (nmc->return_text, _("Error: Can't obtain connections: settings services are not running.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + return nmc->return_value; + } + + /* connect to signal "connections-read" - emitted when connections are fetched and ready */ + if (nmc->system_settings_running) + g_signal_connect (nmc->system_settings, NM_SETTINGS_INTERFACE_CONNECTIONS_READ, + G_CALLBACK (get_connections_cb), &args_info); + + if (nmc->user_settings_running) + g_signal_connect (nmc->user_settings, NM_SETTINGS_INTERFACE_CONNECTIONS_READ, + G_CALLBACK (get_connections_cb), &args_info); + + dbus_g_connection_unref (bus); + + /* The rest will be done in get_connection_cb() callback. + * We need to wait for signals that connections are read. + */ + return NMC_RESULT_SUCCESS; +} diff --git a/cli/src/connections.h b/cli/src/connections.h new file mode 100644 index 00000000..a1ed1c1c --- /dev/null +++ b/cli/src/connections.h @@ -0,0 +1,27 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_CONNECTIONS_H +#define NMC_CONNECTIONS_H + +#include "nmcli.h" + +NMCResultCode do_connections (NmCli *nmc, int argc, char **argv); + +#endif /* NMC_CONNECTIONS_H */ diff --git a/cli/src/devices.c b/cli/src/devices.c new file mode 100644 index 00000000..e2ce91e3 --- /dev/null +++ b/cli/src/devices.c @@ -0,0 +1,1294 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "utils.h" +#include "devices.h" + + +/* Available fields for 'dev status' */ +static NmcOutputField nmc_fields_dev_status[] = { + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 0 */ + {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 1 */ + {"STATE", N_("STATE"), 12, NULL, 0}, /* 2 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE" +#define NMC_FIELDS_DEV_STATUS_COMMON "DEVICE,TYPE,STATE" + + +/* Available sections for 'dev list' */ +static NmcOutputField nmc_fields_dev_list_sections[] = { + {"GENERAL", N_("GENERAL"), 0, NULL, 0}, /* 0 */ + {"CAPABILITIES", N_("CAPABILITIES"), 0, NULL, 0}, /* 1 */ + {"WIFI-PROPERTIES", N_("WIFI-PROPERTIES"), 0, NULL, 0}, /* 2 */ + {"AP", N_("AP"), 0, NULL, 0}, /* 3 */ + {"WIRED-PROPERTIES", N_("WIRED-PROPERTIES"), 0, NULL, 0}, /* 4 */ + {"IP4-SETTINGS", N_("IP4-SETTINGS"), 0, NULL, 0}, /* 5 */ + {"IP4-DNS", N_("IP4-DNS"), 0, NULL, 0}, /* 6 */ + {"IP6-SETTINGS", N_("IP6-SETTINGS"), 0, NULL, 0}, /* 7 */ + {"IP6-DNS", N_("IP6-DNS"), 0, NULL, 0}, /* 8 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_SECTIONS_ALL "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS,IP6-SETTINGS,IP6-DNS" +#define NMC_FIELDS_DEV_LIST_SECTIONS_COMMON "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS,IP6-SETTINGS,IP6-DNS" + +/* Available fields for 'dev list' - GENERAL part */ +static NmcOutputField nmc_fields_dev_list_general[] = { + {"NAME", N_("NAME"), 10, NULL, 0}, /* 0 */ + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 1 */ + {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 2 */ + {"DRIVER", N_("DRIVER"), 10, NULL, 0}, /* 3 */ + {"HWADDR", N_("HWADDR"), 19, NULL, 0}, /* 4 */ + {"STATE", N_("STATE"), 14, NULL, 0}, /* 5 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_GENERAL_ALL "NAME,DEVICE,TYPE,DRIVER,HWADDR,STATE" +#define NMC_FIELDS_DEV_LIST_GENERAL_COMMON "NAME,DEVICE,TYPE,DRIVER,HWADDR,STATE" + +/* Available fields for 'dev list' - CAPABILITIES part */ +static NmcOutputField nmc_fields_dev_list_cap[] = { + {"NAME", N_("NAME"), 13, NULL, 0}, /* 0 */ + {"CARRIER-DETECT", N_("CARRIER-DETECT"), 16, NULL, 0}, /* 1 */ + {"SPEED", N_("SPEED"), 10, NULL, 0}, /* 2 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_CAP_ALL "NAME,CARRIER-DETECT,SPEED" +#define NMC_FIELDS_DEV_LIST_CAP_COMMON "NAME,CARRIER-DETECT,SPEED" + +/* Available fields for 'dev list' - wired properties part */ +static NmcOutputField nmc_fields_dev_list_wired_prop[] = { + {"NAME", N_("NAME"), 18, NULL, 0}, /* 0 */ + {"CARRIER", N_("CARRIER"), 10, NULL, 0}, /* 1 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_WIRED_PROP_ALL "NAME,CARRIER" +#define NMC_FIELDS_DEV_LIST_WIRED_PROP_COMMON "NAME,CARRIER" + + +/* Available fields for 'dev list' - wireless properties part */ +static NmcOutputField nmc_fields_dev_list_wifi_prop[] = { + {"NAME", N_("NAME"), 18, NULL, 0}, /* 0 */ + {"WEP", N_("WEP"), 5, NULL, 0}, /* 1 */ + {"WPA", N_("WPA"), 5, NULL, 0}, /* 2 */ + {"WPA2", N_("WPA2"), 6, NULL, 0}, /* 3 */ + {"TKIP", N_("TKIP"), 6, NULL, 0}, /* 4 */ + {"CCMP", N_("CCMP"), 6, NULL, 0}, /* 5 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_WIFI_PROP_ALL "NAME,WEP,WPA,WPA2,TKIP,CCMP" +#define NMC_FIELDS_DEV_LIST_WIFI_PROP_COMMON "NAME,WEP,WPA,WPA2,TKIP,CCMP" + +/* Available fields for 'dev list' - IPv4 settings part */ +static NmcOutputField nmc_fields_dev_list_ip4_settings[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"ADDRESS", N_("ADDRESS"), 15, NULL, 0}, /* 1 */ + {"PREFIX", N_("PREFIX"), 20, NULL, 0}, /* 2 */ + {"GATEWAY", N_("GATEWAY"), 20, NULL, 0}, /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL "NAME,ADDRESS,PREFIX,GATEWAY" +#define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_COMMON "NAME,ADDRESS,PREFIX,GATEWAY" + +/* Available fields for 'dev list' - IPv6 settings part */ +static NmcOutputField nmc_fields_dev_list_ip6_settings[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"ADDRESS", N_("ADDRESS"), 15, NULL, 0}, /* 1 */ + {"PREFIX", N_("PREFIX"), 20, NULL, 0}, /* 2 */ + {"GATEWAY", N_("GATEWAY"), 20, NULL, 0}, /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_IP6_SETTINGS_ALL "NAME,ADDRESS,PREFIX,GATEWAY" +#define NMC_FIELDS_DEV_LIST_IP6_SETTINGS_COMMON "NAME,ADDRESS,PREFIX,GATEWAY" + +/* Available fields for 'dev list' - IPv4 settings DNS part */ +static NmcOutputField nmc_fields_dev_list_ip4_dns[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"DNS", N_("DNS"), 17, NULL, 0}, /* 1 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_IP4_DNS_ALL "NAME,DNS" +#define NMC_FIELDS_DEV_LIST_IP4_DNS_COMMON "NAME,DNS" + +/* Available fields for 'dev list' - IPv6 settings DNS part */ +static NmcOutputField nmc_fields_dev_list_ip6_dns[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"DNS", N_("DNS"), 17, NULL, 0}, /* 1 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_LIST_IP6_DNS_ALL "NAME,DNS" +#define NMC_FIELDS_DEV_LIST_IP6_DNS_COMMON "NAME,DNS" + +/* Available fields for 'dev wifi list' */ +static NmcOutputField nmc_fields_dev_wifi_list[] = { + {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */ + {"SSID", N_("SSID"), 33, NULL, 0}, /* 1 */ + {"BSSID", N_("BSSID"), 19, NULL, 0}, /* 2 */ + {"MODE", N_("MODE"), 16, NULL, 0}, /* 3 */ + {"FREQ", N_("FREQ"), 10, NULL, 0}, /* 4 */ + {"RATE", N_("RATE"), 10, NULL, 0}, /* 5 */ + {"SIGNAL", N_("SIGNAL"), 8, NULL, 0}, /* 6 */ + {"SECURITY", N_("SECURITY"), 10, NULL, 0}, /* 7 */ + {"WPA-FLAGS", N_("WPA-FLAGS"), 25, NULL, 0}, /* 8 */ + {"RSN-FLAGS", N_("RSN-FLAGS"), 25, NULL, 0}, /* 9 */ + {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 10 */ + {"ACTIVE", N_("ACTIVE"), 8, NULL, 0}, /* 11 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_DEV_WIFI_LIST_ALL "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE" +#define NMC_FIELDS_DEV_WIFI_LIST_COMMON "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,ACTIVE" +#define NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST "NAME,"NMC_FIELDS_DEV_WIFI_LIST_COMMON + + +/* static function prototypes */ +static void usage (void); +static const char *device_state_to_string (NMDeviceState state); +static NMCResultCode do_devices_status (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_devices_list (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_device_disconnect (NmCli *nmc, int argc, char **argv); +static NMCResultCode do_device_wifi (NmCli *nmc, int argc, char **argv); + + +extern GMainLoop *loop; /* glib main loop variable */ + +static void +usage (void) +{ + fprintf (stderr, + _("Usage: nmcli dev { COMMAND | help }\n\n" + " COMMAND := { status | list | disconnect | wifi }\n\n" + " status\n" + " list [iface ]\n" + " disconnect iface [--nowait] [--timeout ]\n" + " wifi [list [iface ] [hwaddr ]]\n\n")); +} + +/* quit main loop */ +static void +quit (void) +{ + g_main_loop_quit (loop); /* quit main loop */ +} + +static const char * +device_state_to_string (NMDeviceState state) +{ + switch (state) { + case NM_DEVICE_STATE_UNMANAGED: + return _("unmanaged"); + case NM_DEVICE_STATE_UNAVAILABLE: + return _("unavailable"); + case NM_DEVICE_STATE_DISCONNECTED: + return _("disconnected"); + case NM_DEVICE_STATE_PREPARE: + return _("connecting (prepare)"); + case NM_DEVICE_STATE_CONFIG: + return _("connecting (configuring)"); + case NM_DEVICE_STATE_NEED_AUTH: + return _("connecting (need authentication)"); + case NM_DEVICE_STATE_IP_CONFIG: + return _("connecting (getting IP configuration)"); + case NM_DEVICE_STATE_ACTIVATED: + return _("connected"); + case NM_DEVICE_STATE_FAILED: + return _("connection failed"); + default: + return _("unknown"); + } +} + +/* Return device type - use setting names to match with connection types */ +static const char * +get_device_type (NMDevice * device) +{ + if (NM_IS_DEVICE_ETHERNET (device)) + return NM_SETTING_WIRED_SETTING_NAME; + else if (NM_IS_DEVICE_WIFI (device)) + return NM_SETTING_WIRELESS_SETTING_NAME; + else if (NM_IS_GSM_DEVICE (device)) + return NM_SETTING_GSM_SETTING_NAME; + else if (NM_IS_CDMA_DEVICE (device)) + return NM_SETTING_CDMA_SETTING_NAME; + else if (NM_IS_DEVICE_BT (device)) + return NM_SETTING_BLUETOOTH_SETTING_NAME; +// else if (NM_IS_DEVICE_OLPC_MESH (device)) +// return NM_SETTING_OLPC_MESH_SETTING_NAME; + else + return _("Unknown"); +} + +static char * +ap_wpa_rsn_flags_to_string (guint32 flags) +{ + char *flags_str[16]; /* Enough space for flags and terminating NULL */ + char *ret_str; + int i = 0; + + if (flags & NM_802_11_AP_SEC_PAIR_WEP40) + flags_str[i++] = g_strdup ("pair_wpe40"); + if (flags & NM_802_11_AP_SEC_PAIR_WEP104) + flags_str[i++] = g_strdup ("pair_wpe104"); + if (flags & NM_802_11_AP_SEC_PAIR_TKIP) + flags_str[i++] = g_strdup ("pair_tkip"); + if (flags & NM_802_11_AP_SEC_PAIR_CCMP) + flags_str[i++] = g_strdup ("pair_ccmp"); + if (flags & NM_802_11_AP_SEC_GROUP_WEP40) + flags_str[i++] = g_strdup ("group_wpe40"); + if (flags & NM_802_11_AP_SEC_GROUP_WEP104) + flags_str[i++] = g_strdup ("group_wpe104"); + if (flags & NM_802_11_AP_SEC_GROUP_TKIP) + flags_str[i++] = g_strdup ("group_tkip"); + if (flags & NM_802_11_AP_SEC_GROUP_CCMP) + flags_str[i++] = g_strdup ("group_ccmp"); + if (flags & NM_802_11_AP_SEC_KEY_MGMT_PSK) + flags_str[i++] = g_strdup ("psk"); + if (flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) + flags_str[i++] = g_strdup ("802.1X"); + + if (i == 0) + flags_str[i++] = g_strdup (_("(none)")); + + flags_str[i] = NULL; + + ret_str = g_strjoinv (" ", flags_str); + + i = 0; + while (flags_str[i]) + g_free (flags_str[i++]); + + return ret_str; +} + +static gchar * +ip4_address_as_string (guint32 ip) +{ + struct in_addr tmp_addr; + char buf[INET_ADDRSTRLEN+1]; + + memset (&buf, '\0', sizeof (buf)); + tmp_addr.s_addr = ip; + + if (inet_ntop (AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN)) { + return g_strdup (buf); + } else { + g_warning (_("%s: error converting IP4 address 0x%X"), + __func__, ntohl (tmp_addr.s_addr)); + return NULL; + } +} + +static gchar * +ip6_address_as_string (const struct in6_addr *ip) +{ + char buf[INET6_ADDRSTRLEN]; + + memset (&buf, '\0', sizeof (buf)); + + if (inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)) { + return g_strdup (buf); + } else { + int j; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", ip->s6_addr[0]); + for (j = 1; j < 16; j++) + g_string_append_printf (ip6_str, " %02X", ip->s6_addr[j]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + return NULL; + } +} + +typedef struct { + NmCli *nmc; + int index; + const char* active_bssid; + const char* device; +} APInfo; + +static void +detail_access_point (gpointer data, gpointer user_data) +{ + NMAccessPoint *ap = NM_ACCESS_POINT (data); + APInfo *info = (APInfo *) user_data; + gboolean active = FALSE; + guint32 flags, wpa_flags, rsn_flags, freq, bitrate; + guint8 strength; + const GByteArray *ssid; + const char *hwaddr; + NM80211Mode mode; + char *freq_str, *ssid_str, *bitrate_str, *strength_str, *wpa_flags_str, *rsn_flags_str; + GString *security_str; + char *ap_name; + + if (info->active_bssid) { + const char *current_bssid = nm_access_point_get_hw_address (ap); + if (current_bssid && !strcmp (current_bssid, info->active_bssid)) + active = TRUE; + } + + /* Get AP properties */ + flags = nm_access_point_get_flags (ap); + wpa_flags = nm_access_point_get_wpa_flags (ap); + rsn_flags = nm_access_point_get_rsn_flags (ap); + ssid = nm_access_point_get_ssid (ap); + hwaddr = nm_access_point_get_hw_address (ap); + freq = nm_access_point_get_frequency (ap); + mode = nm_access_point_get_mode (ap); + bitrate = nm_access_point_get_max_bitrate (ap); + strength = nm_access_point_get_strength (ap); + + /* Convert to strings */ + ssid_str = ssid_to_printable ((const char *) ssid->data, ssid->len); + freq_str = g_strdup_printf (_("%u MHz"), freq); + bitrate_str = g_strdup_printf (_("%u MB/s"), bitrate/1000); + strength_str = g_strdup_printf ("%u", strength); + wpa_flags_str = ap_wpa_rsn_flags_to_string (wpa_flags); + rsn_flags_str = ap_wpa_rsn_flags_to_string (rsn_flags); + + security_str = g_string_new (NULL); + if ( !(flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags != NM_802_11_AP_SEC_NONE) + && (rsn_flags != NM_802_11_AP_SEC_NONE)) + g_string_append (security_str, _("Encrypted: ")); + + if ( (flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags == NM_802_11_AP_SEC_NONE) + && (rsn_flags == NM_802_11_AP_SEC_NONE)) + g_string_append (security_str, _("WEP ")); + if (wpa_flags != NM_802_11_AP_SEC_NONE) + g_string_append (security_str, _("WPA ")); + if (rsn_flags != NM_802_11_AP_SEC_NONE) + g_string_append (security_str, _("WPA2 ")); + if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) + || (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + g_string_append (security_str, _("Enterprise ")); + + if (security_str->len > 0) + g_string_truncate (security_str, security_str->len-1); /* Chop off last space */ + + ap_name = g_strdup_printf ("AP%d", info->index++); /* AP */ + info->nmc->allowed_fields[0].value = ap_name; + info->nmc->allowed_fields[1].value = ssid_str; + info->nmc->allowed_fields[2].value = hwaddr; + info->nmc->allowed_fields[3].value = mode == NM_802_11_MODE_ADHOC ? _("Ad-Hoc") : mode == NM_802_11_MODE_INFRA ? _("Infrastructure") : _("Unknown"); + info->nmc->allowed_fields[4].value = freq_str; + info->nmc->allowed_fields[5].value = bitrate_str; + info->nmc->allowed_fields[6].value = strength_str; + info->nmc->allowed_fields[7].value = security_str->str; + info->nmc->allowed_fields[8].value = wpa_flags_str; + info->nmc->allowed_fields[9].value = rsn_flags_str; + info->nmc->allowed_fields[10].value = info->device; + info->nmc->allowed_fields[11].value = active ? _("yes") : _("no"); + + info->nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + print_fields (info->nmc->print_fields, info->nmc->allowed_fields); + + g_free (ap_name); + g_free (ssid_str); + g_free (freq_str); + g_free (bitrate_str); + g_free (strength_str); + g_free (wpa_flags_str); + g_free (rsn_flags_str); + g_string_free (security_str, TRUE); +} + +struct cb_info { + NMClient *client; + const GPtrArray *active; +}; + +static void +show_device_info (gpointer data, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (data); + NmCli *nmc = (NmCli *) user_data; + GError *error = NULL; + APInfo *info; + char *tmp; + const char *hwaddr = NULL; + NMDeviceState state = NM_DEVICE_STATE_UNKNOWN; + guint32 caps; + guint32 speed; + char *speed_str = NULL; + const GArray *array; + GArray *sections_array; + int k; + char *fields_str; + char *fields_all = NMC_FIELDS_DEV_LIST_SECTIONS_ALL; + char *fields_common = NMC_FIELDS_DEV_LIST_SECTIONS_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + gboolean was_output = FALSE; + + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + sections_array = parse_output_fields (fields_str, nmc_fields_dev_list_sections, &error); + if (error) { + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'dev list': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'dev list': %s; allowed fields: %s"), error->message, NMC_FIELDS_DEV_LIST_SECTIONS_ALL); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return; + } + + /* Main header */ + nmc->allowed_fields = nmc_fields_dev_list_general; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ONLY; + nmc->print_fields.header_name = _("Device details"); + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_GENERAL_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + /* Loop through the required sections and print them. */ + for (k = 0; k < sections_array->len; k++) { + int section_idx = g_array_index (sections_array, int, k); + + if (nmc->print_output != NMC_PRINT_TERSE && !nmc->multiline_output && was_output) + printf ("\n"); /* Empty line */ + + was_output = FALSE; + + state = nm_device_get_state (device); + + /* section GENERAL */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[0].name)) { + nmc->allowed_fields = nmc_fields_dev_list_general; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_GENERAL_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + if (NM_IS_DEVICE_ETHERNET (device)) + hwaddr = nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device)); + else if (NM_IS_DEVICE_WIFI (device)) + hwaddr = nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device)); + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[0].name; /* "GENERAL"*/ + nmc->allowed_fields[1].value = nm_device_get_iface (device); + nmc->allowed_fields[2].value = get_device_type (device); + nmc->allowed_fields[3].value = nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)"); + nmc->allowed_fields[4].value = hwaddr ? hwaddr : _("unknown)"); + nmc->allowed_fields[5].value = device_state_to_string (state); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + was_output = TRUE; + } + + /* section CAPABILITIES */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[1].name)) { + nmc->allowed_fields = nmc_fields_dev_list_cap; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_CAP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + caps = nm_device_get_capabilities (device); + speed = 0; + if (NM_IS_DEVICE_ETHERNET (device)) { + /* Speed in Mb/s */ + speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (device)); + } else if (NM_IS_DEVICE_WIFI (device)) { + /* Speed in b/s */ + speed = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI (device)); + speed /= 1000; + } + if (speed) + speed_str = g_strdup_printf (_("%u Mb/s"), speed); + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[1].name; /* "CAPABILITIES" */ + nmc->allowed_fields[1].value = (caps & NM_DEVICE_CAP_CARRIER_DETECT) ? _("yes") : _("no"); + nmc->allowed_fields[2].value = speed_str ? speed_str : _("unknown"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (speed_str); + was_output = TRUE; + } + + /* Wireless specific information */ + if ((NM_IS_DEVICE_WIFI (device))) { + guint32 wcaps; + NMAccessPoint *active_ap = NULL; + const char *active_bssid = NULL; + const GPtrArray *aps; + + /* section WIFI-PROPERTIES */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[2].name)) { + wcaps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device)); + + nmc->allowed_fields = nmc_fields_dev_list_wifi_prop; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_WIFI_PROP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[2].name; /* "WIFI-PROPERTIES" */ + nmc->allowed_fields[1].value = (wcaps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104)) ? _("yes") : _("no"); + nmc->allowed_fields[2].value = (wcaps & NM_WIFI_DEVICE_CAP_WPA) ? _("yes") : _("no"); + nmc->allowed_fields[3].value = (wcaps & NM_WIFI_DEVICE_CAP_RSN) ? _("yes") : _("no"); + nmc->allowed_fields[4].value = (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = (wcaps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + was_output = TRUE; + } + + /* section AP */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[3].name)) { + if (state == NM_DEVICE_STATE_ACTIVATED) { + active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); + active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; + } + + nmc->allowed_fields = nmc_fields_dev_wifi_list; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->index = 1; + info->active_bssid = active_bssid; + info->device = nm_device_get_iface (device); + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + if (aps && aps->len) + g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) info); + g_free (info); + was_output = TRUE; + } + } else if (NM_IS_DEVICE_ETHERNET (device)) { + /* WIRED-PROPERTIES */ + if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[4].name)) { + nmc->allowed_fields = nmc_fields_dev_list_wired_prop; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_WIRED_PROP_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[4].name; /* "WIRED-PROPERTIES" */ + nmc->allowed_fields[1].value = (nm_device_ethernet_get_carrier (NM_DEVICE_ETHERNET (device))) ? _("on") : _("off"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + was_output = TRUE; + } + } + + /* IP Setup info */ + if (state == NM_DEVICE_STATE_ACTIVATED) { + NMIP4Config *cfg4 = nm_device_get_ip4_config (device); + NMIP6Config *cfg6 = nm_device_get_ip6_config (device); + GSList *iter; + + /* IP4-SETTINGS */ + if (cfg4 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[5].name)) { + nmc->allowed_fields = nmc_fields_dev_list_ip4_settings; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + for (iter = (GSList *) nm_ip4_config_get_addresses (cfg4); iter; iter = g_slist_next (iter)) { + NMIP4Address *addr = (NMIP4Address *) iter->data; + guint32 prefix = nm_ip4_address_get_prefix (addr); + char *tmp2; + char *addr_str, *prefix_str, *gateway_str; + + addr_str = ip4_address_as_string (nm_ip4_address_get_address (addr)); + + tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix)); + prefix_str = g_strdup_printf ("%d (%s)", prefix, tmp2); + g_free (tmp2); + + gateway_str = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[5].name; /* "IP4-SETTINGS" */ + nmc->allowed_fields[1].value = addr_str; + nmc->allowed_fields[2].value = prefix_str; + nmc->allowed_fields[3].value = gateway_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (addr_str); + g_free (prefix_str); + g_free (gateway_str); + } + was_output = TRUE; + } + /* IP4-DNS */ + if (cfg4 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[6].name)) { + array = nm_ip4_config_get_nameservers (cfg4); + if (array) { + int i; + + nmc->allowed_fields = nmc_fields_dev_list_ip4_dns; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_DNS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + for (i = 0; i < array->len; i++) { + char *dns_name = g_strdup_printf ("%s%d", nmc_fields_dev_list_sections[6].name, i+1); + tmp = ip4_address_as_string (g_array_index (array, guint32, i)); + nmc->allowed_fields[0].value = dns_name; /* "IP4-DNS" */ + nmc->allowed_fields[1].value = tmp; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (tmp); + g_free (dns_name); + } + } + was_output = TRUE; + } + + /* IP6-SETTINGS */ + if (cfg6 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[7].name)) { + nmc->allowed_fields = nmc_fields_dev_list_ip6_settings; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP6_SETTINGS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + for (iter = (GSList *) nm_ip6_config_get_addresses (cfg6); iter; iter = g_slist_next (iter)) { + NMIP6Address *addr = (NMIP6Address *) iter->data; + guint32 prefix = nm_ip6_address_get_prefix (addr); + char *addr_str, *prefix_str, *gateway_str; + + addr_str = ip6_address_as_string (nm_ip6_address_get_address (addr)); + + prefix_str = g_strdup_printf ("%d", prefix); + gateway_str = ip6_address_as_string (nm_ip6_address_get_gateway (addr)); + + nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[7].name; /* "IP6-SETTINGS" */ + nmc->allowed_fields[1].value = addr_str; + nmc->allowed_fields[2].value = prefix_str; + nmc->allowed_fields[3].value = gateway_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (addr_str); + g_free (prefix_str); + g_free (gateway_str); + } + was_output = TRUE; + } + /* IP6-DNS */ + if (cfg6 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[8].name)) { + int i = 1; + nmc->allowed_fields = nmc_fields_dev_list_ip6_dns; + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP6_DNS_ALL, nmc->allowed_fields, NULL); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + for (iter = (GSList *) nm_ip6_config_get_nameservers (cfg6); iter; iter = g_slist_next (iter)) { + char *dns_name = g_strdup_printf ("%s%d", nmc_fields_dev_list_sections[8].name, i++); + + tmp = ip6_address_as_string (iter->data); + nmc->allowed_fields[0].value = dns_name; /* "IP6-DNS" */ + nmc->allowed_fields[1].value = tmp; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + g_free (tmp); + g_free (dns_name); + } + was_output = TRUE; + } + } + } + + if (sections_array) + g_array_free (sections_array, TRUE); +} + +static void +show_device_status (NMDevice *device, NmCli *nmc) +{ + nmc->allowed_fields[0].value = nm_device_get_iface (device); + nmc->allowed_fields[1].value = get_device_type (device); + nmc->allowed_fields[2].value = device_state_to_string (nm_device_get_state (device)); + + nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */ + print_fields (nmc->print_fields, nmc->allowed_fields); +} + +static NMCResultCode +do_devices_status (NmCli *nmc, int argc, char **argv) +{ + GError *error = NULL; + const GPtrArray *devices; + int i; + char *fields_str; + char *fields_all = NMC_FIELDS_DEV_STATUS_ALL; + char *fields_common = NMC_FIELDS_DEV_STATUS_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + while (argc > 0) { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + argc--; + argv++; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + nmc->allowed_fields = nmc_fields_dev_status; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); + + if (error) { + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'dev status': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'dev status': %s; allowed fields: %s"), error->message, NMC_FIELDS_DEV_STATUS_ALL); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("Status of devices"); + print_fields (nmc->print_fields, nmc->allowed_fields); + + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *device = g_ptr_array_index (devices, i); + show_device_status (device, nmc); + } + + return NMC_RESULT_SUCCESS; + +error: + return nmc->return_value; +} + +static NMCResultCode +do_devices_list (NmCli *nmc, int argc, char **argv) +{ + const GPtrArray *devices; + NMDevice *device = NULL; + const char *iface = NULL; + gboolean iface_specified = FALSE; + int i; + + while (argc > 0) { + if (strcmp (*argv, "iface") == 0) { + iface_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + iface = *argv; + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + + if (iface_specified) { + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *candidate = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (candidate); + + if (!strcmp (dev_iface, iface)) + device = candidate; + } + if (!device) { + g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + show_device_info (device, nmc); + } else { + if (devices) + g_ptr_array_foreach ((GPtrArray *) devices, show_device_info, nmc); + } + +error: + return nmc->return_value; +} + +static void +device_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data) +{ + NmCli *nmc = (NmCli *) user_data; + NMDeviceState state; + + state = nm_device_get_state (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 gboolean +timeout_cb (gpointer user_data) +{ + /* Time expired -> exit nmcli */ + + NmCli *nmc = (NmCli *) user_data; + + g_string_printf (nmc->return_text, _("Error: Timeout %d sec expired."), nmc->timeout); + nmc->return_value = NMC_RESULT_ERROR_TIMEOUT_EXPIRED; + quit (); + return FALSE; +} + +static void +disconnect_device_cb (NMDevice *device, GError *error, gpointer user_data) +{ + NmCli *nmc = (NmCli *) user_data; + NMDeviceState state; + + if (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 ? error->message : _("(unknown)")); + nmc->return_value = NMC_RESULT_ERROR_DEV_DISCONNECT; + quit (); + } else { + state = nm_device_get_state (device); + printf (_("Device state: %d (%s)\n"), state, device_state_to_string (state)); + + if (!nmc->should_wait || state == NM_DEVICE_STATE_DISCONNECTED) { + /* Don't want to wait or device already disconnected */ + quit (); + } else { + g_signal_connect (device, "notify::state", G_CALLBACK (device_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); + } + + } +} + +static NMCResultCode +do_device_disconnect (NmCli *nmc, int argc, char **argv) +{ + const GPtrArray *devices; + NMDevice *device = NULL; + const char *iface = NULL; + gboolean iface_specified = FALSE; + gboolean wait = TRUE; + int i; + + /* Set default timeout for disconnect operation */ + nmc->timeout = 10; + + while (argc > 0) { + if (strcmp (*argv, "iface") == 0) { + iface_specified = TRUE; + + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + iface = *argv; + } else if (strcmp (*argv, "--nowait") == 0) { + wait = FALSE; + } else if (strcmp (*argv, "--timeout") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + errno = 0; + nmc->timeout = strtol (*argv, NULL, 10); + if (errno || nmc->timeout < 0) { + g_string_printf (nmc->return_text, _("Error: timeout value '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + if (!iface_specified) { + g_string_printf (nmc->return_text, _("Error: iface has to be specified.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *candidate = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (candidate); + + if (!strcmp (dev_iface, iface)) + device = candidate; + } + + if (!device) { + g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + nmc->should_wait = wait; + nm_device_disconnect (device, disconnect_device_cb, nmc); + +error: + return nmc->return_value; +} + +static void +show_acces_point_info (NMDevice *device, NmCli *nmc) +{ + NMAccessPoint *active_ap = NULL; + const char *active_bssid = NULL; + const GPtrArray *aps; + APInfo *info; + + if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { + active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); + active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; + } + + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->index = 1; + info->active_bssid = active_bssid; + info->device = nm_device_get_iface (device); + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + if (aps && aps->len) + g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) info); + g_free (info); +} + +static NMCResultCode +do_device_wifi_list (NmCli *nmc, int argc, char **argv) +{ + GError *error = NULL; + NMDevice *device = NULL; + NMAccessPoint *ap = NULL; + const char *iface = NULL; + const char *hwaddr_user = NULL; + const GPtrArray *devices; + const GPtrArray *aps; + APInfo *info; + int i, j; + char *fields_str; + char *fields_all = NMC_FIELDS_DEV_WIFI_LIST_ALL; + char *fields_common = NMC_FIELDS_DEV_WIFI_LIST_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + while (argc > 0) { + if (strcmp (*argv, "iface") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + iface = *argv; + } else if (strcmp (*argv, "hwaddr") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + hwaddr_user = *argv; + } else { + fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + } + + argc--; + argv++; + } + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto error; + + devices = nm_client_get_devices (nmc->client); + + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + nmc->allowed_fields = nmc_fields_dev_wifi_list; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); + + if (error) { + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'dev wifi': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'dev wifi': %s; allowed fields: %s"), error->message, NMC_FIELDS_DEV_WIFI_LIST_ALL); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("WiFi scan list"); + + if (iface) { + /* Device specified - list only APs of this interface */ + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *candidate = g_ptr_array_index (devices, i); + const char *dev_iface = nm_device_get_iface (candidate); + + if (!strcmp (dev_iface, iface)) { + device = candidate; + break; + } + } + + if (!device) { + g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + if (NM_IS_DEVICE_WIFI (device)) { + if (hwaddr_user) { + /* Specific AP requested - list only that */ + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + for (j = 0; aps && (j < aps->len); j++) { + char *hwaddr_up; + NMAccessPoint *candidate_ap = g_ptr_array_index (aps, j); + const char *candidate_hwaddr = nm_access_point_get_hw_address (candidate_ap); + + hwaddr_up = g_ascii_strup (hwaddr_user, -1); + if (!strcmp (hwaddr_up, candidate_hwaddr)) + ap = candidate_ap; + g_free (hwaddr_up); + } + if (!ap) { + g_string_printf (nmc->return_text, _("Error: Access point with hwaddr '%s' not found."), hwaddr_user); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->index = 1; + info->active_bssid = NULL; + info->device = nm_device_get_iface (device); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + detail_access_point (ap, info); + g_free (info); + } else { + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + show_acces_point_info (device, nmc); + } + } else { + g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiFi device."), iface); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } else { + /* List APs for all devices */ + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + if (hwaddr_user) { + /* Specific AP requested - list only that */ + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *dev = g_ptr_array_index (devices, i); + + if (!NM_IS_DEVICE_WIFI (dev)) + continue; + + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (dev)); + for (j = 0; aps && (j < aps->len); j++) { + char *hwaddr_up; + NMAccessPoint *candidate_ap = g_ptr_array_index (aps, j); + const char *candidate_hwaddr = nm_access_point_get_hw_address (candidate_ap); + + hwaddr_up = g_ascii_strup (hwaddr_user, -1); + if (!strcmp (hwaddr_up, candidate_hwaddr)) { + ap = candidate_ap; + + info = g_malloc0 (sizeof (APInfo)); + info->nmc = nmc; + info->index = 1; + info->active_bssid = NULL; + info->device = nm_device_get_iface (dev); + detail_access_point (ap, info); + g_free (info); + } + g_free (hwaddr_up); + } + } + if (!ap) { + g_string_printf (nmc->return_text, _("Error: Access point with hwaddr '%s' not found."), hwaddr_user); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + } else { + for (i = 0; devices && (i < devices->len); i++) { + NMDevice *dev = g_ptr_array_index (devices, i); + if (NM_IS_DEVICE_WIFI (dev)) + show_acces_point_info (dev, nmc); + } + } + } + +error: + return nmc->return_value; +} + +static NMCResultCode +do_device_wifi (NmCli *nmc, int argc, char **argv) +{ + if (argc == 0) + nmc->return_value = do_device_wifi_list (nmc, argc-1, argv+1); + else if (argc > 0) { + if (matches (*argv, "list") == 0) { + nmc->return_value = do_device_wifi_list (nmc, argc-1, argv+1); + } + else { + g_string_printf (nmc->return_text, _("Error: 'dev wifi' command '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + } + } + + return nmc->return_value; +} + + +NMCResultCode +do_devices (NmCli *nmc, int argc, char **argv) +{ + GError *error = NULL; + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto end; + + if (argc == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + nmc->return_value = do_devices_status (nmc, 0, NULL); + } + + if (argc > 0) { + if (matches (*argv, "status") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + nmc->return_value = do_devices_status (nmc, argc-1, argv+1); + } + else if (matches (*argv, "list") == 0) { + if (!nmc->mode_specified) + nmc->multiline_output = TRUE; /* multiline mode is default for 'dev list' */ + nmc->return_value = do_devices_list (nmc, argc-1, argv+1); + } + else if (matches (*argv, "disconnect") == 0) { + nmc->return_value = do_device_disconnect (nmc, argc-1, argv+1); + } + else if (matches (*argv, "wifi") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + nmc->return_value = do_device_wifi (nmc, argc-1, argv+1); + } + else if (strcmp (*argv, "help") == 0) { + usage (); + } + else { + g_string_printf (nmc->return_text, _("Error: 'dev' command '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + } + } + +end: + return nmc->return_value; + +opt_error: + g_string_printf (nmc->return_text, _("Error: %s."), error->message); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + g_error_free (error); + return nmc->return_value; +} diff --git a/cli/src/devices.h b/cli/src/devices.h new file mode 100644 index 00000000..152dd207 --- /dev/null +++ b/cli/src/devices.h @@ -0,0 +1,27 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_DEVICES_H +#define NMC_DEVICES_H + +#include "nmcli.h" + +NMCResultCode do_devices (NmCli *nmc, int argc, char **argv); + +#endif /* NMC_DEVICES_H */ diff --git a/cli/src/network-manager.c b/cli/src/network-manager.c new file mode 100644 index 00000000..b65dfcd7 --- /dev/null +++ b/cli/src/network-manager.c @@ -0,0 +1,278 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include + +#include +#include +#include +#include + +#include "utils.h" +#include "network-manager.h" + + +/* Available fields for 'nm status' */ +static NmcOutputField nmc_fields_nm_status[] = { + {"RUNNING", N_("RUNNING"), 15, NULL, 0}, /* 0 */ + {"STATE", N_("STATE"), 15, NULL, 0}, /* 1 */ + {"WIFI-HARDWARE", N_("WIFI-HARDWARE"), 15, NULL, 0}, /* 2 */ + {"WIFI", N_("WIFI"), 10, NULL, 0}, /* 3 */ + {"WWAN-HARDWARE", N_("WWAN-HARDWARE"), 15, NULL, 0}, /* 4 */ + {"WWAN", N_("WWAN"), 10, NULL, 0}, /* 5 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_NM_STATUS_ALL "RUNNING,STATE,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" +#define NMC_FIELDS_NM_STATUS_COMMON "RUNNING,STATE,WIFI-HARDWARE,WIFI,WWAN-HARDWARE,WWAN" +#define NMC_FIELDS_NM_WIFI "WIFI" +#define NMC_FIELDS_NM_WWAN "WWAN" + + +extern GMainLoop *loop; + +/* static function prototypes */ +static void usage (void); +static void quit (void); +static const char *nm_state_to_string (NMState state); +static NMCResultCode show_nm_status (NmCli *nmc); + + +static void +usage (void) +{ + fprintf (stderr, + _("Usage: nmcli nm { COMMAND | help }\n\n" + " COMMAND := { status | sleep | wakeup | wifi | wwan }\n\n" + " status\n" + " sleep\n" + " wakeup\n" + " wifi [on|off]\n" + " wwan [on|off]\n\n")); +} + +/* quit main loop */ +static void +quit (void) +{ + g_main_loop_quit (loop); /* quit main loop */ +} + +static const char * +nm_state_to_string (NMState state) +{ + switch (state) { + case NM_STATE_ASLEEP: + return _("asleep"); + case NM_STATE_CONNECTING: + return _("connecting"); + case NM_STATE_CONNECTED: + return _("connected"); + case NM_STATE_DISCONNECTED: + return _("disconnected"); + case NM_STATE_UNKNOWN: + default: + return _("unknown"); + } +} + +static NMCResultCode +show_nm_status (NmCli *nmc) +{ + gboolean nm_running; + NMState state; + const char *wireless_hw_enabled_str, *wireless_enabled_str; + const char *wwan_hw_enabled_str, *wwan_enabled_str; + GError *error = NULL; + const char *fields_str; + const char *fields_all = NMC_FIELDS_NM_STATUS_ALL; + const char *fields_common = NMC_FIELDS_NM_STATUS_COMMON; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (nmc->client != NULL, NMC_RESULT_ERROR_UNKNOWN); + + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) + fields_str = fields_common; + else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) + fields_str = fields_all; + else + fields_str = nmc->required_fields; + + nmc->allowed_fields = nmc_fields_nm_status; + nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error); + + if (error) { + if (error->code == 0) + g_string_printf (nmc->return_text, _("Error: 'nm status': %s"), error->message); + else + g_string_printf (nmc->return_text, _("Error: 'nm status': %s; allowed fields: %s"), error->message, NMC_FIELDS_NM_STATUS_ALL); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("NetworkManager status"); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + + nm_running = nm_client_get_manager_running (nmc->client); + state = nm_client_get_state (nmc->client); + if (nm_running) { + 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"); + } else { + wireless_hw_enabled_str = wireless_enabled_str = wwan_hw_enabled_str = wwan_enabled_str = _("unknown"); + } + + nmc->allowed_fields[0].value = nm_running ? _("running") : _("not running"); + nmc->allowed_fields[1].value = nm_state_to_string (state); + nmc->allowed_fields[2].value = wireless_hw_enabled_str; + nmc->allowed_fields[3].value = wireless_enabled_str; + nmc->allowed_fields[4].value = wwan_hw_enabled_str; + nmc->allowed_fields[5].value = wwan_enabled_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + return NMC_RESULT_SUCCESS; +} + + +/* entry point function for global network manager related commands 'nmcli nm' */ +NMCResultCode +do_network_manager (NmCli *nmc, int argc, char **argv) +{ + GError *error = NULL; + gboolean enable_wifi; + gboolean enable_wwan; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + /* create NMClient */ + if (!nmc->get_client (nmc)) + goto end; + + if (argc == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + nmc->return_value = show_nm_status (nmc); + } + + if (argc > 0) { + if (matches (*argv, "status") == 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + nmc->return_value = show_nm_status (nmc); + } + else if (matches (*argv, "sleep") == 0) { + nm_client_sleep (nmc->client, TRUE); + } + else if (matches (*argv, "wakeup") == 0) { + nm_client_sleep (nmc->client, FALSE); + } + else if (matches (*argv, "wifi") == 0) { + if (next_arg (&argc, &argv) != 0) { + /* no argument, show current WiFi state */ + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + if (nmc->required_fields && strcasecmp (nmc->required_fields, "WIFI")) { + g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), + nmc->required_fields, NMC_FIELDS_NM_WIFI); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + nmc->allowed_fields = nmc_fields_nm_status; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_WIFI, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("WiFi enabled"); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + nmc->allowed_fields[3].value = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + } else { + if (!strcmp (*argv, "on")) + enable_wifi = TRUE; + else if (!strcmp (*argv, "off")) + enable_wifi = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: invalid 'wifi' parameter: '%s'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + nm_client_wireless_set_enabled (nmc->client, enable_wifi); + } + } + else if (matches (*argv, "wwan") == 0) { + if (next_arg (&argc, &argv) != 0) { + if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) + goto opt_error; + /* no argument, show current WWAN state */ + if (nmc->required_fields && strcasecmp (nmc->required_fields, "WWAN")) { + g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here; allowed fields: %s"), + nmc->required_fields, NMC_FIELDS_NM_WWAN); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + nmc->allowed_fields = nmc_fields_nm_status; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_NM_WWAN, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES; + nmc->print_fields.header_name = _("WWAN enabled"); + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + nmc->allowed_fields[5].value = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */ + } else { + if (!strcmp (*argv, "on")) + enable_wwan = TRUE; + else if (!strcmp (*argv, "off")) + enable_wwan = FALSE; + else { + g_string_printf (nmc->return_text, _("Error: invalid 'wwan' parameter: '%s'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto end; + } + nm_client_wwan_set_enabled (nmc->client, enable_wwan); + } + } + else if (strcmp (*argv, "help") == 0) { + usage (); + } + else { + g_string_printf (nmc->return_text, _("Error: 'nm' command '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + } + } + +end: + quit (); + return nmc->return_value; + +opt_error: + quit (); + g_string_printf (nmc->return_text, _("Error: %s."), error->message); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + g_error_free (error); + return nmc->return_value; +} diff --git a/cli/src/network-manager.h b/cli/src/network-manager.h new file mode 100644 index 00000000..93cc1b07 --- /dev/null +++ b/cli/src/network-manager.h @@ -0,0 +1,27 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_NETWORK_MANAGER_H +#define NMC_NETWORK_MANAGER_H + +#include "nmcli.h" + +NMCResultCode do_network_manager (NmCli *nmc, int argc, char **argv); + +#endif /* NMC_NETWORK_MANAGER_H */ diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c new file mode 100644 index 00000000..328a6d8e --- /dev/null +++ b/cli/src/nmcli.c @@ -0,0 +1,363 @@ +/* nmcli - command-line tool to control NetworkManager + * + * Jiri Klimes + * + * 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. + */ + +/* Generated configuration file */ +#include "config.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nmcli.h" +#include "utils.h" +#include "connections.h" +#include "devices.h" +#include "network-manager.h" + +#if defined(NM_DIST_VERSION) +# define NMCLI_VERSION NM_DIST_VERSION +#else +# define NMCLI_VERSION VERSION +#endif + + +typedef struct { + NmCli *nmc; + int argc; + char **argv; +} ArgsInfo; + +/* --- Global variables --- */ +GMainLoop *loop = NULL; + + +static void +usage (const char *prog_name) +{ + fprintf (stderr, + _("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] |all|common specify fields to output\n" + " -e[scape] yes|no escape columns separators in values\n" + " -v[ersion] show program version\n" + " -h[elp] print this help\n\n" + "OBJECT\n" + " nm NetworkManager status\n" + " con NetworkManager connections\n" + " dev devices managed by NetworkManager\n\n"), + prog_name); +} + +static NMCResultCode +do_help (NmCli *nmc, int argc, char **argv) +{ + usage ("nmcli"); + return NMC_RESULT_SUCCESS; +} + +static const struct cmd { + const char *cmd; + NMCResultCode (*func) (NmCli *nmc, int argc, char **argv); +} nmcli_cmds[] = { + { "nm", do_network_manager }, + { "con", do_connections }, + { "dev", do_devices }, + { "help", do_help }, + { 0 } +}; + +static NMCResultCode +do_cmd (NmCli *nmc, const char *argv0, int argc, char **argv) +{ + const struct cmd *c; + + for (c = nmcli_cmds; c->cmd; ++c) { + if (matches (argv0, c->cmd) == 0) + return c->func (nmc, argc-1, argv+1); + } + + g_string_printf (nmc->return_text, _("Error: Object '%s' is unknown, try 'nmcli help'."), argv0); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; +} + +static NMCResultCode +parse_command_line (NmCli *nmc, int argc, char **argv) +{ + char *base; + + base = strrchr (argv[0], '/'); + if (base == NULL) + base = argv[0]; + else + base++; + + /* parse options */ + while (argc > 1) { + char *opt = argv[1]; + /* '--' ends options */ + if (strcmp (opt, "--") == 0) { + argc--; argv++; + break; + } + if (opt[0] != '-') + break; + if (opt[1] == '-') + opt++; + if (matches (opt, "-terse") == 0) { + if (nmc->print_output == NMC_PRINT_TERSE) { + g_string_printf (nmc->return_text, _("Error: Option '--terse' is specified the second time.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + else if (nmc->print_output == NMC_PRINT_PRETTY) { + g_string_printf (nmc->return_text, _("Error: Option '--terse' is mutually exclusive with '--pretty'.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + else + nmc->print_output = NMC_PRINT_TERSE; + } else if (matches (opt, "-pretty") == 0) { + if (nmc->print_output == NMC_PRINT_PRETTY) { + g_string_printf (nmc->return_text, _("Error: Option '--pretty' is specified the second time.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + else if (nmc->print_output == NMC_PRINT_TERSE) { + g_string_printf (nmc->return_text, _("Error: Option '--pretty' is mutually exclusive with '--terse'.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + else + nmc->print_output = NMC_PRINT_PRETTY; + } else if (matches (opt, "-mode") == 0) { + nmc->mode_specified = TRUE; + 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 (!strcmp (argv[1], "tabular")) + nmc->multiline_output = FALSE; + else if (!strcmp (argv[1], "multiline")) + nmc->multiline_output = TRUE; + 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) { + 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 (!strcmp (argv[1], "yes")) + nmc->escape_values = TRUE; + else if (!strcmp (argv[1], "no")) + nmc->escape_values = FALSE; + 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, "-fields") == 0) { + next_arg (&argc, &argv); + if (argc <= 1) { + g_string_printf (nmc->return_text, _("Error: fields for '%s' options are missing."), opt); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + nmc->required_fields = g_strdup (argv[1]); + } else if (matches (opt, "-version") == 0) { + printf (_("nmcli tool, version %s\n"), NMCLI_VERSION); + return NMC_RESULT_SUCCESS; + } else if (matches (opt, "-help") == 0) { + usage (base); + return NMC_RESULT_SUCCESS; + } else { + g_string_printf (nmc->return_text, _("Error: Option '%s' is unknown, try 'nmcli -help'."), opt); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + argc--; + argv++; + } + + if (argc > 1) + return do_cmd (nmc, argv[1], argc-1, argv+1); + + usage (base); + return nmc->return_value; +} + +static void +signal_handler (int signo) +{ + if (signo == SIGINT || signo == SIGTERM) { + g_message (_("Caught signal %d, shutting down..."), signo); + g_main_loop_quit (loop); + } +} + +static void +setup_signals (void) +{ + struct sigaction action; + sigset_t mask; + + sigemptyset (&mask); + action.sa_handler = signal_handler; + action.sa_mask = mask; + action.sa_flags = 0; + sigaction (SIGTERM, &action, NULL); + sigaction (SIGINT, &action, NULL); +} + +static NMClient * +nmc_get_client (NmCli *nmc) +{ + if (!nmc->client) { + nmc->client = nm_client_new (); + if (!nmc->client) { + g_string_printf (nmc->return_text, _("Error: Could not connect to NetworkManager.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } + } + + return nmc->client; +} + +/* Initialize NmCli structure - set default values */ +static void +nmc_init (NmCli *nmc) +{ + nmc->client = NULL; + nmc->get_client = &nmc_get_client; + + nmc->return_value = NMC_RESULT_SUCCESS; + nmc->return_text = g_string_new (_("Success")); + + nmc->timeout = 10; + + nmc->system_settings = NULL; + nmc->user_settings = NULL; + + nmc->system_settings_running = FALSE; + nmc->user_settings_running = FALSE; + + nmc->system_connections = NULL; + nmc->user_connections = NULL; + + nmc->should_wait = FALSE; + nmc->print_output = NMC_PRINT_NORMAL; + nmc->multiline_output = FALSE; + nmc->mode_specified = FALSE; + nmc->escape_values = TRUE; + nmc->required_fields = NULL; + nmc->allowed_fields = NULL; + memset (&nmc->print_fields, '\0', sizeof (NmcPrintFields)); +} + +static void +nmc_cleanup (NmCli *nmc) +{ + if (nmc->client) g_object_unref (nmc->client); + + g_string_free (nmc->return_text, TRUE); + + if (nmc->system_settings) g_object_unref (nmc->system_settings); + if (nmc->user_settings) g_object_unref (nmc->user_settings); + + g_slist_free (nmc->system_connections); + g_slist_free (nmc->user_connections); + + g_free (nmc->required_fields); + if (nmc->print_fields.indices) + g_array_free (nmc->print_fields.indices, TRUE); +} + +static gboolean +start (gpointer data) +{ + ArgsInfo *info = (ArgsInfo *) data; + info->nmc->return_value = parse_command_line (info->nmc, info->argc, info->argv); + + if (!info->nmc->should_wait) + g_main_loop_quit (loop); + + return FALSE; +} + + +int +main (int argc, char *argv[]) +{ + NmCli nmc; + ArgsInfo args_info = { &nmc, argc, argv }; + + /* Set locale to use environment variables */ + setlocale (LC_ALL, ""); + +#ifdef GETTEXT_PACKAGE + /* Set i18n stuff */ + bindtextdomain (GETTEXT_PACKAGE, NMCLI_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); +#endif + + g_type_init (); + + nmc_init (&nmc); + g_idle_add (start, &args_info); + + loop = g_main_loop_new (NULL, FALSE); /* create main loop */ + setup_signals (); /* setup UNIX signals */ + g_main_loop_run (loop); /* run main loop */ + + /* Print result descripting text */ + if (nmc.return_value != NMC_RESULT_SUCCESS) { + fprintf (stderr, "%s\n", nmc.return_text->str); + } + + g_main_loop_unref (loop); + nmc_cleanup (&nmc); + + return nmc.return_value; +} diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h new file mode 100644 index 00000000..b4e4562b --- /dev/null +++ b/cli/src/nmcli.h @@ -0,0 +1,114 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_NMCLI_H +#define NMC_NMCLI_H + +#include + +#include +#include +#include + +/* nmcli exit codes */ +typedef enum { + /* Indicates successful execution */ + NMC_RESULT_SUCCESS = 0, + + /* Unknown / unspecified error */ + NMC_RESULT_ERROR_UNKNOWN = 1, + + /* Wrong invocation of nmcli */ + NMC_RESULT_ERROR_USER_INPUT = 2, + + /* A timeout expired */ + NMC_RESULT_ERROR_TIMEOUT_EXPIRED = 3, + + /* Error in connection activation */ + NMC_RESULT_ERROR_CON_ACTIVATION = 4, + + /* Error in connection deactivation */ + NMC_RESULT_ERROR_CON_DEACTIVATION = 5, + + /* Error in device disconnect */ + NMC_RESULT_ERROR_DEV_DISCONNECT = 6 +} NMCResultCode; + +typedef enum { + NMC_PRINT_TERSE = 0, + NMC_PRINT_NORMAL = 1, + NMC_PRINT_PRETTY = 2 +} NMCPrintOutput; + +/* === Output fields === */ +typedef struct { + const char *name; /* Field's name */ + const char *name_l10n; /* Field's name for translation */ + int width; /* Width in screen columns */ + const char *value; /* Value of current field */ + guint32 flags; /* Flags */ +} NmcOutputField; + +/* Flags for NmcPrintFields */ +#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular */ +#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse output mode */ +#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */ +#define NMC_PF_FLAG_MAIN_HEADER_ADD 0x00000008 /* Print main header in addition to values/field names */ +#define NMC_PF_FLAG_MAIN_HEADER_ONLY 0x00000010 /* Print main header only */ +#define NMC_PF_FLAG_FIELD_NAMES 0x00000020 /* Print field names instead of values */ +#define NMC_PF_FLAG_ESCAPE 0x00000040 /* Escape column separator and '\' */ +#define NMC_PF_FLAG_SECTION_PREFIX 0x00000080 /* Use the first value as section prefix for the other field names - just in multiline */ + +typedef struct { + GArray *indices; /* Array of field indices to the array of allowed fields */ + char *header_name; /* Name of the output */ + int indent; /* Indent by this number of spaces */ + guint32 flags; /* Various flags for controlling output: see NMC_PF_FLAG_* values */ +} NmcPrintFields; + +/* NmCli - main structure */ +typedef struct _NmCli { + NMClient *client; /* Pointer to NMClient of libnm-glib */ + NMClient *(*get_client) (struct _NmCli *nmc); /* Pointer to function for creating NMClient */ + + NMCResultCode return_value; /* Return code of nmcli */ + GString *return_text; /* Reason text */ + + int timeout; /* Operation timeout */ + + NMRemoteSettingsSystem *system_settings; /* System settings */ + NMRemoteSettings *user_settings; /* User settings */ + + gboolean system_settings_running; /* Is system settings service running? */ + gboolean user_settings_running; /* Is user settings service running? */ + + GSList *system_connections; /* List of system connections */ + GSList *user_connections; /* List of user connections */ + + gboolean should_wait; /* Indication that nmcli should not end yet */ + 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 */ + gboolean escape_values; /* Whether to escape ':' and '\' in terse tabular mode */ + char *required_fields; /* Required fields in output: '--fields' option */ + NmcOutputField *allowed_fields; /* Array of allowed fields for particular commands */ + NmcPrintFields print_fields; /* Structure with field indices to print */ +} NmCli; + +#endif /* NMC_NMCLI_H */ diff --git a/cli/src/settings.c b/cli/src/settings.c new file mode 100644 index 00000000..1371bfbe --- /dev/null +++ b/cli/src/settings.c @@ -0,0 +1,1369 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include +#include + +#include "utils.h" +#include "settings.h" + + +/* Helper macro to define fields */ +#define SETTING_FIELD(setting, width) { setting, N_(setting), width, NULL, 0 } + +/* Available fields for NM_SETTING_CONNECTION_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_connection[] = { + SETTING_FIELD ("name", 15), /* 0 */ + SETTING_FIELD (NM_SETTING_CONNECTION_ID, 25), /* 1 */ + SETTING_FIELD (NM_SETTING_CONNECTION_UUID, 38), /* 2 */ + SETTING_FIELD (NM_SETTING_CONNECTION_TYPE, 17), /* 3 */ + SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT, 13), /* 4 */ + SETTING_FIELD (NM_SETTING_CONNECTION_TIMESTAMP, 10), /* 5 */ + SETTING_FIELD (NM_SETTING_CONNECTION_READ_ONLY, 10), /* 6 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_CONNECTION_ALL "name"","\ + NM_SETTING_CONNECTION_ID","\ + NM_SETTING_CONNECTION_UUID","\ + NM_SETTING_CONNECTION_TYPE","\ + NM_SETTING_CONNECTION_AUTOCONNECT","\ + NM_SETTING_CONNECTION_TIMESTAMP","\ + NM_SETTING_CONNECTION_READ_ONLY +#define NMC_FIELDS_SETTING_CONNECTION_COMMON NMC_FIELDS_SETTING_CONNECTION_ALL + +/* Available fields for NM_SETTING_WIRED_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_wired[] = { + SETTING_FIELD ("name", 17), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRED_PORT, 8), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRED_SPEED, 10), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRED_DUPLEX, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRED_AUTO_NEGOTIATE, 15), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS, 19), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRED_MTU, 6), /* 6 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_WIRED_ALL "name"","\ + NM_SETTING_WIRED_PORT","\ + NM_SETTING_WIRED_SPEED","\ + NM_SETTING_WIRED_DUPLEX","\ + NM_SETTING_WIRED_AUTO_NEGOTIATE","\ + NM_SETTING_WIRED_MAC_ADDRESS","\ + NM_SETTING_WIRED_MTU +#define NMC_FIELDS_SETTING_WIRED_COMMON NMC_FIELDS_SETTING_WIRED_ALL + +/* Available fields for NM_SETTING_802_1X_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_8021X[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_802_1X_EAP, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_802_1X_IDENTITY, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, 15), /* 3 */ + SETTING_FIELD (NM_SETTING_802_1X_CA_CERT, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_802_1X_CA_PATH, 10), /* 5 */ + SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT, 10), /* 6 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPVER, 10), /* 7 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPLABEL, 10), /* 8 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, 10), /* 9 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTH, 10), /* 10 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTHEAP, 10), /* 11 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT, 20), /* 12 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_PATH, 20), /* 13 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, 20), /* 14 */ + SETTING_FIELD (NM_SETTING_802_1X_PASSWORD, 10), /* 15 */ + SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY, 15), /* 16 */ + SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, 20), /* 17 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, 20), /* 18 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, 20), /* 19 */ + SETTING_FIELD (NM_SETTING_802_1X_PIN, 8), /* 20 */ + SETTING_FIELD (NM_SETTING_802_1X_PSK, 8), /* 21 */ + SETTING_FIELD (NM_SETTING_802_1X_SYSTEM_CA_CERTS, 17), /* 22 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_802_1X_ALL "name"","\ + NM_SETTING_802_1X_EAP","\ + NM_SETTING_802_1X_IDENTITY","\ + NM_SETTING_802_1X_ANONYMOUS_IDENTITY","\ + NM_SETTING_802_1X_CA_CERT","\ + NM_SETTING_802_1X_CA_PATH","\ + NM_SETTING_802_1X_CLIENT_CERT","\ + NM_SETTING_802_1X_PHASE1_PEAPVER","\ + NM_SETTING_802_1X_PHASE1_PEAPLABEL","\ + NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING","\ + NM_SETTING_802_1X_PHASE2_AUTH","\ + NM_SETTING_802_1X_PHASE2_AUTHEAP","\ + NM_SETTING_802_1X_PHASE2_CA_CERT","\ + NM_SETTING_802_1X_PHASE2_CA_PATH","\ + NM_SETTING_802_1X_PHASE2_CLIENT_CERT","\ + NM_SETTING_802_1X_PASSWORD","\ + NM_SETTING_802_1X_PRIVATE_KEY","\ + NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD","\ + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY","\ + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD","\ + NM_SETTING_802_1X_PIN","\ + NM_SETTING_802_1X_PSK","\ + NM_SETTING_802_1X_SYSTEM_CA_CERTS +#define NMC_FIELDS_SETTING_802_1X_COMMON NMC_FIELDS_SETTING_802_1X_ALL + +/* Available fields for NM_SETTING_WIRELESS_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_wireless[] = { + SETTING_FIELD ("name", 17), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SSID, 34), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MODE, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRELESS_BAND, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRELESS_CHANNEL, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRELESS_BSSID, 19), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRELESS_RATE, 10), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRELESS_TX_POWER, 10), /* 7 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS, 19), /* 8 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MTU, 6), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS, 35), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEC, 10), /* 11 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_WIRELESS_ALL "name"","\ + NM_SETTING_WIRELESS_SSID","\ + NM_SETTING_WIRELESS_MODE","\ + NM_SETTING_WIRELESS_BAND","\ + NM_SETTING_WIRELESS_CHANNEL","\ + NM_SETTING_WIRELESS_BSSID","\ + NM_SETTING_WIRELESS_RATE","\ + NM_SETTING_WIRELESS_TX_POWER","\ + NM_SETTING_WIRELESS_MAC_ADDRESS","\ + NM_SETTING_WIRELESS_MTU","\ + NM_SETTING_WIRELESS_SEEN_BSSIDS","\ + NM_SETTING_WIRELESS_SEC +#define NMC_FIELDS_SETTING_WIRELESS_COMMON NMC_FIELDS_SETTING_WIRELESS_ALL + +/* Available fields for NM_SETTING_WIRELESS_SECURITY_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_wireless_security[] = { + SETTING_FIELD ("name", 25), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PROTO, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PAIRWISE, 10), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_GROUP, 10), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, 15), /* 7 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, 10), /* 8 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, 10), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, 10), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, 10), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PSK, 6), /* 12 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, 15), /* 13 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, 15), /* 14 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_WIRELESS_SECURITY_ALL "name"","\ + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT","\ + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX","\ + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG","\ + NM_SETTING_WIRELESS_SECURITY_PROTO","\ + NM_SETTING_WIRELESS_SECURITY_PAIRWISE","\ + NM_SETTING_WIRELESS_SECURITY_GROUP","\ + NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3","\ + NM_SETTING_WIRELESS_SECURITY_PSK","\ + NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD","\ + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE +#define NMC_FIELDS_SETTING_WIRELESS_SECURITY_COMMON NMC_FIELDS_SETTING_WIRELESS_SECURITY_ALL + +/* Available fields for NM_SETTING_IP4_CONFIG_SETTING_NAME */ +static 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 */ + {NULL, NULL, 0, NULL, 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_IP4_CONFIG_DHCP_CLIENT_ID","\ + NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME","\ + NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME","\ + NM_SETTING_IP4_CONFIG_NEVER_DEFAULT +#define NMC_FIELDS_SETTING_IP4_CONFIG_COMMON NMC_FIELDS_SETTING_IP4_CONFIG_ALL + +/* Available fields for NM_SETTING_IP6_CONFIG_SETTING_NAME */ +static 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 */ + {NULL, NULL, 0, NULL, 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 +#define NMC_FIELDS_SETTING_IP6_CONFIG_COMMON NMC_FIELDS_SETTING_IP4_CONFIG_ALL + +/* Available fields for NM_SETTING_SERIAL_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_serial[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_SERIAL_BAUD, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_SERIAL_BITS, 10), /* 2 */ + SETTING_FIELD (NM_SETTING_SERIAL_PARITY, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_SERIAL_STOPBITS, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_SERIAL_SEND_DELAY, 12), /* 5 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_SERIAL_ALL "name"","\ + NM_SETTING_SERIAL_BAUD","\ + NM_SETTING_SERIAL_BITS","\ + NM_SETTING_SERIAL_PARITY","\ + NM_SETTING_SERIAL_STOPBITS","\ + NM_SETTING_SERIAL_SEND_DELAY +#define NMC_FIELDS_SETTING_SERIAL_COMMON NMC_FIELDS_SETTING_SERIAL_ALL + +/* Available fields for NM_SETTING_PPP_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_ppp[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_PPP_NOAUTH, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_EAP, 10), /* 2 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_PAP, 10), /* 3 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_CHAP, 10), /* 4 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_MSCHAP, 10), /* 5 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_MSCHAPV2, 10), /* 6 */ + SETTING_FIELD (NM_SETTING_PPP_NOBSDCOMP, 10), /* 7 */ + SETTING_FIELD (NM_SETTING_PPP_NODEFLATE, 10), /* 8 */ + SETTING_FIELD (NM_SETTING_PPP_NO_VJ_COMP, 10), /* 9 */ + SETTING_FIELD (NM_SETTING_PPP_REQUIRE_MPPE, 10), /* 10 */ + SETTING_FIELD (NM_SETTING_PPP_REQUIRE_MPPE_128, 10), /* 11 */ + SETTING_FIELD (NM_SETTING_PPP_MPPE_STATEFUL, 10), /* 12 */ + SETTING_FIELD (NM_SETTING_PPP_CRTSCTS, 10), /* 13 */ + SETTING_FIELD (NM_SETTING_PPP_BAUD, 10), /* 14 */ + SETTING_FIELD (NM_SETTING_PPP_MRU, 10), /* 15 */ + SETTING_FIELD (NM_SETTING_PPP_MTU, 10), /* 16 */ + SETTING_FIELD (NM_SETTING_PPP_LCP_ECHO_FAILURE, 17), /* 17 */ + SETTING_FIELD (NM_SETTING_PPP_LCP_ECHO_INTERVAL, 18), /* 18 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_PPP_ALL "name"","\ + NM_SETTING_PPP_NOAUTH","\ + NM_SETTING_PPP_REFUSE_EAP","\ + NM_SETTING_PPP_REFUSE_PAP","\ + NM_SETTING_PPP_REFUSE_CHAP","\ + NM_SETTING_PPP_REFUSE_MSCHAP","\ + NM_SETTING_PPP_REFUSE_MSCHAPV2","\ + NM_SETTING_PPP_NOBSDCOMP","\ + NM_SETTING_PPP_NODEFLATE","\ + NM_SETTING_PPP_NO_VJ_COMP","\ + NM_SETTING_PPP_REQUIRE_MPPE","\ + NM_SETTING_PPP_REQUIRE_MPPE_128","\ + NM_SETTING_PPP_MPPE_STATEFUL","\ + NM_SETTING_PPP_CRTSCTS","\ + NM_SETTING_PPP_BAUD","\ + NM_SETTING_PPP_MRU","\ + NM_SETTING_PPP_MTU","\ + NM_SETTING_PPP_LCP_ECHO_FAILURE","\ + NM_SETTING_PPP_LCP_ECHO_INTERVAL +#define NMC_FIELDS_SETTING_PPP_COMMON NMC_FIELDS_SETTING_PPP_ALL + +/* Available fields for NM_SETTING_PPPOE_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_pppoe[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_PPPOE_SERVICE, 12), /* 1 */ + SETTING_FIELD (NM_SETTING_PPPOE_USERNAME, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_PPPOE_PASSWORD, 15), /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_PPPOE_ALL "name"","\ + NM_SETTING_PPPOE_SERVICE","\ + NM_SETTING_PPPOE_USERNAME","\ + NM_SETTING_PPPOE_PASSWORD +#define NMC_FIELDS_SETTING_PPPOE_COMMON NMC_FIELDS_SETTING_PPP_ALL + +/* Available fields for NM_SETTING_GSM_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_gsm[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_GSM_NUMBER, 10), /* 1 */ + SETTING_FIELD (NM_SETTING_GSM_USERNAME, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_GSM_PASSWORD, 15), /* 3 */ + SETTING_FIELD (NM_SETTING_GSM_APN, 25), /* 4 */ + SETTING_FIELD (NM_SETTING_GSM_NETWORK_ID, 12), /* 5 */ + SETTING_FIELD (NM_SETTING_GSM_NETWORK_TYPE, 15), /* 6 */ + SETTING_FIELD (NM_SETTING_GSM_ALLOWED_BANDS, 15), /* 7 */ + SETTING_FIELD (NM_SETTING_GSM_PIN, 10), /* 8 */ + SETTING_FIELD (NM_SETTING_GSM_HOME_ONLY, 10), /* 9 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_GSM_ALL "name"","\ + NM_SETTING_GSM_NUMBER","\ + NM_SETTING_GSM_USERNAME","\ + NM_SETTING_GSM_PASSWORD","\ + NM_SETTING_GSM_APN","\ + NM_SETTING_GSM_NETWORK_ID","\ + NM_SETTING_GSM_NETWORK_TYPE","\ + NM_SETTING_GSM_ALLOWED_BANDS","\ + NM_SETTING_GSM_PIN","\ + NM_SETTING_GSM_HOME_ONLY +#define NMC_FIELDS_SETTING_GSM_COMMON NMC_FIELDS_SETTING_GSM_ALL + +/* Available fields for NM_SETTING_CDMA_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_cdma[] = { + SETTING_FIELD ("name", 10), /* 0 */ + SETTING_FIELD (NM_SETTING_CDMA_NUMBER, 15), /* 1 */ + SETTING_FIELD (NM_SETTING_CDMA_USERNAME, 15), /* 2 */ + SETTING_FIELD (NM_SETTING_CDMA_PASSWORD, 15), /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_CDMA_ALL "name"","\ + NM_SETTING_CDMA_NUMBER","\ + NM_SETTING_CDMA_USERNAME","\ + NM_SETTING_CDMA_PASSWORD +#define NMC_FIELDS_SETTING_CDMA_COMMON NMC_FIELDS_SETTING_CDMA_ALL + +/* Available fields for NM_SETTING_BLUETOOTH_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_bluetooth[] = { + SETTING_FIELD ("name", 11), /* 0 */ + SETTING_FIELD (NM_SETTING_BLUETOOTH_BDADDR, 19), /* 1 */ + SETTING_FIELD (NM_SETTING_BLUETOOTH_TYPE, 10), /* 2 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_BLUETOOTH_ALL "name"","\ + NM_SETTING_BLUETOOTH_BDADDR","\ + NM_SETTING_BLUETOOTH_TYPE +#define NMC_FIELDS_SETTING_BLUETOOTH_COMMON NMC_FIELDS_SETTING_BLUETOOTH_ALL + +/* Available fields for NM_SETTING_OLPC_MESH_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_olpc_mesh[] = { + SETTING_FIELD ("name", 18), /* 0 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_SSID, 34), /* 1 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_CHANNEL, 12), /* 2 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS, 17), /* 3 */ + {NULL, NULL, 0, NULL, 0} +}; +#define NMC_FIELDS_SETTING_OLPC_MESH_ALL "name"","\ + NM_SETTING_OLPC_MESH_SSID","\ + NM_SETTING_OLPC_MESH_CHANNEL","\ + NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS +#define NMC_FIELDS_SETTING_OLPC_MESH_COMMON NMC_FIELDS_SETTING_OLPC_MESH_ALL + +/* Available fields for NM_SETTING_VPN_SETTING_NAME */ +static NmcOutputField nmc_fields_setting_vpn[] = { + SETTING_FIELD ("name", 6), /* 0 */ + SETTING_FIELD (NM_SETTING_VPN_SERVICE_TYPE, 40), /* 1 */ + SETTING_FIELD (NM_SETTING_VPN_USER_NAME, 12), /* 2 */ + SETTING_FIELD (NM_SETTING_VPN_DATA, 30), /* 3 */ + SETTING_FIELD (NM_SETTING_VPN_SECRETS, 15), /* 4 */ + {NULL, NULL, 0, NULL, 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 +#define NMC_FIELDS_SETTING_VPN_COMMON NMC_FIELDS_SETTING_VPN_ALL + + +static char * +wep_key_type_to_string (NMWepKeyType type) +{ + switch (type) { + case NM_WEP_KEY_TYPE_KEY: + return g_strdup_printf (_("%d (hex-ascii-key)"), type); + case NM_WEP_KEY_TYPE_PASSPHRASE: + return g_strdup_printf (_("%d (104/128-bit passphrase)"), type); + case NM_WEP_KEY_TYPE_UNKNOWN: + default: + return g_strdup_printf (_("%d (unknown)"), type); + } +} + +static char * +blob_cert_to_string (const GByteArray *array) +{ + GString *cert = NULL; + int i; + + if (array->len > 0) + cert = g_string_new (NULL); + + for (i = 0; i < array->len; i++) { + g_string_append_printf (cert, "%02X", array->data[i]); + } + + return cert ? g_string_free (cert, FALSE) : NULL; +} + +static char * +allowed_bands_to_string (guint32 bands) +{ + GString *band_str; + + if (bands == NM_SETTING_GSM_BAND_UNKNOWN) + return g_strdup (_("0 (unknown)")); + + band_str = g_string_new (NULL); + g_string_printf (band_str, "%d (", bands); + + if (bands & NM_SETTING_GSM_BAND_ANY) + g_string_append (band_str, _("any, ")); + if (bands & NM_SETTING_GSM_BAND_EGSM) + g_string_append (band_str, _("900 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_DCS) + g_string_append (band_str, _("1800 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_PCS) + g_string_append (band_str, _("1900 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_G850) + g_string_append (band_str, _("850 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U2100) + g_string_append (band_str, _("WCDMA 3GPP UMTS 2100 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U1800) + g_string_append (band_str, _("WCDMA 3GPP UMTS 1800 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U17IV) + g_string_append (band_str, _("WCDMA 3GPP UMTS 1700/2100 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U800) + g_string_append (band_str, _("WCDMA 3GPP UMTS 800 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U850) + g_string_append (band_str, _("WCDMA 3GPP UMTS 850 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U900) + g_string_append (band_str, _("WCDMA 3GPP UMTS 900 MHz, ")); + if (bands & NM_SETTING_GSM_BAND_U17IX) + g_string_append (band_str, _("WCDMA 3GPP UMTS 1700 MHz, ")); + + if (band_str->str[band_str->len-1] == '(') + g_string_assign (band_str, _("unknown")); + else + g_string_truncate (band_str, band_str->len-2); /* chop off trailing ', ' */ + + g_string_append_c (band_str, ')'); + + return g_string_free (band_str, FALSE); +} + + +gboolean +setting_connection_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingConnection *s_con; + guint64 timestamp; + char *timestamp_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), FALSE); + s_con = (NMSettingConnection *) setting; + + nmc->allowed_fields = nmc_fields_setting_connection; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_CONNECTION_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + timestamp = nm_setting_connection_get_timestamp (s_con); + timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp); + + nmc->allowed_fields[0].value = NM_SETTING_CONNECTION_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_connection_get_id (s_con); + nmc->allowed_fields[2].value = nm_setting_connection_get_uuid (s_con); + nmc->allowed_fields[3].value = nm_setting_connection_get_connection_type (s_con); + nmc->allowed_fields[4].value = nm_setting_connection_get_autoconnect (s_con) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = timestamp_str; + nmc->allowed_fields[6].value = nm_setting_connection_get_read_only (s_con) ? ("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (timestamp_str); + + return TRUE; +} + +gboolean +setting_wired_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingWired *s_wired; + const GByteArray *mac; + char *speed_str, *mtu_str, *mac_str = NULL; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); + s_wired = (NMSettingWired *) setting; + + nmc->allowed_fields = nmc_fields_setting_wired; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRED_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + speed_str = g_strdup_printf ("%d", nm_setting_wired_get_speed (s_wired)); + mtu_str = g_strdup_printf ("%d", nm_setting_wired_get_mtu (s_wired)); + mac = nm_setting_wired_get_mac_address (s_wired); + if (mac) + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + + nmc->allowed_fields[0].value = NM_SETTING_WIRED_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_wired_get_port (s_wired); + nmc->allowed_fields[2].value = speed_str; + nmc->allowed_fields[3].value = nm_setting_wired_get_duplex (s_wired); + nmc->allowed_fields[4].value = nm_setting_wired_get_auto_negotiate (s_wired) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = mac_str; + nmc->allowed_fields[6].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (speed_str); + g_free (mac_str); + g_free (mtu_str); + + return TRUE; +} + +gboolean +setting_802_1X_details (NMSetting *setting, NmCli *nmc) +{ + NMSetting8021x *s_8021X; + NMSetting8021xCKScheme scheme; + GString *eap_str; + char *ca_cert_str = NULL, *client_cert_str = NULL, *phase2_ca_cert_str = NULL; + char *phase2_client_cert_str = NULL, *private_key_str = NULL, *phase2_private_key_str = NULL; + int i; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), FALSE); + s_8021X = (NMSetting8021x *) setting; + + nmc->allowed_fields = nmc_fields_setting_8021X; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_802_1X_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + eap_str = g_string_new (NULL); + for (i = 0; i < nm_setting_802_1x_get_num_eap_methods (s_8021X); i++) { + if (i > 0) + g_string_append_c (eap_str, ','); + g_string_append (eap_str, nm_setting_802_1x_get_eap_method (s_8021X, i)); + } + scheme = nm_setting_802_1x_get_ca_cert_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + ca_cert_str = blob_cert_to_string (nm_setting_802_1x_get_ca_cert_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + ca_cert_str = g_strdup (nm_setting_802_1x_get_ca_cert_path (s_8021X)); + + scheme = nm_setting_802_1x_get_client_cert_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + client_cert_str = blob_cert_to_string (nm_setting_802_1x_get_client_cert_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + client_cert_str = g_strdup (nm_setting_802_1x_get_client_cert_path (s_8021X)); + + scheme = nm_setting_802_1x_get_phase2_ca_cert_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + phase2_ca_cert_str = blob_cert_to_string (nm_setting_802_1x_get_phase2_ca_cert_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + phase2_ca_cert_str = g_strdup (nm_setting_802_1x_get_phase2_ca_cert_path (s_8021X)); + + scheme = nm_setting_802_1x_get_phase2_client_cert_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + phase2_client_cert_str = blob_cert_to_string (nm_setting_802_1x_get_phase2_client_cert_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + phase2_client_cert_str = g_strdup (nm_setting_802_1x_get_phase2_client_cert_path (s_8021X)); + + scheme = nm_setting_802_1x_get_private_key_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + private_key_str = blob_cert_to_string (nm_setting_802_1x_get_private_key_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + private_key_str = g_strdup (nm_setting_802_1x_get_private_key_path (s_8021X)); + + scheme = nm_setting_802_1x_get_phase2_private_key_scheme (s_8021X); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + phase2_private_key_str = blob_cert_to_string (nm_setting_802_1x_get_phase2_private_key_blob (s_8021X)); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + phase2_private_key_str = g_strdup (nm_setting_802_1x_get_phase2_private_key_path (s_8021X)); + + nmc->allowed_fields[0].value = NM_SETTING_802_1X_SETTING_NAME; + nmc->allowed_fields[1].value = eap_str->str; + nmc->allowed_fields[2].value = nm_setting_802_1x_get_identity (s_8021X); + nmc->allowed_fields[3].value = nm_setting_802_1x_get_anonymous_identity (s_8021X); + nmc->allowed_fields[4].value = ca_cert_str; + nmc->allowed_fields[5].value = nm_setting_802_1x_get_ca_path (s_8021X); + nmc->allowed_fields[6].value = client_cert_str; + nmc->allowed_fields[7].value = nm_setting_802_1x_get_phase1_peapver (s_8021X); + nmc->allowed_fields[8].value = nm_setting_802_1x_get_phase1_peaplabel (s_8021X); + nmc->allowed_fields[9].value = nm_setting_802_1x_get_phase1_fast_provisioning (s_8021X); + nmc->allowed_fields[10].value = nm_setting_802_1x_get_phase2_auth (s_8021X); + nmc->allowed_fields[11].value = nm_setting_802_1x_get_phase2_autheap (s_8021X); + nmc->allowed_fields[12].value = phase2_ca_cert_str; + nmc->allowed_fields[13].value = nm_setting_802_1x_get_phase2_ca_path (s_8021X); + nmc->allowed_fields[14].value = phase2_client_cert_str; + nmc->allowed_fields[15].value = nm_setting_802_1x_get_password (s_8021X); + nmc->allowed_fields[16].value = private_key_str; + nmc->allowed_fields[17].value = nm_setting_802_1x_get_private_key_password (s_8021X); + nmc->allowed_fields[18].value = phase2_private_key_str; + nmc->allowed_fields[19].value = nm_setting_802_1x_get_phase2_private_key_password (s_8021X); + nmc->allowed_fields[20].value = nm_setting_802_1x_get_pin (s_8021X); + nmc->allowed_fields[21].value = nm_setting_802_1x_get_psk (s_8021X); + nmc->allowed_fields[22].value = nm_setting_802_1x_get_system_ca_certs (s_8021X) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (ca_cert_str); + g_free (client_cert_str); + g_free (phase2_ca_cert_str); + g_free (phase2_client_cert_str); + g_free (private_key_str); + g_free (phase2_private_key_str); + g_string_free (eap_str, TRUE); + + return TRUE; +} + +gboolean +setting_wireless_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingWireless *s_wireless; + int i; + const GByteArray *ssid, *bssid, *mac; + char *ssid_str, *channel_str, *rate_str, *tx_power_str, *mtu_str; + char *mac_str = NULL, *bssid_str = NULL; + GString *seen_bssids; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE); + s_wireless = (NMSettingWireless *) setting; + + nmc->allowed_fields = nmc_fields_setting_wireless; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRELESS_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + ssid = nm_setting_wireless_get_ssid (s_wireless); + ssid_str = ssid_to_printable ((const char *) ssid->data, ssid->len); + channel_str = g_strdup_printf ("%d", nm_setting_wireless_get_channel (s_wireless)); + rate_str = g_strdup_printf ("%d", nm_setting_wireless_get_rate (s_wireless)); + bssid = nm_setting_wireless_get_bssid (s_wireless); + if (bssid) + bssid_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", bssid->data[0], bssid->data[1], bssid->data[2], bssid->data[3], bssid->data[4], bssid->data[5]); + tx_power_str = g_strdup_printf ("%d", nm_setting_wireless_get_tx_power (s_wireless)); + mtu_str = g_strdup_printf ("%d", nm_setting_wireless_get_mtu (s_wireless)); + mac = nm_setting_wireless_get_mac_address (s_wireless); + if (mac) + mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]); + seen_bssids = g_string_new (NULL); + for (i = 0; i < nm_setting_wireless_get_num_seen_bssids (s_wireless); i++) { + if (i > 0) + g_string_append_c (seen_bssids, ','); + g_string_append (seen_bssids, nm_setting_wireless_get_seen_bssid (s_wireless, i)); + } + + nmc->allowed_fields[0].value = NM_SETTING_WIRELESS_SETTING_NAME; + nmc->allowed_fields[1].value = ssid_str; + nmc->allowed_fields[2].value = nm_setting_wireless_get_mode (s_wireless); + nmc->allowed_fields[3].value = nm_setting_wireless_get_band (s_wireless); + nmc->allowed_fields[4].value = channel_str; + nmc->allowed_fields[5].value = bssid_str ? bssid_str : _("not set"); + nmc->allowed_fields[6].value = rate_str; + nmc->allowed_fields[7].value = tx_power_str; + nmc->allowed_fields[8].value = mac_str ? mac_str : _("not set"); + nmc->allowed_fields[9].value = strcmp (mtu_str, "0") ? mtu_str : _("auto"); + nmc->allowed_fields[10].value = seen_bssids->str; + nmc->allowed_fields[11].value = nm_setting_wireless_get_security (s_wireless); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (ssid_str); + g_free (channel_str); + g_free (bssid_str); + g_free (rate_str); + g_free (tx_power_str); + g_free (mac_str); + g_free (mtu_str); + g_string_free (seen_bssids, TRUE); + + return TRUE; +} + +gboolean +setting_wireless_security_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingWirelessSecurity *s_wireless_sec; + int i; + char *wep_tx_keyidx_str, *wep_key_type_str; + GString *protos, *pairwises, *groups; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE); + s_wireless_sec = (NMSettingWirelessSecurity *) setting; + + nmc->allowed_fields = nmc_fields_setting_wireless_security; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRELESS_SECURITY_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + wep_tx_keyidx_str = g_strdup_printf ("%d", nm_setting_wireless_security_get_wep_tx_keyidx (s_wireless_sec)); + protos = g_string_new (NULL); + for (i = 0; i < nm_setting_wireless_security_get_num_protos (s_wireless_sec); i++) { + if (i > 0) + g_string_append_c (protos, ','); + g_string_append (protos, nm_setting_wireless_security_get_proto (s_wireless_sec, i)); + } + pairwises = g_string_new (NULL); + for (i = 0; i < nm_setting_wireless_security_get_num_pairwise (s_wireless_sec); i++) { + if (i > 0) + g_string_append_c (pairwises, ','); + g_string_append (pairwises, nm_setting_wireless_security_get_pairwise (s_wireless_sec, i)); + } + groups = g_string_new (NULL); + for (i = 0; i < nm_setting_wireless_security_get_num_groups (s_wireless_sec); i++) { + if (i > 0) + g_string_append_c (groups, ','); + g_string_append (groups, nm_setting_wireless_security_get_group (s_wireless_sec, i)); + } + wep_key_type_str = wep_key_type_to_string (nm_setting_wireless_security_get_wep_key_type (s_wireless_sec)); + + nmc->allowed_fields[0].value = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_wireless_security_get_key_mgmt (s_wireless_sec); + nmc->allowed_fields[2].value = wep_tx_keyidx_str; + nmc->allowed_fields[3].value = nm_setting_wireless_security_get_auth_alg (s_wireless_sec); + nmc->allowed_fields[4].value = protos->str; + nmc->allowed_fields[5].value = pairwises->str; + nmc->allowed_fields[6].value = groups->str; + nmc->allowed_fields[7].value = nm_setting_wireless_security_get_leap_username (s_wireless_sec); + nmc->allowed_fields[8].value = nm_setting_wireless_security_get_wep_key (s_wireless_sec, 0); + nmc->allowed_fields[9].value = nm_setting_wireless_security_get_wep_key (s_wireless_sec, 1); + nmc->allowed_fields[10].value = nm_setting_wireless_security_get_wep_key (s_wireless_sec, 2); + nmc->allowed_fields[11].value = nm_setting_wireless_security_get_wep_key (s_wireless_sec, 3); + nmc->allowed_fields[12].value = nm_setting_wireless_security_get_psk (s_wireless_sec); + nmc->allowed_fields[13].value = nm_setting_wireless_security_get_leap_password (s_wireless_sec); + nmc->allowed_fields[14].value = wep_key_type_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (wep_tx_keyidx_str); + g_free (wep_key_type_str); + g_string_free (protos, TRUE); + g_string_free (pairwises, TRUE); + g_string_free (groups, TRUE); + + return TRUE; +} + +gboolean +setting_ip4_config_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingIP4Config *s_ip4; + GString *dns_str, *dns_search_str, *addr_str, *route_str; + int i, num; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE); + s_ip4 = (NMSettingIP4Config *) setting; + + nmc->allowed_fields = nmc_fields_setting_ip4_config; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_IP4_CONFIG_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + dns_str = g_string_new (NULL); + num = nm_setting_ip4_config_get_num_dns (s_ip4); + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN]; + guint32 ip; + + ip = nm_setting_ip4_config_get_dns (s_ip4, i); + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET, (const void *) &ip, buf, sizeof (buf)); + if (i > 0) + g_string_append (dns_str, ", "); + g_string_append (dns_str, buf); + } + + dns_search_str = g_string_new (NULL); + num = nm_setting_ip4_config_get_num_dns_searches (s_ip4); + for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_setting_ip4_config_get_dns_search (s_ip4, i); + if (i > 0) + g_string_append (dns_search_str, ", "); + g_string_append (dns_search_str, domain); + } + + addr_str = g_string_new (NULL); + num = nm_setting_ip4_config_get_num_addresses (s_ip4); + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN]; + char *tmp; + NMIP4Address *addr; + guint32 ip; + + if (i > 0) + g_string_append (addr_str, "; "); + + g_string_append (addr_str, "{ "); + + 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, sizeof (buf)); + g_string_append_printf (addr_str, "ip = %s", buf); + + tmp = g_strdup_printf ("/%u", nm_ip4_address_get_prefix (addr)); + g_string_append (addr_str, tmp); + g_free (tmp); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_address_get_gateway (addr); + inet_ntop (AF_INET, (const void *) &ip, buf, sizeof (buf)); + g_string_append_printf (addr_str, ", gw = %s", buf); + + g_string_append (addr_str, " }"); + } + + route_str = g_string_new (NULL); + num = nm_setting_ip4_config_get_num_routes (s_ip4); + for (i = 0; i < num; i++) { + char buf[INET_ADDRSTRLEN]; + char *tmp; + NMIP4Route *route; + guint32 ip; + + if (i > 0) + g_string_append (route_str, "; "); + + g_string_append (route_str, "{ "); + + 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, sizeof (buf)); + g_string_append_printf (route_str, "dst = %s", buf); + + tmp = g_strdup_printf ("/%u", nm_ip4_route_get_prefix (route)); + g_string_append (route_str, tmp); + g_free (tmp); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip4_route_get_next_hop (route); + inet_ntop (AF_INET, (const void *) &ip, buf, sizeof (buf)); + g_string_append_printf (route_str, ", nh = %s", buf); + + tmp = g_strdup_printf (", mt = %u", nm_ip4_route_get_metric (route)); + g_string_append (route_str, tmp); + g_free (tmp); + + g_string_append (route_str, " }"); + } + + nmc->allowed_fields[0].value = NM_SETTING_IP4_CONFIG_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_ip4_config_get_method (s_ip4); + nmc->allowed_fields[2].value = dns_str->str; + nmc->allowed_fields[3].value = dns_search_str->str; + nmc->allowed_fields[4].value = addr_str->str; + nmc->allowed_fields[5].value = route_str->str; + nmc->allowed_fields[6].value = nm_setting_ip4_config_get_ignore_auto_routes (s_ip4) ? _("yes") : _("no"); + nmc->allowed_fields[7].value = nm_setting_ip4_config_get_ignore_auto_dns (s_ip4) ? _("yes") : _("no"); + nmc->allowed_fields[8].value = nm_setting_ip4_config_get_dhcp_client_id (s_ip4); + nmc->allowed_fields[9].value = nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) ? _("yes") : _("no"); + nmc->allowed_fields[10].value = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); + nmc->allowed_fields[11].value = nm_setting_ip4_config_get_never_default (s_ip4) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_string_free (dns_str, TRUE); + g_string_free (dns_search_str, TRUE); + g_string_free (addr_str, TRUE); + g_string_free (route_str, TRUE); + + return TRUE; +} + +gboolean +setting_ip6_config_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingIP6Config *s_ip6; + GString *dns_str, *dns_search_str, *addr_str, *route_str; + int i, num; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE); + s_ip6 = (NMSettingIP6Config *) setting; + + nmc->allowed_fields = nmc_fields_setting_ip6_config; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_IP6_CONFIG_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + dns_str = g_string_new (NULL); + num = nm_setting_ip6_config_get_num_dns (s_ip6); + for (i = 0; i < num; i++) { + char buf[INET6_ADDRSTRLEN]; + const struct in6_addr *ip; + + ip = nm_setting_ip6_config_get_dns (s_ip6, i); + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + if (i > 0) + g_string_append (dns_str, ", "); + g_string_append (dns_str, buf); + } + + dns_search_str = g_string_new (NULL); + num = nm_setting_ip6_config_get_num_dns_searches (s_ip6); + for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_setting_ip6_config_get_dns_search (s_ip6, i); + if (i > 0) + g_string_append (dns_search_str, ", "); + g_string_append (dns_search_str, domain); + } + + addr_str = g_string_new (NULL); + num = nm_setting_ip6_config_get_num_addresses (s_ip6); + for (i = 0; i < num; i++) { + char buf[INET6_ADDRSTRLEN]; + char *tmp; + NMIP6Address *addr; + const struct in6_addr *ip; + + if (i > 0) + g_string_append (addr_str, "; "); + + g_string_append (addr_str, "{ "); + + addr = nm_setting_ip6_config_get_address (s_ip6, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip6_address_get_address (addr); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + g_string_append_printf (addr_str, "ip = %s", buf); + + tmp = g_strdup_printf ("/%u", nm_ip6_address_get_prefix (addr)); + g_string_append (addr_str, tmp); + g_free (tmp); + + g_string_append (addr_str, " }"); + } + + route_str = g_string_new (NULL); + num = nm_setting_ip6_config_get_num_routes (s_ip6); + for (i = 0; i < num; i++) { + char buf[INET6_ADDRSTRLEN]; + char *tmp; + NMIP6Route *route; + const struct in6_addr *ip; + + if (i > 0) + g_string_append (route_str, "; "); + + g_string_append (route_str, "{ "); + + route = nm_setting_ip6_config_get_route (s_ip6, i); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip6_route_get_dest (route); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + g_string_append_printf (route_str, "dst = %s", buf); + + tmp = g_strdup_printf ("/%u", nm_ip6_route_get_prefix (route)); + g_string_append (route_str, tmp); + g_free (tmp); + + memset (buf, 0, sizeof (buf)); + ip = nm_ip6_route_get_next_hop (route); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + g_string_append_printf (route_str, ", nh = %s", buf); + + tmp = g_strdup_printf (", mt = %u", nm_ip6_route_get_metric (route)); + g_string_append (route_str, tmp); + g_free (tmp); + + g_string_append (route_str, " }"); + } + + nmc->allowed_fields[0].value = NM_SETTING_IP6_CONFIG_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_ip6_config_get_method (s_ip6); + nmc->allowed_fields[2].value = dns_str->str; + nmc->allowed_fields[3].value = dns_search_str->str; + nmc->allowed_fields[4].value = addr_str->str; + nmc->allowed_fields[5].value = route_str->str; + nmc->allowed_fields[6].value = nm_setting_ip6_config_get_ignore_auto_routes (s_ip6) ? _("yes") : _("no"); + nmc->allowed_fields[7].value = nm_setting_ip6_config_get_ignore_auto_dns (s_ip6) ? _("yes") : _("no"); + nmc->allowed_fields[8].value = nm_setting_ip6_config_get_never_default (s_ip6) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_string_free (dns_str, TRUE); + g_string_free (dns_search_str, TRUE); + g_string_free (addr_str, TRUE); + g_string_free (route_str, TRUE); + + return TRUE; +} + +gboolean +setting_serial_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingSerial *s_serial; + char *baud_str, *bits_str, *parity_str, *stopbits_str, *send_delay_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_SERIAL (setting), FALSE); + s_serial = (NMSettingSerial *) setting; + + nmc->allowed_fields = nmc_fields_setting_serial; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_SERIAL_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + baud_str = g_strdup_printf ("%d", nm_setting_serial_get_baud (s_serial)); + bits_str = g_strdup_printf ("%d", nm_setting_serial_get_bits (s_serial)); + parity_str = g_strdup_printf ("%c", nm_setting_serial_get_parity (s_serial)); + stopbits_str = g_strdup_printf ("%d", nm_setting_serial_get_stopbits (s_serial)); + send_delay_str = g_strdup_printf ("%" G_GUINT64_FORMAT, nm_setting_serial_get_send_delay (s_serial)); + + nmc->allowed_fields[0].value = NM_SETTING_SERIAL_SETTING_NAME; + nmc->allowed_fields[1].value = baud_str; + nmc->allowed_fields[2].value = bits_str; + nmc->allowed_fields[3].value = parity_str; + nmc->allowed_fields[4].value = stopbits_str; + nmc->allowed_fields[5].value = send_delay_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (baud_str); + g_free (bits_str); + g_free (parity_str); + g_free (stopbits_str); + g_free (send_delay_str); + + return TRUE; +} + +gboolean +setting_ppp_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingPPP *s_ppp; + char *baud_str, *mru_str, *mtu_str, *lcp_echo_failure_str, *lcp_echo_interval_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + s_ppp = (NMSettingPPP *) setting; + + nmc->allowed_fields = nmc_fields_setting_ppp; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_PPP_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + baud_str = g_strdup_printf ("%d", nm_setting_ppp_get_baud (s_ppp)); + mru_str = g_strdup_printf ("%d", nm_setting_ppp_get_mru (s_ppp)); + mtu_str = g_strdup_printf ("%d", nm_setting_ppp_get_mtu (s_ppp)); + lcp_echo_failure_str = g_strdup_printf ("%d", nm_setting_ppp_get_lcp_echo_failure (s_ppp)); + lcp_echo_interval_str = g_strdup_printf ("%d", nm_setting_ppp_get_lcp_echo_interval (s_ppp)); + + nmc->allowed_fields[0].value = NM_SETTING_PPP_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_ppp_get_noauth (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[2].value = nm_setting_ppp_get_refuse_eap (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[3].value = nm_setting_ppp_get_refuse_pap (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[4].value = nm_setting_ppp_get_refuse_chap (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[5].value = nm_setting_ppp_get_refuse_mschap (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[6].value = nm_setting_ppp_get_refuse_mschapv2 (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[7].value = nm_setting_ppp_get_nobsdcomp (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[8].value = nm_setting_ppp_get_nodeflate (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[9].value = nm_setting_ppp_get_no_vj_comp (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[10].value = nm_setting_ppp_get_require_mppe (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[11].value = nm_setting_ppp_get_require_mppe_128 (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[12].value = nm_setting_ppp_get_mppe_stateful (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[13].value = nm_setting_ppp_get_crtscts (s_ppp) ? _("yes") : _("no"); + nmc->allowed_fields[14].value = baud_str; + nmc->allowed_fields[15].value = mru_str; + nmc->allowed_fields[16].value = mtu_str; + nmc->allowed_fields[17].value = lcp_echo_failure_str; + nmc->allowed_fields[18].value = lcp_echo_interval_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (baud_str); + g_free (mru_str); + g_free (mtu_str); + g_free (lcp_echo_failure_str); + g_free (lcp_echo_interval_str); + + return TRUE; +} + +gboolean +setting_pppoe_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingPPPOE *s_pppoe; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_PPPOE (setting), FALSE); + s_pppoe = (NMSettingPPPOE *) setting; + + nmc->allowed_fields = nmc_fields_setting_pppoe; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_PPPOE_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + nmc->allowed_fields[0].value = NM_SETTING_PPPOE_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_pppoe_get_service (s_pppoe); + nmc->allowed_fields[2].value = nm_setting_pppoe_get_username (s_pppoe); + nmc->allowed_fields[3].value = nm_setting_pppoe_get_password (s_pppoe); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + return TRUE; +} + +gboolean +setting_gsm_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingGsm *s_gsm; + char *network_type_str, *allowed_bands_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), FALSE); + s_gsm = (NMSettingGsm *) setting; + + nmc->allowed_fields = nmc_fields_setting_gsm; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_GSM_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + network_type_str = g_strdup_printf ("%d", nm_setting_gsm_get_network_type (s_gsm)); + allowed_bands_str = allowed_bands_to_string (nm_setting_gsm_get_allowed_bands (s_gsm)); + + nmc->allowed_fields[0].value = NM_SETTING_GSM_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_gsm_get_number (s_gsm); + nmc->allowed_fields[2].value = nm_setting_gsm_get_username (s_gsm); + nmc->allowed_fields[3].value = nm_setting_gsm_get_password (s_gsm); + nmc->allowed_fields[4].value = nm_setting_gsm_get_apn (s_gsm); + nmc->allowed_fields[5].value = nm_setting_gsm_get_network_id (s_gsm); + nmc->allowed_fields[6].value = network_type_str; + nmc->allowed_fields[7].value = allowed_bands_str; + nmc->allowed_fields[8].value = nm_setting_gsm_get_pin (s_gsm); + nmc->allowed_fields[9].value = nm_setting_gsm_get_home_only (s_gsm) ? _("yes") : _("no"); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (network_type_str); + g_free (allowed_bands_str); + + return TRUE; +} + +gboolean +setting_cdma_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingCdma *s_cdma; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_CDMA (setting), FALSE); + s_cdma = (NMSettingCdma *) setting; + + nmc->allowed_fields = nmc_fields_setting_cdma; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_CDMA_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + nmc->allowed_fields[0].value = NM_SETTING_CDMA_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_cdma_get_number (s_cdma); + nmc->allowed_fields[2].value = nm_setting_cdma_get_username (s_cdma); + nmc->allowed_fields[3].value = nm_setting_cdma_get_password (s_cdma); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + return TRUE; +} + +gboolean +setting_bluetooth_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingBluetooth *s_bluetooth; + const GByteArray *bdaddr; + char *bdaddr_str = NULL; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_BLUETOOTH (setting), FALSE); + s_bluetooth = (NMSettingBluetooth *) setting; + + nmc->allowed_fields = nmc_fields_setting_bluetooth; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_BLUETOOTH_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + bdaddr = nm_setting_bluetooth_get_bdaddr (s_bluetooth); + if (bdaddr) + bdaddr_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", bdaddr->data[0], bdaddr->data[1], bdaddr->data[2], + bdaddr->data[3], bdaddr->data[4], bdaddr->data[5]); + nmc->allowed_fields[0].value = NM_SETTING_BLUETOOTH_SETTING_NAME; + nmc->allowed_fields[1].value = bdaddr_str; + nmc->allowed_fields[2].value = nm_setting_bluetooth_get_connection_type (s_bluetooth); + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (bdaddr_str); + + return TRUE; +} + +gboolean +setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingOlpcMesh *s_olpc_mesh; + const GByteArray *ssid, *dhcp_anycast; + char *ssid_str, *channel_str, *dhcp_anycast_str = NULL; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_OLPC_MESH (setting), FALSE); + s_olpc_mesh = (NMSettingOlpcMesh *) setting; + + nmc->allowed_fields = nmc_fields_setting_olpc_mesh; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_OLPC_MESH_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + ssid = nm_setting_olpc_mesh_get_ssid (s_olpc_mesh); + ssid_str = ssid_to_printable ((const char *) ssid->data, ssid->len); + channel_str = g_strdup_printf ("%d", nm_setting_olpc_mesh_get_channel (s_olpc_mesh)); + dhcp_anycast = nm_setting_olpc_mesh_get_dhcp_anycast_address (s_olpc_mesh); + if (dhcp_anycast) + dhcp_anycast_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", dhcp_anycast->data[0], dhcp_anycast->data[1], dhcp_anycast->data[2], + dhcp_anycast->data[3], dhcp_anycast->data[4], dhcp_anycast->data[5]); + nmc->allowed_fields[0].value = NM_SETTING_OLPC_MESH_SETTING_NAME; + nmc->allowed_fields[1].value = ssid_str; + nmc->allowed_fields[2].value = channel_str; + nmc->allowed_fields[3].value = dhcp_anycast_str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_free (ssid_str); + g_free (channel_str); + g_free (dhcp_anycast_str); + + return TRUE; +} + +static void +vpn_data_item (const char *key, const char *value, gpointer user_data) +{ + GString *ret_str = (GString *) user_data; + + if (ret_str->len != 0) + g_string_append (ret_str, ", "); + + g_string_append_printf (ret_str, "%s = %s", key, value); +} + +gboolean +setting_vpn_details (NMSetting *setting, NmCli *nmc) +{ + NMSettingVPN *s_vpn; + GString *data_item_str, *secret_str; + guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0; + guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0; + guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0; + + g_return_val_if_fail (NM_IS_SETTING_VPN (setting), FALSE); + s_vpn = (NMSettingVPN *) setting; + + nmc->allowed_fields = nmc_fields_setting_vpn; + nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_VPN_ALL, nmc->allowed_fields, NULL); + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */ + + data_item_str = g_string_new (NULL); + secret_str = g_string_new (NULL); + nm_setting_vpn_foreach_data_item (s_vpn, &vpn_data_item, data_item_str); + nm_setting_vpn_foreach_secret (s_vpn, &vpn_data_item, secret_str); + + nmc->allowed_fields[0].value = NM_SETTING_VPN_SETTING_NAME; + nmc->allowed_fields[1].value = nm_setting_vpn_get_service_type (s_vpn); + nmc->allowed_fields[2].value = nm_setting_vpn_get_user_name (s_vpn); + nmc->allowed_fields[3].value = data_item_str->str; + nmc->allowed_fields[4].value = secret_str->str; + + nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX; + print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */ + + g_string_free (data_item_str, TRUE); + g_string_free (secret_str, TRUE); + + return TRUE; +} + diff --git a/cli/src/settings.h b/cli/src/settings.h new file mode 100644 index 00000000..aec71551 --- /dev/null +++ b/cli/src/settings.h @@ -0,0 +1,59 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_SETTINGS_H +#define NMC_SETTINGS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nmcli.h" +#include "utils.h" + + +gboolean setting_connection_details (NMSetting *setting, NmCli *nmc); +gboolean setting_wired_details (NMSetting *setting, NmCli *nmc); +gboolean setting_802_1X_details (NMSetting *setting, NmCli *nmc); +gboolean setting_wireless_details (NMSetting *setting, NmCli *nmc); +gboolean setting_wireless_security_details (NMSetting *setting, NmCli *nmc); +gboolean setting_ip4_config_details (NMSetting *setting, NmCli *nmc); +gboolean setting_ip6_config_details (NMSetting *setting, NmCli *nmc); +gboolean setting_serial_details (NMSetting *setting, NmCli *nmc); +gboolean setting_ppp_details (NMSetting *setting, NmCli *nmc); +gboolean setting_pppoe_details (NMSetting *setting, NmCli *nmc); +gboolean setting_gsm_details (NMSetting *setting, NmCli *nmc); +gboolean setting_cdma_details (NMSetting *setting, NmCli *nmc); +gboolean setting_bluetooth_details (NMSetting *setting, NmCli *nmc); +gboolean setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc); +gboolean setting_vpn_details (NMSetting *setting, NmCli *nmc); + +#endif /* NMC_SETTINGS_H */ diff --git a/cli/src/utils.c b/cli/src/utils.c new file mode 100644 index 00000000..0096a0ae --- /dev/null +++ b/cli/src/utils.c @@ -0,0 +1,298 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#include +#include + +#include +#include + +#include "utils.h" + +int +matches (const char *cmd, const char *pattern) +{ + int len = strlen (cmd); + if (len > strlen (pattern)) + return -1; + return memcmp (pattern, cmd, len); +} + +int +next_arg (int *argc, char ***argv) +{ + if (*argc <= 1) { + return -1; + } + else { + (*argc)--; + (*argv)++; + } + return 0; +} + +/* + * Convert SSID to a printable form. + * If it is an UTF-8 string, enclose it in quotes and return it. + * Otherwise convert it to a hex string representation. + * Caller has to free the returned string using g_free() + */ +char * +ssid_to_printable (const char *str, gsize len) +{ + GString *printable; + char *printable_str; + int i; + + if (str == NULL || len == 0) + return NULL; + + if (g_utf8_validate (str, len, NULL)) + return g_strdup_printf ("'%.*s'", (int) len, str); + + printable = g_string_new (NULL); + for (i = 0; i < len; i++) { + g_string_append_printf (printable, "%02X", (unsigned char) str[i]); + } + printable_str = g_string_free (printable, FALSE); + return printable_str; +} + +/* + * 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; + + 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); + } + return width; +} + +/* + * Parse comma separated fields in 'fields_str' according to 'fields_array'. + * IN: 'field_str': comma-separated fields names + * 'fields_array': array of allowed fields + * RETURN: GArray with indices representing fields in 'fields_array'. + * Caller is responsible to free it. + */ +GArray * +parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error) +{ + char **fields, **iter; + GArray *array; + int i; + + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + array = g_array_new (FALSE, FALSE, sizeof (int)); + + /* Split supplied fields string */ + fields = g_strsplit_set (fields_str, ",", -1); + for (iter = fields; iter && *iter; iter++) { + for (i = 0; fields_array[i].name; i++) { + if (strcasecmp (*iter, fields_array[i].name) == 0) { + g_array_append_val (array, i); + break; + } + } + if (fields_array[i].name == NULL) { + if (!strcasecmp (*iter, "all") || !strcasecmp (*iter, "common")) + g_set_error (error, 0, 0, _("field '%s' has to be alone"), *iter); + + else + g_set_error (error, 0, 1, _("invalid field '%s'"), *iter); + g_array_free (array, TRUE); + array = NULL; + goto done; + } + } +done: + if (fields) + g_strfreev (fields); + return array; +} + +gboolean +nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error) +{ + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + if (print_output == NMC_PRINT_TERSE) { + if (!fields) { + g_set_error (error, 0, 0, _("Option '--terse' requires specifying '--fields'")); + return FALSE; + } else if ( !strcasecmp (fields, "all") + || !strcasecmp (fields, "common")) { + g_set_error (error, 0, 0, _("Option '--terse' requires specific '--fields' option values , not '%s'"), fields); + return FALSE; + } + } + return TRUE; +} + +/* + * Print both headers or values of 'field_values' array. + * Entries to print and their order are specified via indices + * in 'fields.indices' array. + * 'fields.flags' specify various aspects influencing the output. + */ +void +print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]) +{ + GString *str; + int width1, width2; + int table_width = 0; + char *line = NULL; + char *indent_str; + const char *value; + const char *not_set_str = _("not set"); + int i, idx; + gboolean multiline = fields.flags & NMC_PF_FLAG_MULTILINE; + gboolean terse = fields.flags & NMC_PF_FLAG_TERSE; + gboolean pretty = fields.flags & NMC_PF_FLAG_PRETTY; + gboolean main_header_add = fields.flags & NMC_PF_FLAG_MAIN_HEADER_ADD; + gboolean main_header_only = fields.flags & NMC_PF_FLAG_MAIN_HEADER_ONLY; + gboolean field_names = fields.flags & NMC_PF_FLAG_FIELD_NAMES; + gboolean escape = fields.flags & NMC_PF_FLAG_ESCAPE; + gboolean section_prefix = fields.flags & NMC_PF_FLAG_SECTION_PREFIX; + gboolean main_header = main_header_add || main_header_only; + + /* No headers are printed in terse mode: + * - neither main header nor field (column) names + */ + if ((main_header_only || field_names) && terse) + return; + + if (multiline) { + /* --- Multiline mode --- */ + enum { ML_HEADER_WIDTH = 79 }; + if (main_header && pretty) { + /* Print the main header */ + int header_width = nmc_string_screen_width (fields.header_name, NULL) + 4; + table_width = header_width < ML_HEADER_WIDTH ? ML_HEADER_WIDTH : header_width; + + line = g_strnfill (ML_HEADER_WIDTH, '='); + width1 = strlen (fields.header_name); + width2 = nmc_string_screen_width (fields.header_name, NULL); + printf ("%s\n", line); + printf ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name); + printf ("%s\n", line); + g_free (line); + } + + /* Print values */ + if (!main_header_only && !field_names) { + for (i = 0; i < fields.indices->len; i++) { + char *tmp; + idx = g_array_index (fields.indices, int, i); + if (section_prefix && idx == 0) /* The first field is section prefix */ + continue; + tmp = g_strdup_printf ("%s%s%s:", section_prefix ? field_values[0].value : "", + section_prefix ? "." : "", + _(field_values[idx].name_l10n)); + printf ("%-*s%s\n", terse ? 0 : 32, tmp, field_values[idx].value ? field_values[idx].value : not_set_str); + g_free (tmp); + } + if (pretty) { + line = g_strnfill (ML_HEADER_WIDTH, '-'); + printf ("%s\n", line); + g_free (line); + } + } + return; + } + + /* --- Tabular mode: each line = one object --- */ + str = g_string_new (NULL); + + for (i = 0; i < fields.indices->len; i++) { + idx = g_array_index (fields.indices, int, i); + if (field_names) + value = _(field_values[idx].name_l10n); + else + value = field_values[idx].value ? field_values[idx].value : not_set_str; + if (terse) { + if (escape) { + const char *p = value; + while (*p) { + if (*p == ':' || *p == '\\') + g_string_append_c (str, '\\'); /* Escaping by '\' */ + g_string_append_c (str, *p); + p++; + } + } + else + g_string_append_printf (str, "%s", value); + g_string_append_c (str, ':'); /* Column separator */ + } else { + width1 = strlen (value); + width2 = nmc_string_screen_width (value, NULL); /* Width of the string (in screen colums) */ + if (strlen (value) == 0) + value = "--"; + g_string_append_printf (str, "%-*s", field_values[idx].width + width1 - width2, value); + g_string_append_c (str, ' '); /* Column separator */ + table_width += field_values[idx].width + width1 - width2 + 1; + } + } + + /* Print the main table header */ + if (main_header && pretty) { + int header_width = nmc_string_screen_width (fields.header_name, NULL) + 4; + table_width = table_width < header_width ? header_width : table_width; + + line = g_strnfill (table_width, '='); + width1 = strlen (fields.header_name); + width2 = nmc_string_screen_width (fields.header_name, NULL); + printf ("%s\n", line); + printf ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name); + printf ("%s\n", line); + g_free (line); + } + + /* Print actual values */ + if (!main_header_only && str->len > 0) { + g_string_truncate (str, str->len-1); /* Chop off last column separator */ + if (fields.indent > 0) { + indent_str = g_strnfill (fields.indent, ' '); + g_string_prepend (str, indent_str); + g_free (indent_str); + } + printf ("%s\n", str->str); + } + + /* Print horizontal separator */ + if (!main_header_only && field_names && pretty) { + if (str->len > 0) { + line = g_strnfill (table_width, '-'); + printf ("%s\n", line); + g_free (line); + } + } + + g_string_free (str, TRUE); +} + diff --git a/cli/src/utils.h b/cli/src/utils.h new file mode 100644 index 00000000..308f6401 --- /dev/null +++ b/cli/src/utils.h @@ -0,0 +1,36 @@ +/* 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. + * + * (C) Copyright 2010 Red Hat, Inc. + */ + +#ifndef NMC_UTILS_H +#define NMC_UTILS_H + +#include + +#include "nmcli.h" + +/* === Functions === */ +int matches (const char *cmd, const char *pattern); +int next_arg (int *argc, char ***argv); +char *ssid_to_printable (const char *str, gsize len); +int nmc_string_screen_width (const char *start, const char *end); +GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error); +gboolean nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error); +void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]); + +#endif /* NMC_UTILS_H */ diff --git a/compile b/compile new file mode 100755 index 00000000..c0096a7b --- /dev/null +++ b/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-10-06.20; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess new file mode 100755 index 00000000..dc84c68e --- /dev/null +++ b/config.guess @@ -0,0 +1,1501 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# This file 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 00000000..70efa3a5 --- /dev/null +++ b/config.h.in @@ -0,0 +1,220 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* always defined to indicate that i18n is enabled */ +#undef ENABLE_NLS + +/* Gettext package */ +#undef GETTEXT_PACKAGE + +/* Define to 1 if you have the `bind_textdomain_codeset' function. */ +#undef HAVE_BIND_TEXTDOMAIN_CODESET + +/* Define to 1 if you have the `dcgettext' function. */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define if you have libgnutls */ +#undef HAVE_GNUTLS + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if your file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have NSS */ +#undef HAVE_NSS + +/* Define to 1 if you have the header file. */ +#undef HAVE_PATHS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PPPD_PPPD_H + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the `uname' function. */ +#undef HAVE_UNAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to path of iptables binary */ +#undef IPTABLES_PATH + +/* Define this to hack around buggy libnl rtnl_addr caching */ +#undef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Define the distribution version string */ +#undef NM_DIST_VERSION + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if you have a resolvconf implementation */ +#undef RESOLVCONF_PATH + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to path to system CA certificates */ +#undef SYSTEM_CA_PATH + +/* Define if you have Arch */ +#undef TARGET_ARCH + +/* Define if you have Debian */ +#undef TARGET_DEBIAN + +/* Define if you have Frugalware */ +#undef TARGET_FRUGALWARE + +/* Define if you have Gentoo */ +#undef TARGET_GENTOO + +/* Define if you have Mandriva */ +#undef TARGET_MANDRIVA + +/* Define if you have Paldo */ +#undef TARGET_PALDO + +/* Define if you have Pardus */ +#undef TARGET_PARDUS + +/* Define if you have Fedora or RHEL */ +#undef TARGET_REDHAT + +/* Define if you have Slackware */ +#undef TARGET_SLACKWARE + +/* Define if you have OpenSUSE or SLES */ +#undef TARGET_SUSE + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Version number of package */ +#undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Define to `int' if does not define. */ +#undef mode_t + +/* Define to `int' if does not define. */ +#undef pid_t diff --git a/config.sub b/config.sub new file mode 100755 index 00000000..2a55a507 --- /dev/null +++ b/config.sub @@ -0,0 +1,1705 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 00000000..e78da0e2 --- /dev/null +++ b/configure @@ -0,0 +1,18359 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.65 for NetworkManager 0.8.1. +# +# Report bugs to . +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and dcbw@redhat.com +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='NetworkManager' +PACKAGE_TARNAME='NetworkManager' +PACKAGE_VERSION='0.8.1' +PACKAGE_STRING='NetworkManager 0.8.1' +PACKAGE_BUGREPORT='dcbw@redhat.com' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +WITH_TESTS_FALSE +WITH_TESTS_TRUE +GTK_DOC_USE_REBASE_FALSE +GTK_DOC_USE_REBASE_TRUE +GTK_DOC_USE_LIBTOOL_FALSE +GTK_DOC_USE_LIBTOOL_TRUE +GTK_DOC_BUILD_PDF_FALSE +GTK_DOC_BUILD_PDF_TRUE +GTK_DOC_BUILD_HTML_FALSE +GTK_DOC_BUILD_HTML_TRUE +ENABLE_GTK_DOC_FALSE +ENABLE_GTK_DOC_TRUE +HTML_DIR +GTKDOC_MKPDF +GTKDOC_REBASE +GTKDOC_CHECK +SYSTEM_CA_PATH +IPTABLES_PATH +RESOLVCONF_PATH +DHCPCD_PATH +DHCLIENT_PATH +PPPD_PLUGIN_DIR +DBUS_SYS_DIR +GLIB_GENMARSHAL +WITH_GNUTLS_FALSE +WITH_GNUTLS_TRUE +WITH_NSS_FALSE +WITH_NSS_TRUE +LIBGCRYPT_LIBS +LIBGCRYPT_CFLAGS +LIBGCRYPT_CONFIG +GNUTLS_LIBS +GNUTLS_CFLAGS +NSS_LIBS +NSS_CFLAGS +POLKIT_LIBS +POLKIT_CFLAGS +UUID_LIBS +UUID_CFLAGS +LIBNL_LIBS +LIBNL_CFLAGS +UDEV_BASE_DIR +GIO_LIBS +GIO_CFLAGS +GUDEV_LIBS +GUDEV_CFLAGS +GMODULE_LIBS +GMODULE_CFLAGS +GLIB_LIBS +GLIB_CFLAGS +DBUS_LIBS +DBUS_CFLAGS +PKG_CONFIG +LIBDL +LIBM +TARGET_PARDUS_FALSE +TARGET_PARDUS_TRUE +TARGET_MANDRIVA_FALSE +TARGET_MANDRIVA_TRUE +TARGET_FRUGALWARE_FALSE +TARGET_FRUGALWARE_TRUE +TARGET_PALDO_FALSE +TARGET_PALDO_TRUE +TARGET_ARCH_FALSE +TARGET_ARCH_TRUE +TARGET_SLACKWARE_FALSE +TARGET_SLACKWARE_TRUE +TARGET_DEBIAN_FALSE +TARGET_DEBIAN_TRUE +TARGET_GENTOO_FALSE +TARGET_GENTOO_TRUE +TARGET_SUSE_FALSE +TARGET_SUSE_TRUE +TARGET_REDHAT_FALSE +TARGET_REDHAT_TRUE +WITH_DOCS_FALSE +WITH_DOCS_TRUE +MKINSTALLDIRS +POSUB +POFILES +PO_IN_DATADIR_FALSE +PO_IN_DATADIR_TRUE +INTLLIBS +INSTOBJEXT +GMOFILES +CATOBJEXT +CATALOGS +MSGFMT_OPTS +DATADIRNAME +ALL_LINGUAS +INTLTOOL_PERL +GMSGFMT +MSGFMT +MSGMERGE +XGETTEXT +INTLTOOL_POLICY_RULE +INTLTOOL_SERVICE_RULE +INTLTOOL_THEME_RULE +INTLTOOL_SCHEMAS_RULE +INTLTOOL_CAVES_RULE +INTLTOOL_XML_NOMERGE_RULE +INTLTOOL_XML_RULE +INTLTOOL_KBD_RULE +INTLTOOL_XAM_RULE +INTLTOOL_UI_RULE +INTLTOOL_SOUNDLIST_RULE +INTLTOOL_SHEET_RULE +INTLTOOL_SERVER_RULE +INTLTOOL_PONG_RULE +INTLTOOL_OAF_RULE +INTLTOOL_PROP_RULE +INTLTOOL_KEYS_RULE +INTLTOOL_DIRECTORY_RULE +INTLTOOL_DESKTOP_RULE +INTLTOOL_EXTRACT +INTLTOOL_MERGE +INTLTOOL_UPDATE +USE_NLS +GETTEXT_PACKAGE +LIBOBJS +DISABLE_DEPRECATED +ACLOCAL_AMFLAGS +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +lt_ECHO +RANLIB +AR +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +enable_nls +with_docs +with_distro +with_dist_version +with_udev_dir +with_crypto +with_dbus_sys_dir +with_pppd_plugin_dir +with_dhclient +with_dhcpcd +with_resolvconf +with_iptables +with_system_ca_path +enable_more_warnings +with_html_dir +enable_gtk_doc +enable_gtk_doc_html +enable_gtk_doc_pdf +with_tests +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +PKG_CONFIG +DBUS_CFLAGS +DBUS_LIBS +GLIB_CFLAGS +GLIB_LIBS +GMODULE_CFLAGS +GMODULE_LIBS +GUDEV_CFLAGS +GUDEV_LIBS +GIO_CFLAGS +GIO_LIBS +LIBNL_CFLAGS +LIBNL_LIBS +UUID_CFLAGS +UUID_LIBS +POLKIT_CFLAGS +POLKIT_LIBS +NSS_CFLAGS +NSS_LIBS +GNUTLS_CFLAGS +GNUTLS_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures NetworkManager 0.8.1 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/NetworkManager] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of NetworkManager 0.8.1:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-nls do not use Native Language Support + --enable-more-warnings Maximum compiler warnings + --enable-gtk-doc use gtk-doc to build documentation [[default=no]] + --enable-gtk-doc-html build documentation in html format [[default=yes]] + --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-docs Build NetworkManager documentation + --with-distro=DISTRO Specify the Linux distribution to target: One of + redhat, suse, gentoo, debian, arch, slackware, + paldo, mandriva or pardus + --with-dist-version= + Define the NM's distribution version string + --with-udev-dir=DIR where the udev base directory is + --with-crypto=nss | gnutls + Cryptography library to use for certificate and key + operations + --with-dbus-sys-dir=DIR where D-BUS system.d directory is + --with-pppd-plugin-dir=DIR + path to the pppd plugins directory + --with-dhclient=yes|no|path + Enable dhclient 4.x support + --with-dhcpcd=yes|no|path + Enable dhcpcd 4.x support + --with-resolvconf=yes|no|path + Enable resolvconf support + --with-iptables=/path/to/iptables + path to iptables + --with-system-ca-path=/path/to/ssl/certs + path to system CA certificates + --with-html-dir=PATH path to installed docs + --with-tests Build NetworkManager tests + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + PKG_CONFIG path to pkg-config utility + DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config + DBUS_LIBS linker flags for DBUS, overriding pkg-config + GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config + GLIB_LIBS linker flags for GLIB, overriding pkg-config + GMODULE_CFLAGS + C compiler flags for GMODULE, overriding pkg-config + GMODULE_LIBS + linker flags for GMODULE, overriding pkg-config + GUDEV_CFLAGS + C compiler flags for GUDEV, overriding pkg-config + GUDEV_LIBS linker flags for GUDEV, overriding pkg-config + GIO_CFLAGS C compiler flags for GIO, overriding pkg-config + GIO_LIBS linker flags for GIO, overriding pkg-config + LIBNL_CFLAGS + C compiler flags for LIBNL, overriding pkg-config + LIBNL_LIBS linker flags for LIBNL, overriding pkg-config + UUID_CFLAGS C compiler flags for UUID, overriding pkg-config + UUID_LIBS linker flags for UUID, overriding pkg-config + POLKIT_CFLAGS + C compiler flags for POLKIT, overriding pkg-config + POLKIT_LIBS linker flags for POLKIT, overriding pkg-config + NSS_CFLAGS C compiler flags for NSS, overriding pkg-config + NSS_LIBS linker flags for NSS, overriding pkg-config + GNUTLS_CFLAGS + C compiler flags for GNUTLS, overriding pkg-config + GNUTLS_LIBS linker flags for GNUTLS, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +NetworkManager configure 0.8.1 +generated by GNU Autoconf 2.65 + +Copyright (C) 2009 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( cat <<\_ASBOX +## ------------------------------ ## +## Report this to dcbw@redhat.com ## +## ------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by NetworkManager $as_me 0.8.1, which was +generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done +done +if test -z "$ac_aux_dir"; then + as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='NetworkManager' + VERSION='0.8.1' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +$as_echo_n "checking how to create a ustar tar archive... " >&6; } +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' +_am_tools=${am_cv_prog_tar_ustar-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +if test "${am_cv_prog_tar_ustar+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_ustar=$_am_tool +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +$as_echo "$am_cv_prog_tar_ustar" >&6; } + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + + +ac_config_headers="$ac_config_headers config.h" + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = x""yes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.6b' +macro_revision='1.3017' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:5977: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:5980: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:5983: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 7188 "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8450: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8454: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8789: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8793: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8894: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8898: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8949: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8953: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 11319 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 11415 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" +if test -n "$ac_macro_dir"; then + ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS" +fi + + +if test $USE_MAINTAINER_MODE = yes; then + DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED" +else + DISABLE_DEPRECATED="" +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if test "${ac_cv_header_time+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + + +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +$as_echo_n "checking for working memcmp... " >&6; } +if test "${ac_cv_func_memcmp_working+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_memcmp_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_memcmp_working=yes +else + ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +$as_echo "$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + +for ac_func in select socket uname +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +GETTEXT_PACKAGE=NetworkManager + + +cat >>confdefs.h <<_ACEOF +#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + +case "$am__api_version" in + 1.01234) + as_fn_error "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 + ;; + *) + ;; +esac + +if test -n "0.35.0"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= 0.35.0" >&5 +$as_echo_n "checking for intltool >= 0.35.0... " >&6; } + + INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.35.0 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 +$as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } + test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || + as_fn_error "Your intltool is too old. You need intltool 0.35.0 or later." "$LINENO" 5 +fi + +# Extract the first word of "intltool-update", so it can be a program name with args. +set dummy intltool-update; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_UPDATE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_UPDATE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE +if test -n "$INTLTOOL_UPDATE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 +$as_echo "$INTLTOOL_UPDATE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "intltool-merge", so it can be a program name with args. +set dummy intltool-merge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_MERGE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_MERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE +if test -n "$INTLTOOL_MERGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 +$as_echo "$INTLTOOL_MERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "intltool-extract", so it can be a program name with args. +set dummy intltool-extract; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_EXTRACT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_EXTRACT in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT +if test -n "$INTLTOOL_EXTRACT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 +$as_echo "$INTLTOOL_EXTRACT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + as_fn_error "The intltool scripts were not found. Please install intltool." "$LINENO" 5 +fi + + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< $@' + INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' +INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< $@' + INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# Check the gettext tools to make sure they are GNU +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XGETTEXT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $XGETTEXT in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +XGETTEXT=$ac_cv_path_XGETTEXT +if test -n "$XGETTEXT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGMERGE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MSGMERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MSGMERGE=$ac_cv_path_MSGMERGE +if test -n "$MSGMERGE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MSGFMT=$ac_cv_path_MSGFMT +if test -n "$MSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GMSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then + as_fn_error "GNU gettext tools not found; required for intltool" "$LINENO" 5 +fi +xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" +mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" +mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" +if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then + as_fn_error "GNU gettext tools not found; required for intltool" "$LINENO" 5 +fi + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_INTLTOOL_PERL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $INTLTOOL_PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL +if test -n "$INTLTOOL_PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 +$as_echo "$INTLTOOL_PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$INTLTOOL_PERL"; then + as_fn_error "perl not found" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 +$as_echo_n "checking for perl >= 5.8.1... " >&6; } +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + as_fn_error "perl 5.8.1 is required for intltool" "$LINENO" 5 +else + IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 +$as_echo "$IT_PERL_VERSION" >&6; } +fi +if test "x" != "xno-xml"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 +$as_echo_n "checking for XML::Parser... " >&6; } + if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + else + as_fn_error "XML::Parser perl module is required for intltool" "$LINENO" 5 + fi +fi + +# Substitute ALL_LINGUAS so we can use it in po/Makefile + + +# Set DATADIRNAME correctly if it is not set yet +# (copied from glib-gettext.m4) +if test -z "$DATADIRNAME"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + DATADIRNAME=share +else + case $host in + *-*-solaris*) + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + DATADIRNAME=share +else + DATADIRNAME=lib +fi + + ;; + *) + DATADIRNAME=lib + ;; + esac +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + + + + + + for ac_header in locale.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE_H 1 +_ACEOF + +fi + +done + + if test $ac_cv_header_locale_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +$as_echo_n "checking for LC_MESSAGES... " >&6; } +if test "${am_cv_val_LC_MESSAGES+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return LC_MESSAGES + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_val_LC_MESSAGES=yes +else + am_cv_val_LC_MESSAGES=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 +$as_echo "$am_cv_val_LC_MESSAGES" >&6; } + if test $am_cv_val_LC_MESSAGES = yes; then + +$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h + + fi + fi + USE_NLS=yes + + + gt_cv_have_gettext=no + + CATOBJEXT=NONE + XGETTEXT=: + INTLLIBS= + + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = x""yes; then : + gt_cv_func_dgettext_libintl="no" + libintl_extra_libs="" + + # + # First check in libc + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 +$as_echo_n "checking for ngettext in libc... " >&6; } +if test "${gt_cv_func_ngettext_libc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ +return !ngettext ("","", 1) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_ngettext_libc=yes +else + gt_cv_func_ngettext_libc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 +$as_echo "$gt_cv_func_ngettext_libc" >&6; } + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 +$as_echo_n "checking for dgettext in libc... " >&6; } +if test "${gt_cv_func_dgettext_libc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ +return !dgettext ("","") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_dgettext_libc=yes +else + gt_cv_func_dgettext_libc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 +$as_echo "$gt_cv_func_dgettext_libc" >&6; } + fi + + if test "$gt_cv_func_ngettext_libc" = "yes" ; then + for ac_func in bind_textdomain_codeset +do : + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 +_ACEOF + +fi +done + + fi + + # + # If we don't have everything we want, check in libintl + # + if test "$gt_cv_func_dgettext_libc" != "yes" \ + || test "$gt_cv_func_ngettext_libc" != "yes" \ + || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 +$as_echo_n "checking for bindtextdomain in -lintl... " >&6; } +if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char bindtextdomain (); +int +main () +{ +return bindtextdomain (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_bindtextdomain=yes +else + ac_cv_lib_intl_bindtextdomain=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 +$as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } +if test "x$ac_cv_lib_intl_bindtextdomain" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 +$as_echo_n "checking for ngettext in -lintl... " >&6; } +if test "${ac_cv_lib_intl_ngettext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ngettext (); +int +main () +{ +return ngettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_ngettext=yes +else + ac_cv_lib_intl_ngettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 +$as_echo "$ac_cv_lib_intl_ngettext" >&6; } +if test "x$ac_cv_lib_intl_ngettext" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 +$as_echo_n "checking for dgettext in -lintl... " >&6; } +if test "${ac_cv_lib_intl_dgettext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dgettext (); +int +main () +{ +return dgettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_dgettext=yes +else + ac_cv_lib_intl_dgettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 +$as_echo "$ac_cv_lib_intl_dgettext" >&6; } +if test "x$ac_cv_lib_intl_dgettext" = x""yes; then : + gt_cv_func_dgettext_libintl=yes +fi + +fi + +fi + + + if test "$gt_cv_func_dgettext_libintl" != "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 +$as_echo_n "checking if -liconv is needed to use gettext... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 +$as_echo_n "checking for ngettext in -lintl... " >&6; } +if test "${ac_cv_lib_intl_ngettext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl -liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ngettext (); +int +main () +{ +return ngettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_ngettext=yes +else + ac_cv_lib_intl_ngettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 +$as_echo "$ac_cv_lib_intl_ngettext" >&6; } +if test "x$ac_cv_lib_intl_ngettext" = x""yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 +$as_echo_n "checking for dcgettext in -lintl... " >&6; } +if test "${ac_cv_lib_intl_dcgettext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl -liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dcgettext (); +int +main () +{ +return dcgettext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_dcgettext=yes +else + ac_cv_lib_intl_dcgettext=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 +$as_echo "$ac_cv_lib_intl_dcgettext" >&6; } +if test "x$ac_cv_lib_intl_dcgettext" = x""yes; then : + gt_cv_func_dgettext_libintl=yes + libintl_extra_libs=-liconv +else + : +fi + +else + : +fi + + fi + + # + # If we found libintl, then check in it for bind_textdomain_codeset(); + # we'll prefer libc if neither have bind_textdomain_codeset(), + # and both have dgettext and ngettext + # + if test "$gt_cv_func_dgettext_libintl" = "yes" ; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $libintl_extra_libs" + unset ac_cv_func_bind_textdomain_codeset + for ac_func in bind_textdomain_codeset +do : + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 +_ACEOF + +fi +done + + LIBS="$glib_save_LIBS" + + if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then + gt_cv_func_dgettext_libc=no + else + if test "$gt_cv_func_dgettext_libc" = "yes" \ + && test "$gt_cv_func_ngettext_libc" = "yes"; then + gt_cv_func_dgettext_libintl=no + fi + fi + fi + fi + + if test "$gt_cv_func_dgettext_libc" = "yes" \ + || test "$gt_cv_func_dgettext_libintl" = "yes"; then + gt_cv_have_gettext=yes + fi + + if test "$gt_cv_func_dgettext_libintl" = "yes"; then + INTLLIBS="-lintl $libintl_extra_libs" + fi + + if test "$gt_cv_have_gettext" = "yes"; then + +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "$MSGFMT" != "no"; then + glib_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + for ac_func in dcgettext +do : + ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" +if test "x$ac_cv_func_dcgettext" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DCGETTEXT 1 +_ACEOF + +fi +done + + MSGFMT_OPTS= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 +$as_echo_n "checking if msgfmt accepts -c... " >&6; } + cat >conftest.foo <<_ACEOF + +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: test 1.0\n" +"PO-Revision-Date: 2007-02-15 12:01+0100\n" +"Last-Translator: test \n" +"Language-Team: C \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" + +_ACEOF +if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 + ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +echo "$as_me: failed input was:" >&5 +sed 's/^/| /' conftest.foo >&5 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GMSGFMT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XGETTEXT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + CATOBJEXT=.gmo + DATADIRNAME=share +else + case $host in + *-*-solaris*) + ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = x""yes; then : + CATOBJEXT=.gmo + DATADIRNAME=share +else + CATOBJEXT=.mo + DATADIRNAME=lib +fi + + ;; + *) + CATOBJEXT=.mo + DATADIRNAME=lib + ;; + esac +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$glib_save_LIBS" + INSTOBJEXT=.mo + else + gt_cv_have_gettext=no + fi + fi + +fi + + + + if test "$gt_cv_have_gettext" = "yes" ; then + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 +$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + + ac_config_commands="$ac_config_commands default-1" + + + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + + + + + + + + + + + + + if test "$gt_cv_have_gettext" = "yes"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 +$as_echo_n "checking for catalogs to be installed... " >&6; } + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 +$as_echo "$LINGUAS" >&6; } + fi + + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + + + +# Check whether --with-docs was given. +if test "${with_docs+set}" = set; then : + withval=$with_docs; +fi + + if test "x$with_docs" = "xyes"; then + WITH_DOCS_TRUE= + WITH_DOCS_FALSE='#' +else + WITH_DOCS_TRUE='#' + WITH_DOCS_FALSE= +fi + +case $with_docs in + yes) + enable_gtk_doc=yes + ;; + *) + with_docs=no + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + +# Check whether --with-distro was given. +if test "${with_distro+set}" = set; then : + withval=$with_distro; +fi + +if test "z$with_distro" = "z"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/redhat-release" >&5 +$as_echo_n "checking for /etc/redhat-release... " >&6; } +if test "${ac_cv_file__etc_redhat_release+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/redhat-release"; then + ac_cv_file__etc_redhat_release=yes +else + ac_cv_file__etc_redhat_release=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_redhat_release" >&5 +$as_echo "$ac_cv_file__etc_redhat_release" >&6; } +if test "x$ac_cv_file__etc_redhat_release" = x""yes; then : + with_distro="redhat" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/SuSE-release" >&5 +$as_echo_n "checking for /etc/SuSE-release... " >&6; } +if test "${ac_cv_file__etc_SuSE_release+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/SuSE-release"; then + ac_cv_file__etc_SuSE_release=yes +else + ac_cv_file__etc_SuSE_release=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_SuSE_release" >&5 +$as_echo "$ac_cv_file__etc_SuSE_release" >&6; } +if test "x$ac_cv_file__etc_SuSE_release" = x""yes; then : + with_distro="suse" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/fedora-release" >&5 +$as_echo_n "checking for /etc/fedora-release... " >&6; } +if test "${ac_cv_file__etc_fedora_release+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/fedora-release"; then + ac_cv_file__etc_fedora_release=yes +else + ac_cv_file__etc_fedora_release=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_fedora_release" >&5 +$as_echo "$ac_cv_file__etc_fedora_release" >&6; } +if test "x$ac_cv_file__etc_fedora_release" = x""yes; then : + with_distro="redhat" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/gentoo-release" >&5 +$as_echo_n "checking for /etc/gentoo-release... " >&6; } +if test "${ac_cv_file__etc_gentoo_release+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/gentoo-release"; then + ac_cv_file__etc_gentoo_release=yes +else + ac_cv_file__etc_gentoo_release=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_gentoo_release" >&5 +$as_echo "$ac_cv_file__etc_gentoo_release" >&6; } +if test "x$ac_cv_file__etc_gentoo_release" = x""yes; then : + with_distro="gentoo" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/debian_version" >&5 +$as_echo_n "checking for /etc/debian_version... " >&6; } +if test "${ac_cv_file__etc_debian_version+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/debian_version"; then + ac_cv_file__etc_debian_version=yes +else + ac_cv_file__etc_debian_version=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_debian_version" >&5 +$as_echo "$ac_cv_file__etc_debian_version" >&6; } +if test "x$ac_cv_file__etc_debian_version" = x""yes; then : + with_distro="debian" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/arch-release" >&5 +$as_echo_n "checking for /etc/arch-release... " >&6; } +if test "${ac_cv_file__etc_arch_release+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/arch-release"; then + ac_cv_file__etc_arch_release=yes +else + ac_cv_file__etc_arch_release=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_arch_release" >&5 +$as_echo "$ac_cv_file__etc_arch_release" >&6; } +if test "x$ac_cv_file__etc_arch_release" = x""yes; then : + with_distro="arch" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/slackware-version" >&5 +$as_echo_n "checking for /etc/slackware-version... " >&6; } +if test "${ac_cv_file__etc_slackware_version+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/slackware-version"; then + ac_cv_file__etc_slackware_version=yes +else + ac_cv_file__etc_slackware_version=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_slackware_version" >&5 +$as_echo "$ac_cv_file__etc_slackware_version" >&6; } +if test "x$ac_cv_file__etc_slackware_version" = x""yes; then : + with_distro="slackware" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/frugalware-release" >&5 +$as_echo_n "checking for /etc/frugalware-release... " >&6; } +if test "${ac_cv_file__etc_frugalware_release+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/frugalware-release"; then + ac_cv_file__etc_frugalware_release=yes +else + ac_cv_file__etc_frugalware_release=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_frugalware_release" >&5 +$as_echo "$ac_cv_file__etc_frugalware_release" >&6; } +if test "x$ac_cv_file__etc_frugalware_release" = x""yes; then : + with_distro="frugalware" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/mandriva-release" >&5 +$as_echo_n "checking for /etc/mandriva-release... " >&6; } +if test "${ac_cv_file__etc_mandriva_release+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/mandriva-release"; then + ac_cv_file__etc_mandriva_release=yes +else + ac_cv_file__etc_mandriva_release=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_mandriva_release" >&5 +$as_echo "$ac_cv_file__etc_mandriva_release" >&6; } +if test "x$ac_cv_file__etc_mandriva_release" = x""yes; then : + with_distro="mandriva" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /etc/pardus-release" >&5 +$as_echo_n "checking for /etc/pardus-release... " >&6; } +if test "${ac_cv_file__etc_pardus_release+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "/etc/pardus-release"; then + ac_cv_file__etc_pardus_release=yes +else + ac_cv_file__etc_pardus_release=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__etc_pardus_release" >&5 +$as_echo "$ac_cv_file__etc_pardus_release" >&6; } +if test "x$ac_cv_file__etc_pardus_release" = x""yes; then : + with_distro="pardus" +fi + + if test "z$with_distro" = "z"; then + with_distro=`lsb_release -is` + fi +fi +with_distro=`echo ${with_distro} | tr '[:upper:]' '[:lower:]' ` + +if test "z$with_distro" = "z"; then + echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO" + exit 1 +else + case $with_distro in + redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus) ;; + *) + echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)" + exit 1 + ;; + esac +fi + + if test x"$with_distro" = xredhat; then + TARGET_REDHAT_TRUE= + TARGET_REDHAT_FALSE='#' +else + TARGET_REDHAT_TRUE='#' + TARGET_REDHAT_FALSE= +fi + +if test x"$with_distro" = xredhat; then + +$as_echo "#define TARGET_REDHAT 1" >>confdefs.h + +fi + + if test x"$with_distro" = xsuse; then + TARGET_SUSE_TRUE= + TARGET_SUSE_FALSE='#' +else + TARGET_SUSE_TRUE='#' + TARGET_SUSE_FALSE= +fi + +if test x"$with_distro" = xsuse; then + +$as_echo "#define TARGET_SUSE 1" >>confdefs.h + +fi + + if test x"$with_distro" = xgentoo; then + TARGET_GENTOO_TRUE= + TARGET_GENTOO_FALSE='#' +else + TARGET_GENTOO_TRUE='#' + TARGET_GENTOO_FALSE= +fi + +if test x"$with_distro" = xgentoo; then + +$as_echo "#define TARGET_GENTOO 1" >>confdefs.h + +fi + + if test x"$with_distro" = xdebian; then + TARGET_DEBIAN_TRUE= + TARGET_DEBIAN_FALSE='#' +else + TARGET_DEBIAN_TRUE='#' + TARGET_DEBIAN_FALSE= +fi + +if test x"$with_distro" = xdebian; then + +$as_echo "#define TARGET_DEBIAN 1" >>confdefs.h + +fi + + if test x"$with_distro" = xslackware; then + TARGET_SLACKWARE_TRUE= + TARGET_SLACKWARE_FALSE='#' +else + TARGET_SLACKWARE_TRUE='#' + TARGET_SLACKWARE_FALSE= +fi + +if test x"$with_distro" = xslackware; then + +$as_echo "#define TARGET_SLACKWARE 1" >>confdefs.h + +fi + + if test x"$with_distro" = xarch; then + TARGET_ARCH_TRUE= + TARGET_ARCH_FALSE='#' +else + TARGET_ARCH_TRUE='#' + TARGET_ARCH_FALSE= +fi + +if test x"$with_distro" = xarch; then + +$as_echo "#define TARGET_ARCH 1" >>confdefs.h + +fi + + if test x"$with_distro" = xpaldo; then + TARGET_PALDO_TRUE= + TARGET_PALDO_FALSE='#' +else + TARGET_PALDO_TRUE='#' + TARGET_PALDO_FALSE= +fi + +if test x"$with_distro" = xpaldo; then + +$as_echo "#define TARGET_PALDO 1" >>confdefs.h + +fi + + if test x"$with_distro" = xfrugalware; then + TARGET_FRUGALWARE_TRUE= + TARGET_FRUGALWARE_FALSE='#' +else + TARGET_FRUGALWARE_TRUE='#' + TARGET_FRUGALWARE_FALSE= +fi + +if test x"$with_distro" = xfrugalware; then + +$as_echo "#define TARGET_FRUGALWARE 1" >>confdefs.h + +fi + + if test x"$with_distro" = xmandriva; then + TARGET_MANDRIVA_TRUE= + TARGET_MANDRIVA_FALSE='#' +else + TARGET_MANDRIVA_TRUE='#' + TARGET_MANDRIVA_FALSE= +fi + +if test x"$with_distro" = xmandriva; then + +$as_echo "#define TARGET_MANDRIVA 1" >>confdefs.h + +fi + + if test x"$with_distro" = xpardus; then + TARGET_PARDUS_TRUE= + TARGET_PARDUS_FALSE='#' +else + TARGET_PARDUS_TRUE='#' + TARGET_PARDUS_FALSE= +fi + +if test x"$with_distro" = xpardus; then + +$as_echo "#define TARGET_PARDUS 1" >>confdefs.h + +fi + + +# Check whether --with-dist-version was given. +if test "${with_dist_version+set}" = set; then : + withval=$with_dist_version; ac_distver=$withval +else + ac_distver="" +fi + +if ! test x"$ac_distver" = x""; then + +cat >>confdefs.h <<_ACEOF +#define NM_DIST_VERSION "$ac_distver" +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux Wireless Extensions >= 18" >&5 +$as_echo_n "checking Linux Wireless Extensions >= 18... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __user + #define __user + #endif + #include + #include + #include + #include + #include +int +main () +{ +#ifndef IWEVGENIE + #error "not found" + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_have_iwevgenie=yes +else + ac_have_iwevgenie=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_iwevgenie" >&5 +$as_echo "$ac_have_iwevgenie" >&6; } +if test "$ac_have_iwevgenie" = no; then + as_fn_error "wireless-tools library and development headers >= 28pre9 not installed or not functional" "$LINENO" 5 +fi + +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 +$as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } +if test "${ac_cv_lib_mw__mwvalidcheckl+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmw $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _mwvalidcheckl (); +int +main () +{ +return _mwvalidcheckl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mw__mwvalidcheckl=yes +else + ac_cv_lib_mw__mwvalidcheckl=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 +$as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } +if test "x$ac_cv_lib_mw__mwvalidcheckl" = x""yes; then : + LIBM="-lmw" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if test "${ac_cv_lib_m_cos+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = x""yes; then : + LIBM="$LIBM -lm" +fi + + ;; +*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if test "${ac_cv_lib_m_cos+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = x""yes; then : + LIBM="-lm" +fi + + ;; +esac + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in -ldl" >&5 +$as_echo_n "checking for dladdr in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dladdr+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dladdr (); +int +main () +{ +return dladdr (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dladdr=yes +else + ac_cv_lib_dl_dladdr=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dladdr" >&5 +$as_echo "$ac_cv_lib_dl_dladdr" >&6; } +if test "x$ac_cv_lib_dl_dladdr" = x""yes; then : + LIBDL="-ldl" +else + LIBDL="" +fi + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 +$as_echo_n "checking for DBUS... " >&6; } + +if test -n "$DBUS_CFLAGS"; then + pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.1 dbus-glib-1 >= 0.75\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.1 dbus-glib-1 >= 0.75") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.1 dbus-glib-1 >= 0.75" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DBUS_LIBS"; then + pkg_cv_DBUS_LIBS="$DBUS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.1 dbus-glib-1 >= 0.75\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.1 dbus-glib-1 >= 0.75") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.1 dbus-glib-1 >= 0.75" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-1 >= 1.1 dbus-glib-1 >= 0.75" 2>&1` + else + DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-1 >= 1.1 dbus-glib-1 >= 0.75" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DBUS_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (dbus-1 >= 1.1 dbus-glib-1 >= 0.75) were not met: + +$DBUS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables DBUS_CFLAGS +and DBUS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables DBUS_CFLAGS +and DBUS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS + DBUS_LIBS=$pkg_cv_DBUS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } + +if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gthread-2.0 glib-2.0 >= 2.18 gobject-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gthread-2.0 glib-2.0 >= 2.18 gobject-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0 glib-2.0 >= 2.18 gobject-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gthread-2.0 glib-2.0 >= 2.18 gobject-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gthread-2.0 glib-2.0 >= 2.18 gobject-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "gthread-2.0 glib-2.0 >= 2.18 gobject-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gthread-2.0 glib-2.0 >= 2.18 gobject-2.0" 2>&1` + else + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "gthread-2.0 glib-2.0 >= 2.18 gobject-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLIB_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (gthread-2.0 glib-2.0 >= 2.18 gobject-2.0) were not met: + +$GLIB_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GLIB_CFLAGS +and GLIB_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GLIB_CFLAGS +and GLIB_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMODULE" >&5 +$as_echo_n "checking for GMODULE... " >&6; } + +if test -n "$GMODULE_CFLAGS"; then + pkg_cv_GMODULE_CFLAGS="$GMODULE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmodule-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMODULE_CFLAGS=`$PKG_CONFIG --cflags "gmodule-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GMODULE_LIBS"; then + pkg_cv_GMODULE_LIBS="$GMODULE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmodule-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMODULE_LIBS=`$PKG_CONFIG --libs "gmodule-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GMODULE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gmodule-2.0" 2>&1` + else + GMODULE_PKG_ERRORS=`$PKG_CONFIG --print-errors "gmodule-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GMODULE_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (gmodule-2.0) were not met: + +$GMODULE_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GMODULE_CFLAGS +and GMODULE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GMODULE_CFLAGS +and GMODULE_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + GMODULE_CFLAGS=$pkg_cv_GMODULE_CFLAGS + GMODULE_LIBS=$pkg_cv_GMODULE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUDEV" >&5 +$as_echo_n "checking for GUDEV... " >&6; } + +if test -n "$GUDEV_CFLAGS"; then + pkg_cv_GUDEV_CFLAGS="$GUDEV_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gudev-1.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gudev-1.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GUDEV_CFLAGS=`$PKG_CONFIG --cflags "gudev-1.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GUDEV_LIBS"; then + pkg_cv_GUDEV_LIBS="$GUDEV_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gudev-1.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gudev-1.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GUDEV_LIBS=`$PKG_CONFIG --libs "gudev-1.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GUDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gudev-1.0" 2>&1` + else + GUDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors "gudev-1.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GUDEV_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (gudev-1.0) were not met: + +$GUDEV_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GUDEV_CFLAGS +and GUDEV_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GUDEV_CFLAGS +and GUDEV_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + GUDEV_CFLAGS=$pkg_cv_GUDEV_CFLAGS + GUDEV_LIBS=$pkg_cv_GUDEV_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO" >&5 +$as_echo_n "checking for GIO... " >&6; } + +if test -n "$GIO_CFLAGS"; then + pkg_cv_GIO_CFLAGS="$GIO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GIO_LIBS"; then + pkg_cv_GIO_LIBS="$GIO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gio-2.0" 2>&1` + else + GIO_PKG_ERRORS=`$PKG_CONFIG --print-errors "gio-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GIO_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (gio-2.0) were not met: + +$GIO_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GIO_CFLAGS +and GIO_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GIO_CFLAGS +and GIO_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + GIO_CFLAGS=$pkg_cv_GIO_CFLAGS + GIO_LIBS=$pkg_cv_GIO_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + + + + +# Check whether --with-udev-dir was given. +if test "${with_udev_dir+set}" = set; then : + withval=$with_udev_dir; +fi + +if test -n "$with_udev_dir" ; then + UDEV_BASE_DIR="$with_udev_dir" +else + UDEV_BASE_DIR="/lib/udev" +fi + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNL" >&5 +$as_echo_n "checking for LIBNL... " >&6; } + +if test -n "$LIBNL_CFLAGS"; then + pkg_cv_LIBNL_CFLAGS="$LIBNL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-1 >= 1.0-pre8\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libnl-1 >= 1.0-pre8") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBNL_CFLAGS=`$PKG_CONFIG --cflags "libnl-1 >= 1.0-pre8" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBNL_LIBS"; then + pkg_cv_LIBNL_LIBS="$LIBNL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-1 >= 1.0-pre8\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libnl-1 >= 1.0-pre8") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBNL_LIBS=`$PKG_CONFIG --libs "libnl-1 >= 1.0-pre8" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBNL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libnl-1 >= 1.0-pre8" 2>&1` + else + LIBNL_PKG_ERRORS=`$PKG_CONFIG --print-errors "libnl-1 >= 1.0-pre8" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBNL_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (libnl-1 >= 1.0-pre8) were not met: + +$LIBNL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables LIBNL_CFLAGS +and LIBNL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables LIBNL_CFLAGS +and LIBNL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + LIBNL_CFLAGS=$pkg_cv_LIBNL_CFLAGS + LIBNL_LIBS=$pkg_cv_LIBNL_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnl address caching bug" >&5 +$as_echo_n "checking for libnl address caching bug... " >&6; } + save_CFLAGS="$CFLAGS" + save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS $LIBNL_CFLAGS" + LDFLAGS="$LDFLAGS $LIBNL_LIBS" + if test "$cross_compiling" = yes; then : + libnl_bug=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main (int argc, char **argv) +{ + struct nl_handle *nlh; + struct nl_cache *cache; + struct nl_object *obj; + + nlh = nl_handle_alloc (); + if (nl_connect (nlh, NETLINK_ROUTE) < 0) { + fprintf (stderr, "couldn't connect to netlink: %s", nl_geterror ()); + return 3; + } + + cache = rtnl_addr_alloc_cache (nlh); + if (!cache || nl_cache_nitems (cache) == 0) { + fprintf (stderr, "couldn't fill address cache: %s", nl_geterror ()); + return 3; + } + + obj = nl_cache_get_first (cache); + if (nl_object_identical (obj, obj)) + return 0; + + nl_cache_get_ops (cache)->co_obj_ops->oo_id_attrs &= ~0x80; + if (nl_object_identical (obj, obj)) + return 1; + else + return 2; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + libnl_bug=$? +else + libnl_bug=$? +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + CFLAGS="$save_CFLAGS" + LDFLAGS="$save_LDFLAGS" + + case $libnl_bug in + 0) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + + 1) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, using workaround" >&5 +$as_echo "yes, using workaround" >&6; } + +$as_echo "#define LIBNL_NEEDS_ADDR_CACHING_WORKAROUND 1" >>confdefs.h + + ;; + + 2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and workaround doesn't work" >&5 +$as_echo "yes, and workaround doesn't work" >&6; } + as_fn_error "Installed libnl has broken address caching; please patch or upgrade" "$LINENO" 5 + ;; + + cross) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling... assuming it works!" >&5 +$as_echo "cross-compiling... assuming it works!" >&6; } + ;; + + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ?" >&5 +$as_echo "?" >&6; } + as_fn_error "libnl test program failed" "$LINENO" 5 + ;; +esac + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UUID" >&5 +$as_echo_n "checking for UUID... " >&6; } + +if test -n "$UUID_CFLAGS"; then + pkg_cv_UUID_CFLAGS="$UUID_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 + ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UUID_CFLAGS=`$PKG_CONFIG --cflags "uuid" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$UUID_LIBS"; then + pkg_cv_UUID_LIBS="$UUID_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 + ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UUID_LIBS=`$PKG_CONFIG --libs "uuid" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + UUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "uuid" 2>&1` + else + UUID_PKG_ERRORS=`$PKG_CONFIG --print-errors "uuid" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$UUID_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (uuid) were not met: + +$UUID_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables UUID_CFLAGS +and UUID_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables UUID_CFLAGS +and UUID_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + UUID_CFLAGS=$pkg_cv_UUID_CFLAGS + UUID_LIBS=$pkg_cv_UUID_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POLKIT" >&5 +$as_echo_n "checking for POLKIT... " >&6; } + +if test -n "$POLKIT_CFLAGS"; then + pkg_cv_POLKIT_CFLAGS="$POLKIT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"polkit-gobject-1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "polkit-gobject-1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_POLKIT_CFLAGS=`$PKG_CONFIG --cflags "polkit-gobject-1" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$POLKIT_LIBS"; then + pkg_cv_POLKIT_LIBS="$POLKIT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"polkit-gobject-1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "polkit-gobject-1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_POLKIT_LIBS=`$PKG_CONFIG --libs "polkit-gobject-1" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + POLKIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "polkit-gobject-1" 2>&1` + else + POLKIT_PKG_ERRORS=`$PKG_CONFIG --print-errors "polkit-gobject-1" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$POLKIT_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (polkit-gobject-1) were not met: + +$POLKIT_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables POLKIT_CFLAGS +and POLKIT_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables POLKIT_CFLAGS +and POLKIT_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + POLKIT_CFLAGS=$pkg_cv_POLKIT_CFLAGS + POLKIT_LIBS=$pkg_cv_POLKIT_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + + + + +# Check whether --with-crypto was given. +if test "${with_crypto+set}" = set; then : + withval=$with_crypto; ac_crypto=$withval +else + ac_crypto=nss +fi + + +with_nss=no +with_gnutls=no +if test x"$ac_crypto" = xnss; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSS" >&5 +$as_echo_n "checking for NSS... " >&6; } + +if test -n "$NSS_CFLAGS"; then + pkg_cv_NSS_CFLAGS="$NSS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nss >= 3.11\""; } >&5 + ($PKG_CONFIG --exists --print-errors "nss >= 3.11") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_NSS_CFLAGS=`$PKG_CONFIG --cflags "nss >= 3.11" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$NSS_LIBS"; then + pkg_cv_NSS_LIBS="$NSS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nss >= 3.11\""; } >&5 + ($PKG_CONFIG --exists --print-errors "nss >= 3.11") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_NSS_LIBS=`$PKG_CONFIG --libs "nss >= 3.11" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + NSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "nss >= 3.11" 2>&1` + else + NSS_PKG_ERRORS=`$PKG_CONFIG --print-errors "nss >= 3.11" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$NSS_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (nss >= 3.11) were not met: + +$NSS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables NSS_CFLAGS +and NSS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables NSS_CFLAGS +and NSS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + NSS_CFLAGS=$pkg_cv_NSS_CFLAGS + NSS_LIBS=$pkg_cv_NSS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + +$as_echo "#define HAVE_NSS 1" >>confdefs.h + + with_nss=yes +elif test x"$ac_crypto" = xgnutls; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNUTLS" >&5 +$as_echo_n "checking for GNUTLS... " >&6; } + +if test -n "$GNUTLS_CFLAGS"; then + pkg_cv_GNUTLS_CFLAGS="$GNUTLS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 1.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gnutls >= 1.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 1.2" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GNUTLS_LIBS"; then + pkg_cv_GNUTLS_LIBS="$GNUTLS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 1.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gnutls >= 1.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 1.2" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gnutls >= 1.2" 2>&1` + else + GNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors "gnutls >= 1.2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GNUTLS_PKG_ERRORS" >&5 + + as_fn_error "Package requirements (gnutls >= 1.2) were not met: + +$GNUTLS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GNUTLS_CFLAGS +and GNUTLS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" "$LINENO" 5 +elif test $pkg_failed = untried; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GNUTLS_CFLAGS +and GNUTLS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." "$LINENO" 5; } +else + GNUTLS_CFLAGS=$pkg_cv_GNUTLS_CFLAGS + GNUTLS_LIBS=$pkg_cv_GNUTLS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + : +fi + # Extract the first word of "libgcrypt-config", so it can be a program name with args. +set dummy libgcrypt-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_LIBGCRYPT_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $LIBGCRYPT_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_LIBGCRYPT_CONFIG="$LIBGCRYPT_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_LIBGCRYPT_CONFIG" && ac_cv_path_LIBGCRYPT_CONFIG="no" + ;; +esac +fi +LIBGCRYPT_CONFIG=$ac_cv_path_LIBGCRYPT_CONFIG +if test -n "$LIBGCRYPT_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT_CONFIG" >&5 +$as_echo "$LIBGCRYPT_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x"$LIBGCRYPT_CONFIG" = xno; then + as_fn_error "gnutls explicitly requested but gcrypt not found on system" "$LINENO" 5 + else + +$as_echo "#define HAVE_GNUTLS 1" >>confdefs.h + + LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` + LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` + + + with_gnutls=yes + fi +else + as_fn_error "Please choose either 'nss' or 'gnutls' for certificate and key operations" "$LINENO" 5 +fi + if test x"$with_nss" != xno; then + WITH_NSS_TRUE= + WITH_NSS_FALSE='#' +else + WITH_NSS_TRUE='#' + WITH_NSS_FALSE= +fi + + if test x"$with_gnutls" != xno; then + WITH_GNUTLS_TRUE= + WITH_GNUTLS_FALSE='#' +else + WITH_GNUTLS_TRUE='#' + WITH_GNUTLS_FALSE= +fi + + +# Shouldn't ever trigger this, but just in case... +if test x"$ac_nss" = xno -a x"$ac_gnutls" = xno; then + as_fn_error "Could not find required development headers and libraries for '$ac_crypto'" "$LINENO" 5 +fi + +GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` + + + +# Check whether --with-dbus-sys-dir was given. +if test "${with_dbus_sys_dir+set}" = set; then : + withval=$with_dbus_sys_dir; +fi + + +if test -n "$with_dbus_sys_dir" ; then + DBUS_SYS_DIR="$with_dbus_sys_dir" +else + DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d" +fi + + +# PPPD +for ac_header in pppd/pppd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "pppd/pppd.h" "ac_cv_header_pppd_pppd_h" "$ac_includes_default" +if test "x$ac_cv_header_pppd_pppd_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PPPD_PPPD_H 1 +_ACEOF + +else + as_fn_error "couldn't find pppd.h. pppd development headers are required." "$LINENO" 5 +fi + +done + + + +# Check whether --with-pppd-plugin-dir was given. +if test "${with_pppd_plugin_dir+set}" = set; then : + withval=$with_pppd_plugin_dir; +fi + + +if test -n "$with_pppd_plugin_dir" ; then + PPPD_PLUGIN_DIR="$with_pppd_plugin_dir" +else + PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.5" +fi + + +# dhclient support + +# Check whether --with-dhclient was given. +if test "${with_dhclient+set}" = set; then : + withval=$with_dhclient; +fi + +# If a full path is given, use that and do not test if it works or not. +case "${with_dhclient}" in + /*) + DHCLIENT_PATH="${with_dhclient}" + { $as_echo "$as_me:${as_lineno-$LINENO}: using dhclient at ${DHCLIENT_PATH}" >&5 +$as_echo "$as_me: using dhclient at ${DHCLIENT_PATH}" >&6;} + ;; + no) { $as_echo "$as_me:${as_lineno-$LINENO}: dhclient support disabled" >&5 +$as_echo "$as_me: dhclient support disabled" >&6;} + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhclient" >&5 +$as_echo_n "checking for dhclient... " >&6; } + # NM only works with ISC dhclient - other derivatives don't have + # the same userland. NM also requires dhclient 4.x since older + # versions do not have IPv6 support. + for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do + test -x "${path}/dhclient" || continue + case `"$path/dhclient" --version 2>&1` in + "isc-dhclient-4"*) DHCLIENT_PATH="$path/dhclient"; break;; + esac + done + if test -n "${DHCLIENT_PATH}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DHCLIENT_PATH" >&5 +$as_echo "$DHCLIENT_PATH" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; +esac + +# dhcpcd support + +# Check whether --with-dhcpcd was given. +if test "${with_dhcpcd+set}" = set; then : + withval=$with_dhcpcd; +fi + +# If a full path is given, use that and do not test if it works or not. +case "${with_dhcpcd}" in + /*) + DHCPCD_PATH="${with_dhcpcd}" + { $as_echo "$as_me:${as_lineno-$LINENO}: using dhcpcd at ${DHCPCD_PATH}" >&5 +$as_echo "$as_me: using dhcpcd at ${DHCPCD_PATH}" >&6;} + ;; + no) { $as_echo "$as_me:${as_lineno-$LINENO}: dhcpcd support disabled" >&5 +$as_echo "$as_me: dhcpcd support disabled" >&6;} + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhcpcd" >&5 +$as_echo_n "checking for dhcpcd... " >&6; } + # We fully work with upstream dhcpcd-4 + for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do + test -x "${path}/dhclient" || continue + case `"$path/dhcpcd" --version 2>/dev/null` in + "dhcpcd "123*);; + "dhcpcd "*) DHCP_CLIENT_PATH="$path/dhcpcd"; break;; + esac + done + if test -n "${DHCPCD_PATH}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DHCPCD_PATH" >&5 +$as_echo "$DHCPCD_PATH" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; +esac + +if test -z "$DHCPCD_PATH" -a -z "$DHCLIENT_PATH"; then + # DHCP clients are not a build time dependency, only runtime. + # dhclient has been the longtime default for NM and it's in /sbin + # in most distros, so use it. + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find a suitable DHCP client" >&5 +$as_echo "$as_me: WARNING: Could not find a suitable DHCP client" >&2;} + DHCLIENT_PATH=/sbin/dhclient + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Falling back to ISC dhclient, ${DHCP_CLIENT_PATH}" >&5 +$as_echo "$as_me: WARNING: Falling back to ISC dhclient, ${DHCP_CLIENT_PATH}" >&2;} +fi + + + +# resolvconf support + +# Check whether --with-resolvconf was given. +if test "${with_resolvconf+set}" = set; then : + withval=$with_resolvconf; with_resolvconf="$withval" +else + with_resolvconf=no +fi + +# If a full path is given, use that and do not test if it works or not. +case "${with_resolvconf}" in + /*) + RESOLVCONF_PATH="${with_resolvconf}" + { $as_echo "$as_me:${as_lineno-$LINENO}: setting resolvconf path to ${RESOLVCONF_PATH}" >&5 +$as_echo "$as_me: setting resolvconf path to ${RESOLVCONF_PATH}" >&6;} + ;; + no) { $as_echo "$as_me:${as_lineno-$LINENO}: resolvconf support disabled" >&5 +$as_echo "$as_me: resolvconf support disabled" >&6;} + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolvconf" >&5 +$as_echo_n "checking for resolvconf... " >&6; } + for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do + if test -x "${path}/resolvconf"; then + RESOLVCONF_PATH="${path}/resolvconf" + break + fi + done + if test -n "${RESOLVCONF_PATH}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RESOLVCONF_PATH" >&5 +$as_echo "$RESOLVCONF_PATH" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; +esac + +if test -n "${RESOLVCONF_PATH}"; then + +cat >>confdefs.h <<_ACEOF +#define RESOLVCONF_PATH "$RESOLVCONF_PATH" +_ACEOF + +fi + +# iptables path + +# Check whether --with-iptables was given. +if test "${with_iptables+set}" = set; then : + withval=$with_iptables; +fi + +if test "x${with_iptables}" = x; then + # Extract the first word of "iptables", so it can be a program name with args. +set dummy iptables; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_IPTABLES_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $IPTABLES_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_IPTABLES_PATH="$IPTABLES_PATH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/sbin:/usr/sbin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_IPTABLES_PATH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +IPTABLES_PATH=$ac_cv_path_IPTABLES_PATH +if test -n "$IPTABLES_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPTABLES_PATH" >&5 +$as_echo "$IPTABLES_PATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if ! test -x "$IPTABLES_PATH"; then + as_fn_error "iptables was not installed." "$LINENO" 5 + fi +else + IPTABLES_PATH="$with_iptables" +fi + +cat >>confdefs.h <<_ACEOF +#define IPTABLES_PATH "$IPTABLES_PATH" +_ACEOF + + + +# system CA certificates path + +# Check whether --with-system-ca-path was given. +if test "${with_system_ca_path+set}" = set; then : + withval=$with_system_ca_path; +fi + +if test "x${with_system_ca_path}" = x; then + SYSTEM_CA_PATH=/etc/ssl/certs +else + SYSTEM_CA_PATH="$with_system_ca_path" +fi + +cat >>confdefs.h <<_ACEOF +#define SYSTEM_CA_PATH "$SYSTEM_CA_PATH" +_ACEOF + + + +# Check whether --enable-more-warnings was given. +if test "${enable_more_warnings+set}" = set; then : + enableval=$enable_more_warnings; set_more_warnings="$enableval" +else + set_more_warnings=yes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for more warnings" >&5 +$as_echo_n "checking for more warnings... " >&6; } +if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS" + + for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \ + -Wdeclaration-after-statement -Wstrict-prototypes \ + -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \ + -fno-strict-aliasing; do + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $option" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands $option" >&5 +$as_echo_n "checking whether gcc understands $option... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + has_option=yes +else + has_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $has_option = no; then + CFLAGS="$SAVE_CFLAGS" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_option" >&5 +$as_echo "$has_option" >&6; } + unset has_option + unset SAVE_CFLAGS + done + unset option +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GTKDOC_CHECK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_CHECK in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK +if test -n "$GTKDOC_CHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 +$as_echo "$GTKDOC_CHECK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for ac_prog in gtkdoc-rebase +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GTKDOC_REBASE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_REBASE in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE +if test -n "$GTKDOC_REBASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 +$as_echo "$GTKDOC_REBASE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GTKDOC_REBASE" && break +done +test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" + + # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. +set dummy gtkdoc-mkpdf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GTKDOC_MKPDF+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GTKDOC_MKPDF in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF +if test -n "$GTKDOC_MKPDF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 +$as_echo "$GTKDOC_MKPDF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Check whether --with-html-dir was given. +if test "${with_html_dir+set}" = set; then : + withval=$with_html_dir; +else + with_html_dir='${datadir}/gtk-doc/html' +fi + + HTML_DIR="$with_html_dir" + + + # Check whether --enable-gtk-doc was given. +if test "${enable_gtk_doc+set}" = set; then : + enableval=$enable_gtk_doc; +else + enable_gtk_doc=no +fi + + + if test x$enable_gtk_doc = xyes; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + : +else + as_fn_error "You need to have gtk-doc >= 1.0 installed to build $PACKAGE_NAME" "$LINENO" 5 +fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 +$as_echo_n "checking whether to build gtk-doc documentation... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 +$as_echo "$enable_gtk_doc" >&6; } + + # Check whether --enable-gtk-doc-html was given. +if test "${enable_gtk_doc_html+set}" = set; then : + enableval=$enable_gtk_doc_html; +else + enable_gtk_doc_html=yes +fi + + # Check whether --enable-gtk-doc-pdf was given. +if test "${enable_gtk_doc_pdf+set}" = set; then : + enableval=$enable_gtk_doc_pdf; +else + enable_gtk_doc_pdf=no +fi + + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + + if test x$enable_gtk_doc = xyes; then + ENABLE_GTK_DOC_TRUE= + ENABLE_GTK_DOC_FALSE='#' +else + ENABLE_GTK_DOC_TRUE='#' + ENABLE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc_html = xyes; then + GTK_DOC_BUILD_HTML_TRUE= + GTK_DOC_BUILD_HTML_FALSE='#' +else + GTK_DOC_BUILD_HTML_TRUE='#' + GTK_DOC_BUILD_HTML_FALSE= +fi + + if test x$enable_gtk_doc_pdf = xyes; then + GTK_DOC_BUILD_PDF_TRUE= + GTK_DOC_BUILD_PDF_FALSE='#' +else + GTK_DOC_BUILD_PDF_TRUE='#' + GTK_DOC_BUILD_PDF_FALSE= +fi + + if test -n "$LIBTOOL"; then + GTK_DOC_USE_LIBTOOL_TRUE= + GTK_DOC_USE_LIBTOOL_FALSE='#' +else + GTK_DOC_USE_LIBTOOL_TRUE='#' + GTK_DOC_USE_LIBTOOL_FALSE= +fi + + if test -n "$GTKDOC_REBASE"; then + GTK_DOC_USE_REBASE_TRUE= + GTK_DOC_USE_REBASE_FALSE='#' +else + GTK_DOC_USE_REBASE_TRUE='#' + GTK_DOC_USE_REBASE_FALSE= +fi + + + + +# Check whether --with-tests was given. +if test "${with_tests+set}" = set; then : + withval=$with_tests; +fi + + if test "x$with_tests" = "xyes"; then + WITH_TESTS_TRUE= + WITH_TESTS_FALSE='#' +else + WITH_TESTS_TRUE='#' + WITH_TESTS_FALSE= +fi + +case $with_tests in + yes) + with_tests=yes + ;; + *) + with_tests=no + ;; +esac + + +ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile src/tests/Makefile marshallers/Makefile src/logging/Makefile src/named-manager/Makefile src/vpn-manager/Makefile src/dhcp-manager/Makefile src/ip6-manager/Makefile src/supplicant-manager/Makefile src/supplicant-manager/tests/Makefile src/ppp-manager/Makefile src/dnsmasq-manager/Makefile src/modem-manager/Makefile src/bluez-manager/Makefile src/system-settings/Makefile src/backends/Makefile libnm-util/libnm-util.pc libnm-util/Makefile libnm-util/tests/Makefile libnm-util/tests/certs/Makefile libnm-glib/libnm-glib.pc libnm-glib/libnm-glib-vpn.pc libnm-glib/Makefile callouts/Makefile tools/Makefile system-settings/Makefile system-settings/plugins/Makefile system-settings/plugins/ifupdown/Makefile system-settings/plugins/ifcfg-rh/Makefile system-settings/plugins/ifcfg-rh/tests/Makefile system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile system-settings/plugins/ifcfg-suse/Makefile system-settings/plugins/keyfile/Makefile system-settings/plugins/keyfile/io/Makefile system-settings/plugins/keyfile/tests/Makefile system-settings/plugins/keyfile/tests/keyfiles/Makefile cli/Makefile cli/src/Makefile test/Makefile initscript/Makefile initscript/RedHat/Makefile initscript/RedHat/NetworkManager initscript/Gentoo/Makefile initscript/Gentoo/NetworkManager initscript/Debian/Makefile initscript/Debian/NetworkManager initscript/Slackware/Makefile initscript/Slackware/rc.networkmanager initscript/SUSE/Makefile initscript/SUSE/networkmanager initscript/Arch/Makefile initscript/Arch/networkmanager initscript/paldo/Makefile initscript/paldo/NetworkManager initscript/Mandriva/Makefile initscript/Mandriva/networkmanager introspection/Makefile man/Makefile man/NetworkManager.8 man/NetworkManager.conf.5 man/nm-system-settings.conf.5 man/nm-tool.1 man/nmcli.1 po/Makefile.in policy/Makefile docs/Makefile docs/libnm-glib/Makefile docs/libnm-util/Makefile NetworkManager.pc examples/Makefile examples/python/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + ac_config_commands="$ac_config_commands po/stamp-it" + + +if test -z "${WITH_DOCS_TRUE}" && test -z "${WITH_DOCS_FALSE}"; then + as_fn_error "conditional \"WITH_DOCS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${TARGET_REDHAT_TRUE}" && test -z "${TARGET_REDHAT_FALSE}"; then + as_fn_error "conditional \"TARGET_REDHAT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_SUSE_TRUE}" && test -z "${TARGET_SUSE_FALSE}"; then + as_fn_error "conditional \"TARGET_SUSE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_GENTOO_TRUE}" && test -z "${TARGET_GENTOO_FALSE}"; then + as_fn_error "conditional \"TARGET_GENTOO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_DEBIAN_TRUE}" && test -z "${TARGET_DEBIAN_FALSE}"; then + as_fn_error "conditional \"TARGET_DEBIAN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_SLACKWARE_TRUE}" && test -z "${TARGET_SLACKWARE_FALSE}"; then + as_fn_error "conditional \"TARGET_SLACKWARE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_ARCH_TRUE}" && test -z "${TARGET_ARCH_FALSE}"; then + as_fn_error "conditional \"TARGET_ARCH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_PALDO_TRUE}" && test -z "${TARGET_PALDO_FALSE}"; then + as_fn_error "conditional \"TARGET_PALDO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_FRUGALWARE_TRUE}" && test -z "${TARGET_FRUGALWARE_FALSE}"; then + as_fn_error "conditional \"TARGET_FRUGALWARE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_MANDRIVA_TRUE}" && test -z "${TARGET_MANDRIVA_FALSE}"; then + as_fn_error "conditional \"TARGET_MANDRIVA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TARGET_PARDUS_TRUE}" && test -z "${TARGET_PARDUS_FALSE}"; then + as_fn_error "conditional \"TARGET_PARDUS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_NSS_TRUE}" && test -z "${WITH_NSS_FALSE}"; then + as_fn_error "conditional \"WITH_NSS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_GNUTLS_TRUE}" && test -z "${WITH_GNUTLS_FALSE}"; then + as_fn_error "conditional \"WITH_GNUTLS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then + as_fn_error "conditional \"ENABLE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then + as_fn_error "conditional \"GTK_DOC_BUILD_HTML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then + as_fn_error "conditional \"GTK_DOC_BUILD_PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then + as_fn_error "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then + as_fn_error "conditional \"GTK_DOC_USE_REBASE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_TESTS_TRUE}" && test -z "${WITH_TESTS_FALSE}"; then + as_fn_error "conditional \"WITH_TESTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by NetworkManager $as_me 0.8.1, which was +generated by GNU Autoconf 2.65. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +NetworkManager config.status 0.8.1 +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;; + "marshallers/Makefile") CONFIG_FILES="$CONFIG_FILES marshallers/Makefile" ;; + "src/logging/Makefile") CONFIG_FILES="$CONFIG_FILES src/logging/Makefile" ;; + "src/named-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/named-manager/Makefile" ;; + "src/vpn-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/vpn-manager/Makefile" ;; + "src/dhcp-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/dhcp-manager/Makefile" ;; + "src/ip6-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/ip6-manager/Makefile" ;; + "src/supplicant-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/supplicant-manager/Makefile" ;; + "src/supplicant-manager/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/supplicant-manager/tests/Makefile" ;; + "src/ppp-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/ppp-manager/Makefile" ;; + "src/dnsmasq-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/dnsmasq-manager/Makefile" ;; + "src/modem-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/modem-manager/Makefile" ;; + "src/bluez-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/bluez-manager/Makefile" ;; + "src/system-settings/Makefile") CONFIG_FILES="$CONFIG_FILES src/system-settings/Makefile" ;; + "src/backends/Makefile") CONFIG_FILES="$CONFIG_FILES src/backends/Makefile" ;; + "libnm-util/libnm-util.pc") CONFIG_FILES="$CONFIG_FILES libnm-util/libnm-util.pc" ;; + "libnm-util/Makefile") CONFIG_FILES="$CONFIG_FILES libnm-util/Makefile" ;; + "libnm-util/tests/Makefile") CONFIG_FILES="$CONFIG_FILES libnm-util/tests/Makefile" ;; + "libnm-util/tests/certs/Makefile") CONFIG_FILES="$CONFIG_FILES libnm-util/tests/certs/Makefile" ;; + "libnm-glib/libnm-glib.pc") CONFIG_FILES="$CONFIG_FILES libnm-glib/libnm-glib.pc" ;; + "libnm-glib/libnm-glib-vpn.pc") CONFIG_FILES="$CONFIG_FILES libnm-glib/libnm-glib-vpn.pc" ;; + "libnm-glib/Makefile") CONFIG_FILES="$CONFIG_FILES libnm-glib/Makefile" ;; + "callouts/Makefile") CONFIG_FILES="$CONFIG_FILES callouts/Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "system-settings/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/Makefile" ;; + "system-settings/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/Makefile" ;; + "system-settings/plugins/ifupdown/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/ifupdown/Makefile" ;; + "system-settings/plugins/ifcfg-rh/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/ifcfg-rh/Makefile" ;; + "system-settings/plugins/ifcfg-rh/tests/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/ifcfg-rh/tests/Makefile" ;; + "system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile" ;; + "system-settings/plugins/ifcfg-suse/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/ifcfg-suse/Makefile" ;; + "system-settings/plugins/keyfile/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/keyfile/Makefile" ;; + "system-settings/plugins/keyfile/io/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/keyfile/io/Makefile" ;; + "system-settings/plugins/keyfile/tests/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/keyfile/tests/Makefile" ;; + "system-settings/plugins/keyfile/tests/keyfiles/Makefile") CONFIG_FILES="$CONFIG_FILES system-settings/plugins/keyfile/tests/keyfiles/Makefile" ;; + "cli/Makefile") CONFIG_FILES="$CONFIG_FILES cli/Makefile" ;; + "cli/src/Makefile") CONFIG_FILES="$CONFIG_FILES cli/src/Makefile" ;; + "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; + "initscript/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/Makefile" ;; + "initscript/RedHat/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/RedHat/Makefile" ;; + "initscript/RedHat/NetworkManager") CONFIG_FILES="$CONFIG_FILES initscript/RedHat/NetworkManager" ;; + "initscript/Gentoo/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/Gentoo/Makefile" ;; + "initscript/Gentoo/NetworkManager") CONFIG_FILES="$CONFIG_FILES initscript/Gentoo/NetworkManager" ;; + "initscript/Debian/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/Debian/Makefile" ;; + "initscript/Debian/NetworkManager") CONFIG_FILES="$CONFIG_FILES initscript/Debian/NetworkManager" ;; + "initscript/Slackware/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/Slackware/Makefile" ;; + "initscript/Slackware/rc.networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/Slackware/rc.networkmanager" ;; + "initscript/SUSE/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/SUSE/Makefile" ;; + "initscript/SUSE/networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/SUSE/networkmanager" ;; + "initscript/Arch/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/Arch/Makefile" ;; + "initscript/Arch/networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/Arch/networkmanager" ;; + "initscript/paldo/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/paldo/Makefile" ;; + "initscript/paldo/NetworkManager") CONFIG_FILES="$CONFIG_FILES initscript/paldo/NetworkManager" ;; + "initscript/Mandriva/Makefile") CONFIG_FILES="$CONFIG_FILES initscript/Mandriva/Makefile" ;; + "initscript/Mandriva/networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/Mandriva/networkmanager" ;; + "introspection/Makefile") CONFIG_FILES="$CONFIG_FILES introspection/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "man/NetworkManager.8") CONFIG_FILES="$CONFIG_FILES man/NetworkManager.8" ;; + "man/NetworkManager.conf.5") CONFIG_FILES="$CONFIG_FILES man/NetworkManager.conf.5" ;; + "man/nm-system-settings.conf.5") CONFIG_FILES="$CONFIG_FILES man/nm-system-settings.conf.5" ;; + "man/nm-tool.1") CONFIG_FILES="$CONFIG_FILES man/nm-tool.1" ;; + "man/nmcli.1") CONFIG_FILES="$CONFIG_FILES man/nmcli.1" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "policy/Makefile") CONFIG_FILES="$CONFIG_FILES policy/Makefile" ;; + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "docs/libnm-glib/Makefile") CONFIG_FILES="$CONFIG_FILES docs/libnm-glib/Makefile" ;; + "docs/libnm-util/Makefile") CONFIG_FILES="$CONFIG_FILES docs/libnm-util/Makefile" ;; + "NetworkManager.pc") CONFIG_FILES="$CONFIG_FILES NetworkManager.pc" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "examples/python/Makefile") CONFIG_FILES="$CONFIG_FILES examples/python/Makefile" ;; + "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; + + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac ;; + "po/stamp-it":C) + if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then + as_fn_error "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 + fi + rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" + >"po/stamp-it.tmp" + sed '/^#/d + s/^[[].*] *// + /^[ ]*$/d + '"s|^| $ac_top_srcdir/|" \ + "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" + + sed '/^POTFILES =/,/[^\\]$/ { + /^POTFILES =/!d + r po/POTFILES + } + ' "po/Makefile.in" >"po/Makefile" + rm -f "po/Makefile.tmp" + mv "po/stamp-it.tmp" "po/stamp-it" + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit $? +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +echo +echo Distribution target: ${with_distro} +echo 'if this is not correct, please specifiy your distro with --with-distro=DISTRO' + +echo + +if test -n "${DHCLIENT_PATH}"; then + echo ISC dhclient support: ${DHCLIENT_PATH} +else + echo ISC dhclient support: no +fi + +if test -n "${DHCPCD_PATH}"; then + echo dhcpcd support: ${DHCPCD_PATH} +else + echo dhcpcd support: no +fi + +echo +echo Building documentation: ${with_docs} +echo Building tests: ${with_tests} +echo + diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..1c54f608 --- /dev/null +++ b/configure.ac @@ -0,0 +1,544 @@ +AC_PREREQ(2.52) + +AC_INIT(NetworkManager, 0.8.1, dcbw@redhat.com, NetworkManager) +AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) +AM_MAINTAINER_MODE + +AC_CONFIG_MACRO_DIR([m4]) + +AC_CONFIG_HEADERS([config.h]) + +dnl Define _GNU_SOURCE for various things like strcasestr() +AC_GNU_SOURCE + +dnl +dnl Require programs +dnl +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_INSTALL +AC_PROG_LIBTOOL + +dnl ensure that when the Automake generated makefile calls aclocal, +dnl it honours the $ACLOCAL_FLAGS environment variable +ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" +if test -n "$ac_macro_dir"; then + ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS" +fi +AC_SUBST([ACLOCAL_AMFLAGS]) + +dnl maintainer mode stuff +if test $USE_MAINTAINER_MODE = yes; then + DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED" +else + DISABLE_DEPRECATED="" +fi +AC_SUBST(DISABLE_DEPRECATED) + +dnl +dnl Required headers +dnl +AC_HEADER_STDC +AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h) + +dnl +dnl Checks for typedefs, structures, and compiler characteristics. +dnl +AC_TYPE_MODE_T +AC_TYPE_PID_T +AC_HEADER_TIME + +dnl +dnl Checks for library functions. +dnl +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MEMCMP +AC_CHECK_FUNCS(select socket uname) + +dnl +dnl translation support +dnl +GETTEXT_PACKAGE=NetworkManager +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package]) +IT_PROG_INTLTOOL([0.35.0]) +AM_GLIB_GNU_GETTEXT + +dnl +dnl Documentation +dnl +AC_ARG_WITH(docs, AS_HELP_STRING([--with-docs], [Build NetworkManager documentation])) +AM_CONDITIONAL(WITH_DOCS, test "x$with_docs" = "xyes") +case $with_docs in + yes) + enable_gtk_doc=yes + ;; + *) + with_docs=no + ;; +esac + +dnl +dnl Make sha1.c happy on big endian systems +dnl +AC_C_BIGENDIAN + +AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, suse, gentoo, debian, arch, slackware, paldo, mandriva or pardus])) +if test "z$with_distro" = "z"; then + AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") + AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") + AC_CHECK_FILE(/etc/fedora-release,with_distro="redhat") + AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo") + AC_CHECK_FILE(/etc/debian_version,with_distro="debian") + AC_CHECK_FILE(/etc/arch-release,with_distro="arch") + AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware") + AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware") + AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva") + AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") + if test "z$with_distro" = "z"; then + with_distro=`lsb_release -is` + fi +fi +with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' ` + +if test "z$with_distro" = "z"; then + echo "Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO" + exit 1 +else + case $with_distro in + redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus) ;; + *) + echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)" + exit 1 + ;; + esac +fi + +AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat) +if test x"$with_distro" = xredhat; then + AC_DEFINE(TARGET_REDHAT, 1, [Define if you have Fedora or RHEL]) +fi + +AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse) +if test x"$with_distro" = xsuse; then + AC_DEFINE(TARGET_SUSE, 1, [Define if you have OpenSUSE or SLES]) +fi + +AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo) +if test x"$with_distro" = xgentoo; then + AC_DEFINE(TARGET_GENTOO, 1, [Define if you have Gentoo]) +fi + +AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian) +if test x"$with_distro" = xdebian; then + AC_DEFINE(TARGET_DEBIAN, 1, [Define if you have Debian]) +fi + +AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware) +if test x"$with_distro" = xslackware; then + AC_DEFINE(TARGET_SLACKWARE, 1, [Define if you have Slackware]) +fi + +AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch) +if test x"$with_distro" = xarch; then + AC_DEFINE(TARGET_ARCH, 1, [Define if you have Arch]) +fi + +AM_CONDITIONAL(TARGET_PALDO, test x"$with_distro" = xpaldo) +if test x"$with_distro" = xpaldo; then + AC_DEFINE(TARGET_PALDO, 1, [Define if you have Paldo]) +fi + +AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware) +if test x"$with_distro" = xfrugalware; then + AC_DEFINE(TARGET_FRUGALWARE, 1, [Define if you have Frugalware]) +fi + +AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva) +if test x"$with_distro" = xmandriva; then + AC_DEFINE(TARGET_MANDRIVA, 1, [Define if you have Mandriva]) +fi + +AM_CONDITIONAL(TARGET_PARDUS, test x"$with_distro" = xpardus) +if test x"$with_distro" = xpardus; then + AC_DEFINE(TARGET_PARDUS, 1, [Define if you have Pardus]) +fi + +dnl +dnl Distribution version string +dnl +AC_ARG_WITH(dist-version, AS_HELP_STRING([--with-dist-version=], [Define the NM's distribution version string]), ac_distver=$withval, ac_distver="") +if ! test x"$ac_distver" = x""; then + AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string]) +fi + +AC_MSG_CHECKING([Linux Wireless Extensions >= 18]) +AC_TRY_COMPILE([#ifndef __user + #define __user + #endif + #include + #include + #include + #include + #include ], + [#ifndef IWEVGENIE + #error "not found" + #endif], + [ac_have_iwevgenie=yes], + [ac_have_iwevgenie=no]) +AC_MSG_RESULT($ac_have_iwevgenie) +if test "$ac_have_iwevgenie" = no; then + AC_MSG_ERROR(wireless-tools library and development headers >= 28pre9 not installed or not functional) +fi + +dnl +dnl Checks for libm - needed for pow() +dnl +LT_LIB_M + +dnl +dnl Checks for libdl - on certain platforms its part of libc +dnl +AC_CHECK_LIB([dl], [dladdr], LIBDL="-ldl", LIBDL="") +AC_SUBST(LIBDL) + +PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.75) +AC_SUBST(DBUS_CFLAGS) +AC_SUBST(DBUS_LIBS) + +PKG_CHECK_MODULES(GLIB, gthread-2.0 glib-2.0 >= 2.18 gobject-2.0) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + +PKG_CHECK_MODULES(GMODULE, gmodule-2.0) +AC_SUBST(GMODULE_CFLAGS) +AC_SUBST(GMODULE_LIBS) + +PKG_CHECK_MODULES(GUDEV, gudev-1.0) +AC_SUBST(GUDEV_CFLAGS) +AC_SUBST(GUDEV_LIBS) + +PKG_CHECK_MODULES(GIO, gio-2.0) +AC_SUBST(GIO_CFLAGS) +AC_SUBST(GIO_LIBS) + +AC_ARG_WITH(udev-dir, AS_HELP_STRING([--with-udev-dir=DIR], [where the udev base directory is])) +if test -n "$with_udev_dir" ; then + UDEV_BASE_DIR="$with_udev_dir" +else + UDEV_BASE_DIR="/lib/udev" +fi +AC_SUBST(UDEV_BASE_DIR) + +PKG_CHECK_MODULES(LIBNL, libnl-1 >= 1.0-pre8) +AC_SUBST(LIBNL_CFLAGS) +AC_SUBST(LIBNL_LIBS) +NM_LIBNL_CHECK + +PKG_CHECK_MODULES(UUID, uuid) +AC_SUBST(UUID_CFLAGS) +AC_SUBST(UUID_LIBS) + +PKG_CHECK_MODULES(POLKIT, polkit-gobject-1) + +AC_SUBST(POLKIT_CFLAGS) + +AC_ARG_WITH(crypto, AS_HELP_STRING([--with-crypto=nss | gnutls], [Cryptography library to use for certificate and key operations]),ac_crypto=$withval, ac_crypto=nss) + +with_nss=no +with_gnutls=no +if test x"$ac_crypto" = xnss; then + PKG_CHECK_MODULES(NSS, [nss >= 3.11]) + AC_DEFINE(HAVE_NSS, 1, [Define if you have NSS]) + with_nss=yes +elif test x"$ac_crypto" = xgnutls; then + PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.2]) + AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) + if test x"$LIBGCRYPT_CONFIG" = xno; then + AC_MSG_ERROR([gnutls explicitly requested but gcrypt not found on system]) + else + AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have libgnutls]) + LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` + LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` + AC_SUBST(LIBGCRYPT_CFLAGS) + AC_SUBST(LIBGCRYPT_LIBS) + with_gnutls=yes + fi +else + AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and key operations]) +fi +AM_CONDITIONAL(WITH_NSS, test x"$with_nss" != xno) +AM_CONDITIONAL(WITH_GNUTLS, test x"$with_gnutls" != xno) + +# Shouldn't ever trigger this, but just in case... +if test x"$ac_nss" = xno -a x"$ac_gnutls" = xno; then + AC_MSG_ERROR([Could not find required development headers and libraries for '$ac_crypto']) +fi + +GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` +AC_SUBST(GLIB_GENMARSHAL) + +AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is])) + +if test -n "$with_dbus_sys_dir" ; then + DBUS_SYS_DIR="$with_dbus_sys_dir" +else + DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d" +fi +AC_SUBST(DBUS_SYS_DIR) + +# PPPD +AC_CHECK_HEADERS(pppd/pppd.h,, + AC_MSG_ERROR(couldn't find pppd.h. pppd development headers are required.)) + +AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory])) + +if test -n "$with_pppd_plugin_dir" ; then + PPPD_PLUGIN_DIR="$with_pppd_plugin_dir" +else + PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.5" +fi +AC_SUBST(PPPD_PLUGIN_DIR) + +# dhclient support +AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support])) +# If a full path is given, use that and do not test if it works or not. +case "${with_dhclient}" in + /*) + DHCLIENT_PATH="${with_dhclient}" + AC_MSG_NOTICE(using dhclient at ${DHCLIENT_PATH}) + ;; + no) AC_MSG_NOTICE(dhclient support disabled) + ;; + *) + AC_MSG_CHECKING(for dhclient) + # NM only works with ISC dhclient - other derivatives don't have + # the same userland. NM also requires dhclient 4.x since older + # versions do not have IPv6 support. + for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do + test -x "${path}/dhclient" || continue + case `"$path/dhclient" --version 2>&1` in + "isc-dhclient-4"*) DHCLIENT_PATH="$path/dhclient"; break;; + esac + done + if test -n "${DHCLIENT_PATH}"; then + AC_MSG_RESULT($DHCLIENT_PATH) + else + AC_MSG_RESULT(no) + fi + ;; +esac + +# dhcpcd support +AC_ARG_WITH([dhcpcd], AS_HELP_STRING([--with-dhcpcd=yes|no|path], [Enable dhcpcd 4.x support])) +# If a full path is given, use that and do not test if it works or not. +case "${with_dhcpcd}" in + /*) + DHCPCD_PATH="${with_dhcpcd}" + AC_MSG_NOTICE(using dhcpcd at ${DHCPCD_PATH}) + ;; + no) AC_MSG_NOTICE(dhcpcd support disabled) + ;; + *) + AC_MSG_CHECKING(for dhcpcd) + # We fully work with upstream dhcpcd-4 + for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do + test -x "${path}/dhclient" || continue + case `"$path/dhcpcd" --version 2>/dev/null` in + "dhcpcd "[123]*);; + "dhcpcd "*) DHCP_CLIENT_PATH="$path/dhcpcd"; break;; + esac + done + if test -n "${DHCPCD_PATH}"; then + AC_MSG_RESULT($DHCPCD_PATH) + else + AC_MSG_RESULT(no) + fi + ;; +esac + +if test -z "$DHCPCD_PATH" -a -z "$DHCLIENT_PATH"; then + # DHCP clients are not a build time dependency, only runtime. + # dhclient has been the longtime default for NM and it's in /sbin + # in most distros, so use it. + AC_MSG_WARN([Could not find a suitable DHCP client]) + DHCLIENT_PATH=/sbin/dhclient + AC_MSG_WARN([Falling back to ISC dhclient, ${DHCP_CLIENT_PATH}]) +fi +AC_SUBST(DHCLIENT_PATH) +AC_SUBST(DHCPCD_PATH) + +# resolvconf support +AC_ARG_WITH([resolvconf], + AS_HELP_STRING([--with-resolvconf=yes|no|path], [Enable resolvconf support]), + with_resolvconf="$withval",with_resolvconf=no) +# If a full path is given, use that and do not test if it works or not. +case "${with_resolvconf}" in + /*) + RESOLVCONF_PATH="${with_resolvconf}" + AC_MSG_NOTICE(setting resolvconf path to ${RESOLVCONF_PATH}) + ;; + no) AC_MSG_NOTICE(resolvconf support disabled) + ;; + *) + AC_MSG_CHECKING(for resolvconf) + for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do + if test -x "${path}/resolvconf"; then + RESOLVCONF_PATH="${path}/resolvconf" + break + fi + done + if test -n "${RESOLVCONF_PATH}"; then + AC_MSG_RESULT($RESOLVCONF_PATH) + else + AC_MSG_RESULT(no) + fi + ;; +esac +AC_SUBST(RESOLVCONF_PATH) +if test -n "${RESOLVCONF_PATH}"; then + AC_DEFINE_UNQUOTED(RESOLVCONF_PATH, "$RESOLVCONF_PATH", [Define if you have a resolvconf implementation]) +fi + +# iptables path +AC_ARG_WITH(iptables, AC_HELP_STRING([--with-iptables=/path/to/iptables], [path to iptables])) +if test "x${with_iptables}" = x; then + AC_PATH_PROG(IPTABLES_PATH, iptables, [], $PATH:/sbin:/usr/sbin) + if ! test -x "$IPTABLES_PATH"; then + AC_MSG_ERROR(iptables was not installed.) + fi +else + IPTABLES_PATH="$with_iptables" +fi +AC_DEFINE_UNQUOTED(IPTABLES_PATH, "$IPTABLES_PATH", [Define to path of iptables binary]) +AC_SUBST(IPTABLES_PATH) + +# system CA certificates path +AC_ARG_WITH(system-ca-path, AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates])) +if test "x${with_system_ca_path}" = x; then + SYSTEM_CA_PATH=/etc/ssl/certs +else + SYSTEM_CA_PATH="$with_system_ca_path" +fi +AC_DEFINE_UNQUOTED(SYSTEM_CA_PATH, "$SYSTEM_CA_PATH", [Define to path to system CA certificates]) +AC_SUBST(SYSTEM_CA_PATH) + +NM_COMPILER_WARNINGS + +GTK_DOC_CHECK(1.0) + +dnl +dnl Tests +dnl +AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests])) +AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes") +case $with_tests in + yes) + with_tests=yes + ;; + *) + with_tests=no + ;; +esac + + +AC_CONFIG_FILES([ +Makefile +include/Makefile +src/Makefile +src/tests/Makefile +marshallers/Makefile +src/logging/Makefile +src/named-manager/Makefile +src/vpn-manager/Makefile +src/dhcp-manager/Makefile +src/ip6-manager/Makefile +src/supplicant-manager/Makefile +src/supplicant-manager/tests/Makefile +src/ppp-manager/Makefile +src/dnsmasq-manager/Makefile +src/modem-manager/Makefile +src/bluez-manager/Makefile +src/system-settings/Makefile +src/backends/Makefile +libnm-util/libnm-util.pc +libnm-util/Makefile +libnm-util/tests/Makefile +libnm-util/tests/certs/Makefile +libnm-glib/libnm-glib.pc +libnm-glib/libnm-glib-vpn.pc +libnm-glib/Makefile +callouts/Makefile +tools/Makefile +system-settings/Makefile +system-settings/plugins/Makefile +system-settings/plugins/ifupdown/Makefile +system-settings/plugins/ifcfg-rh/Makefile +system-settings/plugins/ifcfg-rh/tests/Makefile +system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile +system-settings/plugins/ifcfg-suse/Makefile +system-settings/plugins/keyfile/Makefile +system-settings/plugins/keyfile/io/Makefile +system-settings/plugins/keyfile/tests/Makefile +system-settings/plugins/keyfile/tests/keyfiles/Makefile +cli/Makefile +cli/src/Makefile +test/Makefile +initscript/Makefile +initscript/RedHat/Makefile +initscript/RedHat/NetworkManager +initscript/Gentoo/Makefile +initscript/Gentoo/NetworkManager +initscript/Debian/Makefile +initscript/Debian/NetworkManager +initscript/Slackware/Makefile +initscript/Slackware/rc.networkmanager +initscript/SUSE/Makefile +initscript/SUSE/networkmanager +initscript/Arch/Makefile +initscript/Arch/networkmanager +initscript/paldo/Makefile +initscript/paldo/NetworkManager +initscript/Mandriva/Makefile +initscript/Mandriva/networkmanager +introspection/Makefile +man/Makefile +man/NetworkManager.8 +man/NetworkManager.conf.5 +man/nm-system-settings.conf.5 +man/nm-tool.1 +man/nmcli.1 +po/Makefile.in +policy/Makefile +docs/Makefile +docs/libnm-glib/Makefile +docs/libnm-util/Makefile +NetworkManager.pc +examples/Makefile +examples/python/Makefile +]) +AC_OUTPUT + +echo +echo Distribution target: ${with_distro} +echo 'if this is not correct, please specifiy your distro with --with-distro=DISTRO' + +echo + +if test -n "${DHCLIENT_PATH}"; then + echo ISC dhclient support: ${DHCLIENT_PATH} +else + echo ISC dhclient support: no +fi + +if test -n "${DHCPCD_PATH}"; then + echo dhcpcd support: ${DHCPCD_PATH} +else + echo dhcpcd support: no +fi + +echo +echo Building documentation: ${with_docs} +echo Building tests: ${with_tests} +echo + diff --git a/depcomp b/depcomp new file mode 100755 index 00000000..df8eea7e --- /dev/null +++ b/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, 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 . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 00000000..fe745110 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,50 @@ +SUBDIRS = libnm-glib libnm-util + +if WITH_DOCS + +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util + +noinst_PROGRAMS = \ + generate-settings-spec + +generate_settings_spec_SOURCES = \ + generate-settings-spec.c + +generate_settings_spec_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +generate_settings_spec_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +XSLTPROC = xsltproc --xinclude --nonet +XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml) + +OTHER_FILES= \ + $(top_srcdir)/introspection/all.xml \ + $(top_srcdir)/introspection/generic-types.xml \ + $(top_srcdir)/introspection/errors.xml \ + $(top_srcdir)/introspection/vpn-errors.xml \ + $(top_srcdir)/tools/doc-generator.xsl \ + $(top_srcdir)/introspection/generic-types.xml + +GENERATED_FILES = spec.html settings-spec.html + +spec.html: $(XMLS) $(OTHER_FILES) + $(XSLTPROC) $(top_srcdir)/tools/doc-generator.xsl $(top_srcdir)/introspection/all.xml > $@ + +settings-spec.html: generate-settings-spec $(top_builddir)/libnm-util/libnm-util.la + $(builddir)/generate-settings-spec $(builddir)/settings-spec.html + +all: $(GENERATED_FILES) + +EXTRA_DIST = $(GENERATED_FILES) + +CLEANFILES = $(GENERATED_FILES) + +endif + diff --git a/docs/Makefile.in b/docs/Makefile.in new file mode 100644 index 00000000..cf7c15a3 --- /dev/null +++ b/docs/Makefile.in @@ -0,0 +1,746 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@WITH_DOCS_TRUE@noinst_PROGRAMS = generate-settings-spec$(EXEEXT) +subdir = docs +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am__generate_settings_spec_SOURCES_DIST = generate-settings-spec.c +@WITH_DOCS_TRUE@am_generate_settings_spec_OBJECTS = generate_settings_spec-generate-settings-spec.$(OBJEXT) +generate_settings_spec_OBJECTS = $(am_generate_settings_spec_OBJECTS) +am__DEPENDENCIES_1 = +@WITH_DOCS_TRUE@generate_settings_spec_DEPENDENCIES = \ +@WITH_DOCS_TRUE@ $(top_builddir)/libnm-util/libnm-util.la \ +@WITH_DOCS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(generate_settings_spec_SOURCES) +DIST_SOURCES = $(am__generate_settings_spec_SOURCES_DIST) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = libnm-glib libnm-util +@WITH_DOCS_TRUE@INCLUDES = \ +@WITH_DOCS_TRUE@ -I$(top_srcdir)/include \ +@WITH_DOCS_TRUE@ -I$(top_srcdir)/libnm-util + +@WITH_DOCS_TRUE@generate_settings_spec_SOURCES = \ +@WITH_DOCS_TRUE@ generate-settings-spec.c + +@WITH_DOCS_TRUE@generate_settings_spec_CPPFLAGS = \ +@WITH_DOCS_TRUE@ $(GLIB_CFLAGS) \ +@WITH_DOCS_TRUE@ $(DBUS_CFLAGS) + +@WITH_DOCS_TRUE@generate_settings_spec_LDADD = \ +@WITH_DOCS_TRUE@ $(top_builddir)/libnm-util/libnm-util.la \ +@WITH_DOCS_TRUE@ $(GLIB_LIBS) \ +@WITH_DOCS_TRUE@ $(DBUS_LIBS) + +@WITH_DOCS_TRUE@XSLTPROC = xsltproc --xinclude --nonet +@WITH_DOCS_TRUE@XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml) +@WITH_DOCS_TRUE@OTHER_FILES = \ +@WITH_DOCS_TRUE@ $(top_srcdir)/introspection/all.xml \ +@WITH_DOCS_TRUE@ $(top_srcdir)/introspection/generic-types.xml \ +@WITH_DOCS_TRUE@ $(top_srcdir)/introspection/errors.xml \ +@WITH_DOCS_TRUE@ $(top_srcdir)/introspection/vpn-errors.xml \ +@WITH_DOCS_TRUE@ $(top_srcdir)/tools/doc-generator.xsl \ +@WITH_DOCS_TRUE@ $(top_srcdir)/introspection/generic-types.xml + +@WITH_DOCS_TRUE@GENERATED_FILES = spec.html settings-spec.html +@WITH_DOCS_TRUE@EXTRA_DIST = $(GENERATED_FILES) +@WITH_DOCS_TRUE@CLEANFILES = $(GENERATED_FILES) +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +generate-settings-spec$(EXEEXT): $(generate_settings_spec_OBJECTS) $(generate_settings_spec_DEPENDENCIES) + @rm -f generate-settings-spec$(EXEEXT) + $(LINK) $(generate_settings_spec_OBJECTS) $(generate_settings_spec_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_settings_spec-generate-settings-spec.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +generate_settings_spec-generate-settings-spec.o: generate-settings-spec.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(generate_settings_spec_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT generate_settings_spec-generate-settings-spec.o -MD -MP -MF $(DEPDIR)/generate_settings_spec-generate-settings-spec.Tpo -c -o generate_settings_spec-generate-settings-spec.o `test -f 'generate-settings-spec.c' || echo '$(srcdir)/'`generate-settings-spec.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/generate_settings_spec-generate-settings-spec.Tpo $(DEPDIR)/generate_settings_spec-generate-settings-spec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='generate-settings-spec.c' object='generate_settings_spec-generate-settings-spec.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(generate_settings_spec_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o generate_settings_spec-generate-settings-spec.o `test -f 'generate-settings-spec.c' || echo '$(srcdir)/'`generate-settings-spec.c + +generate_settings_spec-generate-settings-spec.obj: generate-settings-spec.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(generate_settings_spec_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT generate_settings_spec-generate-settings-spec.obj -MD -MP -MF $(DEPDIR)/generate_settings_spec-generate-settings-spec.Tpo -c -o generate_settings_spec-generate-settings-spec.obj `if test -f 'generate-settings-spec.c'; then $(CYGPATH_W) 'generate-settings-spec.c'; else $(CYGPATH_W) '$(srcdir)/generate-settings-spec.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/generate_settings_spec-generate-settings-spec.Tpo $(DEPDIR)/generate_settings_spec-generate-settings-spec.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='generate-settings-spec.c' object='generate_settings_spec-generate-settings-spec.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(generate_settings_spec_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o generate_settings_spec-generate-settings-spec.obj `if test -f 'generate-settings-spec.c'; then $(CYGPATH_W) 'generate-settings-spec.c'; else $(CYGPATH_W) '$(srcdir)/generate-settings-spec.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-noinstPROGRAMS ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +@WITH_DOCS_TRUE@spec.html: $(XMLS) $(OTHER_FILES) +@WITH_DOCS_TRUE@ $(XSLTPROC) $(top_srcdir)/tools/doc-generator.xsl $(top_srcdir)/introspection/all.xml > $@ + +@WITH_DOCS_TRUE@settings-spec.html: generate-settings-spec $(top_builddir)/libnm-util/libnm-util.la +@WITH_DOCS_TRUE@ $(builddir)/generate-settings-spec $(builddir)/settings-spec.html + +@WITH_DOCS_TRUE@all: $(GENERATED_FILES) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/docs/generate-settings-spec.c b/docs/generate-settings-spec.c new file mode 100644 index 00000000..6ec8f7c5 --- /dev/null +++ b/docs/generate-settings-spec.c @@ -0,0 +1,196 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Dan Williams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2009 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include +#include +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +typedef NMSetting* (*SettingNewFunc) (void); + +static SettingNewFunc funcs[] = { + nm_setting_802_1x_new, + nm_setting_bluetooth_new, + nm_setting_cdma_new, + nm_setting_connection_new, + nm_setting_gsm_new, + nm_setting_ip4_config_new, + nm_setting_ip6_config_new, + nm_setting_olpc_mesh_new, + nm_setting_ppp_new, + nm_setting_pppoe_new, + nm_setting_serial_new, + nm_setting_vpn_new, + nm_setting_wired_new, + nm_setting_wireless_new, + nm_setting_wireless_security_new, + NULL +}; + +typedef struct { + const char *gvalue_name; + const char *new_name; +} TypeNameElement; + +static TypeNameElement 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" }, + { "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)" }, + { NULL, NULL } +}; + +static void +write_one_setting (FILE *f, SettingNewFunc func) +{ + int w; + NMSetting *s; + GParamSpec **props, **iter; + guint num; + + s = func (); + + /* write out section header */ + w = fprintf (f, "

Setting name: '%s'

\n", nm_setting_get_name (s)); + + w = fprintf (f, "\n"); + w = fprintf (f, "\n"); + w = fprintf (f, "\n"); + w = fprintf (f, "\n"); + w = fprintf (f, "\n"); + props = g_object_class_list_properties (G_OBJECT_GET_CLASS (G_OBJECT (s)), &num); + for (iter = props; iter && *iter; iter++) { + const char *key_name, *value_type, *value_desc; + char *default_value; + TypeNameElement *name_iter; + GValue value = { 0, }; + + value_type = g_type_name (G_PARAM_SPEC_VALUE_TYPE (*iter)); + for (name_iter = &name_map[0]; name_iter && name_iter->gvalue_name; name_iter++) { + if (!strcmp (value_type, name_iter->gvalue_name)) { + value_type = name_iter->new_name; + break; + } + } + + key_name = g_param_spec_get_name (*iter); + value_desc = g_param_spec_get_blurb (*iter); + + g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (*iter)); + g_param_value_set_default (*iter, &value); + default_value = g_strdup_value_contents (&value); + if (default_value && !strcmp (default_value, "NULL")) { + g_free (default_value); + default_value = NULL; + } + + if (!strcmp (key_name, NM_SETTING_NAME)) { + g_free (default_value); + default_value = NULL; + g_object_get (G_OBJECT (s), NM_SETTING_NAME, &default_value, NULL); + } + + w = fprintf (f, "\n"); + w = fprintf (f, "\n", key_name); + w = fprintf (f, "\n", value_type); + w = fprintf (f, "\n", default_value ? default_value : ""); + w = fprintf (f, "\n", value_desc); + w = fprintf (f, "\n"); + + g_free (default_value); + } + + w = fprintf (f, "
Key NameValue TypeDefault ValueValue Description
%s%s%s%s

\n"); + g_object_unref (s); +} + +int +main (int argc, char *argv[]) +{ + GError *error = NULL; + FILE *f; + int w; + SettingNewFunc *fptr; + + if (argc != 2) { + fprintf (stderr, "Usage: %s \n", argv[0]); + _exit (1); + } + + g_type_init (); + + if (!nm_utils_init (&error)) { + fprintf (stderr, "ERR: failed to initialize libnm-util: %s", error->message); + _exit (2); + } + + f = fopen (argv[1], "w"); + if (!f) { + fprintf (stderr, "ERR: could not create %s: %d\n", argv[1], errno); + _exit (3); + } + + w = fprintf (f, "\n\n"); + w = fprintf (f, "NetworkManager " PACKAGE_VERSION " Settings Specification"); + w = fprintf (f, "\n\n"); + + for (fptr = funcs; fptr && *fptr; fptr++) + write_one_setting (f, *fptr); + + w = fprintf (f, "\n\n"); + + fclose (f); + _exit (0); +} + diff --git a/docs/libnm-glib/Makefile.am b/docs/libnm-glib/Makefile.am new file mode 100644 index 00000000..96ff66ee --- /dev/null +++ b/docs/libnm-glib/Makefile.am @@ -0,0 +1,85 @@ +## Process this file with automake to produce Makefile.in +AUTOMAKE_OPTIONS = 1.6 + +# The name of the module +DOC_MODULE=libnm-glib + +# The top-level SGML file. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.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=../../libnm-glib + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS= + +# Extra options to supply to gtkdoc-scangobj. +SCANGOBJ_OPTIONS=--type-init-func 'g_type_init();' + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS= + +# Used for dependencies. +HFILE_GLOB=$(top_srcdir)/libnm-glib/*.h +CFILE_GLOB=$(top_srcdir)/libnm-glib/*.c + +# Header files to ignore when scanning. +IGNORE_HFILES= \ + nm-dbus-utils.h \ + nm-device-private.h \ + nm-object-cache.h \ + nm-object-private.h \ + nm-remote-connection-private.h \ + nm-types-private.h \ + nm-access-point-bindings.h \ + nm-active-connection-bindings.h \ + nm-client-bindings.h \ + nm-device-bindings.h \ + nm-device-bt-bindings.h \ + nm-device-ethernet-bindings.h \ + nm-device-wifi-bindings.h \ + nm-dhcp4-config-bindings.h \ + nm-dhcp6-config-bindings.h \ + nm-exported-connection-bindings.h \ + nm-exported-connection-glue.h \ + nm-ip4-config-bindings.h \ + nm-ip6-config-bindings.h \ + nm-settings-bindings.h \ + nm-settings-glue.h \ + nm-settings-system-bindings.h \ + nm-vpn-connection-bindings.h \ + nm-vpn-plugin-glue.h + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra XML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = + +# Other files to distribute. +extra_files = + + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +GTKDOC_CFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/marshallers \ + -I$(top_srcdir)/libnm-glib \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +GTKDOC_LIBS = $(top_builddir)/libnm-glib/libnm-glib.la + + +# include common portion ... +include $(top_srcdir)/gtk-doc.make + +CLEANFILES += libnm-glib-sections.txt + diff --git a/docs/libnm-glib/Makefile.in b/docs/libnm-glib/Makefile.in new file mode 100644 index 00000000..6c3d00b9 --- /dev/null +++ b/docs/libnm-glib/Makefile.in @@ -0,0 +1,712 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/gtk-doc.make +subdir = docs/libnm-glib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.6 + +# The name of the module +DOC_MODULE = libnm-glib + +# The top-level SGML file. +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.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 = ../../libnm-glib + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS = + +# Extra options to supply to gtkdoc-scangobj. +SCANGOBJ_OPTIONS = --type-init-func 'g_type_init();' + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS = --sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS = + +# Used for dependencies. +HFILE_GLOB = $(top_srcdir)/libnm-glib/*.h +CFILE_GLOB = $(top_srcdir)/libnm-glib/*.c + +# Header files to ignore when scanning. +IGNORE_HFILES = \ + nm-dbus-utils.h \ + nm-device-private.h \ + nm-object-cache.h \ + nm-object-private.h \ + nm-remote-connection-private.h \ + nm-types-private.h \ + nm-access-point-bindings.h \ + nm-active-connection-bindings.h \ + nm-client-bindings.h \ + nm-device-bindings.h \ + nm-device-bt-bindings.h \ + nm-device-ethernet-bindings.h \ + nm-device-wifi-bindings.h \ + nm-dhcp4-config-bindings.h \ + nm-dhcp6-config-bindings.h \ + nm-exported-connection-bindings.h \ + nm-exported-connection-glue.h \ + nm-ip4-config-bindings.h \ + nm-ip6-config-bindings.h \ + nm-settings-bindings.h \ + nm-settings-glue.h \ + nm-settings-system-bindings.h \ + nm-vpn-connection-bindings.h \ + nm-vpn-plugin-glue.h + + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra XML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = + +# Other files to distribute. +extra_files = + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +GTKDOC_CFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/marshallers \ + -I$(top_srcdir)/libnm-glib \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +GTKDOC_LIBS = $(top_builddir)/libnm-glib/libnm-glib.la +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) +EXTRA_DIST = \ + $(content_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ + pdf-build.stamp \ + $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ + $(srcdir)/pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + + +# include common portion ... +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) \ + libnm-glib-sections.txt +@ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = +@ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp +@ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = +@ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/libnm-glib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/libnm-glib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am +check: check-am +all-am: Makefile all-local +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-local + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: install-am install-strip + +.PHONY: all all-am all-local check check-am clean clean-generic \ + clean-libtool clean-local dist-hook distclean \ + distclean-generic distclean-libtool distclean-local distdir \ + dvi dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-local mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-local + + +@ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +@ENABLE_GTK_DOC_FALSE@all-local: + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +#### scan #### + +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo 'gtk-doc: Scanning header files' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ + else \ + cd $(srcdir) ; \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + @touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### templates #### + +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt + @echo 'gtk-doc: Rebuilding template files' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + @touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +$(srcdir)/tmpl/*.sgml: + @true + +#### xml #### + +sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) + @echo 'gtk-doc: Building XML' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building HTML' + @-chmod -R u+w $(srcdir) + @rm -rf $(srcdir)/html + @mkdir $(srcdir)/html + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$(?)" = "0"; then \ + mkhtml_options=--path="$(srcdir)"; \ + fi; \ + cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + @echo 'gtk-doc: Fixing cross-references' + @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +#### pdf #### + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building PDF' + @-chmod -R u+w $(srcdir) + @rm -rf $(srcdir)/$(DOC_MODULE).pdf + @mkpdf_imgdirs=""; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + @touch pdf-build.stamp + +############## + +clean-local: + rm -f *~ *.bak + rm -rf .libs + +distclean-local: + cd $(srcdir) && \ + rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +maintainer-clean-local: clean + cd $(srcdir) && rm -rf xml html + +install-data-local: + @installfiles=`echo $(srcdir)/html/*`; \ + if test "$$installfiles" = '$(srcdir)/html/*'; \ + then echo '-- Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + mv -f $${installdir}/$(DOC_MODULE).devhelp \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +@ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: +@ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: +@ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" +@ENABLE_GTK_DOC_FALSE@ @false + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/tmpl + mkdir $(distdir)/html + -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl + cp $(srcdir)/html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/docs/libnm-glib/html/NMCdmaDevice.html b/docs/libnm-glib/html/NMCdmaDevice.html new file mode 100644 index 00000000..f0765444 --- /dev/null +++ b/docs/libnm-glib/html/NMCdmaDevice.html @@ -0,0 +1,105 @@ + + + + +NMCdmaDevice + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMCdmaDevice

+

NMCdmaDevice

+
+
+

Synopsis

+
                    NMCdmaDevice;
+GObject *           nm_cdma_device_new                  (DBusGConnection *connection,
+                                                         const char *path);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMDevice
+               +----NMSerialDevice
+                     +----NMCdmaDevice
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMCdmaDevice

+
typedef struct _NMCdmaDevice NMCdmaDevice;
+

+

+
+
+
+

nm_cdma_device_new ()

+
GObject *           nm_cdma_device_new                  (DBusGConnection *connection,
+                                                         const char *path);
+

+Creates a new NMCdmaDevice. +

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

connection :

the DBusGConnection +

path :

the DBus object path of the device +

Returns :

a new device +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/NMDHCP4Config.html b/docs/libnm-glib/html/NMDHCP4Config.html new file mode 100644 index 00000000..697744f7 --- /dev/null +++ b/docs/libnm-glib/html/NMDHCP4Config.html @@ -0,0 +1,187 @@ + + + + +NMDHCP4Config + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMDHCP4Config

+

NMDHCP4Config

+
+
+

Synopsis

+
                    NMDHCP4Config;
+#define             NM_DHCP4_CONFIG_OPTIONS
+GObject *           nm_dhcp4_config_new                 (DBusGConnection *connection,
+                                                         const char *object_path);
+GHashTable *        nm_dhcp4_config_get_options         (NMDHCP4Config *config);
+const char *        nm_dhcp4_config_get_one_option      (NMDHCP4Config *config,
+                                                         const char *option);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMDHCP4Config
+
+
+
+

Properties

+
+  "options"                  GHashTable*           : Read
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMDHCP4Config

+
typedef struct _NMDHCP4Config NMDHCP4Config;
+

+

+
+
+
+

NM_DHCP4_CONFIG_OPTIONS

+
#define NM_DHCP4_CONFIG_OPTIONS "options"
+
+

+

+
+
+
+

nm_dhcp4_config_new ()

+
GObject *           nm_dhcp4_config_new                 (DBusGConnection *connection,
+                                                         const char *object_path);
+

+Creates a new NMDHCP4Config. +

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

connection :

the DBusGConnection +

object_path :

the DBus object path of the device +

Returns :

a new configuration +
+
+
+
+

nm_dhcp4_config_get_options ()

+
GHashTable *        nm_dhcp4_config_get_options         (NMDHCP4Config *config);
+

+Gets all the options contained in the configuration. +

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

config :

a NMDHCP4Config +

Returns :

the GHashTable containing strings for keys and values. +This is the internal copy used by the configuration, and must not be modified. +
+
+
+
+

nm_dhcp4_config_get_one_option ()

+
const char *        nm_dhcp4_config_get_one_option      (NMDHCP4Config *config,
+                                                         const char *option);
+

+Gets one option by option name. +

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

config :

a NMDHCP4Config +

option :

the option to retrieve +

Returns :

the configuration option's value. This is the internal string used by the +configuration, and must not be modified. +
+
+
+
+

Property Details

+
+

The "options" property

+
  "options"                  GHashTable*           : Read
+

+The GHashTable containing options of the configuration. +

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/NMDHCP6Config.html b/docs/libnm-glib/html/NMDHCP6Config.html new file mode 100644 index 00000000..8edffbb6 --- /dev/null +++ b/docs/libnm-glib/html/NMDHCP6Config.html @@ -0,0 +1,169 @@ + + + + +NMDHCP6Config + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMDHCP6Config

+

NMDHCP6Config

+
+
+

Synopsis

+
                    NMDHCP6Config;
+#define             NM_DHCP6_CONFIG_OPTIONS
+GObject *           nm_dhcp6_config_new                 (DBusGConnection *connection,
+                                                         const char *object_path);
+GHashTable *        nm_dhcp6_config_get_options         (NMDHCP6Config *config);
+const char *        nm_dhcp6_config_get_one_option      (NMDHCP6Config *config,
+                                                         const char *option);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMDHCP6Config
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMDHCP6Config

+
typedef struct _NMDHCP6Config NMDHCP6Config;
+

+

+
+
+
+

NM_DHCP6_CONFIG_OPTIONS

+
#define NM_DHCP6_CONFIG_OPTIONS "options"
+
+

+

+
+
+
+

nm_dhcp6_config_new ()

+
GObject *           nm_dhcp6_config_new                 (DBusGConnection *connection,
+                                                         const char *object_path);
+

+Creates a new NMDHCP6Config. +

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

connection :

the DBusGConnection +

object_path :

the DBus object path of the device +

Returns :

a new configuration +
+
+
+
+

nm_dhcp6_config_get_options ()

+
GHashTable *        nm_dhcp6_config_get_options         (NMDHCP6Config *config);
+

+Gets all the options contained in the configuration. +

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

config :

a NMDHCP6Config +

Returns :

the GHashTable containing strings for keys and values. +This is the internal copy used by the configuration, and must not be modified. +
+
+
+
+

nm_dhcp6_config_get_one_option ()

+
const char *        nm_dhcp6_config_get_one_option      (NMDHCP6Config *config,
+                                                         const char *option);
+

+Gets one option by option name. +

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

config :

a NMDHCP6Config +

option :

the option to retrieve +

Returns :

the configuration option's value. This is the internal string used by the +configuration, and must not be modified. +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/NMGsmDevice.html b/docs/libnm-glib/html/NMGsmDevice.html new file mode 100644 index 00000000..257c3bb8 --- /dev/null +++ b/docs/libnm-glib/html/NMGsmDevice.html @@ -0,0 +1,105 @@ + + + + +NMGsmDevice + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMGsmDevice

+

NMGsmDevice

+
+
+

Synopsis

+
                    NMGsmDevice;
+NMGsmDevice *       nm_gsm_device_new                   (DBusGConnection *connection,
+                                                         const char *path);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMDevice
+               +----NMSerialDevice
+                     +----NMGsmDevice
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMGsmDevice

+
typedef struct _NMGsmDevice NMGsmDevice;
+

+

+
+
+
+

nm_gsm_device_new ()

+
NMGsmDevice *       nm_gsm_device_new                   (DBusGConnection *connection,
+                                                         const char *path);
+

+Creates a new NMGsmDevice. +

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

connection :

the DBusGConnection +

path :

the DBus object path of the device +

Returns :

a new device +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/NMIP4Config.html b/docs/libnm-glib/html/NMIP4Config.html new file mode 100644 index 00000000..d8b6411e --- /dev/null +++ b/docs/libnm-glib/html/NMIP4Config.html @@ -0,0 +1,370 @@ + + + + +NMIP4Config + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMIP4Config

+

NMIP4Config

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMIP4Config
+
+
+
+

Properties

+
+  "addresses"                gpointer              : Read
+  "domains"                  nm-string-array*      : Read
+  "hostname"                 gchar*                : Read
+  "nameservers"              nm-uint-array*        : Read
+  "routes"                   gpointer              : Read
+  "wins-servers"             nm-uint-array*        : Read
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMIP4Config

+
typedef struct _NMIP4Config NMIP4Config;
+

+

+
+
+
+

NM_IP4_CONFIG_ADDRESSES

+
#define NM_IP4_CONFIG_ADDRESSES "addresses"
+
+

+

+
+
+
+

NM_IP4_CONFIG_HOSTNAME

+
#define NM_IP4_CONFIG_HOSTNAME "hostname" /* DEPRECATED */
+
+

+

+
+
+
+

NM_IP4_CONFIG_NAMESERVERS

+
#define NM_IP4_CONFIG_NAMESERVERS "nameservers"
+
+

+

+
+
+
+

NM_IP4_CONFIG_DOMAINS

+
#define NM_IP4_CONFIG_DOMAINS "domains"
+
+

+

+
+
+
+

NM_IP4_CONFIG_ROUTES

+
#define NM_IP4_CONFIG_ROUTES "routes"
+
+

+

+
+
+
+

NM_IP4_CONFIG_WINS_SERVERS

+
#define NM_IP4_CONFIG_WINS_SERVERS "wins-servers"
+
+

+

+
+
+
+

nm_ip4_config_new ()

+
GObject *           nm_ip4_config_new                   (DBusGConnection *connection,
+                                                         const char *object_path);
+

+Creates a new NMIP4Config. +

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

connection :

the DBusGConnection +

object_path :

the DBus object path of the device +

Returns :

a new IP4 configuration +
+
+
+
+

nm_ip4_config_get_addresses ()

+
const GSList *      nm_ip4_config_get_addresses         (NMIP4Config *config);
+

+Gets the IP4 addresses (containing the address, prefix, and gateway). +

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

config :

a NMIP4Config +

Returns :

the GSList containing NMSettingIP4Addresses. This is the internal copy +used by the configuration and must not be modified. +
+
+
+
+

nm_ip4_config_get_hostname ()

+
const char *        nm_ip4_config_get_hostname          (NMIP4Config *config);
+

+DEPRECATED. Don't use. +

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

config :

a NMIP4Config +

Returns :

NULL +
+
+
+
+

nm_ip4_config_get_nameservers ()

+
const GArray *      nm_ip4_config_get_nameservers       (NMIP4Config *config);
+

+Gets the domain name servers (DNS). +

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

config :

a NMIP4Config +

Returns :

the GArray containing guint32s. This is the internal copy used by the +configuration and must not be modified. +
+
+
+
+

nm_ip4_config_get_domains ()

+
const GPtrArray *   nm_ip4_config_get_domains           (NMIP4Config *config);
+

+Gets the domain names. +

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

config :

a NMIP4Config +

Returns :

the GPtrArray containing domains as strings. This is the +internal copy used by the configuration, and must not be modified. +
+
+
+
+

nm_ip4_config_get_routes ()

+
const GSList *      nm_ip4_config_get_routes            (NMIP4Config *config);
+

+Gets the routes. +

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

config :

a NMIP4Config +

Returns :

the GSList containing NMSettingIP4Routes. This is the +internal copy used by the configuration, and must not be modified. +
+
+
+
+

nm_ip4_config_get_wins_servers ()

+
const GArray *      nm_ip4_config_get_wins_servers      (NMIP4Config *config);
+

+Gets the Windows Internet Name Service servers (WINS). +

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

config :

a NMIP4Config +

Returns :

the GArray containing guint32s. This is the internal copy used by the +configuration and must not be modified. +
+
+
+
+

Property Details

+
+

The "addresses" property

+
  "addresses"                gpointer              : Read
+

+The GPtrArray containing NMSettingIP4Addresses of the configuration. +

+
+
+
+

The "domains" property

+
  "domains"                  nm-string-array*      : Read
+

+The GPtrArray containing domain strings of the configuration. +

+
+
+
+

The "hostname" property

+
  "hostname"                 gchar*                : Read
+

+DEPRECATED. Don't use. +

+

Default value: NULL

+
+
+
+

The "nameservers" property

+
  "nameservers"              nm-uint-array*        : Read
+

+The GArray containing name servers (guint32es) of the configuration. +

+
+
+
+

The "routes" property

+
  "routes"                   gpointer              : Read
+

+The GPtrArray containing NMSettingIP4Routes of the configuration. +

+
+
+
+

The "wins-servers" property

+
  "wins-servers"             nm-uint-array*        : Read
+

+The GArray containing WINS servers (guint32es) of the configuration. +

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/NMIP6Config.html b/docs/libnm-glib/html/NMIP6Config.html new file mode 100644 index 00000000..738699ba --- /dev/null +++ b/docs/libnm-glib/html/NMIP6Config.html @@ -0,0 +1,290 @@ + + + + +NMIP6Config + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMIP6Config

+

NMIP6Config

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMIP6Config
+
+
+
+

Properties

+
+  "addresses"                nm-ip6-address-object-array*  : Read
+  "domains"                  nm-string-array*      : Read
+  "nameservers"              nm-ip6-address-array*  : Read
+  "routes"                   nm-ip6-route-object-array*  : Read
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMIP6Config

+
typedef struct _NMIP6Config NMIP6Config;
+

+

+
+
+
+

NM_IP6_CONFIG_ADDRESSES

+
#define NM_IP6_CONFIG_ADDRESSES "addresses"
+
+

+

+
+
+
+

NM_IP6_CONFIG_NAMESERVERS

+
#define NM_IP6_CONFIG_NAMESERVERS "nameservers"
+
+

+

+
+
+
+

NM_IP6_CONFIG_DOMAINS

+
#define NM_IP6_CONFIG_DOMAINS "domains"
+
+

+

+
+
+
+

NM_IP6_CONFIG_ROUTES

+
#define NM_IP6_CONFIG_ROUTES "routes"
+
+

+

+
+
+
+

nm_ip6_config_new ()

+
GObject *           nm_ip6_config_new                   (DBusGConnection *connection,
+                                                         const char *object_path);
+

+Creates a new NMIP6Config. +

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

connection :

the DBusGConnection +

object_path :

the DBus object path of the device +

Returns :

a new IP6 configuration +
+
+
+
+

nm_ip6_config_get_addresses ()

+
const GSList *      nm_ip6_config_get_addresses         (NMIP6Config *config);
+

+Gets the IP6 addresses (containing the address, prefix, and gateway). +

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

config :

a NMIP6Config +

Returns :

the GSList containing NMSettingIP6Addresses. This is the internal copy +used by the configuration and must not be modified. +
+
+
+
+

nm_ip6_config_get_nameservers ()

+
const GSList *      nm_ip6_config_get_nameservers       (NMIP6Config *config);
+

+Gets the domain name servers (DNS). +

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

config :

a NMIP6Config +

Returns :

a GSList containing elements of type 'struct in6_addr' which contain +the addresses of nameservers of the configuration. This is the internal copy +used by the configuration and must not be modified. +
+
+
+
+

nm_ip6_config_get_domains ()

+
const GPtrArray *   nm_ip6_config_get_domains           (NMIP6Config *config);
+

+Gets the domain names. +

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

config :

a NMIP6Config +

Returns :

the GPtrArray containing domains as strings. This is the +internal copy used by the configuration, and must not be modified. +
+
+
+
+

nm_ip6_config_get_routes ()

+
const GSList *      nm_ip6_config_get_routes            (NMIP6Config *config);
+

+Gets the routes. +

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

config :

a NMIP6Config +

Returns :

the GSList containing NMSettingIP6Routes. This is the +internal copy used by the configuration, and must not be modified. +
+
+
+
+

Property Details

+
+

The "addresses" property

+
  "addresses"                nm-ip6-address-object-array*  : Read
+

+The GPtrArray containing the IPv6 addresses; use +nm_utils_ip6_addresses_from_gvalue() to return a GSList of +NMSettingIP6Address objects that is more usable than the raw data. +

+
+
+
+

The "domains" property

+
  "domains"                  nm-string-array*      : Read
+

+The GPtrArray containing domain strings of the configuration. +

+
+
+
+

The "nameservers" property

+
  "nameservers"              nm-ip6-address-array*  : Read
+

+The GPtrArray containing elements of type 'struct ip6_addr' which +contain the addresses of nameservers of the configuration. +

+
+
+
+

The "routes" property

+
  "routes"                   nm-ip6-route-object-array*  : Read
+

+The GPtrArray containing the IPv6 routes; use +nm_utils_ip6_routes_from_gvalue() to return a GSList of +NMSettingIP6Address objects that is more usable than the raw data. +

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/NMSerialDevice.html b/docs/libnm-glib/html/NMSerialDevice.html new file mode 100644 index 00000000..a4354823 --- /dev/null +++ b/docs/libnm-glib/html/NMSerialDevice.html @@ -0,0 +1,170 @@ + + + + +NMSerialDevice + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSerialDevice

+

NMSerialDevice

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMDevice
+               +----NMSerialDevice
+                     +----NMGsmDevice
+                     +----NMCdmaDevice
+
+
+
+

Signals

+
+  "ppp-stats"                                      : Run First
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMSerialDevice

+
typedef struct _NMSerialDevice NMSerialDevice;
+

+

+
+
+
+

nm_serial_device_get_bytes_received ()

+
guint32             nm_serial_device_get_bytes_received (NMSerialDevice *self);
+

+Gets the amount of bytes received by the serial device. +This counter is reset when the device is activated. +

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

self :

a NMSerialDevice +

Returns :

bytes received +
+
+
+
+

nm_serial_device_get_bytes_sent ()

+
guint32             nm_serial_device_get_bytes_sent     (NMSerialDevice *self);
+

+Gets the amount of bytes sent by the serial device. +This counter is reset when the device is activated. +

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

self :

a NMSerialDevice +

Returns :

bytes sent +
+
+
+
+

Signal Details

+
+

The "ppp-stats" signal

+
void                user_function                      (NMSerialDevice *device,
+                                                        guint           in_bytes,
+                                                        guint           out_bytes,
+                                                        gpointer        user_data)      : Run First
+

+Notifies that a NMAccessPoint is added to the wifi device. +

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

device :

the serial device that received the signal +

in_bytes :

the amount of bytes received +

out_bytes :

the amount of bytes sent +

user_data :

user data set when the signal handler was connected.
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/ch01.html b/docs/libnm-glib/html/ch01.html new file mode 100644 index 00000000..c795714a --- /dev/null +++ b/docs/libnm-glib/html/ch01.html @@ -0,0 +1,113 @@ + + + + +libnm-glib Objects + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/libnm-glib/html/home.png b/docs/libnm-glib/html/home.png new file mode 100644 index 00000000..17003611 Binary files /dev/null and b/docs/libnm-glib/html/home.png differ diff --git a/docs/libnm-glib/html/index.html b/docs/libnm-glib/html/index.html new file mode 100644 index 00000000..5ff93e32 --- /dev/null +++ b/docs/libnm-glib/html/index.html @@ -0,0 +1,116 @@ + + + + +libnm-glib Reference Manual + + + + + + + + + + + \ No newline at end of file diff --git a/docs/libnm-glib/html/index.sgml b/docs/libnm-glib/html/index.sgml new file mode 100644 index 00000000..810b8b0e --- /dev/null +++ b/docs/libnm-glib/html/index.sgml @@ -0,0 +1,498 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/html/left.png b/docs/libnm-glib/html/left.png new file mode 100644 index 00000000..2d05b3d5 Binary files /dev/null and b/docs/libnm-glib/html/left.png differ diff --git a/docs/libnm-glib/html/libnm-glib-NMExportedConnection.html b/docs/libnm-glib/html/libnm-glib-NMExportedConnection.html new file mode 100644 index 00000000..58492295 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-NMExportedConnection.html @@ -0,0 +1,89 @@ + + + + +NMExportedConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMExportedConnection

+

NMExportedConnection

+
+ +
+

Description

+

+

+
+
+

Details

+
+

NMExportedConnection

+
typedef struct {
+	NMConnection parent;
+} NMExportedConnection;
+
+

+

+
+
+
+

nm_exported_connection_new ()

+
NMExportedConnection * nm_exported_connection_new       (NMConnectionScope scope);
+

+Creates a new object representing the remote connection. +

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

scope :

the Connection scope (either user or system) +

Returns :

the new exported connection object on success, or NULL on failure +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-NMRemoteConnection.html b/docs/libnm-glib/html/libnm-glib-NMRemoteConnection.html new file mode 100644 index 00000000..9bac6e61 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-NMRemoteConnection.html @@ -0,0 +1,104 @@ + + + + +NMRemoteConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMRemoteConnection

+

NMRemoteConnection

+
+
+

Synopsis

+
                    NMRemoteConnection;
+NMRemoteConnection * nm_remote_connection_new           (DBusGConnection *bus,
+                                                         NMConnectionScope scope,
+                                                         const char *path);
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMRemoteConnection

+
typedef struct {
+	NMConnection parent;
+} NMRemoteConnection;
+
+

+

+
+
+
+

nm_remote_connection_new ()

+
NMRemoteConnection * nm_remote_connection_new           (DBusGConnection *bus,
+                                                         NMConnectionScope scope,
+                                                         const char *path);
+

+Creates a new object representing the remote connection. +

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

bus :

a valid and connected D-Bus connection +

scope :

the Connection scope (either user or system) +

path :

the D-Bus path of the connection as exported by the settings service + indicated by scope +

Returns :

the new remote connection object on success, or NULL on failure +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-NMRemoteSettingsSystem.html b/docs/libnm-glib/html/libnm-glib-NMRemoteSettingsSystem.html new file mode 100644 index 00000000..c84d4665 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-NMRemoteSettingsSystem.html @@ -0,0 +1,89 @@ + + + + +NMRemoteSettingsSystem + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMRemoteSettingsSystem

+

NMRemoteSettingsSystem

+
+ +
+

Description

+

+

+
+
+

Details

+
+

NMRemoteSettingsSystem

+
typedef struct {
+	NMRemoteSettings parent;
+} NMRemoteSettingsSystem;
+
+

+

+
+
+
+

nm_remote_settings_system_new ()

+
NMRemoteSettingsSystem * nm_remote_settings_system_new  (DBusGConnection *bus);
+

+Creates a new object representing the remote system settings service. +

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

bus :

a valid and connected D-Bus connection +

Returns :

the new remote system settings object on success, or NULL on failure +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-access-point.html b/docs/libnm-glib/html/libnm-glib-nm-access-point.html new file mode 100644 index 00000000..cfddf32a --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-access-point.html @@ -0,0 +1,503 @@ + + + + +NMAccessPoint + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMAccessPoint

+

NMAccessPoint

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMAccessPoint
+
+
+
+

Properties

+
+  "flags"                    guint                 : Read
+  "frequency"                guint                 : Read
+  "hw-address"               gchar*                : Read
+  "max-bitrate"              guint                 : Read
+  "mode"                     guint                 : Read
+  "rsn-flags"                guint                 : Read
+  "ssid"                     nm-ssid*              : Read
+  "strength"                 guchar                : Read
+  "wpa-flags"                guint                 : Read
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_ACCESS_POINT_FLAGS

+
#define NM_ACCESS_POINT_FLAGS       "flags"
+
+

+

+
+
+
+

NM_ACCESS_POINT_WPA_FLAGS

+
#define NM_ACCESS_POINT_WPA_FLAGS   "wpa-flags"
+
+

+

+
+
+
+

NM_ACCESS_POINT_RSN_FLAGS

+
#define NM_ACCESS_POINT_RSN_FLAGS   "rsn-flags"
+
+

+

+
+
+
+

NM_ACCESS_POINT_SSID

+
#define NM_ACCESS_POINT_SSID        "ssid"
+
+

+

+
+
+
+

NM_ACCESS_POINT_FREQUENCY

+
#define NM_ACCESS_POINT_FREQUENCY   "frequency"
+
+

+

+
+
+
+

NM_ACCESS_POINT_HW_ADDRESS

+
#define NM_ACCESS_POINT_HW_ADDRESS  "hw-address"
+
+

+

+
+
+
+

NM_ACCESS_POINT_MODE

+
#define NM_ACCESS_POINT_MODE        "mode"
+
+

+

+
+
+
+

NM_ACCESS_POINT_MAX_BITRATE

+
#define NM_ACCESS_POINT_MAX_BITRATE "max-bitrate"
+
+

+

+
+
+
+

NM_ACCESS_POINT_STRENGTH

+
#define NM_ACCESS_POINT_STRENGTH    "strength"
+
+

+

+
+
+
+

NMAccessPoint

+
typedef struct _NMAccessPoint NMAccessPoint;
+

+

+
+
+
+

nm_access_point_new ()

+
GObject *           nm_access_point_new                 (DBusGConnection *connection,
+                                                         const char *path);
+

+Creates a new NMAccessPoint. +

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

connection :

the DBusGConnection +

path :

the DBusobject path of the access point +

Returns :

a new access point +
+
+
+
+

nm_access_point_get_flags ()

+
guint32             nm_access_point_get_flags           (NMAccessPoint *ap);
+

+Gets the flags of the access point +

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

ap :

a NMAccessPoint +

Returns :

the flags +
+
+
+
+

nm_access_point_get_wpa_flags ()

+
guint32             nm_access_point_get_wpa_flags       (NMAccessPoint *ap);
+

+Gets the WPA flags of the access point. +

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

ap :

a NMAccessPoint +

Returns :

the WPA flags +
+
+
+
+

nm_access_point_get_rsn_flags ()

+
guint32             nm_access_point_get_rsn_flags       (NMAccessPoint *ap);
+

+Gets the RSN flags of the access point. +

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

ap :

a NMAccessPoint +

Returns :

the RSN flags +
+
+
+
+

nm_access_point_get_ssid ()

+
const GByteArray *  nm_access_point_get_ssid            (NMAccessPoint *ap);
+

+Gets the SSID of the access point. +

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

ap :

a NMAccessPoint +

Returns :

the GByteArray containing the SSID. This is the internal copy used by the +access point, and must not be modified. +
+
+
+
+

nm_access_point_get_frequency ()

+
guint32             nm_access_point_get_frequency       (NMAccessPoint *ap);
+

+Gets the frequency of the access point. +

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

ap :

a NMAccessPoint +

Returns :

the frequency +
+
+
+
+

nm_access_point_get_hw_address ()

+
const char *        nm_access_point_get_hw_address      (NMAccessPoint *ap);
+

+Gets the hardware (MAC) address of the access point. +

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

ap :

a NMAccessPoint +

Returns :

the hardware address of the access point. This is the internal string used by the +access point and must not be modified. +
+
+
+
+

nm_access_point_get_mode ()

+
NM80211Mode         nm_access_point_get_mode            (NMAccessPoint *ap);
+

+Gets the mode of the access point. +

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

ap :

a NMAccessPoint +

Returns :

the mode +
+
+
+
+

nm_access_point_get_max_bitrate ()

+
guint32             nm_access_point_get_max_bitrate     (NMAccessPoint *ap);
+

+Gets the maximum bit rate of the access point. +

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

ap :

a NMAccessPoint +

Returns :

the maximum bit rate +
+
+
+
+

nm_access_point_get_strength ()

+
guint8              nm_access_point_get_strength        (NMAccessPoint *ap);
+

+Gets the current signal strength of the access point. +

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

ap :

a NMAccessPoint +

Returns :

the signal strength +
+
+
+
+

Property Details

+
+

The "flags" property

+
  "flags"                    guint                 : Read
+

+The flags of the access point. +

+

Allowed values: <= 1

+

Default value: 0

+
+
+
+

The "frequency" property

+
  "frequency"                guint                 : Read
+

+The frequency of the access point. +

+

Allowed values: <= 10000

+

Default value: 0

+
+
+
+

The "hw-address" property

+
  "hw-address"               gchar*                : Read
+

+The hardware address of the access point. +

+

Default value: NULL

+
+
+
+

The "max-bitrate" property

+
  "max-bitrate"              guint                 : Read
+

+The maximum bit rate of the access point. +

+

Default value: 0

+
+
+
+

The "mode" property

+
  "mode"                     guint                 : Read
+

+The mode of the access point. +

+

Allowed values: [1,2]

+

Default value: 2

+
+
+
+

The "rsn-flags" property

+
  "rsn-flags"                guint                 : Read
+

+The RSN flags of the access point. +

+

Default value: 0

+
+
+
+

The "ssid" property

+
  "ssid"                     nm-ssid*              : Read
+

+The SSID of the access point. +

+
+
+
+

The "strength" property

+
  "strength"                 guchar                : Read
+

+The current signal strength of the access point. +

+

Default value: 0

+
+
+
+

The "wpa-flags" property

+
  "wpa-flags"                guint                 : Read
+

+The WPA flags of the access point. +

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-active-connection.html b/docs/libnm-glib/html/libnm-glib-nm-active-connection.html new file mode 100644 index 00000000..1b5f8fd5 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-active-connection.html @@ -0,0 +1,445 @@ + + + + +NMActiveConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMActiveConnection

+

NMActiveConnection

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMActiveConnection
+
+
+
+

Properties

+
+  "connection"               gchar*                : Read
+  "default"                  gboolean              : Read
+  "default6"                 gboolean              : Read
+  "devices"                  nm-object-array*      : Read
+  "service-name"             gchar*                : Read
+  "specific-object"          gchar*                : Read
+  "state"                    guint                 : Read
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_ACTIVE_CONNECTION_SERVICE_NAME

+
#define NM_ACTIVE_CONNECTION_SERVICE_NAME        "service-name"
+
+

+

+
+
+
+

NM_ACTIVE_CONNECTION_CONNECTION

+
#define NM_ACTIVE_CONNECTION_CONNECTION          "connection"
+
+

+

+
+
+
+

NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT

+
#define NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT     "specific-object"
+
+

+

+
+
+
+

NM_ACTIVE_CONNECTION_DEVICES

+
#define NM_ACTIVE_CONNECTION_DEVICES             "devices"
+
+

+

+
+
+
+

NM_ACTIVE_CONNECTION_STATE

+
#define NM_ACTIVE_CONNECTION_STATE               "state"
+
+

+

+
+
+
+

NM_ACTIVE_CONNECTION_DEFAULT

+
#define NM_ACTIVE_CONNECTION_DEFAULT             "default"
+
+

+

+
+
+
+

NM_ACTIVE_CONNECTION_DEFAULT6

+
#define NM_ACTIVE_CONNECTION_DEFAULT6            "default6"
+
+

+

+
+
+
+

NMActiveConnection

+
typedef struct _NMActiveConnection NMActiveConnection;
+

+

+
+
+
+

nm_active_connection_new ()

+
GObject *           nm_active_connection_new            (DBusGConnection *connection,
+                                                         const char *path);
+

+Creates a new NMActiveConnection. +

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

connection :

the DBusGConnection +

path :

the DBus object path of the device +

Returns :

a new active connection +
+
+
+
+

nm_active_connection_get_service_name ()

+
const char *        nm_active_connection_get_service_name
+                                                        (NMActiveConnection *connection);
+

+Gets the service name of the active connection. +

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

connection :

a NMActiveConnection +

Returns :

the service name. This is the internal string used by the +connection, and must not be modified. +
+
+
+
+

nm_active_connection_get_scope ()

+
NMConnectionScope   nm_active_connection_get_scope      (NMActiveConnection *connection);
+

+Gets the scope of the active connection. +

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

connection :

a NMActiveConnection +

Returns :

the connection's scope +
+
+
+
+

nm_active_connection_get_connection ()

+
const char *        nm_active_connection_get_connection (NMActiveConnection *connection);
+

+Gets the NMConnection's DBus object path. +

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

connection :

a NMActiveConnection +

Returns :

the object path of the NMConnection inside of NMActiveConnection. +This is the internal string used by the connection, and must not be modified. +
+
+
+
+

nm_active_connection_get_specific_object ()

+
const char *        nm_active_connection_get_specific_object
+                                                        (NMActiveConnection *connection);
+

+Gets the "specific object" used at the activation. +

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

connection :

a NMActiveConnection +

Returns :

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

nm_active_connection_get_devices ()

+
const GPtrArray *   nm_active_connection_get_devices    (NMActiveConnection *connection);
+

+Gets the NMDevices used for the active connections. +

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

connection :

a NMActiveConnection +

Returns :

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

nm_active_connection_get_state ()

+
NMActiveConnectionState  nm_active_connection_get_state (NMActiveConnection *connection);
+

+Gets the active connection's state. +

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

connection :

a NMActiveConnection +

Returns :

the state +
+
+
+
+

nm_active_connection_get_default ()

+
gboolean            nm_active_connection_get_default    (NMActiveConnection *connection);
+

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

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

connection :

a NMActiveConnection +

Returns :

TRUE if the active connection is the default IPv4 connection +
+
+
+
+

nm_active_connection_get_default6 ()

+
gboolean            nm_active_connection_get_default6   (NMActiveConnection *connection);
+

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

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

connection :

a NMActiveConnection +

Returns :

TRUE if the active connection is the default IPv6 connection +
+
+
+
+

Property Details

+
+

The "connection" property

+
  "connection"               gchar*                : Read
+

+The connection's path of the active connection. +

+

Default value: NULL

+
+
+
+

The "default" property

+
  "default"                  gboolean              : Read
+

+Whether the active connection is the default IPv4 one. +

+

Default value: FALSE

+
+
+
+

The "default6" property

+
  "default6"                 gboolean              : Read
+

+Whether the active connection is the default IPv6 one. +

+

Default value: FALSE

+
+
+
+

The "devices" property

+
  "devices"                  nm-object-array*      : Read
+

Devices.

+
+
+
+

The "service-name" property

+
  "service-name"             gchar*                : Read
+

+The service name of the active connection. +

+

Default value: NULL

+
+
+
+

The "specific-object" property

+
  "specific-object"          gchar*                : Read
+

+The specific object's path of the active connection. +

+

Default value: NULL

+
+
+
+

The "state" property

+
  "state"                    guint                 : Read
+

+The state of the active connection. +

+

Allowed values: <= 2

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-client.html b/docs/libnm-glib/html/libnm-glib-nm-client.html new file mode 100644 index 00000000..b7af2851 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-client.html @@ -0,0 +1,724 @@ + + + + +NMClient + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMClient

+

NMClient

+
+
+

Synopsis

+
#define             NM_CLIENT_STATE
+#define             NM_CLIENT_MANAGER_RUNNING
+#define             NM_CLIENT_WIRELESS_ENABLED
+#define             NM_CLIENT_WIRELESS_HARDWARE_ENABLED
+#define             NM_CLIENT_WWAN_ENABLED
+#define             NM_CLIENT_WWAN_HARDWARE_ENABLED
+#define             NM_CLIENT_ACTIVE_CONNECTIONS
+                    NMClient;
+NMClient *          nm_client_new                       (void);
+const GPtrArray *   nm_client_get_devices               (NMClient *client);
+NMDevice *          nm_client_get_device_by_path        (NMClient *client,
+                                                         const char *object_path);
+void                (*NMClientActivateDeviceFn)         (gpointer user_data,
+                                                         const char *object_path,
+                                                         GError *error);
+void                nm_client_activate_connection       (NMClient *client,
+                                                         const char *service_name,
+                                                         const char *connection_path,
+                                                         NMDevice *device,
+                                                         const char *specific_object,
+                                                         NMClientActivateDeviceFn callback,
+                                                         gpointer user_data);
+void                nm_client_deactivate_connection     (NMClient *client,
+                                                         NMActiveConnection *active);
+gboolean            nm_client_wireless_get_enabled      (NMClient *client);
+void                nm_client_wireless_set_enabled      (NMClient *client,
+                                                         gboolean enabled);
+gboolean            nm_client_wireless_hardware_get_enabled
+                                                        (NMClient *client);
+gboolean            nm_client_wwan_get_enabled          (NMClient *client);
+void                nm_client_wwan_set_enabled          (NMClient *client,
+                                                         gboolean enabled);
+gboolean            nm_client_wwan_hardware_get_enabled (NMClient *client);
+NMState             nm_client_get_state                 (NMClient *client);
+gboolean            nm_client_get_manager_running       (NMClient *client);
+const GPtrArray *   nm_client_get_active_connections    (NMClient *client);
+void                nm_client_sleep                     (NMClient *client,
+                                                         gboolean sleep);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMClient
+
+
+
+

Properties

+
+  "active-connections"       nm-object-array*      : Read
+  "manager-running"          gboolean              : Read
+  "networking-enabled"       gboolean              : Read
+  "state"                    guint                 : Read
+  "wireless-enabled"         gboolean              : Read / Write
+  "wireless-hardware-enabled" gboolean              : Read
+  "wwan-enabled"             gboolean              : Read / Write / Construct
+  "wwan-hardware-enabled"    gboolean              : Read / Write / Construct Only
+
+
+
+

Signals

+
+  "device-added"                                   : Run First
+  "device-removed"                                 : Run First
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_CLIENT_STATE

+
#define NM_CLIENT_STATE "state"
+
+

+

+
+
+
+

NM_CLIENT_MANAGER_RUNNING

+
#define NM_CLIENT_MANAGER_RUNNING "manager-running"
+
+

+

+
+
+
+

NM_CLIENT_WIRELESS_ENABLED

+
#define NM_CLIENT_WIRELESS_ENABLED "wireless-enabled"
+
+

+

+
+
+
+

NM_CLIENT_WIRELESS_HARDWARE_ENABLED

+
#define NM_CLIENT_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
+
+

+

+
+
+
+

NM_CLIENT_WWAN_ENABLED

+
#define NM_CLIENT_WWAN_ENABLED "wwan-enabled"
+
+

+

+
+
+
+

NM_CLIENT_WWAN_HARDWARE_ENABLED

+
#define NM_CLIENT_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled"
+
+

+

+
+
+
+

NM_CLIENT_ACTIVE_CONNECTIONS

+
#define NM_CLIENT_ACTIVE_CONNECTIONS "active-connections"
+
+

+

+
+
+
+

NMClient

+
typedef struct _NMClient NMClient;
+

+

+
+
+
+

nm_client_new ()

+
NMClient *          nm_client_new                       (void);
+

+Creates a new NMClient. +

+
++ + + + +

Returns :

a new NMClient +
+
+
+
+

nm_client_get_devices ()

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

+Gets all the detected devices. +

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

client :

a NMClient +

Returns :

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

nm_client_get_device_by_path ()

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

+Gets a NMDevice from a NMClient. +

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

client :

a NMClient +

object_path :

the object path to search for +

Returns :

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

NMClientActivateDeviceFn ()

+
void                (*NMClientActivateDeviceFn)         (gpointer user_data,
+                                                         const char *object_path,
+                                                         GError *error);
+

+

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

user_data :

+

object_path :

+

error :

+
+
+
+
+

nm_client_activate_connection ()

+
void                nm_client_activate_connection       (NMClient *client,
+                                                         const char *service_name,
+                                                         const char *connection_path,
+                                                         NMDevice *device,
+                                                         const char *specific_object,
+                                                         NMClientActivateDeviceFn callback,
+                                                         gpointer user_data);
+

+Activates a connection with the given NMDevice. +

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

client :

a NMClient +

service_name :

the connection's service name +

connection_path :

the connection's DBus path +

device :

the NMDevice +

specific_object :

the device specific object (currently used only for +activating wireless devices and should be the NMAccessPoint's path. +

callback :

the function to call when the call is done +

user_data :

user data to pass to the callback function +
+
+
+
+

nm_client_deactivate_connection ()

+
void                nm_client_deactivate_connection     (NMClient *client,
+                                                         NMActiveConnection *active);
+

+Deactivates an active NMActiveConnection. +

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

client :

a NMClient +

active :

the NMActiveConnection to deactivate +
+
+
+
+

nm_client_wireless_get_enabled ()

+
gboolean            nm_client_wireless_get_enabled      (NMClient *client);
+

+Determines whether the wireless is enabled. +

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

client :

a NMClient +

Returns :

TRUE if wireless is enabled +
+
+
+
+

nm_client_wireless_set_enabled ()

+
void                nm_client_wireless_set_enabled      (NMClient *client,
+                                                         gboolean enabled);
+

+Enables or disables wireless devices. +

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

client :

a NMClient +

enabled :

+TRUE to enable wireless +
+
+
+
+

nm_client_wireless_hardware_get_enabled ()

+
gboolean            nm_client_wireless_hardware_get_enabled
+                                                        (NMClient *client);
+

+Determines whether the wireless hardware is enabled. +

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

client :

a NMClient +

Returns :

TRUE if the wireless hardware is enabled +
+
+
+
+

nm_client_wwan_get_enabled ()

+
gboolean            nm_client_wwan_get_enabled          (NMClient *client);
+

+Determines whether WWAN is enabled. +

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

client :

a NMClient +

Returns :

TRUE if WWAN is enabled +
+
+
+
+

nm_client_wwan_set_enabled ()

+
void                nm_client_wwan_set_enabled          (NMClient *client,
+                                                         gboolean enabled);
+

+Enables or disables WWAN devices. +

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

client :

a NMClient +

enabled :

+TRUE to enable WWAN +
+
+
+
+

nm_client_wwan_hardware_get_enabled ()

+
gboolean            nm_client_wwan_hardware_get_enabled (NMClient *client);
+

+Determines whether the WWAN hardware is enabled. +

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

client :

a NMClient +

Returns :

TRUE if the WWAN hardware is enabled +
+
+
+
+

nm_client_get_state ()

+
NMState             nm_client_get_state                 (NMClient *client);
+

+Gets the current daemon state. +

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

client :

a NMClient +

Returns :

the current NMState +
+
+
+
+

nm_client_get_manager_running ()

+
gboolean            nm_client_get_manager_running       (NMClient *client);
+

+Determines whether the daemon is running. +

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

client :

a NMClient +

Returns :

TRUE if the daemon is running +
+
+
+
+

nm_client_get_active_connections ()

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

+Gets the active connections. +

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

client :

a NMClient +

Returns :

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

nm_client_sleep ()

+
void                nm_client_sleep                     (NMClient *client,
+                                                         gboolean sleep);
+

+Deprecated; use nm_client_networking_set_enabled() instead. +

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

client :

a NMClient +

sleep :

+TRUE to put the daemon to sleep +
+
+
+
+

Property Details

+
+

The "active-connections" property

+
  "active-connections"       nm-object-array*      : Read
+

Active connections.

+
+
+
+

The "manager-running" property

+
  "manager-running"          gboolean              : Read
+

Whether NetworkManager is running.

+

Default value: FALSE

+
+
+
+

The "networking-enabled" property

+
  "networking-enabled"       gboolean              : Read
+

Is networking enabled.

+

Default value: TRUE

+
+
+
+

The "state" property

+
  "state"                    guint                 : Read
+

+The current daemon state. +

+

Allowed values: <= 4

+

Default value: 0

+
+
+
+

The "wireless-enabled" property

+
  "wireless-enabled"         gboolean              : Read / Write
+

Is wireless enabled.

+

Default value: TRUE

+
+
+
+

The "wireless-hardware-enabled" property

+
  "wireless-hardware-enabled" gboolean              : Read
+

Is wireless hardware enabled.

+

Default value: TRUE

+
+
+
+

The "wwan-enabled" property

+
  "wwan-enabled"             gboolean              : Read / Write / Construct
+

Is WWAN enabled.

+

Default value: TRUE

+
+
+
+

The "wwan-hardware-enabled" property

+
  "wwan-hardware-enabled"    gboolean              : Read / Write / Construct Only
+

Is WWAN hardware enabled.

+

Default value: TRUE

+
+
+
+

Signal Details

+
+

The "device-added" signal

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

+Notifies that a NMDevice is added. +

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

client :

the client that received the signal +

device :

the new device +

user_data :

user data set when the signal handler was connected.
+
+
+
+

The "device-removed" signal

+
void                user_function                      (NMClient *widget,
+                                                        GObject  *device,
+                                                        gpointer  user_data)      : Run First
+

+Notifies that a NMDevice is removed. +

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

widget :

the client that received the signal +

device :

the removed device +

user_data :

user data set when the signal handler was connected.
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-device-bt.html b/docs/libnm-glib/html/libnm-glib-nm-device-bt.html new file mode 100644 index 00000000..4372ca11 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-device-bt.html @@ -0,0 +1,196 @@ + + + + +NMDeviceBt + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMDeviceBt

+

NMDeviceBt

+
+
+

Synopsis

+
#define             NM_DEVICE_BT_HW_ADDRESS
+#define             NM_DEVICE_BT_NAME
+#define             NM_DEVICE_BT_CAPABILITIES
+                    NMDeviceBt;
+GObject *           nm_device_bt_new                    (DBusGConnection *connection,
+                                                         const char *path);
+const char *        nm_device_bt_get_hw_address         (NMDeviceBt *device);
+const char *        nm_device_bt_get_name               (NMDeviceBt *device);
+NMBluetoothCapabilities  nm_device_bt_get_capabilities  (NMDeviceBt *device);
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_DEVICE_BT_HW_ADDRESS

+
#define NM_DEVICE_BT_HW_ADDRESS   "hw-address"
+
+

+

+
+
+
+

NM_DEVICE_BT_NAME

+
#define NM_DEVICE_BT_NAME         "name"
+
+

+

+
+
+
+

NM_DEVICE_BT_CAPABILITIES

+
#define NM_DEVICE_BT_CAPABILITIES "bt-capabilities"
+
+

+

+
+
+
+

NMDeviceBt

+
typedef struct {
+	NMDevice parent;
+} NMDeviceBt;
+
+

+

+
+
+
+

nm_device_bt_new ()

+
GObject *           nm_device_bt_new                    (DBusGConnection *connection,
+                                                         const char *path);
+

+Creates a new NMDeviceBt. +

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

connection :

the DBusGConnection +

path :

the DBus object path of the device +

Returns :

a new device +
+
+
+
+

nm_device_bt_get_hw_address ()

+
const char *        nm_device_bt_get_hw_address         (NMDeviceBt *device);
+

+Gets the hardware (MAC) address of the NMDeviceBt +

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

device :

a NMDeviceBt +

Returns :

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

nm_device_bt_get_name ()

+
const char *        nm_device_bt_get_name               (NMDeviceBt *device);
+

+Gets the name of the NMDeviceBt. +

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

device :

a NMDeviceBt +

Returns :

the name of the device +
+
+
+
+

nm_device_bt_get_capabilities ()

+
NMBluetoothCapabilities  nm_device_bt_get_capabilities  (NMDeviceBt *device);
+

+Returns the Bluetooth device's usable capabilities. +

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

device :

a NMDeviceBt +

Returns :

a combination of NMBluetoothCapabilities +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-device-ethernet.html b/docs/libnm-glib/html/libnm-glib-nm-device-ethernet.html new file mode 100644 index 00000000..ad47fde5 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-device-ethernet.html @@ -0,0 +1,243 @@ + + + + +NMDeviceEthernet + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMDeviceEthernet

+

NMDeviceEthernet

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMDevice
+               +----NMDeviceEthernet
+
+
+
+

Properties

+
+  "carrier"                  gboolean              : Read
+  "hw-address"               gchar*                : Read
+  "speed"                    guint                 : Read
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_DEVICE_ETHERNET_HW_ADDRESS

+
#define NM_DEVICE_ETHERNET_HW_ADDRESS  "hw-address"
+
+

+

+
+
+
+

NM_DEVICE_ETHERNET_SPEED

+
#define NM_DEVICE_ETHERNET_SPEED       "speed"
+
+

+

+
+
+
+

NM_DEVICE_ETHERNET_CARRIER

+
#define NM_DEVICE_ETHERNET_CARRIER     "carrier"
+
+

+

+
+
+
+

NMDeviceEthernet

+
typedef struct _NMDeviceEthernet NMDeviceEthernet;
+

+

+
+
+
+

nm_device_ethernet_new ()

+
GObject *           nm_device_ethernet_new              (DBusGConnection *connection,
+                                                         const char *path);
+

+Creates a new NMDeviceEthernet. +

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

connection :

the DBusGConnection +

path :

the DBus object path of the device +

Returns :

a new device +
+
+
+
+

nm_device_ethernet_get_hw_address ()

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

+Gets the hardware (MAC) address of the NMDeviceEthernet +

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

device :

a NMDeviceEthernet +

Returns :

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

nm_device_ethernet_get_speed ()

+
guint32             nm_device_ethernet_get_speed        (NMDeviceEthernet *device);
+

+Gets the speed of the NMDeviceEthernet. +

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

device :

a NMDeviceEthernet +

Returns :

the speed of the device +
+
+
+
+

nm_device_ethernet_get_carrier ()

+
gboolean            nm_device_ethernet_get_carrier      (NMDeviceEthernet *device);
+

+Whether the device has carrier. +

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

device :

a NMDeviceEthernet +

Returns :

TRUE if the device has carrier +
+
+
+
+

Property Details

+
+

The "carrier" property

+
  "carrier"                  gboolean              : Read
+

+Whether the device has carrier. +

+

Default value: FALSE

+
+
+
+

The "hw-address" property

+
  "hw-address"               gchar*                : Read
+

+The hardware (MAC) address of the device. +

+

Default value: NULL

+
+
+
+

The "speed" property

+
  "speed"                    guint                 : Read
+

+The speed of the device. +

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-device-wifi.html b/docs/libnm-glib/html/libnm-glib-nm-device-wifi.html new file mode 100644 index 00000000..acc5f6e0 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-device-wifi.html @@ -0,0 +1,458 @@ + + + + +NMDeviceWifi + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMDeviceWifi

+

NMDeviceWifi

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMDevice
+               +----NMDeviceWifi
+
+
+
+

Properties

+
+  "active-access-point"      NMAccessPoint*        : Read
+  "bitrate"                  guint                 : Read
+  "hw-address"               gchar*                : Read
+  "mode"                     guint                 : Read
+  "wireless-capabilities"    guint                 : Read
+
+
+
+

Signals

+
+  "access-point-added"                             : Run First
+  "access-point-removed"                           : Run First
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_DEVICE_WIFI_HW_ADDRESS

+
#define NM_DEVICE_WIFI_HW_ADDRESS          "hw-address"
+
+

+

+
+
+
+

NM_DEVICE_WIFI_MODE

+
#define NM_DEVICE_WIFI_MODE                "mode"
+
+

+

+
+
+
+

NM_DEVICE_WIFI_BITRATE

+
#define NM_DEVICE_WIFI_BITRATE             "bitrate"
+
+

+

+
+
+
+

NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT

+
#define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point"
+
+

+

+
+
+
+

NM_DEVICE_WIFI_CAPABILITIES

+
#define NM_DEVICE_WIFI_CAPABILITIES        "wireless-capabilities"
+
+

+

+
+
+
+

NMDeviceWifi

+
typedef struct _NMDeviceWifi NMDeviceWifi;
+

+

+
+
+
+

nm_device_wifi_new ()

+
GObject *           nm_device_wifi_new                  (DBusGConnection *connection,
+                                                         const char *path);
+

+Creates a new NMDeviceWifi. +

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

connection :

the DBusGConnection +

path :

the DBus object path of the device +

Returns :

a new device +
+
+
+
+

nm_device_wifi_get_hw_address ()

+
const char *        nm_device_wifi_get_hw_address       (NMDeviceWifi *device);
+

+Gets the hardware (MAC) address of the NMDeviceWifi +

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

device :

a NMDeviceWifi +

Returns :

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

nm_device_wifi_get_mode ()

+
NM80211Mode         nm_device_wifi_get_mode             (NMDeviceWifi *device);
+

+Gets the NMDeviceWifi mode. +

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

device :

a NMDeviceWifi +

Returns :

the mode +
+
+
+
+

nm_device_wifi_get_bitrate ()

+
guint32             nm_device_wifi_get_bitrate          (NMDeviceWifi *device);
+

+Gets the bit rate of the NMDeviceWifi. +

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

device :

a NMDeviceWifi +

Returns :

the bit rate +
+
+
+
+

nm_device_wifi_get_capabilities ()

+
guint32             nm_device_wifi_get_capabilities     (NMDeviceWifi *device);
+

+Gets the WIFI capabilities of the NMDeviceWifi. +

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

device :

a NMDeviceWifi +

Returns :

the capabilities +
+
+
+
+

nm_device_wifi_get_active_access_point ()

+
NMAccessPoint *     nm_device_wifi_get_active_access_point
+                                                        (NMDeviceWifi *device);
+

+Gets the active NMAccessPoint. +

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

device :

a NMDeviceWifi +

Returns :

the access point or NULL if none is active +
+
+
+
+

nm_device_wifi_get_access_point_by_path ()

+
NMAccessPoint *     nm_device_wifi_get_access_point_by_path
+                                                        (NMDeviceWifi *device,
+                                                         const char *path);
+

+Gets a NMAccessPoint by path. +

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

device :

a NMDeviceWifi +

path :

the object path of the access point +

Returns :

the access point or NULL if none is found. +
+
+
+
+

nm_device_wifi_get_access_points ()

+
const GPtrArray *   nm_device_wifi_get_access_points    (NMDeviceWifi *device);
+

+Gets all the scanned access points of the NMDeviceWifi. +

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

device :

a NMDeviceWifi +

Returns :

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

Property Details

+
+

The "active-access-point" property

+
  "active-access-point"      NMAccessPoint*        : Read
+

+The active NMAccessPoint of the device. +

+
+
+
+

The "bitrate" property

+
  "bitrate"                  guint                 : Read
+

+The bit rate of the device. +

+

Default value: 0

+
+
+
+

The "hw-address" property

+
  "hw-address"               gchar*                : Read
+

+The hardware (MAC) address of the device. +

+

Default value: NULL

+
+
+
+

The "mode" property

+
  "mode"                     guint                 : Read
+

+The mode of the device. +

+

Allowed values: <= 2

+

Default value: 2

+
+
+
+

The "wireless-capabilities" property

+
  "wireless-capabilities"    guint                 : Read
+

+The wireless capabilities of the device. +

+

Default value: 0

+
+
+
+

Signal Details

+
+

The "access-point-added" signal

+
void                user_function                      (NMDeviceWifi *device,
+                                                        GObject      *ap,
+                                                        gpointer      user_data)      : Run First
+

+Notifies that a NMAccessPoint is added to the wifi device. +

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

device :

the wifi device that received the signal +

ap :

the new access point +

user_data :

user data set when the signal handler was connected.
+
+
+
+

The "access-point-removed" signal

+
void                user_function                      (NMDeviceWifi *device,
+                                                        GObject      *ap,
+                                                        gpointer      user_data)      : Run First
+

+Notifies that a NMAccessPoint is removed from the wifi device. +

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

device :

the wifi device that received the signal +

ap :

the removed access point +

user_data :

user data set when the signal handler was connected.
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-device.html b/docs/libnm-glib/html/libnm-glib-nm-device.html new file mode 100644 index 00000000..d37903e1 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-device.html @@ -0,0 +1,743 @@ + + + + +NMDevice + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMDevice

+

NMDevice

+
+
+

Synopsis

+
#define             NM_DEVICE_UDI
+#define             NM_DEVICE_INTERFACE
+#define             NM_DEVICE_DRIVER
+#define             NM_DEVICE_CAPABILITIES
+#define             NM_DEVICE_MANAGED
+#define             NM_DEVICE_IP4_CONFIG
+#define             NM_DEVICE_DHCP4_CONFIG
+#define             NM_DEVICE_IP6_CONFIG
+#define             NM_DEVICE_DHCP6_CONFIG
+#define             NM_DEVICE_STATE
+#define             NM_DEVICE_VENDOR
+#define             NM_DEVICE_PRODUCT
+                    NMDevice;
+GObject *           nm_device_new                       (DBusGConnection *connection,
+                                                         const char *path);
+const char *        nm_device_get_iface                 (NMDevice *device);
+const char *        nm_device_get_udi                   (NMDevice *device);
+const char *        nm_device_get_driver                (NMDevice *device);
+guint32             nm_device_get_capabilities          (NMDevice *device);
+gboolean            nm_device_get_managed               (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);
+NMDeviceState       nm_device_get_state                 (NMDevice *device);
+const char *        nm_device_get_product               (NMDevice *device);
+const char *        nm_device_get_vendor                (NMDevice *device);
+void                (*NMDeviceDeactivateFn)             (NMDevice *device,
+                                                         GError *error,
+                                                         gpointer user_data);
+void                nm_device_disconnect                (NMDevice *device,
+                                                         NMDeviceDeactivateFn callback,
+                                                         gpointer user_data);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMDevice
+               +----NMDeviceEthernet
+               +----NMDeviceWifi
+               +----NMSerialDevice
+
+
+
+

Properties

+
+  "capabilities"             guint                 : Read
+  "dhcp4-config"             NMDHCP4Config*        : Read
+  "dhcp6-config"             NMDHCP6Config*        : Read
+  "driver"                   gchar*                : Read
+  "interface"                gchar*                : Read
+  "ip4-config"               NMIP4Config*          : Read
+  "ip6-config"               NMIP6Config*          : Read
+  "managed"                  gboolean              : Read
+  "product"                  gchar*                : Read
+  "state"                    guint                 : Read
+  "udi"                      gchar*                : Read
+  "vendor"                   gchar*                : Read
+
+
+
+

Signals

+
+  "state-changed"                                  : Run First
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_DEVICE_UDI

+
#define NM_DEVICE_UDI "udi"
+
+

+

+
+
+
+

NM_DEVICE_INTERFACE

+
#define NM_DEVICE_INTERFACE "interface"
+
+

+

+
+
+
+

NM_DEVICE_DRIVER

+
#define NM_DEVICE_DRIVER "driver"
+
+

+

+
+
+
+

NM_DEVICE_CAPABILITIES

+
#define NM_DEVICE_CAPABILITIES "capabilities"
+
+

+

+
+
+
+

NM_DEVICE_MANAGED

+
#define NM_DEVICE_MANAGED "managed"
+
+

+

+
+
+
+

NM_DEVICE_IP4_CONFIG

+
#define NM_DEVICE_IP4_CONFIG "ip4-config"
+
+

+

+
+
+
+

NM_DEVICE_DHCP4_CONFIG

+
#define NM_DEVICE_DHCP4_CONFIG "dhcp4-config"
+
+

+

+
+
+
+

NM_DEVICE_IP6_CONFIG

+
#define NM_DEVICE_IP6_CONFIG "ip6-config"
+
+

+

+
+
+
+

NM_DEVICE_DHCP6_CONFIG

+
#define NM_DEVICE_DHCP6_CONFIG "dhcp6-config"
+
+

+

+
+
+
+

NM_DEVICE_STATE

+
#define NM_DEVICE_STATE "state"
+
+

+

+
+
+
+

NM_DEVICE_VENDOR

+
#define NM_DEVICE_VENDOR "vendor"
+
+

+

+
+
+
+

NM_DEVICE_PRODUCT

+
#define NM_DEVICE_PRODUCT "product"
+
+

+

+
+
+
+

NMDevice

+
typedef struct _NMDevice NMDevice;
+

+

+
+
+
+

nm_device_new ()

+
GObject *           nm_device_new                       (DBusGConnection *connection,
+                                                         const char *path);
+

+Creates a new NMDevice. +

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

connection :

the DBusGConnection +

path :

the DBus object path of the device +

Returns :

a new device +
+
+
+
+

nm_device_get_iface ()

+
const char *        nm_device_get_iface                 (NMDevice *device);
+

+Gets the interface name of the NMDevice. +

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

device :

a NMDevice +

Returns :

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

nm_device_get_udi ()

+
const char *        nm_device_get_udi                   (NMDevice *device);
+

+Gets the Unique Device Identifier of the NMDevice. +

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

device :

a NMDevice +

Returns :

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

nm_device_get_driver ()

+
const char *        nm_device_get_driver                (NMDevice *device);
+

+Gets the driver of the NMDevice. +

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

device :

a NMDevice +

Returns :

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

nm_device_get_capabilities ()

+
guint32             nm_device_get_capabilities          (NMDevice *device);
+

+Gets the device' capabilities. +

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

device :

a NMDevice +

Returns :

the capabilities +
+
+
+
+

nm_device_get_managed ()

+
gboolean            nm_device_get_managed               (NMDevice *device);
+

+Whether the NMDevice is managed by NetworkManager. +

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

device :

a NMDevice +

Returns :

TRUE if the device is managed by NetworkManager +
+
+
+
+

nm_device_get_ip4_config ()

+
NMIP4Config *       nm_device_get_ip4_config            (NMDevice *device);
+

+Gets the current NMIP4Config associated with the NMDevice. +

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

device :

a NMDevice +

Returns :

the NMIP4Config or NULL if the device is not activated. +
+
+
+
+

nm_device_get_dhcp4_config ()

+
NMDHCP4Config *     nm_device_get_dhcp4_config          (NMDevice *device);
+

+Gets the current NMDHCP4Config associated with the NMDevice. +

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

device :

a NMDevice +

Returns :

the NMDHCPConfig or NULL if the device is not activated or not +using DHCP. +
+
+
+
+

nm_device_get_ip6_config ()

+
NMIP6Config *       nm_device_get_ip6_config            (NMDevice *device);
+

+Gets the current NMIP6Config associated with the NMDevice. +

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

device :

a NMDevice +

Returns :

the NMIP6Config or NULL if the device is not activated. +
+
+
+
+

nm_device_get_dhcp6_config ()

+
NMDHCP6Config *     nm_device_get_dhcp6_config          (NMDevice *device);
+

+Gets the current NMDHCP6Config associated with the NMDevice. +

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

device :

a NMDevice +

Returns :

the NMDHCPConfig or NULL if the device is not activated or not +using DHCP. +
+
+
+
+

nm_device_get_state ()

+
NMDeviceState       nm_device_get_state                 (NMDevice *device);
+

+Gets the current NMDevice state. +

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

device :

a NMDevice +

Returns :

the current device state +
+
+
+
+

nm_device_get_product ()

+
const char *        nm_device_get_product               (NMDevice *device);
+

+Gets the product string of the NMDevice. +

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

device :

a NMDevice +

Returns :

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

nm_device_get_vendor ()

+
const char *        nm_device_get_vendor                (NMDevice *device);
+

+Gets the vendor string of the NMDevice. +

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

device :

a NMDevice +

Returns :

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

NMDeviceDeactivateFn ()

+
void                (*NMDeviceDeactivateFn)             (NMDevice *device,
+                                                         GError *error,
+                                                         gpointer user_data);
+

+

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

device :

+

error :

+

user_data :

+
+
+
+
+

nm_device_disconnect ()

+
void                nm_device_disconnect                (NMDevice *device,
+                                                         NMDeviceDeactivateFn callback,
+                                                         gpointer user_data);
+

+Disconnects the device if currently connected, and prevents the device from +automatically connecting to networks until the next manual network connection +request. +

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

device :

a NMDevice +

callback :

callback to be called when disconnect operation completes +

user_data :

caller-specific data passed to callback +
+
+
+
+

Property Details

+
+

The "capabilities" property

+
  "capabilities"             guint                 : Read
+

+The capabilities of the device. +

+

Default value: 0

+
+
+
+

The "dhcp4-config" property

+
  "dhcp4-config"             NMDHCP4Config*        : Read
+

+The NMDHCP4Config of the device. +

+
+
+
+

The "dhcp6-config" property

+
  "dhcp6-config"             NMDHCP6Config*        : Read
+

+The NMDHCP6Config of the device. +

+
+
+
+

The "driver" property

+
  "driver"                   gchar*                : Read
+

+The driver of the device. +

+

Default value: NULL

+
+
+
+

The "interface" property

+
  "interface"                gchar*                : Read
+

+The interface of the device. +

+

Default value: NULL

+
+
+
+

The "ip4-config" property

+
  "ip4-config"               NMIP4Config*          : Read
+

+The NMIP4Config of the device. +

+
+
+
+

The "ip6-config" property

+
  "ip6-config"               NMIP6Config*          : Read
+

+The NMIP6Config of the device. +

+
+
+
+

The "managed" property

+
  "managed"                  gboolean              : Read
+

+Whether the device is managed by NetworkManager. +

+

Default value: FALSE

+
+
+
+

The "product" property

+
  "product"                  gchar*                : Read
+

+The product string of the device. +

+

Default value: NULL

+
+
+
+

The "state" property

+
  "state"                    guint                 : Read
+

+The state of the device. +

+

Default value: 0

+
+
+
+

The "udi" property

+
  "udi"                      gchar*                : Read
+

+The Unique Device Identifier of the device. +

+

Default value: NULL

+
+
+
+

The "vendor" property

+
  "vendor"                   gchar*                : Read
+

+The vendor string of the device. +

+

Default value: NULL

+
+
+
+

Signal Details

+
+

The "state-changed" signal

+
void                user_function                      (NMDevice *device,
+                                                        guint     state,
+                                                        guint     arg2,
+                                                        guint     arg3,
+                                                        gpointer  user_data)      : Run First
+

+Notifies the state change of a NMDevice. +

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

device :

the client that received the signal +

state :

the new state of the device +

user_data :

user data set when the signal handler was connected.
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-object.html b/docs/libnm-glib/html/libnm-glib-nm-object.html new file mode 100644 index 00000000..1a511d0b --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-object.html @@ -0,0 +1,170 @@ + + + + +NMObject + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMObject

+

NMObject

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMObject
+         +----NMClient
+         +----NMDevice
+         +----NMAccessPoint
+         +----NMIP4Config
+         +----NMActiveConnection
+         +----NMDHCP4Config
+         +----NMIP6Config
+         +----NMDHCP6Config
+
+
+
+

Properties

+
+  "dbus-connection"          DBusGConnection*      : Read / Write / Construct Only
+  "dbus-path"                gchar*                : Read / Write / Construct Only
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_OBJECT_DBUS_CONNECTION

+
#define NM_OBJECT_DBUS_CONNECTION "dbus-connection"
+
+

+

+
+
+
+

NM_OBJECT_DBUS_PATH

+
#define NM_OBJECT_DBUS_PATH "dbus-path"
+
+

+

+
+
+
+

NMObject

+
typedef struct _NMObject NMObject;
+

+

+
+
+
+

nm_object_get_connection ()

+
DBusGConnection *   nm_object_get_connection            (NMObject *object);
+

+Gets the NMObject's DBusGConnection. +

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

object :

a NMObject +

Returns :

the connection +
+
+
+
+

nm_object_get_path ()

+
const char *        nm_object_get_path                  (NMObject *object);
+

+Gets the DBus path of the NMObject. +

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

object :

a NMObject +

Returns :

the object's path. This is the internal string used by the +device, and must not be modified. +
+
+
+
+

Property Details

+
+

The "dbus-connection" property

+
  "dbus-connection"          DBusGConnection*      : Read / Write / Construct Only
+

Connection.

+
+
+
+

The "dbus-path" property

+
  "dbus-path"                gchar*                : Read / Write / Construct Only
+

DBus Object Path.

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-remote-settings.html b/docs/libnm-glib/html/libnm-glib-nm-remote-settings.html new file mode 100644 index 00000000..7f2c41cb --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-remote-settings.html @@ -0,0 +1,123 @@ + + + + +NMRemoteSettings + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMRemoteSettings

+

NMRemoteSettings

+
+ +
+

Description

+

+

+
+
+

Details

+
+

NM_REMOTE_SETTINGS_BUS

+
#define NM_REMOTE_SETTINGS_BUS "bus"
+
+

+

+
+
+
+

NM_REMOTE_SETTINGS_SCOPE

+
#define NM_REMOTE_SETTINGS_SCOPE "scope"
+
+

+

+
+
+
+

NM_REMOTE_SETTINGS_SERVICE_RUNNING

+
#define NM_REMOTE_SETTINGS_SERVICE_RUNNING "service-running"
+
+

+

+
+
+
+

NMRemoteSettings

+
typedef struct {
+	GObject parent;
+} NMRemoteSettings;
+
+

+

+
+
+
+

nm_remote_settings_new ()

+
NMRemoteSettings *  nm_remote_settings_new              (DBusGConnection *bus,
+                                                         NMConnectionScope scope);
+

+Creates a new object representing the remote settings service. +

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

bus :

a valid and connected D-Bus connection +

scope :

the settings service scope (either user or system) +

Returns :

the new remote settings object on success, or NULL on failure +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-settings-connection-interface.html b/docs/libnm-glib/html/libnm-glib-nm-settings-connection-interface.html new file mode 100644 index 00000000..3fada84f --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-settings-connection-interface.html @@ -0,0 +1,403 @@ + + + + +nm-settings-connection-interface + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

nm-settings-connection-interface

+

nm-settings-connection-interface

+
+ +
+

Description

+

+

+
+
+

Details

+
+

NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE()

+
#define NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_CONNECTION_INTERFACE, NMSettingsConnectionInterface))
+
+

+

+
++ + + + +

obj :

+
+
+
+
+

NM_SETTINGS_CONNECTION_INTERFACE_UPDATED

+
#define NM_SETTINGS_CONNECTION_INTERFACE_UPDATED               "updated"
+
+

+

+
+
+
+

NM_SETTINGS_CONNECTION_INTERFACE_REMOVED

+
#define NM_SETTINGS_CONNECTION_INTERFACE_REMOVED               "removed"
+
+

+

+
+
+
+

NMSettingsConnectionInterface

+
typedef struct {
+	GTypeInterface g_iface;
+
+	/* Methods */
+	gboolean (*update) (NMSettingsConnectionInterface *connection,
+	                    NMSettingsConnectionInterfaceUpdateFunc callback,
+	                    gpointer user_data);
+
+	gboolean (*delete) (NMSettingsConnectionInterface *connection,
+	                    NMSettingsConnectionInterfaceDeleteFunc callback,
+	                    gpointer user_data);
+
+	gboolean (*get_secrets) (NMSettingsConnectionInterface *connection,
+	                         const char *setting_name,
+                             const char **hints,
+                             gboolean request_new,
+                             NMSettingsConnectionInterfaceGetSecretsFunc callback,
+                             gpointer user_data);
+
+	void (*emit_updated) (NMSettingsConnectionInterface *connection);
+
+	/* Signals */
+	/* 'new_settings' hash should *not* contain secrets */
+	void (*updated) (NMSettingsConnectionInterface *connection,
+	                 GHashTable *new_settings);
+
+	void (*removed) (NMSettingsConnectionInterface *connection);
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+	void (*_reserved5) (void);
+	void (*_reserved6) (void);
+} NMSettingsConnectionInterface;
+
+

+

+
+
+
+

NMSettingsConnectionInterfaceUpdateFunc ()

+
void                (*NMSettingsConnectionInterfaceUpdateFunc)
+                                                        (NMSettingsConnectionInterface *connection,
+                                                         GError *error,
+                                                         gpointer user_data);
+

+

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

connection :

+

error :

+

user_data :

+
+
+
+
+

NMSettingsConnectionInterfaceDeleteFunc ()

+
void                (*NMSettingsConnectionInterfaceDeleteFunc)
+                                                        (NMSettingsConnectionInterface *connection,
+                                                         GError *error,
+                                                         gpointer user_data);
+

+

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

connection :

+

error :

+

user_data :

+
+
+
+
+

NMSettingsConnectionInterfaceGetSecretsFunc ()

+
void                (*NMSettingsConnectionInterfaceGetSecretsFunc)
+                                                        (NMSettingsConnectionInterface *connection,
+                                                         GHashTable *secrets,
+                                                         GError *error,
+                                                         gpointer user_data);
+

+

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

connection :

+

secrets :

+

error :

+

user_data :

+
+
+
+
+

nm_settings_connection_interface_update ()

+
gboolean            nm_settings_connection_interface_update
+                                                        (NMSettingsConnectionInterface *connection,
+                                                         NMSettingsConnectionInterfaceUpdateFunc callback,
+                                                         gpointer user_data);
+

+Update the connection with current settings and properties. +

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

connection :

an object implementing NMSettingsConnectionInterface +

callback :

a function to be called when the update completes +

user_data :

caller-specific data to be passed to callback +

Returns :

TRUE on success, FALSE on failure +
+
+
+
+

nm_settings_connection_interface_delete ()

+
gboolean            nm_settings_connection_interface_delete
+                                                        (NMSettingsConnectionInterface *connection,
+                                                         NMSettingsConnectionInterfaceDeleteFunc callback,
+                                                         gpointer user_data);
+

+Delete the connection. +

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

connection :

a objecting implementing NMSettingsConnectionInterface +

callback :

a function to be called when the delete completes +

user_data :

caller-specific data to be passed to callback +

Returns :

TRUE on success, FALSE on failure +
+
+
+
+

nm_settings_connection_interface_get_secrets ()

+
gboolean            nm_settings_connection_interface_get_secrets
+                                                        (NMSettingsConnectionInterface *connection,
+                                                         const char *setting_name,
+                                                         const char **hints,
+                                                         gboolean request_new,
+                                                         NMSettingsConnectionInterfaceGetSecretsFunc callback,
+                                                         gpointer user_data);
+

+Request the connection's secrets. +

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

connection :

a object implementing NMSettingsConnectionInterface +

setting_name :

the NMSetting object name to get secrets for +

hints :

+NMSetting key names to get secrets for (optional) +

request_new :

hint that new secrets (instead of cached or stored secrets) + should be returned +

callback :

a function to be called when the update completes +

user_data :

caller-specific data to be passed to callback +

Returns :

TRUE on success, FALSE on failure +
+
+
+
+

nm_settings_connection_interface_emit_updated ()

+
void                nm_settings_connection_interface_emit_updated
+                                                        (NMSettingsConnectionInterface *connection);
+

+

+
++ + + + +

connection :

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-settings-interface.html b/docs/libnm-glib/html/libnm-glib-nm-settings-interface.html new file mode 100644 index 00000000..8fedb758 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-settings-interface.html @@ -0,0 +1,331 @@ + + + + +nm-settings-interface + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

nm-settings-interface

+

nm-settings-interface

+
+ +
+

Description

+

+

+
+
+

Details

+
+

enum NMSettingsInterfaceError

+
typedef enum {
+	NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION = 0,
+	NM_SETTINGS_INTERFACE_ERROR_READ_ONLY_CONNECTION,
+	NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR,
+	NM_SETTINGS_INTERFACE_ERROR_SECRETS_UNAVAILABLE,
+	NM_SETTINGS_INTERFACE_ERROR_SECRETS_REQUEST_CANCELED,
+	NM_SETTINGS_INTERFACE_ERROR_PERMISSION_DENIED,
+	NM_SETTINGS_INTERFACE_ERROR_INVALID_SETTING,
+} NMSettingsInterfaceError;
+
+

+

+
+
+
+

NM_SETTINGS_INTERFACE_ERROR

+
#define NM_SETTINGS_INTERFACE_ERROR (nm_settings_interface_error_quark ())
+
+

+

+
+
+
+

nm_settings_interface_error_quark ()

+
GQuark              nm_settings_interface_error_quark   (void);
+

+Setting error quark. +

+
++ + + + +

Returns :

the setting error quark +
+
+
+
+

NM_TYPE_SETTINGS_INTERFACE_ERROR

+
#define NM_TYPE_SETTINGS_INTERFACE_ERROR (nm_settings_interface_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTINGS_INTERFACE_GET_INTERFACE()

+
#define NM_SETTINGS_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_INTERFACE, NMSettingsInterface))
+
+

+

+
++ + + + +

obj :

+
+
+
+
+

NM_SETTINGS_INTERFACE_NEW_CONNECTION

+
#define NM_SETTINGS_INTERFACE_NEW_CONNECTION   "new-connection"
+
+

+

+
+
+
+

NM_SETTINGS_INTERFACE_CONNECTIONS_READ

+
#define NM_SETTINGS_INTERFACE_CONNECTIONS_READ "connections-read"
+
+

+

+
+
+
+

NMSettingsInterface

+
typedef struct {
+	GTypeInterface g_iface;
+
+	/* Methods */
+	/* Returns a list of objects implementing NMSettingsConnectionInterface */
+	GSList * (*list_connections) (NMSettingsInterface *settings);
+
+	NMSettingsConnectionInterface * (*get_connection_by_path) (NMSettingsInterface *settings,
+	                                                           const char *path);
+
+	gboolean (*add_connection) (NMSettingsInterface *settings,
+	                            NMConnection *connection,
+	                            NMSettingsAddConnectionFunc callback,
+	                            gpointer user_data);
+
+	/* Signals */
+	void (*new_connection) (NMSettingsInterface *settings,
+	                        NMSettingsConnectionInterface *connection);
+
+	void (*connections_read) (NMSettingsInterface *settings);
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+	void (*_reserved5) (void);
+	void (*_reserved6) (void);
+} NMSettingsInterface;
+
+

+

+
+
+
+

NMSettingsAddConnectionFunc ()

+
void                (*NMSettingsAddConnectionFunc)      (NMSettingsInterface *settings,
+                                                         GError *error,
+                                                         gpointer user_data);
+

+

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

settings :

+

error :

+

user_data :

+
+
+
+
+

nm_settings_interface_get_type ()

+
GType               nm_settings_interface_get_type      (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_settings_interface_list_connections ()

+
GSList *            nm_settings_interface_list_connections
+                                                        (NMSettingsInterface *settings);
+

+

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

settings :

+

Returns :

+
+
+
+
+

nm_settings_interface_get_connection_by_path ()

+
NMSettingsConnectionInterface * nm_settings_interface_get_connection_by_path
+                                                        (NMSettingsInterface *settings,
+                                                         const char *path);
+

+

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

settings :

+

path :

+

Returns :

+
+
+
+
+

nm_settings_interface_add_connection ()

+
gboolean            nm_settings_interface_add_connection
+                                                        (NMSettingsInterface *settings,
+                                                         NMConnection *connection,
+                                                         NMSettingsAddConnectionFunc callback,
+                                                         gpointer user_data);
+

+Requests that the settings service add the given settings to a new connection. +

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

settings :

a object implementing NMSettingsInterface +

connection :

the settings to add; note that this object's settings will be + added, not the object itself +

callback :

callback to be called when the add operation completes +

user_data :

caller-specific data passed to callback +

Returns :

TRUE if the request was successful, FALSE if it failed +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-settings-service.html b/docs/libnm-glib/html/libnm-glib-nm-settings-service.html new file mode 100644 index 00000000..86df33fc --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-settings-service.html @@ -0,0 +1,158 @@ + + + + +NMSettingsService + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingsService

+

NMSettingsService

+
+ +
+

Description

+

+

+
+
+

Details

+
+

NM_SETTINGS_SERVICE_BUS

+
#define NM_SETTINGS_SERVICE_BUS "bus"
+
+

+

+
+
+
+

NM_SETTINGS_SERVICE_SCOPE

+
#define NM_SETTINGS_SERVICE_SCOPE "scope"
+
+

+

+
+
+
+

NMSettingsService

+
typedef struct {
+	GObject parent;
+} NMSettingsService;
+
+

+

+
+
+
+

nm_settings_service_get_connection_by_path ()

+
NMExportedConnection * nm_settings_service_get_connection_by_path
+                                                        (NMSettingsService *self,
+                                                         const char *path);
+

+

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

self :

+

path :

+

Returns :

+
+
+
+
+

nm_settings_service_export ()

+
void                nm_settings_service_export          (NMSettingsService *self);
+

+

+
++ + + + +

self :

+
+
+
+
+

nm_settings_service_export_connection ()

+
void                nm_settings_service_export_connection
+                                                        (NMSettingsService *self,
+                                                         NMSettingsConnectionInterface *exported);
+

+

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

self :

+

exported :

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-settings-system-interface.html b/docs/libnm-glib/html/libnm-glib-nm-settings-system-interface.html new file mode 100644 index 00000000..e8c500de --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-settings-system-interface.html @@ -0,0 +1,322 @@ + + + + +nm-settings-system-interface + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

nm-settings-system-interface

+

nm-settings-system-interface

+
+ +
+

Description

+

+

+
+
+

Details

+
+

enum NMSettingsSystemPermissions

+
typedef enum {
+	NM_SETTINGS_SYSTEM_PERMISSION_NONE = 0x0,
+	NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY = 0x1,
+	NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_PROTECTED = 0x2,
+	NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_OPEN = 0x4,
+	NM_SETTINGS_SYSTEM_PERMISSION_HOSTNAME_MODIFY = 0x8
+} NMSettingsSystemPermissions;
+
+

+

+
+
+
+

NM_SETTINGS_SYSTEM_INTERFACE_GET_INTERFACE()

+
#define NM_SETTINGS_SYSTEM_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_SYSTEM_INTERFACE, NMSettingsSystemInterface))
+
+

+

+
++ + + + +

obj :

+
+
+
+
+

NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME

+
#define NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME          "hostname"
+
+

+

+
+
+
+

NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY

+
#define NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY        "can-modify"
+
+

+

+
+
+
+

NM_SETTINGS_SYSTEM_INTERFACE_CHECK_PERMISSIONS

+
#define NM_SETTINGS_SYSTEM_INTERFACE_CHECK_PERMISSIONS "check-permissions"
+
+

+

+
+
+
+

enum NMSettingsSystemInterfaceProp

+
typedef enum {
+	NM_SETTINGS_SYSTEM_INTERFACE_PROP_FIRST = 0x1000,
+
+	NM_SETTINGS_SYSTEM_INTERFACE_PROP_HOSTNAME = NM_SETTINGS_SYSTEM_INTERFACE_PROP_FIRST,
+	NM_SETTINGS_SYSTEM_INTERFACE_PROP_CAN_MODIFY
+} NMSettingsSystemInterfaceProp;
+
+

+

+
+
+
+

NMSettingsSystemInterface

+
typedef struct {
+	GTypeInterface g_iface;
+
+	/* Methods */
+	gboolean (*save_hostname) (NMSettingsSystemInterface *settings,
+	                           const char *hostname,
+	                           NMSettingsSystemSaveHostnameFunc callback,
+	                           gpointer user_data);
+
+	gboolean (*get_permissions) (NMSettingsSystemInterface *settings,
+	                             NMSettingsSystemGetPermissionsFunc callback,
+	                             gpointer user_data);
+
+	/* Signals */
+	void (*check_permissions) (NMSettingsSystemInterface *settings);
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+	void (*_reserved5) (void);
+	void (*_reserved6) (void);
+} NMSettingsSystemInterface;
+
+

+

+
+
+
+

NMSettingsSystemSaveHostnameFunc ()

+
void                (*NMSettingsSystemSaveHostnameFunc) (NMSettingsSystemInterface *settings,
+                                                         GError *error,
+                                                         gpointer user_data);
+

+

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

settings :

+

error :

+

user_data :

+
+
+
+
+

NMSettingsSystemGetPermissionsFunc ()

+
void                (*NMSettingsSystemGetPermissionsFunc)
+                                                        (NMSettingsSystemInterface *settings,
+                                                         NMSettingsSystemPermissions permissions,
+                                                         GError *error,
+                                                         gpointer user_data);
+

+

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

settings :

+

permissions :

+

error :

+

user_data :

+
+
+
+
+

nm_settings_system_interface_save_hostname ()

+
gboolean            nm_settings_system_interface_save_hostname
+                                                        (NMSettingsSystemInterface *settings,
+                                                         const char *hostname,
+                                                         NMSettingsSystemSaveHostnameFunc callback,
+                                                         gpointer user_data);
+

+Requests that the machine's persistent hostname be set to the specified value +or cleared. +

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

settings :

a object implementing NMSettingsSystemInterface +

hostname :

the new persistent hostname to set, or NULL to clear any existing + persistent hostname +

callback :

callback to be called when the hostname operation completes +

user_data :

caller-specific data passed to callback +

Returns :

TRUE if the request was successful, FALSE if it failed +
+
+
+
+

nm_settings_system_interface_get_permissions ()

+
gboolean            nm_settings_system_interface_get_permissions
+                                                        (NMSettingsSystemInterface *settings,
+                                                         NMSettingsSystemGetPermissionsFunc callback,
+                                                         gpointer user_data);
+

+Requests an indication of the operations the caller is permitted to perform +including those that may require authorization. +

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

settings :

a object implementing NMSettingsSystemInterface +

callback :

callback to be called when the permissions operation completes +

user_data :

caller-specific data passed to callback +

Returns :

TRUE if the request was successful, FALSE if it failed +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-types.html b/docs/libnm-glib/html/libnm-glib-nm-types.html new file mode 100644 index 00000000..4f136208 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-types.html @@ -0,0 +1,231 @@ + + + + +nm-types + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

nm-types

+

nm-types

+
+ +
+

Description

+

+

+
+
+

Details

+
+

NM_TYPE_SSID

+
#define NM_TYPE_SSID  (nm_ssid_get_type ())
+
+

+

+
+
+
+

nm_ssid_get_type ()

+
GType               nm_ssid_get_type                    (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_TYPE_UINT_ARRAY

+
#define NM_TYPE_UINT_ARRAY  (nm_uint_array_get_type ())
+
+

+

+
+
+
+

nm_uint_array_get_type ()

+
GType               nm_uint_array_get_type              (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_TYPE_STRING_ARRAY

+
#define NM_TYPE_STRING_ARRAY  (nm_string_array_get_type ())
+
+

+

+
+
+
+

nm_string_array_get_type ()

+
GType               nm_string_array_get_type            (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_TYPE_OBJECT_ARRAY

+
#define NM_TYPE_OBJECT_ARRAY  (nm_object_array_get_type ())
+
+

+

+
+
+
+

nm_object_array_get_type ()

+
GType               nm_object_array_get_type            (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_TYPE_IP6_ADDRESS_OBJECT_ARRAY

+
#define NM_TYPE_IP6_ADDRESS_OBJECT_ARRAY  (nm_ip6_address_object_array_get_type ())
+
+

+

+
+
+
+

nm_ip6_address_object_array_get_type ()

+
GType               nm_ip6_address_object_array_get_type
+                                                        (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_TYPE_IP6_ADDRESS_ARRAY

+
#define NM_TYPE_IP6_ADDRESS_ARRAY  (nm_ip6_address_array_get_type ())
+
+

+

+
+
+
+

nm_ip6_address_array_get_type ()

+
GType               nm_ip6_address_array_get_type       (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_TYPE_IP6_ROUTE_OBJECT_ARRAY

+
#define NM_TYPE_IP6_ROUTE_OBJECT_ARRAY  (nm_ip6_route_object_array_get_type ())
+
+

+

+
+
+
+

nm_ip6_route_object_array_get_type ()

+
GType               nm_ip6_route_object_array_get_type  (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-vpn-connection.html b/docs/libnm-glib/html/libnm-glib-nm-vpn-connection.html new file mode 100644 index 00000000..36421d4b --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-vpn-connection.html @@ -0,0 +1,159 @@ + + + + +NMVPNConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMVPNConnection

+

NMVPNConnection

+
+
+

Synopsis

+
#define             NM_VPN_CONNECTION_VPN_STATE
+#define             NM_VPN_CONNECTION_BANNER
+                    NMVPNConnection;
+GObject *           nm_vpn_connection_new               (DBusGConnection *dbus_connection,
+                                                         const char *path);
+NMVPNConnectionState  nm_vpn_connection_get_vpn_state   (NMVPNConnection *vpn);
+const char *        nm_vpn_connection_get_banner        (NMVPNConnection *vpn);
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_VPN_CONNECTION_VPN_STATE

+
#define NM_VPN_CONNECTION_VPN_STATE "vpn-state"
+
+

+

+
+
+
+

NM_VPN_CONNECTION_BANNER

+
#define NM_VPN_CONNECTION_BANNER "banner"
+
+

+

+
+
+
+

NMVPNConnection

+
typedef struct {
+	NMActiveConnection parent;
+} NMVPNConnection;
+
+

+

+
+
+
+

nm_vpn_connection_new ()

+
GObject *           nm_vpn_connection_new               (DBusGConnection *dbus_connection,
+                                                         const char *path);
+

+

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

dbus_connection :

+

path :

+

Returns :

+
+
+
+
+

nm_vpn_connection_get_vpn_state ()

+
NMVPNConnectionState  nm_vpn_connection_get_vpn_state   (NMVPNConnection *vpn);
+

+

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

vpn :

+

Returns :

+
+
+
+
+

nm_vpn_connection_get_banner ()

+
const char *        nm_vpn_connection_get_banner        (NMVPNConnection *vpn);
+

+

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

vpn :

+

Returns :

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-vpn-plugin-ui-interface.html b/docs/libnm-glib/html/libnm-glib-nm-vpn-plugin-ui-interface.html new file mode 100644 index 00000000..7fa7e7f0 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-vpn-plugin-ui-interface.html @@ -0,0 +1,679 @@ + + + + +nm-vpn-plugin-ui-interface + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

nm-vpn-plugin-ui-interface

+

nm-vpn-plugin-ui-interface

+
+
+

Synopsis

+
                    NMVpnPluginUiInterface;
+                    NMVpnPluginUiWidgetInterface;
+NMVpnPluginUiInterface * (*NMVpnPluginUiFactory)        (GError **error);
+NMVpnPluginUiInterface * nm_vpn_plugin_ui_factory       (GError **error);
+#define             NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE(obj)
+#define             NM_VPN_PLUGIN_UI_CAPABILITY_NONE
+#define             NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT
+#define             NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT
+#define             NM_VPN_PLUGIN_UI_INTERFACE_NAME
+#define             NM_VPN_PLUGIN_UI_INTERFACE_DESC
+#define             NM_VPN_PLUGIN_UI_INTERFACE_SERVICE
+enum                NMVpnPluginUiInterfaceProp;
+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);
+gboolean            nm_vpn_plugin_ui_interface_delete_connection
+                                                        (NMVpnPluginUiInterface *iface,
+                                                         NMConnection *connection,
+                                                         GError **error);
+#define             NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE
+#define             NM_VPN_PLUGIN_UI_WIDGET_INTERFACE   (obj)
+#define             NM_IS_VPN_PLUGIN_UI_WIDGET_INTERFACE(obj)
+#define             NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE(obj)
+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);
+gboolean            nm_vpn_plugin_ui_widget_interface_save_secrets
+                                                        (NMVpnPluginUiWidgetInterface *iface,
+                                                         NMConnection *connection,
+                                                         GError **error);
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NMVpnPluginUiInterface

+
typedef struct {
+	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) (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) (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);
+
+	/* Called when the user has chosen to remove the connection (for user
+	 * connections only; system connections are handled by the system
+	 * settings service).  Should clear out any VPN-specific secrets or data
+	 * related to the connection.
+	 */
+	gboolean (*delete_connection) (NMVpnPluginUiInterface *iface, NMConnection *connection, GError **error);
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+	void (*_reserved5) (void);
+	void (*_reserved6) (void);
+} NMVpnPluginUiInterface;
+
+

+

+
+
+
+

NMVpnPluginUiWidgetInterface

+
typedef struct {
+	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);
+
+	/* Called when the user has chosen to save the connection (for user
+	 * connections only; system connections are handled by the system
+	 * settings service).  Should save VPN-specific connection secrets in
+	 * a way that the auth-dialog can read them.
+	 */
+	gboolean (*save_secrets) (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);
+} NMVpnPluginUiWidgetInterface;
+
+

+

+
+
+
+

NMVpnPluginUiFactory ()

+
NMVpnPluginUiInterface * (*NMVpnPluginUiFactory)        (GError **error);
+

+

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

error :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_factory ()

+
NMVpnPluginUiInterface * nm_vpn_plugin_ui_factory       (GError **error);
+

+

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

error :

+

Returns :

+
+
+
+
+

NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE()

+
#define NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_VPN_PLUGIN_UI_INTERFACE, NMVpnPluginUiInterface))
+
+

+

+
++ + + + +

obj :

+
+
+
+
+

NM_VPN_PLUGIN_UI_CAPABILITY_NONE

+
#define NM_VPN_PLUGIN_UI_CAPABILITY_NONE     0x00
+
+

+

+
+
+
+

NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT

+
#define NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT   0x01
+
+

+

+
+
+
+

NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT

+
#define NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT   0x02
+
+

+

+
+
+
+

NM_VPN_PLUGIN_UI_INTERFACE_NAME

+
#define NM_VPN_PLUGIN_UI_INTERFACE_NAME "name"
+
+

+

+
+
+
+

NM_VPN_PLUGIN_UI_INTERFACE_DESC

+
#define NM_VPN_PLUGIN_UI_INTERFACE_DESC "desc"
+
+

+

+
+
+
+

NM_VPN_PLUGIN_UI_INTERFACE_SERVICE

+
#define NM_VPN_PLUGIN_UI_INTERFACE_SERVICE "service"
+
+

+

+
+
+
+

enum NMVpnPluginUiInterfaceProp

+
typedef enum {
+	NM_VPN_PLUGIN_UI_INTERFACE_PROP_FIRST = 0x1000,
+
+	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;
+
+

+

+
+
+
+

nm_vpn_plugin_ui_interface_ui_factory ()

+
NMVpnPluginUiWidgetInterface * nm_vpn_plugin_ui_interface_ui_factory
+                                                        (NMVpnPluginUiInterface *iface,
+                                                         NMConnection *connection,
+                                                         GError **error);
+

+

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

iface :

+

connection :

+

error :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_interface_get_capabilities ()

+
guint32             nm_vpn_plugin_ui_interface_get_capabilities
+                                                        (NMVpnPluginUiInterface *iface);
+

+

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

iface :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_interface_import ()

+
NMConnection *      nm_vpn_plugin_ui_interface_import   (NMVpnPluginUiInterface *iface,
+                                                         const char *path,
+                                                         GError **error);
+

+

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

iface :

+

path :

+

error :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_interface_export ()

+
gboolean            nm_vpn_plugin_ui_interface_export   (NMVpnPluginUiInterface *iface,
+                                                         const char *path,
+                                                         NMConnection *connection,
+                                                         GError **error);
+

+

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

iface :

+

path :

+

connection :

+

error :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_interface_get_suggested_name ()

+
char *              nm_vpn_plugin_ui_interface_get_suggested_name
+                                                        (NMVpnPluginUiInterface *iface,
+                                                         NMConnection *connection);
+

+

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

iface :

+

connection :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_interface_delete_connection ()

+
gboolean            nm_vpn_plugin_ui_interface_delete_connection
+                                                        (NMVpnPluginUiInterface *iface,
+                                                         NMConnection *connection,
+                                                         GError **error);
+

+

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

iface :

+

connection :

+

error :

+

Returns :

+
+
+
+
+

NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE

+
#define NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE      (nm_vpn_plugin_ui_widget_interface_get_type ())
+
+

+

+
+
+
+

NM_VPN_PLUGIN_UI_WIDGET_INTERFACE()

+
#define NM_VPN_PLUGIN_UI_WIDGET_INTERFACE(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE, NMVpnPluginUiWidgetInterface))
+
+

+

+
++ + + + +

obj :

+
+
+
+
+

NM_IS_VPN_PLUGIN_UI_WIDGET_INTERFACE()

+
#define NM_IS_VPN_PLUGIN_UI_WIDGET_INTERFACE(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE))
+
+

+

+
++ + + + +

obj :

+
+
+
+
+

NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_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))
+
+

+

+
++ + + + +

obj :

+
+
+
+
+

nm_vpn_plugin_ui_widget_interface_get_type ()

+
GType               nm_vpn_plugin_ui_widget_interface_get_type
+                                                        (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_widget_interface_get_widget ()

+
GObject *           nm_vpn_plugin_ui_widget_interface_get_widget
+                                                        (NMVpnPluginUiWidgetInterface *iface);
+

+

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

iface :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_widget_interface_update_connection ()

+
gboolean            nm_vpn_plugin_ui_widget_interface_update_connection
+                                                        (NMVpnPluginUiWidgetInterface *iface,
+                                                         NMConnection *connection,
+                                                         GError **error);
+

+

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

iface :

+

connection :

+

error :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_ui_widget_interface_save_secrets ()

+
gboolean            nm_vpn_plugin_ui_widget_interface_save_secrets
+                                                        (NMVpnPluginUiWidgetInterface *iface,
+                                                         NMConnection *connection,
+                                                         GError **error);
+

+

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

iface :

+

connection :

+

error :

+

Returns :

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib-nm-vpn-plugin.html b/docs/libnm-glib/html/libnm-glib-nm-vpn-plugin.html new file mode 100644 index 00000000..5b39eb8b --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib-nm-vpn-plugin.html @@ -0,0 +1,328 @@ + + + + +NMVPNPlugin + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMVPNPlugin

+

NMVPNPlugin

+
+
+

Synopsis

+
#define             NM_VPN_PLUGIN_DBUS_SERVICE_NAME
+#define             NM_VPN_PLUGIN_STATE
+enum                NMVPNPluginError;
+#define             NM_VPN_PLUGIN_ERROR
+#define             NM_TYPE_VPN_PLUGIN_ERROR
+                    NMVPNPlugin;
+GQuark              nm_vpn_plugin_error_quark           (void);
+GType               nm_vpn_plugin_error_get_type        (void);
+DBusGConnection *   nm_vpn_plugin_get_connection        (NMVPNPlugin *plugin);
+NMVPNServiceState   nm_vpn_plugin_get_state             (NMVPNPlugin *plugin);
+void                nm_vpn_plugin_set_state             (NMVPNPlugin *plugin,
+                                                         NMVPNServiceState state);
+void                nm_vpn_plugin_set_login_banner      (NMVPNPlugin *plugin,
+                                                         const char *banner);
+void                nm_vpn_plugin_failure               (NMVPNPlugin *plugin,
+                                                         NMVPNPluginFailure reason);
+void                nm_vpn_plugin_set_ip4_config        (NMVPNPlugin *plugin,
+                                                         GHashTable *ip4_config);
+gboolean            nm_vpn_plugin_disconnect            (NMVPNPlugin *plugin,
+                                                         GError **err);
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_VPN_PLUGIN_DBUS_SERVICE_NAME

+
#define NM_VPN_PLUGIN_DBUS_SERVICE_NAME "service-name"
+
+

+

+
+
+
+

NM_VPN_PLUGIN_STATE

+
#define NM_VPN_PLUGIN_STATE             "state"
+
+

+

+
+
+
+

enum NMVPNPluginError

+
typedef enum {
+	NM_VPN_PLUGIN_ERROR_GENERAL,
+	NM_VPN_PLUGIN_ERROR_STARTING_IN_PROGRESS,
+	NM_VPN_PLUGIN_ERROR_ALREADY_STARTED,
+	NM_VPN_PLUGIN_ERROR_STOPPING_IN_PROGRESS,
+	NM_VPN_PLUGIN_ERROR_ALREADY_STOPPED,
+	NM_VPN_PLUGIN_ERROR_WRONG_STATE,
+	NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
+	NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
+	NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID,
+} NMVPNPluginError;
+
+

+

+
+
+
+

NM_VPN_PLUGIN_ERROR

+
#define NM_VPN_PLUGIN_ERROR      (nm_vpn_plugin_error_quark ())
+
+

+

+
+
+
+

NM_TYPE_VPN_PLUGIN_ERROR

+
#define NM_TYPE_VPN_PLUGIN_ERROR (nm_vpn_plugin_error_get_type ()) 
+
+

+

+
+
+
+

NMVPNPlugin

+
typedef struct {
+	GObject parent;
+} NMVPNPlugin;
+
+

+

+
+
+
+

nm_vpn_plugin_error_quark ()

+
GQuark              nm_vpn_plugin_error_quark           (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_vpn_plugin_error_get_type ()

+
GType               nm_vpn_plugin_error_get_type        (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_vpn_plugin_get_connection ()

+
DBusGConnection *   nm_vpn_plugin_get_connection        (NMVPNPlugin *plugin);
+

+

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

plugin :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_get_state ()

+
NMVPNServiceState   nm_vpn_plugin_get_state             (NMVPNPlugin *plugin);
+

+

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

plugin :

+

Returns :

+
+
+
+
+

nm_vpn_plugin_set_state ()

+
void                nm_vpn_plugin_set_state             (NMVPNPlugin *plugin,
+                                                         NMVPNServiceState state);
+

+

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

plugin :

+

state :

+
+
+
+
+

nm_vpn_plugin_set_login_banner ()

+
void                nm_vpn_plugin_set_login_banner      (NMVPNPlugin *plugin,
+                                                         const char *banner);
+

+

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

plugin :

+

banner :

+
+
+
+
+

nm_vpn_plugin_failure ()

+
void                nm_vpn_plugin_failure               (NMVPNPlugin *plugin,
+                                                         NMVPNPluginFailure reason);
+

+

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

plugin :

+

reason :

+
+
+
+
+

nm_vpn_plugin_set_ip4_config ()

+
void                nm_vpn_plugin_set_ip4_config        (NMVPNPlugin *plugin,
+                                                         GHashTable *ip4_config);
+

+

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

plugin :

+

ip4_config :

+
+
+
+
+

nm_vpn_plugin_disconnect ()

+
gboolean            nm_vpn_plugin_disconnect            (NMVPNPlugin *plugin,
+                                                         GError **err);
+

+

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

plugin :

+

err :

+

Returns :

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-glib/html/libnm-glib.devhelp b/docs/libnm-glib/html/libnm-glib.devhelp new file mode 100644 index 00000000..68f0a080 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib.devhelp @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/html/libnm-glib.devhelp2 b/docs/libnm-glib/html/libnm-glib.devhelp2 new file mode 100644 index 00000000..d7b770d2 --- /dev/null +++ b/docs/libnm-glib/html/libnm-glib.devhelp2 @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/html/right.png b/docs/libnm-glib/html/right.png new file mode 100644 index 00000000..92832e3a Binary files /dev/null and b/docs/libnm-glib/html/right.png differ diff --git a/docs/libnm-glib/html/style.css b/docs/libnm-glib/html/style.css new file mode 100644 index 00000000..82115eb7 --- /dev/null +++ b/docs/libnm-glib/html/style.css @@ -0,0 +1,257 @@ +.synopsis, .classsynopsis +{ + /* tango:aluminium 1/2 */ + background: #eeeeec; + border: solid 1px #d3d7cf; + padding: 0.5em; +} +.programlisting +{ + /* tango:sky blue 0/1 */ + background: #e6f3ff; + border: solid 1px #729fcf; + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} + +@media screen { + sup a.footnote + { + position: relative; + top: 0em ! important; + + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + position: relative; + padding-top:4.5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 3.2em; + padding-bottom: 20em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + /* tango:scarlet red 0/1 */ + background: #ffe6e6; + border: solid 1px #ef2929; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + z-index: 10; + } + .navigation a, .navigation a:visited + { + /* tango:scarlet red 3 */ + color: #a40000; + } + .navigation a:hover + { + /* tango:scarlet red 1 */ + color: #ef2929; + } + td.shortcuts + { + /* tango:scarlet red 1 */ + color: #ef2929; + font-size: 80%; + white-space: nowrap; + } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + /* tango:scarlet red 0/1 */ + background: #ffe6e6; + border: solid 1px #ef2929; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + +.navigation .title +{ + font-size: 200%; +} + +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} + +a, a:visited +{ + text-decoration: none; + /* tango:sky blue 2 */ + color: #3465a4; +} +a:hover +{ + text-decoration: underline; + /* tango:sky blue 1 */ + color: #729fcf; +} + +div.table table +{ + border-collapse: collapse; + border-spacing: 0px; + /* tango:aluminium 3 */ + border: solid 1px #babdb6; +} + +div.table table td, div.table table th +{ + /* tango:aluminium 3 */ + border: solid 1px #babdb6; + padding: 3px; + vertical-align: top; +} + +div.table table th +{ + /* tango:aluminium 2 */ + background-color: #d3d7cf; +} + +hr +{ + /* tango:aluminium 3 */ + color: #babdb6; + background: #babdb6; + border: none 0px; + height: 1px; + clear: both; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + border-color: #ffb04f; +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + border-color: #abf562; +} +.note, .warning +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; +} +.note h3, .warning h3 +{ + margin-top: 0.0em +} +.note p, .warning p +{ + margin-bottom: 0.0em +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +/* code listings */ + +.listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ +.listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ +.listing_code .programlisting .function { color: #000000; font-weight: bold; } +.listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ +.listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ +.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ +.listing_code .programlisting .normal { color: #000000; } +.listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ +.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ +.listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ +.listing_code .programlisting .type { color: #000000; } +.listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ +.listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + diff --git a/docs/libnm-glib/html/up.png b/docs/libnm-glib/html/up.png new file mode 100644 index 00000000..85b3e2a2 Binary files /dev/null and b/docs/libnm-glib/html/up.png differ diff --git a/docs/libnm-glib/libnm-glib-docs.sgml b/docs/libnm-glib/libnm-glib-docs.sgml new file mode 100644 index 00000000..b4e5dac2 --- /dev/null +++ b/docs/libnm-glib/libnm-glib-docs.sgml @@ -0,0 +1,44 @@ + + + + + libnm-glib Reference Manual + + for libnm-glib 0.8 + The latest version of this documentation can be found on-line at + http://projects.gnome.org/NetworkManager/developers/libnm-glib/08/. + + + + + libnm-glib Objects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/libnm-glib-overrides.txt b/docs/libnm-glib/libnm-glib-overrides.txt new file mode 100644 index 00000000..e69de29b diff --git a/docs/libnm-glib/libnm-glib-sections.txt b/docs/libnm-glib/libnm-glib-sections.txt new file mode 100644 index 00000000..2ea68ca8 --- /dev/null +++ b/docs/libnm-glib/libnm-glib-sections.txt @@ -0,0 +1,606 @@ +
+nm-remote-settings-system +NMRemoteSettingsSystem +NMRemoteSettingsSystem +nm_remote_settings_system_new + +NM_REMOTE_SETTINGS_SYSTEM +NM_IS_REMOTE_SETTINGS_SYSTEM +NM_TYPE_REMOTE_SETTINGS_SYSTEM +nm_remote_settings_system_get_type +NM_REMOTE_SETTINGS_SYSTEM_CLASS +NM_IS_REMOTE_SETTINGS_SYSTEM_CLASS +NM_REMOTE_SETTINGS_SYSTEM_GET_CLASS +
+ +
+nm-active-connection +NM_ACTIVE_CONNECTION_SERVICE_NAME +NM_ACTIVE_CONNECTION_CONNECTION +NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT +NM_ACTIVE_CONNECTION_DEVICES +NM_ACTIVE_CONNECTION_STATE +NM_ACTIVE_CONNECTION_DEFAULT +NM_ACTIVE_CONNECTION_DEFAULT6 +NMActiveConnection +NMActiveConnection +nm_active_connection_new +nm_active_connection_get_service_name +nm_active_connection_get_scope +nm_active_connection_get_connection +nm_active_connection_get_specific_object +nm_active_connection_get_devices +nm_active_connection_get_state +nm_active_connection_get_default +nm_active_connection_get_default6 + +NM_ACTIVE_CONNECTION +NM_IS_ACTIVE_CONNECTION +NM_TYPE_ACTIVE_CONNECTION +nm_active_connection_get_type +NM_ACTIVE_CONNECTION_CLASS +NM_IS_ACTIVE_CONNECTION_CLASS +NM_ACTIVE_CONNECTION_GET_CLASS +
+ +
+nm-settings-system-interface +NMSettingsSystemPermissions +NM_SETTINGS_SYSTEM_INTERFACE_GET_INTERFACE +NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME +NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY +NM_SETTINGS_SYSTEM_INTERFACE_CHECK_PERMISSIONS +NMSettingsSystemInterfaceProp +NMSettingsSystemInterface +NMSettingsSystemSaveHostnameFunc +NMSettingsSystemGetPermissionsFunc +nm_settings_system_interface_save_hostname +nm_settings_system_interface_get_permissions + +NM_SETTINGS_SYSTEM_INTERFACE +NM_IS_SETTINGS_SYSTEM_INTERFACE +NM_TYPE_SETTINGS_SYSTEM_INTERFACE +nm_settings_system_interface_get_type +
+ +
+nm-remote-settings +NM_REMOTE_SETTINGS_BUS +NM_REMOTE_SETTINGS_SCOPE +NM_REMOTE_SETTINGS_SERVICE_RUNNING +NMRemoteSettings +NMRemoteSettings +nm_remote_settings_new + +NM_REMOTE_SETTINGS +NM_IS_REMOTE_SETTINGS +NM_TYPE_REMOTE_SETTINGS +nm_remote_settings_get_type +NM_REMOTE_SETTINGS_CLASS +NM_IS_REMOTE_SETTINGS_CLASS +NM_REMOTE_SETTINGS_GET_CLASS +
+ +
+nm-serial-device +NMSerialDevice +NMSerialDevice +nm_serial_device_get_bytes_received +nm_serial_device_get_bytes_sent + +NM_SERIAL_DEVICE +NM_IS_SERIAL_DEVICE +NM_TYPE_SERIAL_DEVICE +nm_serial_device_get_type +NM_SERIAL_DEVICE_CLASS +NM_IS_SERIAL_DEVICE_CLASS +NM_SERIAL_DEVICE_GET_CLASS +
+ +
+nm-device-wifi +NM_DEVICE_WIFI_HW_ADDRESS +NM_DEVICE_WIFI_MODE +NM_DEVICE_WIFI_BITRATE +NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT +NM_DEVICE_WIFI_CAPABILITIES +NMDeviceWifi +NMDeviceWifi +nm_device_wifi_new +nm_device_wifi_get_hw_address +nm_device_wifi_get_mode +nm_device_wifi_get_bitrate +nm_device_wifi_get_capabilities +nm_device_wifi_get_active_access_point +nm_device_wifi_get_access_point_by_path +nm_device_wifi_get_access_points + +NM_DEVICE_WIFI +NM_IS_DEVICE_WIFI +NM_TYPE_DEVICE_WIFI +nm_device_wifi_get_type +NM_DEVICE_WIFI_CLASS +NM_IS_DEVICE_WIFI_CLASS +NM_DEVICE_WIFI_GET_CLASS +
+ +
+nm-dhcp6-config +NMDHCP6Config +NMDHCP6Config +NM_DHCP6_CONFIG_OPTIONS +nm_dhcp6_config_new +nm_dhcp6_config_get_options +nm_dhcp6_config_get_one_option + +NM_DHCP6_CONFIG +NM_IS_DHCP6_CONFIG +NM_TYPE_DHCP6_CONFIG +nm_dhcp6_config_get_type +NM_DHCP6_CONFIG_CLASS +NM_IS_DHCP6_CONFIG_CLASS +
+ +
+nm-exported-connection +NMExportedConnection +NMExportedConnection +nm_exported_connection_new + +NM_EXPORTED_CONNECTION +NM_IS_EXPORTED_CONNECTION +NM_TYPE_EXPORTED_CONNECTION +nm_exported_connection_get_type +NM_EXPORTED_CONNECTION_CLASS +NM_IS_EXPORTED_CONNECTION_CLASS +NM_EXPORTED_CONNECTION_GET_CLASS +
+ +
+nm-object +NM_OBJECT_DBUS_CONNECTION +NM_OBJECT_DBUS_PATH +NMObject +NMObject +nm_object_get_connection +nm_object_get_path + +NM_OBJECT +NM_IS_OBJECT +NM_TYPE_OBJECT +nm_object_get_type +NM_OBJECT_CLASS +NM_IS_OBJECT_CLASS +NM_OBJECT_GET_CLASS +
+ +
+nm-settings-interface +NMSettingsInterfaceError +NM_SETTINGS_INTERFACE_ERROR +nm_settings_interface_error_quark +NM_TYPE_SETTINGS_INTERFACE_ERROR +NM_SETTINGS_INTERFACE_GET_INTERFACE +NM_SETTINGS_INTERFACE_NEW_CONNECTION +NM_SETTINGS_INTERFACE_CONNECTIONS_READ +NMSettingsInterface +NMSettingsAddConnectionFunc +nm_settings_interface_get_type +nm_settings_interface_list_connections +nm_settings_interface_get_connection_by_path +nm_settings_interface_add_connection + +NM_SETTINGS_INTERFACE +NM_IS_SETTINGS_INTERFACE +NM_TYPE_SETTINGS_INTERFACE +nm_settings_interface_error_get_type +
+ +
+nm-settings-service +NM_SETTINGS_SERVICE_BUS +NM_SETTINGS_SERVICE_SCOPE +NMSettingsService +NMSettingsService +nm_settings_service_get_connection_by_path +nm_settings_service_export +nm_settings_service_export_connection + +NM_SETTINGS_SERVICE +NM_IS_SETTINGS_SERVICE +NM_TYPE_SETTINGS_SERVICE +nm_settings_service_get_type +NM_SETTINGS_SERVICE_CLASS +NM_IS_SETTINGS_SERVICE_CLASS +NM_SETTINGS_SERVICE_GET_CLASS +
+ +
+nm-ip4-config +NMIP4Config +NMIP4Config +NM_IP4_CONFIG_ADDRESSES +NM_IP4_CONFIG_HOSTNAME +NM_IP4_CONFIG_NAMESERVERS +NM_IP4_CONFIG_DOMAINS +NM_IP4_CONFIG_ROUTES +NM_IP4_CONFIG_WINS_SERVERS +nm_ip4_config_new +nm_ip4_config_get_addresses +nm_ip4_config_get_hostname +nm_ip4_config_get_nameservers +nm_ip4_config_get_domains +nm_ip4_config_get_routes +nm_ip4_config_get_wins_servers + +NM_IP4_CONFIG +NM_IS_IP4_CONFIG +NM_TYPE_IP4_CONFIG +nm_ip4_config_get_type +NM_IP4_CONFIG_CLASS +NM_IS_IP4_CONFIG_CLASS +NM_IP4_CONFIG_GET_CLASS +
+ +
+nm-gsm-device +NMGsmDevice +NMGsmDevice +nm_gsm_device_new + +NM_GSM_DEVICE +NM_IS_GSM_DEVICE +NM_TYPE_GSM_DEVICE +nm_gsm_device_get_type +NM_GSM_DEVICE_CLASS +NM_IS_GSM_DEVICE_CLASS +NM_GSM_DEVICE_GET_CLASS +
+ +
+nm-vpn-plugin +NM_VPN_PLUGIN_DBUS_SERVICE_NAME +NM_VPN_PLUGIN_STATE +NMVPNPluginError +NM_VPN_PLUGIN_ERROR +NM_TYPE_VPN_PLUGIN_ERROR +NMVPNPlugin +NMVPNPlugin +nm_vpn_plugin_error_quark +nm_vpn_plugin_error_get_type +nm_vpn_plugin_get_connection +nm_vpn_plugin_get_state +nm_vpn_plugin_set_state +nm_vpn_plugin_set_login_banner +nm_vpn_plugin_failure +nm_vpn_plugin_set_ip4_config +nm_vpn_plugin_disconnect + +NM_VPN_PLUGIN +NM_IS_VPN_PLUGIN +NM_TYPE_VPN_PLUGIN +nm_vpn_plugin_get_type +NM_VPN_PLUGIN_CLASS +NM_IS_VPN_PLUGIN_CLASS +NM_VPN_PLUGIN_GET_CLASS +
+ +
+nm-access-point +NM_ACCESS_POINT_FLAGS +NM_ACCESS_POINT_WPA_FLAGS +NM_ACCESS_POINT_RSN_FLAGS +NM_ACCESS_POINT_SSID +NM_ACCESS_POINT_FREQUENCY +NM_ACCESS_POINT_HW_ADDRESS +NM_ACCESS_POINT_MODE +NM_ACCESS_POINT_MAX_BITRATE +NM_ACCESS_POINT_STRENGTH +NMAccessPoint +NMAccessPoint +nm_access_point_new +nm_access_point_get_flags +nm_access_point_get_wpa_flags +nm_access_point_get_rsn_flags +nm_access_point_get_ssid +nm_access_point_get_frequency +nm_access_point_get_hw_address +nm_access_point_get_mode +nm_access_point_get_max_bitrate +nm_access_point_get_strength + +NM_ACCESS_POINT +NM_IS_ACCESS_POINT +NM_TYPE_ACCESS_POINT +nm_access_point_get_type +NM_ACCESS_POINT_CLASS +NM_IS_ACCESS_POINT_CLASS +NM_ACCESS_POINT_GET_CLASS +
+ +
+nm-device +NM_DEVICE_UDI +NM_DEVICE_INTERFACE +NM_DEVICE_DRIVER +NM_DEVICE_CAPABILITIES +NM_DEVICE_MANAGED +NM_DEVICE_IP4_CONFIG +NM_DEVICE_DHCP4_CONFIG +NM_DEVICE_IP6_CONFIG +NM_DEVICE_DHCP6_CONFIG +NM_DEVICE_STATE +NM_DEVICE_VENDOR +NM_DEVICE_PRODUCT +NMDevice +NMDevice +nm_device_new +nm_device_get_iface +nm_device_get_udi +nm_device_get_driver +nm_device_get_capabilities +nm_device_get_managed +nm_device_get_ip4_config +nm_device_get_dhcp4_config +nm_device_get_ip6_config +nm_device_get_dhcp6_config +nm_device_get_state +nm_device_get_product +nm_device_get_vendor +NMDeviceDeactivateFn +nm_device_disconnect + +NM_DEVICE +NM_IS_DEVICE +NM_TYPE_DEVICE +nm_device_get_type +NM_DEVICE_CLASS +NM_IS_DEVICE_CLASS +NM_DEVICE_GET_CLASS +
+ +
+nm-device-ethernet +NM_DEVICE_ETHERNET_HW_ADDRESS +NM_DEVICE_ETHERNET_SPEED +NM_DEVICE_ETHERNET_CARRIER +NMDeviceEthernet +NMDeviceEthernet +nm_device_ethernet_new +nm_device_ethernet_get_hw_address +nm_device_ethernet_get_speed +nm_device_ethernet_get_carrier + +NM_DEVICE_ETHERNET +NM_IS_DEVICE_ETHERNET +NM_TYPE_DEVICE_ETHERNET +nm_device_ethernet_get_type +NM_DEVICE_ETHERNET_CLASS +NM_IS_DEVICE_ETHERNET_CLASS +NM_DEVICE_ETHERNET_GET_CLASS +
+ +
+nm-settings-connection-interface +NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE +NM_SETTINGS_CONNECTION_INTERFACE_UPDATED +NM_SETTINGS_CONNECTION_INTERFACE_REMOVED +NMSettingsConnectionInterface +NMSettingsConnectionInterfaceUpdateFunc +NMSettingsConnectionInterfaceDeleteFunc +NMSettingsConnectionInterfaceGetSecretsFunc +nm_settings_connection_interface_update +nm_settings_connection_interface_delete +nm_settings_connection_interface_get_secrets +nm_settings_connection_interface_emit_updated + +NM_SETTINGS_CONNECTION_INTERFACE +NM_IS_SETTINGS_CONNECTION_INTERFACE +NM_TYPE_SETTINGS_CONNECTION_INTERFACE +nm_settings_connection_interface_get_type +
+ +
+nm-vpn-connection +NM_VPN_CONNECTION_VPN_STATE +NM_VPN_CONNECTION_BANNER +NMVPNConnection +NMVPNConnection +nm_vpn_connection_new +nm_vpn_connection_get_vpn_state +nm_vpn_connection_get_banner + +NM_VPN_CONNECTION +NM_IS_VPN_CONNECTION +NM_TYPE_VPN_CONNECTION +nm_vpn_connection_get_type +NM_VPN_CONNECTION_CLASS +NM_IS_VPN_CONNECTION_CLASS +NM_VPN_CONNECTION_GET_CLASS +
+ +
+nm-vpn-plugin-ui-interface +NMVpnPluginUiInterface +NMVpnPluginUiWidgetInterface +NMVpnPluginUiFactory +nm_vpn_plugin_ui_factory +NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE +NM_VPN_PLUGIN_UI_CAPABILITY_NONE +NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT +NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT +NM_VPN_PLUGIN_UI_INTERFACE_NAME +NM_VPN_PLUGIN_UI_INTERFACE_DESC +NM_VPN_PLUGIN_UI_INTERFACE_SERVICE +NMVpnPluginUiInterfaceProp +nm_vpn_plugin_ui_interface_ui_factory +nm_vpn_plugin_ui_interface_get_capabilities +nm_vpn_plugin_ui_interface_import +nm_vpn_plugin_ui_interface_export +nm_vpn_plugin_ui_interface_get_suggested_name +nm_vpn_plugin_ui_interface_delete_connection +NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE +NM_VPN_PLUGIN_UI_WIDGET_INTERFACE +NM_IS_VPN_PLUGIN_UI_WIDGET_INTERFACE +NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE +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_plugin_ui_widget_interface_save_secrets + +NM_VPN_PLUGIN_UI_INTERFACE +NM_IS_VPN_PLUGIN_UI_INTERFACE +NM_TYPE_VPN_PLUGIN_UI_INTERFACE +nm_vpn_plugin_ui_interface_get_type +
+ +
+nm-ip6-config +NMIP6Config +NMIP6Config +NM_IP6_CONFIG_ADDRESSES +NM_IP6_CONFIG_NAMESERVERS +NM_IP6_CONFIG_DOMAINS +NM_IP6_CONFIG_ROUTES +nm_ip6_config_new +nm_ip6_config_get_addresses +nm_ip6_config_get_nameservers +nm_ip6_config_get_domains +nm_ip6_config_get_routes + +NM_IP6_CONFIG +NM_IS_IP6_CONFIG +NM_TYPE_IP6_CONFIG +nm_ip6_config_get_type +NM_IP6_CONFIG_CLASS +NM_IS_IP6_CONFIG_CLASS +NM_IP6_CONFIG_GET_CLASS +
+ +
+nm-device-bt +NM_DEVICE_BT_HW_ADDRESS +NM_DEVICE_BT_NAME +NM_DEVICE_BT_CAPABILITIES +NMDeviceBt +NMDeviceBt +nm_device_bt_new +nm_device_bt_get_hw_address +nm_device_bt_get_name +nm_device_bt_get_capabilities + +NM_DEVICE_BT +NM_IS_DEVICE_BT +NM_TYPE_DEVICE_BT +nm_device_bt_get_type +NM_DEVICE_BT_CLASS +NM_IS_DEVICE_BT_CLASS +NM_DEVICE_BT_GET_CLASS +
+ +
+nm-client +NM_CLIENT_STATE +NM_CLIENT_MANAGER_RUNNING +NM_CLIENT_WIRELESS_ENABLED +NM_CLIENT_WIRELESS_HARDWARE_ENABLED +NM_CLIENT_WWAN_ENABLED +NM_CLIENT_WWAN_HARDWARE_ENABLED +NM_CLIENT_ACTIVE_CONNECTIONS +NMClient +NMClient +nm_client_new +nm_client_get_devices +nm_client_get_device_by_path +NMClientActivateDeviceFn +nm_client_activate_connection +nm_client_deactivate_connection +nm_client_wireless_get_enabled +nm_client_wireless_set_enabled +nm_client_wireless_hardware_get_enabled +nm_client_wwan_get_enabled +nm_client_wwan_set_enabled +nm_client_wwan_hardware_get_enabled +nm_client_get_state +nm_client_get_manager_running +nm_client_get_active_connections +nm_client_sleep + +NM_CLIENT +NM_IS_CLIENT +NM_TYPE_CLIENT +nm_client_get_type +NM_CLIENT_CLASS +NM_IS_CLIENT_CLASS +NM_CLIENT_GET_CLASS +
+ +
+nm-dhcp4-config +NMDHCP4Config +NMDHCP4Config +NM_DHCP4_CONFIG_OPTIONS +nm_dhcp4_config_new +nm_dhcp4_config_get_options +nm_dhcp4_config_get_one_option + +NM_DHCP4_CONFIG +NM_IS_DHCP4_CONFIG +NM_TYPE_DHCP4_CONFIG +nm_dhcp4_config_get_type +NM_DHCP4_CONFIG_CLASS +NM_IS_DHCP4_CONFIG_CLASS +
+ +
+nm-remote-connection +NMRemoteConnection +NMRemoteConnection +nm_remote_connection_new + +NM_REMOTE_CONNECTION +NM_IS_REMOTE_CONNECTION +NM_TYPE_REMOTE_CONNECTION +nm_remote_connection_get_type +NM_REMOTE_CONNECTION_CLASS +NM_IS_REMOTE_CONNECTION_CLASS +NM_REMOTE_CONNECTION_GET_CLASS +
+ +
+nm-cdma-device +NMCdmaDevice +NMCdmaDevice +nm_cdma_device_new + +NM_CDMA_DEVICE +NM_IS_CDMA_DEVICE +NM_TYPE_CDMA_DEVICE +nm_cdma_device_get_type +NM_CDMA_DEVICE_CLASS +NM_IS_CDMA_DEVICE_CLASS +NM_CDMA_DEVICE_GET_CLASS +
+ +
+libnm_glib +
+ +
+nm-types +NM_TYPE_SSID +nm_ssid_get_type +NM_TYPE_UINT_ARRAY +nm_uint_array_get_type +NM_TYPE_STRING_ARRAY +nm_string_array_get_type +NM_TYPE_OBJECT_ARRAY +nm_object_array_get_type +NM_TYPE_IP6_ADDRESS_OBJECT_ARRAY +nm_ip6_address_object_array_get_type +NM_TYPE_IP6_ADDRESS_ARRAY +nm_ip6_address_array_get_type +NM_TYPE_IP6_ROUTE_OBJECT_ARRAY +nm_ip6_route_object_array_get_type +
+ diff --git a/docs/libnm-glib/libnm-glib.types b/docs/libnm-glib/libnm-glib.types new file mode 100644 index 00000000..99783ba6 --- /dev/null +++ b/docs/libnm-glib/libnm-glib.types @@ -0,0 +1,25 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +nm_object_get_type +nm_client_get_type +nm_device_get_type +nm_device_ethernet_get_type +nm_device_wifi_get_type +nm_gsm_device_get_type +nm_cdma_device_get_type +nm_serial_device_get_type +nm_access_point_get_type +nm_ip4_config_get_type +nm_active_connection_get_type +nm_dhcp4_config_get_type +nm_ip6_config_get_type diff --git a/docs/libnm-glib/tmpl/libnm-glib-unused.sgml b/docs/libnm-glib/tmpl/libnm-glib-unused.sgml new file mode 100644 index 00000000..aac76040 --- /dev/null +++ b/docs/libnm-glib/tmpl/libnm-glib-unused.sgml @@ -0,0 +1,637 @@ + + + + + + + + + + + + + + + + + + + + + +NMDBusConnection + + + + + + + + + + + + + + + + + + + + + + + +NMDBusSettingsSystem + + + + + + + + + + + + + + + + + + + + + + + +NMDBusSettings + + + + + + + + + + + + + + + + + + + + + + + +nm-device-bt-bindings + + + + + + + + + + + + + + + + + + + + + + + +nm-dhcp6-config-bindings + + + + + + + + + + + + + + + + + + + + + + + +nm-ip6-config-bindings + + + + + + + + + + + + + + + + + + + + + + + +nm-remote-connection-private + + + + + + + + + + + + + + + + + + + + + + + +NMSettings + + + + + + + + + + + + + + + + + + + + + + + + + +@nmclient: the object which received the signal. +@arg1: +@arg2: + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@parent: + + + + + + +@parent: + + + + + + + + + + + + + + + + + + + + + + + + +@NM_REMOTE_CONNECTION_INIT_RESULT_UNKNOWN: +@NM_REMOTE_CONNECTION_INIT_RESULT_SUCCESS: +@NM_REMOTE_CONNECTION_INIT_RESULT_ERROR: + + + + + + +@parent: + + + + + + +@NM_SETTINGS_ERROR_INVALID_CONNECTION: +@NM_SETTINGS_ERROR_READ_ONLY_CONNECTION: +@NM_SETTINGS_ERROR_INTERNAL_ERROR: +@NM_SETTINGS_ERROR_SECRETS_UNAVAILABLE: +@NM_SETTINGS_ERROR_SECRETS_REQUEST_CANCELED: +@NM_SETTINGS_ERROR_PERMISSION_DENIED: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@obj: + + + + + + +@klass: + + + + + + + + + + + + +@obj: + + + + + + +@klass: + + + + + + + + + + + + +@obj: + + + + + + + + + + + + +@libnm_ctx: +@user_data: + + + + + + + + + + + + +@ctx: +@Returns: + + + + + + +@Returns: + + + + + + +@ctx: +@func: +@user_data: +@g_main_ctx: +@Returns: + + + + + + +@ctx: + + + + + + +@LIBNM_NO_DBUS: +@LIBNM_NO_NETWORKMANAGER: +@LIBNM_NO_NETWORK_CONNECTION: +@LIBNM_ACTIVE_NETWORK_CONNECTION: +@LIBNM_INVALID_CONTEXT: + + + + + + +@ctx: +@id: + + + + + + +@dbus_connection: +@scope: +@path: +@Returns: + + + + + + +@self: +@path: +@Returns: + + + + + + +@dbus_connection: +@Returns: + + + + + + +@self: +@connection: +@err: +@Returns: + + + + + + +@self: +@Returns: + + + + + + +@self: +@Returns: + + + + + + +@self: +@Returns: + + + + + + +@dbus_connection: +@Returns: + + + + + + +@self: +@hostname: +@err: +@Returns: + + + + + + +@connection: +@err: +@Returns: + + + + + + +@connection: +@Returns: + + + + + + +@connection: +@scope: +@dbus_connection: + + + + + + +@connection: + + + + + + +@connection: +@new_settings: + + + + + + +@connection: +@new_settings: +@err: +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@settings: +@Returns: + + + + + + +@settings: +@connection: + diff --git a/docs/libnm-glib/tmpl/libnm_glib.sgml b/docs/libnm-glib/tmpl/libnm_glib.sgml new file mode 100644 index 00000000..325e10cb --- /dev/null +++ b/docs/libnm-glib/tmpl/libnm_glib.sgml @@ -0,0 +1,22 @@ + +libnm_glib + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/tmpl/nm-access-point.sgml b/docs/libnm-glib/tmpl/nm-access-point.sgml new file mode 100644 index 00000000..04b92818 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-access-point.sgml @@ -0,0 +1,227 @@ + +NMAccessPoint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@path: +@Returns: + + + + + + + +@ap: +@Returns: + + + + + + + +@ap: +@Returns: + + + + + + + +@ap: +@Returns: + + + + + + + +@ap: +@Returns: + + + + + + + +@ap: +@Returns: + + + + + + + +@ap: +@Returns: + + + + + + + +@ap: +@Returns: + + + + + + + +@ap: +@Returns: + + + + + + + +@ap: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-active-connection.sgml b/docs/libnm-glib/tmpl/nm-active-connection.sgml new file mode 100644 index 00000000..8617c034 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-active-connection.sgml @@ -0,0 +1,194 @@ + +NMActiveConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@path: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-cdma-device.sgml b/docs/libnm-glib/tmpl/nm-cdma-device.sgml new file mode 100644 index 00000000..30939d8b --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-cdma-device.sgml @@ -0,0 +1,38 @@ + +NMCdmaDevice + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@path: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-client.sgml b/docs/libnm-glib/tmpl/nm-client.sgml new file mode 100644 index 00000000..679bd3e1 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-client.sgml @@ -0,0 +1,284 @@ + +NMClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@nmclient: the object which received the signal. +@arg1: + + + + + + +@nmclient: the object which received the signal. +@arg1: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@object_path: +@Returns: + + + + + + + +@user_data: +@object_path: +@error: + + + + + + + +@client: +@service_name: +@connection_path: +@device: +@specific_object: +@callback: +@user_data: + + + + + + + +@client: +@active: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@enabled: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@enabled: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@Returns: + + + + + + + +@client: +@sleep: + + diff --git a/docs/libnm-glib/tmpl/nm-dbus-connection.sgml b/docs/libnm-glib/tmpl/nm-dbus-connection.sgml new file mode 100644 index 00000000..dbc81062 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-dbus-connection.sgml @@ -0,0 +1,19 @@ + +NMDBusConnection + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/tmpl/nm-dbus-settings-system.sgml b/docs/libnm-glib/tmpl/nm-dbus-settings-system.sgml new file mode 100644 index 00000000..b57a582d --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-dbus-settings-system.sgml @@ -0,0 +1,19 @@ + +NMDBusSettingsSystem + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/tmpl/nm-dbus-settings.sgml b/docs/libnm-glib/tmpl/nm-dbus-settings.sgml new file mode 100644 index 00000000..5090b3a8 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-dbus-settings.sgml @@ -0,0 +1,19 @@ + +NMDBusSettings + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/tmpl/nm-device-bt-bindings.sgml b/docs/libnm-glib/tmpl/nm-device-bt-bindings.sgml new file mode 100644 index 00000000..cc4c496a --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-device-bt-bindings.sgml @@ -0,0 +1,26 @@ + +nm-device-bt-bindings + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/tmpl/nm-device-bt.sgml b/docs/libnm-glib/tmpl/nm-device-bt.sgml new file mode 100644 index 00000000..f0cc46b6 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-device-bt.sgml @@ -0,0 +1,87 @@ + +NMDeviceBt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@connection: +@path: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-device-ethernet.sgml b/docs/libnm-glib/tmpl/nm-device-ethernet.sgml new file mode 100644 index 00000000..85f760c2 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-device-ethernet.sgml @@ -0,0 +1,101 @@ + +NMDeviceEthernet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@path: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-device-wifi.sgml b/docs/libnm-glib/tmpl/nm-device-wifi.sgml new file mode 100644 index 00000000..4e677738 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-device-wifi.sgml @@ -0,0 +1,178 @@ + +NMDeviceWifi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@nmdevicewifi: the object which received the signal. +@arg1: + + + + + + +@nmdevicewifi: the object which received the signal. +@arg1: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@path: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@path: +@Returns: + + + + + + + +@device: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-device.sgml b/docs/libnm-glib/tmpl/nm-device.sgml new file mode 100644 index 00000000..d7159eb3 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-device.sgml @@ -0,0 +1,320 @@ + +NMDevice + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@nmdevice: the object which received the signal. +@arg1: +@arg2: +@arg3: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@path: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@Returns: + + + + + + + +@device: +@error: +@user_data: + + + + + + + +@device: +@callback: +@user_data: + + diff --git a/docs/libnm-glib/tmpl/nm-dhcp4-config.sgml b/docs/libnm-glib/tmpl/nm-dhcp4-config.sgml new file mode 100644 index 00000000..0f3ba93e --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-dhcp4-config.sgml @@ -0,0 +1,69 @@ + +NMDHCP4Config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@object_path: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@option: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-dhcp6-config-bindings.sgml b/docs/libnm-glib/tmpl/nm-dhcp6-config-bindings.sgml new file mode 100644 index 00000000..4aee648c --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-dhcp6-config-bindings.sgml @@ -0,0 +1,26 @@ + +nm-dhcp6-config-bindings + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/tmpl/nm-dhcp6-config.sgml b/docs/libnm-glib/tmpl/nm-dhcp6-config.sgml new file mode 100644 index 00000000..d0443073 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-dhcp6-config.sgml @@ -0,0 +1,64 @@ + +NMDHCP6Config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@object_path: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@option: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-exported-connection.sgml b/docs/libnm-glib/tmpl/nm-exported-connection.sgml new file mode 100644 index 00000000..7f3ad5da --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-exported-connection.sgml @@ -0,0 +1,38 @@ + +NMExportedConnection + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@scope: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-gsm-device.sgml b/docs/libnm-glib/tmpl/nm-gsm-device.sgml new file mode 100644 index 00000000..51320a11 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-gsm-device.sgml @@ -0,0 +1,38 @@ + +NMGsmDevice + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@path: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-ip4-config.sgml b/docs/libnm-glib/tmpl/nm-ip4-config.sgml new file mode 100644 index 00000000..415a9afe --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-ip4-config.sgml @@ -0,0 +1,164 @@ + +NMIP4Config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@object_path: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-ip6-config-bindings.sgml b/docs/libnm-glib/tmpl/nm-ip6-config-bindings.sgml new file mode 100644 index 00000000..0a6ba649 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-ip6-config-bindings.sgml @@ -0,0 +1,26 @@ + +nm-ip6-config-bindings + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/tmpl/nm-ip6-config.sgml b/docs/libnm-glib/tmpl/nm-ip6-config.sgml new file mode 100644 index 00000000..f8490d6b --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-ip6-config.sgml @@ -0,0 +1,122 @@ + +NMIP6Config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@connection: +@object_path: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@Returns: + + + + + + + +@config: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-object.sgml b/docs/libnm-glib/tmpl/nm-object.sgml new file mode 100644 index 00000000..3757ea7b --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-object.sgml @@ -0,0 +1,70 @@ + +NMObject + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@object: +@Returns: + + + + + + + +@object: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-remote-connection-private.sgml b/docs/libnm-glib/tmpl/nm-remote-connection-private.sgml new file mode 100644 index 00000000..3b6da6d5 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-remote-connection-private.sgml @@ -0,0 +1,35 @@ + +nm-remote-connection-private + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_REMOTE_CONNECTION_INIT_RESULT_UNKNOWN: +@NM_REMOTE_CONNECTION_INIT_RESULT_SUCCESS: +@NM_REMOTE_CONNECTION_INIT_RESULT_ERROR: + diff --git a/docs/libnm-glib/tmpl/nm-remote-connection.sgml b/docs/libnm-glib/tmpl/nm-remote-connection.sgml new file mode 100644 index 00000000..a32edd95 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-remote-connection.sgml @@ -0,0 +1,40 @@ + +NMRemoteConnection + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@bus: +@scope: +@path: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-remote-settings-system.sgml b/docs/libnm-glib/tmpl/nm-remote-settings-system.sgml new file mode 100644 index 00000000..52f43385 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-remote-settings-system.sgml @@ -0,0 +1,38 @@ + +NMRemoteSettingsSystem + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@bus: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-remote-settings.sgml b/docs/libnm-glib/tmpl/nm-remote-settings.sgml new file mode 100644 index 00000000..9100853f --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-remote-settings.sgml @@ -0,0 +1,60 @@ + +NMRemoteSettings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@bus: +@scope: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-serial-device.sgml b/docs/libnm-glib/tmpl/nm-serial-device.sgml new file mode 100644 index 00000000..082bedd7 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-serial-device.sgml @@ -0,0 +1,55 @@ + +NMSerialDevice + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@nmserialdevice: the object which received the signal. +@arg1: +@arg2: + + + + + + +@self: +@Returns: + + + + + + + +@self: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-settings-connection-interface.sgml b/docs/libnm-glib/tmpl/nm-settings-connection-interface.sgml new file mode 100644 index 00000000..0271dee4 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-settings-connection-interface.sgml @@ -0,0 +1,138 @@ + +nm-settings-connection-interface + + + + + + + + + + + + + + + + + + + + + + + + + +@obj: + + + + + + + + + + + + + + + + + + + + + +@g_iface: +@update: +@delete: +@get_secrets: +@emit_updated: +@updated: +@removed: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: +@_reserved5: +@_reserved6: + + + + + + +@connection: +@error: +@user_data: + + + + + + + +@connection: +@error: +@user_data: + + + + + + + +@connection: +@secrets: +@error: +@user_data: + + + + + + + +@connection: +@callback: +@user_data: +@Returns: + + + + + + + +@connection: +@callback: +@user_data: +@Returns: + + + + + + + +@connection: +@setting_name: +@hints: +@request_new: +@callback: +@user_data: +@Returns: + + + + + + + +@connection: + + diff --git a/docs/libnm-glib/tmpl/nm-settings-interface.sgml b/docs/libnm-glib/tmpl/nm-settings-interface.sgml new file mode 100644 index 00000000..f9cc7fb8 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-settings-interface.sgml @@ -0,0 +1,148 @@ + +nm-settings-interface + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION: +@NM_SETTINGS_INTERFACE_ERROR_READ_ONLY_CONNECTION: +@NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR: +@NM_SETTINGS_INTERFACE_ERROR_SECRETS_UNAVAILABLE: +@NM_SETTINGS_INTERFACE_ERROR_SECRETS_REQUEST_CANCELED: +@NM_SETTINGS_INTERFACE_ERROR_PERMISSION_DENIED: +@NM_SETTINGS_INTERFACE_ERROR_INVALID_SETTING: + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + +@obj: + + + + + + + + + + + + + + + + + + + + + +@g_iface: +@list_connections: +@get_connection_by_path: +@add_connection: +@new_connection: +@connections_read: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: +@_reserved5: +@_reserved6: + + + + + + +@settings: +@error: +@user_data: + + + + + + + +@void: +@Returns: + + + + + + + +@settings: +@Returns: + + + + + + + +@settings: +@path: +@Returns: + + + + + + + +@settings: +@connection: +@callback: +@user_data: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-settings-service.sgml b/docs/libnm-glib/tmpl/nm-settings-service.sgml new file mode 100644 index 00000000..164c873b --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-settings-service.sgml @@ -0,0 +1,70 @@ + +NMSettingsService + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@self: +@path: +@Returns: + + + + + + + +@self: + + + + + + + +@self: +@exported: + + diff --git a/docs/libnm-glib/tmpl/nm-settings-system-interface.sgml b/docs/libnm-glib/tmpl/nm-settings-system-interface.sgml new file mode 100644 index 00000000..44aad9ed --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-settings-system-interface.sgml @@ -0,0 +1,131 @@ + +nm-settings-system-interface + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTINGS_SYSTEM_PERMISSION_NONE: +@NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY: +@NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_PROTECTED: +@NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_OPEN: +@NM_SETTINGS_SYSTEM_PERMISSION_HOSTNAME_MODIFY: + + + + + + +@obj: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTINGS_SYSTEM_INTERFACE_PROP_FIRST: +@NM_SETTINGS_SYSTEM_INTERFACE_PROP_HOSTNAME: +@NM_SETTINGS_SYSTEM_INTERFACE_PROP_CAN_MODIFY: + + + + + + +@g_iface: +@save_hostname: +@get_permissions: +@check_permissions: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: +@_reserved5: +@_reserved6: + + + + + + +@settings: +@error: +@user_data: + + + + + + + +@settings: +@permissions: +@error: +@user_data: + + + + + + + +@settings: +@hostname: +@callback: +@user_data: +@Returns: + + + + + + + +@settings: +@callback: +@user_data: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-settings.sgml b/docs/libnm-glib/tmpl/nm-settings.sgml new file mode 100644 index 00000000..c8f4b951 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-settings.sgml @@ -0,0 +1,35 @@ + +NMSettings + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@scope: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-types.sgml b/docs/libnm-glib/tmpl/nm-types.sgml new file mode 100644 index 00000000..a96a895f --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-types.sgml @@ -0,0 +1,134 @@ + +nm-types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + +@void: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-vpn-connection.sgml b/docs/libnm-glib/tmpl/nm-vpn-connection.sgml new file mode 100644 index 00000000..201529c1 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-vpn-connection.sgml @@ -0,0 +1,71 @@ + +NMVPNConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@dbus_connection: +@path: +@Returns: + + + + + + + +@vpn: +@Returns: + + + + + + + +@vpn: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-vpn-plugin-ui-interface.sgml b/docs/libnm-glib/tmpl/nm-vpn-plugin-ui-interface.sgml new file mode 100644 index 00000000..b6635e98 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-vpn-plugin-ui-interface.sgml @@ -0,0 +1,265 @@ + +nm-vpn-plugin-ui-interface + + + + + + + + + + + + + + + + + + + + + + + + + +@g_iface: +@ui_factory: +@get_capabilities: +@import: +@export: +@get_suggested_name: +@delete_connection: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: +@_reserved5: +@_reserved6: + + + + + + +@g_iface: +@get_widget: +@update_connection: +@save_secrets: +@changed: + + + + + + +@error: +@Returns: + + + + + + + +@error: +@Returns: + + + + + + + +@obj: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_VPN_PLUGIN_UI_INTERFACE_PROP_FIRST: +@NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME: +@NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC: +@NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE: + + + + + + +@iface: +@connection: +@error: +@Returns: + + + + + + + +@iface: +@Returns: + + + + + + + +@iface: +@path: +@error: +@Returns: + + + + + + + +@iface: +@path: +@connection: +@error: +@Returns: + + + + + + + +@iface: +@connection: +@Returns: + + + + + + + +@iface: +@connection: +@error: +@Returns: + + + + + + + + + + + + + + +@obj: + + + + + + + +@obj: + + + + + + + +@obj: + + + + + + + +@void: +@Returns: + + + + + + + +@iface: +@Returns: + + + + + + + +@iface: +@connection: +@error: +@Returns: + + + + + + + +@iface: +@connection: +@error: +@Returns: + + diff --git a/docs/libnm-glib/tmpl/nm-vpn-plugin.sgml b/docs/libnm-glib/tmpl/nm-vpn-plugin.sgml new file mode 100644 index 00000000..910f5561 --- /dev/null +++ b/docs/libnm-glib/tmpl/nm-vpn-plugin.sgml @@ -0,0 +1,154 @@ + +NMVPNPlugin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_VPN_PLUGIN_ERROR_GENERAL: +@NM_VPN_PLUGIN_ERROR_STARTING_IN_PROGRESS: +@NM_VPN_PLUGIN_ERROR_ALREADY_STARTED: +@NM_VPN_PLUGIN_ERROR_STOPPING_IN_PROGRESS: +@NM_VPN_PLUGIN_ERROR_ALREADY_STOPPED: +@NM_VPN_PLUGIN_ERROR_WRONG_STATE: +@NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS: +@NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED: +@NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID: + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@plugin: +@Returns: + + + + + + + +@plugin: +@Returns: + + + + + + + +@plugin: +@state: + + + + + + + +@plugin: +@banner: + + + + + + + +@plugin: +@reason: + + + + + + + +@plugin: +@ip4_config: + + + + + + + +@plugin: +@err: +@Returns: + + diff --git a/docs/libnm-util/Makefile.am b/docs/libnm-util/Makefile.am new file mode 100644 index 00000000..59a9ef6b --- /dev/null +++ b/docs/libnm-util/Makefile.am @@ -0,0 +1,64 @@ +## Process this file with automake to produce Makefile.in +AUTOMAKE_OPTIONS = 1.6 + +# The name of the module +DOC_MODULE=libnm-util + +# The top-level SGML file. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting functions and macros. +DOC_SOURCE_DIR=../../libnm-util + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS=--rebuild-types --rebuild-sections + +# Extra options to supply to gtkdoc-scangobj. +SCANGOBJ_OPTIONS=--type-init-func 'g_type_init();' + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS= + +# Used for dependencies. +HFILE_GLOB=$(top_srcdir)/libnm-util/*.h +CFILE_GLOB=$(top_srcdir)/libnm-util/*.c + +# Header files to ignore when scanning. +IGNORE_HFILES= \ + crypto.h \ + nm-setting-template.h \ + nm-utils-private.h \ + nm-param-spec-specialized.h + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra XML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = + +# Other files to distribute. +extra_files = + + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +GTKDOC_CFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/marshallers \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +GTKDOC_LIBS = $(top_builddir)/libnm-util/libnm-util.la + + +# include common portion ... +include $(top_srcdir)/gtk-doc.make + +CLEANFILES += libnm-util-sections.txt + diff --git a/docs/libnm-util/Makefile.in b/docs/libnm-util/Makefile.in new file mode 100644 index 00000000..1db7fbbe --- /dev/null +++ b/docs/libnm-util/Makefile.in @@ -0,0 +1,691 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/gtk-doc.make +subdir = docs/libnm-util +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.6 + +# The name of the module +DOC_MODULE = libnm-util + +# The top-level SGML file. +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting functions and macros. +DOC_SOURCE_DIR = ../../libnm-util + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS = --rebuild-types --rebuild-sections + +# Extra options to supply to gtkdoc-scangobj. +SCANGOBJ_OPTIONS = --type-init-func 'g_type_init();' + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS = --sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-fixref. +FIXXREF_OPTIONS = + +# Used for dependencies. +HFILE_GLOB = $(top_srcdir)/libnm-util/*.h +CFILE_GLOB = $(top_srcdir)/libnm-util/*.c + +# Header files to ignore when scanning. +IGNORE_HFILES = \ + crypto.h \ + nm-setting-template.h \ + nm-utils-private.h \ + nm-param-spec-specialized.h + + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra XML files that are included by $(DOC_MAIN_SGML_FILE). +content_files = + +# Other files to distribute. +extra_files = + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +GTKDOC_CFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/marshallers \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +GTKDOC_LIBS = $(top_builddir)/libnm-util/libnm-util.la +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) +EXTRA_DIST = \ + $(content_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ + pdf-build.stamp \ + $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ + $(srcdir)/pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + + +# include common portion ... +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) \ + libnm-util-sections.txt +@ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = +@ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp +@ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = +@ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/libnm-util/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/libnm-util/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am +check: check-am +all-am: Makefile all-local +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-local + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: install-am install-strip + +.PHONY: all all-am all-local check check-am clean clean-generic \ + clean-libtool clean-local dist-hook distclean \ + distclean-generic distclean-libtool distclean-local distdir \ + dvi dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-local mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-local + + +@ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +@ENABLE_GTK_DOC_FALSE@all-local: + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +#### scan #### + +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo 'gtk-doc: Scanning header files' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ + else \ + cd $(srcdir) ; \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + @touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### templates #### + +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt + @echo 'gtk-doc: Rebuilding template files' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + @touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +$(srcdir)/tmpl/*.sgml: + @true + +#### xml #### + +sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) + @echo 'gtk-doc: Building XML' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building HTML' + @-chmod -R u+w $(srcdir) + @rm -rf $(srcdir)/html + @mkdir $(srcdir)/html + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$(?)" = "0"; then \ + mkhtml_options=--path="$(srcdir)"; \ + fi; \ + cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + @echo 'gtk-doc: Fixing cross-references' + @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +#### pdf #### + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building PDF' + @-chmod -R u+w $(srcdir) + @rm -rf $(srcdir)/$(DOC_MODULE).pdf + @mkpdf_imgdirs=""; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + @touch pdf-build.stamp + +############## + +clean-local: + rm -f *~ *.bak + rm -rf .libs + +distclean-local: + cd $(srcdir) && \ + rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +maintainer-clean-local: clean + cd $(srcdir) && rm -rf xml html + +install-data-local: + @installfiles=`echo $(srcdir)/html/*`; \ + if test "$$installfiles" = '$(srcdir)/html/*'; \ + then echo '-- Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + mv -f $${installdir}/$(DOC_MODULE).devhelp \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +@ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: +@ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: +@ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" +@ENABLE_GTK_DOC_FALSE@ @false + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/tmpl + mkdir $(distdir)/html + -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl + cp $(srcdir)/html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/docs/libnm-util/html/NMConnection.html b/docs/libnm-util/html/NMConnection.html new file mode 100644 index 00000000..40734343 --- /dev/null +++ b/docs/libnm-util/html/NMConnection.html @@ -0,0 +1,1011 @@ + + + + +NMConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMConnection

+

NMConnection — Describes a connection to specific network or provider

+
+
+

Synopsis

+
+#include <nm-connection.h>
+
+enum                NMConnectionScope;
+enum                NMConnectionError;
+#define             NM_TYPE_CONNECTION_ERROR
+#define             NM_CONNECTION_ERROR
+GQuark              nm_connection_error_quark           (void);
+#define             NM_CONNECTION_SCOPE
+#define             NM_CONNECTION_PATH
+                    NMConnection;
+                    NMConnectionClass;
+GType               nm_connection_get_type              (void);
+NMConnection *      nm_connection_new                   (void);
+NMConnection *      nm_connection_new_from_hash         (GHashTable *hash,
+                                                         GError **error);
+NMConnection *      nm_connection_duplicate             (NMConnection *connection);
+void                nm_connection_add_setting           (NMConnection *connection,
+                                                         NMSetting *setting);
+void                nm_connection_remove_setting        (NMConnection *connection,
+                                                         GType setting_type);
+NMSetting *         nm_connection_get_setting           (NMConnection *connection,
+                                                         GType setting_type);
+NMSetting *         nm_connection_get_setting_by_name   (NMConnection *connection,
+                                                         const char *name);
+gboolean            nm_connection_replace_settings      (NMConnection *connection,
+                                                         GHashTable *new_settings,
+                                                         GError **error);
+gboolean            nm_connection_compare               (NMConnection *a,
+                                                         NMConnection *b,
+                                                         NMSettingCompareFlags flags);
+gboolean            nm_connection_verify                (NMConnection *connection,
+                                                         GError **error);
+const char *        nm_connection_need_secrets          (NMConnection *connection,
+                                                         GPtrArray **hints);
+void                nm_connection_clear_secrets         (NMConnection *connection);
+gboolean            nm_connection_update_secrets        (NMConnection *connection,
+                                                         const char *setting_name,
+                                                         GHashTable *secrets,
+                                                         GError **error);
+void                nm_connection_set_scope             (NMConnection *connection,
+                                                         NMConnectionScope scope);
+NMConnectionScope   nm_connection_get_scope             (NMConnection *connection);
+void                nm_connection_set_path              (NMConnection *connection,
+                                                         const char *path);
+const char *        nm_connection_get_path              (NMConnection *connection);
+void                nm_connection_for_each_setting_value
+                                                        (NMConnection *connection,
+                                                         NMSettingValueIterFn func,
+                                                         gpointer user_data);
+GHashTable *        nm_connection_to_hash               (NMConnection *connection);
+void                nm_connection_dump                  (NMConnection *connection);
+NMSetting *         nm_connection_create_setting        (const char *name);
+GType               nm_connection_lookup_setting_type   (const char *name);
+GType               nm_connection_lookup_setting_type_by_quark
+                                                        (GQuark error_quark);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMConnection
+
+
+
+

Properties

+
+  "path"                     gchar*                : Read / Write / Construct
+  "scope"                    guint                 : Read / Write / Construct
+
+
+
+

Signals

+
+  "secrets-updated"                                : Run First
+
+
+
+

Description

+

+An NMConnection describes all the settings and configuration values that +are necessary to configure network devices for operation on a specific +network. Connections are the fundamental operating object for +NetworkManager; no device is connected without a NMConnection, or +disconnected without having been connected with a NMConnection. +

+

+Each NMConnection contains a list of NMSetting objects usually referenced +by name (using nm_connection_get_setting_by_name()) or by type (with +nm_connection_get_setting()). The settings describe the actual parameters +with which the network devices are configured, including device-specific +parameters (MTU, SSID, APN, channel, rate, etc) and IP-level parameters +(addresses, routes, addressing methods, etc). +

+

+Most connections also have a NMConnectionScope; a connection will be +provided over D-Bus either by the user settings service +(org.freedesktop.NetworkManagerUserSettings) running in an active user +session, or by the system-wide system settings service +(org.freedesktop.NetworkManagerSystemSettings) which provides connections +for all users. +

+
+
+

Details

+
+

enum NMConnectionScope

+
typedef enum {
+	NM_CONNECTION_SCOPE_UNKNOWN = 0,
+	NM_CONNECTION_SCOPE_SYSTEM,
+	NM_CONNECTION_SCOPE_USER
+} NMConnectionScope;
+
+

+Connection scope indicated what settings service, if any, provides the +connection. +

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

NM_CONNECTION_SCOPE_UNKNOWN

scope not known or not yet set +

NM_CONNECTION_SCOPE_SYSTEM

connection is provided by the system settings + service +

NM_CONNECTION_SCOPE_USER

connection is provided by a user settings service +
+
+
+
+

enum NMConnectionError

+
typedef enum
+{
+	NM_CONNECTION_ERROR_UNKNOWN = 0,
+	NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND
+} NMConnectionError;
+
+

+Describes errors that may result from operations involving a NMConnection. +

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

NM_CONNECTION_ERROR_UNKNOWN

unknown or unclassified error +

NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND

the NMConnection object + did not contain the required NMSettingConnection object, which must be + present for all connections +
+
+
+
+

NM_TYPE_CONNECTION_ERROR

+
#define NM_TYPE_CONNECTION_ERROR (nm_connection_error_get_type ()) 
+
+

+

+
+
+
+

NM_CONNECTION_ERROR

+
#define NM_CONNECTION_ERROR nm_connection_error_quark ()
+
+

+

+
+
+
+

nm_connection_error_quark ()

+
GQuark              nm_connection_error_quark           (void);
+

+Registers an error quark for NMConnection if necessary. +

+
++ + + + +

Returns :

the error quark used for NMConnection errors. +
+
+
+
+

NM_CONNECTION_SCOPE

+
#define NM_CONNECTION_SCOPE "scope"
+
+

+

+
+
+
+

NM_CONNECTION_PATH

+
#define NM_CONNECTION_PATH "path"
+
+

+

+
+
+
+

NMConnection

+
typedef struct _NMConnection NMConnection;
+

+The NMConnection struct contains only private data. +It should only be accessed through the functions described below. +

+
+
+
+

NMConnectionClass

+
typedef struct {
+	GObjectClass parent;
+
+	/* Signals */
+	void (*secrets_updated) (NMConnection *connection, const char * setting);
+} NMConnectionClass;
+
+

+

+
+
+
+

nm_connection_get_type ()

+
GType               nm_connection_get_type              (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_connection_new ()

+
NMConnection *      nm_connection_new                   (void);
+

+Creates a new NMConnection object with no NMSetting objects. +

+
++ + + + +

Returns :

the new empty NMConnection object +
+
+
+
+

nm_connection_new_from_hash ()

+
NMConnection *      nm_connection_new_from_hash         (GHashTable *hash,
+                                                         GError **error);
+

+Creates a new NMConnection from a hash table describing the connection. See +nm_connection_to_hash() for a description of the expected hash table. +

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

hash :

the GHashTable describing the connection +

error :

on unsuccessful return, an error +

Returns :

the new NMConnection object, populated with settings created +from the values in the hash table, or NULL if the connection failed to +validate +
+
+
+
+

nm_connection_duplicate ()

+
NMConnection *      nm_connection_duplicate             (NMConnection *connection);
+

+Duplicates a NMConnection. +

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

connection :

the NMConnection to duplicate +

Returns :

a new NMConnection containing the same settings and properties +as the source NMConnection +
+
+
+
+

nm_connection_add_setting ()

+
void                nm_connection_add_setting           (NMConnection *connection,
+                                                         NMSetting *setting);
+

+Adds a NMSetting to the connection, replacing any previous NMSetting of the +same name which has previously been added to the NMConnection. The +connection takes ownership of the NMSetting object and does not increase +the setting object's reference count. +

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

connection :

a NMConnection +

setting :

the NMSetting to add to the connection object +
+
+
+
+

nm_connection_remove_setting ()

+
void                nm_connection_remove_setting        (NMConnection *connection,
+                                                         GType setting_type);
+

+Removes the NMSetting with the given GType from the NMConnection. This +operation dereferences the NMSetting object. +

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

connection :

a NMConnection +

setting_type :

the GType of the setting object to remove +
+
+
+
+

nm_connection_get_setting ()

+
NMSetting *         nm_connection_get_setting           (NMConnection *connection,
+                                                         GType setting_type);
+

+Gets the NMSetting with the given GType, if one has been previously added +to the NMConnection. +

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

connection :

a NMConnection +

setting_type :

the GType of the setting object to return +

Returns :

the NMSetting, or NULL if no setting of that type was previously +added to the NMConnection +
+
+
+
+

nm_connection_get_setting_by_name ()

+
NMSetting *         nm_connection_get_setting_by_name   (NMConnection *connection,
+                                                         const char *name);
+

+Gets the NMSetting with the given name, if one has been previously added +the the NMConnection. +

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

connection :

a NMConnection +

name :

a setting name +

Returns :

the NMSetting, or NULL if no setting with that name was previously +added to the NMConnection +
+
+
+
+

nm_connection_replace_settings ()

+
gboolean            nm_connection_replace_settings      (NMConnection *connection,
+                                                         GHashTable *new_settings,
+                                                         GError **error);
+
++ + + + + + + + + + + + + + + + + + +

connection :

a NMConnection +

new_settings :

a GHashTable of settings +

error :

location to store error, or NULL +

Returns :

TRUE if the settings were valid and added to the connection, FALSE +if they were not +
+
+
+
+

nm_connection_compare ()

+
gboolean            nm_connection_compare               (NMConnection *a,
+                                                         NMConnection *b,
+                                                         NMSettingCompareFlags flags);
+

+Compares two NMConnection objects for similarity, with comparison behavior +modified by a set of flags. See nm_setting_compare() for a description of +each flag's behavior. +

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

a :

a NMConnection +

b :

a second NMConnection to compare with the first +

flags :

compare flags, e.g. NM_SETTING_COMPARE_FLAG_EXACT +

Returns :

TRUE if the comparison succeeds, FALSE if it does not +
+
+
+
+

nm_connection_verify ()

+
gboolean            nm_connection_verify                (NMConnection *connection,
+                                                         GError **error);
+

+Validates the connection and all its settings. Each setting's properties +have allowed values, and some values are dependent on other values. For +example, if a WiFi connection is security enabled, the NMSettingWireless +setting object's 'security' property must contain the setting name of the +NMSettingWirelessSecurity object, which must also be present in the +connection for the connection to be valid. As another example, the +NMSettingWired object's 'mac-address' property must be a validly formatted +MAC address. The returned GError contains information about which +setting and which property failed validation, and how it failed validation. +

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

connection :

the NMConnection to verify +

error :

location to store error, or NULL +

Returns :

TRUE if the connection is valid, FALSE if it is not +
+
+
+
+

nm_connection_need_secrets ()

+
const char *        nm_connection_need_secrets          (NMConnection *connection,
+                                                         GPtrArray **hints);
+

+Returns the name of the first setting object in the connection which would +need secrets to make a successful connection. The returned hints are only +intended as a guide to what secrets may be required, because in some +circumstances, there is no way to conclusively determine exactly which +secrets are needed. +

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

connection :

the NMConnection +

hints :

the address of a pointer to a GPtrArray, initialized to NULL, which +on return points to an allocated GPtrArray containing the property names of +secrets of the NMSetting which may be required; the caller owns the array +and must free the each array element with g_free(), as well as the array +itself with g_ptr_array_free() +

Returns :

the setting name of the NMSetting object which has invalid or +missing secrets +
+
+
+
+

nm_connection_clear_secrets ()

+
void                nm_connection_clear_secrets         (NMConnection *connection);
+

+Clears and frees any secrets that may be stored in the connection, to avoid +keeping secret data in memory when not needed. +

+
++ + + + +

connection :

the NMConnection +
+
+
+
+

nm_connection_update_secrets ()

+
gboolean            nm_connection_update_secrets        (NMConnection *connection,
+                                                         const char *setting_name,
+                                                         GHashTable *secrets,
+                                                         GError **error);
+

+Update the specified setting's secrets, given a hash table of secrets +intended for that setting (deserialized from D-Bus for example). +

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

connection :

the NMConnection +

setting_name :

the setting object name to which the secrets apply +

secrets :

a GHashTable mapping string:GValue of setting property names and +secrets +

error :

location to store error, or NULL +

Returns :

TRUE if the secrets were successfully updated and the connection +is valid, FALSE on failure or if the setting was never added to the connection +
+
+
+
+

nm_connection_set_scope ()

+
void                nm_connection_set_scope             (NMConnection *connection,
+                                                         NMConnectionScope scope);
+

+Sets the scope of the connection. This property is not serialized, and is +only for the reference of the caller. A connection may have no scope +(internal, temporary connections), "system" scope (provided by the system +settings service), or "user" scope, provided by a user settings service. The +creator of the NMConnection object is responsible for setting the +connection's scope if needed. Sets the "scope" property. +

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

connection :

the NMConnection +

scope :

the scope of the connection +
+
+
+
+

nm_connection_get_scope ()

+
NMConnectionScope   nm_connection_get_scope             (NMConnection *connection);
+

+Returns the connection scope. +

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

connection :

the NMConnection +

Returns :

the scope of the connection, previously set by a call to +nm_connection_set_scope(). +
+
+
+
+

nm_connection_set_path ()

+
void                nm_connection_set_path              (NMConnection *connection,
+                                                         const char *path);
+

+Sets the D-Bus path of the connection. This property is not serialized, and +is only for the reference of the caller. Sets the "path" +property. +

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

connection :

the NMConnection +

path :

the D-Bus path of the connection as given by the settings service +which provides the connection +
+
+
+
+

nm_connection_get_path ()

+
const char *        nm_connection_get_path              (NMConnection *connection);
+

+Returns the connection's D-Bus path. +

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

connection :

the NMConnection +

Returns :

the D-Bus path of the connection, previously set by a call to +nm_connection_set_path(). +
+
+
+
+

nm_connection_for_each_setting_value ()

+
void                nm_connection_for_each_setting_value
+                                                        (NMConnection *connection,
+                                                         NMSettingValueIterFn func,
+                                                         gpointer user_data);
+

+Iterates over the properties of each NMSetting object in the NMConnection, +calling the supplied user function for each property. +

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

connection :

the NMConnection +

func :

user-supplied function called for each setting's property +

user_data :

user data passed to func at each invocation +
+
+
+
+

nm_connection_to_hash ()

+
GHashTable *        nm_connection_to_hash               (NMConnection *connection);
+

+Converts the NMConnection into a GHashTable describing the connection, +suitable for marshalling over D-Bus or serializing. The hash table mapping +is string:GHashTable with each element in the returned hash representing +a NMSetting object. The keys are setting object names, and the values +are GHashTables mapping string:GValue, each of which represents the +properties of the NMSetting object. +

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

connection :

the NMConnection +

Returns :

a new GHashTable describing the connection, its settings, and +each setting's properties. The caller owns the hash table and must unref +the hash table with g_hash_table_unref() when it is no longer needed. +
+
+
+
+

nm_connection_dump ()

+
void                nm_connection_dump                  (NMConnection *connection);
+

+Print the connection to stdout. For debugging purposes ONLY, should NOT +be used for serialization of the connection or machine-parsed in any way. The +output format is not guaranteed to be stable and may change at any time. +

+
++ + + + +

connection :

the NMConnection +
+
+
+
+

nm_connection_create_setting ()

+
NMSetting *         nm_connection_create_setting        (const char *name);
+

+Create a new NMSetting object of the desired type, given a setting name. +

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

name :

a setting name +

Returns :

the new setting object, or NULL if the setting name was unknown +
+
+
+
+

nm_connection_lookup_setting_type ()

+
GType               nm_connection_lookup_setting_type   (const char *name);
+

+Returns the GType of the setting's class for a given setting name. +

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

name :

a setting name +

Returns :

the GType of the setting's class +
+
+
+
+

nm_connection_lookup_setting_type_by_quark ()

+
GType               nm_connection_lookup_setting_type_by_quark
+                                                        (GQuark error_quark);
+

+Returns the GType of the setting's class for a given setting error quark. +Useful for figuring out which setting a returned error is for. +

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

error_quark :

a setting error quark +

Returns :

the GType of the setting's class +
+
+
+
+

Property Details

+
+

The "path" property

+
  "path"                     gchar*                : Read / Write / Construct
+

+The connection's D-Bus path, used only by the calling process as a record +of the D-Bus path of the connection as provided by a settings service. +

+

Default value: NULL

+
+
+
+

The "scope" property

+
  "scope"                    guint                 : Read / Write / Construct
+

+The connection's scope, used only by the calling process as a record +of which settings service the connection is provided by. One of the +NM_CONNECTION_SCOPE_* defines. +

+

Allowed values: <= 2

+

Default value: 0

+
+
+
+

Signal Details

+
+

The "secrets-updated" signal

+
void                user_function                      (NMConnection *connection,
+                                                        gchar        *setting_name,
+                                                        gpointer      user_data)         : Run First
+

+The ::secrets-updated signal is emitted when the secrets of a setting +have been changed. +

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

connection :

the object on which the signal is emitted +

setting_name :

the setting name of the NMSetting for which secrets were +updated +

user_data :

user data set when the signal handler was connected.
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSetting.html b/docs/libnm-util/html/NMSetting.html new file mode 100644 index 00000000..181ee2df --- /dev/null +++ b/docs/libnm-util/html/NMSetting.html @@ -0,0 +1,725 @@ + + + + +NMSetting + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSetting

+

NMSetting — Describes related configuration information

+
+
+

Synopsis

+
+#include <nm-setting.h>
+
+enum                NMSettingError;
+#define             NM_TYPE_SETTING_ERROR
+#define             NM_SETTING_ERROR
+GQuark              nm_setting_error_quark              (void);
+#define             NM_SETTING_PARAM_SERIALIZE
+#define             NM_SETTING_PARAM_REQUIRED
+#define             NM_SETTING_PARAM_SECRET
+#define             NM_SETTING_PARAM_FUZZY_IGNORE
+#define             NM_SETTING_NAME
+                    NMSetting;
+                    NMSettingClass;
+void                (*NMSettingValueIterFn)             (NMSetting *setting,
+                                                         const char *key,
+                                                         const GValue *value,
+                                                         GParamFlags flags,
+                                                         gpointer user_data);
+GType               nm_setting_get_type                 (void);
+GHashTable *        nm_setting_to_hash                  (NMSetting *setting);
+NMSetting *         nm_setting_new_from_hash            (GType setting_type,
+                                                         GHashTable *hash);
+NMSetting *         nm_setting_duplicate                (NMSetting *setting);
+const char *        nm_setting_get_name                 (NMSetting *setting);
+gboolean            nm_setting_verify                   (NMSetting *setting,
+                                                         GSList *all_settings,
+                                                         GError **error);
+enum                NMSettingCompareFlags;
+gboolean            nm_setting_compare                  (NMSetting *a,
+                                                         NMSetting *b,
+                                                         NMSettingCompareFlags flags);
+void                nm_setting_enumerate_values         (NMSetting *setting,
+                                                         NMSettingValueIterFn func,
+                                                         gpointer user_data);
+char *              nm_setting_to_string                (NMSetting *setting);
+void                nm_setting_clear_secrets            (NMSetting *setting);
+GPtrArray *         nm_setting_need_secrets             (NMSetting *setting);
+gboolean            nm_setting_update_secrets           (NMSetting *setting,
+                                                         GHashTable *secrets,
+                                                         GError **error);
+
+
+ +
+

Properties

+
+  "name"                     gchar*                : Read / Write
+
+
+
+

Description

+

+Each NMSetting contains properties that describe configuration that applies +to a specific network layer (like IPv4 or IPv6 configuration) or device type +(like Ethernet, or WiFi). A collection of individual settings together +make up an NMConnection. Each property is strongly typed and usually has +a number of allowed values. See each NMSetting subclass for a description +of properties and allowed values. +

+
+
+

Details

+
+

enum NMSettingError

+
typedef enum
+{
+	NM_SETTING_ERROR_UNKNOWN = 0,
+	NM_SETTING_ERROR_PROPERTY_NOT_FOUND,
+	NM_SETTING_ERROR_PROPERTY_NOT_SECRET,
+	NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH
+} NMSettingError;
+
+

+Describes errors that may result from operations involving a NMSetting. +

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

NM_SETTING_ERROR_UNKNOWN

unknown or unclassified error +

NM_SETTING_ERROR_PROPERTY_NOT_FOUND

a property required by the operation + was not found; for example, an attempt to update an invalid secret +

NM_SETTING_ERROR_PROPERTY_NOT_SECRET

an operation which requires a secret + was attempted on a non-secret property +

NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH

the operation requires a property + of a specific type, or the value couldn't be transformed to the same type + as the property being acted upon +
+
+
+
+

NM_TYPE_SETTING_ERROR

+
#define NM_TYPE_SETTING_ERROR (nm_setting_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_ERROR

+
#define NM_SETTING_ERROR nm_setting_error_quark ()
+
+

+

+
+
+
+

nm_setting_error_quark ()

+
GQuark              nm_setting_error_quark              (void);
+

+Registers an error quark for NMSetting if necessary. +

+
++ + + + +

Returns :

the error quark used for NMSetting errors. +
+
+
+
+

NM_SETTING_PARAM_SERIALIZE

+
#define NM_SETTING_PARAM_SERIALIZE    (1 << (0 + G_PARAM_USER_SHIFT))
+
+

+

+
+
+
+

NM_SETTING_PARAM_REQUIRED

+
#define NM_SETTING_PARAM_REQUIRED     (1 << (1 + G_PARAM_USER_SHIFT))
+
+

+

+
+
+
+

NM_SETTING_PARAM_SECRET

+
#define NM_SETTING_PARAM_SECRET       (1 << (2 + G_PARAM_USER_SHIFT))
+
+

+

+
+
+
+

NM_SETTING_PARAM_FUZZY_IGNORE

+
#define NM_SETTING_PARAM_FUZZY_IGNORE (1 << (3 + G_PARAM_USER_SHIFT))
+
+

+

+
+
+
+

NM_SETTING_NAME

+
#define NM_SETTING_NAME "name"
+
+

+

+
+
+
+

NMSetting

+
typedef struct _NMSetting NMSetting;
+

+The NMSetting struct contains only private data. +It should only be accessed through the functions described below. +

+
+
+
+

NMSettingClass

+
typedef struct {
+	GObjectClass parent;
+
+	/* Virtual functions */
+	gboolean    (*verify)            (NMSetting  *setting,
+	                                  GSList     *all_settings,
+	                                  GError     **error);
+
+	GPtrArray  *(*need_secrets)      (NMSetting  *setting);
+
+	gboolean    (*update_one_secret) (NMSetting  *setting,
+	                                  const char *key,
+	                                  GValue     *value,
+	                                  GError    **error);
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingClass;
+
+

+

+
+
+
+

NMSettingValueIterFn ()

+
void                (*NMSettingValueIterFn)             (NMSetting *setting,
+                                                         const char *key,
+                                                         const GValue *value,
+                                                         GParamFlags flags,
+                                                         gpointer user_data);
+

+

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

setting :

+

key :

+

value :

+

flags :

+

user_data :

+
+
+
+
+

nm_setting_get_type ()

+
GType               nm_setting_get_type                 (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_to_hash ()

+
GHashTable *        nm_setting_to_hash                  (NMSetting *setting);
+

+Converts the NMSetting into a GHashTable mapping each setting property +name to a GValue describing that property, suitable for marshalling over +D-Bus or serializing. The mapping is string:GValue. +

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

setting :

the NMSetting +

Returns :

a new GHashTable describing the setting's properties +
+
+
+
+

nm_setting_new_from_hash ()

+
NMSetting *         nm_setting_new_from_hash            (GType setting_type,
+                                                         GHashTable *hash);
+

+Creates a new NMSetting object and populates that object with the properties +contained in the hash table, using each hash key as the property to set, +and each hash value as the value to set that property to. Setting properties +are strongly typed, thus the GValue type of the hash value must be correct. +See the documentation on each NMSetting object subclass for the correct +property names and value types. +

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

setting_type :

the NMSetting type which the hash contains properties for +

hash :

the GHashTable containing a string:GValue mapping of properties +that apply to the setting +

Returns :

a new NMSetting object populated with the properties from the +hash table, or NULL on failure +
+
+
+
+

nm_setting_duplicate ()

+
NMSetting *         nm_setting_duplicate                (NMSetting *setting);
+

+Duplicates a NMSetting. +

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

setting :

the NMSetting to duplicate +

Returns :

a new NMSetting containing the same properties and values as the +source NMSetting +
+
+
+
+

nm_setting_get_name ()

+
const char *        nm_setting_get_name                 (NMSetting *setting);
+

+Returns the type name of the NMSetting object +

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

setting :

the NMSetting +

Returns :

a string containing the type name of the NMSetting object, +like 'ppp' or 'wireless' or 'wired'. +
+
+
+
+

nm_setting_verify ()

+
gboolean            nm_setting_verify                   (NMSetting *setting,
+                                                         GSList *all_settings,
+                                                         GError **error);
+

+Validates the setting. Each setting's properties have allowed values, and +some are dependent on other values (hence the need for all_settings). The +returned GError contains information about which property of the setting +failed validation, and in what way that property failed validation. +

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

setting :

the NMSetting to verify +

all_settings :

a GSList of all settings in the connection from which setting +came +

error :

location to store error, or NULL +

Returns :

TRUE if the setting is valid, FALSE if it is not +
+
+
+
+

enum NMSettingCompareFlags

+
typedef enum {
+	NM_SETTING_COMPARE_FLAG_EXACT = 0x00000000,
+	NM_SETTING_COMPARE_FLAG_FUZZY = 0x00000001,
+	NM_SETTING_COMPARE_FLAG_IGNORE_ID = 0x00000002,
+	NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS = 0x00000004
+} NMSettingCompareFlags;
+
+

+These flags modify the comparison behavior when comparing two settings or +two connections. +

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

NM_SETTING_COMPARE_FLAG_EXACT

match all properties exactly +

NM_SETTING_COMPARE_FLAG_FUZZY

match only important attributes, like SSID, + type, security settings, etc. Does not match, for example, connection ID + or UUID. +

NM_SETTING_COMPARE_FLAG_IGNORE_ID

ignore the connection's ID +

NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS

ignore secrets +
+
+
+
+

nm_setting_compare ()

+
gboolean            nm_setting_compare                  (NMSetting *a,
+                                                         NMSetting *b,
+                                                         NMSettingCompareFlags flags);
+

+Compares two NMSetting objects for similarity, with comparison behavior +modified by a set of flags. See the documentation for NMSettingCompareFlags +for a description of each flag's behavior. +

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

a :

a NMSetting +

b :

a second NMSetting to compare with the first +

flags :

compare flags, e.g. NM_SETTING_COMPARE_FLAG_EXACT +

Returns :

TRUE if the comparison succeeds, FALSE if it does not +
+
+
+
+

nm_setting_enumerate_values ()

+
void                nm_setting_enumerate_values         (NMSetting *setting,
+                                                         NMSettingValueIterFn func,
+                                                         gpointer user_data);
+

+Iterates over each property of the NMSetting object, calling the supplied +user function for each property. +

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

setting :

the NMSetting +

func :

user-supplied function called for each property of the setting +

user_data :

user data passed to func at each invocation +
+
+
+
+

nm_setting_to_string ()

+
char *              nm_setting_to_string                (NMSetting *setting);
+

+Convert the setting into a string. For debugging purposes ONLY, should NOT +be used for serialization of the setting, or machine-parsed in any way. The +output format is not guaranteed to be stable and may change at any time. +

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

setting :

the NMSetting +

Returns :

an allocated string containing a textual representation of the +setting's properties and values (including secrets!), which the caller should +free with g_free() +
+
+
+
+

nm_setting_clear_secrets ()

+
void                nm_setting_clear_secrets            (NMSetting *setting);
+

+Resets and clears any secrets in the setting. Secrets should be added to the +setting only when needed, and cleared immediately after use to prevent +leakage of information. +

+
++ + + + +

setting :

the NMSetting +
+
+
+
+

nm_setting_need_secrets ()

+
GPtrArray *         nm_setting_need_secrets             (NMSetting *setting);
+

+Returns an array of property names for each secret which may be required +to make a successful connection. The returned hints are only intended as a +guide to what secrets may be required, because in some circumstances, there +is no way to conclusively determine exactly which secrets are needed. +

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

setting :

the NMSetting +

Returns :

a GPtrArray containing the property names of secrets of the +NMSetting which may be required; the caller owns the array +and must free the each array element with g_free(), as well as the array +itself with g_ptr_array_free() +
+
+
+
+

nm_setting_update_secrets ()

+
gboolean            nm_setting_update_secrets           (NMSetting *setting,
+                                                         GHashTable *secrets,
+                                                         GError **error);
+

+Update the setting's secrets, given a hash table of secrets intended for that +setting (deserialized from D-Bus for example). +

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

setting :

the NMSetting +

secrets :

a GHashTable mapping string:GValue of setting property names and +secrets +

error :

location to store error, or NULL +

Returns :

TRUE if the secrets were successfully updated and the connection +is valid, FALSE on failure or if the setting was never added to the connection +
+
+
+
+

Property Details

+
+

The "name" property

+
  "name"                     gchar*                : Read / Write
+

+The setting's name, which uniquely identifies the setting within the +connection. Each setting type has a name unique to that type, for +example 'ppp' or 'wireless' or 'wired'. +

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSetting8021x.html b/docs/libnm-util/html/NMSetting8021x.html new file mode 100644 index 00000000..99739eb8 --- /dev/null +++ b/docs/libnm-util/html/NMSetting8021x.html @@ -0,0 +1,2835 @@ + + + + +NMSetting8021x + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSetting8021x

+

NMSetting8021x — Describes 802.1x-authenticated connection properties

+
+
+

Synopsis

+
+#include <nm-setting-8021x.h>
+
+enum                NMSetting8021xCKFormat;
+enum                NMSetting8021xCKScheme;
+#define             NM_SETTING_802_1X_SETTING_NAME
+enum                NMSetting8021xError;
+#define             NM_TYPE_SETTING_802_1X_ERROR
+#define             NM_SETTING_802_1X_ERROR
+GQuark              nm_setting_802_1x_error_quark       (void);
+#define             NM_SETTING_802_1X_EAP
+#define             NM_SETTING_802_1X_IDENTITY
+#define             NM_SETTING_802_1X_ANONYMOUS_IDENTITY
+#define             NM_SETTING_802_1X_CA_CERT
+#define             NM_SETTING_802_1X_CA_PATH
+#define             NM_SETTING_802_1X_CLIENT_CERT
+#define             NM_SETTING_802_1X_PHASE1_PEAPVER
+#define             NM_SETTING_802_1X_PHASE1_PEAPLABEL
+#define             NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING
+#define             NM_SETTING_802_1X_PHASE2_AUTH
+#define             NM_SETTING_802_1X_PHASE2_AUTHEAP
+#define             NM_SETTING_802_1X_PHASE2_CA_CERT
+#define             NM_SETTING_802_1X_PHASE2_CA_PATH
+#define             NM_SETTING_802_1X_PHASE2_CLIENT_CERT
+#define             NM_SETTING_802_1X_PASSWORD
+#define             NM_SETTING_802_1X_PRIVATE_KEY
+#define             NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD
+#define             NM_SETTING_802_1X_PHASE2_PRIVATE_KEY
+#define             NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD
+#define             NM_SETTING_802_1X_PIN
+#define             NM_SETTING_802_1X_PSK
+#define             NM_SETTING_802_1X_SYSTEM_CA_CERTS
+                    NMSetting8021x;
+                    NMSetting8021xClass;
+GType               nm_setting_802_1x_get_type          (void);
+NMSetting *         nm_setting_802_1x_new               (void);
+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);
+void                nm_setting_802_1x_remove_eap_method (NMSetting8021x *setting,
+                                                         guint32 i);
+void                nm_setting_802_1x_clear_eap_methods (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_identity      (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_anonymous_identity
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_get_system_ca_certs
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_ca_path       (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_phase2_ca_path
+                                                        (NMSetting8021x *setting);
+NMSetting8021xCKScheme  nm_setting_802_1x_get_ca_cert_scheme
+                                                        (NMSetting8021x *setting);
+const GByteArray *  nm_setting_802_1x_get_ca_cert_blob  (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_ca_cert_path  (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_ca_cert       (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+NMSetting8021xCKScheme  nm_setting_802_1x_get_client_cert_scheme
+                                                        (NMSetting8021x *setting);
+const GByteArray *  nm_setting_802_1x_get_client_cert_blob
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_client_cert_path
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_client_cert   (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+const char *        nm_setting_802_1x_get_phase1_peapver
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_phase1_peaplabel
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_phase1_fast_provisioning
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_phase2_auth   (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_phase2_autheap
+                                                        (NMSetting8021x *setting);
+NMSetting8021xCKScheme  nm_setting_802_1x_get_phase2_ca_cert_scheme
+                                                        (NMSetting8021x *setting);
+const GByteArray *  nm_setting_802_1x_get_phase2_ca_cert_blob
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_phase2_ca_cert_path
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_phase2_ca_cert
+                                                        (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+NMSetting8021xCKScheme  nm_setting_802_1x_get_phase2_client_cert_scheme
+                                                        (NMSetting8021x *setting);
+const GByteArray *  nm_setting_802_1x_get_phase2_client_cert_blob
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_phase2_client_cert_path
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_phase2_client_cert
+                                                        (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+const char *        nm_setting_802_1x_get_password      (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_pin           (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_psk           (NMSetting8021x *setting);
+NMSetting8021xCKScheme  nm_setting_802_1x_get_private_key_scheme
+                                                        (NMSetting8021x *setting);
+const GByteArray *  nm_setting_802_1x_get_private_key_blob
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_private_key_path
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_private_key   (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         const char *password,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+const char *        nm_setting_802_1x_get_private_key_password
+                                                        (NMSetting8021x *setting);
+NMSetting8021xCKFormat  nm_setting_802_1x_get_private_key_format
+                                                        (NMSetting8021x *setting);
+NMSetting8021xCKScheme  nm_setting_802_1x_get_phase2_private_key_scheme
+                                                        (NMSetting8021x *setting);
+const GByteArray *  nm_setting_802_1x_get_phase2_private_key_blob
+                                                        (NMSetting8021x *setting);
+const char *        nm_setting_802_1x_get_phase2_private_key_path
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_phase2_private_key
+                                                        (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         const char *password,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+const char *        nm_setting_802_1x_get_phase2_private_key_password
+                                                        (NMSetting8021x *setting);
+NMSetting8021xCKFormat  nm_setting_802_1x_get_phase2_private_key_format
+                                                        (NMSetting8021x *setting);
+enum                NMSetting8021xCKType;
+const GByteArray *  nm_setting_802_1x_get_ca_cert       (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_ca_cert_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+const GByteArray *  nm_setting_802_1x_get_client_cert   (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_client_cert_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+const GByteArray *  nm_setting_802_1x_get_phase2_ca_cert
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_phase2_ca_cert_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+const GByteArray *  nm_setting_802_1x_get_phase2_client_cert
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_phase2_client_cert_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+const GByteArray *  nm_setting_802_1x_get_private_key   (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_private_key_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         const char *password,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+NMSetting8021xCKType  nm_setting_802_1x_get_private_key_type
+                                                        (NMSetting8021x *setting);
+const GByteArray *  nm_setting_802_1x_get_phase2_private_key
+                                                        (NMSetting8021x *setting);
+gboolean            nm_setting_802_1x_set_phase2_private_key_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         const char *password,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+NMSetting8021xCKType  nm_setting_802_1x_get_phase2_private_key_type
+                                                        (NMSetting8021x *setting);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSetting8021x
+
+
+
+

Properties

+
+  "anonymous-identity"       gchar*                : Read / Write
+  "ca-cert"                  GArray_guchar_*       : Read / Write
+  "ca-path"                  gchar*                : Read / Write
+  "client-cert"              GArray_guchar_*       : Read / Write
+  "eap"                      GSList_gchararray_*   : Read / Write
+  "identity"                 gchar*                : Read / Write
+  "password"                 gchar*                : Read / Write
+  "phase1-fast-provisioning" gchar*                : Read / Write
+  "phase1-peaplabel"         gchar*                : Read / Write
+  "phase1-peapver"           gchar*                : Read / Write
+  "phase2-auth"              gchar*                : Read / Write
+  "phase2-autheap"           gchar*                : Read / Write
+  "phase2-ca-cert"           GArray_guchar_*       : Read / Write
+  "phase2-ca-path"           gchar*                : Read / Write
+  "phase2-client-cert"       GArray_guchar_*       : Read / Write
+  "phase2-private-key"       GArray_guchar_*       : Read / Write
+  "phase2-private-key-password" gchar*                : Read / Write
+  "private-key"              GArray_guchar_*       : Read / Write
+  "private-key-password"     gchar*                : Read / Write
+  "system-ca-certs"          gboolean              : Read / Write / Construct
+
+
+
+

Description

+

+The NMSetting8021x object is a NMSetting subclass that describes +properties necessary for connection to 802.1x-authenticated networks, such as +WPA and WPA2 Enterprise WiFi networks and wired 802.1x networks. 802.1x +connections typically use certificates and/or EAP authentication methods to +securely verify, identify, and authenticate the client to the network itself, +instead of simply relying on a widely shared static key. +

+

+It's a good idea to read up on wpa_supplicant configuration before using this +setting extensively, since most of the options here correspond closely with +the relevant wpa_supplicant configuration options. +

+

+Furthermore, to get a good idea of 802.1x, EAP, TLS, TTLS, etc and their +applications to WiFi and wired networks, you'll want to get copies of the +following books. +

+

+ 802.11 Wireless Networks: The Definitive Guide, Second Edition + Author: Matthew Gast + ISBN: 978-0596100520 +

+

+ Cisco Wireless LAN Security + Authors: Krishna Sankar, Sri Sundaralingam, Darrin Miller, and Andrew Balinsky + ISBN: 978-1587051548 +

+
+
+

Details

+
+

enum NMSetting8021xCKFormat

+
typedef enum {
+	NM_SETTING_802_1X_CK_FORMAT_UNKNOWN = 0,
+	NM_SETTING_802_1X_CK_FORMAT_X509,
+	NM_SETTING_802_1X_CK_FORMAT_RAW_KEY,
+	NM_SETTING_802_1X_CK_FORMAT_PKCS12
+} NMSetting8021xCKFormat;
+
+

+

+
+
+
+

enum NMSetting8021xCKScheme

+
typedef enum {
+	NM_SETTING_802_1X_CK_SCHEME_UNKNOWN = 0,
+	NM_SETTING_802_1X_CK_SCHEME_BLOB,
+	NM_SETTING_802_1X_CK_SCHEME_PATH
+} NMSetting8021xCKScheme;
+
+

+

+
+
+
+

NM_SETTING_802_1X_SETTING_NAME

+
#define NM_SETTING_802_1X_SETTING_NAME "802-1x"
+
+

+

+
+
+
+

enum NMSetting8021xError

+
typedef enum
+{
+	NM_SETTING_802_1X_ERROR_UNKNOWN = 0,
+	NM_SETTING_802_1X_ERROR_INVALID_PROPERTY,
+	NM_SETTING_802_1X_ERROR_MISSING_PROPERTY
+} NMSetting8021xError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_802_1X_ERROR

+
#define NM_TYPE_SETTING_802_1X_ERROR (nm_setting_802_1x_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_802_1X_ERROR

+
#define NM_SETTING_802_1X_ERROR nm_setting_802_1x_error_quark ()
+
+

+

+
+
+
+

nm_setting_802_1x_error_quark ()

+
GQuark              nm_setting_802_1x_error_quark       (void);
+

+Registers an error quark for NMSetting8021x if necessary. +

+
++ + + + +

Returns :

the error quark used for NMSetting8021x errors. +
+
+
+
+

NM_SETTING_802_1X_EAP

+
#define NM_SETTING_802_1X_EAP "eap"
+
+

+

+
+
+
+

NM_SETTING_802_1X_IDENTITY

+
#define NM_SETTING_802_1X_IDENTITY "identity"
+
+

+

+
+
+
+

NM_SETTING_802_1X_ANONYMOUS_IDENTITY

+
#define NM_SETTING_802_1X_ANONYMOUS_IDENTITY "anonymous-identity"
+
+

+

+
+
+
+

NM_SETTING_802_1X_CA_CERT

+
#define NM_SETTING_802_1X_CA_CERT "ca-cert"
+
+

+

+
+
+
+

NM_SETTING_802_1X_CA_PATH

+
#define NM_SETTING_802_1X_CA_PATH "ca-path"
+
+

+

+
+
+
+

NM_SETTING_802_1X_CLIENT_CERT

+
#define NM_SETTING_802_1X_CLIENT_CERT "client-cert"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE1_PEAPVER

+
#define NM_SETTING_802_1X_PHASE1_PEAPVER "phase1-peapver"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE1_PEAPLABEL

+
#define NM_SETTING_802_1X_PHASE1_PEAPLABEL "phase1-peaplabel"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING

+
#define NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING "phase1-fast-provisioning"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE2_AUTH

+
#define NM_SETTING_802_1X_PHASE2_AUTH "phase2-auth"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE2_AUTHEAP

+
#define NM_SETTING_802_1X_PHASE2_AUTHEAP "phase2-autheap"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE2_CA_CERT

+
#define NM_SETTING_802_1X_PHASE2_CA_CERT "phase2-ca-cert"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE2_CA_PATH

+
#define NM_SETTING_802_1X_PHASE2_CA_PATH "phase2-ca-path"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE2_CLIENT_CERT

+
#define NM_SETTING_802_1X_PHASE2_CLIENT_CERT "phase2-client-cert"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PASSWORD

+
#define NM_SETTING_802_1X_PASSWORD "password"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PRIVATE_KEY

+
#define NM_SETTING_802_1X_PRIVATE_KEY "private-key"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD

+
#define NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD "private-key-password"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE2_PRIVATE_KEY

+
#define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY "phase2-private-key"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD

+
#define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD "phase2-private-key-password"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PIN

+
#define NM_SETTING_802_1X_PIN "pin"
+
+

+

+
+
+
+

NM_SETTING_802_1X_PSK

+
#define NM_SETTING_802_1X_PSK "psk"
+
+

+

+
+
+
+

NM_SETTING_802_1X_SYSTEM_CA_CERTS

+
#define NM_SETTING_802_1X_SYSTEM_CA_CERTS "system-ca-certs"
+
+

+

+
+
+
+

NMSetting8021x

+
typedef struct _NMSetting8021x NMSetting8021x;
+

+

+
+
+
+

NMSetting8021xClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSetting8021xClass;
+
+

+

+
+
+
+

nm_setting_802_1x_get_type ()

+
GType               nm_setting_802_1x_get_type          (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_802_1x_new ()

+
NMSetting *         nm_setting_802_1x_new               (void);
+

+Creates a new NMSetting8021x object with default values. +

+
++ + + + +

Returns :

the new empty NMSetting8021x object +
+
+
+
+

nm_setting_802_1x_get_num_eap_methods ()

+
guint32             nm_setting_802_1x_get_num_eap_methods
+                                                        (NMSetting8021x *setting);
+

+Returns the number of eap methods allowed for use when connecting to the +network. Generally only one EAP method is used. Use the functions +nm_setting_802_1x_get_eap_method(), nm_setting_802_1x_add_eap_method(), +and nm_setting_802_1x_remove_eap_method() for adding, removing, and retrieving +allowed EAP methods. +

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

setting :

the NMSetting8021x +

Returns :

the number of allowed EAP methods +
+
+
+
+

nm_setting_802_1x_get_eap_method ()

+
const char *        nm_setting_802_1x_get_eap_method    (NMSetting8021x *setting,
+                                                         guint32 i);
+

+Returns the name of the allowed EAP method at index i. +

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

setting :

the NMSetting8021x +

i :

the index of the EAP method name to return +

Returns :

the name of the allowed EAP method at index i +
+
+
+
+

nm_setting_802_1x_add_eap_method ()

+
gboolean            nm_setting_802_1x_add_eap_method    (NMSetting8021x *setting,
+                                                         const char *eap);
+

+Adds an allowed EAP method. The setting is not valid until at least one +EAP method has been added. See "eap" property for a list of +allowed EAP methods. +

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

setting :

the NMSetting8021x +

eap :

the name of the EAP method to allow for this connection +

Returns :

TRUE if the EAP method was successfully added, FALSE if it was + not a valid method or if it was already allowed. +
+
+
+
+

nm_setting_802_1x_remove_eap_method ()

+
void                nm_setting_802_1x_remove_eap_method (NMSetting8021x *setting,
+                                                         guint32 i);
+

+Removes the allowed EAP method at the specified index. +

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

setting :

the NMSetting8021x +

i :

the index of the EAP method to remove +
+
+
+
+

nm_setting_802_1x_clear_eap_methods ()

+
void                nm_setting_802_1x_clear_eap_methods (NMSetting8021x *setting);
+

+Clears all allowed EAP methods. +

+
++ + + + +

setting :

the NMSetting8021x +
+
+
+
+

nm_setting_802_1x_get_identity ()

+
const char *        nm_setting_802_1x_get_identity      (NMSetting8021x *setting);
+

+Returns the identifier used by some EAP methods (like TLS) to +authenticate the user. Often this is a username or login name. +

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

setting :

the NMSetting8021x +

Returns :

the user identifier +
+
+
+
+

nm_setting_802_1x_get_anonymous_identity ()

+
const char *        nm_setting_802_1x_get_anonymous_identity
+                                                        (NMSetting8021x *setting);
+

+Returns the anonymous identifier used by some EAP methods (like TTLS) to +authenticate the user in the outer unencrypted "phase 1" authentication. The +inner "phase 2" authentication will use the "identity" in +a secure form, if applicable for that EAP method. +

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

setting :

the NMSetting8021x +

Returns :

the anonymous identifier +
+
+
+
+

nm_setting_802_1x_get_system_ca_certs ()

+
gboolean            nm_setting_802_1x_get_system_ca_certs
+                                                        (NMSetting8021x *setting);
+

+Sets the "system-ca-certs" property. The +"ca-path" and "phase2-ca-path" +properties are ignored if the "system-ca-certs" property is +TRUE, in which case a system-wide CA certificate directory specified at +compile time (using the --system-ca-path configure option) is used in place +of these properties. +

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

setting :

the NMSetting8021x +

Returns :

TRUE if a system CA certificate path should be used, FALSE if not +
+
+
+
+

nm_setting_802_1x_get_ca_path ()

+
const char *        nm_setting_802_1x_get_ca_path       (NMSetting8021x *setting);
+

+Returns the path of the CA certificate directory if previously set. Systems +will often have a directory that contains multiple individual CA certificates +which the supplicant can then add to the verification chain. This may be +used in addition to the "ca-cert" property to add more CA +certificates for verifying the network to client. +

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

setting :

the NMSetting8021x +

Returns :

the CA certificate directory path +
+
+
+
+

nm_setting_802_1x_get_phase2_ca_path ()

+
const char *        nm_setting_802_1x_get_phase2_ca_path
+                                                        (NMSetting8021x *setting);
+

+Returns the path of the "phase 2" CA certificate directory if previously set. +Systems will often have a directory that contains multiple individual CA +certificates which the supplicant can then add to the verification chain. +This may be used in addition to the "phase2-ca-cert" property +to add more CA certificates for verifying the network to client. +

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

setting :

the NMSetting8021x +

Returns :

the "phase 2" CA certificate directory path +
+
+
+
+

nm_setting_802_1x_get_ca_cert_scheme ()

+
NMSetting8021xCKScheme  nm_setting_802_1x_get_ca_cert_scheme
+                                                        (NMSetting8021x *setting);
+

+Returns the scheme used to store the CA certificate. If the returned scheme +is NM_SETTING_802_1X_CK_SCHEME_BLOB, use nm_setting_802_1x_get_ca_cert_blob(); +if NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_ca_cert_path(). +

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

setting :

the NMSetting8021x +

Returns :

scheme used to store the CA certificate (blob or path) +
+
+
+
+

nm_setting_802_1x_get_ca_cert_blob ()

+
const GByteArray *  nm_setting_802_1x_get_ca_cert_blob  (NMSetting8021x *setting);
+

+Returns the CA certificate blob if the CA certificate is stored using the +NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. Not all EAP methods use a +CA certificate (LEAP for example), and those that can take advantage of the +CA certificate allow it to be unset. Note that lack of a CA certificate +reduces security by allowing man-in-the-middle attacks, because the identity +of the network cannot be confirmed by the client. +

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

setting :

the NMSetting8021x +

Returns :

the CA certificate data +
+
+
+
+

nm_setting_802_1x_get_ca_cert_path ()

+
const char *        nm_setting_802_1x_get_ca_cert_path  (NMSetting8021x *setting);
+

+Returns the CA certificate path if the CA certificate is stored using the +NM_SETTING_802_1X_CK_SCHEME_PATH scheme. Not all EAP methods use a +CA certificate (LEAP for example), and those that can take advantage of the +CA certificate allow it to be unset. Note that lack of a CA certificate +reduces security by allowing man-in-the-middle attacks, because the identity +of the network cannot be confirmed by the client. +

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

setting :

the NMSetting8021x +

Returns :

path to the CA certificate file +
+
+
+
+

nm_setting_802_1x_set_ca_cert ()

+
gboolean            nm_setting_802_1x_set_ca_cert       (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+

+Reads a certificate from disk and sets the "ca-cert" property +with the raw certificate data if using the NM_SETTING_802_1X_CK_SCHEME_BLOB +scheme, or with the path to the certificate file if using the +NM_SETTING_802_1X_CK_SCHEME_PATH scheme. +

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

setting :

the NMSetting8021x +

value :

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 CA certificate file + (PEM or DER format). The path must be UTF-8 encoded; use + g_filename_to_utf8() to convert if needed. Passing NULL with any scheme + clears the CA certificate. +

scheme :

desired storage scheme for the certificate +

out_format :

on successful return, the type of the certificate added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_client_cert_scheme ()

+
NMSetting8021xCKScheme  nm_setting_802_1x_get_client_cert_scheme
+                                                        (NMSetting8021x *setting);
+

+Returns the scheme used to store the client certificate. If the returned scheme +is NM_SETTING_802_1X_CK_SCHEME_BLOB, use nm_setting_802_1x_get_client_cert_blob(); +if NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_client_cert_path(). +

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

setting :

the NMSetting8021x +

Returns :

scheme used to store the client certificate (blob or path) +
+
+
+
+

nm_setting_802_1x_get_client_cert_blob ()

+
const GByteArray *  nm_setting_802_1x_get_client_cert_blob
+                                                        (NMSetting8021x *setting);
+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

the client certificate data +
+
+
+
+

nm_setting_802_1x_get_client_cert_path ()

+
const char *        nm_setting_802_1x_get_client_cert_path
+                                                        (NMSetting8021x *setting);
+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

path to the client certificate file +
+
+
+
+

nm_setting_802_1x_set_client_cert ()

+
gboolean            nm_setting_802_1x_set_client_cert   (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+

+Reads a certificate from disk and sets the "client-cert" +property with the raw certificate data if using the +NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the certificate +file if using the NM_SETTING_802_1X_CK_SCHEME_PATH scheme. +

+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

value :

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 PKCS12 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 +

out_format :

on successful return, the type of the certificate added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_phase1_peapver ()

+
const char *        nm_setting_802_1x_get_phase1_peapver
+                                                        (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the "phase 1" PEAP version to be used when authenticating with + EAP-PEAP as contained in the "phase1-peapver" property. Valid + values are NULL (unset), "0" (PEAP version 0), and "1" (PEAP version 1). +
+
+
+
+

nm_setting_802_1x_get_phase1_peaplabel ()

+
const char *        nm_setting_802_1x_get_phase1_peaplabel
+                                                        (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

whether the "phase 1" PEAP label is new-style or old-style, to be + used when authenticating with EAP-PEAP, as contained in the + "phase1-peaplabel" property. Valid values are NULL (unset), + "0" (use old-style label), and "1" (use new-style label). See the + wpa_supplicant documentation for more details. +
+
+
+
+

nm_setting_802_1x_get_phase1_fast_provisioning ()

+
const char *        nm_setting_802_1x_get_phase1_fast_provisioning
+                                                        (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

whether "phase 1" PEAP fast provisioning should be used, as specified + by the "phase1-fast-provisioning" property. See the + wpa_supplicant documentation for more details. +
+
+
+
+

nm_setting_802_1x_get_phase2_auth ()

+
const char *        nm_setting_802_1x_get_phase2_auth   (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the "phase 2" non-EAP (ex MD5) allowed authentication method as + specified by the "phase2-auth" property. +
+
+
+
+

nm_setting_802_1x_get_phase2_autheap ()

+
const char *        nm_setting_802_1x_get_phase2_autheap
+                                                        (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the "phase 2" EAP-based (ex TLS) allowed authentication method as + specified by the "phase2-autheap" property. +
+
+
+
+

nm_setting_802_1x_get_phase2_ca_cert_scheme ()

+
NMSetting8021xCKScheme  nm_setting_802_1x_get_phase2_ca_cert_scheme
+                                                        (NMSetting8021x *setting);
+

+Returns the scheme used to store the "phase 2" CA certificate. If the +returned scheme is NM_SETTING_802_1X_CK_SCHEME_BLOB, use +nm_setting_802_1x_get_ca_cert_blob(); if NM_SETTING_802_1X_CK_SCHEME_PATH, +use nm_setting_802_1x_get_ca_cert_path(). +

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

setting :

the NMSetting8021x +

Returns :

scheme used to store the "phase 2" CA certificate (blob or path) +
+
+
+
+

nm_setting_802_1x_get_phase2_ca_cert_blob ()

+
const GByteArray *  nm_setting_802_1x_get_phase2_ca_cert_blob
+                                                        (NMSetting8021x *setting);
+

+Returns the "phase 2" CA certificate blob if the CA certificate is stored +using the NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. Not all EAP methods use +a CA certificate (LEAP for example), and those that can take advantage of the +CA certificate allow it to be unset. Note that lack of a CA certificate +reduces security by allowing man-in-the-middle attacks, because the identity +of the network cannot be confirmed by the client. +

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

setting :

the NMSetting8021x +

Returns :

the "phase 2" CA certificate data +
+
+
+
+

nm_setting_802_1x_get_phase2_ca_cert_path ()

+
const char *        nm_setting_802_1x_get_phase2_ca_cert_path
+                                                        (NMSetting8021x *setting);
+

+Returns the "phase 2" CA certificate path if the CA certificate is stored +using the NM_SETTING_802_1X_CK_SCHEME_PATH scheme. Not all EAP methods use +a CA certificate (LEAP for example), and those that can take advantage of the +CA certificate allow it to be unset. Note that lack of a CA certificate +reduces security by allowing man-in-the-middle attacks, because the identity +of the network cannot be confirmed by the client. +

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

setting :

the NMSetting8021x +

Returns :

path to the "phase 2" CA certificate file +
+
+
+
+

nm_setting_802_1x_set_phase2_ca_cert ()

+
gboolean            nm_setting_802_1x_set_phase2_ca_cert
+                                                        (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+

+Reads a certificate from disk and sets the "phase2-ca-cert" +property with the raw certificate data if using the +NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the certificate +file if using the NM_SETTING_802_1X_CK_SCHEME_PATH scheme. +

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

setting :

the NMSetting8021x +

value :

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" CA + certificate file (PEM or DER 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" CA certificate. +

scheme :

desired storage scheme for the certificate +

out_format :

on successful return, the type of the certificate added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_phase2_client_cert_scheme ()

+
NMSetting8021xCKScheme  nm_setting_802_1x_get_phase2_client_cert_scheme
+                                                        (NMSetting8021x *setting);
+

+Returns the scheme used to store the "phase 2" client certificate. If the +returned scheme is NM_SETTING_802_1X_CK_SCHEME_BLOB, use +nm_setting_802_1x_get_client_cert_blob(); if +NM_SETTING_802_1X_CK_SCHEME_PATH, use +nm_setting_802_1x_get_client_cert_path(). +

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

setting :

the NMSetting8021x +

Returns :

scheme used to store the "phase 2" client certificate (blob or path) +
+
+
+
+

nm_setting_802_1x_get_phase2_client_cert_blob ()

+
const GByteArray *  nm_setting_802_1x_get_phase2_client_cert_blob
+                                                        (NMSetting8021x *setting);
+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

the "phase 2" client certificate data +
+
+
+
+

nm_setting_802_1x_get_phase2_client_cert_path ()

+
const char *        nm_setting_802_1x_get_phase2_client_cert_path
+                                                        (NMSetting8021x *setting);
+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

path to the "phase 2" client certificate file +
+
+
+
+

nm_setting_802_1x_set_phase2_client_cert ()

+
gboolean            nm_setting_802_1x_set_phase2_client_cert
+                                                        (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+

+Reads a certificate from disk and sets the "phase2-client-cert" +property with the raw certificate data if using the +NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the certificate +file if using the NM_SETTING_802_1X_CK_SCHEME_PATH scheme. +

+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

value :

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 PKCS12 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 +

out_format :

on successful return, the type of the certificate added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_password ()

+
const char *        nm_setting_802_1x_get_password      (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the password used by the authentication method, if any, as specified + by the "password" property +
+
+
+
+

nm_setting_802_1x_get_pin ()

+
const char *        nm_setting_802_1x_get_pin           (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the PIN used by the authentication method, if any, as specified + by the "pin" property +
+
+
+
+

nm_setting_802_1x_get_psk ()

+
const char *        nm_setting_802_1x_get_psk           (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the Pre-Shared-Key used by the authentication method, if any, as + specified by the "psk" property +
+
+
+
+

nm_setting_802_1x_get_private_key_scheme ()

+
NMSetting8021xCKScheme  nm_setting_802_1x_get_private_key_scheme
+                                                        (NMSetting8021x *setting);
+

+Returns the scheme used to store the private key. If the returned scheme is +NM_SETTING_802_1X_CK_SCHEME_BLOB, use +nm_setting_802_1x_get_client_cert_blob(); if +NM_SETTING_802_1X_CK_SCHEME_PATH, use +nm_setting_802_1x_get_client_cert_path(). +

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

setting :

the NMSetting8021x +

Returns :

scheme used to store the private key (blob or path) +
+
+
+
+

nm_setting_802_1x_get_private_key_blob ()

+
const GByteArray *  nm_setting_802_1x_get_private_key_blob
+                                                        (NMSetting8021x *setting);
+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

the private key data +
+
+
+
+

nm_setting_802_1x_get_private_key_path ()

+
const char *        nm_setting_802_1x_get_private_key_path
+                                                        (NMSetting8021x *setting);
+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

path to the private key file +
+
+
+
+

nm_setting_802_1x_set_private_key ()

+
gboolean            nm_setting_802_1x_set_private_key   (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         const char *password,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+

+Reads a private key from disk and sets the "private-key" +property with the raw private key data if using the +NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the private key +file if using the NM_SETTING_802_1X_CK_SCHEME_PATH scheme. +

+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

value :

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 PKCS12 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 +

scheme :

desired storage scheme for the private key +

out_format :

on successful return, the type of the private key added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_private_key_password ()

+
const char *        nm_setting_802_1x_get_private_key_password
+                                                        (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the private key password used to decrypt the private key if + previously set with nm_setting_802_1x_set_private_key_from_file(), + nm_setting_802_1x_set_private_key_path(), or the + "private-key-password" property. +
+
+
+
+

nm_setting_802_1x_get_private_key_format ()

+
NMSetting8021xCKFormat  nm_setting_802_1x_get_private_key_format
+                                                        (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the data format of the private key data stored in the + "private-key" property +
+
+
+
+

nm_setting_802_1x_get_phase2_private_key_scheme ()

+
NMSetting8021xCKScheme  nm_setting_802_1x_get_phase2_private_key_scheme
+                                                        (NMSetting8021x *setting);
+

+Returns the scheme used to store the "phase 2" private key. If the returned +scheme is NM_SETTING_802_1X_CK_SCHEME_BLOB, use +nm_setting_802_1x_get_client_cert_blob(); if +NM_SETTING_802_1X_CK_SCHEME_PATH, use +nm_setting_802_1x_get_client_cert_path(). +

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

setting :

the NMSetting8021x +

Returns :

scheme used to store the "phase 2" private key (blob or path) +
+
+
+
+

nm_setting_802_1x_get_phase2_private_key_blob ()

+
const GByteArray *  nm_setting_802_1x_get_phase2_private_key_blob
+                                                        (NMSetting8021x *setting);
+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

the "phase 2" private key data +
+
+
+
+

nm_setting_802_1x_get_phase2_private_key_path ()

+
const char *        nm_setting_802_1x_get_phase2_private_key_path
+                                                        (NMSetting8021x *setting);
+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

path to the "phase 2" private key file +
+
+
+
+

nm_setting_802_1x_set_phase2_private_key ()

+
gboolean            nm_setting_802_1x_set_phase2_private_key
+                                                        (NMSetting8021x *setting,
+                                                         const char *value,
+                                                         const char *password,
+                                                         NMSetting8021xCKScheme scheme,
+                                                         NMSetting8021xCKFormat *out_format,
+                                                         GError **error);
+

+Reads a "phase 2" private key from disk and sets the +"phase2-private-key" property with the raw private key data if +using the NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the +private key file if using the NM_SETTING_802_1X_CK_SCHEME_PATH scheme. +

+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

value :

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 PKCS12 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" private key. +

password :

password used to decrypt the private key +

scheme :

desired storage scheme for the private key +

out_format :

on successful return, the type of the private key added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_phase2_private_key_password ()

+
const char *        nm_setting_802_1x_get_phase2_private_key_password
+                                                        (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the private key password used to decrypt the private key if + previously set with nm_setting_802_1x_set_phase2_private_key_from_file(), + nm_setting_802_1x_set_phase2_private_key_path(), or the + "phase2-private-key-password" property. +
+
+
+
+

nm_setting_802_1x_get_phase2_private_key_format ()

+
NMSetting8021xCKFormat  nm_setting_802_1x_get_phase2_private_key_format
+                                                        (NMSetting8021x *setting);
+
++ + + + + + + + + + +

setting :

the NMSetting8021x +

Returns :

the data format of the "phase 2" private key data stored in the + "phase2-private-key" property +
+
+
+
+

enum NMSetting8021xCKType

+
typedef enum {
+	NM_SETTING_802_1X_CK_TYPE_UNKNOWN = 0,
+	NM_SETTING_802_1X_CK_TYPE_X509,
+	NM_SETTING_802_1X_CK_TYPE_RAW_KEY,
+	NM_SETTING_802_1X_CK_TYPE_PKCS12
+} NMSetting8021xCKType;
+
+

+

+
+
+
+

nm_setting_802_1x_get_ca_cert ()

+
const GByteArray *  nm_setting_802_1x_get_ca_cert       (NMSetting8021x *setting);
+
+

Warning

+

nm_setting_802_1x_get_ca_cert has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_get_ca_cert_blob().

+
+

+Returns the CA certificate blob if the CA certificate is stored using the +NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. Not all EAP methods use a +CA certificate (LEAP for example), and those that can take advantage of the +CA certificate allow it to be unset. Note that lack of a CA certificate +reduces security by allowing man-in-the-middle attacks, because the identity +of the network cannot be confirmed by the client. +

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

setting :

the NMSetting8021x +

Returns :

the CA certificate data +
+
+
+
+

nm_setting_802_1x_set_ca_cert_from_file ()

+
gboolean            nm_setting_802_1x_set_ca_cert_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+
+

Warning

+

nm_setting_802_1x_set_ca_cert_from_file has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_set_ca_cert() with the + NM_SETTING_802_1X_CK_SCHEME_BLOB scheme.

+
+

+Reads a certificate from disk and sets the "ca-cert" property +with the raw certificate data using the NM_SETTING_802_1X_CK_SCHEME_BLOB +scheme. +

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

setting :

the NMSetting8021x +

filename :

the path of the CA certificate file (PEM or DER format). Passing + NULL clears the CA certificate. +

out_ck_type :

on successful return, the type of the certificate added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_client_cert ()

+
const GByteArray *  nm_setting_802_1x_get_client_cert   (NMSetting8021x *setting);
+
+

Warning

+

nm_setting_802_1x_get_client_cert has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_get_client_cert_blob().

+
+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

the client certificate data +
+
+
+
+

nm_setting_802_1x_set_client_cert_from_file ()

+
gboolean            nm_setting_802_1x_set_client_cert_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+
+

Warning

+

nm_setting_802_1x_set_client_cert_from_file has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_set_client_cert() with the + NM_SETTING_802_1X_CK_SCHEME_BLOB scheme.

+
+

+Reads a certificate from disk and sets the "client-cert" +property with the raw certificate data. +

+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

filename :

the path of the client certificate file (PEM, DER, or + PKCS12 format). Passing NULL clears the client certificate. +

out_ck_type :

on successful return, the type of the certificate added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_phase2_ca_cert ()

+
const GByteArray *  nm_setting_802_1x_get_phase2_ca_cert
+                                                        (NMSetting8021x *setting);
+
+

Warning

+

nm_setting_802_1x_get_phase2_ca_cert has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_get_phase2_ca_cert_blob().

+
+

+Returns the "phase 2" CA certificate blob. Not all EAP methods use +a CA certificate (LEAP for example), and those that can take advantage of the +CA certificate allow it to be unset. Note that lack of a CA certificate +reduces security by allowing man-in-the-middle attacks, because the identity +of the network cannot be confirmed by the client. +

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

setting :

the NMSetting8021x +

Returns :

the "phase 2" CA certificate data +
+
+
+
+

nm_setting_802_1x_set_phase2_ca_cert_from_file ()

+
gboolean            nm_setting_802_1x_set_phase2_ca_cert_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+
+

Warning

+

nm_setting_802_1x_set_phase2_ca_cert_from_file has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_set_phase2_ca_cert(). + with the NM_SETTING_802_1X_CK_SCHEME_BLOB scheme.

+
+

+Reads a certificate from disk and sets the "phase2-ca-cert" +property with the raw certificate data. +

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

setting :

the NMSetting8021x +

filename :

the path of the "phase2" CA certificate file (PEM or DER format). + Passing NULL with any scheme clears the "phase2" CA certificate. +

out_ck_type :

on successful return, the type of the certificate added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_phase2_client_cert ()

+
const GByteArray *  nm_setting_802_1x_get_phase2_client_cert
+                                                        (NMSetting8021x *setting);
+
+

Warning

+

nm_setting_802_1x_get_phase2_client_cert has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_get_phase2_client_cert_blob().

+
+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

the "phase 2" client certificate data +
+
+
+
+

nm_setting_802_1x_set_phase2_client_cert_from_file ()

+
gboolean            nm_setting_802_1x_set_phase2_client_cert_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+
+

Warning

+

nm_setting_802_1x_set_phase2_client_cert_from_file has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_set_phase2_client_cert() with the. + NM_SETTING_802_1X_CK_SCHEME_BLOB scheme.

+
+

+Reads a certificate from disk and sets the "phase2-client-cert" +property with the raw certificate data. +

+

+Client certificates are used to identify the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

filename :

pass the path of the "phase2" client certificate file (PEM, DER, + or PKCS12 format). Passing NULL clears the "phase2" client certificate. +

out_ck_type :

on successful return, the type of the certificate added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_private_key ()

+
const GByteArray *  nm_setting_802_1x_get_private_key   (NMSetting8021x *setting);
+
+

Warning

+

nm_setting_802_1x_get_private_key has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_get_private_key_blob().

+
+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

the private key data +
+
+
+
+

nm_setting_802_1x_set_private_key_from_file ()

+
gboolean            nm_setting_802_1x_set_private_key_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         const char *password,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+
+

Warning

+

nm_setting_802_1x_set_private_key_from_file has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_set_private_key() with. + the NM_SETTING_802_1X_CK_SCHEME_BLOB scheme.

+
+

+Reads a private key from disk and sets the "private-key" +property with the raw private key data. +

+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

filename :

the path of the private key file (PEM, DER, or PKCS12 format). + Passing NULL clears the private key. +

password :

password used to decrypt the private key +

out_ck_type :

on successful return, the type of the private key added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_private_key_type ()

+
NMSetting8021xCKType  nm_setting_802_1x_get_private_key_type
+                                                        (NMSetting8021x *setting);
+
+

Warning

+

nm_setting_802_1x_get_private_key_type has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_get_private_key_format().

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

setting :

the NMSetting8021x +

Returns :

the data format of the private key data stored in the + "private-key" property +
+
+
+
+

nm_setting_802_1x_get_phase2_private_key ()

+
const GByteArray *  nm_setting_802_1x_get_phase2_private_key
+                                                        (NMSetting8021x *setting);
+
+

Warning

+

nm_setting_802_1x_get_phase2_private_key has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_get_private_key_blob().

+
+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

Returns :

the "phase 2" private key data +
+
+
+
+

nm_setting_802_1x_set_phase2_private_key_from_file ()

+
gboolean            nm_setting_802_1x_set_phase2_private_key_from_file
+                                                        (NMSetting8021x *setting,
+                                                         const char *filename,
+                                                         const char *password,
+                                                         NMSetting8021xCKType *out_ck_type,
+                                                         GError **error);
+
+

Warning

+

nm_setting_802_1x_set_phase2_private_key_from_file has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_set_phase2_private_key() with + the NM_SETTING_802_1X_CK_SCHEME_BLOB scheme.

+
+

+Reads a "phase 2" private key from disk and sets the +"phase2-private-key" property with the raw private key data. +

+

+Private keys are used to authenticate the connecting client to the network +when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x +authentication method. +

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

setting :

the NMSetting8021x +

filename :

the path of the "phase2" private key file (PEM, DER, or PKCS12 + format). Passing NULL clears the "phase2" private key. +

password :

password used to decrypt the private key +

out_ck_type :

on successful return, the type of the private key added +

error :

on unsuccessful return, an error +

Returns :

TRUE if the operation succeeded, FALSE if it was unsuccessful +
+
+
+
+

nm_setting_802_1x_get_phase2_private_key_type ()

+
NMSetting8021xCKType  nm_setting_802_1x_get_phase2_private_key_type
+                                                        (NMSetting8021x *setting);
+
+

Warning

+

nm_setting_802_1x_get_phase2_private_key_type has been deprecated since version 0.8 and should not be used in newly-written code. This function has been deprecated and should + not be used in newly written code. Calling this function is + equivalent to calling nm_setting_802_1x_get_phase2_private_key_format().

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

setting :

the NMSetting8021x +

Returns :

the data format of the private key data stored in the + "phase2-private-key" property +
+
+
+
+

Property Details

+
+

The "anonymous-identity" property

+
  "anonymous-identity"       gchar*                : Read / Write
+

+Anonymous identity string for EAP authentication methods. Used as the +unencrypted identity with EAP types that support different tunneled +identity like EAP-TTLS. +

+

Default value: NULL

+
+
+
+

The "ca-cert" property

+
  "ca-cert"                  GArray_guchar_*       : Read / Write
+

+Contains the CA certificate if used by the EAP method specified in the +"eap" property. Setting this property directly is +discouraged; use the nm_setting_802_1x_set_ca_cert() function instead. +

+
+
+
+

The "ca-path" property

+
  "ca-path"                  gchar*                : Read / Write
+

+UTF-8 encoded path to a directory containing PEM or DER formatted +certificates to be added to the verification chain in addition to the +certificate specified in the "ca-cert" property. +

+

Default value: NULL

+
+
+
+

The "client-cert" property

+
  "client-cert"              GArray_guchar_*       : Read / Write
+

+Contains the client certificate if used by the EAP method specified in +the "eap" property. Setting this property directly is +discouraged; use the nm_setting_802_1x_set_client_cert() function instead. +

+
+
+
+

The "eap" property

+
  "eap"                      GSList_gchararray_*   : Read / Write
+

+The allowed EAP method to be used when authenticating to the network with +802.1x. Valid methods are: "leap", "md5", "tls", "peap", "ttls", and +"fast". Each method requires different configuration using the +properties of this object; refer to wpa_supplicant documentation for the +allowed combinations. +

+
+
+
+

The "identity" property

+
  "identity"                 gchar*                : Read / Write
+

+Identity string for EAP authentication methods. Often the user's +user or login name. +

+

Default value: NULL

+
+
+
+

The "password" property

+
  "password"                 gchar*                : Read / Write
+

+Password used for EAP authentication methods. +

+

Default value: NULL

+
+
+
+

The "phase1-fast-provisioning" property

+
  "phase1-fast-provisioning" gchar*                : Read / Write
+

+Enables or disables in-line provisioning of EAP-FAST credentials when +FAST is specified as the EAP method in the "eap" property. +Recognized values are "0" (disabled), "1" (allow unauthenticated +provisioning), "2" (allow authenticated provisioning), and "3" (allow +both authenticated and unauthenticated provisioning). See the +wpa_supplicant documentation for more details. +

+

Default value: NULL

+
+
+
+

The "phase1-peaplabel" property

+
  "phase1-peaplabel"         gchar*                : Read / Write
+

+Forces use of the new PEAP label during key derivation. Some RADIUS +servers may require forcing the new PEAP label to interoperate with +PEAPv1. Set to "1" to force use of the new PEAP label. See the +wpa_supplicant documentation for more details. +

+

Default value: NULL

+
+
+
+

The "phase1-peapver" property

+
  "phase1-peapver"           gchar*                : Read / Write
+

+Forces which PEAP version is used when PEAP is set as the EAP method in +the "eap" property. When unset, the version reported by +the server will be used. Sometimes when using older RADIUS servers, it +is necessary to force the client to use a particular PEAP version. To do +so, this property may be set to "0" or "1" to force that specific PEAP +version. +

+

Default value: NULL

+
+
+
+

The "phase2-auth" property

+
  "phase2-auth"              gchar*                : Read / Write
+

+Specifies the allowed "phase 2" inner non-EAP authentication methods when +an EAP method that uses an inner TLS tunnel is specified in the +"eap" property. Recognized non-EAP phase2 methods are +"pap", "chap", "mschap", "mschapv2", "gtc", "otp", "md5", and "tls". +Each 'phase 2' inner method requires specific parameters for successful +authentication; see the wpa_supplicant documentation for more details. +

+

Default value: NULL

+
+
+
+

The "phase2-autheap" property

+
  "phase2-autheap"           gchar*                : Read / Write
+

+Specifies the allowed "phase 2" inner EAP-based authentication methods +when an EAP method that uses an inner TLS tunnel is specified in the +"eap" property. Recognized EAP-based phase2 methods are +"md5", "mschapv2", "otp", "gtc", and "tls". Each 'phase 2' inner method +requires specific parameters for successful authentication; see the +wpa_supplicant documentation for more details. +

+

Default value: NULL

+
+
+
+

The "phase2-ca-cert" property

+
  "phase2-ca-cert"           GArray_guchar_*       : Read / Write
+

+Contains the CA certificate if used by the EAP method specified in the +"phase2-auth" or "phase2-autheap" properties. +Setting this property directly is discouraged; use the +nm_setting_802_1x_set_phase2_ca_cert() function instead. +

+
+
+
+

The "phase2-ca-path" property

+
  "phase2-ca-path"           gchar*                : Read / Write
+

+UTF-8 encoded path to a directory containing PEM or DER formatted +certificates to be added to the verification chain in addition to the +certificate specified in the "phase2-ca-cert" property. +

+

Default value: NULL

+
+
+
+

The "phase2-client-cert" property

+
  "phase2-client-cert"       GArray_guchar_*       : Read / Write
+

+Contains the client certificate if used by the EAP method specified in +the "phase2-auth" or "phase2-autheap" +properties. Setting this property directly is discouraged; use the +nm_setting_802_1x_set_phase2_client_cert() function instead. +

+
+
+
+

The "phase2-private-key" property

+
  "phase2-private-key"       GArray_guchar_*       : Read / Write
+

+Private key data used by "phase 2" inner authentication methods. +

+

+Contains the "phase 2" inner private key if the "auth" or +"phase2-autheap" property is set to 'tls'. Setting this +property directly is discouraged; use the +nm_setting_802_1x_set_phase2_private_key() function instead. +

+
+
+
+

The "phase2-private-key-password" property

+
  "phase2-private-key-password" gchar*                : Read / Write
+

+The password used to decrypt the private key specified in +"phase2-private-key" when the private key either uses the +path scheme, or if the private key is a PKCS12 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. +

+

Default value: NULL

+
+
+
+

The "private-key" property

+
  "private-key"              GArray_guchar_*       : Read / Write
+

+Contains the private key if the "eap" property is set to +'tls'. Setting this property directly is discouraged; use the +nm_setting_802_1x_set_private_key() function instead. +

+
+
+
+

The "private-key-password" property

+
  "private-key-password"     gchar*                : Read / Write
+

+The password used to decrypt the private key specified in +"private-key" when the private key either uses the path +scheme, or if the private key is a PKCS12 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. +

+

Default value: NULL

+
+
+
+

The "system-ca-certs" property

+
  "system-ca-certs"          gboolean              : Read / Write / Construct
+

+When TRUE, overrides "ca-path" and +"phase2-ca-path" properties using the system CA directory +specified at configure time with the --system-ca-path switch. The +certificates in this directory are added to the verification chain in +addition to any certificates specified by the "ca-cert", +"ca-cert-path", "phase2-ca-cert" and +"phase2-ca-cert-path" properties. +

+

Default value: FALSE

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingBluetooth.html b/docs/libnm-util/html/NMSettingBluetooth.html new file mode 100644 index 00000000..92064725 --- /dev/null +++ b/docs/libnm-util/html/NMSettingBluetooth.html @@ -0,0 +1,292 @@ + + + + +NMSettingBluetooth + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingBluetooth

+

NMSettingBluetooth

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingBluetooth
+
+
+
+

Properties

+
+  "bdaddr"                   GArray_guchar_*       : Read / Write
+  "type"                     gchar*                : Read / Write
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_BLUETOOTH_SETTING_NAME

+
#define NM_SETTING_BLUETOOTH_SETTING_NAME "bluetooth"
+
+

+

+
+
+
+

enum NMSettingBluetoothError

+
typedef enum
+{
+	NM_SETTING_BLUETOOTH_ERROR_UNKNOWN = 0,
+	NM_SETTING_BLUETOOTH_ERROR_INVALID_PROPERTY,
+	NM_SETTING_BLUETOOTH_ERROR_MISSING_PROPERTY,
+	NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND,
+} NMSettingBluetoothError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_BLUETOOTH_ERROR

+
#define NM_TYPE_SETTING_BLUETOOTH_ERROR (nm_setting_bluetooth_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_BLUETOOTH_ERROR

+
#define NM_SETTING_BLUETOOTH_ERROR nm_setting_bluetooth_error_quark ()
+
+

+

+
+
+
+

nm_setting_bluetooth_error_quark ()

+
GQuark              nm_setting_bluetooth_error_quark    (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_BLUETOOTH_BDADDR

+
#define NM_SETTING_BLUETOOTH_BDADDR    "bdaddr"
+
+

+

+
+
+
+

NM_SETTING_BLUETOOTH_TYPE

+
#define NM_SETTING_BLUETOOTH_TYPE      "type"
+
+

+

+
+
+
+

NM_SETTING_BLUETOOTH_TYPE_DUN

+
#define NM_SETTING_BLUETOOTH_TYPE_DUN  "dun"
+
+

+

+
+
+
+

NM_SETTING_BLUETOOTH_TYPE_PANU

+
#define NM_SETTING_BLUETOOTH_TYPE_PANU "panu"
+
+

+

+
+
+
+

NMSettingBluetooth

+
typedef struct _NMSettingBluetooth NMSettingBluetooth;
+

+

+
+
+
+

NMSettingBluetoothClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingBluetoothClass;
+
+

+

+
+
+
+

nm_setting_bluetooth_get_type ()

+
GType               nm_setting_bluetooth_get_type       (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_bluetooth_new ()

+
NMSetting *         nm_setting_bluetooth_new            (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_bluetooth_get_bdaddr ()

+
const GByteArray *  nm_setting_bluetooth_get_bdaddr     (NMSettingBluetooth *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_bluetooth_get_connection_type ()

+
const char *        nm_setting_bluetooth_get_connection_type
+                                                        (NMSettingBluetooth *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "bdaddr" property

+
  "bdaddr"                   GArray_guchar_*       : Read / Write
+

+The Bluetooth address of the device. +

+
+
+
+

The "type" property

+
  "type"                     gchar*                : Read / Write
+

+Either 'dun' for Dial-Up Networking connections (not yet supported) or +'panu' for Personal Area Networking connections. +

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingCdma.html b/docs/libnm-util/html/NMSettingCdma.html new file mode 100644 index 00000000..878660d4 --- /dev/null +++ b/docs/libnm-util/html/NMSettingCdma.html @@ -0,0 +1,322 @@ + + + + +NMSettingCdma + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingCdma

+

NMSettingCdma — Describes CDMA-based mobile broadband properties

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingCdma
+
+
+
+

Properties

+
+  "number"                   gchar*                : Read / Write
+  "password"                 gchar*                : Read / Write
+  "username"                 gchar*                : Read / Write
+
+
+
+

Description

+

+The NMSettingCdma object is a NMSetting subclass that describes +properties that allow connections to IS-95-based mobile broadband +networks, including those using CDMA2000/EVDO technology. +

+
+
+

Details

+
+

NM_SETTING_CDMA_SETTING_NAME

+
#define NM_SETTING_CDMA_SETTING_NAME "cdma"
+
+

+

+
+
+
+

enum NMSettingCdmaError

+
typedef enum
+{
+	NM_SETTING_CDMA_ERROR_UNKNOWN = 0,
+	NM_SETTING_CDMA_ERROR_INVALID_PROPERTY,
+	NM_SETTING_CDMA_ERROR_MISSING_PROPERTY,
+	NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING
+} NMSettingCdmaError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_CDMA_ERROR

+
#define NM_TYPE_SETTING_CDMA_ERROR (nm_setting_cdma_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_CDMA_ERROR

+
#define NM_SETTING_CDMA_ERROR nm_setting_cdma_error_quark ()
+
+

+

+
+
+
+

nm_setting_cdma_error_quark ()

+
GQuark              nm_setting_cdma_error_quark         (void);
+

+Registers an error quark for NMSettingCdma if necessary. +

+
++ + + + +

Returns :

the error quark used for NMSettingCdma errors. +
+
+
+
+

NM_SETTING_CDMA_NUMBER

+
#define NM_SETTING_CDMA_NUMBER       "number"
+
+

+

+
+
+
+

NM_SETTING_CDMA_USERNAME

+
#define NM_SETTING_CDMA_USERNAME     "username"
+
+

+

+
+
+
+

NM_SETTING_CDMA_PASSWORD

+
#define NM_SETTING_CDMA_PASSWORD     "password"
+
+

+

+
+
+
+

NMSettingCdma

+
typedef struct _NMSettingCdma NMSettingCdma;
+

+

+
+
+
+

NMSettingCdmaClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingCdmaClass;
+
+

+

+
+
+
+

nm_setting_cdma_get_type ()

+
GType               nm_setting_cdma_get_type            (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_cdma_new ()

+
NMSetting *         nm_setting_cdma_new                 (void);
+

+Creates a new NMSettingCdma object with default values. +

+
++ + + + +

Returns :

the new empty NMSettingCdma object +
+
+
+
+

nm_setting_cdma_get_number ()

+
const char *        nm_setting_cdma_get_number          (NMSettingCdma *setting);
+
++ + + + + + + + + + +

setting :

the NMSettingCdma +

Returns :

the "number" property of the setting +
+
+
+
+

nm_setting_cdma_get_username ()

+
const char *        nm_setting_cdma_get_username        (NMSettingCdma *setting);
+
++ + + + + + + + + + +

setting :

the NMSettingCdma +

Returns :

the "username" property of the setting +
+
+
+
+

nm_setting_cdma_get_password ()

+
const char *        nm_setting_cdma_get_password        (NMSettingCdma *setting);
+
++ + + + + + + + + + +

setting :

the NMSettingCdma +

Returns :

the "password" property of the setting +
+
+
+
+

Property Details

+
+

The "number" property

+
  "number"                   gchar*                : Read / Write
+

+The number to dial to establish the connection to the CDMA-based mobile +broadband network, if any. If not specified, the default number (777) +is used when required. +

+

Default value: NULL

+
+
+
+

The "password" property

+
  "password"                 gchar*                : Read / Write
+

+The password used to authenticate with the network, if required. Many +providers do not require a password, or accept any password. But if a +password is required, it is specified here. +

+

Default value: NULL

+
+
+
+

The "username" property

+
  "username"                 gchar*                : Read / Write
+

+The username used to authenticate with the network, if required. Many +providers do not require a username, or accept any username. But if a +username is required, it is specified here. +

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingConnection.html b/docs/libnm-util/html/NMSettingConnection.html new file mode 100644 index 00000000..8fa7c953 --- /dev/null +++ b/docs/libnm-util/html/NMSettingConnection.html @@ -0,0 +1,514 @@ + + + + +NMSettingConnection + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingConnection

+

NMSettingConnection — Describes general connection properties

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingConnection
+
+
+
+

Properties

+
+  "autoconnect"              gboolean              : Read / Write / Construct
+  "id"                       gchar*                : Read / Write
+  "read-only"                gboolean              : Read / Write / Construct
+  "timestamp"                guint64               : Read / Write / Construct
+  "type"                     gchar*                : Read / Write
+  "uuid"                     gchar*                : Read / Write
+
+
+
+

Description

+

+The NMSettingConnection object is a NMSetting subclass that describes +properties that apply to all NMConnection objects, regardless of what type +of network connection they describe. Each NMConnection object must contain +a NMSettingConnection setting. +

+
+
+

Details

+
+

NM_SETTING_CONNECTION_SETTING_NAME

+
#define NM_SETTING_CONNECTION_SETTING_NAME "connection"
+
+

+

+
+
+
+

enum NMSettingConnectionError

+
typedef enum
+{
+	NM_SETTING_CONNECTION_ERROR_UNKNOWN = 0,
+	NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY,
+	NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY,
+	NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND
+} NMSettingConnectionError;
+
+

+Describes errors that may result from operations involving a +NMSettingConnection. +

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

NM_SETTING_CONNECTION_ERROR_UNKNOWN

unknown or unclassified error +

NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY

the property's value is + invalid +

NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY

a required property is not + present +

NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND

the NMSetting object + referenced by the setting name contained in the + "type" property was not present in the NMConnection +
+
+
+
+

NM_TYPE_SETTING_CONNECTION_ERROR

+
#define NM_TYPE_SETTING_CONNECTION_ERROR (nm_setting_connection_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_CONNECTION_ERROR

+
#define NM_SETTING_CONNECTION_ERROR nm_setting_connection_error_quark ()
+
+

+

+
+
+
+

nm_setting_connection_error_quark ()

+
GQuark              nm_setting_connection_error_quark   (void);
+

+Registers an error quark for NMSettingConnection if necessary. +

+
++ + + + +

Returns :

the error quark used for NMSettingConnection errors. +
+
+
+
+

NM_SETTING_CONNECTION_ID

+
#define NM_SETTING_CONNECTION_ID          "id"
+
+

+

+
+
+
+

NM_SETTING_CONNECTION_UUID

+
#define NM_SETTING_CONNECTION_UUID        "uuid"
+
+

+

+
+
+
+

NM_SETTING_CONNECTION_TYPE

+
#define NM_SETTING_CONNECTION_TYPE        "type"
+
+

+

+
+
+
+

NM_SETTING_CONNECTION_AUTOCONNECT

+
#define NM_SETTING_CONNECTION_AUTOCONNECT "autoconnect"
+
+

+

+
+
+
+

NM_SETTING_CONNECTION_TIMESTAMP

+
#define NM_SETTING_CONNECTION_TIMESTAMP   "timestamp"
+
+

+

+
+
+
+

NM_SETTING_CONNECTION_READ_ONLY

+
#define NM_SETTING_CONNECTION_READ_ONLY   "read-only"
+
+

+

+
+
+
+

NMSettingConnection

+
typedef struct _NMSettingConnection NMSettingConnection;
+

+The NMSettingConnection struct contains only private data. +It should only be accessed through the functions described below. +

+
+
+
+

NMSettingConnectionClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingConnectionClass;
+
+

+

+
+
+
+

nm_setting_connection_get_type ()

+
GType               nm_setting_connection_get_type      (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_connection_new ()

+
NMSetting *         nm_setting_connection_new           (void);
+

+Creates a new NMSettingConnection object with default values. +

+
++ + + + +

Returns :

the new empty NMSettingConnection object +
+
+
+
+

nm_setting_connection_get_id ()

+
const char *        nm_setting_connection_get_id        (NMSettingConnection *setting);
+

+Returns the "id" property of the connection. +

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

setting :

the NMSettingConnection +

Returns :

the connection ID +
+
+
+
+

nm_setting_connection_get_uuid ()

+
const char *        nm_setting_connection_get_uuid      (NMSettingConnection *setting);
+

+Returns the "uuid" property of the connection. +

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

setting :

the NMSettingConnection +

Returns :

the connection UUID +
+
+
+
+

nm_setting_connection_get_connection_type ()

+
const char *        nm_setting_connection_get_connection_type
+                                                        (NMSettingConnection *setting);
+

+Returns the "type" property of the connection. +

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

setting :

the NMSettingConnection +

Returns :

the connection type +
+
+
+
+

nm_setting_connection_get_autoconnect ()

+
gboolean            nm_setting_connection_get_autoconnect
+                                                        (NMSettingConnection *setting);
+

+Returns the "autoconnect" property of the connection. +

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

setting :

the NMSettingConnection +

Returns :

the connection's autoconnect behavior +
+
+
+
+

nm_setting_connection_get_timestamp ()

+
guint64             nm_setting_connection_get_timestamp (NMSettingConnection *setting);
+

+Returns the "timestamp" property of the connection. +

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

setting :

the NMSettingConnection +

Returns :

the connection's timestamp +
+
+
+
+

nm_setting_connection_get_read_only ()

+
gboolean            nm_setting_connection_get_read_only (NMSettingConnection *setting);
+

+Returns the "read-only" property of the connection. +

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

setting :

the NMSettingConnection +

Returns :

TRUE if the connection is read-only, FALSE if it is not +
+
+
+
+

Property Details

+
+

The "autoconnect" property

+
  "autoconnect"              gboolean              : Read / Write / Construct
+

+Whether or not the connection should be automatically connected by +NetworkManager when the resources for the connection are available. +TRUE to automatically activate the connection, FALSE to require manual +intervention to activate the connection. Defaults to TRUE. +

+

Default value: TRUE

+
+
+
+

The "id" property

+
  "id"                       gchar*                : Read / Write
+

+A human readable unique idenfier for the connection, like "Work WiFi" or +"T-Mobile 3G". +

+

Default value: NULL

+
+
+
+

The "read-only" property

+
  "read-only"                gboolean              : Read / Write / Construct
+

+TRUE if the connection can be modified using the providing settings +service's D-Bus interface with the right privileges, or FALSE +if the connection is read-only and cannot be modified. +

+

Default value: FALSE

+
+
+
+

The "timestamp" property

+
  "timestamp"                guint64               : Read / Write / Construct
+

+The time, in seconds since the Unix Epoch, that the connection was last +_successfully_ fully activated. +

+

Default value: 0

+
+
+
+

The "type" property

+
  "type"                     gchar*                : Read / Write
+

+The general hardware type of the device used for the network connection, +contains the name of the NMSetting object that describes that hardware +type's parameters. For example, for WiFi devices, the name of the +NMSettingWireless setting. +

+

Default value: NULL

+
+
+
+

The "uuid" property

+
  "uuid"                     gchar*                : Read / Write
+

+A universally unique idenfier for the connection, for example generated +with libuuid. Should be assigned when the connection is created, and +never changed as long as the connection still applies to the same +network. For example, should not be changed when the +"id" or NMSettingIP4Config changes, but might need +to be re-created when the WiFi SSID, mobile broadband network provider, +or "type" changes. +

+

+The UUID must be in the format '2815492f-7e56-435e-b2e9-246bd7cdc664' +(ie, contains only hexadecimal characters and '-'). A suitable UUID may +be generated by nm_utils_uuid_generate() or +nm_utils_uuid_generate_from_string(). +

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingGsm.html b/docs/libnm-util/html/NMSettingGsm.html new file mode 100644 index 00000000..0b68795c --- /dev/null +++ b/docs/libnm-util/html/NMSettingGsm.html @@ -0,0 +1,759 @@ + + + + +NMSettingGsm + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingGsm

+

NMSettingGsm

+
+
+

Synopsis

+
#define             NM_SETTING_GSM_SETTING_NAME
+enum                NMSettingGsmError;
+#define             NM_TYPE_SETTING_GSM_ERROR
+#define             NM_SETTING_GSM_ERROR
+GQuark              nm_setting_gsm_error_quark          (void);
+#define             NM_SETTING_GSM_NUMBER
+#define             NM_SETTING_GSM_USERNAME
+#define             NM_SETTING_GSM_PASSWORD
+#define             NM_SETTING_GSM_APN
+#define             NM_SETTING_GSM_NETWORK_ID
+#define             NM_SETTING_GSM_NETWORK_TYPE
+#define             NM_SETTING_GSM_ALLOWED_BANDS
+#define             NM_SETTING_GSM_PIN
+#define             NM_SETTING_GSM_HOME_ONLY
+#define             NM_SETTING_GSM_PUK
+#define             NM_SETTING_GSM_BAND
+#define             NM_GSM_NETWORK_ANY
+#define             NM_GSM_NETWORK_UMTS_HSPA
+#define             NM_GSM_NETWORK_GPRS_EDGE
+#define             NM_GSM_NETWORK_PREFER_UMTS_HSPA
+#define             NM_GSM_NETWORK_PREFER_GPRS_EDGE
+enum                NMSettingGsmNetworkType;
+enum                NMSettingGsmNetworkBand;
+                    NMSettingGsm;
+                    NMSettingGsmClass;
+GType               nm_setting_gsm_get_type             (void);
+NMSetting *         nm_setting_gsm_new                  (void);
+const char *        nm_setting_gsm_get_number           (NMSettingGsm *setting);
+const char *        nm_setting_gsm_get_username         (NMSettingGsm *setting);
+const char *        nm_setting_gsm_get_password         (NMSettingGsm *setting);
+const char *        nm_setting_gsm_get_apn              (NMSettingGsm *setting);
+const char *        nm_setting_gsm_get_network_id       (NMSettingGsm *setting);
+int                 nm_setting_gsm_get_network_type     (NMSettingGsm *setting);
+guint32             nm_setting_gsm_get_allowed_bands    (NMSettingGsm *setting);
+const char *        nm_setting_gsm_get_pin              (NMSettingGsm *setting);
+gboolean            nm_setting_gsm_get_home_only        (NMSettingGsm *setting);
+const char *        nm_setting_gsm_get_puk              (NMSettingGsm *setting);
+int                 nm_setting_gsm_get_band             (NMSettingGsm *setting);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingGsm
+
+
+
+

Properties

+
+  "allowed-bands"            guint                 : Read / Write / Construct
+  "apn"                      gchar*                : Read / Write
+  "band"                     gint                  : Read / Write / Construct
+  "home-only"                gboolean              : Read / Write
+  "network-id"               gchar*                : Read / Write
+  "network-type"             gint                  : Read / Write / Construct
+  "number"                   gchar*                : Read / Write
+  "password"                 gchar*                : Read / Write
+  "pin"                      gchar*                : Read / Write
+  "puk"                      gchar*                : Read / Write
+  "username"                 gchar*                : Read / Write
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_GSM_SETTING_NAME

+
#define NM_SETTING_GSM_SETTING_NAME "gsm"
+
+

+

+
+
+
+

enum NMSettingGsmError

+
typedef enum
+{
+	NM_SETTING_GSM_ERROR_UNKNOWN = 0,
+	NM_SETTING_GSM_ERROR_INVALID_PROPERTY,
+	NM_SETTING_GSM_ERROR_MISSING_PROPERTY,
+	NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING
+} NMSettingGsmError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_GSM_ERROR

+
#define NM_TYPE_SETTING_GSM_ERROR (nm_setting_gsm_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_GSM_ERROR

+
#define NM_SETTING_GSM_ERROR nm_setting_gsm_error_quark ()
+
+

+

+
+
+
+

nm_setting_gsm_error_quark ()

+
GQuark              nm_setting_gsm_error_quark          (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_GSM_NUMBER

+
#define NM_SETTING_GSM_NUMBER        "number"
+
+

+

+
+
+
+

NM_SETTING_GSM_USERNAME

+
#define NM_SETTING_GSM_USERNAME      "username"
+
+

+

+
+
+
+

NM_SETTING_GSM_PASSWORD

+
#define NM_SETTING_GSM_PASSWORD      "password"
+
+

+

+
+
+
+

NM_SETTING_GSM_APN

+
#define NM_SETTING_GSM_APN           "apn"
+
+

+

+
+
+
+

NM_SETTING_GSM_NETWORK_ID

+
#define NM_SETTING_GSM_NETWORK_ID    "network-id"
+
+

+

+
+
+
+

NM_SETTING_GSM_NETWORK_TYPE

+
#define NM_SETTING_GSM_NETWORK_TYPE  "network-type"
+
+

+

+
+
+
+

NM_SETTING_GSM_ALLOWED_BANDS

+
#define NM_SETTING_GSM_ALLOWED_BANDS "allowed-bands"
+
+

+

+
+
+
+

NM_SETTING_GSM_PIN

+
#define NM_SETTING_GSM_PIN           "pin"
+
+

+

+
+
+
+

NM_SETTING_GSM_HOME_ONLY

+
#define NM_SETTING_GSM_HOME_ONLY     "home-only"
+
+

+

+
+
+
+

NM_SETTING_GSM_PUK

+
#define NM_SETTING_GSM_PUK           "puk"
+
+

+

+
+
+
+

NM_SETTING_GSM_BAND

+
#define NM_SETTING_GSM_BAND          "band"
+
+

+

+
+
+
+

NM_GSM_NETWORK_ANY

+
#define NM_GSM_NETWORK_ANY              NM_SETTING_GSM_NETWORK_TYPE_ANY
+
+

+

+
+
+
+

NM_GSM_NETWORK_UMTS_HSPA

+
#define NM_GSM_NETWORK_UMTS_HSPA        NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA
+
+

+

+
+
+
+

NM_GSM_NETWORK_GPRS_EDGE

+
#define NM_GSM_NETWORK_GPRS_EDGE        NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE
+
+

+

+
+
+
+

NM_GSM_NETWORK_PREFER_UMTS_HSPA

+
#define NM_GSM_NETWORK_PREFER_UMTS_HSPA NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA
+
+

+

+
+
+
+

NM_GSM_NETWORK_PREFER_GPRS_EDGE

+
#define NM_GSM_NETWORK_PREFER_GPRS_EDGE NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE
+
+

+

+
+
+
+

enum NMSettingGsmNetworkType

+
typedef enum {
+	NM_SETTING_GSM_NETWORK_TYPE_ANY = -1,
+	NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA = 0,
+	NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE = 1,
+	NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA = 2,
+	NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE = 3
+} NMSettingGsmNetworkType;
+
+

+

+
+
+
+

enum NMSettingGsmNetworkBand

+
typedef enum {
+	NM_SETTING_GSM_BAND_UNKNOWN      = 0x00000000,
+	NM_SETTING_GSM_BAND_ANY          = 0x00000001,
+	NM_SETTING_GSM_BAND_EGSM         = 0x00000002, /*  900 MHz */
+	NM_SETTING_GSM_BAND_DCS          = 0x00000004, /* 1800 MHz */
+	NM_SETTING_GSM_BAND_PCS          = 0x00000008, /* 1900 MHz */
+	NM_SETTING_GSM_BAND_G850         = 0x00000010, /*  850 MHz */
+	NM_SETTING_GSM_BAND_U2100        = 0x00000020, /* WCDMA 3GPP UMTS 2100 MHz     (Class I) */
+	NM_SETTING_GSM_BAND_U1800        = 0x00000040, /* WCDMA 3GPP UMTS 1800 MHz     (Class III) */
+	NM_SETTING_GSM_BAND_U17IV        = 0x00000080, /* WCDMA 3GPP AWS 1700/2100 MHz (Class IV) */
+	NM_SETTING_GSM_BAND_U800         = 0x00000100, /* WCDMA 3GPP UMTS 800 MHz      (Class VI) */
+	NM_SETTING_GSM_BAND_U850         = 0x00000200, /* WCDMA 3GPP UMTS 850 MHz      (Class V) */
+	NM_SETTING_GSM_BAND_U900         = 0x00000400, /* WCDMA 3GPP UMTS 900 MHz      (Class VIII) */
+	NM_SETTING_GSM_BAND_U17IX        = 0x00000800, /* WCDMA 3GPP UMTS 1700 MHz     (Class IX) */
+	NM_SETTING_GSM_BAND_U1900        = 0x00001000, /* WCDMA 3GPP UMTS 1900 MHz     (Class II) */
+} NMSettingGsmNetworkBand;
+
+

+

+
+
+
+

NMSettingGsm

+
typedef struct _NMSettingGsm NMSettingGsm;
+

+

+
+
+
+

NMSettingGsmClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingGsmClass;
+
+

+

+
+
+
+

nm_setting_gsm_get_type ()

+
GType               nm_setting_gsm_get_type             (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_gsm_new ()

+
NMSetting *         nm_setting_gsm_new                  (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_gsm_get_number ()

+
const char *        nm_setting_gsm_get_number           (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_username ()

+
const char *        nm_setting_gsm_get_username         (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_password ()

+
const char *        nm_setting_gsm_get_password         (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_apn ()

+
const char *        nm_setting_gsm_get_apn              (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_network_id ()

+
const char *        nm_setting_gsm_get_network_id       (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_network_type ()

+
int                 nm_setting_gsm_get_network_type     (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_allowed_bands ()

+
guint32             nm_setting_gsm_get_allowed_bands    (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_pin ()

+
const char *        nm_setting_gsm_get_pin              (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_home_only ()

+
gboolean            nm_setting_gsm_get_home_only        (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_puk ()

+
const char *        nm_setting_gsm_get_puk              (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_gsm_get_band ()

+
int                 nm_setting_gsm_get_band             (NMSettingGsm *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "allowed-bands" property

+
  "allowed-bands"            guint                 : Read / Write / Construct
+

+Bitfield of allowed frequency bands. Note that not all devices allow +frequency band control. +

+

Allowed values: <= 1

+

Default value: 1

+
+
+
+

The "apn" property

+
  "apn"                      gchar*                : Read / Write
+

+The GPRS Access Point Name specifying the APN used when establishing a +data session with the GSM-based network. The APN often determines how +the user will be billed for their network usage and whether the user has +access to the Internet or just a provider-specific walled-garden, so it +is important to use the correct APN for the user's mobile broadband plan. +

+

Default value: NULL

+
+
+
+

The "band" property

+
  "band"                     gint                  : Read / Write / Construct
+

+DEPRECATED +

+

Allowed values: [G_MAXULONG,5]

+

Default value: -1

+
+
+
+

The "home-only" property

+
  "home-only"                gboolean              : Read / Write
+

+When TRUE, only connections to the home network will be allowed. +Connections to roaming networks will not be made. +

+

Default value: FALSE

+
+
+
+

The "network-id" property

+
  "network-id"               gchar*                : Read / Write
+

+The Network ID (GSM LAI format, ie MCC-MNC) to force specific network +registration. If the Network ID is specified, NetworkManager will +attempt to force the device to register only on the specified network. +This can be used to ensure that the device does not roam when direct +roaming control of the device is not otherwise possible. +

+

Default value: NULL

+
+
+
+

The "network-type" property

+
  "network-type"             gint                  : Read / Write / Construct
+

+Network preference to force the device to only use specific network +technologies. The permitted values are: -1: any, 0: 3G only, +1: GPRS/EDGE only, 2: prefer 3G, and 3: prefer 2G. Note that not all +devices allow network preference control. +

+

Allowed values: [G_MAXULONG,3]

+

Default value: -1

+
+
+
+

The "number" property

+
  "number"                   gchar*                : Read / Write
+

+Number to dial when establishing a PPP data session with the GSM-based +mobile broadband network. In most cases, leave the number blank and a +number selecting the APN specified in the 'apn' property will be used +automatically when required. +

+

Default value: NULL

+
+
+
+

The "password" property

+
  "password"                 gchar*                : Read / Write
+

+The password used to authenticate with the network, if required. Many +providers do not require a password, or accept any password. But if a +password is required, it is specified here. +

+

Default value: NULL

+
+
+
+

The "pin" property

+
  "pin"                      gchar*                : Read / Write
+

+If the SIM is locked with a PIN it must be unlocked before any other +operations are requested. Specify the PIN here to allow operation of +the device. +

+

Default value: NULL

+
+
+
+

The "puk" property

+
  "puk"                      gchar*                : Read / Write
+

+DEPRECATED +

+

Default value: NULL

+
+
+
+

The "username" property

+
  "username"                 gchar*                : Read / Write
+

+The username used to authenticate with the network, if required. Many +providers do not require a username, or accept any username. But if a +username is required, it is specified here. +

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingIP4Config.html b/docs/libnm-util/html/NMSettingIP4Config.html new file mode 100644 index 00000000..e2c82542 --- /dev/null +++ b/docs/libnm-util/html/NMSettingIP4Config.html @@ -0,0 +1,1774 @@ + + + + +NMSettingIP4Config + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingIP4Config

+

NMSettingIP4Config

+
+
+

Synopsis

+
#define             NM_SETTING_IP4_CONFIG_SETTING_NAME
+enum                NMSettingIP4ConfigError;
+#define             NM_TYPE_SETTING_IP4_CONFIG_ERROR
+#define             NM_SETTING_IP4_CONFIG_ERROR
+GQuark              nm_setting_ip4_config_error_quark   (void);
+#define             NM_SETTING_IP4_CONFIG_METHOD
+#define             NM_SETTING_IP4_CONFIG_DNS
+#define             NM_SETTING_IP4_CONFIG_DNS_SEARCH
+#define             NM_SETTING_IP4_CONFIG_ADDRESSES
+#define             NM_SETTING_IP4_CONFIG_ROUTES
+#define             NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES
+#define             NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS
+#define             NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID
+#define             NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME
+#define             NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME
+#define             NM_SETTING_IP4_CONFIG_NEVER_DEFAULT
+#define             NM_SETTING_IP4_CONFIG_MAY_FAIL
+#define             NM_SETTING_IP4_CONFIG_METHOD_AUTO
+#define             NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL
+#define             NM_SETTING_IP4_CONFIG_METHOD_MANUAL
+#define             NM_SETTING_IP4_CONFIG_METHOD_SHARED
+#define             NM_SETTING_IP4_CONFIG_METHOD_DISABLED
+typedef             NMIP4Address;
+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);
+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);
+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);
+typedef             NMIP4Route;
+NMIP4Route *        nm_ip4_route_new                    (void);
+NMIP4Route *        nm_ip4_route_dup                    (NMIP4Route *route);
+void                nm_ip4_route_ref                    (NMIP4Route *route);
+void                nm_ip4_route_unref                  (NMIP4Route *route);
+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);
+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);
+guint32             nm_ip4_route_get_metric             (NMIP4Route *route);
+void                nm_ip4_route_set_metric             (NMIP4Route *route,
+                                                         guint32 metric);
+                    NMSettingIP4Config;
+                    NMSettingIP4ConfigClass;
+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);
+guint32             nm_setting_ip4_config_get_dns       (NMSettingIP4Config *setting,
+                                                         guint32 i);
+gboolean            nm_setting_ip4_config_add_dns       (NMSettingIP4Config *setting,
+                                                         guint32 dns);
+void                nm_setting_ip4_config_remove_dns    (NMSettingIP4Config *setting,
+                                                         guint32 i);
+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);
+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);
+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);
+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);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingIP4Config
+
+
+
+

Properties

+
+  "addresses"                GPtrArray_GArray_guint__*  : Read / Write
+  "dhcp-client-id"           gchar*                : Read / Write
+  "dhcp-hostname"            gchar*                : Read / Write
+  "dhcp-send-hostname"       gboolean              : Read / Write / Construct
+  "dns"                      GArray_guint_*        : Read / Write
+  "dns-search"               GSList_gchararray_*   : Read / Write
+  "ignore-auto-dns"          gboolean              : Read / Write / Construct
+  "ignore-auto-routes"       gboolean              : Read / Write / Construct
+  "may-fail"                 gboolean              : Read / Write / Construct
+  "method"                   gchar*                : Read / Write
+  "never-default"            gboolean              : Read / Write / Construct
+  "routes"                   GPtrArray_GArray_guint__*  : Read / Write
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_IP4_CONFIG_SETTING_NAME

+
#define NM_SETTING_IP4_CONFIG_SETTING_NAME "ipv4"
+
+

+

+
+
+
+

enum NMSettingIP4ConfigError

+
typedef enum
+{
+	NM_SETTING_IP4_CONFIG_ERROR_UNKNOWN = 0,
+	NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY,
+	NM_SETTING_IP4_CONFIG_ERROR_MISSING_PROPERTY,
+	NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD
+} NMSettingIP4ConfigError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_IP4_CONFIG_ERROR

+
#define NM_TYPE_SETTING_IP4_CONFIG_ERROR (nm_setting_ip4_config_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_ERROR

+
#define NM_SETTING_IP4_CONFIG_ERROR nm_setting_ip4_config_error_quark ()
+
+

+

+
+
+
+

nm_setting_ip4_config_error_quark ()

+
GQuark              nm_setting_ip4_config_error_quark   (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_IP4_CONFIG_METHOD

+
#define NM_SETTING_IP4_CONFIG_METHOD             "method"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_DNS

+
#define NM_SETTING_IP4_CONFIG_DNS                "dns"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_DNS_SEARCH

+
#define NM_SETTING_IP4_CONFIG_DNS_SEARCH         "dns-search"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_ADDRESSES

+
#define NM_SETTING_IP4_CONFIG_ADDRESSES          "addresses"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_ROUTES

+
#define NM_SETTING_IP4_CONFIG_ROUTES             "routes"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES

+
#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS

+
#define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS    "ignore-auto-dns"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID

+
#define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID     "dhcp-client-id"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME

+
#define NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME

+
#define NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME      "dhcp-hostname"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_NEVER_DEFAULT

+
#define NM_SETTING_IP4_CONFIG_NEVER_DEFAULT      "never-default"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_MAY_FAIL

+
#define NM_SETTING_IP4_CONFIG_MAY_FAIL           "may-fail"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_METHOD_AUTO

+
#define NM_SETTING_IP4_CONFIG_METHOD_AUTO       "auto"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL

+
#define NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL "link-local"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_METHOD_MANUAL

+
#define NM_SETTING_IP4_CONFIG_METHOD_MANUAL     "manual"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_METHOD_SHARED

+
#define NM_SETTING_IP4_CONFIG_METHOD_SHARED     "shared"
+
+

+

+
+
+
+

NM_SETTING_IP4_CONFIG_METHOD_DISABLED

+
#define NM_SETTING_IP4_CONFIG_METHOD_DISABLED   "disabled"
+
+

+

+
+
+
+

NMIP4Address

+
typedef struct NMIP4Address NMIP4Address;
+
+

+

+
+
+
+

nm_ip4_address_new ()

+
NMIP4Address *      nm_ip4_address_new                  (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_ip4_address_dup ()

+
NMIP4Address *      nm_ip4_address_dup                  (NMIP4Address *source);
+

+

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

source :

+

Returns :

+
+
+
+
+

nm_ip4_address_ref ()

+
void                nm_ip4_address_ref                  (NMIP4Address *address);
+

+

+
++ + + + +

address :

+
+
+
+
+

nm_ip4_address_unref ()

+
void                nm_ip4_address_unref                (NMIP4Address *address);
+

+

+
++ + + + +

address :

+
+
+
+
+

nm_ip4_address_compare ()

+
gboolean            nm_ip4_address_compare              (NMIP4Address *address,
+                                                         NMIP4Address *other);
+

+

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

address :

+

other :

+

Returns :

+
+
+
+
+

nm_ip4_address_get_address ()

+
guint32             nm_ip4_address_get_address          (NMIP4Address *address);
+

+

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

address :

+

Returns :

+
+
+
+
+

nm_ip4_address_set_address ()

+
void                nm_ip4_address_set_address          (NMIP4Address *address,
+                                                         guint32 addr);
+

+

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

address :

+

addr :

+
+
+
+
+

nm_ip4_address_get_prefix ()

+
guint32             nm_ip4_address_get_prefix           (NMIP4Address *address);
+

+

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

address :

+

Returns :

+
+
+
+
+

nm_ip4_address_set_prefix ()

+
void                nm_ip4_address_set_prefix           (NMIP4Address *address,
+                                                         guint32 prefix);
+

+

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

address :

+

prefix :

+
+
+
+
+

nm_ip4_address_get_gateway ()

+
guint32             nm_ip4_address_get_gateway          (NMIP4Address *address);
+

+

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

address :

+

Returns :

+
+
+
+
+

nm_ip4_address_set_gateway ()

+
void                nm_ip4_address_set_gateway          (NMIP4Address *address,
+                                                         guint32 gateway);
+

+

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

address :

+

gateway :

+
+
+
+
+

NMIP4Route

+
typedef struct NMIP4Route NMIP4Route;
+
+

+

+
+
+
+

nm_ip4_route_new ()

+
NMIP4Route *        nm_ip4_route_new                    (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_ip4_route_dup ()

+
NMIP4Route *        nm_ip4_route_dup                    (NMIP4Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip4_route_ref ()

+
void                nm_ip4_route_ref                    (NMIP4Route *route);
+

+

+
++ + + + +

route :

+
+
+
+
+

nm_ip4_route_unref ()

+
void                nm_ip4_route_unref                  (NMIP4Route *route);
+

+

+
++ + + + +

route :

+
+
+
+
+

nm_ip4_route_compare ()

+
gboolean            nm_ip4_route_compare                (NMIP4Route *route,
+                                                         NMIP4Route *other);
+

+

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

route :

+

other :

+

Returns :

+
+
+
+
+

nm_ip4_route_get_dest ()

+
guint32             nm_ip4_route_get_dest               (NMIP4Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip4_route_set_dest ()

+
void                nm_ip4_route_set_dest               (NMIP4Route *route,
+                                                         guint32 dest);
+

+

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

route :

+

dest :

+
+
+
+
+

nm_ip4_route_get_prefix ()

+
guint32             nm_ip4_route_get_prefix             (NMIP4Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip4_route_set_prefix ()

+
void                nm_ip4_route_set_prefix             (NMIP4Route *route,
+                                                         guint32 prefix);
+

+

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

route :

+

prefix :

+
+
+
+
+

nm_ip4_route_get_next_hop ()

+
guint32             nm_ip4_route_get_next_hop           (NMIP4Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip4_route_set_next_hop ()

+
void                nm_ip4_route_set_next_hop           (NMIP4Route *route,
+                                                         guint32 next_hop);
+

+

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

route :

+

next_hop :

+
+
+
+
+

nm_ip4_route_get_metric ()

+
guint32             nm_ip4_route_get_metric             (NMIP4Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip4_route_set_metric ()

+
void                nm_ip4_route_set_metric             (NMIP4Route *route,
+                                                         guint32 metric);
+

+

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

route :

+

metric :

+
+
+
+
+

NMSettingIP4Config

+
typedef struct _NMSettingIP4Config NMSettingIP4Config;
+

+

+
+
+
+

NMSettingIP4ConfigClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingIP4ConfigClass;
+
+

+

+
+
+
+

nm_setting_ip4_config_get_type ()

+
GType               nm_setting_ip4_config_get_type      (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_ip4_config_new ()

+
NMSetting *         nm_setting_ip4_config_new           (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_method ()

+
const char *        nm_setting_ip4_config_get_method    (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_num_dns ()

+
guint32             nm_setting_ip4_config_get_num_dns   (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_dns ()

+
guint32             nm_setting_ip4_config_get_dns       (NMSettingIP4Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_add_dns ()

+
gboolean            nm_setting_ip4_config_add_dns       (NMSettingIP4Config *setting,
+                                                         guint32 dns);
+

+

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

setting :

+

dns :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_remove_dns ()

+
void                nm_setting_ip4_config_remove_dns    (NMSettingIP4Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_ip4_config_clear_dns ()

+
void                nm_setting_ip4_config_clear_dns     (NMSettingIP4Config *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_ip4_config_get_num_dns_searches ()

+
guint32             nm_setting_ip4_config_get_num_dns_searches
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_dns_search ()

+
const char *        nm_setting_ip4_config_get_dns_search
+                                                        (NMSettingIP4Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_add_dns_search ()

+
gboolean            nm_setting_ip4_config_add_dns_search
+                                                        (NMSettingIP4Config *setting,
+                                                         const char *dns_search);
+

+

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

setting :

+

dns_search :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_remove_dns_search ()

+
void                nm_setting_ip4_config_remove_dns_search
+                                                        (NMSettingIP4Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_ip4_config_clear_dns_searches ()

+
void                nm_setting_ip4_config_clear_dns_searches
+                                                        (NMSettingIP4Config *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_ip4_config_get_num_addresses ()

+
guint32             nm_setting_ip4_config_get_num_addresses
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_address ()

+
NMIP4Address *      nm_setting_ip4_config_get_address   (NMSettingIP4Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_add_address ()

+
gboolean            nm_setting_ip4_config_add_address   (NMSettingIP4Config *setting,
+                                                         NMIP4Address *address);
+

+

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

setting :

+

address :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_remove_address ()

+
void                nm_setting_ip4_config_remove_address
+                                                        (NMSettingIP4Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_ip4_config_clear_addresses ()

+
void                nm_setting_ip4_config_clear_addresses
+                                                        (NMSettingIP4Config *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_ip4_config_get_num_routes ()

+
guint32             nm_setting_ip4_config_get_num_routes
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_route ()

+
NMIP4Route *        nm_setting_ip4_config_get_route     (NMSettingIP4Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_add_route ()

+
gboolean            nm_setting_ip4_config_add_route     (NMSettingIP4Config *setting,
+                                                         NMIP4Route *route);
+

+

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

setting :

+

route :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_remove_route ()

+
void                nm_setting_ip4_config_remove_route  (NMSettingIP4Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_ip4_config_clear_routes ()

+
void                nm_setting_ip4_config_clear_routes  (NMSettingIP4Config *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_ip4_config_get_ignore_auto_routes ()

+
gboolean            nm_setting_ip4_config_get_ignore_auto_routes
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_ignore_auto_dns ()

+
gboolean            nm_setting_ip4_config_get_ignore_auto_dns
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_dhcp_client_id ()

+
const char *        nm_setting_ip4_config_get_dhcp_client_id
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_dhcp_send_hostname ()

+
gboolean            nm_setting_ip4_config_get_dhcp_send_hostname
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_dhcp_hostname ()

+
const char *        nm_setting_ip4_config_get_dhcp_hostname
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_never_default ()

+
gboolean            nm_setting_ip4_config_get_never_default
+                                                        (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip4_config_get_may_fail ()

+
gboolean            nm_setting_ip4_config_get_may_fail  (NMSettingIP4Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "addresses" property

+
  "addresses"                GPtrArray_GArray_guint__*  : Read / Write
+

+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. +

+
+
+
+

The "dhcp-client-id" property

+
  "dhcp-client-id"           gchar*                : Read / Write
+

+A string sent to the DHCP server to identify the local machine which the +DHCP server may use to cusomize the DHCP lease and options. +

+

Default value: NULL

+
+
+
+

The "dhcp-hostname" property

+
  "dhcp-hostname"            gchar*                : Read / Write
+

+If the "dhcp-send-hostname" property is TRUE, then the +specified name will be sent to the DHCP server when acquiring a lease. +

+

Default value: NULL

+
+
+
+

The "dhcp-send-hostname" property

+
  "dhcp-send-hostname"       gboolean              : Read / Write / Construct
+

+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 +"dhcp-hostname" is empty and this property is TRUE, +the current persistent hostname of the computer is sent. +

+

Default value: FALSE

+
+
+
+

The "dns" property

+
  "dns"                      GArray_guint_*        : Read / Write
+

+List of DNS servers (network byte order). 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 usptream network. In all other +methods, these DNS servers are used as the only DNS servers for this +connection. +

+
+
+
+

The "dns-search" property

+
  "dns-search"               GSList_gchararray_*   : Read / Write
+

+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. +

+
+
+
+

The "ignore-auto-dns" property

+
  "ignore-auto-dns"          gboolean              : Read / Write / Construct
+

+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 "dns" and +"dns-search", if any, are used. +

+

Default value: FALSE

+
+
+
+

The "ignore-auto-routes" property

+
  "ignore-auto-routes"       gboolean              : Read / Write / Construct
+

+When the method is set to 'auto' and this property to TRUE, automatically +configured routes are ignored and only routes specified in +"routes", if any, are used. +

+

Default value: FALSE

+
+
+
+

The "may-fail" property

+
  "may-fail"                 gboolean              : Read / Write / Construct
+

+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. +

+

Default value: FALSE

+
+
+
+

The "method" property

+
  "method"                   gchar*                : Read / Write
+

+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. +

+

Default value: NULL

+
+
+
+

The "never-default" property

+
  "never-default"            gboolean              : Read / Write / Construct
+

+If TRUE, this connection will never be the default IPv4 connection, +meaning it will never be assigned the default route by NetworkManager. +

+

Default value: FALSE

+
+
+
+

The "routes" property

+
  "routes"                   GPtrArray_GArray_guint__*  : Read / Write
+

+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. 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. +

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingIP6Config.html b/docs/libnm-util/html/NMSettingIP6Config.html new file mode 100644 index 00000000..cf5bde6e --- /dev/null +++ b/docs/libnm-util/html/NMSettingIP6Config.html @@ -0,0 +1,1636 @@ + + + + +NMSettingIP6Config + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingIP6Config

+

NMSettingIP6Config

+
+
+

Synopsis

+
#define             NM_SETTING_IP6_CONFIG_SETTING_NAME
+enum                NMSettingIP6ConfigError;
+#define             NM_TYPE_SETTING_IP6_CONFIG_ERROR
+#define             NM_SETTING_IP6_CONFIG_ERROR
+GQuark              nm_setting_ip6_config_error_quark   (void);
+#define             NM_SETTING_IP6_CONFIG_METHOD
+#define             NM_SETTING_IP6_CONFIG_DNS
+#define             NM_SETTING_IP6_CONFIG_DNS_SEARCH
+#define             NM_SETTING_IP6_CONFIG_ADDRESSES
+#define             NM_SETTING_IP6_CONFIG_ROUTES
+#define             NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES
+#define             NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS
+#define             NM_SETTING_IP6_CONFIG_NEVER_DEFAULT
+#define             NM_SETTING_IP6_CONFIG_MAY_FAIL
+#define             NM_SETTING_IP6_CONFIG_METHOD_IGNORE
+#define             NM_SETTING_IP6_CONFIG_METHOD_AUTO
+#define             NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL
+#define             NM_SETTING_IP6_CONFIG_METHOD_MANUAL
+#define             NM_SETTING_IP6_CONFIG_METHOD_SHARED
+typedef             NMIP6Address;
+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);
+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 *gw);
+typedef             NMIP6Route;
+NMIP6Route *        nm_ip6_route_new                    (void);
+NMIP6Route *        nm_ip6_route_dup                    (NMIP6Route *route);
+void                nm_ip6_route_ref                    (NMIP6Route *route);
+void                nm_ip6_route_unref                  (NMIP6Route *route);
+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);
+                    NMSettingIP6Config;
+                    NMSettingIP6ConfigClass;
+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 struct in6_addr * nm_setting_ip6_config_get_dns   (NMSettingIP6Config *setting,
+                                                         guint32 i);
+gboolean            nm_setting_ip6_config_add_dns       (NMSettingIP6Config *setting,
+                                                         const struct in6_addr *dns);
+void                nm_setting_ip6_config_remove_dns    (NMSettingIP6Config *setting,
+                                                         guint32 i);
+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);
+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);
+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);
+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);
+gboolean            nm_setting_ip6_config_get_never_default
+                                                        (NMSettingIP6Config *setting);
+gboolean            nm_setting_ip6_config_get_may_fail  (NMSettingIP6Config *setting);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingIP6Config
+
+
+
+

Properties

+
+  "addresses"                GPtrArray_GValueArray_GArray_guchar_+guint+GArray_guchar___*  : Read / Write
+  "dns"                      GPtrArray_GArray_guchar__*  : Read / Write
+  "dns-search"               GSList_gchararray_*   : Read / Write
+  "ignore-auto-dns"          gboolean              : Read / Write / Construct
+  "ignore-auto-routes"       gboolean              : Read / Write / Construct
+  "may-fail"                 gboolean              : Read / Write / Construct
+  "method"                   gchar*                : Read / Write
+  "never-default"            gboolean              : Read / Write / Construct
+  "routes"                   GPtrArray_GValueArray_GArray_guchar_+guint+GArray_guchar_+guint__*  : Read / Write
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_IP6_CONFIG_SETTING_NAME

+
#define NM_SETTING_IP6_CONFIG_SETTING_NAME "ipv6"
+
+

+

+
+
+
+

enum NMSettingIP6ConfigError

+
typedef enum
+{
+	NM_SETTING_IP6_CONFIG_ERROR_UNKNOWN = 0,
+	NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY,
+	NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY,
+	NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD
+} NMSettingIP6ConfigError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_IP6_CONFIG_ERROR

+
#define NM_TYPE_SETTING_IP6_CONFIG_ERROR (nm_setting_ip6_config_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_ERROR

+
#define NM_SETTING_IP6_CONFIG_ERROR nm_setting_ip6_config_error_quark ()
+
+

+

+
+
+
+

nm_setting_ip6_config_error_quark ()

+
GQuark              nm_setting_ip6_config_error_quark   (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_IP6_CONFIG_METHOD

+
#define NM_SETTING_IP6_CONFIG_METHOD             "method"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_DNS

+
#define NM_SETTING_IP6_CONFIG_DNS                "dns"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_DNS_SEARCH

+
#define NM_SETTING_IP6_CONFIG_DNS_SEARCH         "dns-search"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_ADDRESSES

+
#define NM_SETTING_IP6_CONFIG_ADDRESSES          "addresses"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_ROUTES

+
#define NM_SETTING_IP6_CONFIG_ROUTES             "routes"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES

+
#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS

+
#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS    "ignore-auto-dns"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_NEVER_DEFAULT

+
#define NM_SETTING_IP6_CONFIG_NEVER_DEFAULT      "never-default"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_MAY_FAIL

+
#define NM_SETTING_IP6_CONFIG_MAY_FAIL           "may-fail"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_METHOD_IGNORE

+
#define NM_SETTING_IP6_CONFIG_METHOD_IGNORE     "ignore"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_METHOD_AUTO

+
#define NM_SETTING_IP6_CONFIG_METHOD_AUTO       "auto"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL

+
#define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_METHOD_MANUAL

+
#define NM_SETTING_IP6_CONFIG_METHOD_MANUAL     "manual"
+
+

+

+
+
+
+

NM_SETTING_IP6_CONFIG_METHOD_SHARED

+
#define NM_SETTING_IP6_CONFIG_METHOD_SHARED     "shared"
+
+

+

+
+
+
+

NMIP6Address

+
typedef struct NMIP6Address NMIP6Address;
+
+

+

+
+
+
+

nm_ip6_address_new ()

+
NMIP6Address *      nm_ip6_address_new                  (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_ip6_address_dup ()

+
NMIP6Address *      nm_ip6_address_dup                  (NMIP6Address *source);
+

+

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

source :

+

Returns :

+
+
+
+
+

nm_ip6_address_ref ()

+
void                nm_ip6_address_ref                  (NMIP6Address *address);
+

+

+
++ + + + +

address :

+
+
+
+
+

nm_ip6_address_unref ()

+
void                nm_ip6_address_unref                (NMIP6Address *address);
+

+

+
++ + + + +

address :

+
+
+
+
+

nm_ip6_address_compare ()

+
gboolean            nm_ip6_address_compare              (NMIP6Address *address,
+                                                         NMIP6Address *other);
+

+

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

address :

+

other :

+

Returns :

+
+
+
+
+

nm_ip6_address_get_address ()

+
const struct in6_addr * nm_ip6_address_get_address      (NMIP6Address *address);
+

+

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

address :

+

Returns :

+
+
+
+
+

nm_ip6_address_set_address ()

+
void                nm_ip6_address_set_address          (NMIP6Address *address,
+                                                         const struct in6_addr *addr);
+

+

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

address :

+

addr :

+
+
+
+
+

nm_ip6_address_get_prefix ()

+
guint32             nm_ip6_address_get_prefix           (NMIP6Address *address);
+

+

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

address :

+

Returns :

+
+
+
+
+

nm_ip6_address_set_prefix ()

+
void                nm_ip6_address_set_prefix           (NMIP6Address *address,
+                                                         guint32 prefix);
+

+

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

address :

+

prefix :

+
+
+
+
+

nm_ip6_address_get_gateway ()

+
const struct in6_addr * nm_ip6_address_get_gateway      (NMIP6Address *address);
+

+

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

address :

+

Returns :

+
+
+
+
+

nm_ip6_address_set_gateway ()

+
void                nm_ip6_address_set_gateway          (NMIP6Address *address,
+                                                         const struct in6_addr *gw);
+

+

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

address :

+

gw :

+
+
+
+
+

NMIP6Route

+
typedef struct NMIP6Route NMIP6Route;
+
+

+

+
+
+
+

nm_ip6_route_new ()

+
NMIP6Route *        nm_ip6_route_new                    (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_ip6_route_dup ()

+
NMIP6Route *        nm_ip6_route_dup                    (NMIP6Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip6_route_ref ()

+
void                nm_ip6_route_ref                    (NMIP6Route *route);
+

+

+
++ + + + +

route :

+
+
+
+
+

nm_ip6_route_unref ()

+
void                nm_ip6_route_unref                  (NMIP6Route *route);
+

+

+
++ + + + +

route :

+
+
+
+
+

nm_ip6_route_compare ()

+
gboolean            nm_ip6_route_compare                (NMIP6Route *route,
+                                                         NMIP6Route *other);
+

+

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

route :

+

other :

+

Returns :

+
+
+
+
+

nm_ip6_route_get_dest ()

+
const struct in6_addr * nm_ip6_route_get_dest           (NMIP6Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip6_route_set_dest ()

+
void                nm_ip6_route_set_dest               (NMIP6Route *route,
+                                                         const struct in6_addr *dest);
+

+

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

route :

+

dest :

+
+
+
+
+

nm_ip6_route_get_prefix ()

+
guint32             nm_ip6_route_get_prefix             (NMIP6Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip6_route_set_prefix ()

+
void                nm_ip6_route_set_prefix             (NMIP6Route *route,
+                                                         guint32 prefix);
+

+

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

route :

+

prefix :

+
+
+
+
+

nm_ip6_route_get_next_hop ()

+
const struct in6_addr * nm_ip6_route_get_next_hop       (NMIP6Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip6_route_set_next_hop ()

+
void                nm_ip6_route_set_next_hop           (NMIP6Route *route,
+                                                         const struct in6_addr *next_hop);
+

+

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

route :

+

next_hop :

+
+
+
+
+

nm_ip6_route_get_metric ()

+
guint32             nm_ip6_route_get_metric             (NMIP6Route *route);
+

+

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

route :

+

Returns :

+
+
+
+
+

nm_ip6_route_set_metric ()

+
void                nm_ip6_route_set_metric             (NMIP6Route *route,
+                                                         guint32 metric);
+

+

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

route :

+

metric :

+
+
+
+
+

NMSettingIP6Config

+
typedef struct _NMSettingIP6Config NMSettingIP6Config;
+

+

+
+
+
+

NMSettingIP6ConfigClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingIP6ConfigClass;
+
+

+

+
+
+
+

nm_setting_ip6_config_get_type ()

+
GType               nm_setting_ip6_config_get_type      (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_ip6_config_new ()

+
NMSetting *         nm_setting_ip6_config_new           (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_method ()

+
const char *        nm_setting_ip6_config_get_method    (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_num_dns ()

+
guint32             nm_setting_ip6_config_get_num_dns   (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_dns ()

+
const struct in6_addr * nm_setting_ip6_config_get_dns   (NMSettingIP6Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_add_dns ()

+
gboolean            nm_setting_ip6_config_add_dns       (NMSettingIP6Config *setting,
+                                                         const struct in6_addr *dns);
+

+

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

setting :

+

dns :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_remove_dns ()

+
void                nm_setting_ip6_config_remove_dns    (NMSettingIP6Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_ip6_config_clear_dns ()

+
void                nm_setting_ip6_config_clear_dns     (NMSettingIP6Config *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_ip6_config_get_num_dns_searches ()

+
guint32             nm_setting_ip6_config_get_num_dns_searches
+                                                        (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_dns_search ()

+
const char *        nm_setting_ip6_config_get_dns_search
+                                                        (NMSettingIP6Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_add_dns_search ()

+
gboolean            nm_setting_ip6_config_add_dns_search
+                                                        (NMSettingIP6Config *setting,
+                                                         const char *dns_search);
+

+

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

setting :

+

dns_search :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_remove_dns_search ()

+
void                nm_setting_ip6_config_remove_dns_search
+                                                        (NMSettingIP6Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_ip6_config_clear_dns_searches ()

+
void                nm_setting_ip6_config_clear_dns_searches
+                                                        (NMSettingIP6Config *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_ip6_config_get_num_addresses ()

+
guint32             nm_setting_ip6_config_get_num_addresses
+                                                        (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_address ()

+
NMIP6Address *      nm_setting_ip6_config_get_address   (NMSettingIP6Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_add_address ()

+
gboolean            nm_setting_ip6_config_add_address   (NMSettingIP6Config *setting,
+                                                         NMIP6Address *address);
+

+

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

setting :

+

address :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_remove_address ()

+
void                nm_setting_ip6_config_remove_address
+                                                        (NMSettingIP6Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_ip6_config_clear_addresses ()

+
void                nm_setting_ip6_config_clear_addresses
+                                                        (NMSettingIP6Config *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_ip6_config_get_num_routes ()

+
guint32             nm_setting_ip6_config_get_num_routes
+                                                        (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_route ()

+
NMIP6Route *        nm_setting_ip6_config_get_route     (NMSettingIP6Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_add_route ()

+
gboolean            nm_setting_ip6_config_add_route     (NMSettingIP6Config *setting,
+                                                         NMIP6Route *route);
+

+

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

setting :

+

route :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_remove_route ()

+
void                nm_setting_ip6_config_remove_route  (NMSettingIP6Config *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_ip6_config_clear_routes ()

+
void                nm_setting_ip6_config_clear_routes  (NMSettingIP6Config *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_ip6_config_get_ignore_auto_routes ()

+
gboolean            nm_setting_ip6_config_get_ignore_auto_routes
+                                                        (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_ignore_auto_dns ()

+
gboolean            nm_setting_ip6_config_get_ignore_auto_dns
+                                                        (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_never_default ()

+
gboolean            nm_setting_ip6_config_get_never_default
+                                                        (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ip6_config_get_may_fail ()

+
gboolean            nm_setting_ip6_config_get_may_fail  (NMSettingIP6Config *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "addresses" property

+
  "addresses"                GPtrArray_GValueArray_GArray_guchar_+guint+GArray_guchar___*  : Read / Write
+

+Array of IPv6 address structures. Each IPv6 address structure is +composed of 3 members, the first being a byte array containing the IPv6 +address (network byte order), the second a 32-bit integer containing the +IPv6 address prefix, and the third a byte array containing the IPv6 +address (network byte order) of the gateway associated with this address, +if any. If no gateway is given, the third element should be given as +all zeros. 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. +

+
+
+
+

The "dns" property

+
  "dns"                      GPtrArray_GArray_guchar__*  : Read / Write
+

+Array of DNS servers, where each member of the array is a byte array +containing the IPv6 address of the DNS server (in network byte order). +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. +

+
+
+
+

The "dns-search" property

+
  "dns-search"               GSList_gchararray_*   : Read / Write
+

+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. +

+
+
+
+

The "ignore-auto-dns" property

+
  "ignore-auto-dns"          gboolean              : Read / Write / Construct
+

+When the method is set to 'auto' and this property is set to TRUE, +automatically configured nameservers and search domains are ignored +and only nameservers and search domains specified in +"dns" and "dns-search", if any, are +used. +

+

Default value: FALSE

+
+
+
+

The "ignore-auto-routes" property

+
  "ignore-auto-routes"       gboolean              : Read / Write / Construct
+

+When the method is set to 'auto' and this property is set to TRUE, +automatically configured routes are ignored and only routes specified +in "routes", if any, are used. +

+

Default value: FALSE

+
+
+
+

The "may-fail" property

+
  "may-fail"                 gboolean              : Read / Write / Construct
+

+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. +

+

Default value: FALSE

+
+
+
+

The "method" property

+
  "method"                   gchar*                : Read / Write
+

+IPv6 configuration method. If 'auto' is specified then the appropriate +automatic method (DHCP, PPP, router advertisement, etc) is used for the +interface and most other properties can be left unset. 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 +'ignored' is specified, IPv6 configuration is not done. This property +must be set. NOTE: the 'shared' method are not yet supported. +

+

Default value: NULL

+
+
+
+

The "never-default" property

+
  "never-default"            gboolean              : Read / Write / Construct
+

+If TRUE, this connection will never be the default IPv6 connection, +meaning it will never be assigned the default IPv6 route by NetworkManager. +

+

Default value: FALSE

+
+
+
+

The "routes" property

+
  "routes"                   GPtrArray_GValueArray_GArray_guchar_+guint+GArray_guchar_+guint__*  : Read / Write
+

+Array of IPv6 route structures. Each IPv6 route structure is composed +of 4 members; the first being the destination IPv6 network or +address (network byte order) as a byte array, the second the destination +network or address IPv6 prefix, the third being the next-hop IPv6 address +(network byte order) if any, and the fourth being the route metric. 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. +

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingOlpcMesh.html b/docs/libnm-util/html/NMSettingOlpcMesh.html new file mode 100644 index 00000000..bf918f5e --- /dev/null +++ b/docs/libnm-util/html/NMSettingOlpcMesh.html @@ -0,0 +1,316 @@ + + + + +NMSettingOlpcMesh + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingOlpcMesh

+

NMSettingOlpcMesh

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingOlpcMesh
+
+
+
+

Properties

+
+  "channel"                  guint                 : Read / Write / Construct
+  "dhcp-anycast-address"     GArray_guchar_*       : Read / Write
+  "ssid"                     GArray_guchar_*       : Read / Write
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_OLPC_MESH_SETTING_NAME

+
#define NM_SETTING_OLPC_MESH_SETTING_NAME "802-11-olpc-mesh"
+
+

+

+
+
+
+

enum NMSettingOlpcMeshError

+
typedef enum
+{
+	NM_SETTING_OLPC_MESH_ERROR_UNKNOWN = 0,
+	NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY,
+	NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY
+} NMSettingOlpcMeshError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_OLPC_MESH_ERROR

+
#define NM_TYPE_SETTING_OLPC_MESH_ERROR (nm_setting_olpc_mesh_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_OLPC_MESH_ERROR

+
#define NM_SETTING_OLPC_MESH_ERROR nm_setting_olpc_mesh_error_quark ()
+
+

+

+
+
+
+

nm_setting_olpc_mesh_error_quark ()

+
GQuark              nm_setting_olpc_mesh_error_quark    (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_OLPC_MESH_SSID

+
#define NM_SETTING_OLPC_MESH_SSID                 "ssid"
+
+

+

+
+
+
+

NM_SETTING_OLPC_MESH_CHANNEL

+
#define NM_SETTING_OLPC_MESH_CHANNEL              "channel"
+
+

+

+
+
+
+

NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS

+
#define NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS "dhcp-anycast-address"
+
+

+

+
+
+
+

NMSettingOlpcMesh

+
typedef struct _NMSettingOlpcMesh NMSettingOlpcMesh;
+

+

+
+
+
+

NMSettingOlpcMeshClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingOlpcMeshClass;
+
+

+

+
+
+
+

nm_setting_olpc_mesh_get_type ()

+
GType               nm_setting_olpc_mesh_get_type       (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_olpc_mesh_new ()

+
NMSetting *         nm_setting_olpc_mesh_new            (void);
+

+Creates a new NMSettingOlpcMesh object with default values. +

+
++ + + + +

Returns :

the new empty NMSettingOlpcMesh object +
+
+
+
+

nm_setting_olpc_mesh_get_ssid ()

+
const GByteArray *  nm_setting_olpc_mesh_get_ssid       (NMSettingOlpcMesh *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_olpc_mesh_get_channel ()

+
guint32             nm_setting_olpc_mesh_get_channel    (NMSettingOlpcMesh *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_olpc_mesh_get_dhcp_anycast_address ()

+
const GByteArray *  nm_setting_olpc_mesh_get_dhcp_anycast_address
+                                                        (NMSettingOlpcMesh *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "channel" property

+
  "channel"                  guint                 : Read / Write / Construct
+

+Channel on which the mesh network to join is located. +

+

Default value: 0

+
+
+
+

The "dhcp-anycast-address" property

+
  "dhcp-anycast-address"     GArray_guchar_*       : Read / Write
+

+Anycast DHCP address used when requesting an IP address via DHCP. The +specific anycast address used determines which DHCP server class answers +the request. +

+
+
+
+

The "ssid" property

+
  "ssid"                     GArray_guchar_*       : Read / Write
+

+SSID of the mesh network to join. +

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingPPP.html b/docs/libnm-util/html/NMSettingPPP.html new file mode 100644 index 00000000..e336ef96 --- /dev/null +++ b/docs/libnm-util/html/NMSettingPPP.html @@ -0,0 +1,968 @@ + + + + +NMSettingPPP + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingPPP

+

NMSettingPPP

+
+
+

Synopsis

+
#define             NM_SETTING_PPP_SETTING_NAME
+enum                NMSettingPPPError;
+#define             NM_TYPE_SETTING_PPP_ERROR
+#define             NM_SETTING_PPP_ERROR
+GQuark              nm_setting_ppp_error_quark          (void);
+#define             NM_SETTING_PPP_NOAUTH
+#define             NM_SETTING_PPP_REFUSE_EAP
+#define             NM_SETTING_PPP_REFUSE_PAP
+#define             NM_SETTING_PPP_REFUSE_CHAP
+#define             NM_SETTING_PPP_REFUSE_MSCHAP
+#define             NM_SETTING_PPP_REFUSE_MSCHAPV2
+#define             NM_SETTING_PPP_NOBSDCOMP
+#define             NM_SETTING_PPP_NODEFLATE
+#define             NM_SETTING_PPP_NO_VJ_COMP
+#define             NM_SETTING_PPP_REQUIRE_MPPE
+#define             NM_SETTING_PPP_REQUIRE_MPPE_128
+#define             NM_SETTING_PPP_MPPE_STATEFUL
+#define             NM_SETTING_PPP_CRTSCTS
+#define             NM_SETTING_PPP_BAUD
+#define             NM_SETTING_PPP_MRU
+#define             NM_SETTING_PPP_MTU
+#define             NM_SETTING_PPP_LCP_ECHO_FAILURE
+#define             NM_SETTING_PPP_LCP_ECHO_INTERVAL
+                    NMSettingPPP;
+                    NMSettingPPPClass;
+GType               nm_setting_ppp_get_type             (void);
+NMSetting *         nm_setting_ppp_new                  (void);
+gboolean            nm_setting_ppp_get_noauth           (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_refuse_eap       (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_refuse_pap       (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_refuse_chap      (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_refuse_mschap    (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_refuse_mschapv2  (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_nobsdcomp        (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_nodeflate        (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_no_vj_comp       (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_require_mppe     (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_require_mppe_128 (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_mppe_stateful    (NMSettingPPP *setting);
+gboolean            nm_setting_ppp_get_crtscts          (NMSettingPPP *setting);
+guint32             nm_setting_ppp_get_baud             (NMSettingPPP *setting);
+guint32             nm_setting_ppp_get_mru              (NMSettingPPP *setting);
+guint32             nm_setting_ppp_get_mtu              (NMSettingPPP *setting);
+guint32             nm_setting_ppp_get_lcp_echo_failure (NMSettingPPP *setting);
+guint32             nm_setting_ppp_get_lcp_echo_interval
+                                                        (NMSettingPPP *setting);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingPPP
+
+
+
+

Properties

+
+  "baud"                     guint                 : Read / Write / Construct
+  "crtscts"                  gboolean              : Read / Write / Construct
+  "lcp-echo-failure"         guint                 : Read / Write / Construct
+  "lcp-echo-interval"        guint                 : Read / Write / Construct
+  "mppe-stateful"            gboolean              : Read / Write / Construct
+  "mru"                      guint                 : Read / Write / Construct
+  "mtu"                      guint                 : Read / Write / Construct
+  "no-vj-comp"               gboolean              : Read / Write / Construct
+  "noauth"                   gboolean              : Read / Write / Construct
+  "nobsdcomp"                gboolean              : Read / Write / Construct
+  "nodeflate"                gboolean              : Read / Write / Construct
+  "refuse-chap"              gboolean              : Read / Write / Construct
+  "refuse-eap"               gboolean              : Read / Write / Construct
+  "refuse-mschap"            gboolean              : Read / Write / Construct
+  "refuse-mschapv2"          gboolean              : Read / Write / Construct
+  "refuse-pap"               gboolean              : Read / Write / Construct
+  "require-mppe"             gboolean              : Read / Write / Construct
+  "require-mppe-128"         gboolean              : Read / Write / Construct
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_PPP_SETTING_NAME

+
#define NM_SETTING_PPP_SETTING_NAME "ppp"
+
+

+

+
+
+
+

enum NMSettingPPPError

+
typedef enum
+{
+	NM_SETTING_PPP_ERROR_UNKNOWN = 0,
+	NM_SETTING_PPP_ERROR_INVALID_PROPERTY,
+	NM_SETTING_PPP_ERROR_MISSING_PROPERTY,
+	NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED
+} NMSettingPPPError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_PPP_ERROR

+
#define NM_TYPE_SETTING_PPP_ERROR (nm_setting_ppp_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_PPP_ERROR

+
#define NM_SETTING_PPP_ERROR nm_setting_ppp_error_quark ()
+
+

+

+
+
+
+

nm_setting_ppp_error_quark ()

+
GQuark              nm_setting_ppp_error_quark          (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_PPP_NOAUTH

+
#define NM_SETTING_PPP_NOAUTH            "noauth"
+
+

+

+
+
+
+

NM_SETTING_PPP_REFUSE_EAP

+
#define NM_SETTING_PPP_REFUSE_EAP        "refuse-eap"
+
+

+

+
+
+
+

NM_SETTING_PPP_REFUSE_PAP

+
#define NM_SETTING_PPP_REFUSE_PAP        "refuse-pap"
+
+

+

+
+
+
+

NM_SETTING_PPP_REFUSE_CHAP

+
#define NM_SETTING_PPP_REFUSE_CHAP       "refuse-chap"
+
+

+

+
+
+
+

NM_SETTING_PPP_REFUSE_MSCHAP

+
#define NM_SETTING_PPP_REFUSE_MSCHAP     "refuse-mschap"
+
+

+

+
+
+
+

NM_SETTING_PPP_REFUSE_MSCHAPV2

+
#define NM_SETTING_PPP_REFUSE_MSCHAPV2   "refuse-mschapv2"
+
+

+

+
+
+
+

NM_SETTING_PPP_NOBSDCOMP

+
#define NM_SETTING_PPP_NOBSDCOMP         "nobsdcomp"
+
+

+

+
+
+
+

NM_SETTING_PPP_NODEFLATE

+
#define NM_SETTING_PPP_NODEFLATE         "nodeflate"
+
+

+

+
+
+
+

NM_SETTING_PPP_NO_VJ_COMP

+
#define NM_SETTING_PPP_NO_VJ_COMP        "no-vj-comp"
+
+

+

+
+
+
+

NM_SETTING_PPP_REQUIRE_MPPE

+
#define NM_SETTING_PPP_REQUIRE_MPPE      "require-mppe"
+
+

+

+
+
+
+

NM_SETTING_PPP_REQUIRE_MPPE_128

+
#define NM_SETTING_PPP_REQUIRE_MPPE_128  "require-mppe-128"
+
+

+

+
+
+
+

NM_SETTING_PPP_MPPE_STATEFUL

+
#define NM_SETTING_PPP_MPPE_STATEFUL     "mppe-stateful"
+
+

+

+
+
+
+

NM_SETTING_PPP_CRTSCTS

+
#define NM_SETTING_PPP_CRTSCTS           "crtscts"
+
+

+

+
+
+
+

NM_SETTING_PPP_BAUD

+
#define NM_SETTING_PPP_BAUD              "baud"
+
+

+

+
+
+
+

NM_SETTING_PPP_MRU

+
#define NM_SETTING_PPP_MRU               "mru"
+
+

+

+
+
+
+

NM_SETTING_PPP_MTU

+
#define NM_SETTING_PPP_MTU               "mtu"
+
+

+

+
+
+
+

NM_SETTING_PPP_LCP_ECHO_FAILURE

+
#define NM_SETTING_PPP_LCP_ECHO_FAILURE  "lcp-echo-failure"
+
+

+

+
+
+
+

NM_SETTING_PPP_LCP_ECHO_INTERVAL

+
#define NM_SETTING_PPP_LCP_ECHO_INTERVAL "lcp-echo-interval"
+
+

+

+
+
+
+

NMSettingPPP

+
typedef struct _NMSettingPPP NMSettingPPP;
+

+

+
+
+
+

NMSettingPPPClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingPPPClass;
+
+

+

+
+
+
+

nm_setting_ppp_get_type ()

+
GType               nm_setting_ppp_get_type             (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_ppp_new ()

+
NMSetting *         nm_setting_ppp_new                  (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_ppp_get_noauth ()

+
gboolean            nm_setting_ppp_get_noauth           (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_refuse_eap ()

+
gboolean            nm_setting_ppp_get_refuse_eap       (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_refuse_pap ()

+
gboolean            nm_setting_ppp_get_refuse_pap       (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_refuse_chap ()

+
gboolean            nm_setting_ppp_get_refuse_chap      (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_refuse_mschap ()

+
gboolean            nm_setting_ppp_get_refuse_mschap    (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_refuse_mschapv2 ()

+
gboolean            nm_setting_ppp_get_refuse_mschapv2  (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_nobsdcomp ()

+
gboolean            nm_setting_ppp_get_nobsdcomp        (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_nodeflate ()

+
gboolean            nm_setting_ppp_get_nodeflate        (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_no_vj_comp ()

+
gboolean            nm_setting_ppp_get_no_vj_comp       (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_require_mppe ()

+
gboolean            nm_setting_ppp_get_require_mppe     (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_require_mppe_128 ()

+
gboolean            nm_setting_ppp_get_require_mppe_128 (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_mppe_stateful ()

+
gboolean            nm_setting_ppp_get_mppe_stateful    (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_crtscts ()

+
gboolean            nm_setting_ppp_get_crtscts          (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_baud ()

+
guint32             nm_setting_ppp_get_baud             (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_mru ()

+
guint32             nm_setting_ppp_get_mru              (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_mtu ()

+
guint32             nm_setting_ppp_get_mtu              (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_lcp_echo_failure ()

+
guint32             nm_setting_ppp_get_lcp_echo_failure (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_ppp_get_lcp_echo_interval ()

+
guint32             nm_setting_ppp_get_lcp_echo_interval
+                                                        (NMSettingPPP *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "baud" property

+
  "baud"                     guint                 : Read / Write / Construct
+

+If non-zero, instruct pppd to set the serial port to the specified +baudrate. This value should normally be left as 0 to automatically +choose the speed. +

+

Default value: 0

+
+
+
+

The "crtscts" property

+
  "crtscts"                  gboolean              : Read / Write / Construct
+

+If TRUE, specify that pppd should set the serial port to use hardware +flow control with RTS and CTS signals. This value should normally be +set to FALSE. +

+

Default value: FALSE

+
+
+
+

The "lcp-echo-failure" property

+
  "lcp-echo-failure"         guint                 : Read / Write / Construct
+

+If non-zero, instruct pppd to presume the connection to the peer has +failed if the specified number of LCP echo-requests go unanswered by the +peer. The 'lcp-echo-interval' property must also be set to a non-zero +value if this property is used. +

+

Default value: 0

+
+
+
+

The "lcp-echo-interval" property

+
  "lcp-echo-interval"        guint                 : Read / Write / Construct
+

+If non-zero, instruct pppd to send an LCP echo-request frame to the peer +every n seconds (where n is the specified value). Note that some PPP +peers will respond to echo requests and some will not, and it is not +possible to autodetect this. +

+

Default value: 0

+
+
+
+

The "mppe-stateful" property

+
  "mppe-stateful"            gboolean              : Read / Write / Construct
+

+If TRUE, stateful MPPE is used. See pppd documentation for more +information on stateful MPPE.", +

+

Default value: FALSE

+
+
+
+

The "mru" property

+
  "mru"                      guint                 : Read / Write / Construct
+

+If non-zero, instruct pppd to request that the peer send packets no +larger than the specified size. If non-zero, the MRU should be between +128 and 16384. +

+

Allowed values: <= 16384

+

Default value: 0

+
+
+
+

The "mtu" property

+
  "mtu"                      guint                 : Read / Write / Construct
+

+If non-zero, instruct pppd to send packets no larger than the specified +size. +

+

Default value: 0

+
+
+
+

The "no-vj-comp" property

+
  "no-vj-comp"               gboolean              : Read / Write / Construct
+

+If TRUE, Van Jacobsen TCP header compression will not be requested. +

+

Default value: FALSE

+
+
+
+

The "noauth" property

+
  "noauth"                   gboolean              : Read / Write / Construct
+

+If TRUE, do not require the other side (usually the PPP server) to +authenticate itself to the client. If FALSE, require authentication from +the remote side. In almost all cases, this should be TRUE. +

+

Default value: TRUE

+
+
+
+

The "nobsdcomp" property

+
  "nobsdcomp"                gboolean              : Read / Write / Construct
+

+If TRUE, BSD compression will not be requested. +

+

Default value: FALSE

+
+
+
+

The "nodeflate" property

+
  "nodeflate"                gboolean              : Read / Write / Construct
+

+If TRUE, 'deflate' compression will not be requested. +

+

Default value: FALSE

+
+
+
+

The "refuse-chap" property

+
  "refuse-chap"              gboolean              : Read / Write / Construct
+

+If TRUE, the CHAP authentication method will not be used. +

+

Default value: FALSE

+
+
+
+

The "refuse-eap" property

+
  "refuse-eap"               gboolean              : Read / Write / Construct
+

+If TRUE, the EAP authentication method will not be used. +

+

Default value: FALSE

+
+
+
+

The "refuse-mschap" property

+
  "refuse-mschap"            gboolean              : Read / Write / Construct
+

+If TRUE, the MSCHAP authentication method will not be used. +

+

Default value: FALSE

+
+
+
+

The "refuse-mschapv2" property

+
  "refuse-mschapv2"          gboolean              : Read / Write / Construct
+

+If TRUE, the MSCHAPv2 authentication method will not be used. +

+

Default value: FALSE

+
+
+
+

The "refuse-pap" property

+
  "refuse-pap"               gboolean              : Read / Write / Construct
+

+If TRUE, the PAP authentication method will not be used. +

+

Default value: FALSE

+
+
+
+

The "require-mppe" property

+
  "require-mppe"             gboolean              : Read / Write / Construct
+

+If TRUE, MPPE (Microsoft Point-to-Point Encrpytion) will be required for +the PPP session. If either 64-bit or 128-bit MPPE is not available the +session will fail. Note that MPPE is not used on mobile broadband +connections. +

+

Default value: FALSE

+
+
+
+

The "require-mppe-128" property

+
  "require-mppe-128"         gboolean              : Read / Write / Construct
+

+If TRUE, 128-bit MPPE (Microsoft Point-to-Point Encrpytion) will be +required for the PPP session, and the 'require-mppe' property must also +be set to TRUE. If 128-bit MPPE is not available the session will fail. +

+

Default value: FALSE

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingPPPOE.html b/docs/libnm-util/html/NMSettingPPPOE.html new file mode 100644 index 00000000..baa6bffc --- /dev/null +++ b/docs/libnm-util/html/NMSettingPPPOE.html @@ -0,0 +1,317 @@ + + + + +NMSettingPPPOE + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingPPPOE

+

NMSettingPPPOE

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingPPPOE
+
+
+
+

Properties

+
+  "password"                 gchar*                : Read / Write
+  "service"                  gchar*                : Read / Write
+  "username"                 gchar*                : Read / Write
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_PPPOE_SETTING_NAME

+
#define NM_SETTING_PPPOE_SETTING_NAME "pppoe"
+
+

+

+
+
+
+

enum NMSettingPPPOEError

+
typedef enum
+{
+	NM_SETTING_PPPOE_ERROR_UNKNOWN = 0,
+	NM_SETTING_PPPOE_ERROR_INVALID_PROPERTY,
+	NM_SETTING_PPPOE_ERROR_MISSING_PROPERTY,
+	NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING
+} NMSettingPPPOEError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_PPPOE_ERROR

+
#define NM_TYPE_SETTING_PPPOE_ERROR (nm_setting_pppoe_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_PPPOE_ERROR

+
#define NM_SETTING_PPPOE_ERROR nm_setting_pppoe_error_quark ()
+
+

+

+
+
+
+

nm_setting_pppoe_error_quark ()

+
GQuark              nm_setting_pppoe_error_quark        (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_PPPOE_SERVICE

+
#define NM_SETTING_PPPOE_SERVICE  "service"
+
+

+

+
+
+
+

NM_SETTING_PPPOE_USERNAME

+
#define NM_SETTING_PPPOE_USERNAME "username"
+
+

+

+
+
+
+

NM_SETTING_PPPOE_PASSWORD

+
#define NM_SETTING_PPPOE_PASSWORD "password"
+
+

+

+
+
+
+

NMSettingPPPOE

+
typedef struct _NMSettingPPPOE NMSettingPPPOE;
+

+

+
+
+
+

NMSettingPPPOEClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingPPPOEClass;
+
+

+

+
+
+
+

nm_setting_pppoe_get_type ()

+
GType               nm_setting_pppoe_get_type           (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_pppoe_new ()

+
NMSetting *         nm_setting_pppoe_new                (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_pppoe_get_service ()

+
const char *        nm_setting_pppoe_get_service        (NMSettingPPPOE *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_pppoe_get_username ()

+
const char *        nm_setting_pppoe_get_username       (NMSettingPPPOE *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_pppoe_get_password ()

+
const char *        nm_setting_pppoe_get_password       (NMSettingPPPOE *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "password" property

+
  "password"                 gchar*                : Read / Write
+

+Password used to authenticate with the PPPoE service. +

+

Default value: NULL

+
+
+
+

The "service" property

+
  "service"                  gchar*                : Read / Write
+

+If specified, instruct PPPoE to only initiate sessions with access +concentrators that provide the specified serivce. For most providers, +this should be left blank. It is only required if there are multiple +access concentrators or a specific service is known to be required. +

+

Default value: NULL

+
+
+
+

The "username" property

+
  "username"                 gchar*                : Read / Write
+

+Username used to authenticate with the PPPoE service. +

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingSerial.html b/docs/libnm-util/html/NMSettingSerial.html new file mode 100644 index 00000000..5f45e7f9 --- /dev/null +++ b/docs/libnm-util/html/NMSettingSerial.html @@ -0,0 +1,405 @@ + + + + +NMSettingSerial + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingSerial

+

NMSettingSerial

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingSerial
+
+
+
+

Properties

+
+  "baud"                     guint                 : Read / Write / Construct
+  "bits"                     guint                 : Read / Write / Construct
+  "parity"                   gchar                 : Read / Write / Construct
+  "send-delay"               guint64               : Read / Write / Construct
+  "stopbits"                 guint                 : Read / Write / Construct
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_SERIAL_SETTING_NAME

+
#define NM_SETTING_SERIAL_SETTING_NAME "serial"
+
+

+

+
+
+
+

enum NMSettingSerialError

+
typedef enum
+{
+	NM_SETTING_SERIAL_ERROR_UNKNOWN = 0,
+	NM_SETTING_SERIAL_ERROR_INVALID_PROPERTY,
+	NM_SETTING_SERIAL_ERROR_MISSING_PROPERTY,
+	NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING
+} NMSettingSerialError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_SERIAL_ERROR

+
#define NM_TYPE_SETTING_SERIAL_ERROR (nm_setting_serial_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_SERIAL_ERROR

+
#define NM_SETTING_SERIAL_ERROR nm_setting_serial_error_quark ()
+
+

+

+
+
+
+

nm_setting_serial_error_quark ()

+
GQuark              nm_setting_serial_error_quark       (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_SERIAL_BAUD

+
#define NM_SETTING_SERIAL_BAUD "baud"
+
+

+

+
+
+
+

NM_SETTING_SERIAL_BITS

+
#define NM_SETTING_SERIAL_BITS "bits"
+
+

+

+
+
+
+

NM_SETTING_SERIAL_PARITY

+
#define NM_SETTING_SERIAL_PARITY "parity"
+
+

+

+
+
+
+

NM_SETTING_SERIAL_STOPBITS

+
#define NM_SETTING_SERIAL_STOPBITS "stopbits"
+
+

+

+
+
+
+

NM_SETTING_SERIAL_SEND_DELAY

+
#define NM_SETTING_SERIAL_SEND_DELAY "send-delay"
+
+

+

+
+
+
+

NMSettingSerial

+
typedef struct _NMSettingSerial NMSettingSerial;
+

+

+
+
+
+

NMSettingSerialClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingSerialClass;
+
+

+

+
+
+
+

nm_setting_serial_get_type ()

+
GType               nm_setting_serial_get_type          (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_serial_new ()

+
NMSetting *         nm_setting_serial_new               (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_serial_get_baud ()

+
guint               nm_setting_serial_get_baud          (NMSettingSerial *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_serial_get_bits ()

+
guint               nm_setting_serial_get_bits          (NMSettingSerial *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_serial_get_parity ()

+
char                nm_setting_serial_get_parity        (NMSettingSerial *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_serial_get_stopbits ()

+
guint               nm_setting_serial_get_stopbits      (NMSettingSerial *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_serial_get_send_delay ()

+
guint64             nm_setting_serial_get_send_delay    (NMSettingSerial *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "baud" property

+
  "baud"                     guint                 : Read / Write / Construct
+

+Speed to use for communication over the serial port. Note that this value +usually has no effect for mobile broadband modems as they generally +ignore speed settings and use the highest available speed. +

+

Default value: 57600

+
+
+
+

The "bits" property

+
  "bits"                     guint                 : Read / Write / Construct
+

+Byte-width of the serial communication. +

+

Allowed values: [5,8]

+

Default value: 8

+
+
+
+

The "parity" property

+
  "parity"                   gchar                 : Read / Write / Construct
+

+Parity setting of the serial port. Either 'E' for even parity, 'o' for +odd parity, or 'n' for no parity. +

+

Allowed values: [69,111]

+

Default value: 110

+
+
+
+

The "send-delay" property

+
  "send-delay"               guint64               : Read / Write / Construct
+

+Time to delay between each byte sent to the modem, in microseconds. +

+

Default value: 0

+
+
+
+

The "stopbits" property

+
  "stopbits"                 guint                 : Read / Write / Construct
+

+Number of stop bits for communication on the serial port. Either 1 or 2. +The 1 in '8n1' for example. +

+

Allowed values: [1,2]

+

Default value: 1

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingVPN.html b/docs/libnm-util/html/NMSettingVPN.html new file mode 100644 index 00000000..15bd338b --- /dev/null +++ b/docs/libnm-util/html/NMSettingVPN.html @@ -0,0 +1,579 @@ + + + + +NMSettingVPN + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingVPN

+

NMSettingVPN

+
+
+

Synopsis

+
#define             NM_SETTING_VPN_SETTING_NAME
+enum                NMSettingVpnError;
+#define             NM_TYPE_SETTING_VPN_ERROR
+#define             NM_SETTING_VPN_ERROR
+GQuark              nm_setting_vpn_error_quark          (void);
+#define             NM_SETTING_VPN_SERVICE_TYPE
+#define             NM_SETTING_VPN_USER_NAME
+#define             NM_SETTING_VPN_DATA
+#define             NM_SETTING_VPN_SECRETS
+                    NMSettingVPN;
+                    NMSettingVPNClass;
+void                (*VPNIterFunc)                      (const char *key,
+                                                         const char *value,
+                                                         gpointer user_data);
+GType               nm_setting_vpn_get_type             (void);
+NMSetting *         nm_setting_vpn_new                  (void);
+const char *        nm_setting_vpn_get_service_type     (NMSettingVPN *setting);
+const char *        nm_setting_vpn_get_user_name        (NMSettingVPN *setting);
+void                nm_setting_vpn_add_data_item        (NMSettingVPN *setting,
+                                                         const char *key,
+                                                         const char *item);
+const char *        nm_setting_vpn_get_data_item        (NMSettingVPN *setting,
+                                                         const char *key);
+void                nm_setting_vpn_remove_data_item     (NMSettingVPN *setting,
+                                                         const char *key);
+void                nm_setting_vpn_foreach_data_item    (NMSettingVPN *setting,
+                                                         VPNIterFunc func,
+                                                         gpointer user_data);
+void                nm_setting_vpn_add_secret           (NMSettingVPN *setting,
+                                                         const char *key,
+                                                         const char *secret);
+const char *        nm_setting_vpn_get_secret           (NMSettingVPN *setting,
+                                                         const char *key);
+void                nm_setting_vpn_remove_secret        (NMSettingVPN *setting,
+                                                         const char *key);
+void                nm_setting_vpn_foreach_secret       (NMSettingVPN *setting,
+                                                         VPNIterFunc func,
+                                                         gpointer user_data);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingVPN
+
+
+
+

Properties

+
+  "data"                     GHashTable_gchararray+gchararray_*  : Read / Write
+  "secrets"                  GHashTable_gchararray+gchararray_*  : Read / Write
+  "service-type"             gchar*                : Read / Write
+  "user-name"                gchar*                : Read / Write
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_VPN_SETTING_NAME

+
#define NM_SETTING_VPN_SETTING_NAME "vpn"
+
+

+

+
+
+
+

enum NMSettingVpnError

+
typedef enum
+{
+	NM_SETTING_VPN_ERROR_UNKNOWN = 0,
+	NM_SETTING_VPN_ERROR_INVALID_PROPERTY,
+	NM_SETTING_VPN_ERROR_MISSING_PROPERTY,
+} NMSettingVpnError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_VPN_ERROR

+
#define NM_TYPE_SETTING_VPN_ERROR (nm_setting_vpn_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_VPN_ERROR

+
#define NM_SETTING_VPN_ERROR nm_setting_vpn_error_quark ()
+
+

+

+
+
+
+

nm_setting_vpn_error_quark ()

+
GQuark              nm_setting_vpn_error_quark          (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_VPN_SERVICE_TYPE

+
#define NM_SETTING_VPN_SERVICE_TYPE "service-type"
+
+

+

+
+
+
+

NM_SETTING_VPN_USER_NAME

+
#define NM_SETTING_VPN_USER_NAME    "user-name"
+
+

+

+
+
+
+

NM_SETTING_VPN_DATA

+
#define NM_SETTING_VPN_DATA         "data"
+
+

+

+
+
+
+

NM_SETTING_VPN_SECRETS

+
#define NM_SETTING_VPN_SECRETS      "secrets"
+
+

+

+
+
+
+

NMSettingVPN

+
typedef struct _NMSettingVPN NMSettingVPN;
+

+

+
+
+
+

NMSettingVPNClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingVPNClass;
+
+

+

+
+
+
+

VPNIterFunc ()

+
void                (*VPNIterFunc)                      (const char *key,
+                                                         const char *value,
+                                                         gpointer user_data);
+

+

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

key :

+

value :

+

user_data :

+
+
+
+
+

nm_setting_vpn_get_type ()

+
GType               nm_setting_vpn_get_type             (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_vpn_new ()

+
NMSetting *         nm_setting_vpn_new                  (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_vpn_get_service_type ()

+
const char *        nm_setting_vpn_get_service_type     (NMSettingVPN *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_vpn_get_user_name ()

+
const char *        nm_setting_vpn_get_user_name        (NMSettingVPN *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_vpn_add_data_item ()

+
void                nm_setting_vpn_add_data_item        (NMSettingVPN *setting,
+                                                         const char *key,
+                                                         const char *item);
+

+

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

setting :

+

key :

+

item :

+
+
+
+
+

nm_setting_vpn_get_data_item ()

+
const char *        nm_setting_vpn_get_data_item        (NMSettingVPN *setting,
+                                                         const char *key);
+

+

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

setting :

+

key :

+

Returns :

+
+
+
+
+

nm_setting_vpn_remove_data_item ()

+
void                nm_setting_vpn_remove_data_item     (NMSettingVPN *setting,
+                                                         const char *key);
+

+

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

setting :

+

key :

+
+
+
+
+

nm_setting_vpn_foreach_data_item ()

+
void                nm_setting_vpn_foreach_data_item    (NMSettingVPN *setting,
+                                                         VPNIterFunc func,
+                                                         gpointer user_data);
+

+

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

setting :

+

func :

+

user_data :

+
+
+
+
+

nm_setting_vpn_add_secret ()

+
void                nm_setting_vpn_add_secret           (NMSettingVPN *setting,
+                                                         const char *key,
+                                                         const char *secret);
+

+

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

setting :

+

key :

+

secret :

+
+
+
+
+

nm_setting_vpn_get_secret ()

+
const char *        nm_setting_vpn_get_secret           (NMSettingVPN *setting,
+                                                         const char *key);
+

+

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

setting :

+

key :

+

Returns :

+
+
+
+
+

nm_setting_vpn_remove_secret ()

+
void                nm_setting_vpn_remove_secret        (NMSettingVPN *setting,
+                                                         const char *key);
+

+

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

setting :

+

key :

+
+
+
+
+

nm_setting_vpn_foreach_secret ()

+
void                nm_setting_vpn_foreach_secret       (NMSettingVPN *setting,
+                                                         VPNIterFunc func,
+                                                         gpointer user_data);
+

+

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

setting :

+

func :

+

user_data :

+
+
+
+
+

Property Details

+
+

The "data" property

+
  "data"                     GHashTable_gchararray+gchararray_*  : Read / Write
+

+Dictionary of key/value pairs of VPN plugin specific data. Both keys +and values must be strings. +

+
+
+
+

The "secrets" property

+
  "secrets"                  GHashTable_gchararray+gchararray_*  : Read / Write
+

+Dictionary of key/value pairs of VPN plugin specific secrets like +passwords or private keys. Both keys and values must be strings. +

+
+
+
+

The "service-type" property

+
  "service-type"             gchar*                : Read / Write
+

+D-Bus service name of the VPN plugin that this setting uses to connect +to its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc +plugin. +

+

Default value: NULL

+
+
+
+

The "user-name" property

+
  "user-name"                gchar*                : Read / Write
+

User name of the currently logged in user for connections provided by the user settings service. This name is provided to the VPN plugin to use in lieu of a custom username provided by that VPN plugins specific configuration. The VPN plugin itself decides which user name to use.

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingWired.html b/docs/libnm-util/html/NMSettingWired.html new file mode 100644 index 00000000..8fc96619 --- /dev/null +++ b/docs/libnm-util/html/NMSettingWired.html @@ -0,0 +1,444 @@ + + + + +NMSettingWired + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingWired

+

NMSettingWired

+
+ +
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingWired
+
+
+
+

Properties

+
+  "auto-negotiate"           gboolean              : Read / Write / Construct
+  "duplex"                   gchar*                : Read / Write
+  "mac-address"              GArray_guchar_*       : Read / Write
+  "mtu"                      guint                 : Read / Write / Construct
+  "port"                     gchar*                : Read / Write
+  "speed"                    guint                 : Read / Write / Construct
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_WIRED_SETTING_NAME

+
#define NM_SETTING_WIRED_SETTING_NAME "802-3-ethernet"
+
+

+

+
+
+
+

enum NMSettingWiredError

+
typedef enum
+{
+	NM_SETTING_WIRED_ERROR_UNKNOWN = 0,
+	NM_SETTING_WIRED_ERROR_INVALID_PROPERTY,
+	NM_SETTING_WIRED_ERROR_MISSING_PROPERTY
+} NMSettingWiredError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_WIRED_ERROR

+
#define NM_TYPE_SETTING_WIRED_ERROR (nm_setting_wired_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_WIRED_ERROR

+
#define NM_SETTING_WIRED_ERROR nm_setting_wired_error_quark ()
+
+

+

+
+
+
+

nm_setting_wired_error_quark ()

+
GQuark              nm_setting_wired_error_quark        (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_WIRED_PORT

+
#define NM_SETTING_WIRED_PORT "port"
+
+

+

+
+
+
+

NM_SETTING_WIRED_SPEED

+
#define NM_SETTING_WIRED_SPEED "speed"
+
+

+

+
+
+
+

NM_SETTING_WIRED_DUPLEX

+
#define NM_SETTING_WIRED_DUPLEX "duplex"
+
+

+

+
+
+
+

NM_SETTING_WIRED_AUTO_NEGOTIATE

+
#define NM_SETTING_WIRED_AUTO_NEGOTIATE "auto-negotiate"
+
+

+

+
+
+
+

NM_SETTING_WIRED_MAC_ADDRESS

+
#define NM_SETTING_WIRED_MAC_ADDRESS "mac-address"
+
+

+

+
+
+
+

NM_SETTING_WIRED_MTU

+
#define NM_SETTING_WIRED_MTU "mtu"
+
+

+

+
+
+
+

NMSettingWired

+
typedef struct _NMSettingWired NMSettingWired;
+

+

+
+
+
+

NMSettingWiredClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingWiredClass;
+
+

+

+
+
+
+

nm_setting_wired_get_type ()

+
GType               nm_setting_wired_get_type           (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_wired_new ()

+
NMSetting *         nm_setting_wired_new                (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_wired_get_port ()

+
const char *        nm_setting_wired_get_port           (NMSettingWired *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wired_get_speed ()

+
guint32             nm_setting_wired_get_speed          (NMSettingWired *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wired_get_duplex ()

+
const char *        nm_setting_wired_get_duplex         (NMSettingWired *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wired_get_auto_negotiate ()

+
gboolean            nm_setting_wired_get_auto_negotiate (NMSettingWired *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wired_get_mac_address ()

+
const GByteArray *  nm_setting_wired_get_mac_address    (NMSettingWired *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wired_get_mtu ()

+
guint32             nm_setting_wired_get_mtu            (NMSettingWired *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "auto-negotiate" property

+
  "auto-negotiate"           gboolean              : Read / Write / Construct
+

If TRUE, allow auto-negotiation of port speed and duplex mode. If FALSE, do not allow auto-negotiation,in which case the 'speed' and 'duplex' properties should be set.

+

Default value: TRUE

+
+
+
+

The "duplex" property

+
  "duplex"                   gchar*                : Read / Write
+

+If specified, request that the device only use the specified duplex mode. +Either 'half' or 'full'. +

+

Default value: NULL

+
+
+
+

The "mac-address" property

+
  "mac-address"              GArray_guchar_*       : Read / Write
+

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

+
+
+
+

The "mtu" property

+
  "mtu"                      guint                 : Read / Write / Construct
+

+If non-zero, only transmit packets of the specified size or smaller, +breaking larger packets up into multiple Ethernet frames. +

+

Default value: 0

+
+
+
+

The "port" property

+
  "port"                     gchar*                : Read / Write
+

+Specific port type to use if multiple the device supports multiple +attachment methods. One of 'tp' (Twisted Pair), 'aui' (Attachment Unit +Interface), 'bnc' (Thin Ethernet) or 'mii' (Media Independent Interface. +If the device supports only one port type, this setting is ignored. +

+

Default value: NULL

+
+
+
+

The "speed" property

+
  "speed"                    guint                 : Read / Write / Construct
+

+If non-zero, request that the device use only the specified speed. +In Mbit/s, ie 100 == 100Mbit/s. +

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingWireless.html b/docs/libnm-util/html/NMSettingWireless.html new file mode 100644 index 00000000..d03c4b72 --- /dev/null +++ b/docs/libnm-util/html/NMSettingWireless.html @@ -0,0 +1,797 @@ + + + + +NMSettingWireless + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingWireless

+

NMSettingWireless

+
+
+

Synopsis

+
#define             NM_SETTING_WIRELESS_SETTING_NAME
+enum                NMSettingWirelessError;
+#define             NM_TYPE_SETTING_WIRELESS_ERROR
+#define             NM_SETTING_WIRELESS_ERROR
+GQuark              nm_setting_wireless_error_quark     (void);
+#define             NM_SETTING_WIRELESS_SSID
+#define             NM_SETTING_WIRELESS_MODE
+#define             NM_SETTING_WIRELESS_BAND
+#define             NM_SETTING_WIRELESS_CHANNEL
+#define             NM_SETTING_WIRELESS_BSSID
+#define             NM_SETTING_WIRELESS_RATE
+#define             NM_SETTING_WIRELESS_TX_POWER
+#define             NM_SETTING_WIRELESS_MAC_ADDRESS
+#define             NM_SETTING_WIRELESS_MTU
+#define             NM_SETTING_WIRELESS_SEEN_BSSIDS
+#define             NM_SETTING_WIRELESS_SEC
+                    NMSettingWireless;
+                    NMSettingWirelessClass;
+GType               nm_setting_wireless_get_type        (void);
+NMSetting *         nm_setting_wireless_new             (void);
+const GByteArray *  nm_setting_wireless_get_ssid        (NMSettingWireless *setting);
+const char *        nm_setting_wireless_get_mode        (NMSettingWireless *setting);
+const char *        nm_setting_wireless_get_band        (NMSettingWireless *setting);
+guint32             nm_setting_wireless_get_channel     (NMSettingWireless *setting);
+const GByteArray *  nm_setting_wireless_get_bssid       (NMSettingWireless *setting);
+guint32             nm_setting_wireless_get_rate        (NMSettingWireless *setting);
+guint32             nm_setting_wireless_get_tx_power    (NMSettingWireless *setting);
+const GByteArray *  nm_setting_wireless_get_mac_address (NMSettingWireless *setting);
+guint32             nm_setting_wireless_get_mtu         (NMSettingWireless *setting);
+const char *        nm_setting_wireless_get_security    (NMSettingWireless *setting);
+gboolean            nm_setting_wireless_add_seen_bssid  (NMSettingWireless *setting,
+                                                         const char *bssid);
+guint32             nm_setting_wireless_get_num_seen_bssids
+                                                        (NMSettingWireless *setting);
+const char *        nm_setting_wireless_get_seen_bssid  (NMSettingWireless *setting,
+                                                         guint32 i);
+gboolean            nm_setting_wireless_ap_security_compatible
+                                                        (NMSettingWireless *s_wireless,
+                                                         NMSettingWirelessSecurity *s_wireless_sec,
+                                                         guint32 ap_flags,
+                                                         guint32 ap_wpa,
+                                                         guint32 ap_rsn,
+                                                         guint32 ap_mode);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingWireless
+
+
+
+

Properties

+
+  "band"                     gchar*                : Read / Write
+  "bssid"                    GArray_guchar_*       : Read / Write
+  "channel"                  guint                 : Read / Write / Construct
+  "mac-address"              GArray_guchar_*       : Read / Write
+  "mode"                     gchar*                : Read / Write
+  "mtu"                      guint                 : Read / Write / Construct
+  "rate"                     guint                 : Read / Write / Construct
+  "security"                 gchar*                : Read / Write
+  "seen-bssids"              GSList_gchararray_*   : Read / Write
+  "ssid"                     GArray_guchar_*       : Read / Write
+  "tx-power"                 guint                 : Read / Write / Construct
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_WIRELESS_SETTING_NAME

+
#define NM_SETTING_WIRELESS_SETTING_NAME "802-11-wireless"
+
+

+

+
+
+
+

enum NMSettingWirelessError

+
typedef enum
+{
+	NM_SETTING_WIRELESS_ERROR_UNKNOWN = 0,
+	NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
+	NM_SETTING_WIRELESS_ERROR_MISSING_PROPERTY,
+	NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING,
+	NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND
+} NMSettingWirelessError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_WIRELESS_ERROR

+
#define NM_TYPE_SETTING_WIRELESS_ERROR (nm_setting_wireless_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_ERROR

+
#define NM_SETTING_WIRELESS_ERROR nm_setting_wireless_error_quark ()
+
+

+

+
+
+
+

nm_setting_wireless_error_quark ()

+
GQuark              nm_setting_wireless_error_quark     (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

NM_SETTING_WIRELESS_SSID

+
#define NM_SETTING_WIRELESS_SSID        "ssid"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_MODE

+
#define NM_SETTING_WIRELESS_MODE        "mode"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_BAND

+
#define NM_SETTING_WIRELESS_BAND        "band"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_CHANNEL

+
#define NM_SETTING_WIRELESS_CHANNEL     "channel"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_BSSID

+
#define NM_SETTING_WIRELESS_BSSID       "bssid"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_RATE

+
#define NM_SETTING_WIRELESS_RATE        "rate"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_TX_POWER

+
#define NM_SETTING_WIRELESS_TX_POWER    "tx-power"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_MAC_ADDRESS

+
#define NM_SETTING_WIRELESS_MAC_ADDRESS "mac-address"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_MTU

+
#define NM_SETTING_WIRELESS_MTU         "mtu"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SEEN_BSSIDS

+
#define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SEC

+
#define NM_SETTING_WIRELESS_SEC         "security"
+
+

+

+
+
+
+

NMSettingWireless

+
typedef struct _NMSettingWireless NMSettingWireless;
+

+

+
+
+
+

NMSettingWirelessClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingWirelessClass;
+
+

+

+
+
+
+

nm_setting_wireless_get_type ()

+
GType               nm_setting_wireless_get_type        (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_wireless_new ()

+
NMSetting *         nm_setting_wireless_new             (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_wireless_get_ssid ()

+
const GByteArray *  nm_setting_wireless_get_ssid        (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_mode ()

+
const char *        nm_setting_wireless_get_mode        (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_band ()

+
const char *        nm_setting_wireless_get_band        (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_channel ()

+
guint32             nm_setting_wireless_get_channel     (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_bssid ()

+
const GByteArray *  nm_setting_wireless_get_bssid       (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_rate ()

+
guint32             nm_setting_wireless_get_rate        (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_tx_power ()

+
guint32             nm_setting_wireless_get_tx_power    (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_mac_address ()

+
const GByteArray *  nm_setting_wireless_get_mac_address (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_mtu ()

+
guint32             nm_setting_wireless_get_mtu         (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_security ()

+
const char *        nm_setting_wireless_get_security    (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_add_seen_bssid ()

+
gboolean            nm_setting_wireless_add_seen_bssid  (NMSettingWireless *setting,
+                                                         const char *bssid);
+

+

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

setting :

+

bssid :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_num_seen_bssids ()

+
guint32             nm_setting_wireless_get_num_seen_bssids
+                                                        (NMSettingWireless *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_get_seen_bssid ()

+
const char *        nm_setting_wireless_get_seen_bssid  (NMSettingWireless *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_wireless_ap_security_compatible ()

+
gboolean            nm_setting_wireless_ap_security_compatible
+                                                        (NMSettingWireless *s_wireless,
+                                                         NMSettingWirelessSecurity *s_wireless_sec,
+                                                         guint32 ap_flags,
+                                                         guint32 ap_wpa,
+                                                         guint32 ap_rsn,
+                                                         guint32 ap_mode);
+

+

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

s_wireless :

+

s_wireless_sec :

+

ap_flags :

+

ap_wpa :

+

ap_rsn :

+

ap_mode :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "band" property

+
  "band"                     gchar*                : Read / Write
+

+802.11 frequency band of the network. One of 'a' for 5GHz 802.11a or +'bg' for 2.4GHz 802.11. This will lock associations to the WiFi network +to the specific band, i.e. if 'a' is specified, the device will not +associate with the same network in the 2.4GHz band even if the network's +settings are compatible. This setting depends on specific driver +capability and may not work with all drivers. +

+

Default value: NULL

+
+
+
+

The "bssid" property

+
  "bssid"                    GArray_guchar_*       : Read / Write
+

+If specified, directs the device to only associate with the given access +point. This capability is highly driver dependent and not supported by +all devices. Note: this property does not control the BSSID used when +creating an Ad-Hoc network and is unlikely to in the future. +

+
+
+
+

The "channel" property

+
  "channel"                  guint                 : Read / Write / Construct
+

+Wireless channel to use for the WiFi connection. The device will only +join (or create for Ad-Hoc networks) a WiFi network on the specified +channel. Because channel numbers overlap between bands, this property +also requires the 'band' property to be set. +

+

Default value: 0

+
+
+
+

The "mac-address" property

+
  "mac-address"              GArray_guchar_*       : Read / Write
+

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

+
+
+
+

The "mode" property

+
  "mode"                     gchar*                : Read / Write
+

+WiFi network mode; one of 'infrastructure' or 'adhoc'. If blank, +infrastructure is assumed. +

+

Default value: NULL

+
+
+
+

The "mtu" property

+
  "mtu"                      guint                 : Read / Write / Construct
+

+If non-zero, only transmit packets of the specified size or smaller, +breaking larger packets up into multiple Ethernet frames. +

+

Default value: 0

+
+
+
+

The "rate" property

+
  "rate"                     guint                 : Read / Write / Construct
+

+If non-zero, directs the device to only use the specified bitrate for +communication with the access point. Units are in Kb/s, ie 5500 = 5.5 +Mbit/s. This property is highly driver dependent and not all devices +support setting a static bitrate. +

+

Default value: 0

+
+
+
+

The "security" property

+
  "security"                 gchar*                : Read / Write
+

+If the wireless connection has any security restrictions, like 802.1x, +WEP, or WPA, set this property to '802-11-wireless-security' and ensure +the connection contains a valid 802-11-wireless-security setting. +

+

Default value: NULL

+
+
+
+

The "seen-bssids" property

+
  "seen-bssids"              GSList_gchararray_*   : Read / Write
+

+A list of BSSIDs (each BSSID formatted as a MAC address like +'00:11:22:33:44:55') that have been detected as part of the WiFI network. +The settings service will usually populate this property by periodically +asking NetworkManager what the device's current AP is while connected +to the network (or monitoring the device's 'active-ap' property) and +adding the current AP'sBSSID to this list. This list helps NetworkManager +find hidden APs by matching up scan results with the BSSIDs in this list. +

+
+
+
+

The "ssid" property

+
  "ssid"                     GArray_guchar_*       : Read / Write
+

+SSID of the WiFi network. +

+
+
+
+

The "tx-power" property

+
  "tx-power"                 guint                 : Read / Write / Construct
+

+If non-zero, directs the device to use the specified transmit power. +Units are dBm. This property is highly driver dependent and not all +devices support setting a static transmit power. +

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/NMSettingWirelessSecurity.html b/docs/libnm-util/html/NMSettingWirelessSecurity.html new file mode 100644 index 00000000..6c65b5fc --- /dev/null +++ b/docs/libnm-util/html/NMSettingWirelessSecurity.html @@ -0,0 +1,1151 @@ + + + + +NMSettingWirelessSecurity + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingWirelessSecurity

+

NMSettingWirelessSecurity

+
+
+

Synopsis

+
#define             NM_SETTING_WIRELESS_SECURITY_SETTING_NAME
+enum                NMSettingWirelessSecurityError;
+#define             NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR
+#define             NM_SETTING_WIRELESS_SECURITY_ERROR
+GQuark              nm_setting_wireless_security_error_quark
+                                                        (void);
+enum                NMWepKeyType;
+#define             NM_SETTING_WIRELESS_SECURITY_KEY_MGMT
+#define             NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX
+#define             NM_SETTING_WIRELESS_SECURITY_AUTH_ALG
+#define             NM_SETTING_WIRELESS_SECURITY_PROTO
+#define             NM_SETTING_WIRELESS_SECURITY_PAIRWISE
+#define             NM_SETTING_WIRELESS_SECURITY_GROUP
+#define             NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME
+#define             NM_SETTING_WIRELESS_SECURITY_WEP_KEY0
+#define             NM_SETTING_WIRELESS_SECURITY_WEP_KEY1
+#define             NM_SETTING_WIRELESS_SECURITY_WEP_KEY2
+#define             NM_SETTING_WIRELESS_SECURITY_WEP_KEY3
+#define             NM_SETTING_WIRELESS_SECURITY_PSK
+#define             NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD
+#define             NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE
+                    NMSettingWirelessSecurity;
+                    NMSettingWirelessSecurityClass;
+GType               nm_setting_wireless_security_get_type
+                                                        (void);
+NMSetting *         nm_setting_wireless_security_new    (void);
+const char *        nm_setting_wireless_security_get_key_mgmt
+                                                        (NMSettingWirelessSecurity *setting);
+guint32             nm_setting_wireless_security_get_num_protos
+                                                        (NMSettingWirelessSecurity *setting);
+const char *        nm_setting_wireless_security_get_proto
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+gboolean            nm_setting_wireless_security_add_proto
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         const char *proto);
+void                nm_setting_wireless_security_remove_proto
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+void                nm_setting_wireless_security_clear_protos
+                                                        (NMSettingWirelessSecurity *setting);
+guint32             nm_setting_wireless_security_get_num_pairwise
+                                                        (NMSettingWirelessSecurity *setting);
+const char *        nm_setting_wireless_security_get_pairwise
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+gboolean            nm_setting_wireless_security_add_pairwise
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         const char *pairwise);
+void                nm_setting_wireless_security_remove_pairwise
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+void                nm_setting_wireless_security_clear_pairwise
+                                                        (NMSettingWirelessSecurity *setting);
+guint32             nm_setting_wireless_security_get_num_groups
+                                                        (NMSettingWirelessSecurity *setting);
+const char *        nm_setting_wireless_security_get_group
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+gboolean            nm_setting_wireless_security_add_group
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         const char *group);
+void                nm_setting_wireless_security_remove_group
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+void                nm_setting_wireless_security_clear_groups
+                                                        (NMSettingWirelessSecurity *setting);
+const char *        nm_setting_wireless_security_get_psk
+                                                        (NMSettingWirelessSecurity *setting);
+const char *        nm_setting_wireless_security_get_leap_username
+                                                        (NMSettingWirelessSecurity *setting);
+const char *        nm_setting_wireless_security_get_leap_password
+                                                        (NMSettingWirelessSecurity *setting);
+const char *        nm_setting_wireless_security_get_wep_key
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 idx);
+void                nm_setting_wireless_security_set_wep_key
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 idx,
+                                                         const char *key);
+guint32             nm_setting_wireless_security_get_wep_tx_keyidx
+                                                        (NMSettingWirelessSecurity *setting);
+const char *        nm_setting_wireless_security_get_auth_alg
+                                                        (NMSettingWirelessSecurity *setting);
+NMWepKeyType        nm_setting_wireless_security_get_wep_key_type
+                                                        (NMSettingWirelessSecurity *setting);
+
+
+
+

Object Hierarchy

+
+  GObject
+   +----NMSetting
+         +----NMSettingWirelessSecurity
+
+
+
+

Properties

+
+  "auth-alg"                 gchar*                : Read / Write
+  "group"                    GSList_gchararray_*   : Read / Write
+  "key-mgmt"                 gchar*                : Read / Write
+  "leap-password"            gchar*                : Read / Write
+  "leap-username"            gchar*                : Read / Write
+  "pairwise"                 GSList_gchararray_*   : Read / Write
+  "proto"                    GSList_gchararray_*   : Read / Write
+  "psk"                      gchar*                : Read / Write
+  "wep-key-type"             guint                 : Read / Write / Construct
+  "wep-key0"                 gchar*                : Read / Write
+  "wep-key1"                 gchar*                : Read / Write
+  "wep-key2"                 gchar*                : Read / Write
+  "wep-key3"                 gchar*                : Read / Write
+  "wep-tx-keyidx"            guint                 : Read / Write / Construct
+
+
+
+

Description

+

+

+
+
+

Details

+
+

NM_SETTING_WIRELESS_SECURITY_SETTING_NAME

+
#define NM_SETTING_WIRELESS_SECURITY_SETTING_NAME "802-11-wireless-security"
+
+

+

+
+
+
+

enum NMSettingWirelessSecurityError

+
typedef enum
+{
+	NM_SETTING_WIRELESS_SECURITY_ERROR_UNKNOWN = 0,
+	NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
+	NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_PROPERTY,
+	NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING,
+	NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X,
+	NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME,
+	NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP
+} NMSettingWirelessSecurityError;
+
+

+

+
+
+
+

NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR

+
#define NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR (nm_setting_wireless_security_error_get_type ()) 
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_ERROR

+
#define NM_SETTING_WIRELESS_SECURITY_ERROR nm_setting_wireless_security_error_quark ()
+
+

+

+
+
+
+

nm_setting_wireless_security_error_quark ()

+
GQuark              nm_setting_wireless_security_error_quark
+                                                        (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

enum NMWepKeyType

+
typedef enum {
+	NM_WEP_KEY_TYPE_UNKNOWN = 0,
+	NM_WEP_KEY_TYPE_KEY = 1,          /* Hex or ASCII */
+	NM_WEP_KEY_TYPE_PASSPHRASE = 2,   /* 104/128-bit Passphrase */
+
+	NM_WEP_KEY_TYPE_LAST = NM_WEP_KEY_TYPE_PASSPHRASE
+} NMWepKeyType;
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_KEY_MGMT

+
#define NM_SETTING_WIRELESS_SECURITY_KEY_MGMT "key-mgmt"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX

+
#define NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX "wep-tx-keyidx"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_AUTH_ALG

+
#define NM_SETTING_WIRELESS_SECURITY_AUTH_ALG "auth-alg"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_PROTO

+
#define NM_SETTING_WIRELESS_SECURITY_PROTO "proto"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_PAIRWISE

+
#define NM_SETTING_WIRELESS_SECURITY_PAIRWISE "pairwise"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_GROUP

+
#define NM_SETTING_WIRELESS_SECURITY_GROUP "group"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME

+
#define NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME "leap-username"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_WEP_KEY0

+
#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY0 "wep-key0"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_WEP_KEY1

+
#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY1 "wep-key1"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_WEP_KEY2

+
#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY2 "wep-key2"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_WEP_KEY3

+
#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY3 "wep-key3"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_PSK

+
#define NM_SETTING_WIRELESS_SECURITY_PSK "psk"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD

+
#define NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD "leap-password"
+
+

+

+
+
+
+

NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE

+
#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE "wep-key-type"
+
+

+

+
+
+
+

NMSettingWirelessSecurity

+
typedef struct _NMSettingWirelessSecurity NMSettingWirelessSecurity;
+

+

+
+
+
+

NMSettingWirelessSecurityClass

+
typedef struct {
+	NMSettingClass parent;
+
+	/* Padding for future expansion */
+	void (*_reserved1) (void);
+	void (*_reserved2) (void);
+	void (*_reserved3) (void);
+	void (*_reserved4) (void);
+} NMSettingWirelessSecurityClass;
+
+

+

+
+
+
+

nm_setting_wireless_security_get_type ()

+
GType               nm_setting_wireless_security_get_type
+                                                        (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_wireless_security_new ()

+
NMSetting *         nm_setting_wireless_security_new    (void);
+

+

+
++ + + + +

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_key_mgmt ()

+
const char *        nm_setting_wireless_security_get_key_mgmt
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_num_protos ()

+
guint32             nm_setting_wireless_security_get_num_protos
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_proto ()

+
const char *        nm_setting_wireless_security_get_proto
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_add_proto ()

+
gboolean            nm_setting_wireless_security_add_proto
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         const char *proto);
+

+

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

setting :

+

proto :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_remove_proto ()

+
void                nm_setting_wireless_security_remove_proto
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_wireless_security_clear_protos ()

+
void                nm_setting_wireless_security_clear_protos
+                                                        (NMSettingWirelessSecurity *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_wireless_security_get_num_pairwise ()

+
guint32             nm_setting_wireless_security_get_num_pairwise
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_pairwise ()

+
const char *        nm_setting_wireless_security_get_pairwise
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_add_pairwise ()

+
gboolean            nm_setting_wireless_security_add_pairwise
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         const char *pairwise);
+

+

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

setting :

+

pairwise :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_remove_pairwise ()

+
void                nm_setting_wireless_security_remove_pairwise
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_wireless_security_clear_pairwise ()

+
void                nm_setting_wireless_security_clear_pairwise
+                                                        (NMSettingWirelessSecurity *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_wireless_security_get_num_groups ()

+
guint32             nm_setting_wireless_security_get_num_groups
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_group ()

+
const char *        nm_setting_wireless_security_get_group
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_add_group ()

+
gboolean            nm_setting_wireless_security_add_group
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         const char *group);
+

+

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

setting :

+

group :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_remove_group ()

+
void                nm_setting_wireless_security_remove_group
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 i);
+

+

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

setting :

+

i :

+
+
+
+
+

nm_setting_wireless_security_clear_groups ()

+
void                nm_setting_wireless_security_clear_groups
+                                                        (NMSettingWirelessSecurity *setting);
+

+

+
++ + + + +

setting :

+
+
+
+
+

nm_setting_wireless_security_get_psk ()

+
const char *        nm_setting_wireless_security_get_psk
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_leap_username ()

+
const char *        nm_setting_wireless_security_get_leap_username
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_leap_password ()

+
const char *        nm_setting_wireless_security_get_leap_password
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_wep_key ()

+
const char *        nm_setting_wireless_security_get_wep_key
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 idx);
+

+

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

setting :

+

idx :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_set_wep_key ()

+
void                nm_setting_wireless_security_set_wep_key
+                                                        (NMSettingWirelessSecurity *setting,
+                                                         guint32 idx,
+                                                         const char *key);
+

+

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

setting :

+

idx :

+

key :

+
+
+
+
+

nm_setting_wireless_security_get_wep_tx_keyidx ()

+
guint32             nm_setting_wireless_security_get_wep_tx_keyidx
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_auth_alg ()

+
const char *        nm_setting_wireless_security_get_auth_alg
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

nm_setting_wireless_security_get_wep_key_type ()

+
NMWepKeyType        nm_setting_wireless_security_get_wep_key_type
+                                                        (NMSettingWirelessSecurity *setting);
+

+

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

setting :

+

Returns :

+
+
+
+
+

Property Details

+
+

The "auth-alg" property

+
  "auth-alg"                 gchar*                : Read / Write
+

+When WEP is used (ie, key-mgmt = 'none' or 'ieee8021x') indicate the +802.11 authentication algorithm required by the AP here. One of 'open' +for Open System, 'shared' for Shared Key, or 'leap' for Cisco LEAP. +When using Cisco LEAP (ie, key-mgmt = 'ieee8021x' and auth-alg = 'leap') +the 'leap-username' and 'leap-password' properties must be specified. +

+

Default value: NULL

+
+
+
+

The "group" property

+
  "group"                    GSList_gchararray_*   : Read / Write
+

+If specified, will only connect to WPA networks that provide the +specified group/multicast encryption capabilities. Each element may be +one of 'wep40', 'wep104', 'tkip', or 'ccmp'. +

+
+
+
+

The "key-mgmt" property

+
  "key-mgmt"                 gchar*                : Read / Write
+

+Key management used for the connection. One of 'none' (WEP), 'ieee8021x' +(Dynamic WEP), 'wpa-none' (Ad-Hoc WPA-PSK), 'wpa-psk' (infrastructure +WPA-PSK), or 'wpa-eap' (WPA-Enterprise). This property must be set for +any WiFi connection that uses security. +

+

Default value: NULL

+
+
+
+

The "leap-password" property

+
  "leap-password"            gchar*                : Read / Write
+

+The login password for legacy LEAP connections (ie, key-mgmt = +'ieee8021x' and auth-alg = 'leap'). +

+

Default value: NULL

+
+
+
+

The "leap-username" property

+
  "leap-username"            gchar*                : Read / Write
+

+The login username for legacy LEAP connections (ie, key-mgmt = +'ieee8021x' and auth-alg = 'leap'). +

+

Default value: NULL

+
+
+
+

The "pairwise" property

+
  "pairwise"                 GSList_gchararray_*   : Read / Write
+

+If specified, will only connect to WPA networks that provide the +specified pairwise encryption capabilities. Each element may be one of +'wep40', 'wep104', 'tkip', or 'ccmp'. +

+
+
+
+

The "proto" property

+
  "proto"                    GSList_gchararray_*   : Read / Write
+

+List of strings specifying the allowed WPA protocol versions to use. +Each element may be one 'wpa' (allow WPA) or 'rsn' (allow WPA2/RSN). If +not specified, both WPA and RSN connections are allowed. +

+
+
+
+

The "psk" property

+
  "psk"                      gchar*                : Read / Write
+

+Pre-Shared-Key for WPA networks. If the key is 64-characters long, it +must contain only hexadecimal characters and is interpreted as a +hexadecimal WPA key. Otherwise, the key must be between 8 and 63 ASCII +characters (as specified in the 802.11i standard) and is interpreted as +a WPA passphrase, and is hashed to derive the actual WPA-PSK used when +connecting to the WiFi network. +

+

Default value: NULL

+
+
+
+

The "wep-key-type" property

+
  "wep-key-type"             guint                 : Read / Write / Construct
+

+Controls the interpretation of WEP keys. Allowed values are 1 (interpret +WEP keys as hexadecimal or ASCII keys) or 2 (interpret WEP keys as WEP +Passphrases). If set to 1 and the keys are hexadecimal, they must be +either 10 or 26 characters in length. If set to 1 and the keys are +ASCII keys, they must be either 5 or 13 characters in length. If set to +2, the passphrase is hashed using the de-facto MD5 method to derive the +actual WEP key. +

+

Allowed values: <= 2

+

Default value: 0

+
+
+
+

The "wep-key0" property

+
  "wep-key0"                 gchar*                : Read / Write
+

+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. +

+

Default value: NULL

+
+
+
+

The "wep-key1" property

+
  "wep-key1"                 gchar*                : Read / Write
+

+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. +

+

Default value: NULL

+
+
+
+

The "wep-key2" property

+
  "wep-key2"                 gchar*                : Read / Write
+

+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. +

+

Default value: NULL

+
+
+
+

The "wep-key3" property

+
  "wep-key3"                 gchar*                : Read / Write
+

+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. +

+

Default value: NULL

+
+
+
+

The "wep-tx-keyidx" property

+
  "wep-tx-keyidx"            guint                 : Read / Write / Construct
+

+When static WEP is used (ie, key-mgmt = 'none') and a non-default WEP key +index is used by the AP, put that WEP key index here. Valid values are 0 +(default key) through 3. Note that some consumer access points (like the +Linksys WRT54G) number the keys 1 - 4. +

+

Allowed values: <= 3

+

Default value: 0

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/api-index-full.html b/docs/libnm-util/html/api-index-full.html new file mode 100644 index 00000000..c825a146 --- /dev/null +++ b/docs/libnm-util/html/api-index-full.html @@ -0,0 +1,3197 @@ + + + + +API Index + + + + + + + + + + + + + + + + + + +
+

+API Index

+

C

+
+NMConnection, struct in NMConnection +
+
+
+NMConnection::secrets-updated, object signal in NMConnection +
+
+
+NMConnection:path, object property in NMConnection +
+
+
+NMConnection:scope, object property in NMConnection +
+
+
+NMConnectionClass, struct in NMConnection +
+
+
+NMConnectionError, enum in NMConnection +
+
+
+NMConnectionScope, enum in NMConnection +
+
+
+nm_connection_add_setting, function in NMConnection +
+
+
+nm_connection_clear_secrets, function in NMConnection +
+
+
+nm_connection_compare, function in NMConnection +
+
+
+nm_connection_create_setting, function in NMConnection +
+
+
+nm_connection_dump, function in NMConnection +
+
+
+nm_connection_duplicate, function in NMConnection +
+
+
+NM_CONNECTION_ERROR, macro in NMConnection +
+
+
+nm_connection_error_quark, function in NMConnection +
+
+
+nm_connection_for_each_setting_value, function in NMConnection +
+
+
+nm_connection_get_path, function in NMConnection +
+
+
+nm_connection_get_scope, function in NMConnection +
+
+
+nm_connection_get_setting, function in NMConnection +
+
+
+nm_connection_get_setting_by_name, function in NMConnection +
+
+
+nm_connection_get_type, function in NMConnection +
+
+
+nm_connection_lookup_setting_type, function in NMConnection +
+
+
+nm_connection_lookup_setting_type_by_quark, function in NMConnection +
+
+
+nm_connection_need_secrets, function in NMConnection +
+
+
+nm_connection_new, function in NMConnection +
+
+
+nm_connection_new_from_hash, function in NMConnection +
+
+
+NM_CONNECTION_PATH, macro in NMConnection +
+
+
+nm_connection_remove_setting, function in NMConnection +
+
+
+nm_connection_replace_settings, function in NMConnection +
+
+
+NM_CONNECTION_SCOPE, macro in NMConnection +
+
+
+nm_connection_set_path, function in NMConnection +
+
+
+nm_connection_set_scope, function in NMConnection +
+
+
+nm_connection_to_hash, function in NMConnection +
+
+
+nm_connection_update_secrets, function in NMConnection +
+
+
+nm_connection_verify, function in NMConnection +
+
+

D

+
+nm_debug, macro in nm-utils +
+
+
+nm_debug_str, macro in nm-utils +
+
+

E

+
+nm_error, macro in nm-utils +
+
+
+nm_error_str, macro in nm-utils +
+
+

G

+
+nm_get_timestamp, macro in nm-utils +
+
+
+NM_GSM_NETWORK_ANY, macro in NMSettingGsm +
+
+
+NM_GSM_NETWORK_GPRS_EDGE, macro in NMSettingGsm +
+
+
+NM_GSM_NETWORK_PREFER_GPRS_EDGE, macro in NMSettingGsm +
+
+
+NM_GSM_NETWORK_PREFER_UMTS_HSPA, macro in NMSettingGsm +
+
+
+NM_GSM_NETWORK_UMTS_HSPA, macro in NMSettingGsm +
+
+

I

+
+nm_info, macro in nm-utils +
+
+
+nm_info_str, macro in nm-utils +
+
+
+NMIP4Address, typedef in NMSettingIP4Config +
+
+
+NMIP4Route, typedef in NMSettingIP4Config +
+
+
+nm_ip4_address_compare, function in NMSettingIP4Config +
+
+
+nm_ip4_address_dup, function in NMSettingIP4Config +
+
+
+nm_ip4_address_get_address, function in NMSettingIP4Config +
+
+
+nm_ip4_address_get_gateway, function in NMSettingIP4Config +
+
+
+nm_ip4_address_get_prefix, function in NMSettingIP4Config +
+
+
+nm_ip4_address_new, function in NMSettingIP4Config +
+
+
+nm_ip4_address_ref, function in NMSettingIP4Config +
+
+
+nm_ip4_address_set_address, function in NMSettingIP4Config +
+
+
+nm_ip4_address_set_gateway, function in NMSettingIP4Config +
+
+
+nm_ip4_address_set_prefix, function in NMSettingIP4Config +
+
+
+nm_ip4_address_unref, function in NMSettingIP4Config +
+
+
+nm_ip4_route_compare, function in NMSettingIP4Config +
+
+
+nm_ip4_route_dup, function in NMSettingIP4Config +
+
+
+nm_ip4_route_get_dest, function in NMSettingIP4Config +
+
+
+nm_ip4_route_get_metric, function in NMSettingIP4Config +
+
+
+nm_ip4_route_get_next_hop, function in NMSettingIP4Config +
+
+
+nm_ip4_route_get_prefix, function in NMSettingIP4Config +
+
+
+nm_ip4_route_new, function in NMSettingIP4Config +
+
+
+nm_ip4_route_ref, function in NMSettingIP4Config +
+
+
+nm_ip4_route_set_dest, function in NMSettingIP4Config +
+
+
+nm_ip4_route_set_metric, function in NMSettingIP4Config +
+
+
+nm_ip4_route_set_next_hop, function in NMSettingIP4Config +
+
+
+nm_ip4_route_set_prefix, function in NMSettingIP4Config +
+
+
+nm_ip4_route_unref, function in NMSettingIP4Config +
+
+
+NMIP6Address, typedef in NMSettingIP6Config +
+
+
+NMIP6Route, typedef in NMSettingIP6Config +
+
+
+nm_ip6_address_compare, function in NMSettingIP6Config +
+
+
+nm_ip6_address_dup, function in NMSettingIP6Config +
+
+
+nm_ip6_address_get_address, function in NMSettingIP6Config +
+
+
+nm_ip6_address_get_gateway, function in NMSettingIP6Config +
+
+
+nm_ip6_address_get_prefix, function in NMSettingIP6Config +
+
+
+nm_ip6_address_new, function in NMSettingIP6Config +
+
+
+nm_ip6_address_ref, function in NMSettingIP6Config +
+
+
+nm_ip6_address_set_address, function in NMSettingIP6Config +
+
+
+nm_ip6_address_set_gateway, function in NMSettingIP6Config +
+
+
+nm_ip6_address_set_prefix, function in NMSettingIP6Config +
+
+
+nm_ip6_address_unref, function in NMSettingIP6Config +
+
+
+nm_ip6_route_compare, function in NMSettingIP6Config +
+
+
+nm_ip6_route_dup, function in NMSettingIP6Config +
+
+
+nm_ip6_route_get_dest, function in NMSettingIP6Config +
+
+
+nm_ip6_route_get_metric, function in NMSettingIP6Config +
+
+
+nm_ip6_route_get_next_hop, function in NMSettingIP6Config +
+
+
+nm_ip6_route_get_prefix, function in NMSettingIP6Config +
+
+
+nm_ip6_route_new, function in NMSettingIP6Config +
+
+
+nm_ip6_route_ref, function in NMSettingIP6Config +
+
+
+nm_ip6_route_set_dest, function in NMSettingIP6Config +
+
+
+nm_ip6_route_set_metric, function in NMSettingIP6Config +
+
+
+nm_ip6_route_set_next_hop, function in NMSettingIP6Config +
+
+
+nm_ip6_route_set_prefix, function in NMSettingIP6Config +
+
+
+nm_ip6_route_unref, function in NMSettingIP6Config +
+
+

P

+
+nm_print_backtrace, macro in nm-utils +
+
+

S

+
+NMSetting, struct in NMSetting +
+
+
+NMSetting8021x, struct in NMSetting8021x +
+
+
+NMSetting8021x:anonymous-identity, object property in NMSetting8021x +
+
+
+NMSetting8021x:ca-cert, object property in NMSetting8021x +
+
+
+NMSetting8021x:ca-path, object property in NMSetting8021x +
+
+
+NMSetting8021x:client-cert, object property in NMSetting8021x +
+
+
+NMSetting8021x:eap, object property in NMSetting8021x +
+
+
+NMSetting8021x:identity, object property in NMSetting8021x +
+
+
+NMSetting8021x:password, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase1-fast-provisioning, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase1-peaplabel, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase1-peapver, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase2-auth, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase2-autheap, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase2-ca-cert, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase2-ca-path, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase2-client-cert, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase2-private-key, object property in NMSetting8021x +
+
+
+NMSetting8021x:phase2-private-key-password, object property in NMSetting8021x +
+
+
+NMSetting8021x:private-key, object property in NMSetting8021x +
+
+
+NMSetting8021x:private-key-password, object property in NMSetting8021x +
+
+
+NMSetting8021x:system-ca-certs, object property in NMSetting8021x +
+
+
+NMSetting8021xCKFormat, enum in NMSetting8021x +
+
+
+NMSetting8021xCKScheme, enum in NMSetting8021x +
+
+
+NMSetting8021xCKType, enum in NMSetting8021x +
+
+
+NMSetting8021xClass, struct in NMSetting8021x +
+
+
+NMSetting8021xError, enum in NMSetting8021x +
+
+
+NMSetting:name, object property in NMSetting +
+
+
+NMSettingBluetooth, struct in NMSettingBluetooth +
+
+
+NMSettingBluetooth:bdaddr, object property in NMSettingBluetooth +
+
+
+NMSettingBluetooth:type, object property in NMSettingBluetooth +
+
+
+NMSettingBluetoothClass, struct in NMSettingBluetooth +
+
+
+NMSettingBluetoothError, enum in NMSettingBluetooth +
+
+
+NMSettingCdma, struct in NMSettingCdma +
+
+
+NMSettingCdma:number, object property in NMSettingCdma +
+
+
+NMSettingCdma:password, object property in NMSettingCdma +
+
+
+NMSettingCdma:username, object property in NMSettingCdma +
+
+
+NMSettingCdmaClass, struct in NMSettingCdma +
+
+
+NMSettingCdmaError, enum in NMSettingCdma +
+
+
+NMSettingClass, struct in NMSetting +
+
+
+NMSettingCompareFlags, enum in NMSetting +
+
+
+NMSettingConnection, struct in NMSettingConnection +
+
+
+NMSettingConnection:autoconnect, object property in NMSettingConnection +
+
+
+NMSettingConnection:id, object property in NMSettingConnection +
+
+
+NMSettingConnection:read-only, object property in NMSettingConnection +
+
+
+NMSettingConnection:timestamp, object property in NMSettingConnection +
+
+
+NMSettingConnection:type, object property in NMSettingConnection +
+
+
+NMSettingConnection:uuid, object property in NMSettingConnection +
+
+
+NMSettingConnectionClass, struct in NMSettingConnection +
+
+
+NMSettingConnectionError, enum in NMSettingConnection +
+
+
+NMSettingError, enum in NMSetting +
+
+
+NMSettingGsm, struct in NMSettingGsm +
+
+
+NMSettingGsm:allowed-bands, object property in NMSettingGsm +
+
+
+NMSettingGsm:apn, object property in NMSettingGsm +
+
+
+NMSettingGsm:band, object property in NMSettingGsm +
+
+
+NMSettingGsm:home-only, object property in NMSettingGsm +
+
+
+NMSettingGsm:network-id, object property in NMSettingGsm +
+
+
+NMSettingGsm:network-type, object property in NMSettingGsm +
+
+
+NMSettingGsm:number, object property in NMSettingGsm +
+
+
+NMSettingGsm:password, object property in NMSettingGsm +
+
+
+NMSettingGsm:pin, object property in NMSettingGsm +
+
+
+NMSettingGsm:puk, object property in NMSettingGsm +
+
+
+NMSettingGsm:username, object property in NMSettingGsm +
+
+
+NMSettingGsmClass, struct in NMSettingGsm +
+
+
+NMSettingGsmError, enum in NMSettingGsm +
+
+
+NMSettingGsmNetworkBand, enum in NMSettingGsm +
+
+
+NMSettingGsmNetworkType, enum in NMSettingGsm +
+
+
+NMSettingIP4Config, struct in NMSettingIP4Config +
+
+
+NMSettingIP4Config:addresses, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:dhcp-client-id, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:dhcp-hostname, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:dhcp-send-hostname, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:dns, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:dns-search, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:ignore-auto-dns, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:ignore-auto-routes, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:may-fail, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:method, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:never-default, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:routes, object property in NMSettingIP4Config +
+
+
+NMSettingIP4ConfigClass, struct in NMSettingIP4Config +
+
+
+NMSettingIP4ConfigError, enum in NMSettingIP4Config +
+
+
+NMSettingIP6Config, struct in NMSettingIP6Config +
+
+
+NMSettingIP6Config:addresses, object property in NMSettingIP6Config +
+
+
+NMSettingIP6Config:dns, object property in NMSettingIP6Config +
+
+
+NMSettingIP6Config:dns-search, object property in NMSettingIP6Config +
+
+
+NMSettingIP6Config:ignore-auto-dns, object property in NMSettingIP6Config +
+
+
+NMSettingIP6Config:ignore-auto-routes, object property in NMSettingIP6Config +
+
+
+NMSettingIP6Config:may-fail, object property in NMSettingIP6Config +
+
+
+NMSettingIP6Config:method, object property in NMSettingIP6Config +
+
+
+NMSettingIP6Config:never-default, object property in NMSettingIP6Config +
+
+
+NMSettingIP6Config:routes, object property in NMSettingIP6Config +
+
+
+NMSettingIP6ConfigClass, struct in NMSettingIP6Config +
+
+
+NMSettingIP6ConfigError, enum in NMSettingIP6Config +
+
+
+NMSettingOlpcMesh, struct in NMSettingOlpcMesh +
+
+
+NMSettingOlpcMesh:channel, object property in NMSettingOlpcMesh +
+
+
+NMSettingOlpcMesh:dhcp-anycast-address, object property in NMSettingOlpcMesh +
+
+
+NMSettingOlpcMesh:ssid, object property in NMSettingOlpcMesh +
+
+
+NMSettingOlpcMeshClass, struct in NMSettingOlpcMesh +
+
+
+NMSettingOlpcMeshError, enum in NMSettingOlpcMesh +
+
+
+NMSettingPPP, struct in NMSettingPPP +
+
+
+NMSettingPPP:baud, object property in NMSettingPPP +
+
+
+NMSettingPPP:crtscts, object property in NMSettingPPP +
+
+
+NMSettingPPP:lcp-echo-failure, object property in NMSettingPPP +
+
+
+NMSettingPPP:lcp-echo-interval, object property in NMSettingPPP +
+
+
+NMSettingPPP:mppe-stateful, object property in NMSettingPPP +
+
+
+NMSettingPPP:mru, object property in NMSettingPPP +
+
+
+NMSettingPPP:mtu, object property in NMSettingPPP +
+
+
+NMSettingPPP:no-vj-comp, object property in NMSettingPPP +
+
+
+NMSettingPPP:noauth, object property in NMSettingPPP +
+
+
+NMSettingPPP:nobsdcomp, object property in NMSettingPPP +
+
+
+NMSettingPPP:nodeflate, object property in NMSettingPPP +
+
+
+NMSettingPPP:refuse-chap, object property in NMSettingPPP +
+
+
+NMSettingPPP:refuse-eap, object property in NMSettingPPP +
+
+
+NMSettingPPP:refuse-mschap, object property in NMSettingPPP +
+
+
+NMSettingPPP:refuse-mschapv2, object property in NMSettingPPP +
+
+
+NMSettingPPP:refuse-pap, object property in NMSettingPPP +
+
+
+NMSettingPPP:require-mppe, object property in NMSettingPPP +
+
+
+NMSettingPPP:require-mppe-128, object property in NMSettingPPP +
+
+
+NMSettingPPPClass, struct in NMSettingPPP +
+
+
+NMSettingPPPError, enum in NMSettingPPP +
+
+
+NMSettingPPPOE, struct in NMSettingPPPOE +
+
+
+NMSettingPPPOE:password, object property in NMSettingPPPOE +
+
+
+NMSettingPPPOE:service, object property in NMSettingPPPOE +
+
+
+NMSettingPPPOE:username, object property in NMSettingPPPOE +
+
+
+NMSettingPPPOEClass, struct in NMSettingPPPOE +
+
+
+NMSettingPPPOEError, enum in NMSettingPPPOE +
+
+
+NMSettingSerial, struct in NMSettingSerial +
+
+
+NMSettingSerial:baud, object property in NMSettingSerial +
+
+
+NMSettingSerial:bits, object property in NMSettingSerial +
+
+
+NMSettingSerial:parity, object property in NMSettingSerial +
+
+
+NMSettingSerial:send-delay, object property in NMSettingSerial +
+
+
+NMSettingSerial:stopbits, object property in NMSettingSerial +
+
+
+NMSettingSerialClass, struct in NMSettingSerial +
+
+
+NMSettingSerialError, enum in NMSettingSerial +
+
+
+NMSettingValueIterFn, user_function in NMSetting +
+
+
+NMSettingVPN, struct in NMSettingVPN +
+
+
+NMSettingVPN:data, object property in NMSettingVPN +
+
+
+NMSettingVPN:secrets, object property in NMSettingVPN +
+
+
+NMSettingVPN:service-type, object property in NMSettingVPN +
+
+
+NMSettingVPN:user-name, object property in NMSettingVPN +
+
+
+NMSettingVPNClass, struct in NMSettingVPN +
+
+
+NMSettingVpnError, enum in NMSettingVPN +
+
+
+NMSettingWired, struct in NMSettingWired +
+
+
+NMSettingWired:auto-negotiate, object property in NMSettingWired +
+
+
+NMSettingWired:duplex, object property in NMSettingWired +
+
+
+NMSettingWired:mac-address, object property in NMSettingWired +
+
+
+NMSettingWired:mtu, object property in NMSettingWired +
+
+
+NMSettingWired:port, object property in NMSettingWired +
+
+
+NMSettingWired:speed, object property in NMSettingWired +
+
+
+NMSettingWiredClass, struct in NMSettingWired +
+
+
+NMSettingWiredError, enum in NMSettingWired +
+
+
+NMSettingWireless, struct in NMSettingWireless +
+
+
+NMSettingWireless:band, object property in NMSettingWireless +
+
+
+NMSettingWireless:bssid, object property in NMSettingWireless +
+
+
+NMSettingWireless:channel, object property in NMSettingWireless +
+
+
+NMSettingWireless:mac-address, object property in NMSettingWireless +
+
+
+NMSettingWireless:mode, object property in NMSettingWireless +
+
+
+NMSettingWireless:mtu, object property in NMSettingWireless +
+
+
+NMSettingWireless:rate, object property in NMSettingWireless +
+
+
+NMSettingWireless:security, object property in NMSettingWireless +
+
+
+NMSettingWireless:seen-bssids, object property in NMSettingWireless +
+
+
+NMSettingWireless:ssid, object property in NMSettingWireless +
+
+
+NMSettingWireless:tx-power, object property in NMSettingWireless +
+
+
+NMSettingWirelessClass, struct in NMSettingWireless +
+
+
+NMSettingWirelessError, enum in NMSettingWireless +
+
+
+NMSettingWirelessSecurity, struct in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:auth-alg, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:group, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:key-mgmt, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:leap-password, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:leap-username, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:pairwise, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:proto, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:psk, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:wep-key-type, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:wep-key0, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:wep-key1, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:wep-key2, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:wep-key3, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurity:wep-tx-keyidx, object property in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurityClass, struct in NMSettingWirelessSecurity +
+
+
+NMSettingWirelessSecurityError, enum in NMSettingWirelessSecurity +
+
+
+nm_setting_802_1x_add_eap_method, function in NMSetting8021x +
+
+
+NM_SETTING_802_1X_ANONYMOUS_IDENTITY, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_CA_CERT, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_CA_PATH, macro in NMSetting8021x +
+
+
+nm_setting_802_1x_clear_eap_methods, function in NMSetting8021x +
+
+
+NM_SETTING_802_1X_CLIENT_CERT, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_EAP, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_ERROR, macro in NMSetting8021x +
+
+
+nm_setting_802_1x_error_quark, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_anonymous_identity, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_ca_cert, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_ca_cert_blob, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_ca_cert_path, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_ca_cert_scheme, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_ca_path, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_client_cert, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_client_cert_blob, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_client_cert_path, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_client_cert_scheme, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_eap_method, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_identity, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_num_eap_methods, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_password, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase1_fast_provisioning, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase1_peaplabel, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase1_peapver, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_auth, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_autheap, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_ca_cert, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_ca_cert_blob, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_ca_cert_path, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_ca_cert_scheme, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_ca_path, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_client_cert, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_client_cert_blob, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_client_cert_path, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_client_cert_scheme, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_private_key, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_private_key_blob, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_private_key_format, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_private_key_password, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_private_key_path, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_private_key_scheme, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_phase2_private_key_type, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_pin, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_private_key, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_private_key_blob, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_private_key_format, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_private_key_password, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_private_key_path, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_private_key_scheme, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_private_key_type, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_psk, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_system_ca_certs, function in NMSetting8021x +
+
+
+nm_setting_802_1x_get_type, function in NMSetting8021x +
+
+
+NM_SETTING_802_1X_IDENTITY, macro in NMSetting8021x +
+
+
+nm_setting_802_1x_new, function in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PASSWORD, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE1_PEAPLABEL, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE1_PEAPVER, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE2_AUTH, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE2_AUTHEAP, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE2_CA_CERT, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE2_CA_PATH, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE2_CLIENT_CERT, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PIN, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PRIVATE_KEY, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, macro in NMSetting8021x +
+
+
+NM_SETTING_802_1X_PSK, macro in NMSetting8021x +
+
+
+nm_setting_802_1x_remove_eap_method, function in NMSetting8021x +
+
+
+NM_SETTING_802_1X_SETTING_NAME, macro in NMSetting8021x +
+
+
+nm_setting_802_1x_set_ca_cert, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_ca_cert_from_file, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_client_cert, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_client_cert_from_file, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_phase2_ca_cert, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_phase2_ca_cert_from_file, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_phase2_client_cert, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_phase2_client_cert_from_file, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_phase2_private_key, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_phase2_private_key_from_file, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_private_key, function in NMSetting8021x +
+
+
+nm_setting_802_1x_set_private_key_from_file, function in NMSetting8021x +
+
+
+NM_SETTING_802_1X_SYSTEM_CA_CERTS, macro in NMSetting8021x +
+
+
+NM_SETTING_BLUETOOTH_BDADDR, macro in NMSettingBluetooth +
+
+
+NM_SETTING_BLUETOOTH_ERROR, macro in NMSettingBluetooth +
+
+
+nm_setting_bluetooth_error_quark, function in NMSettingBluetooth +
+
+
+nm_setting_bluetooth_get_bdaddr, function in NMSettingBluetooth +
+
+
+nm_setting_bluetooth_get_connection_type, function in NMSettingBluetooth +
+
+
+nm_setting_bluetooth_get_type, function in NMSettingBluetooth +
+
+
+nm_setting_bluetooth_new, function in NMSettingBluetooth +
+
+
+NM_SETTING_BLUETOOTH_SETTING_NAME, macro in NMSettingBluetooth +
+
+
+NM_SETTING_BLUETOOTH_TYPE, macro in NMSettingBluetooth +
+
+
+NM_SETTING_BLUETOOTH_TYPE_DUN, macro in NMSettingBluetooth +
+
+
+NM_SETTING_BLUETOOTH_TYPE_PANU, macro in NMSettingBluetooth +
+
+
+NM_SETTING_CDMA_ERROR, macro in NMSettingCdma +
+
+
+nm_setting_cdma_error_quark, function in NMSettingCdma +
+
+
+nm_setting_cdma_get_number, function in NMSettingCdma +
+
+
+nm_setting_cdma_get_password, function in NMSettingCdma +
+
+
+nm_setting_cdma_get_type, function in NMSettingCdma +
+
+
+nm_setting_cdma_get_username, function in NMSettingCdma +
+
+
+nm_setting_cdma_new, function in NMSettingCdma +
+
+
+NM_SETTING_CDMA_NUMBER, macro in NMSettingCdma +
+
+
+NM_SETTING_CDMA_PASSWORD, macro in NMSettingCdma +
+
+
+NM_SETTING_CDMA_SETTING_NAME, macro in NMSettingCdma +
+
+
+NM_SETTING_CDMA_USERNAME, macro in NMSettingCdma +
+
+
+nm_setting_clear_secrets, function in NMSetting +
+
+
+nm_setting_compare, function in NMSetting +
+
+
+NM_SETTING_CONNECTION_AUTOCONNECT, macro in NMSettingConnection +
+
+
+NM_SETTING_CONNECTION_ERROR, macro in NMSettingConnection +
+
+
+nm_setting_connection_error_quark, function in NMSettingConnection +
+
+
+nm_setting_connection_get_autoconnect, function in NMSettingConnection +
+
+
+nm_setting_connection_get_connection_type, function in NMSettingConnection +
+
+
+nm_setting_connection_get_id, function in NMSettingConnection +
+
+
+nm_setting_connection_get_read_only, function in NMSettingConnection +
+
+
+nm_setting_connection_get_timestamp, function in NMSettingConnection +
+
+
+nm_setting_connection_get_type, function in NMSettingConnection +
+
+
+nm_setting_connection_get_uuid, function in NMSettingConnection +
+
+
+NM_SETTING_CONNECTION_ID, macro in NMSettingConnection +
+
+
+nm_setting_connection_new, function in NMSettingConnection +
+
+
+NM_SETTING_CONNECTION_READ_ONLY, macro in NMSettingConnection +
+
+
+NM_SETTING_CONNECTION_SETTING_NAME, macro in NMSettingConnection +
+
+
+NM_SETTING_CONNECTION_TIMESTAMP, macro in NMSettingConnection +
+
+
+NM_SETTING_CONNECTION_TYPE, macro in NMSettingConnection +
+
+
+NM_SETTING_CONNECTION_UUID, macro in NMSettingConnection +
+
+
+nm_setting_duplicate, function in NMSetting +
+
+
+nm_setting_enumerate_values, function in NMSetting +
+
+
+NM_SETTING_ERROR, macro in NMSetting +
+
+
+nm_setting_error_quark, function in NMSetting +
+
+
+nm_setting_get_name, function in NMSetting +
+
+
+nm_setting_get_type, function in NMSetting +
+
+
+NM_SETTING_GSM_ALLOWED_BANDS, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_APN, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_BAND, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_ERROR, macro in NMSettingGsm +
+
+
+nm_setting_gsm_error_quark, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_allowed_bands, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_apn, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_band, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_home_only, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_network_id, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_network_type, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_number, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_password, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_pin, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_puk, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_type, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_username, function in NMSettingGsm +
+
+
+NM_SETTING_GSM_HOME_ONLY, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_NETWORK_ID, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_NETWORK_TYPE, macro in NMSettingGsm +
+
+
+nm_setting_gsm_new, function in NMSettingGsm +
+
+
+NM_SETTING_GSM_NUMBER, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_PASSWORD, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_PIN, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_PUK, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_SETTING_NAME, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_USERNAME, macro in NMSettingGsm +
+
+
+NM_SETTING_IP4_CONFIG_ADDRESSES, macro in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_add_address, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_add_dns, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_add_dns_search, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_add_route, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_clear_addresses, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_clear_dns, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_clear_dns_searches, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_clear_routes, function in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_DNS, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_DNS_SEARCH, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_ERROR, macro in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_error_quark, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_address, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_dhcp_client_id, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_dhcp_hostname, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_dhcp_send_hostname, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_dns, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_dns_search, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_ignore_auto_dns, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_ignore_auto_routes, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_may_fail, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_method, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_never_default, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_num_addresses, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_num_dns, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_num_dns_searches, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_num_routes, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_route, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_type, function in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_MAY_FAIL, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_METHOD, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_METHOD_AUTO, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_METHOD_DISABLED, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_METHOD_MANUAL, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_METHOD_SHARED, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, macro in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_new, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_remove_address, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_remove_dns, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_remove_dns_search, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_remove_route, function in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_ROUTES, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_SETTING_NAME, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP6_CONFIG_ADDRESSES, macro in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_add_address, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_add_dns, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_add_dns_search, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_add_route, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_clear_addresses, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_clear_dns, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_clear_dns_searches, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_clear_routes, function in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_DNS, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_DNS_SEARCH, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_ERROR, macro in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_error_quark, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_address, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_dns, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_dns_search, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_ignore_auto_dns, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_ignore_auto_routes, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_may_fail, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_method, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_never_default, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_num_addresses, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_num_dns, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_num_dns_searches, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_num_routes, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_route, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_type, function in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_MAY_FAIL, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_METHOD, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_METHOD_AUTO, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_METHOD_IGNORE, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_METHOD_MANUAL, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_METHOD_SHARED, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, macro in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_new, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_remove_address, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_remove_dns, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_remove_dns_search, function in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_remove_route, function in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_ROUTES, macro in NMSettingIP6Config +
+
+
+NM_SETTING_IP6_CONFIG_SETTING_NAME, macro in NMSettingIP6Config +
+
+
+NM_SETTING_NAME, macro in NMSetting +
+
+
+nm_setting_need_secrets, function in NMSetting +
+
+
+nm_setting_new_from_hash, function in NMSetting +
+
+
+NM_SETTING_OLPC_MESH_CHANNEL, macro in NMSettingOlpcMesh +
+
+
+NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS, macro in NMSettingOlpcMesh +
+
+
+NM_SETTING_OLPC_MESH_ERROR, macro in NMSettingOlpcMesh +
+
+
+nm_setting_olpc_mesh_error_quark, function in NMSettingOlpcMesh +
+
+
+nm_setting_olpc_mesh_get_channel, function in NMSettingOlpcMesh +
+
+
+nm_setting_olpc_mesh_get_dhcp_anycast_address, function in NMSettingOlpcMesh +
+
+
+nm_setting_olpc_mesh_get_ssid, function in NMSettingOlpcMesh +
+
+
+nm_setting_olpc_mesh_get_type, function in NMSettingOlpcMesh +
+
+
+nm_setting_olpc_mesh_new, function in NMSettingOlpcMesh +
+
+
+NM_SETTING_OLPC_MESH_SETTING_NAME, macro in NMSettingOlpcMesh +
+
+
+NM_SETTING_OLPC_MESH_SSID, macro in NMSettingOlpcMesh +
+
+
+NM_SETTING_PARAM_FUZZY_IGNORE, macro in NMSetting +
+
+
+NM_SETTING_PARAM_REQUIRED, macro in NMSetting +
+
+
+NM_SETTING_PARAM_SECRET, macro in NMSetting +
+
+
+NM_SETTING_PARAM_SERIALIZE, macro in NMSetting +
+
+
+NM_SETTING_PPPOE_ERROR, macro in NMSettingPPPOE +
+
+
+nm_setting_pppoe_error_quark, function in NMSettingPPPOE +
+
+
+nm_setting_pppoe_get_password, function in NMSettingPPPOE +
+
+
+nm_setting_pppoe_get_service, function in NMSettingPPPOE +
+
+
+nm_setting_pppoe_get_type, function in NMSettingPPPOE +
+
+
+nm_setting_pppoe_get_username, function in NMSettingPPPOE +
+
+
+nm_setting_pppoe_new, function in NMSettingPPPOE +
+
+
+NM_SETTING_PPPOE_PASSWORD, macro in NMSettingPPPOE +
+
+
+NM_SETTING_PPPOE_SERVICE, macro in NMSettingPPPOE +
+
+
+NM_SETTING_PPPOE_SETTING_NAME, macro in NMSettingPPPOE +
+
+
+NM_SETTING_PPPOE_USERNAME, macro in NMSettingPPPOE +
+
+
+NM_SETTING_PPP_BAUD, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_CRTSCTS, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_ERROR, macro in NMSettingPPP +
+
+
+nm_setting_ppp_error_quark, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_baud, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_crtscts, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_lcp_echo_failure, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_lcp_echo_interval, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_mppe_stateful, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_mru, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_mtu, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_noauth, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_nobsdcomp, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_nodeflate, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_no_vj_comp, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_refuse_chap, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_refuse_eap, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_refuse_mschap, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_refuse_mschapv2, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_refuse_pap, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_require_mppe, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_require_mppe_128, function in NMSettingPPP +
+
+
+nm_setting_ppp_get_type, function in NMSettingPPP +
+
+
+NM_SETTING_PPP_LCP_ECHO_FAILURE, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_LCP_ECHO_INTERVAL, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_MPPE_STATEFUL, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_MRU, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_MTU, macro in NMSettingPPP +
+
+
+nm_setting_ppp_new, function in NMSettingPPP +
+
+
+NM_SETTING_PPP_NOAUTH, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_NOBSDCOMP, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_NODEFLATE, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_NO_VJ_COMP, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_REFUSE_CHAP, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_REFUSE_EAP, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_REFUSE_MSCHAP, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_REFUSE_MSCHAPV2, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_REFUSE_PAP, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_REQUIRE_MPPE, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_REQUIRE_MPPE_128, macro in NMSettingPPP +
+
+
+NM_SETTING_PPP_SETTING_NAME, macro in NMSettingPPP +
+
+
+NM_SETTING_SERIAL_BAUD, macro in NMSettingSerial +
+
+
+NM_SETTING_SERIAL_BITS, macro in NMSettingSerial +
+
+
+NM_SETTING_SERIAL_ERROR, macro in NMSettingSerial +
+
+
+nm_setting_serial_error_quark, function in NMSettingSerial +
+
+
+nm_setting_serial_get_baud, function in NMSettingSerial +
+
+
+nm_setting_serial_get_bits, function in NMSettingSerial +
+
+
+nm_setting_serial_get_parity, function in NMSettingSerial +
+
+
+nm_setting_serial_get_send_delay, function in NMSettingSerial +
+
+
+nm_setting_serial_get_stopbits, function in NMSettingSerial +
+
+
+nm_setting_serial_get_type, function in NMSettingSerial +
+
+
+nm_setting_serial_new, function in NMSettingSerial +
+
+
+NM_SETTING_SERIAL_PARITY, macro in NMSettingSerial +
+
+
+NM_SETTING_SERIAL_SEND_DELAY, macro in NMSettingSerial +
+
+
+NM_SETTING_SERIAL_SETTING_NAME, macro in NMSettingSerial +
+
+
+NM_SETTING_SERIAL_STOPBITS, macro in NMSettingSerial +
+
+
+nm_setting_to_hash, function in NMSetting +
+
+
+nm_setting_to_string, function in NMSetting +
+
+
+nm_setting_update_secrets, function in NMSetting +
+
+
+nm_setting_verify, function in NMSetting +
+
+
+nm_setting_vpn_add_data_item, function in NMSettingVPN +
+
+
+nm_setting_vpn_add_secret, function in NMSettingVPN +
+
+
+NM_SETTING_VPN_DATA, macro in NMSettingVPN +
+
+
+NM_SETTING_VPN_ERROR, macro in NMSettingVPN +
+
+
+nm_setting_vpn_error_quark, function in NMSettingVPN +
+
+
+nm_setting_vpn_foreach_data_item, function in NMSettingVPN +
+
+
+nm_setting_vpn_foreach_secret, function in NMSettingVPN +
+
+
+nm_setting_vpn_get_data_item, function in NMSettingVPN +
+
+
+nm_setting_vpn_get_secret, function in NMSettingVPN +
+
+
+nm_setting_vpn_get_service_type, function in NMSettingVPN +
+
+
+nm_setting_vpn_get_type, function in NMSettingVPN +
+
+
+nm_setting_vpn_get_user_name, function in NMSettingVPN +
+
+
+nm_setting_vpn_new, function in NMSettingVPN +
+
+
+nm_setting_vpn_remove_data_item, function in NMSettingVPN +
+
+
+nm_setting_vpn_remove_secret, function in NMSettingVPN +
+
+
+NM_SETTING_VPN_SECRETS, macro in NMSettingVPN +
+
+
+NM_SETTING_VPN_SERVICE_TYPE, macro in NMSettingVPN +
+
+
+NM_SETTING_VPN_SETTING_NAME, macro in NMSettingVPN +
+
+
+NM_SETTING_VPN_USER_NAME, macro in NMSettingVPN +
+
+
+NM_SETTING_WIRED_AUTO_NEGOTIATE, macro in NMSettingWired +
+
+
+NM_SETTING_WIRED_DUPLEX, macro in NMSettingWired +
+
+
+NM_SETTING_WIRED_ERROR, macro in NMSettingWired +
+
+
+nm_setting_wired_error_quark, function in NMSettingWired +
+
+
+nm_setting_wired_get_auto_negotiate, function in NMSettingWired +
+
+
+nm_setting_wired_get_duplex, function in NMSettingWired +
+
+
+nm_setting_wired_get_mac_address, function in NMSettingWired +
+
+
+nm_setting_wired_get_mtu, function in NMSettingWired +
+
+
+nm_setting_wired_get_port, function in NMSettingWired +
+
+
+nm_setting_wired_get_speed, function in NMSettingWired +
+
+
+nm_setting_wired_get_type, function in NMSettingWired +
+
+
+NM_SETTING_WIRED_MAC_ADDRESS, macro in NMSettingWired +
+
+
+NM_SETTING_WIRED_MTU, macro in NMSettingWired +
+
+
+nm_setting_wired_new, function in NMSettingWired +
+
+
+NM_SETTING_WIRED_PORT, macro in NMSettingWired +
+
+
+NM_SETTING_WIRED_SETTING_NAME, macro in NMSettingWired +
+
+
+NM_SETTING_WIRED_SPEED, macro in NMSettingWired +
+
+
+nm_setting_wireless_add_seen_bssid, function in NMSettingWireless +
+
+
+nm_setting_wireless_ap_security_compatible, function in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_BAND, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_BSSID, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_CHANNEL, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_ERROR, macro in NMSettingWireless +
+
+
+nm_setting_wireless_error_quark, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_band, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_bssid, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_channel, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_mac_address, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_mode, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_mtu, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_num_seen_bssids, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_rate, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_security, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_seen_bssid, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_ssid, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_tx_power, function in NMSettingWireless +
+
+
+nm_setting_wireless_get_type, function in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_MAC_ADDRESS, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_MODE, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_MTU, macro in NMSettingWireless +
+
+
+nm_setting_wireless_new, function in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_RATE, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_SEC, macro in NMSettingWireless +
+
+
+nm_setting_wireless_security_add_group, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_add_pairwise, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_add_proto, function in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, macro in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_clear_groups, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_clear_pairwise, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_clear_protos, function in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_ERROR, macro in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_error_quark, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_auth_alg, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_group, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_key_mgmt, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_leap_password, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_leap_username, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_num_groups, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_num_pairwise, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_num_protos, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_pairwise, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_proto, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_psk, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_type, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_wep_key, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_wep_key_type, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_get_wep_tx_keyidx, function in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_GROUP, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, macro in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_new, function in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_PAIRWISE, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_PROTO, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_PSK, macro in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_remove_group, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_remove_pairwise, function in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_remove_proto, function in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, macro in NMSettingWirelessSecurity +
+
+
+nm_setting_wireless_security_set_wep_key, function in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, macro in NMSettingWirelessSecurity +
+
+
+NM_SETTING_WIRELESS_SEEN_BSSIDS, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_SETTING_NAME, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_SSID, macro in NMSettingWireless +
+
+
+NM_SETTING_WIRELESS_TX_POWER, macro in NMSettingWireless +
+
+

T

+
+NM_TYPE_CONNECTION_ERROR, macro in NMConnection +
+
+
+NM_TYPE_SETTING_802_1X_ERROR, macro in NMSetting8021x +
+
+
+NM_TYPE_SETTING_BLUETOOTH_ERROR, macro in NMSettingBluetooth +
+
+
+NM_TYPE_SETTING_CDMA_ERROR, macro in NMSettingCdma +
+
+
+NM_TYPE_SETTING_CONNECTION_ERROR, macro in NMSettingConnection +
+
+
+NM_TYPE_SETTING_ERROR, macro in NMSetting +
+
+
+NM_TYPE_SETTING_GSM_ERROR, macro in NMSettingGsm +
+
+
+NM_TYPE_SETTING_IP4_CONFIG_ERROR, macro in NMSettingIP4Config +
+
+
+NM_TYPE_SETTING_IP6_CONFIG_ERROR, macro in NMSettingIP6Config +
+
+
+NM_TYPE_SETTING_OLPC_MESH_ERROR, macro in NMSettingOlpcMesh +
+
+
+NM_TYPE_SETTING_PPPOE_ERROR, macro in NMSettingPPPOE +
+
+
+NM_TYPE_SETTING_PPP_ERROR, macro in NMSettingPPP +
+
+
+NM_TYPE_SETTING_SERIAL_ERROR, macro in NMSettingSerial +
+
+
+NM_TYPE_SETTING_VPN_ERROR, macro in NMSettingVPN +
+
+
+NM_TYPE_SETTING_WIRED_ERROR, macro in NMSettingWired +
+
+
+NM_TYPE_SETTING_WIRELESS_ERROR, macro in NMSettingWireless +
+
+
+NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR, macro in NMSettingWirelessSecurity +
+
+

U

+
+NMUtilsSecurityType, enum in nm-utils +
+
+
+nm_utils_deinit, function in nm-utils +
+
+
+nm_utils_escape_ssid, function in nm-utils +
+
+
+nm_utils_gvalue_hash_dup, function in nm-utils +
+
+
+nm_utils_init, function in nm-utils +
+
+
+nm_utils_ip4_addresses_from_gvalue, function in nm-utils +
+
+
+nm_utils_ip4_addresses_to_gvalue, function in nm-utils +
+
+
+nm_utils_ip4_get_default_prefix, function in nm-utils +
+
+
+nm_utils_ip4_netmask_to_prefix, function in nm-utils +
+
+
+nm_utils_ip4_prefix_to_netmask, function in nm-utils +
+
+
+nm_utils_ip4_routes_from_gvalue, function in nm-utils +
+
+
+nm_utils_ip4_routes_to_gvalue, function in nm-utils +
+
+
+nm_utils_ip6_addresses_from_gvalue, function in nm-utils +
+
+
+nm_utils_ip6_addresses_to_gvalue, function in nm-utils +
+
+
+nm_utils_ip6_dns_from_gvalue, function in nm-utils +
+
+
+nm_utils_ip6_dns_to_gvalue, function in nm-utils +
+
+
+nm_utils_ip6_routes_from_gvalue, function in nm-utils +
+
+
+nm_utils_ip6_routes_to_gvalue, function in nm-utils +
+
+
+nm_utils_is_empty_ssid, function in nm-utils +
+
+
+nm_utils_rsa_key_encrypt, function in nm-utils +
+
+
+nm_utils_same_ssid, function in nm-utils +
+
+
+nm_utils_security_valid, function in nm-utils +
+
+
+nm_utils_slist_free, function in nm-utils +
+
+
+nm_utils_ssid_to_utf8, function in nm-utils +
+
+
+nm_utils_uuid_generate, function in nm-utils +
+
+
+nm_utils_uuid_generate_from_string, function in nm-utils +
+
+

V

+
+VPNIterFunc, user_function in NMSettingVPN +
+
+

W

+
+nm_warning, macro in nm-utils +
+
+
+nm_warning_str, macro in nm-utils +
+
+
+NMWepKeyType, enum in NMSettingWirelessSecurity +
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/ch01.html b/docs/libnm-util/html/ch01.html new file mode 100644 index 00000000..29422652 --- /dev/null +++ b/docs/libnm-util/html/ch01.html @@ -0,0 +1,86 @@ + + + + +libnm-util API Reference + + + + + + + + + + + + + + + + +
+

+libnm-util API Reference

+
+
+NMConnection — Describes a connection to specific network or provider +
+
+NMSetting — Describes related configuration information +
+
+NMSettingConnection — Describes general connection properties +
+
+NMSettingWired +
+
+NMSettingWireless +
+
+NMSettingWirelessSecurity +
+
+NMSettingBluetooth +
+
+NMSettingSerial +
+
+NMSettingCdma — Describes CDMA-based mobile broadband properties +
+
+NMSettingGsm +
+
+NMSettingOlpcMesh +
+
+NMSetting8021x — Describes 802.1x-authenticated connection properties +
+
+NMSettingIP4Config +
+
+NMSettingIP6Config +
+
+NMSettingPPP +
+
+NMSettingPPPOE +
+
+NMSettingVPN +
+
+nm-utils — Utility functions +
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/home.png b/docs/libnm-util/html/home.png new file mode 100644 index 00000000..17003611 Binary files /dev/null and b/docs/libnm-util/html/home.png differ diff --git a/docs/libnm-util/html/index.html b/docs/libnm-util/html/index.html new file mode 100644 index 00000000..ea9e74c9 --- /dev/null +++ b/docs/libnm-util/html/index.html @@ -0,0 +1,91 @@ + + + + +libnm-util Reference Manual + + + + + + + +
+
+
+
+

+ for libnm-util 0.8 + The latest version of this documentation can be found on-line at + http://projects.gnome.org/NetworkManager/developers/libnm-util/08/. +

+
+
+
+
+
libnm-util API Reference
+
+
+NMConnection — Describes a connection to specific network or provider +
+
+NMSetting — Describes related configuration information +
+
+NMSettingConnection — Describes general connection properties +
+
+NMSettingWired +
+
+NMSettingWireless +
+
+NMSettingWirelessSecurity +
+
+NMSettingBluetooth +
+
+NMSettingSerial +
+
+NMSettingCdma — Describes CDMA-based mobile broadband properties +
+
+NMSettingGsm +
+
+NMSettingOlpcMesh +
+
+NMSetting8021x — Describes 802.1x-authenticated connection properties +
+
+NMSettingIP4Config +
+
+NMSettingIP6Config +
+
+NMSettingPPP +
+
+NMSettingPPPOE +
+
+NMSettingVPN +
+
+nm-utils — Utility functions +
+
+
Object Hierarchy
+
API Index
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/index.sgml b/docs/libnm-util/html/index.sgml new file mode 100644 index 00000000..fef25ace --- /dev/null +++ b/docs/libnm-util/html/index.sgml @@ -0,0 +1,925 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-util/html/left.png b/docs/libnm-util/html/left.png new file mode 100644 index 00000000..2d05b3d5 Binary files /dev/null and b/docs/libnm-util/html/left.png differ diff --git a/docs/libnm-util/html/libnm-util-nm-utils.html b/docs/libnm-util/html/libnm-util-nm-utils.html new file mode 100644 index 00000000..9e0a9182 --- /dev/null +++ b/docs/libnm-util/html/libnm-util-nm-utils.html @@ -0,0 +1,1074 @@ + + + + +nm-utils + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+

nm-utils

+

nm-utils — Utility functions

+
+
+

Synopsis

+
+#include <nm-utils.h>
+
+#define             nm_print_backtrace
+#define             nm_get_timestamp                    (timestamp)
+#define             nm_info                             (fmt,
+                                                         args...)
+#define             nm_info_str                         (fmt_str,
+                                                         args...)
+#define             nm_debug                            (fmt,
+                                                         args...)
+#define             nm_debug_str                        (fmt_str,
+                                                         args...)
+#define             nm_warning                          (fmt,
+                                                         args...)
+#define             nm_warning_str                      (fmt_str,
+                                                         args...)
+#define             nm_error                            (fmt,
+                                                         args...)
+#define             nm_error_str                        (fmt_str,
+                                                         args...)
+gboolean            nm_utils_init                       (GError **error);
+void                nm_utils_deinit                     (void);
+gboolean            nm_utils_is_empty_ssid              (const guint8 *ssid,
+                                                         int len);
+const char *        nm_utils_escape_ssid                (const guint8 *ssid,
+                                                         guint32 len);
+gboolean            nm_utils_same_ssid                  (const GByteArray *ssid1,
+                                                         const GByteArray *ssid2,
+                                                         gboolean ignore_trailing_null);
+char *              nm_utils_ssid_to_utf8               (const char *ssid,
+                                                         guint32 len);
+GHashTable *        nm_utils_gvalue_hash_dup            (GHashTable *hash);
+void                nm_utils_slist_free                 (GSList *list,
+                                                         GDestroyNotify elem_destroy_fn);
+enum                NMUtilsSecurityType;
+gboolean            nm_utils_security_valid             (NMUtilsSecurityType type,
+                                                         guint32 wifi_caps,
+                                                         gboolean have_ap,
+                                                         gboolean adhoc,
+                                                         guint32 ap_flags,
+                                                         guint32 ap_wpa,
+                                                         guint32 ap_rsn);
+GSList *            nm_utils_ip4_addresses_from_gvalue  (const GValue *value);
+void                nm_utils_ip4_addresses_to_gvalue    (GSList *list,
+                                                         GValue *value);
+GSList *            nm_utils_ip4_routes_from_gvalue     (const GValue *value);
+void                nm_utils_ip4_routes_to_gvalue       (GSList *list,
+                                                         GValue *value);
+guint32             nm_utils_ip4_netmask_to_prefix      (guint32 netmask);
+guint32             nm_utils_ip4_prefix_to_netmask      (guint32 prefix);
+guint32             nm_utils_ip4_get_default_prefix     (guint32 ip);
+GSList *            nm_utils_ip6_addresses_from_gvalue  (const GValue *value);
+void                nm_utils_ip6_addresses_to_gvalue    (GSList *list,
+                                                         GValue *value);
+GSList *            nm_utils_ip6_routes_from_gvalue     (const GValue *value);
+void                nm_utils_ip6_routes_to_gvalue       (GSList *list,
+                                                         GValue *value);
+GSList *            nm_utils_ip6_dns_from_gvalue        (const GValue *value);
+void                nm_utils_ip6_dns_to_gvalue          (GSList *list,
+                                                         GValue *value);
+char *              nm_utils_uuid_generate              (void);
+char *              nm_utils_uuid_generate_from_string  (const char *s);
+GByteArray *        nm_utils_rsa_key_encrypt            (const GByteArray *data,
+                                                         const char *in_password,
+                                                         char **out_password,
+                                                         GError **error);
+
+
+
+

Description

+

+A collection of utility functions for working SSIDs, IP addresses, WiFi +access points and devices, among other things. +

+
+
+

Details

+
+

nm_print_backtrace

+
#define             nm_print_backtrace()
+

+Prints a backtrace of the calling process to the logging location. +

+
+
+
+

nm_get_timestamp()

+
#define             nm_get_timestamp(timestamp)
+

+For debugging only. +

+
++ + + + +

timestamp :

location in which to place the current timestamp +
+
+
+
+

nm_info()

+
#define             nm_info(fmt, args...)
+

+

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

fmt :

+

args... :

+
+
+
+
+

nm_info_str()

+
#define             nm_info_str(fmt_str, args...)
+

+

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

fmt_str :

+

args... :

+
+
+
+
+

nm_debug()

+
#define             nm_debug(fmt, args...)
+

+

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

fmt :

+

args... :

+
+
+
+
+

nm_debug_str()

+
#define             nm_debug_str(fmt_str, args...)
+

+

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

fmt_str :

+

args... :

+
+
+
+
+

nm_warning()

+
#define             nm_warning(fmt, args...)
+

+

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

fmt :

+

args... :

+
+
+
+
+

nm_warning_str()

+
#define             nm_warning_str(fmt_str, args...)
+

+

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

fmt_str :

+

args... :

+
+
+
+
+

nm_error()

+
#define             nm_error(fmt, args...)
+

+

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

fmt :

+

args... :

+
+
+
+
+

nm_error_str()

+
#define             nm_error_str(fmt_str, args...)
+

+

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

fmt_str :

+

args... :

+
+
+
+
+

nm_utils_init ()

+
gboolean            nm_utils_init                       (GError **error);
+

+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. +

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

error :

location to store error, or NULL +

Returns :

TRUE if the initialization was successful, FALSE on failure. +
+
+
+
+

nm_utils_deinit ()

+
void                nm_utils_deinit                     (void);
+

+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. +

+
+
+
+

nm_utils_is_empty_ssid ()

+
gboolean            nm_utils_is_empty_ssid              (const guint8 *ssid,
+                                                         int len);
+

+Different manufacturers use different mechanisms for not broadcasting the +AP's SSID. This function attempts to detect blank/empty SSIDs using a +number of known SSID-cloaking methods. +

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

ssid :

pointer to a buffer containing the SSID data +

len :

length of the SSID data in ssid +

Returns :

TRUE if the SSID is "empty", FALSE if it is not +
+
+
+
+

nm_utils_escape_ssid ()

+
const char *        nm_utils_escape_ssid                (const guint8 *ssid,
+                                                         guint32 len);
+

+This function does a quick printable character conversion of the SSID, simply +replacing embedded NULLs and non-printable characters with the hexadecimal +representation of that character. Intended for debugging only, should not +be used for display of SSIDs. +

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

ssid :

pointer to a buffer containing the SSID data +

len :

length of the SSID data in ssid +

Returns :

pointer to the escaped SSID, which uses an internal static buffer +and will be overwritten by subsequent calls to this function +
+
+
+
+

nm_utils_same_ssid ()

+
gboolean            nm_utils_same_ssid                  (const GByteArray *ssid1,
+                                                         const GByteArray *ssid2,
+                                                         gboolean ignore_trailing_null);
+

+Earlier versions of the Linux kernel added a NULL byte to the end of the +SSID to enable easy printing of the SSID on the console or in a terminal, +but this behavior was problematic (SSIDs are simply byte arrays, not strings) +and thus was changed. This function compensates for that behavior at the +cost of some compatibility with odd SSIDs that may legitimately have trailing +NULLs, even though that is functionally pointless. +

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

ssid1 :

first SSID data to compare +

ssid2 :

second SSID data to compare +

ignore_trailing_null :

TRUE to ignore one trailing NULL byte +

Returns :

TRUE if the SSIDs are the same, FALSE if they are not +
+
+
+
+

nm_utils_ssid_to_utf8 ()

+
char *              nm_utils_ssid_to_utf8               (const char *ssid,
+                                                         guint32 len);
+

+WiFi SSIDs are byte arrays, they are _not_ strings. Thus, an SSID may +contain embedded NULLs and other unprintable characters. Often it is +useful to print the SSID out for debugging purposes, but that should be the +_only_ use of this function. Do not use this function for any persistent +storage of the SSID, since the printable SSID returned from this function +cannot be converted back into the real SSID of the access point. +

+

+This function does almost everything humanly possible to convert the input +into a printable UTF-8 string, using roughly the following procedure: +

+

+1) if the input data is already UTF-8 safe, no conversion is performed +2) attempts to get the current system language from the LANG environment + variable, and depending on the language, uses a table of alternative + encodings to try. For example, if LANG=hu_HU, the table may first try + the ISO-8859-2 encoding, and if that fails, try the Windows-1250 encoding. + If all fallback encodings fail, replaces non-UTF-8 characters with '?'. +3) If the system language was unable to be determined, falls back to the + ISO-8859-1 encoding, then to the Windows-1251 encoding. +4) If step 3 fails, replaces non-UTF-8 characters with '?'. +

+

+Again, this function should be used for debugging and display purposes +_only_. +

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

ssid :

pointer to a buffer containing the SSID data +

len :

length of the SSID data in ssid +

Returns :

an allocated string containing a UTF-8 representation of the +SSID, which must be freed by the caller using g_free(). Returns NULL +on errors. +
+
+
+
+

nm_utils_gvalue_hash_dup ()

+
GHashTable *        nm_utils_gvalue_hash_dup            (GHashTable *hash);
+

+Utility function to duplicate a hash table of GValues. +

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

hash :

a GHashTable mapping string:GValue +

Returns :

a newly allocated duplicated GHashTable, caller must free the +returned hash with g_hash_table_unref() or g_hash_table_destroy() +
+
+
+
+

nm_utils_slist_free ()

+
void                nm_utils_slist_free                 (GSList *list,
+                                                         GDestroyNotify elem_destroy_fn);
+

+Utility function to free a GSList. +

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

list :

a GSList +

elem_destroy_fn :

user function called for each element in list +
+
+
+
+

enum NMUtilsSecurityType

+
typedef enum {
+	NMU_SEC_INVALID = 0,
+	NMU_SEC_NONE,
+	NMU_SEC_STATIC_WEP,
+	NMU_SEC_LEAP,
+	NMU_SEC_DYNAMIC_WEP,
+	NMU_SEC_WPA_PSK,
+	NMU_SEC_WPA_ENTERPRISE,
+	NMU_SEC_WPA2_PSK,
+	NMU_SEC_WPA2_ENTERPRISE
+} NMUtilsSecurityType;
+
+

+

+
+
+
+

nm_utils_security_valid ()

+
gboolean            nm_utils_security_valid             (NMUtilsSecurityType type,
+                                                         guint32 wifi_caps,
+                                                         gboolean have_ap,
+                                                         gboolean adhoc,
+                                                         guint32 ap_flags,
+                                                         guint32 ap_wpa,
+                                                         guint32 ap_rsn);
+

+Given a set of device capabilities, and a desired security type to check +against, determines whether the combination of device, desired security +type, and AP capabilities intersect. +

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

type :

the security type to check AP flags and device capabilties against, +e.g. NMU_SEC_STATIC_WEP +

wifi_caps :

bitfield of the capabilities of the specific WiFi device, e.g. +NM_WIFI_DEVICE_CAP_CIPHER_WEP40 +

have_ap :

whether the ap_flags, ap_wpa, and ap_rsn arguments are valid +

adhoc :

whether the capabilities being tested are from an Ad-Hoc AP (IBSS) +

ap_flags :

bitfield of AP capabilities, e.g. NM_802_11_AP_FLAGS_PRIVACY +

ap_wpa :

bitfield of AP capabilties derived from the AP's WPA beacon, +e.g. (NM_802_11_AP_SEC_PAIR_TKIP | NM_802_11_AP_SEC_KEY_MGMT_PSK) +

ap_rsn :

bitfield of AP capabilties derived from the AP's RSN/WPA2 beacon, +e.g. (NM_802_11_AP_SEC_PAIR_CCMP | NM_802_11_AP_SEC_PAIR_TKIP) +

Returns :

TRUE if the device capabilities and AP capabilties intersect and are +compatible with the desired type, FALSE if they are not +
+
+
+
+

nm_utils_ip4_addresses_from_gvalue ()

+
GSList *            nm_utils_ip4_addresses_from_gvalue  (const GValue *value);
+

+Utility function to convert a GPtrArray of GArrays of guint32s representing +a list of NetworkManager IPv4 addresses (which is a tuple of address, gateway, +and prefix) into a GSList of NMIP4Address objects. The specific format of +this serialization is not guaranteed to be stable and the GArray may be +extended in the future. +

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

value :

gvalue containing a GPtrArray of GArrays of guint32s +

Returns :

a newly allocated GSList of NMIP4Address objects +
+
+
+
+

nm_utils_ip4_addresses_to_gvalue ()

+
void                nm_utils_ip4_addresses_to_gvalue    (GSList *list,
+                                                         GValue *value);
+

+Utility function to convert a GSList of NMIP4Address objects into a +GPtrArray of GArrays of guint32s representing a list of NetworkManager IPv4 +addresses (which is a tuple of address, gateway, and prefix). The specific +format of this serialization is not guaranteed to be stable and may be +extended in the future. +

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

list :

a list of NMIP4Address objects +

value :

a pointer to a GValue into which to place the converted addresses, +which should be unset by the caller (when no longer needed) with +g_value_unset(). +
+
+
+
+

nm_utils_ip4_routes_from_gvalue ()

+
GSList *            nm_utils_ip4_routes_from_gvalue     (const GValue *value);
+

+Utility function to convert a GPtrArray of GArrays of guint32s representing +a list of NetworkManager IPv4 routes (which is a tuple of route, next hop, +prefix, and metric) into a GSList of NMIP4Route objects. The specific +format of this serialization is not guaranteed to be stable and may be +extended in the future. +

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

value :

gvalue containing a GPtrArray of GArrays of guint32s +

Returns :

a newly allocated GSList of NMIP4Route objects +
+
+
+
+

nm_utils_ip4_routes_to_gvalue ()

+
void                nm_utils_ip4_routes_to_gvalue       (GSList *list,
+                                                         GValue *value);
+

+Utility function to convert a GSList of NMIP4Route objects into a +GPtrArray of GArrays of guint32s representing a list of NetworkManager IPv4 +routes (which is a tuple of route, next hop, prefix, and metric). The +specific format of this serialization is not guaranteed to be stable and may +be extended in the future. +

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

list :

a list of NMIP4Route objects +

value :

a pointer to a GValue into which to place the converted routes, +which should be unset by the caller (when no longer needed) with +g_value_unset(). +
+
+
+
+

nm_utils_ip4_netmask_to_prefix ()

+
guint32             nm_utils_ip4_netmask_to_prefix      (guint32 netmask);
+
++ + + + + + + + + + +

netmask :

an IPv4 netmask in network byte order +

Returns :

the CIDR prefix represented by the netmask +
+
+
+
+

nm_utils_ip4_prefix_to_netmask ()

+
guint32             nm_utils_ip4_prefix_to_netmask      (guint32 prefix);
+
++ + + + + + + + + + +

prefix :

a CIDR prefix +

Returns :

the netmask represented by the prefix +
+
+
+
+

nm_utils_ip4_get_default_prefix ()

+
guint32             nm_utils_ip4_get_default_prefix     (guint32 ip);
+

+When the Internet was originally set up, various ranges of IP addresses were +segmented into three network classes: A, B, and C. This function will return +a prefix that is associated with the IP address specified defining where it +falls in the predefined classes. +

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

ip :

an IPv4 address (in network byte order) +

Returns :

the default class prefix for the given IP +
+
+
+
+

nm_utils_ip6_addresses_from_gvalue ()

+
GSList *            nm_utils_ip6_addresses_from_gvalue  (const GValue *value);
+

+Utility function to convert a GPtrArray of GValueArrays of (GArray of guchars) and guint32 +representing a list of NetworkManager IPv6 addresses (which is a tuple of address, +prefix, and gateway), into a GSList of NMIP6Address objects. The specific format of +this serialization is not guaranteed to be stable and the GValueArray may be +extended in the future. +

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

value :

gvalue containing a GPtrArray of GValueArrays of (GArray of guchars) and guint32 +

Returns :

a newly allocated GSList of NMIP6Address objects +
+
+
+
+

nm_utils_ip6_addresses_to_gvalue ()

+
void                nm_utils_ip6_addresses_to_gvalue    (GSList *list,
+                                                         GValue *value);
+

+Utility function to convert a GSList of NMIP6Address objects into a +GPtrArray of GValueArrays representing a list of NetworkManager IPv6 addresses +(which is a tuple of address, prefix, and gateway). The specific format of +this serialization is not guaranteed to be stable and may be extended in the +future. +

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

list :

a list of NMIP6Address objects +

value :

a pointer to a GValue into which to place the converted addresses, +which should be unset by the caller (when no longer needed) with +g_value_unset(). +
+
+
+
+

nm_utils_ip6_routes_from_gvalue ()

+
GSList *            nm_utils_ip6_routes_from_gvalue     (const GValue *value);
+

+Utility function GPtrArray of GValueArrays of (GArray or guchars), guint32, +(GArray of guchars), and guint32 representing a list of NetworkManager IPv6 +routes (which is a tuple of destination, prefix, next hop, and metric) +into a GSList of NMIP6Route objects. The specific format of this serialization +is not guaranteed to be stable and may be extended in the future. +

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

value :

gvalue containing a GPtrArray of GValueArrays of (GArray or guchars), guint32, +(GArray of guchars), and guint32 +

Returns :

a newly allocated GSList of NMIP6Route objects +
+
+
+
+

nm_utils_ip6_routes_to_gvalue ()

+
void                nm_utils_ip6_routes_to_gvalue       (GSList *list,
+                                                         GValue *value);
+

+Utility function to convert a GSList of NMIP6Route objects into a GPtrArray of +GValueArrays of (GArray or guchars), guint32, (GArray of guchars), and guint32 +representing a list of NetworkManager IPv6 routes (which is a tuple of destination, +prefix, next hop, and metric). The specific format of this serialization is not +guaranteed to be stable and may be extended in the future. +

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

list :

a list of NMIP6Route objects +

value :

a pointer to a GValue into which to place the converted routes, +which should be unset by the caller (when no longer needed) with +g_value_unset(). +
+
+
+
+

nm_utils_ip6_dns_from_gvalue ()

+
GSList *            nm_utils_ip6_dns_from_gvalue        (const GValue *value);
+

+

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

value :

+

Returns :

+
+
+
+
+

nm_utils_ip6_dns_to_gvalue ()

+
void                nm_utils_ip6_dns_to_gvalue          (GSList *list,
+                                                         GValue *value);
+

+

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

list :

+

value :

+
+
+
+
+

nm_utils_uuid_generate ()

+
char *              nm_utils_uuid_generate              (void);
+
++ + + + +

Returns :

a newly allocated UUID suitable for use as the NMSettingConnection +object's "id": property. Should be freed with g_free() +
+
+
+
+

nm_utils_uuid_generate_from_string ()

+
char *              nm_utils_uuid_generate_from_string  (const char *s);
+

+For a given s, this function will always return the same UUID. +

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

s :

a string to use as the seed for the UUID +

Returns :

a newly allocated UUID suitable for use as the NMSettingConnection +object's "id": property +
+
+
+
+

nm_utils_rsa_key_encrypt ()

+
GByteArray *        nm_utils_rsa_key_encrypt            (const GByteArray *data,
+                                                         const char *in_password,
+                                                         char **out_password,
+                                                         GError **error);
+

+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. +

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

data :

RSA private key data to be encrypted +

in_password :

existing password to use, if any +

out_password :

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 +

Returns :

on success, PEM-formatted data suitable for writing to a PEM-formatted +certificate/private key file. +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm-util/html/libnm-util.devhelp b/docs/libnm-util/html/libnm-util.devhelp new file mode 100644 index 00000000..0fc6459e --- /dev/null +++ b/docs/libnm-util/html/libnm-util.devhelp @@ -0,0 +1,813 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-util/html/libnm-util.devhelp2 b/docs/libnm-util/html/libnm-util.devhelp2 new file mode 100644 index 00000000..8d58a675 --- /dev/null +++ b/docs/libnm-util/html/libnm-util.devhelp2 @@ -0,0 +1,830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-util/html/object-tree.html b/docs/libnm-util/html/object-tree.html new file mode 100644 index 00000000..d83762f7 --- /dev/null +++ b/docs/libnm-util/html/object-tree.html @@ -0,0 +1,50 @@ + + + + +Object Hierarchy + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/libnm-util/html/right.png b/docs/libnm-util/html/right.png new file mode 100644 index 00000000..92832e3a Binary files /dev/null and b/docs/libnm-util/html/right.png differ diff --git a/docs/libnm-util/html/style.css b/docs/libnm-util/html/style.css new file mode 100644 index 00000000..82115eb7 --- /dev/null +++ b/docs/libnm-util/html/style.css @@ -0,0 +1,257 @@ +.synopsis, .classsynopsis +{ + /* tango:aluminium 1/2 */ + background: #eeeeec; + border: solid 1px #d3d7cf; + padding: 0.5em; +} +.programlisting +{ + /* tango:sky blue 0/1 */ + background: #e6f3ff; + border: solid 1px #729fcf; + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} + +@media screen { + sup a.footnote + { + position: relative; + top: 0em ! important; + + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + position: relative; + padding-top:4.5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 3.2em; + padding-bottom: 20em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + /* tango:scarlet red 0/1 */ + background: #ffe6e6; + border: solid 1px #ef2929; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + z-index: 10; + } + .navigation a, .navigation a:visited + { + /* tango:scarlet red 3 */ + color: #a40000; + } + .navigation a:hover + { + /* tango:scarlet red 1 */ + color: #ef2929; + } + td.shortcuts + { + /* tango:scarlet red 1 */ + color: #ef2929; + font-size: 80%; + white-space: nowrap; + } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + /* tango:scarlet red 0/1 */ + background: #ffe6e6; + border: solid 1px #ef2929; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + +.navigation .title +{ + font-size: 200%; +} + +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} + +a, a:visited +{ + text-decoration: none; + /* tango:sky blue 2 */ + color: #3465a4; +} +a:hover +{ + text-decoration: underline; + /* tango:sky blue 1 */ + color: #729fcf; +} + +div.table table +{ + border-collapse: collapse; + border-spacing: 0px; + /* tango:aluminium 3 */ + border: solid 1px #babdb6; +} + +div.table table td, div.table table th +{ + /* tango:aluminium 3 */ + border: solid 1px #babdb6; + padding: 3px; + vertical-align: top; +} + +div.table table th +{ + /* tango:aluminium 2 */ + background-color: #d3d7cf; +} + +hr +{ + /* tango:aluminium 3 */ + color: #babdb6; + background: #babdb6; + border: none 0px; + height: 1px; + clear: both; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + border-color: #ffb04f; +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + border-color: #abf562; +} +.note, .warning +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; +} +.note h3, .warning h3 +{ + margin-top: 0.0em +} +.note p, .warning p +{ + margin-bottom: 0.0em +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +/* code listings */ + +.listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ +.listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ +.listing_code .programlisting .function { color: #000000; font-weight: bold; } +.listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ +.listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ +.listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ +.listing_code .programlisting .normal { color: #000000; } +.listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ +.listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ +.listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ +.listing_code .programlisting .type { color: #000000; } +.listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ +.listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + diff --git a/docs/libnm-util/html/up.png b/docs/libnm-util/html/up.png new file mode 100644 index 00000000..85b3e2a2 Binary files /dev/null and b/docs/libnm-util/html/up.png differ diff --git a/docs/libnm-util/libnm-util-docs.sgml b/docs/libnm-util/libnm-util-docs.sgml new file mode 100644 index 00000000..78b931d8 --- /dev/null +++ b/docs/libnm-util/libnm-util-docs.sgml @@ -0,0 +1,49 @@ + + +]> + + + libnm-util Reference Manual + + for libnm-util 0.8 + The latest version of this documentation can be found on-line at + http://projects.gnome.org/NetworkManager/developers/libnm-util/08/. + + + + + libnm-util API Reference + + + + + + + + + + + + + + + + + + + + + + Object Hierarchy + + + + API Index + + + + + diff --git a/docs/libnm-util/libnm-util-overrides.txt b/docs/libnm-util/libnm-util-overrides.txt new file mode 100644 index 00000000..e69de29b diff --git a/docs/libnm-util/libnm-util-sections.txt b/docs/libnm-util/libnm-util-sections.txt new file mode 100644 index 00000000..17a667f4 --- /dev/null +++ b/docs/libnm-util/libnm-util-sections.txt @@ -0,0 +1,877 @@ +
+nm-setting-gsm +NMSettingGsm +NM_SETTING_GSM_SETTING_NAME +NMSettingGsmError +NM_TYPE_SETTING_GSM_ERROR +NM_SETTING_GSM_ERROR +nm_setting_gsm_error_quark +NM_SETTING_GSM_NUMBER +NM_SETTING_GSM_USERNAME +NM_SETTING_GSM_PASSWORD +NM_SETTING_GSM_APN +NM_SETTING_GSM_NETWORK_ID +NM_SETTING_GSM_NETWORK_TYPE +NM_SETTING_GSM_ALLOWED_BANDS +NM_SETTING_GSM_PIN +NM_SETTING_GSM_HOME_ONLY +NM_SETTING_GSM_PUK +NM_SETTING_GSM_BAND +NM_GSM_NETWORK_ANY +NM_GSM_NETWORK_UMTS_HSPA +NM_GSM_NETWORK_GPRS_EDGE +NM_GSM_NETWORK_PREFER_UMTS_HSPA +NM_GSM_NETWORK_PREFER_GPRS_EDGE +NMSettingGsmNetworkType +NMSettingGsmNetworkBand +NMSettingGsm +NMSettingGsmClass +nm_setting_gsm_get_type +nm_setting_gsm_new +nm_setting_gsm_get_number +nm_setting_gsm_get_username +nm_setting_gsm_get_password +nm_setting_gsm_get_apn +nm_setting_gsm_get_network_id +nm_setting_gsm_get_network_type +nm_setting_gsm_get_allowed_bands +nm_setting_gsm_get_pin +nm_setting_gsm_get_home_only +nm_setting_gsm_get_puk +nm_setting_gsm_get_band + +NM_SETTING_GSM +NM_IS_SETTING_GSM +NM_TYPE_SETTING_GSM +nm_setting_gsm_error_get_type +NM_SETTING_GSM_CLASS +NM_IS_SETTING_GSM_CLASS +NM_SETTING_GSM_GET_CLASS +
+ +
+nm-setting-8021x +NMSetting8021x +NMSetting8021xCKFormat +NMSetting8021xCKScheme +NM_SETTING_802_1X_SETTING_NAME +NMSetting8021xError +NM_TYPE_SETTING_802_1X_ERROR +NM_SETTING_802_1X_ERROR +nm_setting_802_1x_error_quark +NM_SETTING_802_1X_EAP +NM_SETTING_802_1X_IDENTITY +NM_SETTING_802_1X_ANONYMOUS_IDENTITY +NM_SETTING_802_1X_CA_CERT +NM_SETTING_802_1X_CA_PATH +NM_SETTING_802_1X_CLIENT_CERT +NM_SETTING_802_1X_PHASE1_PEAPVER +NM_SETTING_802_1X_PHASE1_PEAPLABEL +NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING +NM_SETTING_802_1X_PHASE2_AUTH +NM_SETTING_802_1X_PHASE2_AUTHEAP +NM_SETTING_802_1X_PHASE2_CA_CERT +NM_SETTING_802_1X_PHASE2_CA_PATH +NM_SETTING_802_1X_PHASE2_CLIENT_CERT +NM_SETTING_802_1X_PASSWORD +NM_SETTING_802_1X_PRIVATE_KEY +NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD +NM_SETTING_802_1X_PHASE2_PRIVATE_KEY +NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD +NM_SETTING_802_1X_PIN +NM_SETTING_802_1X_PSK +NM_SETTING_802_1X_SYSTEM_CA_CERTS +NMSetting8021x +NMSetting8021xClass +nm_setting_802_1x_get_type +nm_setting_802_1x_new +nm_setting_802_1x_get_num_eap_methods +nm_setting_802_1x_get_eap_method +nm_setting_802_1x_add_eap_method +nm_setting_802_1x_remove_eap_method +nm_setting_802_1x_clear_eap_methods +nm_setting_802_1x_get_identity +nm_setting_802_1x_get_anonymous_identity +nm_setting_802_1x_get_system_ca_certs +nm_setting_802_1x_get_ca_path +nm_setting_802_1x_get_phase2_ca_path +nm_setting_802_1x_get_ca_cert_scheme +nm_setting_802_1x_get_ca_cert_blob +nm_setting_802_1x_get_ca_cert_path +nm_setting_802_1x_set_ca_cert +nm_setting_802_1x_get_client_cert_scheme +nm_setting_802_1x_get_client_cert_blob +nm_setting_802_1x_get_client_cert_path +nm_setting_802_1x_set_client_cert +nm_setting_802_1x_get_phase1_peapver +nm_setting_802_1x_get_phase1_peaplabel +nm_setting_802_1x_get_phase1_fast_provisioning +nm_setting_802_1x_get_phase2_auth +nm_setting_802_1x_get_phase2_autheap +nm_setting_802_1x_get_phase2_ca_cert_scheme +nm_setting_802_1x_get_phase2_ca_cert_blob +nm_setting_802_1x_get_phase2_ca_cert_path +nm_setting_802_1x_set_phase2_ca_cert +nm_setting_802_1x_get_phase2_client_cert_scheme +nm_setting_802_1x_get_phase2_client_cert_blob +nm_setting_802_1x_get_phase2_client_cert_path +nm_setting_802_1x_set_phase2_client_cert +nm_setting_802_1x_get_password +nm_setting_802_1x_get_pin +nm_setting_802_1x_get_psk +nm_setting_802_1x_get_private_key_scheme +nm_setting_802_1x_get_private_key_blob +nm_setting_802_1x_get_private_key_path +nm_setting_802_1x_set_private_key +nm_setting_802_1x_get_private_key_password +nm_setting_802_1x_get_private_key_format +nm_setting_802_1x_get_phase2_private_key_scheme +nm_setting_802_1x_get_phase2_private_key_blob +nm_setting_802_1x_get_phase2_private_key_path +nm_setting_802_1x_set_phase2_private_key +nm_setting_802_1x_get_phase2_private_key_password +nm_setting_802_1x_get_phase2_private_key_format +NMSetting8021xCKType +nm_setting_802_1x_get_ca_cert +nm_setting_802_1x_set_ca_cert_from_file +nm_setting_802_1x_get_client_cert +nm_setting_802_1x_set_client_cert_from_file +nm_setting_802_1x_get_phase2_ca_cert +nm_setting_802_1x_set_phase2_ca_cert_from_file +nm_setting_802_1x_get_phase2_client_cert +nm_setting_802_1x_set_phase2_client_cert_from_file +nm_setting_802_1x_get_private_key +nm_setting_802_1x_set_private_key_from_file +nm_setting_802_1x_get_private_key_type +nm_setting_802_1x_get_phase2_private_key +nm_setting_802_1x_set_phase2_private_key_from_file +nm_setting_802_1x_get_phase2_private_key_type + +NM_SETTING_802_1X +NM_IS_SETTING_802_1X +NM_TYPE_SETTING_802_1X +nm_setting_802_1x_error_get_type +NM_SETTING_802_1X_CLASS +NM_IS_SETTING_802_1X_CLASS +NM_SETTING_802_1X_GET_CLASS +
+ +
+nm-setting-bluetooth +NMSettingBluetooth +NM_SETTING_BLUETOOTH_SETTING_NAME +NMSettingBluetoothError +NM_TYPE_SETTING_BLUETOOTH_ERROR +NM_SETTING_BLUETOOTH_ERROR +nm_setting_bluetooth_error_quark +NM_SETTING_BLUETOOTH_BDADDR +NM_SETTING_BLUETOOTH_TYPE +NM_SETTING_BLUETOOTH_TYPE_DUN +NM_SETTING_BLUETOOTH_TYPE_PANU +NMSettingBluetooth +NMSettingBluetoothClass +nm_setting_bluetooth_get_type +nm_setting_bluetooth_new +nm_setting_bluetooth_get_bdaddr +nm_setting_bluetooth_get_connection_type + +NM_SETTING_BLUETOOTH +NM_IS_SETTING_BLUETOOTH +NM_TYPE_SETTING_BLUETOOTH +nm_setting_bluetooth_error_get_type +NM_SETTING_BLUETOOTH_CLASS +NM_IS_SETTING_BLUETOOTH_CLASS +NM_SETTING_BLUETOOTH_GET_CLASS +
+ +
+nm-setting-olpc-mesh +NMSettingOlpcMesh +NM_SETTING_OLPC_MESH_SETTING_NAME +NMSettingOlpcMeshError +NM_TYPE_SETTING_OLPC_MESH_ERROR +NM_SETTING_OLPC_MESH_ERROR +nm_setting_olpc_mesh_error_quark +NM_SETTING_OLPC_MESH_SSID +NM_SETTING_OLPC_MESH_CHANNEL +NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS +NMSettingOlpcMesh +NMSettingOlpcMeshClass +nm_setting_olpc_mesh_get_type +nm_setting_olpc_mesh_new +nm_setting_olpc_mesh_get_ssid +nm_setting_olpc_mesh_get_channel +nm_setting_olpc_mesh_get_dhcp_anycast_address + +NM_SETTING_OLPC_MESH +NM_IS_SETTING_OLPC_MESH +NM_TYPE_SETTING_OLPC_MESH +nm_setting_olpc_mesh_error_get_type +NM_SETTING_OLPC_MESH_CLASS +NM_IS_SETTING_OLPC_MESH_CLASS +NM_SETTING_OLPC_MESH_GET_CLASS +
+ +
+nm-setting-cdma +NMSettingCdma +NM_SETTING_CDMA_SETTING_NAME +NMSettingCdmaError +NM_TYPE_SETTING_CDMA_ERROR +NM_SETTING_CDMA_ERROR +nm_setting_cdma_error_quark +NM_SETTING_CDMA_NUMBER +NM_SETTING_CDMA_USERNAME +NM_SETTING_CDMA_PASSWORD +NMSettingCdma +NMSettingCdmaClass +nm_setting_cdma_get_type +nm_setting_cdma_new +nm_setting_cdma_get_number +nm_setting_cdma_get_username +nm_setting_cdma_get_password + +NM_SETTING_CDMA +NM_IS_SETTING_CDMA +NM_TYPE_SETTING_CDMA +nm_setting_cdma_error_get_type +NM_SETTING_CDMA_CLASS +NM_IS_SETTING_CDMA_CLASS +NM_SETTING_CDMA_GET_CLASS +
+ +
+nm-setting-serial +NMSettingSerial +NM_SETTING_SERIAL_SETTING_NAME +NMSettingSerialError +NM_TYPE_SETTING_SERIAL_ERROR +NM_SETTING_SERIAL_ERROR +nm_setting_serial_error_quark +NM_SETTING_SERIAL_BAUD +NM_SETTING_SERIAL_BITS +NM_SETTING_SERIAL_PARITY +NM_SETTING_SERIAL_STOPBITS +NM_SETTING_SERIAL_SEND_DELAY +NMSettingSerial +NMSettingSerialClass +nm_setting_serial_get_type +nm_setting_serial_new +nm_setting_serial_get_baud +nm_setting_serial_get_bits +nm_setting_serial_get_parity +nm_setting_serial_get_stopbits +nm_setting_serial_get_send_delay + +NM_SETTING_SERIAL +NM_IS_SETTING_SERIAL +NM_TYPE_SETTING_SERIAL +nm_setting_serial_error_get_type +NM_SETTING_SERIAL_CLASS +NM_IS_SETTING_SERIAL_CLASS +NM_SETTING_SERIAL_GET_CLASS +
+ +
+nm-setting-wireless-security +NMSettingWirelessSecurity +NM_SETTING_WIRELESS_SECURITY_SETTING_NAME +NMSettingWirelessSecurityError +NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR +NM_SETTING_WIRELESS_SECURITY_ERROR +nm_setting_wireless_security_error_quark +NMWepKeyType +NM_SETTING_WIRELESS_SECURITY_KEY_MGMT +NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX +NM_SETTING_WIRELESS_SECURITY_AUTH_ALG +NM_SETTING_WIRELESS_SECURITY_PROTO +NM_SETTING_WIRELESS_SECURITY_PAIRWISE +NM_SETTING_WIRELESS_SECURITY_GROUP +NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME +NM_SETTING_WIRELESS_SECURITY_WEP_KEY0 +NM_SETTING_WIRELESS_SECURITY_WEP_KEY1 +NM_SETTING_WIRELESS_SECURITY_WEP_KEY2 +NM_SETTING_WIRELESS_SECURITY_WEP_KEY3 +NM_SETTING_WIRELESS_SECURITY_PSK +NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD +NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE +NMSettingWirelessSecurity +NMSettingWirelessSecurityClass +nm_setting_wireless_security_get_type +nm_setting_wireless_security_new +nm_setting_wireless_security_get_key_mgmt +nm_setting_wireless_security_get_num_protos +nm_setting_wireless_security_get_proto +nm_setting_wireless_security_add_proto +nm_setting_wireless_security_remove_proto +nm_setting_wireless_security_clear_protos +nm_setting_wireless_security_get_num_pairwise +nm_setting_wireless_security_get_pairwise +nm_setting_wireless_security_add_pairwise +nm_setting_wireless_security_remove_pairwise +nm_setting_wireless_security_clear_pairwise +nm_setting_wireless_security_get_num_groups +nm_setting_wireless_security_get_group +nm_setting_wireless_security_add_group +nm_setting_wireless_security_remove_group +nm_setting_wireless_security_clear_groups +nm_setting_wireless_security_get_psk +nm_setting_wireless_security_get_leap_username +nm_setting_wireless_security_get_leap_password +nm_setting_wireless_security_get_wep_key +nm_setting_wireless_security_set_wep_key +nm_setting_wireless_security_get_wep_tx_keyidx +nm_setting_wireless_security_get_auth_alg +nm_setting_wireless_security_get_wep_key_type + +NM_SETTING_WIRELESS_SECURITY +NM_IS_SETTING_WIRELESS_SECURITY +NM_TYPE_SETTING_WIRELESS_SECURITY +nm_setting_wireless_security_error_get_type +NM_SETTING_WIRELESS_SECURITY_CLASS +NM_IS_SETTING_WIRELESS_SECURITY_CLASS +NM_SETTING_WIRELESS_SECURITY_GET_CLASS +
+ +
+nm-setting-ip6-config +NMSettingIP6Config +NM_SETTING_IP6_CONFIG_SETTING_NAME +NMSettingIP6ConfigError +NM_TYPE_SETTING_IP6_CONFIG_ERROR +NM_SETTING_IP6_CONFIG_ERROR +nm_setting_ip6_config_error_quark +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_IP6_CONFIG_METHOD_IGNORE +NM_SETTING_IP6_CONFIG_METHOD_AUTO +NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL +NM_SETTING_IP6_CONFIG_METHOD_MANUAL +NM_SETTING_IP6_CONFIG_METHOD_SHARED +NMIP6Address +nm_ip6_address_new +nm_ip6_address_dup +nm_ip6_address_ref +nm_ip6_address_unref +nm_ip6_address_compare +nm_ip6_address_get_address +nm_ip6_address_set_address +nm_ip6_address_get_prefix +nm_ip6_address_set_prefix +nm_ip6_address_get_gateway +nm_ip6_address_set_gateway +NMIP6Route +nm_ip6_route_new +nm_ip6_route_dup +nm_ip6_route_ref +nm_ip6_route_unref +nm_ip6_route_compare +nm_ip6_route_get_dest +nm_ip6_route_set_dest +nm_ip6_route_get_prefix +nm_ip6_route_set_prefix +nm_ip6_route_get_next_hop +nm_ip6_route_set_next_hop +nm_ip6_route_get_metric +nm_ip6_route_set_metric +NMSettingIP6Config +NMSettingIP6ConfigClass +nm_setting_ip6_config_get_type +nm_setting_ip6_config_new +nm_setting_ip6_config_get_method +nm_setting_ip6_config_get_num_dns +nm_setting_ip6_config_get_dns +nm_setting_ip6_config_add_dns +nm_setting_ip6_config_remove_dns +nm_setting_ip6_config_clear_dns +nm_setting_ip6_config_get_num_dns_searches +nm_setting_ip6_config_get_dns_search +nm_setting_ip6_config_add_dns_search +nm_setting_ip6_config_remove_dns_search +nm_setting_ip6_config_clear_dns_searches +nm_setting_ip6_config_get_num_addresses +nm_setting_ip6_config_get_address +nm_setting_ip6_config_add_address +nm_setting_ip6_config_remove_address +nm_setting_ip6_config_clear_addresses +nm_setting_ip6_config_get_num_routes +nm_setting_ip6_config_get_route +nm_setting_ip6_config_add_route +nm_setting_ip6_config_remove_route +nm_setting_ip6_config_clear_routes +nm_setting_ip6_config_get_ignore_auto_routes +nm_setting_ip6_config_get_ignore_auto_dns +nm_setting_ip6_config_get_never_default +nm_setting_ip6_config_get_may_fail + +NM_SETTING_IP6_CONFIG +NM_IS_SETTING_IP6_CONFIG +NM_TYPE_SETTING_IP6_CONFIG +nm_setting_ip6_config_error_get_type +NM_SETTING_IP6_CONFIG_CLASS +NM_IS_SETTING_IP6_CONFIG_CLASS +NM_SETTING_IP6_CONFIG_GET_CLASS +
+ +
+nm-setting-ip4-config +NMSettingIP4Config +NM_SETTING_IP4_CONFIG_SETTING_NAME +NMSettingIP4ConfigError +NM_TYPE_SETTING_IP4_CONFIG_ERROR +NM_SETTING_IP4_CONFIG_ERROR +nm_setting_ip4_config_error_quark +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_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_IP4_CONFIG_METHOD_AUTO +NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL +NM_SETTING_IP4_CONFIG_METHOD_MANUAL +NM_SETTING_IP4_CONFIG_METHOD_SHARED +NM_SETTING_IP4_CONFIG_METHOD_DISABLED +NMIP4Address +nm_ip4_address_new +nm_ip4_address_dup +nm_ip4_address_ref +nm_ip4_address_unref +nm_ip4_address_compare +nm_ip4_address_get_address +nm_ip4_address_set_address +nm_ip4_address_get_prefix +nm_ip4_address_set_prefix +nm_ip4_address_get_gateway +nm_ip4_address_set_gateway +NMIP4Route +nm_ip4_route_new +nm_ip4_route_dup +nm_ip4_route_ref +nm_ip4_route_unref +nm_ip4_route_compare +nm_ip4_route_get_dest +nm_ip4_route_set_dest +nm_ip4_route_get_prefix +nm_ip4_route_set_prefix +nm_ip4_route_get_next_hop +nm_ip4_route_set_next_hop +nm_ip4_route_get_metric +nm_ip4_route_set_metric +NMSettingIP4Config +NMSettingIP4ConfigClass +nm_setting_ip4_config_get_type +nm_setting_ip4_config_new +nm_setting_ip4_config_get_method +nm_setting_ip4_config_get_num_dns +nm_setting_ip4_config_get_dns +nm_setting_ip4_config_add_dns +nm_setting_ip4_config_remove_dns +nm_setting_ip4_config_clear_dns +nm_setting_ip4_config_get_num_dns_searches +nm_setting_ip4_config_get_dns_search +nm_setting_ip4_config_add_dns_search +nm_setting_ip4_config_remove_dns_search +nm_setting_ip4_config_clear_dns_searches +nm_setting_ip4_config_get_num_addresses +nm_setting_ip4_config_get_address +nm_setting_ip4_config_add_address +nm_setting_ip4_config_remove_address +nm_setting_ip4_config_clear_addresses +nm_setting_ip4_config_get_num_routes +nm_setting_ip4_config_get_route +nm_setting_ip4_config_add_route +nm_setting_ip4_config_remove_route +nm_setting_ip4_config_clear_routes +nm_setting_ip4_config_get_ignore_auto_routes +nm_setting_ip4_config_get_ignore_auto_dns +nm_setting_ip4_config_get_dhcp_client_id +nm_setting_ip4_config_get_dhcp_send_hostname +nm_setting_ip4_config_get_dhcp_hostname +nm_setting_ip4_config_get_never_default +nm_setting_ip4_config_get_may_fail + +NM_SETTING_IP4_CONFIG +NM_IS_SETTING_IP4_CONFIG +NM_TYPE_SETTING_IP4_CONFIG +nm_setting_ip4_config_error_get_type +NM_SETTING_IP4_CONFIG_CLASS +NM_IS_SETTING_IP4_CONFIG_CLASS +NM_SETTING_IP4_CONFIG_GET_CLASS +
+ +
+nm-setting-wired +NMSettingWired +NM_SETTING_WIRED_SETTING_NAME +NMSettingWiredError +NM_TYPE_SETTING_WIRED_ERROR +NM_SETTING_WIRED_ERROR +nm_setting_wired_error_quark +NM_SETTING_WIRED_PORT +NM_SETTING_WIRED_SPEED +NM_SETTING_WIRED_DUPLEX +NM_SETTING_WIRED_AUTO_NEGOTIATE +NM_SETTING_WIRED_MAC_ADDRESS +NM_SETTING_WIRED_MTU +NMSettingWired +NMSettingWiredClass +nm_setting_wired_get_type +nm_setting_wired_new +nm_setting_wired_get_port +nm_setting_wired_get_speed +nm_setting_wired_get_duplex +nm_setting_wired_get_auto_negotiate +nm_setting_wired_get_mac_address +nm_setting_wired_get_mtu + +NM_SETTING_WIRED +NM_IS_SETTING_WIRED +NM_TYPE_SETTING_WIRED +nm_setting_wired_error_get_type +NM_SETTING_WIRED_CLASS +NM_IS_SETTING_WIRED_CLASS +NM_SETTING_WIRED_GET_CLASS +
+ +
+nm-setting-connection +NMSettingConnection +NM_SETTING_CONNECTION_SETTING_NAME +NMSettingConnectionError +NM_TYPE_SETTING_CONNECTION_ERROR +NM_SETTING_CONNECTION_ERROR +nm_setting_connection_error_quark +NM_SETTING_CONNECTION_ID +NM_SETTING_CONNECTION_UUID +NM_SETTING_CONNECTION_TYPE +NM_SETTING_CONNECTION_AUTOCONNECT +NM_SETTING_CONNECTION_TIMESTAMP +NM_SETTING_CONNECTION_READ_ONLY +NMSettingConnection +NMSettingConnectionClass +nm_setting_connection_get_type +nm_setting_connection_new +nm_setting_connection_get_id +nm_setting_connection_get_uuid +nm_setting_connection_get_connection_type +nm_setting_connection_get_autoconnect +nm_setting_connection_get_timestamp +nm_setting_connection_get_read_only + +NM_SETTING_CONNECTION +NM_IS_SETTING_CONNECTION +NM_TYPE_SETTING_CONNECTION +nm_setting_connection_error_get_type +NM_SETTING_CONNECTION_CLASS +NM_IS_SETTING_CONNECTION_CLASS +NM_SETTING_CONNECTION_GET_CLASS +
+ +
+nm-setting +NMSetting +NMSettingError +NM_TYPE_SETTING_ERROR +NM_SETTING_ERROR +nm_setting_error_quark +NM_SETTING_PARAM_SERIALIZE +NM_SETTING_PARAM_REQUIRED +NM_SETTING_PARAM_SECRET +NM_SETTING_PARAM_FUZZY_IGNORE +NM_SETTING_NAME +NMSetting +NMSettingClass +NMSettingValueIterFn +nm_setting_get_type +nm_setting_to_hash +nm_setting_new_from_hash +nm_setting_duplicate +nm_setting_get_name +nm_setting_verify +NMSettingCompareFlags +nm_setting_compare +nm_setting_enumerate_values +nm_setting_to_string +nm_setting_clear_secrets +nm_setting_need_secrets +nm_setting_update_secrets + +NM_SETTING +NM_IS_SETTING +NM_TYPE_SETTING +nm_setting_error_get_type +NM_SETTING_CLASS +NM_IS_SETTING_CLASS +NM_SETTING_GET_CLASS +
+ +
+nm-setting-ppp +NMSettingPPP +NM_SETTING_PPP_SETTING_NAME +NMSettingPPPError +NM_TYPE_SETTING_PPP_ERROR +NM_SETTING_PPP_ERROR +nm_setting_ppp_error_quark +NM_SETTING_PPP_NOAUTH +NM_SETTING_PPP_REFUSE_EAP +NM_SETTING_PPP_REFUSE_PAP +NM_SETTING_PPP_REFUSE_CHAP +NM_SETTING_PPP_REFUSE_MSCHAP +NM_SETTING_PPP_REFUSE_MSCHAPV2 +NM_SETTING_PPP_NOBSDCOMP +NM_SETTING_PPP_NODEFLATE +NM_SETTING_PPP_NO_VJ_COMP +NM_SETTING_PPP_REQUIRE_MPPE +NM_SETTING_PPP_REQUIRE_MPPE_128 +NM_SETTING_PPP_MPPE_STATEFUL +NM_SETTING_PPP_CRTSCTS +NM_SETTING_PPP_BAUD +NM_SETTING_PPP_MRU +NM_SETTING_PPP_MTU +NM_SETTING_PPP_LCP_ECHO_FAILURE +NM_SETTING_PPP_LCP_ECHO_INTERVAL +NMSettingPPP +NMSettingPPPClass +nm_setting_ppp_get_type +nm_setting_ppp_new +nm_setting_ppp_get_noauth +nm_setting_ppp_get_refuse_eap +nm_setting_ppp_get_refuse_pap +nm_setting_ppp_get_refuse_chap +nm_setting_ppp_get_refuse_mschap +nm_setting_ppp_get_refuse_mschapv2 +nm_setting_ppp_get_nobsdcomp +nm_setting_ppp_get_nodeflate +nm_setting_ppp_get_no_vj_comp +nm_setting_ppp_get_require_mppe +nm_setting_ppp_get_require_mppe_128 +nm_setting_ppp_get_mppe_stateful +nm_setting_ppp_get_crtscts +nm_setting_ppp_get_baud +nm_setting_ppp_get_mru +nm_setting_ppp_get_mtu +nm_setting_ppp_get_lcp_echo_failure +nm_setting_ppp_get_lcp_echo_interval + +NM_SETTING_PPP +NM_IS_SETTING_PPP +NM_TYPE_SETTING_PPP +nm_setting_ppp_error_get_type +NM_SETTING_PPP_CLASS +NM_IS_SETTING_PPP_CLASS +NM_SETTING_PPP_GET_CLASS +
+ +
+nm-connection +NMConnection +NMConnectionScope +NMConnectionError +NM_TYPE_CONNECTION_ERROR +NM_CONNECTION_ERROR +nm_connection_error_quark +NM_CONNECTION_SCOPE +NM_CONNECTION_PATH +NMConnection +NMConnectionClass +nm_connection_get_type +nm_connection_new +nm_connection_new_from_hash +nm_connection_duplicate +nm_connection_add_setting +nm_connection_remove_setting +nm_connection_get_setting +nm_connection_get_setting_by_name +nm_connection_replace_settings +nm_connection_compare +nm_connection_verify +nm_connection_need_secrets +nm_connection_clear_secrets +nm_connection_update_secrets +nm_connection_set_scope +nm_connection_get_scope +nm_connection_set_path +nm_connection_get_path +nm_connection_for_each_setting_value +nm_connection_to_hash +nm_connection_dump +nm_connection_create_setting +nm_connection_lookup_setting_type +nm_connection_lookup_setting_type_by_quark + +NM_CONNECTION +NM_IS_CONNECTION +NM_TYPE_CONNECTION +nm_connection_error_get_type +NM_CONNECTION_CLASS +NM_IS_CONNECTION_CLASS +NM_CONNECTION_GET_CLASS +
+ +
+nm-setting-pppoe +NMSettingPPPOE +NM_SETTING_PPPOE_SETTING_NAME +NMSettingPPPOEError +NM_TYPE_SETTING_PPPOE_ERROR +NM_SETTING_PPPOE_ERROR +nm_setting_pppoe_error_quark +NM_SETTING_PPPOE_SERVICE +NM_SETTING_PPPOE_USERNAME +NM_SETTING_PPPOE_PASSWORD +NMSettingPPPOE +NMSettingPPPOEClass +nm_setting_pppoe_get_type +nm_setting_pppoe_new +nm_setting_pppoe_get_service +nm_setting_pppoe_get_username +nm_setting_pppoe_get_password + +NM_SETTING_PPPOE +NM_IS_SETTING_PPPOE +NM_TYPE_SETTING_PPPOE +nm_setting_pppoe_error_get_type +NM_SETTING_PPPOE_CLASS +NM_IS_SETTING_PPPOE_CLASS +NM_SETTING_PPPOE_GET_CLASS +
+ +
+nm-setting-vpn +NMSettingVPN +NM_SETTING_VPN_SETTING_NAME +NMSettingVpnError +NM_TYPE_SETTING_VPN_ERROR +NM_SETTING_VPN_ERROR +nm_setting_vpn_error_quark +NM_SETTING_VPN_SERVICE_TYPE +NM_SETTING_VPN_USER_NAME +NM_SETTING_VPN_DATA +NM_SETTING_VPN_SECRETS +NMSettingVPN +NMSettingVPNClass +VPNIterFunc +nm_setting_vpn_get_type +nm_setting_vpn_new +nm_setting_vpn_get_service_type +nm_setting_vpn_get_user_name +nm_setting_vpn_add_data_item +nm_setting_vpn_get_data_item +nm_setting_vpn_remove_data_item +nm_setting_vpn_foreach_data_item +nm_setting_vpn_add_secret +nm_setting_vpn_get_secret +nm_setting_vpn_remove_secret +nm_setting_vpn_foreach_secret + +NM_SETTING_VPN +NM_IS_SETTING_VPN +NM_TYPE_SETTING_VPN +nm_setting_vpn_error_get_type +NM_SETTING_VPN_CLASS +NM_IS_SETTING_VPN_CLASS +NM_SETTING_VPN_GET_CLASS +
+ +
+nm-setting-wireless +NMSettingWireless +NM_SETTING_WIRELESS_SETTING_NAME +NMSettingWirelessError +NM_TYPE_SETTING_WIRELESS_ERROR +NM_SETTING_WIRELESS_ERROR +nm_setting_wireless_error_quark +NM_SETTING_WIRELESS_SSID +NM_SETTING_WIRELESS_MODE +NM_SETTING_WIRELESS_BAND +NM_SETTING_WIRELESS_CHANNEL +NM_SETTING_WIRELESS_BSSID +NM_SETTING_WIRELESS_RATE +NM_SETTING_WIRELESS_TX_POWER +NM_SETTING_WIRELESS_MAC_ADDRESS +NM_SETTING_WIRELESS_MTU +NM_SETTING_WIRELESS_SEEN_BSSIDS +NM_SETTING_WIRELESS_SEC +NMSettingWireless +NMSettingWirelessClass +nm_setting_wireless_get_type +nm_setting_wireless_new +nm_setting_wireless_get_ssid +nm_setting_wireless_get_mode +nm_setting_wireless_get_band +nm_setting_wireless_get_channel +nm_setting_wireless_get_bssid +nm_setting_wireless_get_rate +nm_setting_wireless_get_tx_power +nm_setting_wireless_get_mac_address +nm_setting_wireless_get_mtu +nm_setting_wireless_get_security +nm_setting_wireless_add_seen_bssid +nm_setting_wireless_get_num_seen_bssids +nm_setting_wireless_get_seen_bssid +nm_setting_wireless_ap_security_compatible + +NM_SETTING_WIRELESS +NM_IS_SETTING_WIRELESS +NM_TYPE_SETTING_WIRELESS +nm_setting_wireless_error_get_type +NM_SETTING_WIRELESS_CLASS +NM_IS_SETTING_WIRELESS_CLASS +NM_SETTING_WIRELESS_GET_CLASS +
+ +
+nm-utils +nm_print_backtrace +nm_get_timestamp +nm_info +nm_info_str +nm_debug +nm_debug_str +nm_warning +nm_warning_str +nm_error +nm_error_str +nm_utils_init +nm_utils_deinit +nm_utils_is_empty_ssid +nm_utils_escape_ssid +nm_utils_same_ssid +nm_utils_ssid_to_utf8 +nm_utils_gvalue_hash_dup +nm_utils_slist_free +NMUtilsSecurityType +nm_utils_security_valid +nm_utils_ip4_addresses_from_gvalue +nm_utils_ip4_addresses_to_gvalue +nm_utils_ip4_routes_from_gvalue +nm_utils_ip4_routes_to_gvalue +nm_utils_ip4_netmask_to_prefix +nm_utils_ip4_prefix_to_netmask +nm_utils_ip4_get_default_prefix +nm_utils_ip6_addresses_from_gvalue +nm_utils_ip6_addresses_to_gvalue +nm_utils_ip6_routes_from_gvalue +nm_utils_ip6_routes_to_gvalue +nm_utils_ip6_dns_from_gvalue +nm_utils_ip6_dns_to_gvalue +nm_utils_uuid_generate +nm_utils_uuid_generate_from_string +nm_utils_rsa_key_encrypt +
+ diff --git a/docs/libnm-util/libnm-util.types b/docs/libnm-util/libnm-util.types new file mode 100644 index 00000000..c0283767 --- /dev/null +++ b/docs/libnm-util/libnm-util.types @@ -0,0 +1,34 @@ +nm_connection_error_get_type +nm_connection_get_type +nm_setting_802_1x_error_get_type +nm_setting_802_1x_get_type +nm_setting_bluetooth_error_get_type +nm_setting_bluetooth_get_type +nm_setting_cdma_error_get_type +nm_setting_cdma_get_type +nm_setting_connection_error_get_type +nm_setting_connection_get_type +nm_setting_error_get_type +nm_setting_get_type +nm_setting_gsm_error_get_type +nm_setting_gsm_get_type +nm_setting_ip4_config_error_get_type +nm_setting_ip4_config_get_type +nm_setting_ip6_config_error_get_type +nm_setting_ip6_config_get_type +nm_setting_olpc_mesh_error_get_type +nm_setting_olpc_mesh_get_type +nm_setting_ppp_error_get_type +nm_setting_ppp_get_type +nm_setting_pppoe_error_get_type +nm_setting_pppoe_get_type +nm_setting_serial_error_get_type +nm_setting_serial_get_type +nm_setting_vpn_error_get_type +nm_setting_vpn_get_type +nm_setting_wired_error_get_type +nm_setting_wired_get_type +nm_setting_wireless_error_get_type +nm_setting_wireless_get_type +nm_setting_wireless_security_error_get_type +nm_setting_wireless_security_get_type diff --git a/docs/libnm-util/tmpl/libnm-util-unused.sgml b/docs/libnm-util/tmpl/libnm-util-unused.sgml new file mode 100644 index 00000000..ea59da27 --- /dev/null +++ b/docs/libnm-util/tmpl/libnm-util-unused.sgml @@ -0,0 +1,695 @@ + + + + + + + + + + + + + + + + + + + + + +NMSettingBridge + + + + + + + + + + + + + + + + + + + + + + + + + + + +NMSettingWimax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_BRIDGE_ERROR_UNKNOWN: +@NM_SETTING_BRIDGE_ERROR_INVALID_PROPERTY: +@NM_SETTING_BRIDGE_ERROR_MISSING_PROPERTY: + + + + + + +@NM_SETTING_GSM_NETWORK_ANY: +@NM_SETTING_GSM_NETWORK_UMTS_HSPA: +@NM_SETTING_GSM_NETWORK_GPRS_EDGE: +@NM_SETTING_GSM_NETWORK_PREFER_UMTS_HSPA: +@NM_SETTING_GSM_NETWORK_PREFER_GPRS_EDGE: + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@NM_SETTING_WIMAX_ERROR_UNKNOWN: +@NM_SETTING_WIMAX_ERROR_INVALID_PROPERTY: +@NM_SETTING_WIMAX_ERROR_MISSING_PROPERTY: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@setting: +@path_to_cert: +@out_ck_type: +@error: +@Returns: + + + + + + +@setting: +@path_to_cert: +@out_ck_type: +@error: +@Returns: + + + + + + +@setting: +@path_to_cert: +@out_ck_type: +@error: +@Returns: + + + + + + +@setting: +@path_to_cert: +@out_ck_type: +@error: +@Returns: + + + + + + +@setting: +@path_to_file: +@password: +@out_ck_type: +@error: +@Returns: + + + + + + +@setting: +@path_to_file: +@password: +@out_ck_type: +@error: +@Returns: + + + + + + +@setting: +@uuid: +@Returns: + + + + + + +@setting: + + + + + + +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@i: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + +@setting: +@i: + + + + + + +@void: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@void: +@Returns: + + + + + + +@void: +@Returns: + + + + + + +@setting: +@key: +@item: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@idx: +@out_key: +@out_value: +@Returns: + + + + + + +@setting: +@key: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@setting: +@key: +@Returns: + + + + + + +@setting: +@Returns: + + + + + + +@channel: +@band: +@Returns: + + + + + + +@channel: +@direction: +@band: +@Returns: + + + + + + +@freq: +@Returns: + + + + + + +@channel: +@band: +@Returns: + diff --git a/docs/libnm-util/tmpl/nm-connection.sgml b/docs/libnm-util/tmpl/nm-connection.sgml new file mode 100644 index 00000000..649e62c7 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-connection.sgml @@ -0,0 +1,335 @@ + +NMConnection + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_CONNECTION_SCOPE_UNKNOWN: +@NM_CONNECTION_SCOPE_SYSTEM: +@NM_CONNECTION_SCOPE_USER: + + + + + + +@NM_CONNECTION_ERROR_UNKNOWN: +@NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + +@nmconnection: the object which received the signal. +@arg1: + + + + + + + + + + + + + + + + +@parent: +@secrets_updated: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@hash: +@error: +@Returns: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@setting: + + + + + + + +@connection: +@setting_type: + + + + + + + +@connection: +@setting_type: +@Returns: + + + + + + + +@connection: +@name: +@Returns: + + + + + + + +@connection: +@new_settings: +@error: +@Returns: + + + + + + + +@a: +@b: +@flags: +@Returns: + + + + + + + +@connection: +@error: +@Returns: + + + + + + + +@connection: +@hints: +@Returns: + + + + + + + +@connection: + + + + + + + +@connection: +@setting_name: +@secrets: +@error: +@Returns: + + + + + + + +@connection: +@scope: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@path: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: +@func: +@user_data: + + + + + + + +@connection: +@Returns: + + + + + + + +@connection: + + + + + + + +@name: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@error_quark: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-8021x.sgml b/docs/libnm-util/tmpl/nm-setting-8021x.sgml new file mode 100644 index 00000000..d759e94f --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-8021x.sgml @@ -0,0 +1,966 @@ + +NMSetting8021x + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_802_1X_CK_FORMAT_UNKNOWN: +@NM_SETTING_802_1X_CK_FORMAT_X509: +@NM_SETTING_802_1X_CK_FORMAT_RAW_KEY: +@NM_SETTING_802_1X_CK_FORMAT_PKCS12: + + + + + + +@NM_SETTING_802_1X_CK_SCHEME_UNKNOWN: +@NM_SETTING_802_1X_CK_SCHEME_BLOB: +@NM_SETTING_802_1X_CK_SCHEME_PATH: + + + + + + + + + + + + + +@NM_SETTING_802_1X_ERROR_UNKNOWN: +@NM_SETTING_802_1X_ERROR_INVALID_PROPERTY: +@NM_SETTING_802_1X_ERROR_MISSING_PROPERTY: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@eap: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@value: +@scheme: +@out_format: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@value: +@scheme: +@out_format: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@value: +@scheme: +@out_format: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@value: +@scheme: +@out_format: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@value: +@password: +@scheme: +@out_format: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@value: +@password: +@scheme: +@out_format: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@NM_SETTING_802_1X_CK_TYPE_UNKNOWN: +@NM_SETTING_802_1X_CK_TYPE_X509: +@NM_SETTING_802_1X_CK_TYPE_RAW_KEY: +@NM_SETTING_802_1X_CK_TYPE_PKCS12: + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@filename: +@out_ck_type: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@filename: +@out_ck_type: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@filename: +@out_ck_type: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@filename: +@out_ck_type: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@filename: +@password: +@out_ck_type: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@filename: +@password: +@out_ck_type: +@error: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-bluetooth.sgml b/docs/libnm-util/tmpl/nm-setting-bluetooth.sgml new file mode 100644 index 00000000..255435e8 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-bluetooth.sgml @@ -0,0 +1,153 @@ + +NMSettingBluetooth + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_BLUETOOTH_ERROR_UNKNOWN: +@NM_SETTING_BLUETOOTH_ERROR_INVALID_PROPERTY: +@NM_SETTING_BLUETOOTH_ERROR_MISSING_PROPERTY: +@NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-bridge.sgml b/docs/libnm-util/tmpl/nm-setting-bridge.sgml new file mode 100644 index 00000000..15d757c3 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-bridge.sgml @@ -0,0 +1,160 @@ + +NMSettingBridge + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_BRIDGE_ERROR_UNKNOWN: +@NM_SETTING_BRIDGE_ERROR_INVALID_PROPERTY: +@NM_SETTING_BRIDGE_ERROR_MISSING_PROPERTY: + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@Returns: + + + + + + + +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@uuid: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + diff --git a/docs/libnm-util/tmpl/nm-setting-cdma.sgml b/docs/libnm-util/tmpl/nm-setting-cdma.sgml new file mode 100644 index 00000000..21fa4c35 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-cdma.sgml @@ -0,0 +1,160 @@ + +NMSettingCdma + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_CDMA_ERROR_UNKNOWN: +@NM_SETTING_CDMA_ERROR_INVALID_PROPERTY: +@NM_SETTING_CDMA_ERROR_MISSING_PROPERTY: +@NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-connection.sgml b/docs/libnm-util/tmpl/nm-setting-connection.sgml new file mode 100644 index 00000000..58473e01 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-connection.sgml @@ -0,0 +1,223 @@ + +NMSettingConnection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_CONNECTION_ERROR_UNKNOWN: +@NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY: +@NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY: +@NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-gsm.sgml b/docs/libnm-util/tmpl/nm-setting-gsm.sgml new file mode 100644 index 00000000..fe91c082 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-gsm.sgml @@ -0,0 +1,394 @@ + +NMSettingGsm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_GSM_ERROR_UNKNOWN: +@NM_SETTING_GSM_ERROR_INVALID_PROPERTY: +@NM_SETTING_GSM_ERROR_MISSING_PROPERTY: +@NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_GSM_NETWORK_TYPE_ANY: +@NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA: +@NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE: +@NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA: +@NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE: + + + + + + +@NM_SETTING_GSM_BAND_UNKNOWN: +@NM_SETTING_GSM_BAND_ANY: +@NM_SETTING_GSM_BAND_EGSM: +@NM_SETTING_GSM_BAND_DCS: +@NM_SETTING_GSM_BAND_PCS: +@NM_SETTING_GSM_BAND_G850: +@NM_SETTING_GSM_BAND_U2100: +@NM_SETTING_GSM_BAND_U1800: +@NM_SETTING_GSM_BAND_U17IV: +@NM_SETTING_GSM_BAND_U800: +@NM_SETTING_GSM_BAND_U850: +@NM_SETTING_GSM_BAND_U900: +@NM_SETTING_GSM_BAND_U17IX: +@NM_SETTING_GSM_BAND_U1900: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-ip4-config.sgml b/docs/libnm-util/tmpl/nm-setting-ip4-config.sgml new file mode 100644 index 00000000..b374a2b1 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-ip4-config.sgml @@ -0,0 +1,758 @@ + +NMSettingIP4Config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_IP4_CONFIG_ERROR_UNKNOWN: +@NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY: +@NM_SETTING_IP4_CONFIG_ERROR_MISSING_PROPERTY: +@NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@source: +@Returns: + + + + + + + +@address: + + + + + + + +@address: + + + + + + + +@address: +@other: +@Returns: + + + + + + + +@address: +@Returns: + + + + + + + +@address: +@addr: + + + + + + + +@address: +@Returns: + + + + + + + +@address: +@prefix: + + + + + + + +@address: +@Returns: + + + + + + + +@address: +@gateway: + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@route: +@Returns: + + + + + + + +@route: + + + + + + + +@route: + + + + + + + +@route: +@other: +@Returns: + + + + + + + +@route: +@Returns: + + + + + + + +@route: +@dest: + + + + + + + +@route: +@Returns: + + + + + + + +@route: +@prefix: + + + + + + + +@route: +@Returns: + + + + + + + +@route: +@next_hop: + + + + + + + +@route: +@Returns: + + + + + + + +@route: +@metric: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@dns: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@dns_search: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@address: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@route: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-ip6-config.sgml b/docs/libnm-util/tmpl/nm-setting-ip6-config.sgml new file mode 100644 index 00000000..aabe6d24 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-ip6-config.sgml @@ -0,0 +1,695 @@ + +NMSettingIP6Config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_IP6_CONFIG_ERROR_UNKNOWN: +@NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY: +@NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY: +@NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@source: +@Returns: + + + + + + + +@address: + + + + + + + +@address: + + + + + + + +@address: +@other: +@Returns: + + + + + + + +@address: +@Returns: + + + + + + + +@address: +@addr: + + + + + + + +@address: +@Returns: + + + + + + + +@address: +@prefix: + + + + + + + +@address: +@Returns: + + + + + + + +@address: +@gw: + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@route: +@Returns: + + + + + + + +@route: + + + + + + + +@route: + + + + + + + +@route: +@other: +@Returns: + + + + + + + +@route: +@Returns: + + + + + + + +@route: +@dest: + + + + + + + +@route: +@Returns: + + + + + + + +@route: +@prefix: + + + + + + + +@route: +@Returns: + + + + + + + +@route: +@next_hop: + + + + + + + +@route: +@Returns: + + + + + + + +@route: +@metric: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@dns: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@dns_search: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@address: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@route: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-olpc-mesh.sgml b/docs/libnm-util/tmpl/nm-setting-olpc-mesh.sgml new file mode 100644 index 00000000..d9194bd1 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-olpc-mesh.sgml @@ -0,0 +1,159 @@ + +NMSettingOlpcMesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_OLPC_MESH_ERROR_UNKNOWN: +@NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY: +@NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-ppp.sgml b/docs/libnm-util/tmpl/nm-setting-ppp.sgml new file mode 100644 index 00000000..9c48f890 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-ppp.sgml @@ -0,0 +1,475 @@ + +NMSettingPPP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_PPP_ERROR_UNKNOWN: +@NM_SETTING_PPP_ERROR_INVALID_PROPERTY: +@NM_SETTING_PPP_ERROR_MISSING_PROPERTY: +@NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-pppoe.sgml b/docs/libnm-util/tmpl/nm-setting-pppoe.sgml new file mode 100644 index 00000000..5bd2666c --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-pppoe.sgml @@ -0,0 +1,160 @@ + +NMSettingPPPOE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_PPPOE_ERROR_UNKNOWN: +@NM_SETTING_PPPOE_ERROR_INVALID_PROPERTY: +@NM_SETTING_PPPOE_ERROR_MISSING_PROPERTY: +@NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-serial.sgml b/docs/libnm-util/tmpl/nm-setting-serial.sgml new file mode 100644 index 00000000..c5aeb6fc --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-serial.sgml @@ -0,0 +1,202 @@ + +NMSettingSerial + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_SERIAL_ERROR_UNKNOWN: +@NM_SETTING_SERIAL_ERROR_INVALID_PROPERTY: +@NM_SETTING_SERIAL_ERROR_MISSING_PROPERTY: +@NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-vpn.sgml b/docs/libnm-util/tmpl/nm-setting-vpn.sgml new file mode 100644 index 00000000..f30f01f9 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-vpn.sgml @@ -0,0 +1,250 @@ + +NMSettingVPN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_VPN_ERROR_UNKNOWN: +@NM_SETTING_VPN_ERROR_INVALID_PROPERTY: +@NM_SETTING_VPN_ERROR_MISSING_PROPERTY: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@key: +@value: +@user_data: + + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@key: +@item: + + + + + + + +@setting: +@key: +@Returns: + + + + + + + +@setting: +@key: + + + + + + + +@setting: +@func: +@user_data: + + + + + + + +@setting: +@key: +@secret: + + + + + + + +@setting: +@key: +@Returns: + + + + + + + +@setting: +@key: + + + + + + + +@setting: +@func: +@user_data: + + diff --git a/docs/libnm-util/tmpl/nm-setting-wimax.sgml b/docs/libnm-util/tmpl/nm-setting-wimax.sgml new file mode 100644 index 00000000..07d54af4 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-wimax.sgml @@ -0,0 +1,136 @@ + +NMSettingWimax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_WIMAX_ERROR_UNKNOWN: +@NM_SETTING_WIMAX_ERROR_INVALID_PROPERTY: +@NM_SETTING_WIMAX_ERROR_MISSING_PROPERTY: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-wired.sgml b/docs/libnm-util/tmpl/nm-setting-wired.sgml new file mode 100644 index 00000000..4ac2c691 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-wired.sgml @@ -0,0 +1,222 @@ + +NMSettingWired + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_WIRED_ERROR_UNKNOWN: +@NM_SETTING_WIRED_ERROR_INVALID_PROPERTY: +@NM_SETTING_WIRED_ERROR_MISSING_PROPERTY: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-wireless-security.sgml b/docs/libnm-util/tmpl/nm-setting-wireless-security.sgml new file mode 100644 index 00000000..7ebd57d5 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-wireless-security.sgml @@ -0,0 +1,499 @@ + +NMSettingWirelessSecurity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_WIRELESS_SECURITY_ERROR_UNKNOWN: +@NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY: +@NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_PROPERTY: +@NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING: +@NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X: +@NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME: +@NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + +@NM_WEP_KEY_TYPE_UNKNOWN: +@NM_WEP_KEY_TYPE_KEY: +@NM_WEP_KEY_TYPE_PASSPHRASE: +@NM_WEP_KEY_TYPE_LAST: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@proto: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@pairwise: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@setting: +@group: +@Returns: + + + + + + + +@setting: +@i: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@idx: +@Returns: + + + + + + + +@setting: +@idx: +@key: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting-wireless.sgml b/docs/libnm-util/tmpl/nm-setting-wireless.sgml new file mode 100644 index 00000000..d1734f16 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting-wireless.sgml @@ -0,0 +1,363 @@ + +NMSettingWireless + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_WIRELESS_ERROR_UNKNOWN: +@NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY: +@NM_SETTING_WIRELESS_ERROR_MISSING_PROPERTY: +@NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING: +@NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@void: +@Returns: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@bssid: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@i: +@Returns: + + + + + + + +@s_wireless: +@s_wireless_sec: +@ap_flags: +@ap_wpa: +@ap_rsn: +@ap_mode: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-setting.sgml b/docs/libnm-util/tmpl/nm-setting.sgml new file mode 100644 index 00000000..989e71d1 --- /dev/null +++ b/docs/libnm-util/tmpl/nm-setting.sgml @@ -0,0 +1,252 @@ + +NMSetting + + + + + + + + + + + + + + + + + + + + + + + + + +@NM_SETTING_ERROR_UNKNOWN: +@NM_SETTING_ERROR_PROPERTY_NOT_FOUND: +@NM_SETTING_ERROR_PROPERTY_NOT_SECRET: +@NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH: + + + + + + + + + + + + + + + + + + + + +@void: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@parent: +@verify: +@need_secrets: +@update_one_secret: +@_reserved1: +@_reserved2: +@_reserved3: +@_reserved4: + + + + + + +@setting: +@key: +@value: +@flags: +@user_data: + + + + + + + +@void: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting_type: +@hash: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@all_settings: +@error: +@Returns: + + + + + + + +@NM_SETTING_COMPARE_FLAG_EXACT: +@NM_SETTING_COMPARE_FLAG_FUZZY: +@NM_SETTING_COMPARE_FLAG_IGNORE_ID: +@NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS: + + + + + + +@a: +@b: +@flags: +@Returns: + + + + + + + +@setting: +@func: +@user_data: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: + + + + + + + +@setting: +@Returns: + + + + + + + +@setting: +@secrets: +@error: +@Returns: + + diff --git a/docs/libnm-util/tmpl/nm-utils.sgml b/docs/libnm-util/tmpl/nm-utils.sgml new file mode 100644 index 00000000..7c7d3d5e --- /dev/null +++ b/docs/libnm-util/tmpl/nm-utils.sgml @@ -0,0 +1,362 @@ + +nm-utils + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@timestamp: + + + + + + + +@fmt: +@args...: + + + + + + + +@fmt_str: +@args...: + + + + + + + +@fmt: +@args...: + + + + + + + +@fmt_str: +@args...: + + + + + + + +@fmt: +@args...: + + + + + + + +@fmt_str: +@args...: + + + + + + + +@fmt: +@args...: + + + + + + + +@fmt_str: +@args...: + + + + + + + +@error: +@Returns: + + + + + + + +@void: + + + + + + + +@ssid: +@len: +@Returns: + + + + + + + +@ssid: +@len: +@Returns: + + + + + + + +@ssid1: +@ssid2: +@ignore_trailing_null: +@Returns: + + + + + + + +@ssid: +@len: +@Returns: + + + + + + + +@hash: +@Returns: + + + + + + + +@list: +@elem_destroy_fn: + + + + + + + +@NMU_SEC_INVALID: +@NMU_SEC_NONE: +@NMU_SEC_STATIC_WEP: +@NMU_SEC_LEAP: +@NMU_SEC_DYNAMIC_WEP: +@NMU_SEC_WPA_PSK: +@NMU_SEC_WPA_ENTERPRISE: +@NMU_SEC_WPA2_PSK: +@NMU_SEC_WPA2_ENTERPRISE: + + + + + + +@type: +@wifi_caps: +@have_ap: +@adhoc: +@ap_flags: +@ap_wpa: +@ap_rsn: +@Returns: + + + + + + + +@value: +@Returns: + + + + + + + +@list: +@value: + + + + + + + +@value: +@Returns: + + + + + + + +@list: +@value: + + + + + + + +@netmask: +@Returns: + + + + + + + +@prefix: +@Returns: + + + + + + + +@ip: +@Returns: + + + + + + + +@value: +@Returns: + + + + + + + +@list: +@value: + + + + + + + +@value: +@Returns: + + + + + + + +@list: +@value: + + + + + + + +@value: +@Returns: + + + + + + + +@list: +@value: + + + + + + + +@void: +@Returns: + + + + + + + +@s: +@Returns: + + + + + + + +@data: +@in_password: +@out_password: +@error: +@Returns: + + diff --git a/docs/settings-spec.html b/docs/settings-spec.html new file mode 100644 index 00000000..4cd00953 --- /dev/null +++ b/docs/settings-spec.html @@ -0,0 +1,963 @@ + + +NetworkManager 0.8.1 Settings Specification + +

Setting name: '802-1x'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestring802-1xThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
eaparray of string[]The allowed EAP method to be used when authenticating to the network with 802.1x. Valid methods are: 'leap', 'md5', 'tls', 'peap', 'ttls', and 'fast'. Each method requires different configuration using the properties of this setting; refer to wpa_supplicant documentation for the allowed combinations.
identitystringIdentity string for EAP authentication methods. Often the user's user or login name.
anonymous-identitystringAnonymous identity string for EAP authentication methods. Used as the unencrypted identity with EAP types that support different tunneled identity like EAP-TTLS.
ca-certbyte array[]Contains the CA certificate if used by the EAP method specified in the 'eap' property. Certificate data is specified using a 'scheme'; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string 'file://' and ending with a terminating NULL byte. This property can be unset even if the EAP method supports CA certificates, but this allows man-in-the-middle attacks and is NOT recommended.
ca-pathstringUTF-8 encoded path to a directory containing PEM or DER formatted certificates to be added to the verification chain in addition to the certificate specified in the 'ca-cert' property.
client-certbyte array[]Contains the client certificate if used by the EAP method specified in the 'eap' property. Certificate data is specified using a 'scheme'; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string 'file://' and ending with a terminating NULL byte.
phase1-peapverstringForces which PEAP version is used when PEAP is set as the EAP method in 'eap' property. When unset, the version reported by the server will be used. Sometimes when using older RADIUS servers, it is necessary to force the client to use a particular PEAP version. To do so, this property may be set to '0' or '1; to force that specific PEAP version.
phase1-peaplabelstringForces use of the new PEAP label during key derivation. Some RADIUS servers may require forcing the new PEAP label to interoperate with PEAPv1. Set to '1' to force use of the new PEAP label. See the wpa_supplicant documentation for more details.
phase1-fast-provisioningstringEnables or disables in-line provisioning of EAP-FAST credentials when FAST is specified as the EAP method in the #NMSetting8021x:eap property. Allowed values are '0' (disabled), '1' (allow unauthenticated provisioning), '2' (allow authenticated provisioning), and '3' (allow both authenticated and unauthenticated provisioning). See the wpa_supplicant documentation for more details.
phase2-authstringSpecifies the allowed 'phase 2' inner non-EAP authentication methods when an EAP method that uses an inner TLS tunnel is specified in the 'eap' property. Recognized non-EAP phase2 methods are 'pap', 'chap', 'mschap', 'mschapv2', 'gtc', 'otp', 'md5', and 'tls'. Each 'phase 2' inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.
phase2-autheapstringSpecifies the allowed 'phase 2' inner EAP-based authentication methods when an EAP method that uses an inner TLS tunnel is specified in the 'eap' property. Recognized EAP-based 'phase 2' methods are 'md5', 'mschapv2', 'otp', 'gtc', and 'tls'. Each 'phase 2' inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.
phase2-ca-certbyte array[]Contains the 'phase 2' CA certificate if used by the EAP method specified in the 'phase2-auth' or 'phase2-autheap' properties. Certificate data is specified using a 'scheme'; two are currentlysupported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string 'file://' and ending with a terminating NULL byte. This property can be unset even if the EAP method supports CA certificates, but this allows man-in-the-middle attacks and is NOT recommended.
phase2-ca-pathstringUTF-8 encoded path to a directory containing PEM or DER formatted certificates to be added to the verification chain in addition to the certificate specified in the 'phase2-ca-cert' property.
phase2-client-certbyte array[]Contains the 'phase 2' client certificate if used by the EAP method specified in the 'phase2-eap' or 'phase2-autheap' properties. Certificate data is specified using a 'scheme'; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string 'file://' and ending with a terminating NULL byte.
passwordstringPassword used for EAP authentication methods.
private-keybyte array[]Contains the private key when the 'eap' property is set to 'tls'. Key data is specified using a 'scheme'; two are currently supported: blob and path. When using the blob scheme and X.509 private keys, this property should be set to the keys's decrypted DER encoded data. When using X.509 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 and ending with a terminating NULL byte. When using PKCS#12 format private keys and the blob scheme, this property should be set to the PKCS#12 data (which is encrypted) and the '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 NULL 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.
private-key-passwordstringThe password used to decrypt the private key specified in the 'private-key' property when the private key either uses the path scheme, or if the private key is a PKCS#12 format key.
phase2-private-keybyte array[]Contains the 'phase 2' inner private key when the 'phase2-eap' or 'phase2-autheap' property is set to 'tls'. Key data is specified using a 'scheme'; two are currently supported: blob and path. When using the blob scheme and X.509 private keys, this property should be set to the keys's decrypted DER encoded data. When using X.509 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 and ending with a terminating NULL byte. When using PKCS#12 format private keys and the blob scheme, this property should be set to the PKCS#12 data (which is encrypted) and the '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 NULL 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.
phase2-private-key-passwordstringThe password used to decrypt the 'phase 2' private key specified in the 'private-key' property when the phase2 private key either uses the path scheme, or if the phase2 private key is a PKCS#12 format key.
system-ca-certsbooleanFALSEWhen TRUE, overrides 'ca-path' and 'phase2-ca-path' properties using the system CA directory specified at configure time with the --system-ca-path switch. The certificates in this directory are added to the verification chain in addition to any certificates specified by the 'ca-cert' and 'phase2-ca-cert' properties.

+

Setting name: 'bluetooth'

+ + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringbluetoothThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
bdaddrbyte array[]The Bluetooth address of the device
typestringEither 'dun' for Dial-Up Networking connections (not yet supported) or 'panu' for Personal Area Networking connections.

+

Setting name: 'cdma'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringcdmaThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
numberstringNumber to dial when establishing a PPP data session with the CDMA-based mobile broadband network. If not specified, the default number (#777) is used when required.
usernamestringUsername used to authenticate with the network, if required. Note that many providers do not require a username or accept any username.
passwordstringPassword used to authenticate with the network, if required. Note that many providers do not require a password or accept any password.

+

Setting name: 'connection'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringconnectionThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
idstringUser-readable connection identifier/name. Must be one or more characters and may change over the lifetime of the connection if the user decides to rename it.
uuidstringUniversally unique connection identifier. Must be in the format '2815492f-7e56-435e-b2e9-246bd7cdc664' (ie, contains only hexadecimal characters and '-'). The UUID should be assigned when the connection is created and never changed as long as the connection still applies to the same network. For example, it should not be changed when the user changes the connection's 'id', but should be recreated when the WiFi SSID, mobile broadband network provider, or the connection type changes.
typestringBase type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, '802-3-ethernet' or '802-11-wireless' or 'bluetooth', etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, 'vpn' or 'bridge', etc).
autoconnectbooleanTRUEIf TRUE, NetworkManager will activate this connection when its network resources are available. If FALSE, the connection must be manually activated by the user or some other mechanism.
timestampuint640Timestamp (in seconds since the Unix Epoch) that the connection was last successfully activated. Settings services should update the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp.
read-onlybooleanFALSEIf TRUE, the connection is read-only and cannot be changed by the user or any other mechanism. This is normally set for system connections whose plugin cannot yet write updated connections back out.

+

Setting name: 'gsm'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringgsmThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
numberstringNumber to dial when establishing a PPP data session with the GSM-based mobile broadband network. In most cases, leave the number blank and a number selecting the APN specified in the 'apn' property will be used automatically when required.
usernamestringUsername used to authenticate with the network, if required. Note that many providers do not require a username or accept any username.
passwordstringPassword used to authenticate with the network, if required. Note that many providers do not require a password or accept any password.
apnstringThe GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network. The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan.
network-idstringThe Network ID (GSM LAI format, ie MCC-MNC) to force specific network registration. If the Network ID is specified, NetworkManager will attempt to force the device to register only on the specified network. This can be used to ensure that the device does not roam when direct roaming control of the device is not otherwise possible.
network-typeint32-1Network preference to force the device to only use specific network technologies. The permitted values are: -1: any, 0: 3G only, 1: GPRS/EDGE only, 2: prefer 3G, and 3: prefer 2G. Note that not all devices allow network preference control.
bandint32-1Band (DEPRECATED and UNUSED)
pinstringIf the SIM is locked with a PIN it must be unlocked before any other operations are requested. Specify the PIN here to allow operation of the device.
pukstringPUK (DEPRECATED and UNUSED)
allowed-bandsuint321Bitfield of allowed frequency bands. Note that not all devices allow frequency band control.
home-onlybooleanFALSEWhen TRUE, only connections to the home network will be allowed. Connections to roaming networks will not be made.

+

Setting name: 'ipv4'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringipv4The setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
methodstringIPv4 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.
dnsarray of uint32[]List of DNS servers (network byte order). 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 usptream network. In all other methods, these DNS servers are used as the only DNS servers for this connection.
dns-searcharray of string[]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.
addressesarray of array of uint32[]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.
routesarray of array of uint32[]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. 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 as there is no upstream network.
ignore-auto-routesbooleanFALSEWhen the method is set to 'auto' and this property to TRUE, automatically configured routes are ignored and only routes specified in the 'routes' property, if any, are used.
ignore-auto-dnsbooleanFALSEWhen 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 'dns' and 'dns-search' properties, if any, are used.
dhcp-client-idstringA string sent to the DHCP server to identify the local machine which the DHCP server may use to cusomize the DHCP lease and options.
dhcp-send-hostnamebooleanFALSEIf TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the 'dhcp-hostname' property is empty and this property is TRUE, the current persistent hostname of the computer is sent.
dhcp-hostnamestringIf the 'dhcp-send-hostname' property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease.
never-defaultbooleanFALSEIf TRUE, this connection will never be the default IPv4 connection, meaning it will never be assigned the default route by NetworkManager.
may-failbooleanFALSEIf 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.

+

Setting name: 'ipv6'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringipv6The setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
methodstringIPv6 configuration method. If 'auto' is specified then the appropriate automatic method (DHCP, PPP, router advertisement, etc) is used for the interface and most other properties can be left unset. 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 'ignored' is specified, IPv6 configuration is not done. This property must be set. NOTE: the 'shared' method are not yet supported.
dnsarray of byte array[]Array of DNS servers, where each member of the array is a byte array containing the IPv6 address of the DNS server (in network byte order). 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.
dns-searcharray of string[]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.
addressesarray of (byte array, uint32, byte array)[]Array of IPv6 address structures. Each IPv6 address structure is composed of 3 members, the first being a byte array containing the IPv6 address (network byte order), the second a 32-bit integer containing the IPv6 address prefix, and the third a byte array containing the IPv6 address (network byte order) of the gateway associated with this address, if any. If no gateway is given, the third element should be given as all zeros. 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.
routesarray of (byte array, uint32, byte array, uint32)[]Array of IPv6 route structures. Each IPv6 route structure is composed of 4 members; the first being the destination IPv6 network or address (network byte order) as a byte array, the second the destination network or address IPv6 prefix, the third being the next-hop IPv6 address (network byte order) if any, and the fourth being the route metric. 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.
ignore-auto-routesbooleanFALSEWhen the method is set to 'auto' and this property is set to TRUE, automatically configured routes are ignored and only routes specified in the 'routes' property, if any, are used.
ignore-auto-dnsbooleanFALSEWhen the method is set to 'auto' and this property is set to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in 'dns' and 'dns-search' properties, if any, are used.
never-defaultbooleanFALSEIf TRUE, this connection will never be the default IPv6 connection, meaning it will never be assigned the default IPv6 route by NetworkManager.
may-failbooleanFALSEIf 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.

+

Setting name: '802-11-olpc-mesh'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestring802-11-olpc-meshThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
ssidbyte array[]SSID of the mesh network to join.
channeluint320Channel on which the mesh network to join is located.
dhcp-anycast-addressbyte array[]Anycast DHCP MAC address used when requesting an IP address via DHCP. The specific anycast address used determines which DHCP server class answers the the request.

+

Setting name: 'ppp'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringpppThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
noauthbooleanTRUEIf TRUE, do not require the other side (usually the PPP server) to authenticate itself to the client. If FALSE, require authentication from the remote side. In almost all cases, this should be TRUE.
refuse-eapbooleanFALSEIf TRUE, the EAP authentication method will not be used.
refuse-papbooleanFALSEIf TRUE, the PAP authentication method will not be used.
refuse-chapbooleanFALSEIf TRUE, the CHAP authentication method will not be used.
refuse-mschapbooleanFALSEIf TRUE, the MSCHAP authentication method will not be used.
refuse-mschapv2booleanFALSEIf TRUE, the MSCHAPv2 authentication method will not be used.
nobsdcompbooleanFALSEIf TRUE, BSD compression will not be requested.
nodeflatebooleanFALSEIf TRUE, 'deflate' compression will not be requested.
no-vj-compbooleanFALSEIf TRUE, Van Jacobsen TCP header compression will not be requested.
require-mppebooleanFALSEIf TRUE, MPPE (Microsoft Point-to-Point Encrpytion) will be required for the PPP session. If either 64-bit or 128-bit MPPE is not available the session will fail. Note that MPPE is not used on mobile broadband connections.
require-mppe-128booleanFALSEIf TRUE, 128-bit MPPE (Microsoft Point-to-Point Encrpytion) will be required for the PPP session, and the 'require-mppe' property must also be set to TRUE. If 128-bit MPPE is not available the session will fail.
mppe-statefulbooleanFALSEIf TRUE, stateful MPPE is used. See pppd documentation for more information on stateful MPPE.
crtsctsbooleanFALSEIf TRUE, specify that pppd should set the serial port to use hardware flow control with RTS and CTS signals. This value should normally be set to FALSE.
bauduint320If non-zero, instruct pppd to set the serial port to the specified baudrate. This value should normally be left as 0 to automatically choose the speed.
mruuint320If non-zero, instruct pppd to request that the peer send packets no larger than the specified size. If non-zero, the MRU should be between 128 and 16384.
mtuuint320If non-zero, instruct pppd to send packets no larger than the specified size.
lcp-echo-failureuint320If non-zero, instruct pppd to presume the connection to the peer has failed if the specified number of LCP echo-requests go unanswered by the peer. The 'lcp-echo-interval' property must also be set to a non-zero value if this property is used.
lcp-echo-intervaluint320If non-zero, instruct pppd to send an LCP echo-request frame to the peer every n seconds (where n is the specified value). Note that some PPP peers will respond to echo requests and some will not, and it is not possible to autodetect this.

+

Setting name: 'pppoe'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringpppoeThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
servicestringIf specified, instruct PPPoE to only initiate sessions with access concentrators that provide the specified serivce. For most providers, this should be left blank. It is only required if there are multiple access concentrators or a specific service is known to be required.
usernamestringUsername used to authenticate with the PPPoE service.
passwordstringPassword used to authenticate with the PPPoE service.

+

Setting name: 'serial'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringserialThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
bauduint3257600Speed to use for communication over the serial port. Note that this value usually has no effect for mobile broadband modems as they generally ignore speed settings and use the highest available speed.
bitsuint328Byte-width of the serial communication. The 8 in '8n1' for example.
paritygchar110Parity setting of the serial port. Either 'E' for even parity, 'o' for odd parity, or 'n' for no parity.
stopbitsuint321Number of stop bits for communication on the serial port. Either 1 or 2. The 1 in '8n1' for example.
send-delayuint640Time to delay between each byte sent to the modem, in microseconds.

+

Setting name: 'vpn'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestringvpnThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
service-typestringD-Bus service name of the VPN plugin that this setting uses to connect to its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc plugin.
user-namestringUser name of the currently logged in user for connections provided by the user settings service. This name is provided to the VPN plugin to use in lieu of a custom username provided by that VPN plugins specific configuration. The VPN plugin itself decides which user name to use.
datadict of (string::string)[ ]Dictionary of key/value pairs of VPN plugin specific data. Both keys and values must be strings.
secretsdict of (string::string)[ ]Dictionary of key/value pairs of VPN plugin specific secrets like passwords or private keys. Both keys and values must be strings.

+

Setting name: '802-3-ethernet'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestring802-3-ethernetThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
portstringSpecific port type to use if multiple the device supports multiple attachment methods. One of 'tp' (Twisted Pair), 'aui' (Attachment Unit Interface), 'bnc' (Thin Ethernet) or 'mii' (Media Independent Interface. If the device supports only one port type, this setting is ignored.
speeduint320If non-zero, request that the device use only the specified speed. In Mbit/s, ie 100 == 100Mbit/s.
duplexstringIf specified, request that the device only use the specified duplex mode. Either 'half' or 'full'.
auto-negotiatebooleanTRUEIf TRUE, allow auto-negotiation of port speed and duplex mode. If FALSE, do not allow auto-negotiation,in which case the 'speed' and 'duplex' properties should be set.
mac-addressbyte array[]If specified, this connection will only apply to the ethernet device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing).
mtuuint320If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.

+

Setting name: '802-11-wireless'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestring802-11-wirelessThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
ssidbyte array[]SSID of the WiFi network. Must be specified.
modestringWiFi network mode; one of 'infrastructure' or 'adhoc'. If blank, infrastructure is assumed.
bandstring802.11 frequency band of the network. One of 'a' for 5GHz 802.11a or 'bg' for 2.4GHz 802.11. This will lock associations to the WiFi network to the specific band, i.e. if 'a' is specified, the device will not associate with the same network in the 2.4GHz band even if the network's settings are compatible. This setting depends on specific driver capability and may not work with all drivers.
channeluint320Wireless channel to use for the WiFi connection. The device will only join (or create for Ad-Hoc networks) a WiFi network on the specified channel. Because channel numbers overlap between bands, this property also requires the 'band' property to be set.
bssidbyte array[]If specified, directs the device to only associate with the given access point. This capability is highly driver dependent and not supported by all devices. Note: this property does not control the BSSID used when creating an Ad-Hoc network and is unlikely to in the future.
rateuint320If non-zero, directs the device to only use the specified bitrate for communication with the access point. Units are in Kb/s, ie 5500 = 5.5 Mbit/s. This property is highly driver dependent and not all devices support setting a static bitrate.
tx-poweruint320If non-zero, directs the device to use the specified transmit power. Units are dBm. This property is highly driver dependent and not all devices support setting a static transmit power.
mac-addressbyte array[]If specified, this connection will only apply to the WiFi device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing).
mtuuint320If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.
seen-bssidsarray of string[]A list of BSSIDs (each BSSID formatted as a MAC address like '00:11:22:33:44:55') that have been detected as part of the WiFI network. The settings service will usually populate this property by periodically asking NetworkManager what the device's current AP is while connected to the network (or monitoring the device's 'active-ap' property) and adding the current AP's BSSID to this list. This list helps NetworkManager find hidden APs by matching up scan results with the BSSIDs in this list.
securitystringIf the wireless connection has any security restrictions, like 802.1x, WEP, or WPA, set this property to '802-11-wireless-security' and ensure the connection contains a valid 802-11-wireless-security setting.

+

Setting name: '802-11-wireless-security'

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
namestring802-11-wireless-securityThe setting's name; these names are defined by the specification and cannot be changed after the object has been created. Each setting class has a name, and all objects of that class share the same name.
key-mgmtstringKey management used for the connection. One of 'none' (WEP), 'ieee8021x' (Dynamic WEP), 'wpa-none' (WPA-PSK Ad-Hoc), 'wpa-psk' (infrastructure WPA-PSK), or 'wpa-eap' (WPA-Enterprise). This property must be set for any WiFi connection that uses security.
wep-tx-keyidxuint320When static WEP is used (ie, key-mgmt = 'none') and a non-default WEP key index is used by the AP, put that WEP key index here. Valid values are 0 (default key) through 3. Note that some consumer access points (like the Linksys WRT54G) number the keys 1 - 4.
auth-algstringWhen WEP is used (ie, key-mgmt = 'none' or 'ieee8021x') indicate the 802.11 authentication algorithm required by the AP here. One of 'open' for Open System, 'shared' for Shared Key, or 'leap' for Cisco LEAP. When using Cisco LEAP (ie, key-mgmt = 'ieee8021x' and auth-alg = 'leap') the 'leap-username' and 'leap-password' properties must be specified.
protoarray of string[]List of strings specifying the allowed WPA protocol versions to use. Each element may be one 'wpa' (allow WPA) or 'rsn' (allow WPA2/RSN). If not specified, both WPA and RSN connections are allowed.
pairwisearray of string[]If specified, will only connect to WPA networks that provide the specified pairwise encryption capabilities. Each element may be one of 'wep40', 'wep104', 'tkip', or 'ccmp'.
grouparray of string[]If specified, will only connect to WPA networks that provide the specified group/multicast encryption capabilities. Each element may be one of 'wep40', 'wep104', 'tkip', or 'ccmp'.
leap-usernamestringThe login username for legacy LEAP connections (ie, key-mgmt = 'ieee8021x' and auth-alg = 'leap').
wep-key0stringIndex 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.
wep-key1stringIndex 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.
wep-key2stringIndex 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.
wep-key3stringIndex 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.
pskstringPre-Shared-Key for WPA networks. If the key is 64-characters long, it must contain only hexadecimal characters and is interpreted as a hexadecimal WPA key. Otherwise, the key must be between 8 and 63 ASCII characters (as specified in the 802.11i standard) and is interpreted as a WPA passphrase, and is hashed to derive the actual WPA-PSK used when connecting to the WiFi network.
leap-passwordstringThe login password for legacy LEAP connections (ie, key-mgmt = 'ieee8021x' and auth-alg = 'leap').
wep-key-typeuint320Controls the interpretation of WEP keys. Allowed values are 1 (interpret WEP keys as hexadecimal or ASCII keys) or 2 (interpret WEP keys as WEP Passphrases). If set to 1 and the keys are hexadecimal, they must be either 10 or 26 characters in length. If set to 1 and the keys are ASCII keys, they must be either 5 or 13 characters in length. If set to 2, the passphrase is hashed using the de-facto MD5 method to derive the actual WEP key.

+ + diff --git a/docs/spec.html b/docs/spec.html new file mode 100644 index 00000000..67b624ca --- /dev/null +++ b/docs/spec.html @@ -0,0 +1,1138 @@ + +NetworkManager D-Bus Interface Specification version 0.8

NetworkManager D-Bus Interface Specification

Version 0.8

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

This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(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 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.

+

Interfaces

+

org.freedesktop.NetworkManager

Methods:

GetDevices ( + + ) → + ao

+ Get the list of network devices. +

Returns

devices - + ao
+ List of object paths of network devices known to the system. +

ActivateConnection ( + s: service_name, o: connection, o: device, o: specific_object + ) → + o

+ Activate a connection using the supplied device. +

Parameters

service_name - + s
+ The D-Bus service name of the settings service that provides this connection. +
connection - + o
+ The connection to activate the devices with. +
device - + o
+ The object path of device to be activated for physical connections. This parameter is ignored for VPN connections, because the specific_object (if provided) specifies the device to use. +
specific_object - + o
+ The path of a connection-type-specific object this activation should use. + This parameter is currently ignored for wired and mobile broadband connections, + and the value of "/" should be used (ie, no specific object). For WiFi + connections, pass the object path of a specific AP from the card's scan + list, or "/" to pick and AP automatically. For VPN connections, pass + the object path of an ActiveConnection object that should serve as the + "base" connection (to which the VPN connections lifetime will be tied), + or pass "/" and NM will automatically use the current default device. +

Returns

active_connection - + o
+ The path of the active connection object representing this active connection. +

Possible errors

org.freedesktop.NetworkManager.Error.UnknownConnection
+ Connection was not provided by any known settings service. + (generic description)
org.freedesktop.NetworkManager.Error.UnknownDevice
+ Unknown device. + (generic description)
org.freedesktop.NetworkManager.Error.InvalidService
+ Invalid settings service (not a recognized system or user settings service name). + (generic description)
org.freedesktop.NetworkManager.Error.ConnectionActivating
Another connection is already activating or the same connection is already active. FIXME: check if the error name is correct. FIXME: split into 2 errors?
org.freedesktop.NetworkManager.Error.ConnectionInvalid
The connection is invalid for this device.

DeactivateConnection ( + o: active_connection + ) → + nothing

+ Deactivate an active connection. +

Parameters

active_connection - + o
+ The currently active connection to deactivate. +

Sleep ( + b: sleep + ) → + nothing

+ Control the NetworkManager daemon's sleep state. When asleep, all + interfaces that it manages are deactivated. When awake, devices are + available to be activated. This command should not be called directly + by users or clients; it is intended for system suspend/resume tracking. +

Parameters

sleep - + b
+ Indicates whether the NetworkManager daemon should sleep or wake. +

Enable ( + b: enable + ) → + nothing

+ Control whether overall networking is enabled or disabled. When + disabled, all interfaces that NM manages are deactivated. When enabled, + all managed interfaces are re-enabled and available to be activated. + This command should be used by clients that provide to users the ability + to enable/disable all networking. +

Parameters

enable - + b
+ If FALSE, indicates that all networking should be disabled. If TRUE, + indicates that NetworkManager should begin managing network devices. +

SetLogging ( + s: level, s: domains + ) → + nothing

+ Set logging verbosity and which operations are logged. +

Parameters

level - + s
+ One of [ERR, WARN, INFO, DEBUG]. +
domains - + s
+ A combination of logging domains separated by commas (','), or "NONE" + to disable logging. Each domain enables logging for operations + related to that domain. Available domains are: [NONE, HW, RFKILL, + ETHER, WIFI, BT, MB, DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, + DNS, VPN, SHARING, SUPPLICANT, USER_SET, SYS_SET, SUSPEND, CORE, + DEVICE, OLPC] +

sleep ( + + ) → + nothing

+ DEPRECATED. Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated. +

wake ( + + ) → + nothing

+ DEPRECATED. Control the NetworkManager daemon's sleep state. When awake, all known interfaces are available to be activated. +

state ( + + ) → + u

+ DEPRECATED. The overall state of the NetworkManager daemon. +

Returns

state - + u + (NM_STATE) +

Signals:

StateChanged ( + u: state + )

+ NetworkManager's state changed. +

Parameters

state - + u + (NM_STATE) +
+ The new state of NetworkManager. +

PropertiesChanged ( + a{sv}: properties + )

+ NetworkManager's properties changed. +

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ The changed properties. +

DeviceAdded ( + o: device_path + )

+ A device was added to the system +

Parameters

device_path - + o
+ The object path of the newly added device. +

DeviceRemoved ( + o: device_path + )

+ A device was removed from the system, and is no longer available. +

Parameters

device_path - + o
+ The object path of the device that was just removed. +

StateChange ( + u: state + )

+ DEPRECATED. NetworkManager's state changed. Use the 'StateChanged' signal instead. +

Parameters

state - + u + (NM_STATE) +
+ The new state of NetworkManager. +

Properties:

NetworkingEnabled - + b - + (read)
+ Indicates if overall networking is currently enabled or not. See the + Enable() method. +
WirelessEnabled - + b - + (readwrite)
+ Indicates if wireless is currently enabled or not. +
WirelessHardwareEnabled - + b - + (read)
+ Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch. +
WwanEnabled - + b - + (readwrite)
+ Indicates if mobile broadband devices are currently enabled or not. +
WwanHardwareEnabled - + b - + (read)
+ Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch. +
ActiveConnections - + ao - + (read)
+ List of active connection object paths. +
State - + u - + (read) + (NM_STATE) +
+ The overall state of the NetworkManager daemon. +

Enumerated types:

NM_STATE

+ Describes the overall state of the daemon. +
NM_STATE_UNKNOWN = 0
+ The NetworkManager daemon is in an unknown state. +
NM_STATE_ASLEEP = 1
+ The NetworkManager daemon is asleep and all interfaces managed by it are inactive. +
NM_STATE_CONNECTING = 2
+ The NetworkManager daemon is connecting a device. FIXME: What does this mean when one device is active and another is connecting? +
NM_STATE_CONNECTED = 3
+ The NetworkManager daemon is connected. +
NM_STATE_DISCONNECTED = 4
+ The NetworkManager daemon is disconnected. +
+ +

org.freedesktop.NetworkManager.AccessPoint

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Properties:

Flags - + u - + (read) + (NM_802_11_AP_FLAGS) +
Flags describing the capabilities of the access point.
WpaFlags - + u - + (read) + (NM_802_11_AP_SEC) +
Flags describing the access point's capabilities according to WPA (Wifi Protected Access).
RsnFlags - + u - + (read) + (NM_802_11_AP_SEC) +
Flags describing the access point's capabilities according to the RSN (Robust Secure Network) protocol.
Ssid - + ay - + (read)
The Service Set Identifier identifying the access point.
Frequency - + u - + (read)
The radio channel frequency in use by the access point, in MHz.
HwAddress - + s - + (read)
The hardware address (BSSID) of the access point.
Mode - + u - + (read) + (NM_802_11_MODE) +
Describes the operating mode of the access point.
MaxBitrate - + u - + (read)
The maximum bitrate this access point is capable of, in kilobits/second (Kb/s).
Strength - + y - + (read)
The current signal quality of the access point, in percent.

Sets of flags:

NM_802_11_AP_FLAGS

+ Flags describing the general capabilities of the access point. +
NM_802_11_AP_FLAGS_NONE = 0x0
Null capability - says nothing about the access point.
NM_802_11_AP_FLAGS_PRIVACY = 0x1
Access point supports privacy measures.

NM_802_11_AP_SEC

+ Flags describing the security capabilities of the access point. +
NM_802_11_AP_SEC_NONE = 0x0
Null flag.
NM_802_11_AP_SEC_PAIR_WEP40 = 0x1
Access point supports pairwise 40-bit WEP encryption.
NM_802_11_AP_SEC_PAIR_WEP104 = 0x2
Access point supports pairwise 104-bit WEP encryption.
NM_802_11_AP_SEC_PAIR_TKIP = 0x4
Access point supports pairwise TKIP encryption.
NM_802_11_AP_SEC_PAIR_CCMP = 0x8
Access point supports pairwise CCMP encryption.
NM_802_11_AP_SEC_GROUP_WEP40 = 0x10
Access point supports a group 40-bit WEP cipher.
NM_802_11_AP_SEC_GROUP_WEP104 = 0x20
Access point supports a group 104-bit WEP cipher.
NM_802_11_AP_SEC_GROUP_TKIP = 0x40
Access point supports a group TKIP cipher.
NM_802_11_AP_SEC_GROUP_CCMP = 0x80
Access point supports a group CCMP cipher.
NM_802_11_AP_SEC_KEY_MGMT_PSK = 0x100
Access point supports PSK key management.
NM_802_11_AP_SEC_KEY_MGMT_802_1X = 0x200
Access point supports 802.1x key management.
+ +

org.freedesktop.NetworkManager.Device

Methods:

Disconnect ( + + ) → + nothing

+ Disconnects a device and prevents the device from automatically activating further connections without user intervention. +

Signals:

StateChanged ( + u: new_state, u: old_state, u: reason + )

Parameters

new_state - + u + (NM_DEVICE_STATE) +
+ The new state of the device. +
old_state - + u + (NM_DEVICE_STATE) +
+ The previous state of the device. +
reason - + u + (NM_DEVICE_STATE_REASON) +
+ A reason for the state transition. +

Properties:

Udi - + s - + (read)
+ Unique Device Identifier. +
Interface - + s - + (read)
+ The network interface offered by the device. +
Driver - + s - + (read)
+ The driver handling the device. +
Capabilities - + u - + (read) + (NM_DEVICE_CAP) +
+ Flags describing the capabilities of the device. +
Ip4Address - + i - + (read)
+ The IPv4 address bound to the device. FIXME: what about devices with >1 IP address? +
State - + u - + (read) + (NM_DEVICE_STATE) +
+ The current state of the device. +
Ip4Config - + o - + (read)
+ Object path of the Ip4Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. +
Dhcp4Config - + o - + (read)
+ Object path of the Dhcp4Config object describing the DHCP options returned by the DHCP server. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. +
Ip6Config - + o - + (read)
+ Object path of the Ip6Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. +
Managed - + b - + (read)
+ Whether or not this device is managed by NetworkManager. +
DeviceType - + u - + (read) + (NM_DEVICE_TYPE) +
+ The general type of the network device; ie Ethernet, WiFi, etc. +

Enumerated types:

NM_DEVICE_STATE

NM_DEVICE_STATE_UNKNOWN = 0
+ The device is in an unknown state. +
NM_DEVICE_STATE_UNMANAGED = 1
+ The device is not managed by NetworkManager. +
NM_DEVICE_STATE_UNAVAILABLE = 2
+ The device cannot be used (carrier off, rfkill, etc). +
NM_DEVICE_STATE_DISCONNECTED = 3
+ The device is not connected. +
NM_DEVICE_STATE_PREPARE = 4
+ The device is preparing to connect. +
NM_DEVICE_STATE_CONFIG = 5
+ The device is being configured. +
NM_DEVICE_STATE_NEED_AUTH = 6
+ The device is awaiting secrets necessary to continue connection. +
NM_DEVICE_STATE_IP_CONFIG = 7
+ The IP settings of the device are being requested and configured. +
NM_DEVICE_STATE_ACTIVATED = 8
+ The device is active. +
NM_DEVICE_STATE_FAILED = 9
+ The device is in a failure state following an attempt to activate it. +

NM_DEVICE_TYPE

NM_DEVICE_TYPE_UNKNOWN = 0
+ The device type is unknown. +
NM_DEVICE_TYPE_ETHERNET = 1
+ The device is wired Ethernet device. +
NM_DEVICE_TYPE_WIFI = 2
+ The device is an 802.11 WiFi device. +
NM_DEVICE_TYPE_GSM = 3
+ The device is a GSM-based cellular WAN device. +
NM_DEVICE_TYPE_CDMA = 4
+ The device is a CDMA/IS-95-based cellular WAN device. +

NM_DEVICE_STATE_REASON

NM_DEVICE_STATE_REASON_UNKNOWN = 0
+ The reason for the device state change is unknown. +
NM_DEVICE_STATE_REASON_NONE = 1
+ The state change is normal. +
NM_DEVICE_STATE_REASON_NOW_MANAGED = 2
+ The device is now managed. +
NM_DEVICE_STATE_REASON_NOW_UNMANAGED = 3
+ The device is no longer managed. +
NM_DEVICE_STATE_REASON_CONFIG_FAILED = 4
+ The device could not be readied for configuration. +
NM_DEVICE_STATE_REASON_CONFIG_UNAVAILABLE = 5
+ IP configuration could not be reserved (no available address, timeout, etc). +
NM_DEVICE_STATE_REASON_CONFIG_EXPIRED = 6
+ The IP configuration is no longer valid. +
NM_DEVICE_STATE_REASON_NO_SECRETS = 7
+ Secrets were required, but not provided. +
NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT = 8
+ The 802.1X supplicant disconnected from the access point or authentication server. +
NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED = 9
+ Configuration of the 802.1X supplicant failed. +
NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED = 10
+ The 802.1X supplicant quit or failed unexpectedly. +
NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT = 11
+ The 802.1X supplicant took too long to authenticate. +
NM_DEVICE_STATE_REASON_PPP_START_FAILED = 12
+ The PPP service failed to start within the allowed time. +
NM_DEVICE_STATE_REASON_PPP_DISCONNECT = 13
+ The PPP service disconnected unexpectedly. +
NM_DEVICE_STATE_REASON_PPP_FAILED = 14
+ The PPP service quit or failed unexpectedly. +
NM_DEVICE_STATE_REASON_DHCP_START_FAILED = 15
+ The DHCP service failed to start within the allowed time. +
NM_DEVICE_STATE_REASON_DHCP_ERROR = 16
+ The DHCP service reported an unexpected error. +
NM_DEVICE_STATE_REASON_DHCP_FAILED = 17
+ The DHCP service quit or failed unexpectedly. +
NM_DEVICE_STATE_REASON_SHARED_START_FAILED = 18
+ The shared connection service failed to start. +
NM_DEVICE_STATE_REASON_SHARED_FAILED = 19
+ The shared connection service quit or failed unexpectedly. +
NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED = 20
+ The AutoIP service failed to start. +
NM_DEVICE_STATE_REASON_AUTOIP_ERROR = 21
+ The AutoIP service reported an unexpected error. +
NM_DEVICE_STATE_REASON_AUTOIP_FAILED = 22
+ The AutoIP service quit or failed unexpectedly. +
NM_DEVICE_STATE_REASON_MODEM_BUSY = 23
+ Dialing failed because the line was busy. +
NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE = 24
+ Dialing failed because there was no dial tone. +
NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER = 25
+ Dialing failed because there was carrier. +
NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT = 26
+ Dialing timed out. +
NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED = 27
+ Dialing failed. +
NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED = 28
+ Modem initialization failed. +
NM_DEVICE_STATE_REASON_GSM_APN_FAILED = 29
+ Failed to select the specified GSM APN. +
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING = 30
+ Not searching for networks. +
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED = 31
+ Network registration was denied. +
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT = 32
+ Network registration timed out. +
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED = 33
+ Failed to register with the requested GSM network. +
NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED = 34
+ PIN check failed. +
NM_DEVICE_STATE_REASON_FIRMWARE_MISSING = 35
+ Necessary firmware for the device may be missing. +
NM_DEVICE_STATE_REASON_REMOVED = 36
+ The device was removed. +
NM_DEVICE_STATE_REASON_SLEEPING = 37
+ NetworkManager went to sleep. +
NM_DEVICE_STATE_REASON_CONNECTION_REMOVED = 38
+ The device's active connection was removed or disappeared. +
NM_DEVICE_STATE_REASON_USER_REQUESTED = 39
+ A user or client requested the disconnection. +
NM_DEVICE_STATE_REASON_CARRIER = 40
+ The device's carrier/link changed. +
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED = 41
+ The device's existing connection was assumed. +
NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE = 42
+ The 802.1x supplicant is now available. +
NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND = 43
+ The modem could not be found. +
NM_DEVICE_STATE_REASON_BT_FAILED = 44
+ The Bluetooth connection timed out or failed. +

Sets of flags:

NM_DEVICE_CAP

NM_DEVICE_CAP_NONE = 0x0
Null capability.
NM_DEVICE_CAP_NM_SUPPORTED = 0x1
The device is supported by NetworkManager.
NM_DEVICE_CAP_CARRIER_DETECT = 0x2
The device supports carrier detection.
+ +

org.freedesktop.NetworkManager.Device.Wired

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Properties:

HwAddress - + s - + (read)
+ Hardware address of the device. +
Speed - + u - + (read)
+ Design speed of the device, in megabits/second (Mb/s). +
Carrier - + b - + (read)
+ Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not). +
+ +

org.freedesktop.NetworkManager.Device.Wireless

Methods:

GetAccessPoints ( + + ) → + ao

+ Get the list of access points visible to this device. +

Returns

access_points - + ao
+ List of access point object paths +

Signals:

PropertiesChanged ( + a{sv}: properties + )

+ Emitted when the wireless device's properties changed. +

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary containing the FIXME: check changed parameters. +

AccessPointAdded ( + o: access_point + )

+ Emitted when a new access point is found by the device. +

Parameters

access_point - + o
+ The object path of the newly found access point. +

AccessPointRemoved ( + o: access_point + )

+ Emitted when an access point disappears from view of the device. +

Parameters

access_point - + o
+ The object path of the access point that has disappeared. +

Properties:

HwAddress - + s - + (read)
+ The hardware address of the device. +
Mode - + u - + (read) + (NM_802_11_MODE) +
+ The operating mode of the wireless device. +
Bitrate - + u - + (read)
+ The bit rate currently used by the wireless device, in kilobits/second (Kb/s). +
ActiveAccessPoint - + o - + (read)
+ Object path of the access point currently used by the wireless device. +
WirelessCapabilities - + u - + (read) + (NM_802_11_DEVICE_CAP) +
+ The capabilities of the wireless device. +

Sets of flags:

NM_802_11_DEVICE_CAP

+ Flags describing the capabilities of a wireless device. +
NM_802_11_DEVICE_CAP_NONE = 0x0
Null capability - syntactic sugar for no capabilities supported. Do not AND this with other capabilities!
NM_802_11_DEVICE_CAP_CIPHER_WEP40 = 0x1
The device supports the 40-bit WEP cipher.
NM_802_11_DEVICE_CAP_CIPHER_WEP104 = 0x2
The device supports the 104-bit WEP cipher.
NM_802_11_DEVICE_CAP_CIPHER_TKIP = 0x4
The device supports the TKIP cipher.
NM_802_11_DEVICE_CAP_CIPHER_CCMP = 0x8
The device supports the CCMP cipher.
NM_802_11_DEVICE_CAP_WPA = 0x10
The device supports the WPA encryption/authentication protocol.
NM_802_11_DEVICE_CAP_RSN = 0x20
The device supports the RSN encryption/authentication protocol.
+ +

org.freedesktop.NetworkManager.Device.Cdma

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Interface has no properties.

+ +

org.freedesktop.NetworkManager.Device.Gsm

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Interface has no properties.

+ +

org.freedesktop.NetworkManager.Device.Serial

Interface has no methods.

Signals:

PppStats ( + u: in_bytes, u: out_bytes + )

Parameters

in_bytes - + u
+ Bytes received +
out_bytes - + u
+ Bytes sent +

Interface has no properties.

+ +

org.freedesktop.NetworkManager.Device.Bluetooth

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Properties:

HwAddress - + s - + (read)
+ Bluetooth hardware address of the device. +
Name - + s - + (read)
+ Bluetooth name of the device. +
BtCapabilities - + u - + (read) + (NM_BT_CAPABILITIES) +
+ Bluetooth capabilities of the device (either DUN or NAP). +

Sets of flags:

NM_BT_CAPABILITIES

+ Flags describing the capabilities of a Bluetooth device. +
NM_BT_CAPABILITY_NONE = 0x0
The device has no recognized capabilities.
NM_BT_CAPABILITY_DUN = 0x1
The device supports Bluetooth Dial-Up Networking.
NM_BT_CAPABILITY_PAN = 0x2
The device supports Bluetooth Personal Area Networking.
+ +

org.freedesktop.NetworkManager.Device.OlpcMesh

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

+ Emitted when the wireless device's properties changed. +

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary containing the FIXME: check changed parameters. +

Properties:

HwAddress - + s - + (read)
+ The hardware address of the device. +
Companion - + o - + (read)
+ The object path of the companion device. +
ActiveChannel - + u - + (read)
+ The currently active channel. +
+ +

org.freedesktop.NetworkManager.IP4Config

Interface has no methods.

Interface has no signals.

Properties:

Addresses - + aau - + (read)
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), ...] +
Nameservers - + au - + (read)
The nameservers in use.
WinsServers - + au - + (read)
The Windows Internet Name Service servers associated with the connection. Each address is in network byte order.
Domains - + as - + (read)
A list of domains this address belongs to.
Routes - + aau - + (read)
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), ...] +
+ +

org.freedesktop.NetworkManager.IP6Config

Interface has no methods.

Interface has no signals.

Properties:

Addresses - + a(ayuay) - + (read)
Tuples of IPv6 address/prefix/gateway.
Nameservers - + aay - + (read)
The nameservers in use.
Domains - + as - + (read)
A list of domains this address belongs to.
Routes - + a(ayuayu) - + (read)
Tuples of IPv6 route/prefix/next-hop/metric.
+ +

org.freedesktop.NetworkManager.DHCP4Config

+ Options and configuration returned by the IPv4 DHCP server. +

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Properties:

Options - + a{sv} - + (read)
Configuration options returned by a DHCP server, if any.
+ +

org.freedesktop.NetworkManager.DHCP6Config

+ Options and configuration returned by the IPv6 DHCP server. +

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Properties:

Options - + a{sv} - + (read)
Configuration options returned by a DHCP server, if any.
+ +

org.freedesktop.NetworkManagerSettings

+ The NetworkManagerSettings interface is provided by the service which provides connections to NetworkManager. +

Methods:

ListConnections ( + + ) → + ao

+ List the connections stored by this Settings object. +

Returns

connections - + ao
+ List of connections. +

AddConnection ( + a{sa{sv}}: connection + ) → + nothing

+ Add new connection. +

Parameters

connection - + a{sa{sv}}
+ Connection settings and properties. +

Signals:

NewConnection ( + o: connection + )

+ Emitted when a new connection has been added. +

Parameters

connection - + o
+ Object path of the new connection. +

Interface has no properties.

+ + +

org.freedesktop.NetworkManagerSettings.Connection

+ Represents a single network connection configuration. +

Methods:

Update ( + a{sa{sv}}: properties + ) → + nothing

+ Update the connection with new settings and properties, replacing all previous settings and properties. +

Parameters

properties - + a{sa{sv}}
+ New connection properties. +

Delete ( + + ) → + nothing

+ Delete the connection. +

GetSettings ( + + ) → + a{sa{sv}}

+ Get the settings maps describing this object. +

Returns

settings - + a{sa{sv}} + (String_String_Variant_Map_Map) +
+ The nested settings maps describing this object. +

Signals:

Updated ( + a{sa{sv}}: settings + )

+ Emitted when some settings changed. +

Parameters

settings - + a{sa{sv}} + (String_String_Variant_Map_Map) +
+ Contains complete connection setting parameters, including changes. +

Removed ( + + )

+ Emitted when this connection has been deleted/removed. After receipt of this signal, the object no longer exists. +

Interface has no properties.

+ +

org.freedesktop.NetworkManagerSettings.Connection.Secrets

+ Secrets have a separate interface so that they can be locked down. +

Methods:

GetSecrets ( + s: setting_name, as: hints, b: request_new + ) → + a{sa{sv}}

+ Get the secrets encapsulated in this object. +

Parameters

setting_name - + s
+ Name of the setting to return. +
hints - + as
+ Array of strings of key names in the Setting for which NM thinks + a secrets may be required. +
request_new - + b
+ Indicates whether new secrets should be requested or if the request can be fulfilled from storage. +

Returns

secrets - + a{sa{sv}} + (String_String_Variant_Map_Map) +
+ Nested settings maps containing secrets. Each setting MUST contain at least the 'name' field, containing the name of the setting, and one or more secrets. +

Interface has no signals.

Interface has no properties.

+ + +

org.freedesktop.NetworkManager.Connection.Active

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Properties:

ServiceName - + s - + (read)
The D-Bus service name providing this connection.
Connection - + o - + (read)
The path of the connection.
SpecificObject - + o - + (read)
A specific object associated with the active connection.
Devices - + ao - + (read)
Array of object paths representing devices which are part of this active connection.
State - + u - + (read) + (NM_ACTIVE_CONNECTION_STATE) +
The state of this active connection.
Default - + b - + (read)
Whether this active connection is the default IPv4 connection, i.e. whether it currently owns the default IPv4 route.
Default6 - + b - + (read)
Whether this active connection is the default IPv6 connection, i.e. whether it currently owns the default IPv6 route.
Vpn - + b - + (read)
Whether this active connection is also a VPN connection.

Enumerated types:

NM_ACTIVE_CONNECTION_STATE

NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0
+ The active connection is in an unknown state. +
NM_ACTIVE_CONNECTION_STATE_ACTIVATING = 1
+ The connection is activating. +
NM_ACTIVE_CONNECTION_STATE_ACTIVATED = 2
+ The connection is activated. +
+ +

org.freedesktop.NetworkManager.Connection.Active

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

Properties:

ServiceName - + s - + (read)
The D-Bus service name providing this connection.
Connection - + o - + (read)
The path of the connection.
SpecificObject - + o - + (read)
A specific object associated with the active connection.
Devices - + ao - + (read)
Array of object paths representing devices which are part of this active connection.
State - + u - + (read) + (NM_ACTIVE_CONNECTION_STATE) +
The state of this active connection.
Default - + b - + (read)
Whether this active connection is the default connection, i.e. whether it currently owns the default route.
Vpn - + b - + (read)
Whether this active connection is also a VPN connection.
+ +

org.freedesktop.NetworkManager.VPN.Connection

+ Represents an active connection to a Virtual Private Network. +

Interface has no methods.

Signals:

PropertiesChanged ( + a{sv}: properties + )

Parameters

properties - + a{sv} + (String_Variant_Map) +
+ A dictionary mapping property names to variant boxed values +

VpnStateChanged ( + u: state, u: reason + )

+ Emitted when the state of the VPN connection has changed. +

Parameters

state - + u + (NM_VPN_CONNECTION_STATE) +
+ The new state of the VPN connection. +
reason - + u + (NM_VPN_CONNECTION_STATE_REASON) +
+ Reason code describing the change to the new state. +

Properties:

VpnState - + u - + (read) + (NM_VPN_CONNECTION_STATE) +
The VPN-specific state of the connection.
Banner - + s - + (read)
The banner string of the VPN connection.

Enumerated types:

NM_VPN_CONNECTION_STATE

NM_VPN_CONNECTION_STATE_UNKNOWN = 0
+ The state of the VPN connection is unknown. +
NM_VPN_CONNECTION_STATE_PREPARE = 1
+ The VPN connection is preparing to connect. +
NM_VPN_CONNECTION_STATE_NEED_AUTH = 2
+ The VPN connection needs authorization credentials. +
NM_VPN_CONNECTION_STATE_CONNECT = 3
+ The VPN connection is being established. FIXME: Should be CONNECTING or CONNECTED. +
NM_VPN_CONNECTION_STATE_IP_CONFIG_GET = 4
+ The VPN connection is getting an IP address. FIXME: Should be an -ING +
NM_VPN_CONNECTION_STATE_ACTIVATED = 5
+ The VPN connection is active. +
NM_VPN_CONNECTION_STATE_FAILED = 6
+ The VPN connection failed. +
NM_VPN_CONNECTION_STATE_DISCONNECTED = 7
+ The VPN connection is disconnected. +

NM_VPN_CONNECTION_STATE_REASON

NM_VPN_CONNECTION_STATE_REASON_UNKNOWN = 0
+ The reason for the VPN connection state change is unknown. +
NM_VPN_CONNECTION_STATE_REASON_NONE = 1
+ No reason was given for the VPN connection state change. +
NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED = 2
+ The VPN connection changed state because the user disconnected it. +
NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED = 3
+ The VPN connection changed state because the device it was using was disconnected. +
NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED = 4
+ The service providing the VPN connection was stopped. +
NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID = 5
+ The IP config of the VPN connection was invalid. +
NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT = 6
+ The connection attempt to the VPN service timed out. +
NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT = 7
+ A timeout occurred while starting the service providing the VPN connection. +
NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED = 8
+ Starting the service starting the service providing the VPN connection failed. +
NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS = 9
+ Necessary secrets for the VPN connection were not provided. +
+ +

org.freedesktop.NetworkManager.VPN.Plugin

+ This interface is provided by plugins providing VPN services to the NetworkManager daemon. +

Methods:

Connect ( + a{sa{sv}}: connection + ) → + nothing

+ Tells the plugin to connect. +

Parameters

connection - + a{sa{sv}} + (String_String_Variant_Map_Map) +
+ Describes the connection to be established. +

Possible errors

org.freedesktop.NetworkManager.VPN.Error.StartingInProgress
The request could not be processed because the VPN connection is already being started.(generic description)
org.freedesktop.NetworkManager.VPN.Error.AlreadyStarted
The request could not be processed because a VPN connection was already active.(generic description)
org.freedesktop.NetworkManager.VPN.Error.StoppingInProgress
The request could not be processed because the VPN connection is already being stopped.(generic description)
org.freedesktop.NetworkManager.VPN.Error.BadArguments
Invalid arguments were passed with the request. FIXME: too general.(generic description)
org.freedesktop.NetworkManager.VPN.Error.LaunchFailed
A binary providing the service failed to launch.(generic description)

NeedSecrets ( + a{sa{sv}}: settings + ) → + s

+ Asks the plugin whether the provided connection will require secrets to connect successfully. +

Parameters

settings - + a{sa{sv}} + (String_String_Variant_Map_Map) +
+ Describes the connection that may need secrets. +

Returns

setting_name - + s
+ The setting name within the provided connection that requires secrets, if any. +

Possible errors

org.freedesktop.NetworkManager.VPN.Error.ConnectionInvalid
The request could not be processed because the VPN connection settings were invalid.(generic description)

Disconnect ( + + ) → + nothing

+ Disconnect the plugin. +

Possible errors

org.freedesktop.NetworkManager.VPN.Error.StoppingInProgress
The request could not be processed because the VPN connection is already being stopped.(generic description)
org.freedesktop.NetworkManager.VPN.Error.AlreadyStopped
The request could not be processed because the VPN connection was already stopped.(generic description)

SetIp4Config ( + a{sv}: config + ) → + nothing

+ Set IPv4 details on the connection. +

Parameters

config - + a{sv} + (String_Variant_Map) +
+ Ip4Config details for the conneciton. +

SetFailure ( + s: reason + ) → + nothing

+ Indicate a failure to the plugin. +

Parameters

reason - + s
+ The reason for the failure. +

Signals:

StateChanged ( + u: state + )

+ Emitted when the plugin state changes. +

Parameters

state - + u + (NM_VPN_CONNECTION_STATE) +
+ The new state of the plugin. +

Ip4Config ( + a{sv}: ip4config + )

+ The plugin obtained an IPv4 configuration. +

Parameters

ip4config - + a{sv} + (String_Variant_Map) +
+ The IPv4 configuration. +

LoginBanner ( + s: banner + )

+ Emitted when the plugin receives a login banner from the VPN service. +

Parameters

banner - + s
+ The login banner string. +

Failure ( + u: reason + )

+ Emitted when a failure in the VPN plugin occurs. +

Parameters

reason - + u + (NM_VPN_PLUGIN_FAILURE) +
+ Reason code for the failure. +

Properties:

State - + u - + (read) + (NM_VPN_CONNECTION_STATE) +
+ The state of the plugin. +

Enumerated types:

NM_VPN_PLUGIN_FAILURE

NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED = 0
+ Login failed. +
NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED = 1
+ Connect failed. +
NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG = 2
+ Invalid IP configuration returned from the VPN plugin. +
+

Generic types:

Enumerated types:

NM_802_11_MODE

NM_802_11_MODE_UNKNOWN = 0
Mode is unknown.
NM_802_11_MODE_ADHOC = 1
Uncoordinated network without central infrastructure.
NM_802_11_MODE_INFRA = 2
Coordinated network with one or more central controllers.

Mapping types:

String_Variant_Map - a{ + s: Key → v: Value + } +

A mapping from strings to variants representing extra + key-value pairs.

Members

Key - + s
(undocumented)
Value - + v
(undocumented)

String_String_Map - a{ + s: Key → s: Value + } +

A mapping from strings to strings representing extra + key-value pairs.

Members

Key - + s
(undocumented)
Value - + s
(undocumented)

String_String_Variant_Map_Map - a{ + s: Key → a{sv}: Value + } +

A mapping from strings to a map of string to variant.

Members

Key - + s
(undocumented)
Value - + a{sv} + (String_Variant_Map) +
(undocumented)

Errors:

+ + +

org.freedesktop.NetworkManager.Error.UnknownConnection

+ Connection was not provided by any known settings service. + + +

org.freedesktop.NetworkManager.Error.UnknownDevice

+ Unknown device. + + +

org.freedesktop.NetworkManager.Error.InvalidService

+ Invalid settings service (not a recognized system or user settings service name). + + +

org.freedesktop.NetworkManager.Error.SystemConnection

+ Connection was superseded by a system connection. + + +

org.freedesktop.NetworkManager.Error.PermissionDenied

+ User does not have the permission to activate this connection. + + +

Errors:

+

org.freedesktop.NetworkManager.VPN.Error.General

This is a drab, nondescript error. +

org.freedesktop.NetworkManager.VPN.Error.StartingInProgress

The request could not be processed because the VPN connection is already being started. +

org.freedesktop.NetworkManager.VPN.Error.AlreadyStarted

The request could not be processed because a VPN connection was already active. +

org.freedesktop.NetworkManager.VPN.Error.StoppingInProgress

The request could not be processed because the VPN connection is already being stopped. +

org.freedesktop.NetworkManager.VPN.Error.AlreadyStopped

The request could not be processed because the VPN connection was already stopped. +

org.freedesktop.NetworkManager.VPN.Error.WrongState

The request could not be processed because the VPN connection is in the wrong state for this type of request. FIXME: too general? +

org.freedesktop.NetworkManager.VPN.Error.BadArguments

Invalid arguments were passed with the request. FIXME: too general. +

org.freedesktop.NetworkManager.VPN.Error.LaunchFailed

A binary providing the service failed to launch. +

org.freedesktop.NetworkManager.VPN.Error.ConnectionInvalid

The request could not be processed because the VPN connection settings were invalid. +

Index

Index of interfaces

Index of types

diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 00000000..c2ddf781 --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=python diff --git a/examples/Makefile.in b/examples/Makefile.in new file mode 100644 index 00000000..40f42edc --- /dev/null +++ b/examples/Makefile.in @@ -0,0 +1,620 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = examples +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = python +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/examples/python/Makefile.am b/examples/python/Makefile.am new file mode 100644 index 00000000..179e2f3c --- /dev/null +++ b/examples/python/Makefile.am @@ -0,0 +1,8 @@ +EXTRA_DIST = \ + nm-state.py \ + add-system-connection.py \ + vpn.py \ + list-connections.py \ + show-bssids.py + + diff --git a/examples/python/Makefile.in b/examples/python/Makefile.in new file mode 100644 index 00000000..c2f1d9d3 --- /dev/null +++ b/examples/python/Makefile.in @@ -0,0 +1,424 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = examples/python +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + nm-state.py \ + add-system-connection.py \ + vpn.py \ + list-connections.py \ + show-bssids.py + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/python/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/python/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/examples/python/add-system-connection.py b/examples/python/add-system-connection.py new file mode 100755 index 00000000..39eaabee --- /dev/null +++ b/examples/python/add-system-connection.py @@ -0,0 +1,48 @@ +#!/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 Red Hat, Inc. +# + +import dbus + +s_wired = dbus.Dictionary({'duplex': 'full'}) +s_con = dbus.Dictionary({ + 'type': '802-3-ethernet', + 'uuid': '7371bb78-c1f7-42a3-a9db-5b9566e8ca07', + 'id': 'MyConnection'}) + +addr1 = dbus.Array([dbus.UInt32(50462986L), dbus.UInt32(8L), dbus.UInt32(16908554L)], 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}) + + +bus = dbus.SystemBus() + +proxy = bus.get_object("org.freedesktop.NetworkManagerSystemSettings", "/org/freedesktop/NetworkManagerSettings") +settings = dbus.Interface(proxy, "org.freedesktop.NetworkManagerSettings") + +settings.AddConnection(con) + diff --git a/examples/python/list-connections.py b/examples/python/list-connections.py new file mode 100644 index 00000000..ad8d9047 --- /dev/null +++ b/examples/python/list-connections.py @@ -0,0 +1,112 @@ +#!/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 Red Hat, Inc. +# + +import dbus + +# This example asks both the system settings service and the user settings +# service for all configured connections. It also asks for secrets, demonstrating +# the mechanisms each settings service uses to prevent unauthorized access to +# a user's network passwords + +bus = dbus.SystemBus() + +def merge_secrets(proxy, config, setting_name): + try: + # returns a dict of dicts mapping name::setting, where setting is a dict + # mapping key::value. Each member of the 'setting' dict is a secret + secrets = proxy.GetSecrets(setting_name, [], False) + + # Copy the secrets into our connection config + for setting in secrets: + for key in secrets[setting]: + config[setting_name][key] = setting[key] + except Exception, e: + pass + +def dict_to_string(d, indent): + # Try to trivially translate a dictionary's elements into nice string + # formatting. + dstr = "" + for key in d: + val = d[key] + str_val = "" + add_string = True + if type(val) == type(dbus.Array([])): + for elt in val: + if type(elt) == type(dbus.Byte(1)): + str_val += "%s " % int(elt) + elif type(elt) == type(dbus.String("")): + str_val += "%s" % elt + elif type(val) == type(dbus.Dictionary({})): + dstr += dict_to_string(val, indent + " ") + add_string = False + else: + str_val = val + if add_string: + dstr += "%s%s: %s\n" % (indent, key, str_val) + return dstr + +def connection_to_string(config): + # dump a connection configuration to a the console + for setting_name in config: + print " Setting: %s" % setting_name + print dict_to_string(config[setting_name], " ") + print "" + + +def print_one_services_connections(service_name, desc): + # Ask the settings service for the list of connections it provides + proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManagerSettings") + settings = dbus.Interface(proxy, "org.freedesktop.NetworkManagerSettings") + connection_paths = settings.ListConnections() + + print "%s connections --------------------------------------------\n" % desc + + # List each connection's name, UUID, and type + for path in connection_paths: + con_proxy = bus.get_object(service_name, path) + connection = dbus.Interface(con_proxy, "org.freedesktop.NetworkManagerSettings.Connection") + config = connection.GetSettings() + + # Now get secrets too; we grab the secrets for each type of connection + # (since there isn't a "get all secrets" call because most of the time + # you only need 'wifi' secrets or '802.1x' secrets, not everything) and + # merge that into the configuration data + connection_secrets = dbus.Interface(con_proxy, "org.freedesktop.NetworkManagerSettings.Connection.Secrets") + merge_secrets(connection_secrets, config, '802-11-wireless') + merge_secrets(connection_secrets, config, '802-11-wireless-security') + merge_secrets(connection_secrets, config, '802-1x') + merge_secrets(connection_secrets, config, 'gsm') + merge_secrets(connection_secrets, config, 'cdma') + merge_secrets(connection_secrets, config, 'ppp') + + # Get the details of the 'connection' setting + s_con = config['connection'] + print "name: %s" % s_con['id'] + print " uuid: %s" % s_con['uuid'] + print " type: %s" % s_con['type'] + print " ----------------------------" + connection_to_string(config) + + print "" + +# Print out connection information for all connections +print_one_services_connections("org.freedesktop.NetworkManagerSystemSettings", "System") +print_one_services_connections("org.freedesktop.NetworkManagerUserSettings", "User") + diff --git a/examples/python/nm-state.py b/examples/python/nm-state.py new file mode 100644 index 00000000..fddd2da6 --- /dev/null +++ b/examples/python/nm-state.py @@ -0,0 +1,69 @@ +#!/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 Red Hat, Inc. +# + +import dbus + +bus = dbus.SystemBus() + +proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager") +manager = dbus.Interface(proxy, "org.freedesktop.NetworkManager") + +# Get device-specific state +devices = manager.GetDevices() +for d in devices: + dev_proxy = bus.get_object("org.freedesktop.NetworkManager", d) + prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties") + + # Get the device's current state and interface name + state = prop_iface.Get("org.freedesktop.NetworkManager.Device", "State") + name = prop_iface.Get("org.freedesktop.NetworkManager.Device", "Interface") + + # and print them out + if state == 8: # activated + print "Device %s is activated" % name + else: + print "Device %s is not activated" % name + + +# Get active connection state +manager_prop_iface = dbus.Interface(proxy, "org.freedesktop.DBus.Properties") +active = manager_prop_iface.Get("org.freedesktop.NetworkManager", "ActiveConnections") +for a in active: + ac_proxy = bus.get_object("org.freedesktop.NetworkManager", a) + prop_iface = dbus.Interface(ac_proxy, "org.freedesktop.DBus.Properties") + state = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "State") + + # Connections in NM are a collection of settings that describe everything + # needed to connect to a specific network. Lets get those details so we + # can find the user-readable name of the connection. + con_path = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "Connection") + con_service = prop_iface.Get("org.freedesktop.NetworkManager.ActiveConnection", "ServiceName") + + # ask the provider of the connection for its details + service_proxy = bus.get_object(con_service, con_path) + con_iface = dbus.Interface(service_proxy, "org.freedesktop.NetworkManagerSettings.Connection") + 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 + + diff --git a/examples/python/show-bssids.py b/examples/python/show-bssids.py new file mode 100644 index 00000000..5d8778c7 --- /dev/null +++ b/examples/python/show-bssids.py @@ -0,0 +1,78 @@ +#!/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 Red Hat, Inc. +# + + +# This example prints out all the AP BSSIDs that all WiFi devices on the +# machine can see. Useful for location-based services like Skyhook that +# can geolocate you based on the APs you can see. + +import dbus + +bus = dbus.SystemBus() + +# Get a proxy for the base NetworkManager object +proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager") +manager = dbus.Interface(proxy, "org.freedesktop.NetworkManager") + +all_aps = [] + +print "Associated APs:" + +# Get all network devices +devices = manager.GetDevices() +for d in devices: + dev_proxy = bus.get_object("org.freedesktop.NetworkManager", d) + prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties") + + # Make sure the device is enabled before we try to use it + state = prop_iface.Get("org.freedesktop.NetworkManager.Device", "State") + if state <= 2: + continue + + # Get device's type; we only want wifi devices + iface = prop_iface.Get("org.freedesktop.NetworkManager.Device", "Interface") + dtype = prop_iface.Get("org.freedesktop.NetworkManager.Device", "DeviceType") + if dtype == 2: # WiFi + # Get a proxy for the wifi interface + wifi_iface = dbus.Interface(dev_proxy, "org.freedesktop.NetworkManager.Device.Wireless") + wifi_prop_iface = dbus.Interface(dev_proxy, "org.freedesktop.DBus.Properties") + + # Get the associated AP's object path + connected_path = wifi_prop_iface.Get("org.freedesktop.NetworkManager.Device.Wireless", "ActiveAccessPoint") + + # Get all APs the card can see + aps = wifi_iface.GetAccessPoints() + for path in aps: + ap_proxy = bus.get_object("org.freedesktop.NetworkManager", path) + ap_prop_iface = dbus.Interface(ap_proxy, "org.freedesktop.DBus.Properties") + bssid = ap_prop_iface.Get("org.freedesktop.NetworkManager.AccessPoint", "HwAddress") + + # Cache the BSSID + if not bssid in all_aps: + all_aps.append(bssid) + + # Print the current AP's BSSID + if path == connected_path: + print "%s (%s)" % (bssid, iface) + +# and print out all APs the wifi devices can see +print"\nFound APs:" +for bssid in all_aps: + print bssid + diff --git a/examples/python/vpn.py b/examples/python/vpn.py new file mode 100644 index 00000000..4b4057fc --- /dev/null +++ b/examples/python/vpn.py @@ -0,0 +1,152 @@ +#!/usr/bin/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) 2009 Novell, Inc. +# Copyright (C) 2009 Red Hat, Inc. +# + +# Run this script without any arguments to list the available connection uuids. + +# The uuid of the connection to activate +CONNECTION_UUID="ac6dc9b2-85ef-4311-83d8-add5d7db3f59" + +# UID to use. Note that NM only allows the owner of the connection to activate it. +#UID=1000 +UID=0 + +import sys +import os +import dbus +from dbus.mainloop.glib import DBusGMainLoop +import gobject + +DBusGMainLoop(set_as_default=True) + +def get_connections(): + bus = dbus.SystemBus() + proxy = bus.get_object('org.freedesktop.NetworkManagerUserSettings', '/org/freedesktop/NetworkManagerSettings') + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings') + return iface.ListConnections() + + +def get_connection_by_uuid(uuid): + bus = dbus.SystemBus() + for c in get_connections(): + proxy = bus.get_object('org.freedesktop.NetworkManagerUserSettings', c) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection') + settings = iface.GetSettings() + if settings['connection']['uuid'] == uuid: + return c + + return None + + +def list_uuids(): + bus = dbus.SystemBus() + for c in get_connections(): + proxy = bus.get_object('org.freedesktop.NetworkManagerUserSettings', c) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection') + settings = iface.GetSettings() + conn = settings['connection'] + print "%s - %s (%s)" % (conn['uuid'], conn['id'], conn['type']) + + +def get_active_connection_path(uuid): + bus = dbus.SystemBus() + proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.DBus.Properties') + active_connections = iface.Get('org.freedesktop.NetworkManager', 'ActiveConnections') + all_connections = get_connections() + + for a in active_connections: + proxy = bus.get_object('org.freedesktop.NetworkManager', a) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.DBus.Properties') + path = iface.Get('org.freedesktop.NetworkManager.Connection.Active', 'Connection') + + proxy = bus.get_object('org.freedesktop.NetworkManagerUserSettings', path) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManagerSettings.Connection') + settings = iface.GetSettings() + + if settings['connection']['uuid'] == uuid: + return a + + return None + + +def get_wifi_device_path(): + bus = dbus.SystemBus() + proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager') + devices = iface.GetDevices() + for d in devices: + proxy = bus.get_object('org.freedesktop.NetworkManager', d) + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.DBus.Properties') + devtype = iface.Get('org.freedesktop.NetworkManager.Device', 'DeviceType') + if devtype == 2: + return d + return None + +def activate_connection(connection_path, device_path): + + def reply_handler(opath): + print "Success: device activating" + sys.exit(0) + + def error_handler(*args): + print "Error activating device: %s" % args + sys.exit(1) + + bus = dbus.SystemBus() + proxy = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager') + iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.NetworkManager') + iface.ActivateConnection('org.freedesktop.NetworkManagerUserSettings', + connection_path, + device_path, + "/", + reply_handler=reply_handler, + error_handler=error_handler) + + +# Change the UID first if required +if UID != 0: + os.setuid(UID) + +# Are we configured? +if not len(CONNECTION_UUID): + print "missing connection UUID" + sys.exit(0) + +connection_path = get_connection_by_uuid(CONNECTION_UUID) +if not connection_path: + # Configured VPN connection is not known to NM, check CONNECTION_UUID. + print "couldn't find the connection" + sys.exit(1) + +device_path = get_wifi_device_path() +if not device_path: + print "no wifi device found" + sys.exit(1) + +# Is it already activated? +if get_active_connection_path(CONNECTION_UUID): + print "already connected" + sys.exit(0) + +print "Activating connection..." +activate_connection(connection_path, device_path) +loop = gobject.MainLoop() +loop.run() + diff --git a/gtk-doc.make b/gtk-doc.make new file mode 100644 index 00000000..63adaedd --- /dev/null +++ b/gtk-doc.make @@ -0,0 +1,224 @@ +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute +else +GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +EXTRA_DIST = \ + $(content_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ + pdf-build.stamp \ + $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ + $(srcdir)/pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) + +if ENABLE_GTK_DOC +if GTK_DOC_BUILD_HTML +HTML_BUILD_STAMP=html-build.stamp +else +HTML_BUILD_STAMP= +endif +if GTK_DOC_BUILD_PDF +PDF_BUILD_STAMP=pdf-build.stamp +else +PDF_BUILD_STAMP= +endif + +all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +else +all-local: +endif + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +#### scan #### + +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo 'gtk-doc: Scanning header files' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ + else \ + cd $(srcdir) ; \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + @touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### templates #### + +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt + @echo 'gtk-doc: Rebuilding template files' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + @touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +$(srcdir)/tmpl/*.sgml: + @true + +#### xml #### + +sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) + @echo 'gtk-doc: Building XML' + @-chmod -R u+w $(srcdir) + @cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + @touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building HTML' + @-chmod -R u+w $(srcdir) + @rm -rf $(srcdir)/html + @mkdir $(srcdir)/html + @mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$(?)" = "0"; then \ + mkhtml_options=--path="$(srcdir)"; \ + fi; \ + cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + @echo 'gtk-doc: Fixing cross-references' + @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @touch html-build.stamp + +#### pdf #### + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building PDF' + @-chmod -R u+w $(srcdir) + @rm -rf $(srcdir)/$(DOC_MODULE).pdf + @mkpdf_imgdirs=""; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + @touch pdf-build.stamp + +############## + +clean-local: + rm -f *~ *.bak + rm -rf .libs + +distclean-local: + cd $(srcdir) && \ + rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +maintainer-clean-local: clean + cd $(srcdir) && rm -rf xml html + +install-data-local: + @installfiles=`echo $(srcdir)/html/*`; \ + if test "$$installfiles" = '$(srcdir)/html/*'; \ + then echo '-- Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + mv -f $${installdir}/$(DOC_MODULE).devhelp \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/tmpl + mkdir $(distdir)/html + -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl + cp $(srcdir)/html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 00000000..54c4d1dc --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,14 @@ +EXTRA_DIST = \ + NetworkManager.h \ + NetworkManagerVPN.h \ + wireless-helper.h \ + nm-dbus-glib-types.h \ + nm-glib-compat.h \ + nm-test-helpers.h + +NetworkManagerincludedir=$(includedir)/NetworkManager + +NetworkManagerinclude_HEADERS = \ + NetworkManager.h \ + NetworkManagerVPN.h + diff --git a/include/Makefile.in b/include/Makefile.in new file mode 100644 index 00000000..6a914fe8 --- /dev/null +++ b/include/Makefile.in @@ -0,0 +1,529 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include +DIST_COMMON = $(NetworkManagerinclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(NetworkManagerincludedir)" +HEADERS = $(NetworkManagerinclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + NetworkManager.h \ + NetworkManagerVPN.h \ + wireless-helper.h \ + nm-dbus-glib-types.h \ + nm-glib-compat.h \ + nm-test-helpers.h + +NetworkManagerincludedir = $(includedir)/NetworkManager +NetworkManagerinclude_HEADERS = \ + NetworkManager.h \ + NetworkManagerVPN.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-NetworkManagerincludeHEADERS: $(NetworkManagerinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(NetworkManagerincludedir)" || $(MKDIR_P) "$(DESTDIR)$(NetworkManagerincludedir)" + @list='$(NetworkManagerinclude_HEADERS)'; test -n "$(NetworkManagerincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(NetworkManagerincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(NetworkManagerincludedir)" || exit $$?; \ + done + +uninstall-NetworkManagerincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(NetworkManagerinclude_HEADERS)'; test -n "$(NetworkManagerincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(NetworkManagerincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(NetworkManagerincludedir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(NetworkManagerincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-NetworkManagerincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-NetworkManagerincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install \ + install-NetworkManagerincludeHEADERS install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-NetworkManagerincludeHEADERS uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/include/NetworkManager.h b/include/NetworkManager.h new file mode 100644 index 00000000..9df444f2 --- /dev/null +++ b/include/NetworkManager.h @@ -0,0 +1,391 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * + * 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 2004 - 2008 Red Hat, Inc. + */ + +#ifndef NETWORK_MANAGER_H +#define NETWORK_MANAGER_H + +/* + * dbus services details + */ +#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager" + +#define NM_DBUS_PATH "/org/freedesktop/NetworkManager" +#define NM_DBUS_INTERFACE "org.freedesktop.NetworkManager" +#define NM_DBUS_INTERFACE_DEVICE NM_DBUS_INTERFACE ".Device" +#define NM_DBUS_INTERFACE_DEVICE_WIRED NM_DBUS_INTERFACE_DEVICE ".Wired" +#define NM_DBUS_INTERFACE_DEVICE_WIRELESS NM_DBUS_INTERFACE_DEVICE ".Wireless" +#define NM_DBUS_INTERFACE_DEVICE_BLUETOOTH NM_DBUS_INTERFACE_DEVICE ".Bluetooth" +#define NM_DBUS_PATH_ACCESS_POINT NM_DBUS_PATH "/AccessPoint" +#define NM_DBUS_INTERFACE_ACCESS_POINT NM_DBUS_INTERFACE ".AccessPoint" +#define NM_DBUS_INTERFACE_SERIAL_DEVICE NM_DBUS_INTERFACE_DEVICE ".Serial" +#define NM_DBUS_INTERFACE_GSM_DEVICE NM_DBUS_INTERFACE_DEVICE ".Gsm" +#define NM_DBUS_INTERFACE_CDMA_DEVICE NM_DBUS_INTERFACE_DEVICE ".Cdma" +#define NM_DBUS_INTERFACE_ACTIVE_CONNECTION NM_DBUS_INTERFACE ".Connection.Active" +#define NM_DBUS_INTERFACE_IP4_CONFIG NM_DBUS_INTERFACE ".IP4Config" +#define NM_DBUS_INTERFACE_DHCP4_CONFIG NM_DBUS_INTERFACE ".DHCP4Config" +#define NM_DBUS_INTERFACE_IP6_CONFIG NM_DBUS_INTERFACE ".IP6Config" +#define NM_DBUS_INTERFACE_DHCP6_CONFIG NM_DBUS_INTERFACE ".DHCP6Config" + + +#define NM_DBUS_SERVICE_USER_SETTINGS "org.freedesktop.NetworkManagerUserSettings" +#define NM_DBUS_SERVICE_SYSTEM_SETTINGS "org.freedesktop.NetworkManagerSystemSettings" +#define NM_DBUS_IFACE_SETTINGS "org.freedesktop.NetworkManagerSettings" +#define NM_DBUS_IFACE_SETTINGS_SYSTEM "org.freedesktop.NetworkManagerSettings.System" +#define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManagerSettings" + +#define NM_DBUS_IFACE_SETTINGS_CONNECTION "org.freedesktop.NetworkManagerSettings.Connection" +#define NM_DBUS_PATH_SETTINGS_CONNECTION "/org/freedesktop/NetworkManagerSettings/Connection" +#define NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS "org.freedesktop.NetworkManagerSettings.Connection.Secrets" + + +/* + * Types of NetworkManager states + */ +typedef enum NMState +{ + NM_STATE_UNKNOWN = 0, + NM_STATE_ASLEEP, + NM_STATE_CONNECTING, + NM_STATE_CONNECTED, + NM_STATE_DISCONNECTED +} NMState; + + +/* + * Types of NetworkManager devices + */ +typedef enum NMDeviceType +{ + NM_DEVICE_TYPE_UNKNOWN = 0, + NM_DEVICE_TYPE_ETHERNET, + NM_DEVICE_TYPE_WIFI, + NM_DEVICE_TYPE_GSM, + NM_DEVICE_TYPE_CDMA, + NM_DEVICE_TYPE_BT, /* Bluetooth */ + NM_DEVICE_TYPE_OLPC_MESH +} NMDeviceType; + +/* DEPRECATED TYPE NAMES */ +#define DEVICE_TYPE_UNKNOWN NM_DEVICE_TYPE_UNKNOWN +#define DEVICE_TYPE_802_3_ETHERNET NM_DEVICE_TYPE_ETHERNET +#define DEVICE_TYPE_802_11_WIRELESS NM_DEVICE_TYPE_WIFI +#define DEVICE_TYPE_GSM NM_DEVICE_TYPE_GSM +#define DEVICE_TYPE_CDMA NM_DEVICE_TYPE_CDMA + + +/* + * General device capability bits + * + */ +#define NM_DEVICE_CAP_NONE 0x00000000 +#define NM_DEVICE_CAP_NM_SUPPORTED 0x00000001 +#define NM_DEVICE_CAP_CARRIER_DETECT 0x00000002 + + +/* 802.11 wireless device-specific capabilities */ +#define NM_WIFI_DEVICE_CAP_NONE 0x00000000 +#define NM_WIFI_DEVICE_CAP_CIPHER_WEP40 0x00000001 +#define NM_WIFI_DEVICE_CAP_CIPHER_WEP104 0x00000002 +#define NM_WIFI_DEVICE_CAP_CIPHER_TKIP 0x00000004 +#define NM_WIFI_DEVICE_CAP_CIPHER_CCMP 0x00000008 +#define NM_WIFI_DEVICE_CAP_WPA 0x00000010 +#define NM_WIFI_DEVICE_CAP_RSN 0x00000020 + + +/* + * 802.11 Access Point flags + * + */ +#define NM_802_11_AP_FLAGS_NONE 0x00000000 +#define NM_802_11_AP_FLAGS_PRIVACY 0x00000001 + +/* + * 802.11 Access Point security flags + * + * These describe the current security requirements of the BSSID as extracted + * from various pieces of beacon information, like beacon flags and various + * information elements. + */ +#define NM_802_11_AP_SEC_NONE 0x00000000 +#define NM_802_11_AP_SEC_PAIR_WEP40 0x00000001 +#define NM_802_11_AP_SEC_PAIR_WEP104 0x00000002 +#define NM_802_11_AP_SEC_PAIR_TKIP 0x00000004 +#define NM_802_11_AP_SEC_PAIR_CCMP 0x00000008 +#define NM_802_11_AP_SEC_GROUP_WEP40 0x00000010 +#define NM_802_11_AP_SEC_GROUP_WEP104 0x00000020 +#define NM_802_11_AP_SEC_GROUP_TKIP 0x00000040 +#define NM_802_11_AP_SEC_GROUP_CCMP 0x00000080 +#define NM_802_11_AP_SEC_KEY_MGMT_PSK 0x00000100 +#define NM_802_11_AP_SEC_KEY_MGMT_802_1X 0x00000200 + +/* + * 802.11 AP and Station modes + * + */ +typedef enum { + NM_802_11_MODE_UNKNOWN = 0, + NM_802_11_MODE_ADHOC, + NM_802_11_MODE_INFRA +} NM80211Mode; + +/** + * NMBluetoothCapabilities: + * @NM_BT_CAPABILITY_NONE: device has no usable capabilities + * @NM_BT_CAPABILITY_DUN: device provides Dial-Up Networking capability + * @NM_BT_CAPABILITY_PAN: device provides Personal Area Networking capability + * + * #NMBluetoothCapabilities values indicate the usable capabilities of a + * Bluetooth device. + */ +typedef enum { + NM_BT_CAPABILITY_NONE = 0x00000000, + NM_BT_CAPABILITY_DUN = 0x00000001, + NM_BT_CAPABILITY_NAP = 0x00000002, +} NMBluetoothCapabilities; + + +/* + * Device states + */ +typedef enum +{ + NM_DEVICE_STATE_UNKNOWN = 0, + + /* Initial state of all devices and the only state for devices not + * managed by NetworkManager. + * + * Allowed next states: + * UNAVAILABLE: the device is now managed by NetworkManager + */ + NM_DEVICE_STATE_UNMANAGED = 1, + + /* Indicates the device is not yet ready for use, but is managed by + * NetworkManager. For Ethernet devices, the device may not have an + * active carrier. For WiFi devices, the device may not have it's radio + * enabled. + * + * Allowed next states: + * UNMANAGED: the device is no longer managed by NetworkManager + * DISCONNECTED: the device is now ready for use + */ + NM_DEVICE_STATE_UNAVAILABLE = 2, + + /* Indicates the device does not have an activate connection to anything. + * + * Allowed next states: + * UNMANAGED: the device is no longer managed by NetworkManager + * UNAVAILABLE: the device is no longer ready for use (rfkill, no carrier, etc) + * PREPARE: the device has started activation + */ + NM_DEVICE_STATE_DISCONNECTED = 3, + + /* Indicate states in device activation. + * + * Allowed next states: + * UNMANAGED: the device is no longer managed by NetworkManager + * UNAVAILABLE: the device is no longer ready for use (rfkill, no carrier, etc) + * FAILED: an error ocurred during activation + * NEED_AUTH: authentication/secrets are needed + * ACTIVATED: (IP_CONFIG only) activation was successful + * DISCONNECTED: the device's connection is no longer valid, or NetworkManager went to sleep + */ + NM_DEVICE_STATE_PREPARE = 4, + NM_DEVICE_STATE_CONFIG = 5, + NM_DEVICE_STATE_NEED_AUTH = 6, + NM_DEVICE_STATE_IP_CONFIG = 7, + + /* Indicates the device is part of an active network connection. + * + * Allowed next states: + * UNMANAGED: the device is no longer managed by NetworkManager + * UNAVAILABLE: the device is no longer ready for use (rfkill, no carrier, etc) + * FAILED: a DHCP lease was not renewed, or another error + * DISCONNECTED: the device's connection is no longer valid, or NetworkManager went to sleep + */ + NM_DEVICE_STATE_ACTIVATED = 8, + + /* Indicates the device's activation failed. + * + * Allowed next states: + * UNMANAGED: the device is no longer managed by NetworkManager + * UNAVAILABLE: the device is no longer ready for use (rfkill, no carrier, etc) + * DISCONNECTED: the device's connection is ready for activation, or NetworkManager went to sleep + */ + NM_DEVICE_STATE_FAILED = 9 +} NMDeviceState; + + +/* + * Device state change reason codes + */ +typedef enum { + /* No reason given */ + NM_DEVICE_STATE_REASON_NONE = 0, + + /* Unknown error */ + NM_DEVICE_STATE_REASON_UNKNOWN = 1, + + /* Device is now managed */ + NM_DEVICE_STATE_REASON_NOW_MANAGED = 2, + + /* Device is now managed unmanaged */ + NM_DEVICE_STATE_REASON_NOW_UNMANAGED = 3, + + /* The device could not be readied for configuration */ + NM_DEVICE_STATE_REASON_CONFIG_FAILED = 4, + + /* IP configuration could not be reserved (no available address, timeout, etc) */ + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE = 5, + + /* The IP config is no longer valid */ + NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED = 6, + + /* Secrets were required, but not provided */ + NM_DEVICE_STATE_REASON_NO_SECRETS = 7, + + /* 802.1x supplicant disconnected */ + NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT = 8, + + /* 802.1x supplicant configuration failed */ + NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED = 9, + + /* 802.1x supplicant failed */ + NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED = 10, + + /* 802.1x supplicant took too long to authenticate */ + NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT = 11, + + /* PPP service failed to start */ + NM_DEVICE_STATE_REASON_PPP_START_FAILED = 12, + + /* PPP service disconnected */ + NM_DEVICE_STATE_REASON_PPP_DISCONNECT = 13, + + /* PPP failed */ + NM_DEVICE_STATE_REASON_PPP_FAILED = 14, + + /* DHCP client failed to start */ + NM_DEVICE_STATE_REASON_DHCP_START_FAILED = 15, + + /* DHCP client error */ + NM_DEVICE_STATE_REASON_DHCP_ERROR = 16, + + /* DHCP client failed */ + NM_DEVICE_STATE_REASON_DHCP_FAILED = 17, + + /* Shared connection service failed to start */ + NM_DEVICE_STATE_REASON_SHARED_START_FAILED = 18, + + /* Shared connection service failed */ + NM_DEVICE_STATE_REASON_SHARED_FAILED = 19, + + /* AutoIP service failed to start */ + NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED = 20, + + /* AutoIP service error */ + NM_DEVICE_STATE_REASON_AUTOIP_ERROR = 21, + + /* AutoIP service failed */ + NM_DEVICE_STATE_REASON_AUTOIP_FAILED = 22, + + /* The line is busy */ + NM_DEVICE_STATE_REASON_MODEM_BUSY = 23, + + /* No dial tone */ + NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE = 24, + + /* No carrier could be established */ + NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER = 25, + + /* The dialing request timed out */ + NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT = 26, + + /* The dialing attempt failed */ + NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED = 27, + + /* Modem initialization failed */ + NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED = 28, + + /* Failed to select the specified APN */ + NM_DEVICE_STATE_REASON_GSM_APN_FAILED = 29, + + /* Not searching for networks */ + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING = 30, + + /* Network registration denied */ + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED = 31, + + /* Network registration timed out */ + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT = 32, + + /* Failed to register with the requested network */ + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED = 33, + + /* PIN check failed */ + NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED = 34, + + /* Necessary firmware for the device may be missing */ + NM_DEVICE_STATE_REASON_FIRMWARE_MISSING = 35, + + /* The device was removed */ + NM_DEVICE_STATE_REASON_REMOVED = 36, + + /* NetworkManager went to sleep */ + NM_DEVICE_STATE_REASON_SLEEPING = 37, + + /* The device's active connection disappeared */ + NM_DEVICE_STATE_REASON_CONNECTION_REMOVED = 38, + + /* Device disconnected by user or client */ + NM_DEVICE_STATE_REASON_USER_REQUESTED = 39, + + /* Carrier/link changed */ + NM_DEVICE_STATE_REASON_CARRIER = 40, + + /* The device's existing connection was assumed */ + NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED = 41, + + /* The supplicant is now available */ + NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE = 42, + + /* The modem could not be found */ + NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND = 43, + + /* The Bluetooth connection failed or timed out */ + NM_DEVICE_STATE_REASON_BT_FAILED = 44, + + /* Unused */ + NM_DEVICE_STATE_REASON_LAST = 0xFFFF +} NMDeviceStateReason; + + +typedef enum { + NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0, + + /* Indicates the connection is activating */ + NM_ACTIVE_CONNECTION_STATE_ACTIVATING, + + /* Indicates the connection is currently active */ + NM_ACTIVE_CONNECTION_STATE_ACTIVATED +} NMActiveConnectionState; + +#endif /* NETWORK_MANAGER_H */ + diff --git a/include/NetworkManagerVPN.h b/include/NetworkManagerVPN.h new file mode 100644 index 00000000..d792847d --- /dev/null +++ b/include/NetworkManagerVPN.h @@ -0,0 +1,173 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * + * 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 2004 Red Hat, Inc. + */ + +#ifndef NETWORK_MANAGER_VPN_H +#define NETWORK_MANAGER_VPN_H + +/* + * dbus services details + */ +#define NM_DBUS_PATH_VPN "/org/freedesktop/NetworkManager/VPN/Manager" +#define NM_DBUS_INTERFACE_VPN "org.freedesktop.NetworkManager.VPN.Manager" + +#define NM_DBUS_PATH_VPN_CONNECTION "/org/freedesktop/NetworkManager/VPN/Connection" +#define NM_DBUS_INTERFACE_VPN_CONNECTION "org.freedesktop.NetworkManager.VPN.Connection" + +#define NM_VPN_DBUS_PLUGIN_PATH "/org/freedesktop/NetworkManager/VPN/Plugin" +#define NM_VPN_DBUS_PLUGIN_INTERFACE "org.freedesktop.NetworkManager.VPN.Plugin" + +/* + * VPN Errors + */ +#define NM_DBUS_NO_ACTIVE_VPN_CONNECTION "org.freedesktop.NetworkManager.VPNConnections.NoActiveVPNConnection" +#define NM_DBUS_NO_VPN_CONNECTIONS "org.freedesktop.NetworkManager.VPNConnections.NoVPNConnections" +#define NM_DBUS_INVALID_VPN_CONNECTION "org.freedesktop.NetworkManager.VPNConnections.InvalidVPNConnection" + +#define NM_DBUS_VPN_STARTING_IN_PROGRESS "StartingInProgress" +#define NM_DBUS_VPN_ALREADY_STARTED "AlreadyStarted" +#define NM_DBUS_VPN_STOPPING_IN_PROGRESS "StoppingInProgress" +#define NM_DBUS_VPN_ALREADY_STOPPED "AlreadyStopped" +#define NM_DBUS_VPN_WRONG_STATE "WrongState" +#define NM_DBUS_VPN_BAD_ARGUMENTS "BadArguments" + + +/* + * VPN daemon signals + */ +#define NM_DBUS_VPN_SIGNAL_LOGIN_BANNER "LoginBanner" +#define NM_DBUS_VPN_SIGNAL_LOGIN_FAILED "LoginFailed" +#define NM_DBUS_VPN_SIGNAL_LAUNCH_FAILED "LaunchFailed" +#define NM_DBUS_VPN_SIGNAL_CONNECT_FAILED "ConnectFailed" +#define NM_DBUS_VPN_SIGNAL_VPN_CONFIG_BAD "VPNConfigBad" +#define NM_DBUS_VPN_SIGNAL_IP_CONFIG_BAD "IPConfigBad" +#define NM_DBUS_VPN_SIGNAL_STATE_CHANGE "StateChange" +#define NM_DBUS_VPN_SIGNAL_IP4_CONFIG "IP4Config" + +/* + * VPN daemon states + */ +typedef enum NMVPNServiceState +{ + NM_VPN_SERVICE_STATE_UNKNOWN = 0, + NM_VPN_SERVICE_STATE_INIT, + NM_VPN_SERVICE_STATE_SHUTDOWN, + NM_VPN_SERVICE_STATE_STARTING, + NM_VPN_SERVICE_STATE_STARTED, + NM_VPN_SERVICE_STATE_STOPPING, + NM_VPN_SERVICE_STATE_STOPPED +} NMVPNServiceState; + + +/* + * VPN connection states + */ +typedef enum NMVPNConnectionState +{ + NM_VPN_CONNECTION_STATE_UNKNOWN = 0, + NM_VPN_CONNECTION_STATE_PREPARE, + NM_VPN_CONNECTION_STATE_NEED_AUTH, + NM_VPN_CONNECTION_STATE_CONNECT, + NM_VPN_CONNECTION_STATE_IP_CONFIG_GET, + NM_VPN_CONNECTION_STATE_ACTIVATED, + NM_VPN_CONNECTION_STATE_FAILED, + NM_VPN_CONNECTION_STATE_DISCONNECTED +} NMVPNConnectionState; + +typedef enum NMVPNConnectionStateReason +{ + NM_VPN_CONNECTION_STATE_REASON_UNKNOWN = 0, + NM_VPN_CONNECTION_STATE_REASON_NONE, + NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED, + NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED, + NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID, + NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED, + NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS, + NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED, + NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED +} NMVPNConnectionStateReason; + +typedef enum { + NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED, + NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED, + NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG +} NMVPNPluginFailure; + + +/* uint32: IP address of the public external VPN gateway (network byte order) */ +#define NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY "gateway" + +/* uint32: IP address of the internal gateway of the subnet the VPN interface is + * on, if the VPN uses subnet configuration (network byte order) + */ +#define NM_VPN_PLUGIN_IP4_CONFIG_INT_GATEWAY "internal-gateway" + +/* uint32: internal IP address of the local VPN interface (network byte order) */ +#define NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS "address" + +/* uint32: IP address of the other side of Point-to-Point connection if the VPN + * uses Point-to-Point configuration. (network byte order) + */ +#define NM_VPN_PLUGIN_IP4_CONFIG_PTP "ptp" + +/* uint32: IP prefix of the VPN interface; 1 - 32 inclusive */ +#define NM_VPN_PLUGIN_IP4_CONFIG_PREFIX "prefix" + +/* array of uint32: IP addresses of DNS servers for the VPN (network byte order) */ +#define NM_VPN_PLUGIN_IP4_CONFIG_DNS "dns" + +/* array of uint32: IP addresses of NBNS/WINS servers for the VPN (network byte order) */ +#define NM_VPN_PLUGIN_IP4_CONFIG_NBNS "nbns" + +/* uint32: Message Segment Size that the VPN interface should use */ +#define NM_VPN_PLUGIN_IP4_CONFIG_MSS "mss" + +/* uint32: Maximum Transfer Unit that the VPN interface should use */ +#define NM_VPN_PLUGIN_IP4_CONFIG_MTU "mtu" + +/* string: VPN interface name (tun0, tap0, etc) */ +#define NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV "tundev" + +/* string: DNS domain name */ +#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN "domain" + +/* string: Login message */ +#define NM_VPN_PLUGIN_IP4_CONFIG_BANNER "banner" + +/* array of array of uint32: custom routes the client should apply. NOTE: NM + * expects the D-Bus argument signature "aau" here. i.e., an array of + * routes, where each route is a 4-element array of uint32 values. + * + * Each route consists of the following 4 uint32 values, in this order: + * 1: destination IP address (network byte order) + * 2: destination prefix (1 - 32 inclusive) + * 3: IP address of next hop (network byte order) + * 4: route metric + */ +#define NM_VPN_PLUGIN_IP4_CONFIG_ROUTES "routes" + +/* Deprecated */ +#define NM_VPN_PLUGIN_IP4_CONFIG_GATEWAY NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY + + +#endif /* NETWORK_MANAGER_VPN_H */ diff --git a/include/nm-dbus-glib-types.h b/include/nm-dbus-glib-types.h new file mode 100644 index 00000000..0f8c542e --- /dev/null +++ b/include/nm-dbus-glib-types.h @@ -0,0 +1,43 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * + * 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 Red Hat, Inc. + */ + +#ifndef DBUS_GLIB_TYPES_H +#define DBUS_GLIB_TYPES_H + +#include + +#define DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)) +#define DBUS_TYPE_G_ARRAY_OF_STRING (dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING)) +#define DBUS_TYPE_G_ARRAY_OF_UINT (dbus_g_type_get_collection ("GArray", G_TYPE_UINT)) +#define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_UCHAR_ARRAY)) +#define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_ARRAY_OF_UINT)) +#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) +#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT)) +#define DBUS_TYPE_G_MAP_OF_STRING (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)) +#define DBUS_TYPE_G_LIST_OF_STRING (dbus_g_type_get_collection ("GSList", G_TYPE_STRING)) + +#define DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_INVALID)) +#define DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ADDRESS)) +#define DBUS_TYPE_G_IP6_ROUTE (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) +#define DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ROUTE)) + +#endif /* DBUS_GLIB_TYPES_H */ + diff --git a/include/nm-glib-compat.h b/include/nm-glib-compat.h new file mode 100644 index 00000000..9c1fe347 --- /dev/null +++ b/include/nm-glib-compat.h @@ -0,0 +1,37 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * + * 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 Red Hat, Inc. + */ + +#ifndef NM_GLIB_COMPAT_H +#define NM_GLIB_COMPAT_H + +#include + +#if !GLIB_CHECK_VERSION(2,14,0) + +#define g_timeout_add_seconds(i, f, d) \ + g_timeout_add (i * G_USEC_PER_SEC, f, d) + +#define g_timeout_add_seconds_full(p, i, f, d, n) \ + g_timeout_add_full (p, i * G_USEC_PER_SEC, f, d, n) + +#endif /* !GLIB_CHECK_VERSION(2,14,0) */ + +#endif /* NM_GLIB_COMPAT_H */ diff --git a/include/nm-test-helpers.h b/include/nm-test-helpers.h new file mode 100644 index 00000000..91286b58 --- /dev/null +++ b/include/nm-test-helpers.h @@ -0,0 +1,48 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * + * 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 Red Hat, Inc. + */ + +#ifndef NM_TEST_HELPERS_H +#define NM_TEST_HELPERS_H + +#include +#include + +static void +FAIL(const char *test_name, const char *fmt, ...) +{ + va_list args; + char buf[500]; + + snprintf (buf, 500, "FAIL: (%s) %s\n", test_name, fmt); + + va_start (args, fmt); + vfprintf (stderr, buf, args); + va_end (args); + _exit (1); +} + +#define ASSERT(x, test_name, fmt, ...) \ + if (!(x)) { \ + FAIL (test_name, fmt, ## __VA_ARGS__); \ + } + +#endif /* NM_TEST_HELPERS_H */ + diff --git a/include/wireless-helper.h b/include/wireless-helper.h new file mode 100644 index 00000000..d150ef7d --- /dev/null +++ b/include/wireless-helper.h @@ -0,0 +1,32 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * + * 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 Red Hat, Inc. + */ + +/* Hacks necessary to #include wireless.h; yay for WEXT */ + +#ifndef __user +#define __user +#endif +#include +#include +#include +#include +#include + diff --git a/initscript/Arch/Makefile.am b/initscript/Arch/Makefile.am new file mode 100644 index 00000000..2c1f8b54 --- /dev/null +++ b/initscript/Arch/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = networkmanager +DISTCLEANFILES = networkmanager + +initddir = $(sysconfdir)/rc.d +initd_SCRIPTS = networkmanager diff --git a/initscript/Arch/Makefile.in b/initscript/Arch/Makefile.in new file mode 100644 index 00000000..33fa265a --- /dev/null +++ b/initscript/Arch/Makefile.in @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = initscript/Arch +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/networkmanager.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = networkmanager +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(initddir)" +SCRIPTS = $(initd_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = networkmanager +DISTCLEANFILES = networkmanager +initddir = $(sysconfdir)/rc.d +initd_SCRIPTS = networkmanager +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/Arch/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/Arch/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +networkmanager: $(top_builddir)/config.status $(srcdir)/networkmanager.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-initdSCRIPTS: $(initd_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(initddir)" || $(MKDIR_P) "$(DESTDIR)$(initddir)" + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initddir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initddir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-initdSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(initddir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(initddir)" && rm -f $$files + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(initddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-initdSCRIPTS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-initdSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-initdSCRIPTS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-initdSCRIPTS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/Arch/networkmanager b/initscript/Arch/networkmanager new file mode 100644 index 00000000..f1687681 --- /dev/null +++ b/initscript/Arch/networkmanager @@ -0,0 +1,66 @@ +#!/bin/bash + +prefix=/usr +exec_prefix=/usr +sbindir=${exec_prefix}/sbin + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +# Sanity checks. +[ -x $NETWORKMANAGER_BIN ] || exit 0 + +PID=`pidof -o %PPID $NETWORKMANAGER_BIN` +case "$1" in + start) + stat_busy "Starting NetworkManager" + if [ -z "$PID" ]; then + $NETWORKMANAGER_BIN + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon networkmanager + stat_done + fi + ;; + stop) + stat_busy "Stopping NetworkManager" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon networkmanager + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + sleep) + /usr/bin/dbus-send --system \ + --dest=org.freedesktop.NetworkManager \ + --type=method_call \ + /org/freedesktop/NetworkManager \ + org.freedesktop.NetworkManager.sleep + ;; + wake) + /usr/bin/dbus-send --system \ + --dest=org.freedesktop.NetworkManager \ + --type=method_call \ + /org/freedesktop/NetworkManager \ + org.freedesktop.NetworkManager.wake + ;; + *) + echo "usage: $0 {start|stop|restart|sleep|wake}" + ;; +esac +exit 0 + + + diff --git a/initscript/Arch/networkmanager.in b/initscript/Arch/networkmanager.in new file mode 100644 index 00000000..c3b2bfe5 --- /dev/null +++ b/initscript/Arch/networkmanager.in @@ -0,0 +1,66 @@ +#!/bin/bash + +prefix=@prefix@ +exec_prefix=@prefix@ +sbindir=@sbindir@ + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +# Sanity checks. +[ -x $NETWORKMANAGER_BIN ] || exit 0 + +PID=`pidof -o %PPID $NETWORKMANAGER_BIN` +case "$1" in + start) + stat_busy "Starting NetworkManager" + if [ -z "$PID" ]; then + $NETWORKMANAGER_BIN + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon networkmanager + stat_done + fi + ;; + stop) + stat_busy "Stopping NetworkManager" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon networkmanager + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + sleep) + /usr/bin/dbus-send --system \ + --dest=org.freedesktop.NetworkManager \ + --type=method_call \ + /org/freedesktop/NetworkManager \ + org.freedesktop.NetworkManager.sleep + ;; + wake) + /usr/bin/dbus-send --system \ + --dest=org.freedesktop.NetworkManager \ + --type=method_call \ + /org/freedesktop/NetworkManager \ + org.freedesktop.NetworkManager.wake + ;; + *) + echo "usage: $0 {start|stop|restart|sleep|wake}" + ;; +esac +exit 0 + + + diff --git a/initscript/Debian/Makefile.am b/initscript/Debian/Makefile.am new file mode 100644 index 00000000..890ed77b --- /dev/null +++ b/initscript/Debian/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = NetworkManager.in +DISTCLEANFILES = NetworkManager + +initddir = $(sysconfdir)/init.d +initd_SCRIPTS = NetworkManager diff --git a/initscript/Debian/Makefile.in b/initscript/Debian/Makefile.in new file mode 100644 index 00000000..e858baf1 --- /dev/null +++ b/initscript/Debian/Makefile.in @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = initscript/Debian +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/NetworkManager.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = NetworkManager +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(initddir)" +SCRIPTS = $(initd_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = NetworkManager.in +DISTCLEANFILES = NetworkManager +initddir = $(sysconfdir)/init.d +initd_SCRIPTS = NetworkManager +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/Debian/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/Debian/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +NetworkManager: $(top_builddir)/config.status $(srcdir)/NetworkManager.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-initdSCRIPTS: $(initd_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(initddir)" || $(MKDIR_P) "$(DESTDIR)$(initddir)" + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initddir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initddir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-initdSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(initddir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(initddir)" && rm -f $$files + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(initddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-initdSCRIPTS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-initdSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-initdSCRIPTS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-initdSCRIPTS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/Debian/NetworkManager.in b/initscript/Debian/NetworkManager.in new file mode 100755 index 00000000..9cc254ef --- /dev/null +++ b/initscript/Debian/NetworkManager.in @@ -0,0 +1,91 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: NetworkManager +# Required-Start: $remote_fs dbus hal +# Required-Stop: $remote_fs dbus hal +# Should-Start: $syslog +# Should-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: network connection manager +# Description: Daemon for automatically switching network +# connections to the best available connection. +### END INIT INFO + +set -e + +prefix=@prefix@ +exec_prefix=@prefix@ +sbindir=@sbindir@ +localstatedir=@localstatedir@ + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DESC="network connection manager" +NAME="NetworkManager" + +DAEMON=${sbindir}/$NAME + +PIDDIR=${localstatedir}/run/NetworkManager +PIDFILE=$PIDDIR/$NAME.pid + +USER=root + +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +test -f /etc/default/NetworkManager && . /etc/default/NetworkManager + +# +# Function that starts the daemon/service. +# +d_start() { + if [ ! -d $PIDDIR ]; then + mkdir -p $PIDDIR + chown $USER:$USER $PIDDIR + fi + + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --oknodo --user $USER --exec $DAEMON -- $DAEMON_OPTS --pid-file $PIDFILE + +} + +# +# Function that stops the daemon/service. +# +d_stop() { + start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE \ + --oknodo --user $USER --exec $DAEMON + +} + + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + d_start + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + d_stop + log_end_msg $? + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + d_stop + d_start + log_end_msg $? + ;; + status) + status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 + diff --git a/initscript/Gentoo/Makefile.am b/initscript/Gentoo/Makefile.am new file mode 100644 index 00000000..af023b75 --- /dev/null +++ b/initscript/Gentoo/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = NetworkManager +DISTCLEANFILES = NetworkManager + +initddir = $(sysconfdir)/init.d +initd_SCRIPTS = NetworkManager diff --git a/initscript/Gentoo/Makefile.in b/initscript/Gentoo/Makefile.in new file mode 100644 index 00000000..1688b4b8 --- /dev/null +++ b/initscript/Gentoo/Makefile.in @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = initscript/Gentoo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/NetworkManager.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = NetworkManager +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(initddir)" +SCRIPTS = $(initd_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = NetworkManager +DISTCLEANFILES = NetworkManager +initddir = $(sysconfdir)/init.d +initd_SCRIPTS = NetworkManager +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/Gentoo/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/Gentoo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +NetworkManager: $(top_builddir)/config.status $(srcdir)/NetworkManager.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-initdSCRIPTS: $(initd_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(initddir)" || $(MKDIR_P) "$(DESTDIR)$(initddir)" + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initddir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initddir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-initdSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(initddir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(initddir)" && rm -f $$files + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(initddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-initdSCRIPTS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-initdSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-initdSCRIPTS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-initdSCRIPTS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/Gentoo/NetworkManager b/initscript/Gentoo/NetworkManager new file mode 100644 index 00000000..7db410be --- /dev/null +++ b/initscript/Gentoo/NetworkManager @@ -0,0 +1,23 @@ +#!/sbin/runscript +# Copyright (c) 2008 Saleem Abdulrasool +# Distributed under the terms of the GNU General Purpose License v2 +# $Header: $ + +depend() { + need dbus +} + +start() { + ebegin "Starting NetworkManager" + start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid \ + --exec /usr/sbin/NetworkManager -- --pid-file /var/run/NetworkManager.pid + eend $? +} + +stop() { + ebegin "Stopping NetworkManager" + start-stop-daemon --stop --quiet --pidfile /var/run/NetworkManager.pid + eend $? +} + +# vim: set ft=gentoo-init-d ts=3 sw=3 et: diff --git a/initscript/Gentoo/NetworkManager.in b/initscript/Gentoo/NetworkManager.in new file mode 100755 index 00000000..7db410be --- /dev/null +++ b/initscript/Gentoo/NetworkManager.in @@ -0,0 +1,23 @@ +#!/sbin/runscript +# Copyright (c) 2008 Saleem Abdulrasool +# Distributed under the terms of the GNU General Purpose License v2 +# $Header: $ + +depend() { + need dbus +} + +start() { + ebegin "Starting NetworkManager" + start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid \ + --exec /usr/sbin/NetworkManager -- --pid-file /var/run/NetworkManager.pid + eend $? +} + +stop() { + ebegin "Stopping NetworkManager" + start-stop-daemon --stop --quiet --pidfile /var/run/NetworkManager.pid + eend $? +} + +# vim: set ft=gentoo-init-d ts=3 sw=3 et: diff --git a/initscript/Makefile.am b/initscript/Makefile.am new file mode 100644 index 00000000..4cc710eb --- /dev/null +++ b/initscript/Makefile.am @@ -0,0 +1,25 @@ +SUBDIRS = +if TARGET_REDHAT +SUBDIRS += RedHat +endif +if TARGET_GENTOO +SUBDIRS += Gentoo +endif +if TARGET_DEBIAN +SUBDIRS += Debian +endif +if TARGET_SLACKWARE +SUBDIRS += Slackware +endif +if TARGET_SUSE +SUBDIRS += SUSE +endif +if TARGET_ARCH +SUBDIRS += Arch +endif +if TARGET_PALDO +SUBDIRS += paldo +endif +if TARGET_MANDRIVA +SUBDIRS += Mandriva +endif diff --git a/initscript/Makefile.in b/initscript/Makefile.in new file mode 100644 index 00000000..3899c9e4 --- /dev/null +++ b/initscript/Makefile.in @@ -0,0 +1,630 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@TARGET_REDHAT_TRUE@am__append_1 = RedHat +@TARGET_GENTOO_TRUE@am__append_2 = Gentoo +@TARGET_DEBIAN_TRUE@am__append_3 = Debian +@TARGET_SLACKWARE_TRUE@am__append_4 = Slackware +@TARGET_SUSE_TRUE@am__append_5 = SUSE +@TARGET_ARCH_TRUE@am__append_6 = Arch +@TARGET_PALDO_TRUE@am__append_7 = paldo +@TARGET_MANDRIVA_TRUE@am__append_8 = Mandriva +subdir = initscript +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = RedHat Gentoo Debian Slackware SUSE Arch paldo Mandriva +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = $(am__append_1) $(am__append_2) $(am__append_3) \ + $(am__append_4) $(am__append_5) $(am__append_6) \ + $(am__append_7) $(am__append_8) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/Mandriva/Makefile.am b/initscript/Mandriva/Makefile.am new file mode 100644 index 00000000..0a0cc2bb --- /dev/null +++ b/initscript/Mandriva/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = networkmanager +DISTCLEANFILES = networkmanager + +initddir = $(sysconfdir)/rc.d/init.d +initd_SCRIPTS = networkmanager + diff --git a/initscript/Mandriva/Makefile.in b/initscript/Mandriva/Makefile.in new file mode 100644 index 00000000..242e8e88 --- /dev/null +++ b/initscript/Mandriva/Makefile.in @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = initscript/Mandriva +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/networkmanager.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = networkmanager +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(initddir)" +SCRIPTS = $(initd_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = networkmanager +DISTCLEANFILES = networkmanager +initddir = $(sysconfdir)/rc.d/init.d +initd_SCRIPTS = networkmanager +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/Mandriva/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/Mandriva/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +networkmanager: $(top_builddir)/config.status $(srcdir)/networkmanager.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-initdSCRIPTS: $(initd_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(initddir)" || $(MKDIR_P) "$(DESTDIR)$(initddir)" + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initddir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initddir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-initdSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(initddir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(initddir)" && rm -f $$files + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(initddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-initdSCRIPTS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-initdSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-initdSCRIPTS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-initdSCRIPTS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/Mandriva/networkmanager b/initscript/Mandriva/networkmanager new file mode 100644 index 00000000..bb65dc76 --- /dev/null +++ b/initscript/Mandriva/networkmanager @@ -0,0 +1,106 @@ +#!/bin/sh +# +# NetworkManager: NetworkManager daemon +# +# chkconfig: - 98 02 +# description: This is a daemon for automatically switching network \ +# connections to the best available connection. +# +# processname: NetworkManager +# pidfile: /var/run/NetworkManager/NetworkManager.pid +# +### BEGIN INIT INFO +# Provides: networkmanager +# Required-Start: $network +# Required-Stop: $network +# Default-Start: 3 4 5 +# Short-Description: Daemon for automatically switching to best network connection. +# Description: This is a daemon for automatically switching network +# connections to the best available connection. +### END INIT INFO + +prefix=/usr +exec_prefix=/usr +sbindir=${exec_prefix}/sbin + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +# Sanity checks. +[ -x $NETWORKMANAGER_BIN ] || exit 1 + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source network configuration +. /etc/sysconfig/network + +# so we can rearrange this easily +processname=NetworkManager +servicename=NetworkManager +pidfile=/var/run/NetworkManager/NetworkManager.pid + +RETVAL=0 + +start() +{ + echo $"Setting network parameters... " + sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + + if [ ! -e /var/lock/subsys/named ]; then + service named start >/dev/null 2>&1 + fi + + echo -n $"Starting NetworkManager daemon: " + daemon --check $servicename $processname --pid-file=$pidfile + RETVAL=$? + echo + if [ -n "${NETWORKWAIT}" ]; then + [ -z "${LINKDELAY}" ] && LINKDELAY=10 + echo -n $"Waiting for network..." + nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 + [ "$?" = "0" ] && success "network startup" || failure "network startup" + echo + [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} + fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename +} + +stop() +{ + echo -n $"Stopping NetworkManager daemon: " + killproc -p $pidfile $servicename + RETVAL=$? + echo + if [ $RETVAL -eq 0 ]; then + rm -f /var/lock/subsys/$servicename + rm -f $pidfile + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status -p $pidfile $processname + RETVAL=$? + ;; + restart) + stop + start + ;; + condrestart) + if [ -f /var/lock/subsys/$servicename ]; then + stop + start + fi + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart}" + ;; +esac +exit $RETVAL diff --git a/initscript/Mandriva/networkmanager.in b/initscript/Mandriva/networkmanager.in new file mode 100644 index 00000000..dac14e72 --- /dev/null +++ b/initscript/Mandriva/networkmanager.in @@ -0,0 +1,106 @@ +#!/bin/sh +# +# NetworkManager: NetworkManager daemon +# +# chkconfig: - 98 02 +# description: This is a daemon for automatically switching network \ +# connections to the best available connection. +# +# processname: NetworkManager +# pidfile: /var/run/NetworkManager/NetworkManager.pid +# +### BEGIN INIT INFO +# Provides: networkmanager +# Required-Start: $network +# Required-Stop: $network +# Default-Start: 3 4 5 +# Short-Description: Daemon for automatically switching to best network connection. +# Description: This is a daemon for automatically switching network +# connections to the best available connection. +### END INIT INFO + +prefix=@prefix@ +exec_prefix=@prefix@ +sbindir=@sbindir@ + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +# Sanity checks. +[ -x $NETWORKMANAGER_BIN ] || exit 1 + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source network configuration +. /etc/sysconfig/network + +# so we can rearrange this easily +processname=NetworkManager +servicename=NetworkManager +pidfile=/var/run/NetworkManager/NetworkManager.pid + +RETVAL=0 + +start() +{ + echo $"Setting network parameters... " + sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + + if [ ! -e /var/lock/subsys/named ]; then + service named start >/dev/null 2>&1 + fi + + echo -n $"Starting NetworkManager daemon: " + daemon --check $servicename $processname --pid-file=$pidfile + RETVAL=$? + echo + if [ -n "${NETWORKWAIT}" ]; then + [ -z "${LINKDELAY}" ] && LINKDELAY=10 + echo -n $"Waiting for network..." + nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 + [ "$?" = "0" ] && success "network startup" || failure "network startup" + echo + [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} + fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename +} + +stop() +{ + echo -n $"Stopping NetworkManager daemon: " + killproc -p $pidfile $servicename + RETVAL=$? + echo + if [ $RETVAL -eq 0 ]; then + rm -f /var/lock/subsys/$servicename + rm -f $pidfile + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status -p $pidfile $processname + RETVAL=$? + ;; + restart) + stop + start + ;; + condrestart) + if [ -f /var/lock/subsys/$servicename ]; then + stop + start + fi + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart}" + ;; +esac +exit $RETVAL diff --git a/initscript/RedHat/Makefile.am b/initscript/RedHat/Makefile.am new file mode 100644 index 00000000..3f7b876b --- /dev/null +++ b/initscript/RedHat/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = NetworkManager +DISTCLEANFILES = NetworkManager + +initddir = $(sysconfdir)/rc.d/init.d +initd_SCRIPTS = NetworkManager + diff --git a/initscript/RedHat/Makefile.in b/initscript/RedHat/Makefile.in new file mode 100644 index 00000000..e7381d0b --- /dev/null +++ b/initscript/RedHat/Makefile.in @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = initscript/RedHat +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/NetworkManager.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = NetworkManager +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(initddir)" +SCRIPTS = $(initd_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = NetworkManager +DISTCLEANFILES = NetworkManager +initddir = $(sysconfdir)/rc.d/init.d +initd_SCRIPTS = NetworkManager +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/RedHat/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/RedHat/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +NetworkManager: $(top_builddir)/config.status $(srcdir)/NetworkManager.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-initdSCRIPTS: $(initd_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(initddir)" || $(MKDIR_P) "$(DESTDIR)$(initddir)" + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initddir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initddir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-initdSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(initddir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(initddir)" && rm -f $$files + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(initddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-initdSCRIPTS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-initdSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-initdSCRIPTS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-initdSCRIPTS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/RedHat/NetworkManager b/initscript/RedHat/NetworkManager new file mode 100644 index 00000000..465c7611 --- /dev/null +++ b/initscript/RedHat/NetworkManager @@ -0,0 +1,104 @@ +#!/bin/sh +# +# NetworkManager: NetworkManager daemon +# +# chkconfig: - 23 84 +# description: This is a daemon for automatically switching network \ +# connections to the best available connection. +# +# processname: NetworkManager +# pidfile: /var/run/NetworkManager/NetworkManager.pid +# +### BEGIN INIT INFO +# Provides: network_manager $network +# Required-Start: messagebus +# Required-Stop: messagebus +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop NetworkManager +# Description: NetworkManager is a tool for easily managing network connections +### END INIT INFO + +prefix=/usr +exec_prefix=/usr +sbindir=${exec_prefix}/sbin + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +# Sanity checks. +[ -x $NETWORKMANAGER_BIN ] || exit 1 + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source network configuration +. /etc/sysconfig/network + +# so we can rearrange this easily +processname=NetworkManager +servicename=NetworkManager +pidfile=/var/run/NetworkManager/NetworkManager.pid + +RETVAL=0 + +start() +{ + echo -n $"Setting network parameters... " + sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + success + echo + + echo -n $"Starting NetworkManager daemon: " + daemon --pidfile $pidfile --check $servicename $processname --pid-file=$pidfile + RETVAL=$? + echo + if [ -n "${NETWORKWAIT}" ]; then + [ -z "${LINKDELAY}" ] && LINKDELAY=10 + echo -n $"Waiting for network..." + nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 + [ "$?" = "0" ] && success "network startup" || failure "network startup" + echo + [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} + fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename +} + +stop() +{ + echo -n $"Stopping NetworkManager daemon: " + killproc -p $pidfile $servicename + RETVAL=$? + echo + if [ $RETVAL -eq 0 ]; then + rm -f /var/lock/subsys/$servicename + rm -f $pidfile + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status -p $pidfile $processname + RETVAL=$? + ;; + restart) + stop + start + ;; + condrestart) + if [ -f /var/lock/subsys/$servicename ]; then + stop + start + fi + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart}" + ;; +esac +exit $RETVAL diff --git a/initscript/RedHat/NetworkManager.in b/initscript/RedHat/NetworkManager.in new file mode 100755 index 00000000..e26e59ed --- /dev/null +++ b/initscript/RedHat/NetworkManager.in @@ -0,0 +1,104 @@ +#!/bin/sh +# +# NetworkManager: NetworkManager daemon +# +# chkconfig: - 23 84 +# description: This is a daemon for automatically switching network \ +# connections to the best available connection. +# +# processname: NetworkManager +# pidfile: /var/run/NetworkManager/NetworkManager.pid +# +### BEGIN INIT INFO +# Provides: network_manager $network +# Required-Start: messagebus +# Required-Stop: messagebus +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop NetworkManager +# Description: NetworkManager is a tool for easily managing network connections +### END INIT INFO + +prefix=@prefix@ +exec_prefix=@prefix@ +sbindir=@sbindir@ + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +# Sanity checks. +[ -x $NETWORKMANAGER_BIN ] || exit 1 + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source network configuration +. /etc/sysconfig/network + +# so we can rearrange this easily +processname=NetworkManager +servicename=NetworkManager +pidfile=/var/run/NetworkManager/NetworkManager.pid + +RETVAL=0 + +start() +{ + echo -n $"Setting network parameters... " + sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + success + echo + + echo -n $"Starting NetworkManager daemon: " + daemon --pidfile $pidfile --check $servicename $processname --pid-file=$pidfile + RETVAL=$? + echo + if [ -n "${NETWORKWAIT}" ]; then + [ -z "${LINKDELAY}" ] && LINKDELAY=10 + echo -n $"Waiting for network..." + nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 + [ "$?" = "0" ] && success "network startup" || failure "network startup" + echo + [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} + fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename +} + +stop() +{ + echo -n $"Stopping NetworkManager daemon: " + killproc -p $pidfile $servicename + RETVAL=$? + echo + if [ $RETVAL -eq 0 ]; then + rm -f /var/lock/subsys/$servicename + rm -f $pidfile + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status -p $pidfile $processname + RETVAL=$? + ;; + restart) + stop + start + ;; + condrestart) + if [ -f /var/lock/subsys/$servicename ]; then + stop + start + fi + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart}" + ;; +esac +exit $RETVAL diff --git a/initscript/SUSE/Makefile.am b/initscript/SUSE/Makefile.am new file mode 100644 index 00000000..75a7c2ac --- /dev/null +++ b/initscript/SUSE/Makefile.am @@ -0,0 +1,8 @@ +EXTRA_DIST = networkmanager.in +DISTCLEANFILES = networkmanager + +# Nowadays, NetworkManager support is built-in to the SUSE networking +# subsystem, therefore a SUSE machine does not want these scripts. Uncomment +# this if you actually want external initscripts, such as SUSE 10.0 or earlier. +#initddir = $(sysconfdir)/init.d +#initd_SCRIPTS = networkmanager diff --git a/initscript/SUSE/Makefile.in b/initscript/SUSE/Makefile.in new file mode 100644 index 00000000..75d81b7c --- /dev/null +++ b/initscript/SUSE/Makefile.in @@ -0,0 +1,429 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = initscript/SUSE +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/networkmanager.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = networkmanager +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = networkmanager.in +DISTCLEANFILES = networkmanager +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/SUSE/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/SUSE/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +networkmanager: $(top_builddir)/config.status $(srcdir)/networkmanager.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Nowadays, NetworkManager support is built-in to the SUSE networking +# subsystem, therefore a SUSE machine does not want these scripts. Uncomment +# this if you actually want external initscripts, such as SUSE 10.0 or earlier. +#initddir = $(sysconfdir)/init.d +#initd_SCRIPTS = networkmanager + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/SUSE/networkmanager.in b/initscript/SUSE/networkmanager.in new file mode 100644 index 00000000..df2cd24a --- /dev/null +++ b/initscript/SUSE/networkmanager.in @@ -0,0 +1,51 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: networkmanager +# Required-Start: dbus haldaemon +# Default-Start: 3 5 +# Default-Stop: +# Description: NetworkManager, a network and wireless connection manager +### END INIT INFO + +sbindir=@sbindir@ + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager +test -x $NETWORKMANAGER_BIN || exit 5 + +. /etc/rc.status +rc_reset + +case "$1" in + start) + checkproc $NETWORKMANAGER_BIN + if [ $? = 0 ]; then + echo -n "NetworkManager already running" + rc_status -v + rc_exit + fi + echo -n "Starting the NetworkManager" + startproc $NETWORKMANAGER_BIN + rc_status -v + ;; + stop) + echo -n "Shutting down the NetworkManager" + killproc -TERM $NETWORKMANAGER_BIN + rc_status -v + ;; + restart) + $0 stop + $0 start + rc_status + ;; + status) + echo -n "Checking for the NetworkManager: " + checkproc $NETWORKMANAGER_BIN + rc_status -v + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 + ;; +esac + diff --git a/initscript/Slackware/Makefile.am b/initscript/Slackware/Makefile.am new file mode 100644 index 00000000..ded3ee09 --- /dev/null +++ b/initscript/Slackware/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = rc.networkmanager +DISTCLEANFILES = rc.networkmanager + +initddir = $(sysconfdir)/rc.d +initd_SCRIPTS = rc.networkmanager + diff --git a/initscript/Slackware/Makefile.in b/initscript/Slackware/Makefile.in new file mode 100644 index 00000000..db4b3982 --- /dev/null +++ b/initscript/Slackware/Makefile.in @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = initscript/Slackware +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/rc.networkmanager.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = rc.networkmanager +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(initddir)" +SCRIPTS = $(initd_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = rc.networkmanager +DISTCLEANFILES = rc.networkmanager +initddir = $(sysconfdir)/rc.d +initd_SCRIPTS = rc.networkmanager +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/Slackware/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/Slackware/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +rc.networkmanager: $(top_builddir)/config.status $(srcdir)/rc.networkmanager.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-initdSCRIPTS: $(initd_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(initddir)" || $(MKDIR_P) "$(DESTDIR)$(initddir)" + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initddir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initddir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-initdSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(initddir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(initddir)" && rm -f $$files + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(initddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-initdSCRIPTS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-initdSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-initdSCRIPTS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-initdSCRIPTS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/Slackware/rc.networkmanager b/initscript/Slackware/rc.networkmanager new file mode 100644 index 00000000..87df6ff1 --- /dev/null +++ b/initscript/Slackware/rc.networkmanager @@ -0,0 +1,96 @@ +#!/bin/sh +# +# NetworkManager: NetworkManager daemon +# +# description: This is a daemon for automatically switching network \ +# connections to the best available connection. \ +# +# processname: NetworkManager +# pidfile: /var/run/NetworkManager.pid +# + +prefix=/usr +exec_prefix=/usr +sbindir=${exec_prefix}/sbin + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +# Sanity checks. +[ -x $NETWORKMANAGER_BIN ] || exit 0 + +PIDFILE=/var/run/NetworkManager.pid + +nm_start() +{ + if [ "`pgrep dbus-daemon`" = "" ]; then + echo "D-BUS must be running to start NetworkManager" + return + fi + + if [ "`pgrep hald`" = "" ]; then + echo "HAL must be running to start NetworkManager" + return + fi + + # Just in case the pidfile is still there, we may need to nuke it. + if [ -e "$PIDFILE" ]; then + rm -f $PIDFILE + fi + + echo "Starting NetworkManager daemon: $NETWORKMANAGER_BIN" + $NETWORKMANAGER_BIN +} + +nm_status() +{ + local pidlist=`cat $PIDFILE 2>/dev/null` + if [ -z "$pidlist" ]; then + return 1 + fi + local command=`ps -p $pidlist -o comm=` + if [ "$command" != 'NetworkManager' ]; then + return 1 + fi +} + +nm_stop() +{ + echo -en "Stopping NetworkManager: " + local pidlist=`cat $PIDFILE 2>/dev/null` + if [ ! -z "$pidlist" ]; then + kill $pidlist &>/dev/null + rm -f $PIDFILE &>/dev/null + fi + echo "stopped"; +} + +nm_restart() +{ + nm_stop + nm_start +} + +case "$1" in +'start') + if ( ! nm_status ); then + nm_start + else + echo "NetworkManager is already running (will not start it twice)." + fi + ;; +'stop') + nm_stop + ;; +'restart') + nm_restart + ;; +'status') + if ( nm_status ); then + echo "NetworkManager is currently running" + else + echo "NetworkManager is not running." + fi + ;; +*) + echo "usage $0 start|stop|status|restart" +esac diff --git a/initscript/Slackware/rc.networkmanager.in b/initscript/Slackware/rc.networkmanager.in new file mode 100644 index 00000000..04890384 --- /dev/null +++ b/initscript/Slackware/rc.networkmanager.in @@ -0,0 +1,96 @@ +#!/bin/sh +# +# NetworkManager: NetworkManager daemon +# +# description: This is a daemon for automatically switching network \ +# connections to the best available connection. \ +# +# processname: NetworkManager +# pidfile: /var/run/NetworkManager.pid +# + +prefix=@prefix@ +exec_prefix=@prefix@ +sbindir=@sbindir@ + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +# Sanity checks. +[ -x $NETWORKMANAGER_BIN ] || exit 0 + +PIDFILE=/var/run/NetworkManager.pid + +nm_start() +{ + if [ "`pgrep dbus-daemon`" = "" ]; then + echo "D-BUS must be running to start NetworkManager" + return + fi + + if [ "`pgrep hald`" = "" ]; then + echo "HAL must be running to start NetworkManager" + return + fi + + # Just in case the pidfile is still there, we may need to nuke it. + if [ -e "$PIDFILE" ]; then + rm -f $PIDFILE + fi + + echo "Starting NetworkManager daemon: $NETWORKMANAGER_BIN" + $NETWORKMANAGER_BIN +} + +nm_status() +{ + local pidlist=`cat $PIDFILE 2>/dev/null` + if [ -z "$pidlist" ]; then + return 1 + fi + local command=`ps -p $pidlist -o comm=` + if [ "$command" != 'NetworkManager' ]; then + return 1 + fi +} + +nm_stop() +{ + echo -en "Stopping NetworkManager: " + local pidlist=`cat $PIDFILE 2>/dev/null` + if [ ! -z "$pidlist" ]; then + kill $pidlist &>/dev/null + rm -f $PIDFILE &>/dev/null + fi + echo "stopped"; +} + +nm_restart() +{ + nm_stop + nm_start +} + +case "$1" in +'start') + if ( ! nm_status ); then + nm_start + else + echo "NetworkManager is already running (will not start it twice)." + fi + ;; +'stop') + nm_stop + ;; +'restart') + nm_restart + ;; +'status') + if ( nm_status ); then + echo "NetworkManager is currently running" + else + echo "NetworkManager is not running." + fi + ;; +*) + echo "usage $0 start|stop|status|restart" +esac diff --git a/initscript/paldo/Makefile.am b/initscript/paldo/Makefile.am new file mode 100644 index 00000000..3d67ff6e --- /dev/null +++ b/initscript/paldo/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = NetworkManager +DISTCLEANFILES = NetworkManager + +initddir = $(sysconfdir)/init.d +initd_SCRIPTS = NetworkManager + diff --git a/initscript/paldo/Makefile.in b/initscript/paldo/Makefile.in new file mode 100644 index 00000000..ac9cc171 --- /dev/null +++ b/initscript/paldo/Makefile.in @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = initscript/paldo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/NetworkManager.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = NetworkManager +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(initddir)" +SCRIPTS = $(initd_SCRIPTS) +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = NetworkManager +DISTCLEANFILES = NetworkManager +initddir = $(sysconfdir)/init.d +initd_SCRIPTS = NetworkManager +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu initscript/paldo/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu initscript/paldo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +NetworkManager: $(top_builddir)/config.status $(srcdir)/NetworkManager.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-initdSCRIPTS: $(initd_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(initddir)" || $(MKDIR_P) "$(DESTDIR)$(initddir)" + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(initddir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(initddir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-initdSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(initd_SCRIPTS)'; test -n "$(initddir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(initddir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(initddir)" && rm -f $$files + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(initddir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-initdSCRIPTS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-initdSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-initdSCRIPTS install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-initdSCRIPTS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/initscript/paldo/NetworkManager b/initscript/paldo/NetworkManager new file mode 100644 index 00000000..fe66d80b --- /dev/null +++ b/initscript/paldo/NetworkManager @@ -0,0 +1,56 @@ +#!/bin/bash +### BEGIN INIT INFO +# Provides: NetworkManager +# Required-Start: $network dbus +# Required-Stop: $network dbus +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +### END INIT INFO +. /lib/lsb/init-functions + +[ -e /etc/default/NetworkManager ] && source /etc/default/NetworkManager +[ $(/usr/bin/tty -s; echo $?) -gt 0 -o "$(/usr/bin/tty)" == "/dev/console" ] && [ "$START_NETWORK_MANAGER" != "TRUE" ] && exit 0 + +prefix=/usr +exec_prefix=/usr +sbindir=${exec_prefix}/sbin + +case "$1" in + start) + echo -n "Starting NetworkManager..." + if start_daemon $sbindir/NetworkManager + then + log_success_msg + else + log_failure_msg + fi + ;; + stop) + echo -n "Stopping NetworkManager..." + if killproc $sbindir/NetworkManager + then + log_success_msg "." + else + log_failure_msg + fi + ;; + restart|force-reload) + $0 stop + sleep 1 + $0 start + ;; + try-restart) + if pidofproc $sbindir/NetworkManager + then + $0 restart + fi + ;; + status) + pidofproc $sbindir/NetworkManager + exit $? + ;; + *) + echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" + exit 1 + ;; +esac diff --git a/initscript/paldo/NetworkManager.in b/initscript/paldo/NetworkManager.in new file mode 100644 index 00000000..144b237a --- /dev/null +++ b/initscript/paldo/NetworkManager.in @@ -0,0 +1,56 @@ +#!/bin/bash +### BEGIN INIT INFO +# Provides: NetworkManager +# Required-Start: $network dbus +# Required-Stop: $network dbus +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +### END INIT INFO +. /lib/lsb/init-functions + +[ -e /etc/default/NetworkManager ] && source /etc/default/NetworkManager +[ $(/usr/bin/tty -s; echo $?) -gt 0 -o "$(/usr/bin/tty)" == "/dev/console" ] && [ "$START_NETWORK_MANAGER" != "TRUE" ] && exit 0 + +prefix=@prefix@ +exec_prefix=@prefix@ +sbindir=@sbindir@ + +case "$1" in + start) + echo -n "Starting NetworkManager..." + if start_daemon $sbindir/NetworkManager + then + log_success_msg + else + log_failure_msg + fi + ;; + stop) + echo -n "Stopping NetworkManager..." + if killproc $sbindir/NetworkManager + then + log_success_msg "." + else + log_failure_msg + fi + ;; + restart|force-reload) + $0 stop + sleep 1 + $0 start + ;; + try-restart) + if pidofproc $sbindir/NetworkManager + then + $0 restart + fi + ;; + status) + pidofproc $sbindir/NetworkManager + exit $? + ;; + *) + echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" + exit 1 + ;; +esac diff --git a/install-sh b/install-sh new file mode 100755 index 00000000..6781b987 --- /dev/null +++ b/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/intltool-extract.in b/intltool-extract.in new file mode 100644 index 00000000..e69de29b diff --git a/intltool-merge.in b/intltool-merge.in new file mode 100644 index 00000000..e69de29b diff --git a/intltool-update.in b/intltool-update.in new file mode 100644 index 00000000..e69de29b diff --git a/introspection/Makefile.am b/introspection/Makefile.am new file mode 100644 index 00000000..212da3ab --- /dev/null +++ b/introspection/Makefile.am @@ -0,0 +1,28 @@ +EXTRA_DIST = \ + all.xml \ + generic-types.xml \ + errors.xml \ + vpn-errors.xml \ + nm-access-point.xml \ + nm-device-bt.xml \ + nm-device-wifi.xml \ + nm-device-olpc-mesh.xml \ + nm-device-ethernet.xml \ + nm-device-cdma.xml \ + nm-device-gsm.xml \ + nm-device-serial.xml \ + nm-device.xml \ + nm-ip4-config.xml \ + nm-ip6-config.xml \ + nm-manager.xml \ + nm-manager-client.xml \ + nm-settings.xml \ + nm-settings-system.xml \ + nm-exported-connection.xml \ + nm-vpn-plugin.xml \ + nm-vpn-connection.xml \ + nm-ppp-manager.xml \ + nm-active-connection.xml \ + nm-dhcp4-config.xml \ + nm-dhcp6-config.xml + diff --git a/introspection/Makefile.in b/introspection/Makefile.in new file mode 100644 index 00000000..e99bc4a0 --- /dev/null +++ b/introspection/Makefile.in @@ -0,0 +1,445 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = introspection +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + all.xml \ + generic-types.xml \ + errors.xml \ + vpn-errors.xml \ + nm-access-point.xml \ + nm-device-bt.xml \ + nm-device-wifi.xml \ + nm-device-olpc-mesh.xml \ + nm-device-ethernet.xml \ + nm-device-cdma.xml \ + nm-device-gsm.xml \ + nm-device-serial.xml \ + nm-device.xml \ + nm-ip4-config.xml \ + nm-ip6-config.xml \ + nm-manager.xml \ + nm-manager-client.xml \ + nm-settings.xml \ + nm-settings-system.xml \ + nm-exported-connection.xml \ + nm-vpn-plugin.xml \ + nm-vpn-connection.xml \ + nm-ppp-manager.xml \ + nm-active-connection.xml \ + nm-dhcp4-config.xml \ + nm-dhcp6-config.xml + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu introspection/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu introspection/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/introspection/all.xml b/introspection/all.xml new file mode 100644 index 00000000..d6b2f236 --- /dev/null +++ b/introspection/all.xml @@ -0,0 +1,60 @@ + + +NetworkManager D-Bus Interface Specification +0.8 + + +Copyright (C) 2008 - 2009 Red Hat, Inc. +Copyright (C) 2008 - 2009 Novell, Inc. + + +

This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(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 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.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/introspection/errors.xml b/introspection/errors.xml new file mode 100644 index 00000000..444b325d --- /dev/null +++ b/introspection/errors.xml @@ -0,0 +1,36 @@ + + + Copyright (C) 2008 Novell, Inc. + + + + Connection was not provided by any known settings service. + + + + + + Unknown device. + + + + + + Invalid settings service (not a recognized system or user settings service name). + + + + + + Connection was superseded by a system connection. + + + + + + User does not have the permission to activate this connection. + + + + diff --git a/introspection/generic-types.xml b/introspection/generic-types.xml new file mode 100644 index 00000000..1a9e3169 --- /dev/null +++ b/introspection/generic-types.xml @@ -0,0 +1,35 @@ + + + A mapping from strings to variants representing extra + key-value pairs. + + + + + + A mapping from strings to strings representing extra + key-value pairs. + + + + + + A mapping from strings to a map of string to variant. + + + + + + + + Mode is unknown. + + + Uncoordinated network without central infrastructure. + + + Coordinated network with one or more central controllers. + + + diff --git a/introspection/nm-access-point.xml b/introspection/nm-access-point.xml new file mode 100644 index 00000000..21f238ff --- /dev/null +++ b/introspection/nm-access-point.xml @@ -0,0 +1,92 @@ + + + + + + Flags describing the capabilities of the access point. + + + Flags describing the access point's capabilities according to WPA (Wifi Protected Access). + + + Flags describing the access point's capabilities according to the RSN (Robust Secure Network) protocol. + + + The Service Set Identifier identifying the access point. + + + The radio channel frequency in use by the access point, in MHz. + + + The hardware address (BSSID) of the access point. + + + + Describes the operating mode of the access point. + + + The maximum bitrate this access point is capable of, in kilobits/second (Kb/s). + + + The current signal quality of the access point, in percent. + + + + + + A dictionary mapping property names to variant boxed values + + + + + + Flags describing the general capabilities of the access point. + + + Null capability - says nothing about the access point. + + + Access point supports privacy measures. + + + + + Flags describing the security capabilities of the access point. + + + Null flag. + + + Access point supports pairwise 40-bit WEP encryption. + + + Access point supports pairwise 104-bit WEP encryption. + + + Access point supports pairwise TKIP encryption. + + + Access point supports pairwise CCMP encryption. + + + Access point supports a group 40-bit WEP cipher. + + + Access point supports a group 104-bit WEP cipher. + + + Access point supports a group TKIP cipher. + + + Access point supports a group CCMP cipher. + + + Access point supports PSK key management. + + + Access point supports 802.1x key management. + + + + + diff --git a/introspection/nm-active-connection.xml b/introspection/nm-active-connection.xml new file mode 100644 index 00000000..765830a1 --- /dev/null +++ b/introspection/nm-active-connection.xml @@ -0,0 +1,57 @@ + + + + + + The D-Bus service name providing this connection. + + + The path of the connection. + + + A specific object associated with the active connection. + + + Array of object paths representing devices which are part of this active connection. + + + The state of this active connection. + + + Whether this active connection is the default IPv4 connection, i.e. whether it currently owns the default IPv4 route. + + + Whether this active connection is the default IPv6 connection, i.e. whether it currently owns the default IPv6 route. + + + Whether this active connection is also a VPN connection. + + + + + + A dictionary mapping property names to variant boxed values + + + + + + + + The active connection is in an unknown state. + + + + + The connection is activating. + + + + + The connection is activated. + + + + + + diff --git a/introspection/nm-device-bt.xml b/introspection/nm-device-bt.xml new file mode 100644 index 00000000..cc4a9b54 --- /dev/null +++ b/introspection/nm-device-bt.xml @@ -0,0 +1,48 @@ + + + + + + + + Bluetooth hardware address of the device. + + + + + + Bluetooth name of the device. + + + + + + Bluetooth capabilities of the device (either DUN or NAP). + + + + + + + A dictionary mapping property names to variant boxed values + + + + + + + Flags describing the capabilities of a Bluetooth device. + + + The device has no recognized capabilities. + + + The device supports Bluetooth Dial-Up Networking. + + + The device supports Bluetooth Personal Area Networking. + + + + + diff --git a/introspection/nm-device-cdma.xml b/introspection/nm-device-cdma.xml new file mode 100644 index 00000000..2b43f8fd --- /dev/null +++ b/introspection/nm-device-cdma.xml @@ -0,0 +1,15 @@ + + + + + + + + + A dictionary mapping property names to variant boxed values + + + + + + diff --git a/introspection/nm-device-ethernet.xml b/introspection/nm-device-ethernet.xml new file mode 100644 index 00000000..5b7c88eb --- /dev/null +++ b/introspection/nm-device-ethernet.xml @@ -0,0 +1,33 @@ + + + + + + + + Hardware address of the device. + + + + + + Design speed of the device, in megabits/second (Mb/s). + + + + + + Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not). + + + + + + + A dictionary mapping property names to variant boxed values + + + + + + diff --git a/introspection/nm-device-gsm.xml b/introspection/nm-device-gsm.xml new file mode 100644 index 00000000..650d656a --- /dev/null +++ b/introspection/nm-device-gsm.xml @@ -0,0 +1,15 @@ + + + + + + + + + A dictionary mapping property names to variant boxed values + + + + + + diff --git a/introspection/nm-device-olpc-mesh.xml b/introspection/nm-device-olpc-mesh.xml new file mode 100644 index 00000000..c30ecfc6 --- /dev/null +++ b/introspection/nm-device-olpc-mesh.xml @@ -0,0 +1,34 @@ + + + + + + + The hardware address of the device. + + + + + + The object path of the companion device. + + + + + + The currently active channel. + + + + + + + A dictionary containing the FIXME: check changed parameters. + + + + Emitted when the wireless device's properties changed. + + + + diff --git a/introspection/nm-device-serial.xml b/introspection/nm-device-serial.xml new file mode 100644 index 00000000..13b08537 --- /dev/null +++ b/introspection/nm-device-serial.xml @@ -0,0 +1,20 @@ + + + + + + + + + Bytes received + + + + + Bytes sent + + + + + + diff --git a/introspection/nm-device-wifi.xml b/introspection/nm-device-wifi.xml new file mode 100644 index 00000000..21ace0a4 --- /dev/null +++ b/introspection/nm-device-wifi.xml @@ -0,0 +1,104 @@ + + + + + + + + + List of access point object paths + + + + Get the list of access points visible to this device. + + + + + + The hardware address of the device. + + + + + The operating mode of the wireless device. + + + + + + The bit rate currently used by the wireless device, in kilobits/second (Kb/s). + + + + + Object path of the access point currently used by the wireless device. + + + + + The capabilities of the wireless device. + + + + + + + A dictionary containing the FIXME: check changed parameters. + + + + Emitted when the wireless device's properties changed. + + + + + + + The object path of the newly found access point. + + + + Emitted when a new access point is found by the device. + + + + + + + The object path of the access point that has disappeared. + + + + Emitted when an access point disappears from view of the device. + + + + + + Flags describing the capabilities of a wireless device. + + + Null capability - syntactic sugar for no capabilities supported. Do not AND this with other capabilities! + + + The device supports the 40-bit WEP cipher. + + + The device supports the 104-bit WEP cipher. + + + The device supports the TKIP cipher. + + + The device supports the CCMP cipher. + + + The device supports the WPA encryption/authentication protocol. + + + The device supports the RSN encryption/authentication protocol. + + + + diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml new file mode 100644 index 00000000..0d0a9508 --- /dev/null +++ b/introspection/nm-device.xml @@ -0,0 +1,408 @@ + + + + + + + Unique Device Identifier. + + + + + The network interface offered by the device. + + + + + The driver handling the device. + + + + + Flags describing the capabilities of the device. + + + + + The IPv4 address bound to the device. FIXME: what about devices with >1 IP address? + + + + + The current state of the device. + + + + + Object path of the Ip4Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. + + + + + Object path of the Dhcp4Config object describing the DHCP options returned by the DHCP server. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. + + + + + Object path of the Ip6Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state. + + + + + Whether or not this device is managed by NetworkManager. + + + + + The general type of the network device; ie Ethernet, WiFi, etc. + + + + + + Disconnects a device and prevents the device from automatically activating further connections without user intervention. + + + + + + + + The new state of the device. + + + + + The previous state of the device. + + + + + A reason for the state transition. + + + + + + + + The device is in an unknown state. + + + + + The device is not managed by NetworkManager. + + + + + The device cannot be used (carrier off, rfkill, etc). + + + + + The device is not connected. + + + + + The device is preparing to connect. + + + + + The device is being configured. + + + + + The device is awaiting secrets necessary to continue connection. + + + + + The IP settings of the device are being requested and configured. + + + + + The device is active. + + + + + The device is in a failure state following an attempt to activate it. + + + + + + + + The device type is unknown. + + + + + The device is wired Ethernet device. + + + + + The device is an 802.11 WiFi device. + + + + + The device is a GSM-based cellular WAN device. + + + + + The device is a CDMA/IS-95-based cellular WAN device. + + + + + + + Null capability. + + + The device is supported by NetworkManager. + + + The device supports carrier detection. + + + + + + + The reason for the device state change is unknown. + + + + + The state change is normal. + + + + + The device is now managed. + + + + + The device is no longer managed. + + + + + The device could not be readied for configuration. + + + + + IP configuration could not be reserved (no available address, timeout, etc). + + + + + The IP configuration is no longer valid. + + + + + Secrets were required, but not provided. + + + + + The 802.1X supplicant disconnected from the access point or authentication server. + + + + + Configuration of the 802.1X supplicant failed. + + + + + The 802.1X supplicant quit or failed unexpectedly. + + + + + The 802.1X supplicant took too long to authenticate. + + + + + The PPP service failed to start within the allowed time. + + + + + The PPP service disconnected unexpectedly. + + + + + The PPP service quit or failed unexpectedly. + + + + + The DHCP service failed to start within the allowed time. + + + + + The DHCP service reported an unexpected error. + + + + + The DHCP service quit or failed unexpectedly. + + + + + The shared connection service failed to start. + + + + + The shared connection service quit or failed unexpectedly. + + + + + The AutoIP service failed to start. + + + + + The AutoIP service reported an unexpected error. + + + + + The AutoIP service quit or failed unexpectedly. + + + + + Dialing failed because the line was busy. + + + + + Dialing failed because there was no dial tone. + + + + + Dialing failed because there was carrier. + + + + + Dialing timed out. + + + + + Dialing failed. + + + + + Modem initialization failed. + + + + + Failed to select the specified GSM APN. + + + + + Not searching for networks. + + + + + Network registration was denied. + + + + + Network registration timed out. + + + + + Failed to register with the requested GSM network. + + + + + PIN check failed. + + + + + Necessary firmware for the device may be missing. + + + + + The device was removed. + + + + + NetworkManager went to sleep. + + + + + The device's active connection was removed or disappeared. + + + + + A user or client requested the disconnection. + + + + + The device's carrier/link changed. + + + + + The device's existing connection was assumed. + + + + + The 802.1x supplicant is now available. + + + + + The modem could not be found. + + + + + The Bluetooth connection timed out or failed. + + + + + + diff --git a/introspection/nm-dhcp4-config.xml b/introspection/nm-dhcp4-config.xml new file mode 100644 index 00000000..c0821ada --- /dev/null +++ b/introspection/nm-dhcp4-config.xml @@ -0,0 +1,20 @@ + + + + + + Options and configuration returned by the IPv4 DHCP server. + + + Configuration options returned by a DHCP server, if any. + + + + + + A dictionary mapping property names to variant boxed values + + + + + diff --git a/introspection/nm-dhcp6-config.xml b/introspection/nm-dhcp6-config.xml new file mode 100644 index 00000000..93b0f1c8 --- /dev/null +++ b/introspection/nm-dhcp6-config.xml @@ -0,0 +1,20 @@ + + + + + + Options and configuration returned by the IPv6 DHCP server. + + + Configuration options returned by a DHCP server, if any. + + + + + + A dictionary mapping property names to variant boxed values + + + + + diff --git a/introspection/nm-exported-connection.xml b/introspection/nm-exported-connection.xml new file mode 100644 index 00000000..46907c05 --- /dev/null +++ b/introspection/nm-exported-connection.xml @@ -0,0 +1,99 @@ + + + + + + + Represents a single network connection configuration. + + + + + Update the connection with new settings and properties, replacing all previous settings and properties. + + + + + + New connection properties. + + + + + + + Delete the connection. + + + + + + + + Get the settings maps describing this object. + + + + + The nested settings maps describing this object. + + + + + + + Emitted when some settings changed. + + + + Contains complete connection setting parameters, including changes. + + + + + + + Emitted when this connection has been deleted/removed. After receipt of this signal, the object no longer exists. + + + + + + + + Secrets have a separate interface so that they can be locked down. + + + + + Get the secrets encapsulated in this object. + + + + + + Name of the setting to return. + + + + + Array of strings of key names in the Setting for which NM thinks + a secrets may be required. + + + + + Indicates whether new secrets should be requested or if the request can be fulfilled from storage. + + + + + + Nested settings maps containing secrets. Each setting MUST contain at least the 'name' field, containing the name of the setting, and one or more secrets. + + + + + + + diff --git a/introspection/nm-ip4-config.xml b/introspection/nm-ip4-config.xml new file mode 100644 index 00000000..70d3e1ce --- /dev/null +++ b/introspection/nm-ip4-config.xml @@ -0,0 +1,29 @@ + + + + + + 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), ...] + + + + The nameservers in use. + + + The Windows Internet Name Service servers associated with the connection. Each address is in network byte order. + + + A list of domains this address belongs to. + + + 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), ...] + + + + + diff --git a/introspection/nm-ip6-config.xml b/introspection/nm-ip6-config.xml new file mode 100644 index 00000000..60478185 --- /dev/null +++ b/introspection/nm-ip6-config.xml @@ -0,0 +1,19 @@ + + + + + + Tuples of IPv6 address/prefix/gateway. + + + The nameservers in use. + + + A list of domains this address belongs to. + + + Tuples of IPv6 route/prefix/next-hop/metric. + + + + diff --git a/introspection/nm-manager-client.xml b/introspection/nm-manager-client.xml new file mode 100644 index 00000000..7a9e311c --- /dev/null +++ b/introspection/nm-manager-client.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml new file mode 100644 index 00000000..46db5afd --- /dev/null +++ b/introspection/nm-manager.xml @@ -0,0 +1,295 @@ + + + + + + + + + Get the list of network devices. + + + + + List of object paths of network devices known to the system. + + + + + + + + + Activate a connection using the supplied device. + + + + The D-Bus service name of the settings service that provides this connection. + + + + + The connection to activate the devices with. + + + + + The object path of device to be activated for physical connections. This parameter is ignored for VPN connections, because the specific_object (if provided) specifies the device to use. + + + + + The path of a connection-type-specific object this activation should use. + This parameter is currently ignored for wired and mobile broadband connections, + and the value of "/" should be used (ie, no specific object). For WiFi + connections, pass the object path of a specific AP from the card's scan + list, or "/" to pick and AP automatically. For VPN connections, pass + the object path of an ActiveConnection object that should serve as the + "base" connection (to which the VPN connections lifetime will be tied), + or pass "/" and NM will automatically use the current default device. + + + + + The path of the active connection object representing this active connection. + + + + + + + + Another connection is already activating or the same connection is already active. FIXME: check if the error name is correct. FIXME: split into 2 errors? + + + The connection is invalid for this device. + + + + + + + Deactivate an active connection. + + + + + The currently active connection to deactivate. + + + + + + + + Control the NetworkManager daemon's sleep state. When asleep, all + interfaces that it manages are deactivated. When awake, devices are + available to be activated. This command should not be called directly + by users or clients; it is intended for system suspend/resume tracking. + + + + Indicates whether the NetworkManager daemon should sleep or wake. + + + + + + + + Control whether overall networking is enabled or disabled. When + disabled, all interfaces that NM manages are deactivated. When enabled, + all managed interfaces are re-enabled and available to be activated. + This command should be used by clients that provide to users the ability + to enable/disable all networking. + + + + If FALSE, indicates that all networking should be disabled. If TRUE, + indicates that NetworkManager should begin managing network devices. + + + + + + + + Set logging verbosity and which operations are logged. + + + + One of [ERR, WARN, INFO, DEBUG]. + + + + + A combination of logging domains separated by commas (','), or "NONE" + to disable logging. Each domain enables logging for operations + related to that domain. Available domains are: [NONE, HW, RFKILL, + ETHER, WIFI, BT, MB, DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, + DNS, VPN, SHARING, SUPPLICANT, USER_SET, SYS_SET, SUSPEND, CORE, + DEVICE, OLPC] + + + + + + + Indicates if overall networking is currently enabled or not. See the + Enable() method. + + + + + + Indicates if wireless is currently enabled or not. + + + + + + Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch. + + + + + + Indicates if mobile broadband devices are currently enabled or not. + + + + + + Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch. + + + + + + List of active connection object paths. + + + + + + The overall state of the NetworkManager daemon. + + + + + + NetworkManager's state changed. + + + + The new state of NetworkManager. + + + + + + + NetworkManager's properties changed. + + + + The changed properties. + + + + + + + A device was added to the system + + + + The object path of the newly added device. + + + + + + + A device was removed from the system, and is no longer available. + + + + The object path of the device that was just removed. + + + + + + + Describes the overall state of the daemon. + + + + The NetworkManager daemon is in an unknown state. + + + + + The NetworkManager daemon is asleep and all interfaces managed by it are inactive. + + + + + The NetworkManager daemon is connecting a device. FIXME: What does this mean when one device is active and another is connecting? + + + + + The NetworkManager daemon is connected. + + + + + The NetworkManager daemon is disconnected. + + + + + + + + + DEPRECATED. NetworkManager's state changed. Use the 'StateChanged' signal instead. + + + + The new state of NetworkManager. + + + + + + + DEPRECATED. Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated. + + + + + + + DEPRECATED. Control the NetworkManager daemon's sleep state. When awake, all known interfaces are available to be activated. + + + + + + + DEPRECATED. The overall state of the NetworkManager daemon. + + + + + + + diff --git a/introspection/nm-ppp-manager.xml b/introspection/nm-ppp-manager.xml new file mode 100644 index 00000000..9e2dfdb1 --- /dev/null +++ b/introspection/nm-ppp-manager.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/introspection/nm-settings-system.xml b/introspection/nm-settings-system.xml new file mode 100644 index 00000000..598274c0 --- /dev/null +++ b/introspection/nm-settings-system.xml @@ -0,0 +1,81 @@ + + + + + + Implemented by the system settings service to provide additional settings to NetworkManager. + + + + + Save the hostname to persistent configuration. + + + + + + The hostname to save to persistent configuration. If blank, the persistent hostname is cleared. + + + + + + + The machine hostname stored in persistent configuration. + + + + + + If true, adding and modifying connections is supported. + + + + + + + A dictionary mapping property names to variant boxed values + + + + + + + Emitted when system authorization details change, indicating that clients may wish to recheck permissions with GetPermissions. + + + + + + Returns a bitfield indicating certain operations the caller is permitted to perform. Some of these operations may require authorization by the user. + + + + + + A bitfield of permitted operations. Some of these operations may require the user to authorize via password entry or other means. + + + + + + + No permissions. + + + Can modify/add/delete connections. + + + Can share connections via a encrypted user-created WiFi network. + + + Can share connections via a open/unencrypted user-created WiFi network. + + + Can modify the persistent system hostname. + + + + + + diff --git a/introspection/nm-settings.xml b/introspection/nm-settings.xml new file mode 100644 index 00000000..b252c00d --- /dev/null +++ b/introspection/nm-settings.xml @@ -0,0 +1,47 @@ + + + + + + The NetworkManagerSettings interface is provided by the service which provides connections to NetworkManager. + + + + + List the connections stored by this Settings object. + + + + + List of connections. + + + + + + + Add new connection. + + + + + + Connection settings and properties. + + + + + + + Emitted when a new connection has been added. + + + + Object path of the new connection. + + + + + + + diff --git a/introspection/nm-vpn-connection.xml b/introspection/nm-vpn-connection.xml new file mode 100644 index 00000000..3a47cdf1 --- /dev/null +++ b/introspection/nm-vpn-connection.xml @@ -0,0 +1,168 @@ + + + + + + The D-Bus service name providing this connection. + + + The path of the connection. + + + A specific object associated with the active connection. + + + Array of object paths representing devices which are part of this active connection. + + + The state of this active connection. + + + Whether this active connection is the default connection, i.e. whether it currently owns the default route. + + + Whether this active connection is also a VPN connection. + + + + + + A dictionary mapping property names to variant boxed values + + + + + + + + Represents an active connection to a Virtual Private Network. + + + + + + A dictionary mapping property names to variant boxed values + + + + + + The VPN-specific state of the connection. + + + The banner string of the VPN connection. + + + + + Emitted when the state of the VPN connection has changed. + + + + The new state of the VPN connection. + + + + + Reason code describing the change to the new state. + + + + + + + + The state of the VPN connection is unknown. + + + + + The VPN connection is preparing to connect. + + + + + The VPN connection needs authorization credentials. + + + + + The VPN connection is being established. FIXME: Should be CONNECTING or CONNECTED. + + + + + The VPN connection is getting an IP address. FIXME: Should be an -ING + + + + + The VPN connection is active. + + + + + The VPN connection failed. + + + + + The VPN connection is disconnected. + + + + + + + The reason for the VPN connection state change is unknown. + + + + + No reason was given for the VPN connection state change. + + + + + The VPN connection changed state because the user disconnected it. + + + + + The VPN connection changed state because the device it was using was disconnected. + + + + + The service providing the VPN connection was stopped. + + + + + The IP config of the VPN connection was invalid. + + + + + The connection attempt to the VPN service timed out. + + + + + A timeout occurred while starting the service providing the VPN connection. + + + + + Starting the service starting the service providing the VPN connection failed. + + + + + Necessary secrets for the VPN connection were not provided. + + + + + + diff --git a/introspection/nm-vpn-plugin.xml b/introspection/nm-vpn-plugin.xml new file mode 100644 index 00000000..72861f26 --- /dev/null +++ b/introspection/nm-vpn-plugin.xml @@ -0,0 +1,151 @@ + + + + + + This interface is provided by plugins providing VPN services to the NetworkManager daemon. + + + + Tells the plugin to connect. + + + + + Describes the connection to be established. + + + + + + + + + + + + + + Asks the plugin whether the provided connection will require secrets to connect successfully. + + + + + Describes the connection that may need secrets. + + + + + The setting name within the provided connection that requires secrets, if any. + + + + + + + + + + Disconnect the plugin. + + + + + + + + + + + Set IPv4 details on the connection. + + + + + Ip4Config details for the conneciton. + + + + + + + Indicate a failure to the plugin. + + + + + The reason for the failure. + + + + + + + The state of the plugin. + + + + + + Emitted when the plugin state changes. + + + + The new state of the plugin. + + + + + + + The plugin obtained an IPv4 configuration. + + + + The IPv4 configuration. + + + + + + + Emitted when the plugin receives a login banner from the VPN service. + + + + The login banner string. + + + + + + + Emitted when a failure in the VPN plugin occurs. + + + + Reason code for the failure. + + + + + + + + Login failed. + + + + + Connect failed. + + + + + Invalid IP configuration returned from the VPN plugin. + + + + + + diff --git a/introspection/vpn-errors.xml b/introspection/vpn-errors.xml new file mode 100644 index 00000000..0dba7e6f --- /dev/null +++ b/introspection/vpn-errors.xml @@ -0,0 +1,32 @@ + + + + This is a drab, nondescript error. + + + The request could not be processed because the VPN connection is already being started. + + + The request could not be processed because a VPN connection was already active. + + + The request could not be processed because the VPN connection is already being stopped. + + + The request could not be processed because the VPN connection was already stopped. + + + The request could not be processed because the VPN connection is in the wrong state for this type of request. FIXME: too general? + + + Invalid arguments were passed with the request. FIXME: too general. + + + A binary providing the service failed to launch. + + + The request could not be processed because the VPN connection settings were invalid. + + + diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am new file mode 100644 index 00000000..de25df4c --- /dev/null +++ b/libnm-glib/Makefile.am @@ -0,0 +1,212 @@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/marshallers + +BUILT_SOURCES = \ + nm-access-point-bindings.h \ + nm-client-bindings.h \ + nm-device-bindings.h \ + nm-device-ethernet-bindings.h \ + nm-device-wifi-bindings.h \ + nm-device-bt-bindings.h \ + nm-exported-connection-glue.h \ + nm-exported-connection-bindings.h \ + nm-settings-glue.h \ + nm-settings-bindings.h \ + nm-settings-system-bindings.h \ + nm-vpn-connection-bindings.h \ + nm-vpn-plugin-glue.h \ + nm-active-connection-bindings.h \ + nm-ip4-config-bindings.h \ + nm-dhcp4-config-bindings.h \ + nm-ip6-config-bindings.h \ + nm-dhcp6-config-bindings.h + +##################################################### +# Deprecated original libnm_glib bits +##################################################### + +noinst_LTLIBRARIES = libdeprecated-nm-glib.la + +libdeprecated_nm_glib_la_SOURCES = \ + libnm_glib.h \ + libnm_glib.c + +libdeprecated_nm_glib_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -Wno-deprecated-declarations \ + -Wno-deprecated + +libdeprecated_nm_glib_la_LIBADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +##################################################### +# Real libnm-glib stuff +##################################################### + +lib_LTLIBRARIES = libnm-glib.la libnm-glib-vpn.la + +libnm_glib_la_CFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(GCONF_CFLAGS) \ + $(GUDEV_CFLAGS) + +libnmincludedir = $(includedir)/libnm-glib + +libnminclude_HEADERS = \ + libnm_glib.h \ + nm-object.h \ + nm-client.h \ + nm-device.h \ + nm-device-ethernet.h \ + nm-device-wifi.h \ + nm-device-bt.h \ + nm-access-point.h \ + nm-ip4-config.h \ + nm-gsm-device.h \ + nm-cdma-device.h \ + nm-serial-device.h \ + nm-vpn-connection.h \ + nm-vpn-plugin.h \ + nm-vpn-plugin-ui-interface.h \ + nm-types.h \ + nm-active-connection.h \ + nm-dhcp4-config.h \ + nm-ip6-config.h \ + nm-dhcp6-config.h \ + nm-remote-connection.h \ + nm-settings-interface.h \ + nm-settings-system-interface.h \ + nm-remote-settings.h \ + nm-remote-settings-system.h \ + nm-settings-connection-interface.h \ + nm-exported-connection.h \ + nm-settings-service.h + +libnm_glib_la_SOURCES = \ + nm-object.c \ + nm-object-private.h \ + nm-client.c \ + nm-dbus-utils.c \ + nm-dbus-utils.h \ + nm-device.c \ + nm-device-private.h \ + nm-device-ethernet.c \ + nm-device-wifi.c \ + nm-device-bt.c \ + nm-access-point.c \ + nm-ip4-config.c \ + nm-gsm-device.c \ + nm-cdma-device.c \ + nm-serial-device.c \ + nm-vpn-connection.c \ + nm-types.c \ + nm-types-private.h \ + nm-object-cache.c \ + nm-object-cache.h \ + nm-active-connection.c \ + nm-dhcp4-config.c \ + nm-ip6-config.c \ + nm-dhcp6-config.c \ + nm-remote-connection.c \ + nm-remote-connection-private.h \ + nm-settings-interface.c \ + nm-settings-system-interface.c \ + nm-remote-settings.c \ + nm-remote-settings-system.c \ + nm-settings-connection-interface.c \ + nm-exported-connection.c \ + nm-settings-service.c + +libnm_glib_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(builddir)/libdeprecated-nm-glib.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) \ + $(GCONF_LIBS) \ + $(GUDEV_LIBS) + +libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ + -version-info "4:3:2" + +noinst_PROGRAMS = libnm-glib-test + +libnm_glib_test_SOURCES = libnm-glib-test.c +libnm_glib_test_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS) +libnm_glib_test_LDADD = libnm-glib.la $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) $(DBUS_LIBS) + + +libnm_glib_vpn_la_SOURCES = nm-vpn-plugin.c nm-vpn-plugin-ui-interface.c +libnm_glib_vpn_la_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS) +libnm_glib_vpn_la_LIBADD = $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) $(DBUS_LIBS) +libnm_glib_vpn_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib-vpn.ver \ + -version-info "1:0:0" + + +nm-client-bindings.h: $(top_srcdir)/introspection/nm-manager-client.xml + dbus-binding-tool --prefix=nm_client --mode=glib-client --output=$@ $< + +nm-device-bindings.h: $(top_srcdir)/introspection/nm-device.xml + dbus-binding-tool --prefix=nm_device --mode=glib-client --output=$@ $< + +nm-device-ethernet-bindings.h: $(top_srcdir)/introspection/nm-device-ethernet.xml + dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-client --output=$@ $< + +nm-device-wifi-bindings.h: $(top_srcdir)/introspection/nm-device-wifi.xml + dbus-binding-tool --prefix=nm_device_wifi --mode=glib-client --output=$@ $< + +nm-device-bt-bindings.h: $(top_srcdir)/introspection/nm-device-bt.xml + dbus-binding-tool --prefix=nm_device_bt --mode=glib-client --output=$@ $< + +nm-access-point-bindings.h: $(top_srcdir)/introspection/nm-access-point.xml + dbus-binding-tool --prefix=nm_access_point --mode=glib-client --output=$@ $< + +nm-settings-glue.h: $(top_srcdir)/introspection/nm-settings.xml + dbus-binding-tool --prefix=nm_settings --mode=glib-server --output=$@ $< + +nm-settings-bindings.h: $(top_srcdir)/introspection/nm-settings.xml + dbus-binding-tool --prefix=nm_settings --mode=glib-client --output=$@ $< + +nm-settings-system-bindings.h: $(top_srcdir)/introspection/nm-settings-system.xml + dbus-binding-tool --prefix=nm_settings_system --mode=glib-client --output=$@ $< + +nm-exported-connection-glue.h: $(top_srcdir)/introspection/nm-exported-connection.xml + dbus-binding-tool --prefix=nm_exported_connection --mode=glib-server --output=$@ $< + +nm-exported-connection-bindings.h: $(top_srcdir)/introspection/nm-exported-connection.xml + dbus-binding-tool --prefix=nm_exported_connection --mode=glib-client --output=$@ $< + +nm-vpn-connection-bindings.h: $(top_srcdir)/introspection/nm-vpn-connection.xml + dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-client --output=$@ $< + +nm-vpn-plugin-glue.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml + dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-server --output=$@ $< + +nm-active-connection-bindings.h: $(top_srcdir)/introspection/nm-active-connection.xml + dbus-binding-tool --prefix=nm_active_connection --mode=glib-client --output=$@ $< + +nm-ip4-config-bindings.h: $(top_srcdir)/introspection/nm-ip4-config.xml + dbus-binding-tool --prefix=nm_ip4_config --mode=glib-client --output=$@ $< + +nm-dhcp4-config-bindings.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml + dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-client --output=$@ $< + +nm-ip6-config-bindings.h: $(top_srcdir)/introspection/nm-ip6-config.xml + dbus-binding-tool --prefix=nm_ip6_config --mode=glib-client --output=$@ $< + +nm-dhcp6-config-bindings.h: $(top_srcdir)/introspection/nm-dhcp6-config.xml + dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-client --output=$@ $< + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libnm-glib.pc libnm-glib-vpn.pc + +DISTCLEANFILES = libnm-glib.pc libnm-glib.pc + +EXTRA_DIST = libnm-glib.pc.in libnm-glib-vpn.pc.in libnm-glib.ver libnm-glib-vpn.ver + +CLEANFILES = $(BUILT_SOURCES) diff --git a/libnm-glib/Makefile.in b/libnm-glib/Makefile.in new file mode 100644 index 00000000..b7e933d1 --- /dev/null +++ b/libnm-glib/Makefile.in @@ -0,0 +1,1183 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = libnm-glib-test$(EXEEXT) +subdir = libnm-glib +DIST_COMMON = $(libnminclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/libnm-glib-vpn.pc.in \ + $(srcdir)/libnm-glib.pc.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = libnm-glib.pc libnm-glib-vpn.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(libnmincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libdeprecated_nm_glib_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libdeprecated_nm_glib_la_OBJECTS = \ + libdeprecated_nm_glib_la-libnm_glib.lo +libdeprecated_nm_glib_la_OBJECTS = \ + $(am_libdeprecated_nm_glib_la_OBJECTS) +libnm_glib_vpn_la_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libnm_glib_vpn_la_OBJECTS = libnm_glib_vpn_la-nm-vpn-plugin.lo \ + libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.lo +libnm_glib_vpn_la_OBJECTS = $(am_libnm_glib_vpn_la_OBJECTS) +libnm_glib_vpn_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libnm_glib_vpn_la_CFLAGS) $(CFLAGS) \ + $(libnm_glib_vpn_la_LDFLAGS) $(LDFLAGS) -o $@ +libnm_glib_la_DEPENDENCIES = $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(builddir)/libdeprecated-nm-glib.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libnm_glib_la_OBJECTS = libnm_glib_la-nm-object.lo \ + libnm_glib_la-nm-client.lo libnm_glib_la-nm-dbus-utils.lo \ + libnm_glib_la-nm-device.lo libnm_glib_la-nm-device-ethernet.lo \ + libnm_glib_la-nm-device-wifi.lo libnm_glib_la-nm-device-bt.lo \ + libnm_glib_la-nm-access-point.lo \ + libnm_glib_la-nm-ip4-config.lo libnm_glib_la-nm-gsm-device.lo \ + libnm_glib_la-nm-cdma-device.lo \ + libnm_glib_la-nm-serial-device.lo \ + libnm_glib_la-nm-vpn-connection.lo libnm_glib_la-nm-types.lo \ + libnm_glib_la-nm-object-cache.lo \ + libnm_glib_la-nm-active-connection.lo \ + libnm_glib_la-nm-dhcp4-config.lo \ + libnm_glib_la-nm-ip6-config.lo \ + libnm_glib_la-nm-dhcp6-config.lo \ + libnm_glib_la-nm-remote-connection.lo \ + libnm_glib_la-nm-settings-interface.lo \ + libnm_glib_la-nm-settings-system-interface.lo \ + libnm_glib_la-nm-remote-settings.lo \ + libnm_glib_la-nm-remote-settings-system.lo \ + libnm_glib_la-nm-settings-connection-interface.lo \ + libnm_glib_la-nm-exported-connection.lo \ + libnm_glib_la-nm-settings-service.lo +libnm_glib_la_OBJECTS = $(am_libnm_glib_la_OBJECTS) +libnm_glib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libnm_glib_la_CFLAGS) \ + $(CFLAGS) $(libnm_glib_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(noinst_PROGRAMS) +am_libnm_glib_test_OBJECTS = \ + libnm_glib_test-libnm-glib-test.$(OBJEXT) +libnm_glib_test_OBJECTS = $(am_libnm_glib_test_OBJECTS) +libnm_glib_test_DEPENDENCIES = libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +libnm_glib_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libnm_glib_test_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libdeprecated_nm_glib_la_SOURCES) \ + $(libnm_glib_vpn_la_SOURCES) $(libnm_glib_la_SOURCES) \ + $(libnm_glib_test_SOURCES) +DIST_SOURCES = $(libdeprecated_nm_glib_la_SOURCES) \ + $(libnm_glib_vpn_la_SOURCES) $(libnm_glib_la_SOURCES) \ + $(libnm_glib_test_SOURCES) +DATA = $(pkgconfig_DATA) +HEADERS = $(libnminclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/marshallers + +BUILT_SOURCES = \ + nm-access-point-bindings.h \ + nm-client-bindings.h \ + nm-device-bindings.h \ + nm-device-ethernet-bindings.h \ + nm-device-wifi-bindings.h \ + nm-device-bt-bindings.h \ + nm-exported-connection-glue.h \ + nm-exported-connection-bindings.h \ + nm-settings-glue.h \ + nm-settings-bindings.h \ + nm-settings-system-bindings.h \ + nm-vpn-connection-bindings.h \ + nm-vpn-plugin-glue.h \ + nm-active-connection-bindings.h \ + nm-ip4-config-bindings.h \ + nm-dhcp4-config-bindings.h \ + nm-ip6-config-bindings.h \ + nm-dhcp6-config-bindings.h + + +##################################################### +# Deprecated original libnm_glib bits +##################################################### +noinst_LTLIBRARIES = libdeprecated-nm-glib.la +libdeprecated_nm_glib_la_SOURCES = \ + libnm_glib.h \ + libnm_glib.c + +libdeprecated_nm_glib_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -Wno-deprecated-declarations \ + -Wno-deprecated + +libdeprecated_nm_glib_la_LIBADD = \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + + +##################################################### +# Real libnm-glib stuff +##################################################### +lib_LTLIBRARIES = libnm-glib.la libnm-glib-vpn.la +libnm_glib_la_CFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(GCONF_CFLAGS) \ + $(GUDEV_CFLAGS) + +libnmincludedir = $(includedir)/libnm-glib +libnminclude_HEADERS = \ + libnm_glib.h \ + nm-object.h \ + nm-client.h \ + nm-device.h \ + nm-device-ethernet.h \ + nm-device-wifi.h \ + nm-device-bt.h \ + nm-access-point.h \ + nm-ip4-config.h \ + nm-gsm-device.h \ + nm-cdma-device.h \ + nm-serial-device.h \ + nm-vpn-connection.h \ + nm-vpn-plugin.h \ + nm-vpn-plugin-ui-interface.h \ + nm-types.h \ + nm-active-connection.h \ + nm-dhcp4-config.h \ + nm-ip6-config.h \ + nm-dhcp6-config.h \ + nm-remote-connection.h \ + nm-settings-interface.h \ + nm-settings-system-interface.h \ + nm-remote-settings.h \ + nm-remote-settings-system.h \ + nm-settings-connection-interface.h \ + nm-exported-connection.h \ + nm-settings-service.h + +libnm_glib_la_SOURCES = \ + nm-object.c \ + nm-object-private.h \ + nm-client.c \ + nm-dbus-utils.c \ + nm-dbus-utils.h \ + nm-device.c \ + nm-device-private.h \ + nm-device-ethernet.c \ + nm-device-wifi.c \ + nm-device-bt.c \ + nm-access-point.c \ + nm-ip4-config.c \ + nm-gsm-device.c \ + nm-cdma-device.c \ + nm-serial-device.c \ + nm-vpn-connection.c \ + nm-types.c \ + nm-types-private.h \ + nm-object-cache.c \ + nm-object-cache.h \ + nm-active-connection.c \ + nm-dhcp4-config.c \ + nm-ip6-config.c \ + nm-dhcp6-config.c \ + nm-remote-connection.c \ + nm-remote-connection-private.h \ + nm-settings-interface.c \ + nm-settings-system-interface.c \ + nm-remote-settings.c \ + nm-remote-settings-system.c \ + nm-settings-connection-interface.c \ + nm-exported-connection.c \ + nm-settings-service.c + +libnm_glib_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(builddir)/libdeprecated-nm-glib.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) \ + $(GCONF_LIBS) \ + $(GUDEV_LIBS) + +libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \ + -version-info "4:3:2" + +libnm_glib_test_SOURCES = libnm-glib-test.c +libnm_glib_test_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS) +libnm_glib_test_LDADD = libnm-glib.la $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) $(DBUS_LIBS) +libnm_glib_vpn_la_SOURCES = nm-vpn-plugin.c nm-vpn-plugin-ui-interface.c +libnm_glib_vpn_la_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS) +libnm_glib_vpn_la_LIBADD = $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) $(DBUS_LIBS) +libnm_glib_vpn_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib-vpn.ver \ + -version-info "1:0:0" + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libnm-glib.pc libnm-glib-vpn.pc +DISTCLEANFILES = libnm-glib.pc libnm-glib.pc +EXTRA_DIST = libnm-glib.pc.in libnm-glib-vpn.pc.in libnm-glib.ver libnm-glib-vpn.ver +CLEANFILES = $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libnm-glib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libnm-glib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +libnm-glib.pc: $(top_builddir)/config.status $(srcdir)/libnm-glib.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +libnm-glib-vpn.pc: $(top_builddir)/config.status $(srcdir)/libnm-glib-vpn.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libdeprecated-nm-glib.la: $(libdeprecated_nm_glib_la_OBJECTS) $(libdeprecated_nm_glib_la_DEPENDENCIES) + $(LINK) $(libdeprecated_nm_glib_la_OBJECTS) $(libdeprecated_nm_glib_la_LIBADD) $(LIBS) +libnm-glib-vpn.la: $(libnm_glib_vpn_la_OBJECTS) $(libnm_glib_vpn_la_DEPENDENCIES) + $(libnm_glib_vpn_la_LINK) -rpath $(libdir) $(libnm_glib_vpn_la_OBJECTS) $(libnm_glib_vpn_la_LIBADD) $(LIBS) +libnm-glib.la: $(libnm_glib_la_OBJECTS) $(libnm_glib_la_DEPENDENCIES) + $(libnm_glib_la_LINK) -rpath $(libdir) $(libnm_glib_la_OBJECTS) $(libnm_glib_la_LIBADD) $(LIBS) + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +libnm-glib-test$(EXEEXT): $(libnm_glib_test_OBJECTS) $(libnm_glib_test_DEPENDENCIES) + @rm -f libnm-glib-test$(EXEEXT) + $(libnm_glib_test_LINK) $(libnm_glib_test_OBJECTS) $(libnm_glib_test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdeprecated_nm_glib_la-libnm_glib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-access-point.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-active-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-cdma-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-dbus-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-device-bt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-device-ethernet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-device-wifi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-dhcp4-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-dhcp6-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-exported-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-gsm-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-ip4-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-ip6-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-object-cache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-object.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-remote-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-remote-settings-system.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-remote-settings.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-serial-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-settings-connection-interface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-settings-interface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-settings-service.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-settings-system-interface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_la-nm-vpn-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test-libnm-glib-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libdeprecated_nm_glib_la-libnm_glib.lo: libnm_glib.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdeprecated_nm_glib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdeprecated_nm_glib_la-libnm_glib.lo -MD -MP -MF $(DEPDIR)/libdeprecated_nm_glib_la-libnm_glib.Tpo -c -o libdeprecated_nm_glib_la-libnm_glib.lo `test -f 'libnm_glib.c' || echo '$(srcdir)/'`libnm_glib.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdeprecated_nm_glib_la-libnm_glib.Tpo $(DEPDIR)/libdeprecated_nm_glib_la-libnm_glib.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libnm_glib.c' object='libdeprecated_nm_glib_la-libnm_glib.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdeprecated_nm_glib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdeprecated_nm_glib_la-libnm_glib.lo `test -f 'libnm_glib.c' || echo '$(srcdir)/'`libnm_glib.c + +libnm_glib_vpn_la-nm-vpn-plugin.lo: nm-vpn-plugin.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_vpn_la_CFLAGS) $(CFLAGS) -MT libnm_glib_vpn_la-nm-vpn-plugin.lo -MD -MP -MF $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin.Tpo -c -o libnm_glib_vpn_la-nm-vpn-plugin.lo `test -f 'nm-vpn-plugin.c' || echo '$(srcdir)/'`nm-vpn-plugin.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin.Tpo $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-vpn-plugin.c' object='libnm_glib_vpn_la-nm-vpn-plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_vpn_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_vpn_la-nm-vpn-plugin.lo `test -f 'nm-vpn-plugin.c' || echo '$(srcdir)/'`nm-vpn-plugin.c + +libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.lo: nm-vpn-plugin-ui-interface.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_vpn_la_CFLAGS) $(CFLAGS) -MT libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.lo -MD -MP -MF $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.Tpo -c -o libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.lo `test -f 'nm-vpn-plugin-ui-interface.c' || echo '$(srcdir)/'`nm-vpn-plugin-ui-interface.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.Tpo $(DEPDIR)/libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-vpn-plugin-ui-interface.c' object='libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_vpn_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_vpn_la-nm-vpn-plugin-ui-interface.lo `test -f 'nm-vpn-plugin-ui-interface.c' || echo '$(srcdir)/'`nm-vpn-plugin-ui-interface.c + +libnm_glib_la-nm-object.lo: nm-object.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-object.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-object.Tpo -c -o libnm_glib_la-nm-object.lo `test -f 'nm-object.c' || echo '$(srcdir)/'`nm-object.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-object.Tpo $(DEPDIR)/libnm_glib_la-nm-object.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-object.c' object='libnm_glib_la-nm-object.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-object.lo `test -f 'nm-object.c' || echo '$(srcdir)/'`nm-object.c + +libnm_glib_la-nm-client.lo: nm-client.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-client.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-client.Tpo -c -o libnm_glib_la-nm-client.lo `test -f 'nm-client.c' || echo '$(srcdir)/'`nm-client.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-client.Tpo $(DEPDIR)/libnm_glib_la-nm-client.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-client.c' object='libnm_glib_la-nm-client.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-client.lo `test -f 'nm-client.c' || echo '$(srcdir)/'`nm-client.c + +libnm_glib_la-nm-dbus-utils.lo: nm-dbus-utils.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-dbus-utils.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-dbus-utils.Tpo -c -o libnm_glib_la-nm-dbus-utils.lo `test -f 'nm-dbus-utils.c' || echo '$(srcdir)/'`nm-dbus-utils.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-dbus-utils.Tpo $(DEPDIR)/libnm_glib_la-nm-dbus-utils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dbus-utils.c' object='libnm_glib_la-nm-dbus-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-dbus-utils.lo `test -f 'nm-dbus-utils.c' || echo '$(srcdir)/'`nm-dbus-utils.c + +libnm_glib_la-nm-device.lo: nm-device.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-device.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-device.Tpo -c -o libnm_glib_la-nm-device.lo `test -f 'nm-device.c' || echo '$(srcdir)/'`nm-device.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-device.Tpo $(DEPDIR)/libnm_glib_la-nm-device.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device.c' object='libnm_glib_la-nm-device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-device.lo `test -f 'nm-device.c' || echo '$(srcdir)/'`nm-device.c + +libnm_glib_la-nm-device-ethernet.lo: nm-device-ethernet.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-device-ethernet.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-device-ethernet.Tpo -c -o libnm_glib_la-nm-device-ethernet.lo `test -f 'nm-device-ethernet.c' || echo '$(srcdir)/'`nm-device-ethernet.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-device-ethernet.Tpo $(DEPDIR)/libnm_glib_la-nm-device-ethernet.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-ethernet.c' object='libnm_glib_la-nm-device-ethernet.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-device-ethernet.lo `test -f 'nm-device-ethernet.c' || echo '$(srcdir)/'`nm-device-ethernet.c + +libnm_glib_la-nm-device-wifi.lo: nm-device-wifi.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-device-wifi.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-device-wifi.Tpo -c -o libnm_glib_la-nm-device-wifi.lo `test -f 'nm-device-wifi.c' || echo '$(srcdir)/'`nm-device-wifi.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-device-wifi.Tpo $(DEPDIR)/libnm_glib_la-nm-device-wifi.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-wifi.c' object='libnm_glib_la-nm-device-wifi.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-device-wifi.lo `test -f 'nm-device-wifi.c' || echo '$(srcdir)/'`nm-device-wifi.c + +libnm_glib_la-nm-device-bt.lo: nm-device-bt.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-device-bt.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-device-bt.Tpo -c -o libnm_glib_la-nm-device-bt.lo `test -f 'nm-device-bt.c' || echo '$(srcdir)/'`nm-device-bt.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-device-bt.Tpo $(DEPDIR)/libnm_glib_la-nm-device-bt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-bt.c' object='libnm_glib_la-nm-device-bt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-device-bt.lo `test -f 'nm-device-bt.c' || echo '$(srcdir)/'`nm-device-bt.c + +libnm_glib_la-nm-access-point.lo: nm-access-point.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-access-point.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-access-point.Tpo -c -o libnm_glib_la-nm-access-point.lo `test -f 'nm-access-point.c' || echo '$(srcdir)/'`nm-access-point.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-access-point.Tpo $(DEPDIR)/libnm_glib_la-nm-access-point.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-access-point.c' object='libnm_glib_la-nm-access-point.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-access-point.lo `test -f 'nm-access-point.c' || echo '$(srcdir)/'`nm-access-point.c + +libnm_glib_la-nm-ip4-config.lo: nm-ip4-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-ip4-config.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-ip4-config.Tpo -c -o libnm_glib_la-nm-ip4-config.lo `test -f 'nm-ip4-config.c' || echo '$(srcdir)/'`nm-ip4-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-ip4-config.Tpo $(DEPDIR)/libnm_glib_la-nm-ip4-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip4-config.c' object='libnm_glib_la-nm-ip4-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-ip4-config.lo `test -f 'nm-ip4-config.c' || echo '$(srcdir)/'`nm-ip4-config.c + +libnm_glib_la-nm-gsm-device.lo: nm-gsm-device.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-gsm-device.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-gsm-device.Tpo -c -o libnm_glib_la-nm-gsm-device.lo `test -f 'nm-gsm-device.c' || echo '$(srcdir)/'`nm-gsm-device.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-gsm-device.Tpo $(DEPDIR)/libnm_glib_la-nm-gsm-device.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-gsm-device.c' object='libnm_glib_la-nm-gsm-device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-gsm-device.lo `test -f 'nm-gsm-device.c' || echo '$(srcdir)/'`nm-gsm-device.c + +libnm_glib_la-nm-cdma-device.lo: nm-cdma-device.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-cdma-device.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-cdma-device.Tpo -c -o libnm_glib_la-nm-cdma-device.lo `test -f 'nm-cdma-device.c' || echo '$(srcdir)/'`nm-cdma-device.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-cdma-device.Tpo $(DEPDIR)/libnm_glib_la-nm-cdma-device.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-cdma-device.c' object='libnm_glib_la-nm-cdma-device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-cdma-device.lo `test -f 'nm-cdma-device.c' || echo '$(srcdir)/'`nm-cdma-device.c + +libnm_glib_la-nm-serial-device.lo: nm-serial-device.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-serial-device.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-serial-device.Tpo -c -o libnm_glib_la-nm-serial-device.lo `test -f 'nm-serial-device.c' || echo '$(srcdir)/'`nm-serial-device.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-serial-device.Tpo $(DEPDIR)/libnm_glib_la-nm-serial-device.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-serial-device.c' object='libnm_glib_la-nm-serial-device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-serial-device.lo `test -f 'nm-serial-device.c' || echo '$(srcdir)/'`nm-serial-device.c + +libnm_glib_la-nm-vpn-connection.lo: nm-vpn-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-vpn-connection.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-vpn-connection.Tpo -c -o libnm_glib_la-nm-vpn-connection.lo `test -f 'nm-vpn-connection.c' || echo '$(srcdir)/'`nm-vpn-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-vpn-connection.Tpo $(DEPDIR)/libnm_glib_la-nm-vpn-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-vpn-connection.c' object='libnm_glib_la-nm-vpn-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-vpn-connection.lo `test -f 'nm-vpn-connection.c' || echo '$(srcdir)/'`nm-vpn-connection.c + +libnm_glib_la-nm-types.lo: nm-types.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-types.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-types.Tpo -c -o libnm_glib_la-nm-types.lo `test -f 'nm-types.c' || echo '$(srcdir)/'`nm-types.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-types.Tpo $(DEPDIR)/libnm_glib_la-nm-types.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-types.c' object='libnm_glib_la-nm-types.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-types.lo `test -f 'nm-types.c' || echo '$(srcdir)/'`nm-types.c + +libnm_glib_la-nm-object-cache.lo: nm-object-cache.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-object-cache.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-object-cache.Tpo -c -o libnm_glib_la-nm-object-cache.lo `test -f 'nm-object-cache.c' || echo '$(srcdir)/'`nm-object-cache.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-object-cache.Tpo $(DEPDIR)/libnm_glib_la-nm-object-cache.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-object-cache.c' object='libnm_glib_la-nm-object-cache.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-object-cache.lo `test -f 'nm-object-cache.c' || echo '$(srcdir)/'`nm-object-cache.c + +libnm_glib_la-nm-active-connection.lo: nm-active-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-active-connection.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-active-connection.Tpo -c -o libnm_glib_la-nm-active-connection.lo `test -f 'nm-active-connection.c' || echo '$(srcdir)/'`nm-active-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-active-connection.Tpo $(DEPDIR)/libnm_glib_la-nm-active-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-active-connection.c' object='libnm_glib_la-nm-active-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-active-connection.lo `test -f 'nm-active-connection.c' || echo '$(srcdir)/'`nm-active-connection.c + +libnm_glib_la-nm-dhcp4-config.lo: nm-dhcp4-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-dhcp4-config.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-dhcp4-config.Tpo -c -o libnm_glib_la-nm-dhcp4-config.lo `test -f 'nm-dhcp4-config.c' || echo '$(srcdir)/'`nm-dhcp4-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-dhcp4-config.Tpo $(DEPDIR)/libnm_glib_la-nm-dhcp4-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp4-config.c' object='libnm_glib_la-nm-dhcp4-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-dhcp4-config.lo `test -f 'nm-dhcp4-config.c' || echo '$(srcdir)/'`nm-dhcp4-config.c + +libnm_glib_la-nm-ip6-config.lo: nm-ip6-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-ip6-config.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-ip6-config.Tpo -c -o libnm_glib_la-nm-ip6-config.lo `test -f 'nm-ip6-config.c' || echo '$(srcdir)/'`nm-ip6-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-ip6-config.Tpo $(DEPDIR)/libnm_glib_la-nm-ip6-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip6-config.c' object='libnm_glib_la-nm-ip6-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-ip6-config.lo `test -f 'nm-ip6-config.c' || echo '$(srcdir)/'`nm-ip6-config.c + +libnm_glib_la-nm-dhcp6-config.lo: nm-dhcp6-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-dhcp6-config.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-dhcp6-config.Tpo -c -o libnm_glib_la-nm-dhcp6-config.lo `test -f 'nm-dhcp6-config.c' || echo '$(srcdir)/'`nm-dhcp6-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-dhcp6-config.Tpo $(DEPDIR)/libnm_glib_la-nm-dhcp6-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp6-config.c' object='libnm_glib_la-nm-dhcp6-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-dhcp6-config.lo `test -f 'nm-dhcp6-config.c' || echo '$(srcdir)/'`nm-dhcp6-config.c + +libnm_glib_la-nm-remote-connection.lo: nm-remote-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-remote-connection.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-remote-connection.Tpo -c -o libnm_glib_la-nm-remote-connection.lo `test -f 'nm-remote-connection.c' || echo '$(srcdir)/'`nm-remote-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-remote-connection.Tpo $(DEPDIR)/libnm_glib_la-nm-remote-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-remote-connection.c' object='libnm_glib_la-nm-remote-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-remote-connection.lo `test -f 'nm-remote-connection.c' || echo '$(srcdir)/'`nm-remote-connection.c + +libnm_glib_la-nm-settings-interface.lo: nm-settings-interface.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-settings-interface.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-settings-interface.Tpo -c -o libnm_glib_la-nm-settings-interface.lo `test -f 'nm-settings-interface.c' || echo '$(srcdir)/'`nm-settings-interface.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-settings-interface.Tpo $(DEPDIR)/libnm_glib_la-nm-settings-interface.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-settings-interface.c' object='libnm_glib_la-nm-settings-interface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-settings-interface.lo `test -f 'nm-settings-interface.c' || echo '$(srcdir)/'`nm-settings-interface.c + +libnm_glib_la-nm-settings-system-interface.lo: nm-settings-system-interface.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-settings-system-interface.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-settings-system-interface.Tpo -c -o libnm_glib_la-nm-settings-system-interface.lo `test -f 'nm-settings-system-interface.c' || echo '$(srcdir)/'`nm-settings-system-interface.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-settings-system-interface.Tpo $(DEPDIR)/libnm_glib_la-nm-settings-system-interface.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-settings-system-interface.c' object='libnm_glib_la-nm-settings-system-interface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-settings-system-interface.lo `test -f 'nm-settings-system-interface.c' || echo '$(srcdir)/'`nm-settings-system-interface.c + +libnm_glib_la-nm-remote-settings.lo: nm-remote-settings.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-remote-settings.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-remote-settings.Tpo -c -o libnm_glib_la-nm-remote-settings.lo `test -f 'nm-remote-settings.c' || echo '$(srcdir)/'`nm-remote-settings.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-remote-settings.Tpo $(DEPDIR)/libnm_glib_la-nm-remote-settings.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-remote-settings.c' object='libnm_glib_la-nm-remote-settings.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-remote-settings.lo `test -f 'nm-remote-settings.c' || echo '$(srcdir)/'`nm-remote-settings.c + +libnm_glib_la-nm-remote-settings-system.lo: nm-remote-settings-system.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-remote-settings-system.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-remote-settings-system.Tpo -c -o libnm_glib_la-nm-remote-settings-system.lo `test -f 'nm-remote-settings-system.c' || echo '$(srcdir)/'`nm-remote-settings-system.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-remote-settings-system.Tpo $(DEPDIR)/libnm_glib_la-nm-remote-settings-system.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-remote-settings-system.c' object='libnm_glib_la-nm-remote-settings-system.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-remote-settings-system.lo `test -f 'nm-remote-settings-system.c' || echo '$(srcdir)/'`nm-remote-settings-system.c + +libnm_glib_la-nm-settings-connection-interface.lo: nm-settings-connection-interface.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-settings-connection-interface.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-settings-connection-interface.Tpo -c -o libnm_glib_la-nm-settings-connection-interface.lo `test -f 'nm-settings-connection-interface.c' || echo '$(srcdir)/'`nm-settings-connection-interface.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-settings-connection-interface.Tpo $(DEPDIR)/libnm_glib_la-nm-settings-connection-interface.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-settings-connection-interface.c' object='libnm_glib_la-nm-settings-connection-interface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-settings-connection-interface.lo `test -f 'nm-settings-connection-interface.c' || echo '$(srcdir)/'`nm-settings-connection-interface.c + +libnm_glib_la-nm-exported-connection.lo: nm-exported-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-exported-connection.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-exported-connection.Tpo -c -o libnm_glib_la-nm-exported-connection.lo `test -f 'nm-exported-connection.c' || echo '$(srcdir)/'`nm-exported-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-exported-connection.Tpo $(DEPDIR)/libnm_glib_la-nm-exported-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-exported-connection.c' object='libnm_glib_la-nm-exported-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-exported-connection.lo `test -f 'nm-exported-connection.c' || echo '$(srcdir)/'`nm-exported-connection.c + +libnm_glib_la-nm-settings-service.lo: nm-settings-service.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -MT libnm_glib_la-nm-settings-service.lo -MD -MP -MF $(DEPDIR)/libnm_glib_la-nm-settings-service.Tpo -c -o libnm_glib_la-nm-settings-service.lo `test -f 'nm-settings-service.c' || echo '$(srcdir)/'`nm-settings-service.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_la-nm-settings-service.Tpo $(DEPDIR)/libnm_glib_la-nm-settings-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-settings-service.c' object='libnm_glib_la-nm-settings-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_la_CFLAGS) $(CFLAGS) -c -o libnm_glib_la-nm-settings-service.lo `test -f 'nm-settings-service.c' || echo '$(srcdir)/'`nm-settings-service.c + +libnm_glib_test-libnm-glib-test.o: libnm-glib-test.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_CFLAGS) $(CFLAGS) -MT libnm_glib_test-libnm-glib-test.o -MD -MP -MF $(DEPDIR)/libnm_glib_test-libnm-glib-test.Tpo -c -o libnm_glib_test-libnm-glib-test.o `test -f 'libnm-glib-test.c' || echo '$(srcdir)/'`libnm-glib-test.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_test-libnm-glib-test.Tpo $(DEPDIR)/libnm_glib_test-libnm-glib-test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libnm-glib-test.c' object='libnm_glib_test-libnm-glib-test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_CFLAGS) $(CFLAGS) -c -o libnm_glib_test-libnm-glib-test.o `test -f 'libnm-glib-test.c' || echo '$(srcdir)/'`libnm-glib-test.c + +libnm_glib_test-libnm-glib-test.obj: libnm-glib-test.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_CFLAGS) $(CFLAGS) -MT libnm_glib_test-libnm-glib-test.obj -MD -MP -MF $(DEPDIR)/libnm_glib_test-libnm-glib-test.Tpo -c -o libnm_glib_test-libnm-glib-test.obj `if test -f 'libnm-glib-test.c'; then $(CYGPATH_W) 'libnm-glib-test.c'; else $(CYGPATH_W) '$(srcdir)/libnm-glib-test.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_test-libnm-glib-test.Tpo $(DEPDIR)/libnm_glib_test-libnm-glib-test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libnm-glib-test.c' object='libnm_glib_test-libnm-glib-test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_CFLAGS) $(CFLAGS) -c -o libnm_glib_test-libnm-glib-test.obj `if test -f 'libnm-glib-test.c'; then $(CYGPATH_W) 'libnm-glib-test.c'; else $(CYGPATH_W) '$(srcdir)/libnm-glib-test.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files +install-libnmincludeHEADERS: $(libnminclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(libnmincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libnmincludedir)" + @list='$(libnminclude_HEADERS)'; test -n "$(libnmincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libnmincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libnmincludedir)" || exit $$?; \ + done + +uninstall-libnmincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libnminclude_HEADERS)'; test -n "$(libnmincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libnmincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libnmincludedir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libnmincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libnmincludeHEADERS install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-libnmincludeHEADERS \ + uninstall-pkgconfigDATA + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-libnmincludeHEADERS install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-libLTLIBRARIES uninstall-libnmincludeHEADERS \ + uninstall-pkgconfigDATA + + +nm-client-bindings.h: $(top_srcdir)/introspection/nm-manager-client.xml + dbus-binding-tool --prefix=nm_client --mode=glib-client --output=$@ $< + +nm-device-bindings.h: $(top_srcdir)/introspection/nm-device.xml + dbus-binding-tool --prefix=nm_device --mode=glib-client --output=$@ $< + +nm-device-ethernet-bindings.h: $(top_srcdir)/introspection/nm-device-ethernet.xml + dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-client --output=$@ $< + +nm-device-wifi-bindings.h: $(top_srcdir)/introspection/nm-device-wifi.xml + dbus-binding-tool --prefix=nm_device_wifi --mode=glib-client --output=$@ $< + +nm-device-bt-bindings.h: $(top_srcdir)/introspection/nm-device-bt.xml + dbus-binding-tool --prefix=nm_device_bt --mode=glib-client --output=$@ $< + +nm-access-point-bindings.h: $(top_srcdir)/introspection/nm-access-point.xml + dbus-binding-tool --prefix=nm_access_point --mode=glib-client --output=$@ $< + +nm-settings-glue.h: $(top_srcdir)/introspection/nm-settings.xml + dbus-binding-tool --prefix=nm_settings --mode=glib-server --output=$@ $< + +nm-settings-bindings.h: $(top_srcdir)/introspection/nm-settings.xml + dbus-binding-tool --prefix=nm_settings --mode=glib-client --output=$@ $< + +nm-settings-system-bindings.h: $(top_srcdir)/introspection/nm-settings-system.xml + dbus-binding-tool --prefix=nm_settings_system --mode=glib-client --output=$@ $< + +nm-exported-connection-glue.h: $(top_srcdir)/introspection/nm-exported-connection.xml + dbus-binding-tool --prefix=nm_exported_connection --mode=glib-server --output=$@ $< + +nm-exported-connection-bindings.h: $(top_srcdir)/introspection/nm-exported-connection.xml + dbus-binding-tool --prefix=nm_exported_connection --mode=glib-client --output=$@ $< + +nm-vpn-connection-bindings.h: $(top_srcdir)/introspection/nm-vpn-connection.xml + dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-client --output=$@ $< + +nm-vpn-plugin-glue.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml + dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-server --output=$@ $< + +nm-active-connection-bindings.h: $(top_srcdir)/introspection/nm-active-connection.xml + dbus-binding-tool --prefix=nm_active_connection --mode=glib-client --output=$@ $< + +nm-ip4-config-bindings.h: $(top_srcdir)/introspection/nm-ip4-config.xml + dbus-binding-tool --prefix=nm_ip4_config --mode=glib-client --output=$@ $< + +nm-dhcp4-config-bindings.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml + dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-client --output=$@ $< + +nm-ip6-config-bindings.h: $(top_srcdir)/introspection/nm-ip6-config.xml + dbus-binding-tool --prefix=nm_ip6_config --mode=glib-client --output=$@ $< + +nm-dhcp6-config-bindings.h: $(top_srcdir)/introspection/nm-dhcp6-config.xml + dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-client --output=$@ $< + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c new file mode 100644 index 00000000..3ac0a24c --- /dev/null +++ b/libnm-glib/libnm-glib-test.c @@ -0,0 +1,419 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include +#include +#include + +#include +#include +#include + +#include "wireless-helper.h" + +#include "nm-client.h" +#include "nm-device.h" +#include "nm-device-ethernet.h" +#include "nm-device-wifi.h" +#include "nm-utils.h" +#include "nm-active-connection.h" +#include "nm-vpn-connection.h" +#include "nm-setting-ip4-config.h" + +static gboolean +test_wireless_enabled (NMClient *client) +{ + gboolean wireless; + + wireless = nm_client_wireless_get_enabled (client); + g_print ("Wireless enabled? %s\n", wireless ? "yes" : "no"); + +// nm_client_wireless_set_enabled (client, !wireless); + + wireless = nm_client_wireless_hardware_get_enabled (client); + g_print ("Wireless HW enabled? %s\n", wireless ? "yes" : "no"); + +// nm_client_wireless_set_enabled (client, !wireless); + + return TRUE; +} + +static gboolean +test_get_state (NMClient *client) +{ + guint state; + + state = nm_client_get_state (client); + g_print ("Current state: %d\n", state); + + return TRUE; +} + +static gchar * +ip4_address_as_string (guint32 ip) +{ + char buf[INET_ADDRSTRLEN+1]; + struct in_addr tmp_addr; + + memset (&buf, '\0', sizeof (buf)); + tmp_addr.s_addr = ip; + + if (inet_ntop (AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN)) { + return g_strdup (buf); + } else { + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (tmp_addr.s_addr)); + return NULL; + } +} + +static void +dump_ip4_config (NMIP4Config *cfg) +{ + char *tmp; + const GArray *array; + const GPtrArray *ptr_array; + GSList *iter; + int i; + + for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) { + NMIP4Address *addr = iter->data; + guint32 u; + + tmp = ip4_address_as_string (nm_ip4_address_get_address (addr)); + g_print ("IP4 address: %s\n", tmp); + g_free (tmp); + + u = nm_ip4_address_get_prefix (addr); + tmp = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (u)); + g_print ("IP4 prefix: %d (%s)\n", u, tmp); + g_free (tmp); + + tmp = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); + g_print ("IP4 gateway: %s\n\n", tmp); + g_free (tmp); + } + + array = nm_ip4_config_get_nameservers (cfg); + if (array) { + g_print ("IP4 DNS:\n"); + for (i = 0; i < array->len; i++) { + tmp = ip4_address_as_string (g_array_index (array, guint32, i)); + g_print ("\t%s\n", tmp); + g_free (tmp); + } + } + + ptr_array = nm_ip4_config_get_domains (cfg); + if (ptr_array) { + g_print ("IP4 domains:\n"); + for (i = 0; i < ptr_array->len; i++) + g_print ("\t%s\n", (const char *) g_ptr_array_index (ptr_array, i)); + } + + array = nm_ip4_config_get_wins_servers (cfg); + if (array) { + g_print ("IP4 WINS:\n"); + for (i = 0; i < array->len; i++) { + tmp = ip4_address_as_string (g_array_index (array, guint32, i)); + g_print ("\t%s\n", tmp); + g_free (tmp); + } + } +} + +static void +print_one_dhcp4_option (gpointer key, gpointer data, gpointer user_data) +{ + const char *option = (const char *) key; + const char *value = (const char *) data; + + g_print (" %s: %s\n", option, value); +} + +static void +dump_dhcp4_config (NMDHCP4Config *config) +{ + GHashTable *options = NULL; + + if (!config) + return; + + g_print ("\nDHCP4 Options:\n"); + g_print ("-------------------------------------\n"); + + g_object_get (G_OBJECT (config), NM_DHCP4_CONFIG_OPTIONS, &options, NULL); + g_hash_table_foreach (options, print_one_dhcp4_option, NULL); +} + +static void +dump_access_point (NMAccessPoint *ap) +{ + const GByteArray * ssid; + const char * str; + + ssid = nm_access_point_get_ssid (ap); + g_print ("\tSsid: %s\n", + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); + + str = nm_access_point_get_hw_address (ap); + g_print ("\tMAC Address: %s\n", str); + + g_print ("\tFlags: 0x%X\n", nm_access_point_get_flags (ap)); + g_print ("\tWPA Flags: 0x%X\n", nm_access_point_get_wpa_flags (ap)); + g_print ("\tRSN Flags: 0x%X\n", nm_access_point_get_rsn_flags (ap)); + g_print ("\tFrequency: %u\n", nm_access_point_get_frequency (ap)); + + g_print ("\tMode: %d\n", nm_access_point_get_mode (ap)); + g_print ("\tRate: %d\n", nm_access_point_get_max_bitrate (ap)); + g_print ("\tStrength: %d\n", nm_access_point_get_strength (ap)); +} + +static void +dump_wireless (NMDeviceWifi *device) +{ + const char *str; + const GPtrArray *aps; + int i; + + g_print ("Mode: %d\n", nm_device_wifi_get_mode (device)); + g_print ("Bitrate: %d\n", nm_device_wifi_get_bitrate (device)); + + str = nm_device_wifi_get_hw_address (device); + g_print ("MAC: %s\n", str); + + g_print ("AccessPoints:\n"); + aps = nm_device_wifi_get_access_points (device); + for (i = 0; i < aps->len; i++) { + dump_access_point (NM_ACCESS_POINT (g_ptr_array_index (aps, i))); + g_print ("\n"); + } +} + +static void +dump_wired (NMDeviceEthernet *device) +{ + const char *str; + + g_print ("Speed: %d\n", nm_device_ethernet_get_speed (device)); + + str = nm_device_ethernet_get_hw_address (device); + g_print ("MAC: %s\n", str); +} + +static void +dump_device (NMDevice *device) +{ + const char *str; + NMDeviceState state; + + str = nm_device_get_iface (device); + g_print ("Interface: %s\n", str); + + str = nm_device_get_udi (device); + g_print ("Udi: %s\n", str); + + str = nm_device_get_driver (device); + g_print ("Driver: %s\n", str); + + str = nm_device_get_vendor (device); + g_print ("Vendor: %s\n", str); + + str = nm_device_get_product (device); + g_print ("Product: %s\n", str); + + state = nm_device_get_state (device); + g_print ("State: %d\n", state); + + if (state == NM_DEVICE_STATE_ACTIVATED) + dump_ip4_config (nm_device_get_ip4_config (device)); + + if (NM_IS_DEVICE_ETHERNET (device)) + dump_wired (NM_DEVICE_ETHERNET (device)); + else if (NM_IS_DEVICE_WIFI (device)) + dump_wireless (NM_DEVICE_WIFI (device)); + + dump_dhcp4_config (nm_device_get_dhcp4_config (device)); +} + +static gboolean +test_devices (NMClient *client) +{ + const GPtrArray *devices; + int i; + + devices = nm_client_get_devices (client); + g_print ("Got devices:\n"); + if (!devices) { + g_print (" NONE\n"); + return TRUE; + } + + for (i = 0; i < devices->len; i++) { + NMDevice *device = g_ptr_array_index (devices, i); + dump_device (device); + g_print ("\n"); + } + + return TRUE; +} + +static void +active_connections_changed (NMClient *client, GParamSpec *pspec, gpointer user_data) +{ + const GPtrArray *connections; + int i, j; + + g_print ("Active connections changed:\n"); + connections = nm_client_get_active_connections (client); + for (i = 0; connections && (i < connections->len); i++) { + NMActiveConnection *connection; + const GPtrArray *devices; + + connection = g_ptr_array_index (connections, i); + g_print (" %s\n", nm_object_get_path (NM_OBJECT (connection))); + devices = nm_active_connection_get_devices (connection); + for (j = 0; devices && j < devices->len; j++) + g_print (" %s\n", nm_device_get_udi (g_ptr_array_index (devices, j))); + if (NM_IS_VPN_CONNECTION (connection)) + g_print (" VPN base connection: %s\n", nm_active_connection_get_specific_object (connection)); + } +} + +static void +show_active_connection_device (gpointer data, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (data); + + g_print (" %s\n", nm_device_get_udi (device)); +} + +static void +test_get_active_connections (NMClient *client) +{ + const GPtrArray *connections; + int i; + + g_print ("Active connections:\n"); + connections = nm_client_get_active_connections (client); + for (i = 0; connections && (i < connections->len); i++) { + const GPtrArray *devices; + + g_print (" %s\n", nm_object_get_path (g_ptr_array_index (connections, i))); + devices = nm_active_connection_get_devices (g_ptr_array_index (connections, i)); + g_ptr_array_foreach ((GPtrArray *) devices, show_active_connection_device, NULL); + } +} + +static void +device_state_changed (NMDevice *device, GParamSpec *pspec, gpointer user_data) +{ + g_print ("Device state changed: %s %d\n", + nm_device_get_iface (device), + nm_device_get_state (device)); +} + +static void +device_added_cb (NMClient *client, NMDevice *device, gpointer user_data) +{ + g_print ("New device added\n"); + dump_device (device); + g_signal_connect (G_OBJECT (device), "notify::state", + (GCallback) device_state_changed, NULL); +} + +static void +device_removed_cb (NMClient *client, NMDevice *device, gpointer user_data) +{ + g_print ("Device removed\n"); + dump_device (device); +} + +static void +manager_running (NMClient *client, GParamSpec *pspec, gpointer user_data) +{ + if (nm_client_get_manager_running (client)) { + g_print ("NM appeared\n"); + test_wireless_enabled (client); + test_get_state (client); + test_get_active_connections (client); + test_devices (client); + } else + g_print ("NM disappeared\n"); +} + +static GMainLoop *loop = NULL; + +static void +signal_handler (int signo) +{ + if (signo == SIGINT || signo == SIGTERM) { + g_message ("Caught signal %d, shutting down...", signo); + g_main_loop_quit (loop); + } +} + +static void +setup_signals (void) +{ + struct sigaction action; + sigset_t mask; + + sigemptyset (&mask); + action.sa_handler = signal_handler; + action.sa_mask = mask; + action.sa_flags = 0; + sigaction (SIGTERM, &action, NULL); + sigaction (SIGINT, &action, NULL); +} + +int +main (int argc, char *argv[]) +{ + NMClient *client; + + g_type_init (); + + client = nm_client_new (); + if (!client) { + exit (1); + } + + g_signal_connect (client, "notify::" NM_CLIENT_MANAGER_RUNNING, + G_CALLBACK (manager_running), NULL); + g_signal_connect (client, "notify::" NM_CLIENT_ACTIVE_CONNECTIONS, + G_CALLBACK (active_connections_changed), NULL); + manager_running (client, NULL, NULL); + + g_signal_connect (client, "device-added", + G_CALLBACK (device_added_cb), NULL); + g_signal_connect (client, "device-removed", + G_CALLBACK (device_removed_cb), NULL); + + loop = g_main_loop_new (NULL, FALSE); + setup_signals (); + g_main_loop_run (loop); + + g_object_unref (client); + + return 0; +} diff --git a/libnm-glib/libnm-glib-vpn.pc.in b/libnm-glib/libnm-glib-vpn.pc.in new file mode 100644 index 00000000..73b7a9c7 --- /dev/null +++ b/libnm-glib/libnm-glib-vpn.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libnm-glib-vpn +Description: Convenience library for NetworkManager VPN plugins +Version: @VERSION@ +Requires: NetworkManager >= 0.7.999 glib-2.0 dbus-glib-1 +Cflags: -I${includedir}/libnm-glib +Libs: -L${libdir} -lnm-glib-vpn + + diff --git a/libnm-glib/libnm-glib-vpn.ver b/libnm-glib/libnm-glib-vpn.ver new file mode 100644 index 00000000..16643d2e --- /dev/null +++ b/libnm-glib/libnm-glib-vpn.ver @@ -0,0 +1,26 @@ +{ +global: + nm_vpn_plugin_disconnect; + nm_vpn_plugin_error_get_type; + nm_vpn_plugin_error_quark; + nm_vpn_plugin_failure; + nm_vpn_plugin_get_connection; + nm_vpn_plugin_get_state; + nm_vpn_plugin_get_type; + nm_vpn_plugin_set_ip4_config; + nm_vpn_plugin_set_login_banner; + nm_vpn_plugin_set_state; + nm_vpn_plugin_ui_interface_delete_connection; + nm_vpn_plugin_ui_interface_export; + nm_vpn_plugin_ui_interface_get_capabilities; + nm_vpn_plugin_ui_interface_get_suggested_name; + nm_vpn_plugin_ui_interface_get_type; + nm_vpn_plugin_ui_interface_import; + nm_vpn_plugin_ui_interface_ui_factory; + nm_vpn_plugin_ui_widget_interface_get_type; + nm_vpn_plugin_ui_widget_interface_get_widget; + nm_vpn_plugin_ui_widget_interface_save_secrets; + nm_vpn_plugin_ui_widget_interface_update_connection; +local: + *; +}; diff --git a/libnm-glib/libnm-glib.pc.in b/libnm-glib/libnm-glib.pc.in new file mode 100644 index 00000000..5c3471b1 --- /dev/null +++ b/libnm-glib/libnm-glib.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libnm-glib +Description: Convenience library for clients of NetworkManager +Version: @VERSION@ +Requires: NetworkManager >= 0.7.999 glib-2.0 dbus-glib-1 +Cflags: -I${includedir}/libnm-glib +Libs: -L${libdir} -lnm-glib + + diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver new file mode 100644 index 00000000..6d48fb38 --- /dev/null +++ b/libnm-glib/libnm-glib.ver @@ -0,0 +1,161 @@ +{ +global: + libnm_glib_get_network_state; + libnm_glib_init; + libnm_glib_register_callback; + libnm_glib_shutdown; + libnm_glib_unregister_callback; + nm_access_point_get_flags; + nm_access_point_get_frequency; + nm_access_point_get_hw_address; + nm_access_point_get_max_bitrate; + nm_access_point_get_mode; + nm_access_point_get_rsn_flags; + nm_access_point_get_ssid; + nm_access_point_get_strength; + nm_access_point_get_type; + nm_access_point_get_wpa_flags; + nm_access_point_new; + nm_active_connection_get_connection; + nm_active_connection_get_default; + nm_active_connection_get_default6; + nm_active_connection_get_devices; + nm_active_connection_get_scope; + nm_active_connection_get_service_name; + nm_active_connection_get_specific_object; + nm_active_connection_get_state; + nm_active_connection_get_type; + nm_active_connection_new; + nm_cdma_device_get_type; + nm_cdma_device_new; + nm_client_activate_connection; + nm_client_deactivate_connection; + nm_client_get_active_connections; + nm_client_get_device_by_path; + nm_client_get_devices; + nm_client_get_manager_running; + nm_client_get_state; + nm_client_get_type; + nm_client_networking_get_enabled; + nm_client_networking_set_enabled; + nm_client_new; + nm_client_sleep; + nm_client_wireless_get_enabled; + nm_client_wireless_hardware_get_enabled; + nm_client_wireless_set_enabled; + nm_client_wwan_get_enabled; + nm_client_wwan_hardware_get_enabled; + nm_client_wwan_set_enabled; + nm_dbus_settings_get_connection_by_path; + nm_dbus_settings_get_type; + nm_dbus_settings_new; + nm_dbus_settings_system_add_connection; + nm_dbus_settings_system_get_can_modify; + nm_dbus_settings_system_get_type; + nm_dbus_settings_system_get_unmanaged_devices; + nm_dbus_settings_system_new; + nm_device_disconnect; + nm_device_bt_new; + nm_device_bt_get_capabilities; + nm_device_bt_get_hw_address; + nm_device_bt_get_name; + nm_device_bt_get_type; + nm_device_ethernet_get_carrier; + nm_device_ethernet_get_hw_address; + nm_device_ethernet_get_speed; + nm_device_ethernet_get_type; + nm_device_ethernet_new; + nm_device_get_capabilities; + nm_device_get_dhcp4_config; + nm_device_get_driver; + nm_device_get_iface; + nm_device_get_ip4_config; + nm_device_get_ip6_config; + nm_device_get_managed; + nm_device_get_product; + nm_device_get_state; + nm_device_get_type; + nm_device_get_udi; + nm_device_get_vendor; + nm_device_new; + nm_device_wifi_get_access_point_by_path; + nm_device_wifi_get_access_points; + nm_device_wifi_get_active_access_point; + nm_device_wifi_get_bitrate; + nm_device_wifi_get_capabilities; + nm_device_wifi_get_hw_address; + nm_device_wifi_get_mode; + nm_device_wifi_get_type; + nm_device_wifi_new; + nm_dhcp4_config_get_one_option; + nm_dhcp4_config_get_options; + nm_dhcp4_config_get_type; + nm_dhcp4_config_new; + nm_exported_connection_export; + nm_exported_connection_get_type; + nm_exported_connection_new; + nm_gsm_device_get_type; + nm_gsm_device_new; + nm_ip4_config_get_addresses; + nm_ip4_config_get_domains; + nm_ip4_config_get_hostname; + nm_ip4_config_get_nameservers; + nm_ip4_config_get_wins_servers; + nm_ip4_config_get_routes; + nm_ip4_config_get_type; + nm_ip4_config_new; + nm_ip6_address_array_get_type; + nm_ip6_address_object_array_get_type; + nm_ip6_config_get_addresses; + nm_ip6_config_get_domains; + nm_ip6_config_get_nameservers; + nm_ip6_config_get_routes; + nm_ip6_config_get_type; + nm_ip6_config_new; + nm_ip6_route_object_array_get_type; + nm_object_array_get_type; + nm_object_get_connection; + nm_object_get_path; + nm_object_get_type; + nm_remote_connection_get_type; + nm_remote_connection_new; + nm_remote_settings_get_type; + nm_remote_settings_new; + nm_remote_settings_system_get_type; + nm_remote_settings_system_new; + nm_serial_device_get_bytes_received; + nm_serial_device_get_bytes_sent; + nm_serial_device_get_type; + nm_settings_connection_interface_delete; + nm_settings_connection_interface_emit_updated; + nm_settings_connection_interface_get_secrets; + nm_settings_connection_interface_get_type; + nm_settings_connection_interface_update; + nm_settings_interface_add_connection; + nm_settings_interface_error_get_type; + nm_settings_interface_error_quark; + nm_settings_interface_get_connection_by_path; + nm_settings_interface_get_type; + nm_settings_interface_list_connections; + nm_settings_service_export; + nm_settings_service_export_connection; + nm_settings_service_get_connection_by_path; + nm_settings_service_get_type; + nm_settings_system_interface_get_type; + nm_settings_system_interface_add_connection; + nm_settings_system_interface_get_permissions; + nm_settings_system_interface_save_hostname; + nm_settings_error_quark; + nm_settings_get_type; + nm_settings_list_connections; + nm_settings_signal_new_connection; + nm_ssid_get_type; + nm_string_array_get_type; + nm_uint_array_get_type; + nm_vpn_connection_get_banner; + nm_vpn_connection_get_type; + nm_vpn_connection_get_vpn_state; + nm_vpn_connection_new; +local: + *; +}; diff --git a/libnm-glib/libnm_glib.c b/libnm-glib/libnm_glib.c new file mode 100644 index 00000000..5e0e5cf5 --- /dev/null +++ b/libnm-glib/libnm_glib.c @@ -0,0 +1,600 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include "NetworkManager.h" +#include "libnm_glib.h" + +#define DBUS_NO_SERVICE_ERROR "org.freedesktop.DBus.Error.ServiceDoesNotExist" +#define NM_DBUS_SIGNAL_STATE_CHANGE "StateChange" + + +struct libnm_glib_ctx +{ + unsigned char check; + + GMainContext * g_main_ctx; + GMainLoop * g_main_loop; + DBusConnection * dbus_con; + guint dbus_watcher; + guint dbus_watch_interval; + + gboolean thread_done; + gboolean thread_inited; + GThread * thread; + + GSList * callbacks; + GMutex * callbacks_lock; + guint callback_id_last; + + libnm_glib_state nm_state; +}; + +typedef struct libnm_glib_callback +{ + guint id; + GMainContext * gmain_ctx; + libnm_glib_ctx * libnm_glib_ctx; + libnm_glib_callback_func func; + gpointer user_data; +} libnm_glib_callback; + + +static void libnm_glib_schedule_dbus_watcher (libnm_glib_ctx *ctx); +static DBusConnection * libnm_glib_dbus_init (gpointer *user_data, GMainContext *context); +static void libnm_glib_update_state (libnm_glib_ctx *ctx, NMState state); + + +static void +libnm_glib_nm_state_cb (DBusPendingCall *pcall, + void *user_data) +{ + DBusMessage * reply; + libnm_glib_ctx * ctx = (libnm_glib_ctx *) user_data; + NMState nm_state; + + g_return_if_fail (pcall != NULL); + g_return_if_fail (ctx != NULL); + + if (!(reply = dbus_pending_call_steal_reply (pcall))) + goto out; + + if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR) + { + DBusError err; + + dbus_error_init (&err); + dbus_set_error_from_message (&err, reply); + fprintf (stderr, "%s: dbus returned an error.\n (%s) %s\n", __func__, err.name, err.message); + dbus_error_free (&err); + dbus_message_unref (reply); + goto out; + } + + if (dbus_message_get_args (reply, NULL, DBUS_TYPE_UINT32, &nm_state, DBUS_TYPE_INVALID)) + libnm_glib_update_state (ctx, nm_state); + + dbus_message_unref (reply); + +out: + dbus_pending_call_unref (pcall); +} + +static void +libnm_glib_get_nm_state (libnm_glib_ctx *ctx) +{ + DBusMessage * message; + DBusPendingCall * pcall = NULL; + + g_return_if_fail (ctx != NULL); + + if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE, "state"))) + { + dbus_connection_send_with_reply (ctx->dbus_con, message, &pcall, -1); + if (pcall) + dbus_pending_call_set_notify (pcall, libnm_glib_nm_state_cb, ctx, NULL); + dbus_message_unref (message); + } +} + +static gboolean +libnm_glib_callback_helper (gpointer user_data) +{ + libnm_glib_callback *cb_data = (libnm_glib_callback *)user_data; + + g_return_val_if_fail (cb_data != NULL, FALSE); + g_return_val_if_fail (cb_data->func != NULL, FALSE); + g_return_val_if_fail (cb_data->libnm_glib_ctx != NULL, FALSE); + + (*(cb_data->func)) (cb_data->libnm_glib_ctx, cb_data->user_data); + + return FALSE; +} + +static void +libnm_glib_schedule_single_callback (libnm_glib_ctx *ctx, + libnm_glib_callback *callback) +{ + GSource *source; + + g_return_if_fail (ctx != NULL); + g_return_if_fail (callback != NULL); + + callback->libnm_glib_ctx = ctx; + + source = g_idle_source_new (); + g_source_set_callback (source, libnm_glib_callback_helper, callback, NULL); + g_source_attach (source, callback->gmain_ctx); + g_source_unref (source); +} + +static void +libnm_glib_unschedule_single_callback (libnm_glib_ctx *ctx, + libnm_glib_callback *callback) +{ + GSource *source; + + g_return_if_fail (ctx != NULL); + g_return_if_fail (callback != NULL); + + source = g_main_context_find_source_by_user_data (callback->gmain_ctx, callback); + if (source) + g_source_destroy (source); +} + +static void +libnm_glib_call_callbacks (libnm_glib_ctx *ctx) +{ + GSList *elem; + + g_return_if_fail (ctx != NULL); + + g_mutex_lock (ctx->callbacks_lock); + for (elem = ctx->callbacks; elem; elem = g_slist_next (elem)) + { + libnm_glib_callback *callback = (libnm_glib_callback *)(elem->data); + if (callback) + libnm_glib_schedule_single_callback (ctx, callback); + } + g_mutex_unlock (ctx->callbacks_lock); +} + + +static void +libnm_glib_update_state (libnm_glib_ctx *ctx, + NMState state) +{ + libnm_glib_state old_state; + + g_return_if_fail (ctx != NULL); + + old_state = ctx->nm_state; + switch (state) + { + case NM_STATE_CONNECTED: + ctx->nm_state = LIBNM_ACTIVE_NETWORK_CONNECTION; + break; + + case NM_STATE_ASLEEP: + case NM_STATE_CONNECTING: + case NM_STATE_DISCONNECTED: + ctx->nm_state = LIBNM_NO_NETWORK_CONNECTION; + break; + + case NM_STATE_UNKNOWN: + default: + ctx->nm_state = LIBNM_NO_NETWORKMANAGER; + break; + } + + if (old_state != ctx->nm_state) + libnm_glib_call_callbacks (ctx); +} + + +static DBusHandlerResult +libnm_glib_dbus_filter (DBusConnection *connection, + DBusMessage *message, + void *user_data) +{ + libnm_glib_ctx *ctx = (libnm_glib_ctx *)user_data; + gboolean handled = TRUE; + DBusError error; + + g_return_val_if_fail (ctx != NULL, DBUS_HANDLER_RESULT_NOT_YET_HANDLED); + g_return_val_if_fail (connection != NULL, DBUS_HANDLER_RESULT_NOT_YET_HANDLED); + g_return_val_if_fail (message != NULL, DBUS_HANDLER_RESULT_NOT_YET_HANDLED); + + dbus_error_init (&error); + if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) + { + /* Try to reactivate our connection to dbus on the next pass through the event loop */ + ctx->nm_state = LIBNM_NO_DBUS; + dbus_connection_close (ctx->dbus_con); + dbus_connection_unref (ctx->dbus_con); + ctx->dbus_con = NULL; + libnm_glib_schedule_dbus_watcher (ctx); + } + else if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) + { + /* New signal for dbus 0.23... */ + char *service; + char *old_owner; + char *new_owner; + + if ( dbus_message_get_args (message, &error, + DBUS_TYPE_STRING, &service, + DBUS_TYPE_STRING, &old_owner, + DBUS_TYPE_STRING, &new_owner, + DBUS_TYPE_INVALID)) + { + if (strcmp (service, NM_DBUS_SERVICE) == 0) + { + gboolean old_owner_good = (old_owner && (strlen (old_owner) > 0)); + gboolean new_owner_good = (new_owner && (strlen (new_owner) > 0)); + + if (!old_owner_good && new_owner_good) /* Equivalent to old ServiceCreated signal */ + libnm_glib_get_nm_state (ctx); + else if (old_owner_good && !new_owner_good) /* Equivalent to old ServiceDeleted signal */ + ctx->nm_state = LIBNM_NO_NETWORKMANAGER; + } + } + } + else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive") + || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive") + || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating") + || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DevicesChanged")) + { + libnm_glib_get_nm_state (ctx); + } + else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, NM_DBUS_SIGNAL_STATE_CHANGE)) + { + NMState state = NM_STATE_UNKNOWN; + + dbus_message_get_args (message, &error, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID); + libnm_glib_update_state (ctx, state); + } + else + handled = FALSE; + + if (dbus_error_is_set (&error)) + dbus_error_free (&error); + + return (handled ? DBUS_HANDLER_RESULT_HANDLED : DBUS_HANDLER_RESULT_NOT_YET_HANDLED); +} + + +/* + * libnm_glib_dbus_init + * + * Initialize a connection to dbus and set up our callbacks. + * + */ +static DBusConnection * +libnm_glib_dbus_init (gpointer *user_data, + GMainContext *context) +{ + DBusConnection *connection = NULL; + DBusError error; + + dbus_error_init (&error); + connection = dbus_bus_get_private (DBUS_BUS_SYSTEM, &error); + if (dbus_error_is_set (&error)) + { + fprintf (stderr, "%s: error, %s raised:\n %s\n\n", __func__, error.name, error.message); + dbus_error_free (&error); + return (NULL); + } + if (!connection) + return NULL; + + if (!dbus_connection_add_filter (connection, libnm_glib_dbus_filter, user_data, NULL)) + return (NULL); + + dbus_connection_set_exit_on_disconnect (connection, FALSE); + dbus_connection_setup_with_g_main (connection, context); + + dbus_error_init (&error); + dbus_bus_add_match (connection, + "type='signal'," + "interface='" DBUS_INTERFACE_DBUS "'," + "sender='" DBUS_SERVICE_DBUS "'", + &error); + if (dbus_error_is_set (&error)) + dbus_error_free (&error); + + dbus_error_init (&error); + dbus_bus_add_match (connection, + "type='signal'," + "interface='" NM_DBUS_INTERFACE "'," + "path='" NM_DBUS_PATH "'," + "sender='" NM_DBUS_SERVICE "'", + &error); + if (dbus_error_is_set (&error)) + dbus_error_free (&error); + + return (connection); +} + + +/* + * libnm_glib_dbus_watcher + * + * Repeatedly try to re-activate the connection to dbus. + * + */ +static gboolean +libnm_glib_dbus_watcher (gpointer user_data) +{ + libnm_glib_ctx *ctx = (libnm_glib_ctx *)user_data; + + g_return_val_if_fail (ctx != NULL, FALSE); + + ctx->dbus_watcher = 0; + + if (!ctx->dbus_con) + ctx->dbus_con = libnm_glib_dbus_init ((gpointer)ctx, ctx->g_main_ctx); + + if (ctx->dbus_con) + { + /* Get NM's state right away after we reconnect */ + libnm_glib_get_nm_state (ctx); + ctx->dbus_watch_interval = 1000; + } + else + { + /* Wait 3 seconds longer each time we fail to reconnect to dbus, + * with a maximum wait of one minute. + */ + ctx->dbus_watch_interval = MIN(ctx->dbus_watch_interval + 3000, 60000); + + /* Reschule ourselves if we _still_ don't have a connection to dbus */ + libnm_glib_schedule_dbus_watcher (ctx); + } + + return FALSE; +} + + +/* + * libnm_glib_schedule_dbus_watcher + * + * Schedule an idle handler in our main loop to repeatedly + * attempt to re-activate the dbus connection until connected. + * + */ +static void +libnm_glib_schedule_dbus_watcher (libnm_glib_ctx *ctx) +{ + g_return_if_fail (ctx != NULL); + + if (ctx->dbus_watcher == 0) + { + GSource * source = g_timeout_source_new (ctx->dbus_watch_interval); + g_source_set_callback (source, libnm_glib_dbus_watcher, (gpointer) ctx, NULL); + ctx->dbus_watcher = g_source_attach (source, ctx->g_main_ctx); + g_source_unref (source); + } +} + + +/* + * libnm_glib_dbus_worker + * + * Main thread for libnm + * + */ +static gpointer +libnm_glib_dbus_worker (gpointer user_data) +{ + libnm_glib_ctx *ctx = (libnm_glib_ctx *)user_data; + + g_return_val_if_fail (ctx != NULL, NULL); + + /* If dbus isn't up yet, schedule an idle handler to check for dbus. + * We also need a way to reconnect to dbus if the connection ever goes + * down. Should probably be done by a timeout polling dbus_connection_is_connected() + * or by getting connection status out of libdbus or something. + */ + if (!(ctx->dbus_con = libnm_glib_dbus_init ((gpointer) ctx, ctx->g_main_ctx))) + libnm_glib_schedule_dbus_watcher (ctx); + else + libnm_glib_get_nm_state (ctx); + + ctx->thread_inited = TRUE; + g_main_loop_run (ctx->g_main_loop); + ctx->thread_done = TRUE; + + return NULL; +} + + +static void +libnm_glib_ctx_free (libnm_glib_ctx *ctx) +{ + g_return_if_fail (ctx != NULL); + + if (ctx->check == 0xDD) + { + fprintf (stderr, "%s: context %p already freed!\n", __func__, ctx); + return; + } + + if (ctx->g_main_ctx) + g_main_context_unref (ctx->g_main_ctx); + if (ctx->g_main_loop) + g_main_loop_unref (ctx->g_main_loop); + + if (ctx->dbus_con) + { + dbus_connection_close (ctx->dbus_con); + dbus_connection_unref (ctx->dbus_con); + ctx->dbus_con = NULL; + } + + if (ctx->callbacks_lock) + g_mutex_free (ctx->callbacks_lock); + + g_slist_foreach (ctx->callbacks, (GFunc)g_free, NULL); + g_slist_free (ctx->callbacks); + + if (ctx->thread) + g_thread_join (ctx->thread); + + memset (ctx, 0, sizeof (libnm_glib_ctx)); + memset (&(ctx->check), 0xDD, sizeof (ctx->check)); + g_free (ctx); +} + + +static libnm_glib_ctx * +libnm_glib_ctx_new (void) +{ + libnm_glib_ctx *ctx = g_malloc0 (sizeof (libnm_glib_ctx)); + + if (!(ctx->g_main_ctx = g_main_context_new ())) + goto error; + if (!(ctx->g_main_loop = g_main_loop_new (ctx->g_main_ctx, FALSE))) + goto error; + if (!(ctx->callbacks_lock = g_mutex_new ())) + goto error; + ctx->dbus_watch_interval = 1000; + + return ctx; + +error: + libnm_glib_ctx_free (ctx); + return NULL; +} + + +libnm_glib_ctx * +libnm_glib_init (void) +{ + libnm_glib_ctx *ctx = NULL; + + g_type_init (); + if (!g_thread_supported ()) + g_thread_init (NULL); + dbus_g_thread_init (); + + if (!(ctx = libnm_glib_ctx_new ())) + return NULL; + + ctx->thread = g_thread_create (libnm_glib_dbus_worker, ctx, TRUE, NULL); + if (!ctx->thread) + goto error; + + /* Wait until initialization of the thread */ + while (!ctx->thread_inited) + g_usleep (G_USEC_PER_SEC / 20); + + return ctx; + +error: + libnm_glib_ctx_free (ctx); + return NULL; +} + + +void +libnm_glib_shutdown (libnm_glib_ctx *ctx) +{ + g_return_if_fail (ctx != NULL); + + g_main_loop_quit (ctx->g_main_loop); + while (!ctx->thread_done) + g_usleep (G_USEC_PER_SEC / 20); + + libnm_glib_ctx_free (ctx); +} + + +libnm_glib_state +libnm_glib_get_network_state (const libnm_glib_ctx *ctx) +{ + if (!ctx) + return LIBNM_INVALID_CONTEXT; + + return ctx->nm_state; +} + + +guint +libnm_glib_register_callback (libnm_glib_ctx *ctx, + libnm_glib_callback_func func, + gpointer user_data, + GMainContext *g_main_ctx) +{ + libnm_glib_callback *callback = NULL; + + g_return_val_if_fail (ctx != NULL, 0); + g_return_val_if_fail (func != NULL, 0); + + callback = g_malloc0 (sizeof (libnm_glib_callback)); + + callback->id = ++ (ctx->callback_id_last); + callback->func = func; + callback->gmain_ctx = g_main_ctx; + callback->libnm_glib_ctx = ctx; + callback->user_data = user_data; + + g_mutex_lock (ctx->callbacks_lock); + ctx->callbacks = g_slist_append (ctx->callbacks, callback); + libnm_glib_schedule_single_callback (ctx, callback); + g_mutex_unlock (ctx->callbacks_lock); + + return (callback->id); +} + + +void +libnm_glib_unregister_callback (libnm_glib_ctx *ctx, + guint id) +{ + GSList *elem; + + g_return_if_fail (ctx != NULL); + g_return_if_fail (id > 0); + + g_mutex_lock (ctx->callbacks_lock); + elem = ctx->callbacks; + while (elem) + { + libnm_glib_callback *callback = (libnm_glib_callback *)(elem->data); + if (callback && (callback->id == id)) + { + libnm_glib_unschedule_single_callback (ctx, callback); + ctx->callbacks = g_slist_remove_link (ctx->callbacks, elem); + break; + } + + elem = g_slist_next (elem); + } + g_mutex_unlock (ctx->callbacks_lock); +} diff --git a/libnm-glib/libnm_glib.h b/libnm-glib/libnm_glib.h new file mode 100644 index 00000000..01c055d0 --- /dev/null +++ b/libnm-glib/libnm_glib.h @@ -0,0 +1,60 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + */ + +#ifndef _LIB_NM_H_ +#define _LIB_NM_H_ + +#ifndef NM_DISABLE_DEPRECATED + +#include + +G_BEGIN_DECLS + +typedef enum libnm_glib_state +{ + LIBNM_NO_DBUS = 0, + LIBNM_NO_NETWORKMANAGER, + LIBNM_NO_NETWORK_CONNECTION, + LIBNM_ACTIVE_NETWORK_CONNECTION, + LIBNM_INVALID_CONTEXT +} libnm_glib_state G_GNUC_DEPRECATED; + +typedef struct libnm_glib_ctx libnm_glib_ctx G_GNUC_DEPRECATED; + + +typedef void (*libnm_glib_callback_func) (libnm_glib_ctx *libnm_ctx, gpointer user_data) G_GNUC_DEPRECATED; + + +G_GNUC_DEPRECATED libnm_glib_ctx * libnm_glib_init (void); +G_GNUC_DEPRECATED void libnm_glib_shutdown (libnm_glib_ctx *ctx); + +G_GNUC_DEPRECATED libnm_glib_state libnm_glib_get_network_state (const libnm_glib_ctx *ctx); + +G_GNUC_DEPRECATED guint libnm_glib_register_callback (libnm_glib_ctx *ctx, libnm_glib_callback_func func, gpointer user_data, GMainContext *g_main_ctx); +G_GNUC_DEPRECATED void libnm_glib_unregister_callback (libnm_glib_ctx *ctx, guint id); + +G_END_DECLS + +#endif /* NM_DISABLE_DEPRECATED */ + +#endif /* _LIB_NM_H_ */ diff --git a/libnm-glib/nm-access-point.c b/libnm-glib/nm-access-point.c new file mode 100644 index 00000000..777e41de --- /dev/null +++ b/libnm-glib/nm-access-point.c @@ -0,0 +1,597 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include + +#include "nm-access-point.h" +#include "NetworkManager.h" +#include "nm-types-private.h" +#include "nm-object-private.h" + +#include "nm-access-point-bindings.h" + +G_DEFINE_TYPE (NMAccessPoint, nm_access_point, NM_TYPE_OBJECT) + +#define NM_ACCESS_POINT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACCESS_POINT, NMAccessPointPrivate)) + +typedef struct { + gboolean disposed; + DBusGProxy *proxy; + + guint32 flags; + guint32 wpa_flags; + guint32 rsn_flags; + GByteArray *ssid; + guint32 frequency; + char *hw_address; + NM80211Mode mode; + guint32 max_bitrate; + guint8 strength; +} NMAccessPointPrivate; + +enum { + PROP_0, + PROP_FLAGS, + PROP_WPA_FLAGS, + PROP_RSN_FLAGS, + PROP_SSID, + PROP_FREQUENCY, + PROP_HW_ADDRESS, + PROP_MODE, + PROP_MAX_BITRATE, + PROP_STRENGTH, + + LAST_PROP +}; + +#define DBUS_PROP_FLAGS "Flags" +#define DBUS_PROP_WPA_FLAGS "WpaFlags" +#define DBUS_PROP_RSN_FLAGS "RsnFlags" +#define DBUS_PROP_SSID "Ssid" +#define DBUS_PROP_FREQUENCY "Frequency" +#define DBUS_PROP_HW_ADDRESS "HwAddress" +#define DBUS_PROP_MODE "Mode" +#define DBUS_PROP_MAX_BITRATE "MaxBitrate" +#define DBUS_PROP_STRENGTH "Strength" + +/** + * nm_access_point_new: + * @connection: the #DBusGConnection + * @path: the DBusobject path of the access point + * + * Creates a new #NMAccessPoint. + * + * Returns: a new access point + **/ +GObject * +nm_access_point_new (DBusGConnection *connection, const char *path) +{ + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return (GObject *) g_object_new (NM_TYPE_ACCESS_POINT, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); +} + +/** + * nm_access_point_get_flags: + * @ap: a #NMAccessPoint + * + * Gets the flags of the access point + * + * Returns: the flags + **/ +guint32 +nm_access_point_get_flags (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NM_802_11_AP_FLAGS_NONE); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->flags) { + priv->flags = _nm_object_get_uint_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_FLAGS); + } + + return priv->flags; +} + +/** + * nm_access_point_get_wpa_flags: + * @ap: a #NMAccessPoint + * + * Gets the WPA flags of the access point. + * + * Returns: the WPA flags + **/ +guint32 +nm_access_point_get_wpa_flags (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NM_802_11_AP_SEC_NONE); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->wpa_flags) { + priv->wpa_flags = _nm_object_get_uint_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_WPA_FLAGS); + } + + return priv->wpa_flags; +} + +/** + * nm_access_point_get_rsn_flags: + * @ap: a #NMAccessPoint + * + * Gets the RSN flags of the access point. + * + * Returns: the RSN flags + **/ +guint32 +nm_access_point_get_rsn_flags (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NM_802_11_AP_SEC_NONE); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->rsn_flags) { + priv->rsn_flags = _nm_object_get_uint_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_RSN_FLAGS); + } + + return priv->rsn_flags; +} + +/** + * nm_access_point_get_ssid: + * @ap: a #NMAccessPoint + * + * Gets the SSID of the access point. + * + * Returns: the #GByteArray containing the SSID. This is the internal copy used by the + * access point, and must not be modified. + **/ +const GByteArray * +nm_access_point_get_ssid (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NULL); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->ssid) { + priv->ssid = _nm_object_get_byte_array_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_SSID); + } + + return priv->ssid; +} + +/** + * nm_access_point_get_frequency: + * @ap: a #NMAccessPoint + * + * Gets the frequency of the access point. + * + * Returns: the frequency + **/ +guint32 +nm_access_point_get_frequency (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->frequency) { + priv->frequency = _nm_object_get_uint_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_FREQUENCY); + } + + return priv->frequency; +} + +/** + * nm_access_point_get_hw_address: + * @ap: a #NMAccessPoint + * + * Gets the hardware (MAC) address of the access point. + * + * Returns: the hardware address of the access point. This is the internal string used by the + * access point and must not be modified. + **/ +const char * +nm_access_point_get_hw_address (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NULL); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->hw_address) { + priv->hw_address = _nm_object_get_string_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_HW_ADDRESS); + } + + return priv->hw_address; +} + +/** + * nm_access_point_get_mode: + * @ap: a #NMAccessPoint + * + * Gets the mode of the access point. + * + * Returns: the mode + **/ +NM80211Mode +nm_access_point_get_mode (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->mode) { + priv->mode = _nm_object_get_uint_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_MODE); + } + + return priv->mode; +} + +/** + * nm_access_point_get_max_bitrate: + * @ap: a #NMAccessPoint + * + * Gets the maximum bit rate of the access point. + * + * Returns: the maximum bit rate + **/ +guint32 +nm_access_point_get_max_bitrate (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->max_bitrate) { + priv->max_bitrate = _nm_object_get_uint_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_MAX_BITRATE); + } + + return priv->max_bitrate; +} + +/** + * nm_access_point_get_strength: + * @ap: a #NMAccessPoint + * + * Gets the current signal strength of the access point. + * + * Returns: the signal strength + **/ +guint8 +nm_access_point_get_strength (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + + g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0); + + priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + if (!priv->strength) { + priv->strength = _nm_object_get_byte_property (NM_OBJECT (ap), + NM_DBUS_INTERFACE_ACCESS_POINT, + DBUS_PROP_STRENGTH); + } + + return priv->strength; +} + +/************************************************************/ + +static void +nm_access_point_init (NMAccessPoint *ap) +{ +} + +static void +dispose (GObject *object) +{ + NMAccessPointPrivate *priv = NM_ACCESS_POINT_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_access_point_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_access_point_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMAccessPointPrivate *priv = NM_ACCESS_POINT_GET_PRIVATE (object); + + if (priv->ssid) + g_byte_array_free (priv->ssid, TRUE); + + if (priv->hw_address) + g_free (priv->hw_address); + + G_OBJECT_CLASS (nm_access_point_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMAccessPoint *ap = NM_ACCESS_POINT (object); + + switch (prop_id) { + case PROP_FLAGS: + g_value_set_uint (value, nm_access_point_get_flags (ap)); + break; + case PROP_WPA_FLAGS: + g_value_set_uint (value, nm_access_point_get_wpa_flags (ap)); + break; + case PROP_RSN_FLAGS: + g_value_set_uint (value, nm_access_point_get_rsn_flags (ap)); + break; + case PROP_SSID: + g_value_set_boxed (value, nm_access_point_get_ssid (ap)); + break; + case PROP_FREQUENCY: + g_value_set_uint (value, nm_access_point_get_frequency (ap)); + break; + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_access_point_get_hw_address (ap)); + break; + case PROP_MODE: + g_value_set_uint (value, nm_access_point_get_mode (ap)); + break; + case PROP_MAX_BITRATE: + g_value_set_uint (value, nm_access_point_get_max_bitrate (ap)); + break; + case PROP_STRENGTH: + g_value_set_uchar (value, nm_access_point_get_strength (ap)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +demarshal_ssid (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + if (!_nm_ssid_demarshal (value, (GByteArray **) field)) + return FALSE; + + _nm_object_queue_notify (object, NM_ACCESS_POINT_SSID); + return TRUE; +} + +static void +register_for_property_changed (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv = NM_ACCESS_POINT_GET_PRIVATE (ap); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_ACCESS_POINT_FLAGS, _nm_object_demarshal_generic, &priv->flags }, + { NM_ACCESS_POINT_WPA_FLAGS, _nm_object_demarshal_generic, &priv->wpa_flags }, + { NM_ACCESS_POINT_RSN_FLAGS, _nm_object_demarshal_generic, &priv->rsn_flags }, + { NM_ACCESS_POINT_SSID, demarshal_ssid, &priv->ssid }, + { NM_ACCESS_POINT_FREQUENCY, _nm_object_demarshal_generic, &priv->frequency }, + { NM_ACCESS_POINT_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, + { NM_ACCESS_POINT_MODE, _nm_object_demarshal_generic, &priv->mode }, + { NM_ACCESS_POINT_MAX_BITRATE, _nm_object_demarshal_generic, &priv->max_bitrate }, + { NM_ACCESS_POINT_STRENGTH, _nm_object_demarshal_generic, &priv->strength }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (ap), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + NMAccessPointPrivate *priv; + + object = (NMObject *) G_OBJECT_CLASS (nm_access_point_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_ACCESS_POINT_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object), + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE_ACCESS_POINT); + + register_for_property_changed (NM_ACCESS_POINT (object)); + + return G_OBJECT (object); +} + + +static void +nm_access_point_class_init (NMAccessPointClass *ap_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (ap_class); + + g_type_class_add_private (ap_class, sizeof (NMAccessPointPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMAccessPoint:flags: + * + * The flags of the access point. + **/ + g_object_class_install_property + (object_class, PROP_FLAGS, + g_param_spec_uint (NM_ACCESS_POINT_FLAGS, + "Flags", + "Flags", + NM_802_11_AP_FLAGS_NONE, + NM_802_11_AP_FLAGS_PRIVACY, + NM_802_11_AP_FLAGS_NONE, + G_PARAM_READABLE)); + + /** + * NMAccessPoint:wpa-flags: + * + * The WPA flags of the access point. + **/ + g_object_class_install_property + (object_class, PROP_WPA_FLAGS, + g_param_spec_uint (NM_ACCESS_POINT_WPA_FLAGS, + "WPA Flags", + "WPA Flags", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + /** + * NMAccessPoint:rsn-flags: + * + * The RSN flags of the access point. + **/ + g_object_class_install_property + (object_class, PROP_RSN_FLAGS, + g_param_spec_uint (NM_ACCESS_POINT_RSN_FLAGS, + "RSN Flags", + "RSN Flags", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + /** + * NMAccessPoint:ssid: + * + * The SSID of the access point. + **/ + g_object_class_install_property + (object_class, PROP_SSID, + g_param_spec_boxed (NM_ACCESS_POINT_SSID, + "SSID", + "SSID", + NM_TYPE_SSID, + G_PARAM_READABLE)); + + /** + * NMAccessPoint:frequency: + * + * The frequency of the access point. + **/ + g_object_class_install_property + (object_class, PROP_FREQUENCY, + g_param_spec_uint (NM_ACCESS_POINT_FREQUENCY, + "Frequency", + "Frequency", + 0, 10000, 0, + G_PARAM_READABLE)); + + /** + * NMAccessPoint:hw-address: + * + * The hardware address of the access point. + **/ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_ACCESS_POINT_HW_ADDRESS, + "MAC Address", + "Hardware MAC address", + NULL, + G_PARAM_READABLE)); + + /** + * NMAccessPoint:mode: + * + * The mode of the access point. + **/ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_uint (NM_ACCESS_POINT_MODE, + "Mode", + "Mode", + NM_802_11_MODE_ADHOC, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA, + G_PARAM_READABLE)); + + /** + * NMAccessPoint:max-bitrate: + * + * The maximum bit rate of the access point. + **/ + g_object_class_install_property + (object_class, PROP_MAX_BITRATE, + g_param_spec_uint (NM_ACCESS_POINT_MAX_BITRATE, + "Max Bitrate", + "Max Bitrate", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + /** + * NMAccessPoint:strength: + * + * The current signal strength of the access point. + **/ + g_object_class_install_property + (object_class, PROP_STRENGTH, + g_param_spec_uchar (NM_ACCESS_POINT_STRENGTH, + "Strength", + "Strength", + 0, G_MAXUINT8, 0, + G_PARAM_READABLE)); +} diff --git a/libnm-glib/nm-access-point.h b/libnm-glib/nm-access-point.h new file mode 100644 index 00000000..77024815 --- /dev/null +++ b/libnm-glib/nm-access-point.h @@ -0,0 +1,83 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_ACCESS_POINT_H +#define NM_ACCESS_POINT_H + +#include +#include +#include +#include "nm-object.h" + +G_BEGIN_DECLS + +#define NM_TYPE_ACCESS_POINT (nm_access_point_get_type ()) +#define NM_ACCESS_POINT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ACCESS_POINT, NMAccessPoint)) +#define NM_ACCESS_POINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ACCESS_POINT, NMAccessPointClass)) +#define NM_IS_ACCESS_POINT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_ACCESS_POINT)) +#define NM_IS_ACCESS_POINT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_ACCESS_POINT)) +#define NM_ACCESS_POINT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_ACCESS_POINT, NMAccessPointClass)) + +#define NM_ACCESS_POINT_FLAGS "flags" +#define NM_ACCESS_POINT_WPA_FLAGS "wpa-flags" +#define NM_ACCESS_POINT_RSN_FLAGS "rsn-flags" +#define NM_ACCESS_POINT_SSID "ssid" +#define NM_ACCESS_POINT_FREQUENCY "frequency" +#define NM_ACCESS_POINT_HW_ADDRESS "hw-address" +#define NM_ACCESS_POINT_MODE "mode" +#define NM_ACCESS_POINT_MAX_BITRATE "max-bitrate" +#define NM_ACCESS_POINT_STRENGTH "strength" + +typedef struct { + NMObject parent; +} NMAccessPoint; + +typedef struct { + NMObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMAccessPointClass; + +GType nm_access_point_get_type (void); + +GObject *nm_access_point_new (DBusGConnection *connection, const char *path); + +guint32 nm_access_point_get_flags (NMAccessPoint *ap); +guint32 nm_access_point_get_wpa_flags (NMAccessPoint *ap); +guint32 nm_access_point_get_rsn_flags (NMAccessPoint *ap); +const GByteArray * nm_access_point_get_ssid (NMAccessPoint *ap); +guint32 nm_access_point_get_frequency (NMAccessPoint *ap); +const char * nm_access_point_get_hw_address (NMAccessPoint *ap); +NM80211Mode nm_access_point_get_mode (NMAccessPoint *ap); +guint32 nm_access_point_get_max_bitrate (NMAccessPoint *ap); +guint8 nm_access_point_get_strength (NMAccessPoint *ap); + +G_END_DECLS + +#endif /* NM_ACCESS_POINT_H */ diff --git a/libnm-glib/nm-active-connection.c b/libnm-glib/nm-active-connection.c new file mode 100644 index 00000000..2468da09 --- /dev/null +++ b/libnm-glib/nm-active-connection.c @@ -0,0 +1,570 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2010 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#include + +#include "NetworkManager.h" +#include "nm-active-connection.h" +#include "nm-object-private.h" +#include "nm-types-private.h" +#include "nm-device.h" +#include "nm-connection.h" + +#include "nm-active-connection-bindings.h" + +G_DEFINE_TYPE (NMActiveConnection, nm_active_connection, NM_TYPE_OBJECT) + +#define NM_ACTIVE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionPrivate)) + +static gboolean demarshal_devices (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field); + + +typedef struct { + gboolean disposed; + DBusGProxy *proxy; + + char *service_name; + NMConnectionScope scope; + char *connection; + char *specific_object; + GPtrArray *devices; + NMActiveConnectionState state; + gboolean is_default; + gboolean is_default6; +} NMActiveConnectionPrivate; + +enum { + PROP_0, + PROP_SERVICE_NAME, + PROP_CONNECTION, + PROP_SPECIFIC_OBJECT, + PROP_DEVICES, + PROP_STATE, + PROP_DEFAULT, + PROP_DEFAULT6, + + LAST_PROP +}; + +#define DBUS_PROP_SERVICE_NAME "ServiceName" +#define DBUS_PROP_CONNECTION "Connection" +#define DBUS_PROP_SPECIFIC_OBJECT "SpecificObject" +#define DBUS_PROP_DEVICES "Devices" +#define DBUS_PROP_STATE "State" +#define DBUS_PROP_DEFAULT "Default" +#define DBUS_PROP_DEFAULT6 "Default6" + +/** + * nm_active_connection_new: + * @connection: the #DBusGConnection + * @path: the DBus object path of the device + * + * Creates a new #NMActiveConnection. + * + * Returns: a new active connection + **/ +GObject * +nm_active_connection_new (DBusGConnection *connection, const char *path) +{ + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return g_object_new (NM_TYPE_ACTIVE_CONNECTION, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); +} + +static NMConnectionScope +get_scope_for_service_name (const char *service_name) +{ + if (service_name && !strcmp (service_name, NM_DBUS_SERVICE_USER_SETTINGS)) + return NM_CONNECTION_SCOPE_USER; + else if (service_name && !strcmp (service_name, NM_DBUS_SERVICE_SYSTEM_SETTINGS)) + return NM_CONNECTION_SCOPE_SYSTEM; + + return NM_CONNECTION_SCOPE_UNKNOWN; +} + +/** + * nm_active_connection_get_service_name: + * @connection: a #NMActiveConnection + * + * Gets the service name of the active connection. + * + * Returns: the service name. This is the internal string used by the + * connection, and must not be modified. + **/ +const char * +nm_active_connection_get_service_name (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL); + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + if (!priv->service_name) { + priv->service_name = _nm_object_get_string_property (NM_OBJECT (connection), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_SERVICE_NAME); + priv->scope = get_scope_for_service_name (priv->service_name); + } + + return priv->service_name; +} + +/** + * nm_active_connection_get_scope: + * @connection: a #NMActiveConnection + * + * Gets the scope of the active connection. + * + * Returns: the connection's scope + **/ +NMConnectionScope +nm_active_connection_get_scope (NMActiveConnection *connection) +{ + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NM_CONNECTION_SCOPE_UNKNOWN); + + /* Make sure service_name and scope are up-to-date */ + nm_active_connection_get_service_name (connection); + return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->scope; +} + +/** + * nm_active_connection_get_connection: + * @connection: a #NMActiveConnection + * + * Gets the #NMConnection's DBus object path. + * + * Returns: the object path of the #NMConnection inside of #NMActiveConnection. + * This is the internal string used by the connection, and must not be modified. + **/ +const char * +nm_active_connection_get_connection (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL); + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + if (!priv->connection) { + priv->connection = _nm_object_get_string_property (NM_OBJECT (connection), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_CONNECTION); + } + + return priv->connection; +} + +/** + * nm_active_connection_get_specific_object: + * @connection: a #NMActiveConnection + * + * Gets the "specific object" used at the activation. + * + * Returns: the specific object's DBus path. This is the internal string used by the + * connection, and must not be modified. + **/ +const char * +nm_active_connection_get_specific_object (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL); + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + if (!priv->specific_object) { + priv->specific_object = _nm_object_get_string_property (NM_OBJECT (connection), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_SPECIFIC_OBJECT); + } + + return priv->specific_object; +} + +/** + * nm_active_connection_get_devices: + * @connection: a #NMActiveConnection + * + * Gets the #NMDevices used for the active connections. + * + * Returns: the #GPtrArray containing #NMDevices. + * This is the internal copy used by the connection, and must not be modified. + **/ +const GPtrArray * +nm_active_connection_get_devices (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL); + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + if (priv->devices) + return handle_ptr_array_return (priv->devices); + + if (!_nm_object_get_property (NM_OBJECT (connection), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_DEVICES, + &value)) { + return NULL; + } + + demarshal_devices (NM_OBJECT (connection), NULL, &value, &priv->devices); + g_value_unset (&value); + + return handle_ptr_array_return (priv->devices); +} + +/** + * nm_active_connection_get_state: + * @connection: a #NMActiveConnection + * + * Gets the active connection's state. + * + * Returns: the state + **/ +NMActiveConnectionState +nm_active_connection_get_state (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NM_ACTIVE_CONNECTION_STATE_UNKNOWN); + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + if (!priv->state) { + priv->state = _nm_object_get_uint_property (NM_OBJECT (connection), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_STATE); + } + + return priv->state; +} + +/** + * nm_active_connection_get_default: + * @connection: a #NMActiveConnection + * + * Whether the active connection is the default IPv4 one (that is, is used for + * the default IPv4 route and DNS information). + * + * Returns: %TRUE if the active connection is the default IPv4 connection + **/ +gboolean +nm_active_connection_get_default (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE); + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + if (!priv->is_default) { + priv->is_default = _nm_object_get_boolean_property (NM_OBJECT (connection), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_DEFAULT); + } + + return priv->is_default; +} + +/** + * nm_active_connection_get_default6: + * @connection: a #NMActiveConnection + * + * Whether the active connection is the default IPv6 one (that is, is used for + * the default IPv6 route and DNS information). + * + * Returns: %TRUE if the active connection is the default IPv6 connection + **/ +gboolean +nm_active_connection_get_default6 (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE); + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + if (!priv->is_default6) { + priv->is_default6 = _nm_object_get_boolean_property (NM_OBJECT (connection), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + DBUS_PROP_DEFAULT6); + } + + return priv->is_default6; +} + +static void +nm_active_connection_init (NMActiveConnection *ap) +{ +} + +static void +dispose (GObject *object) +{ + NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_active_connection_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + if (priv->devices) { + g_ptr_array_foreach (priv->devices, (GFunc) g_object_unref, NULL); + g_ptr_array_free (priv->devices, TRUE); + } + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_active_connection_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object); + + g_free (priv->service_name); + g_free (priv->connection); + g_free (priv->specific_object); + + G_OBJECT_CLASS (nm_active_connection_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMActiveConnection *self = NM_ACTIVE_CONNECTION (object); + + switch (prop_id) { + case PROP_SERVICE_NAME: + g_value_set_string (value, nm_active_connection_get_service_name (self)); + break; + case PROP_CONNECTION: + g_value_set_boxed (value, nm_active_connection_get_connection (self)); + break; + case PROP_SPECIFIC_OBJECT: + g_value_set_boxed (value, nm_active_connection_get_specific_object (self)); + break; + case PROP_DEVICES: + g_value_set_boxed (value, nm_active_connection_get_devices (self)); + break; + case PROP_STATE: + g_value_set_uint (value, nm_active_connection_get_state (self)); + break; + case PROP_DEFAULT: + g_value_set_boolean (value, nm_active_connection_get_default (self)); + break; + case PROP_DEFAULT6: + g_value_set_boolean (value, nm_active_connection_get_default6 (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static gboolean +demarshal_devices (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + DBusGConnection *connection; + + connection = nm_object_get_connection (object); + if (!_nm_object_array_demarshal (value, (GPtrArray **) field, connection, nm_device_new)) + return FALSE; + + _nm_object_queue_notify (object, NM_ACTIVE_CONNECTION_DEVICES); + return TRUE; +} + +static gboolean +demarshal_service (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object); + + if (_nm_object_demarshal_generic (object, pspec, value, field)) { + priv->scope = get_scope_for_service_name (priv->service_name); + return TRUE; + } + return FALSE; +} + +static void +register_for_property_changed (NMActiveConnection *connection) +{ + NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_ACTIVE_CONNECTION_SERVICE_NAME, demarshal_service, &priv->service_name }, + { NM_ACTIVE_CONNECTION_CONNECTION, _nm_object_demarshal_generic, &priv->connection }, + { NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, _nm_object_demarshal_generic, &priv->specific_object }, + { NM_ACTIVE_CONNECTION_DEVICES, demarshal_devices, &priv->devices }, + { NM_ACTIVE_CONNECTION_STATE, _nm_object_demarshal_generic, &priv->state }, + { NM_ACTIVE_CONNECTION_DEFAULT, _nm_object_demarshal_generic, &priv->is_default }, + { NM_ACTIVE_CONNECTION_DEFAULT6, _nm_object_demarshal_generic, &priv->is_default6 }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (connection), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + NMActiveConnectionPrivate *priv; + + object = (NMObject *) G_OBJECT_CLASS (nm_active_connection_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object), + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE_ACTIVE_CONNECTION); + + register_for_property_changed (NM_ACTIVE_CONNECTION (object)); + + return G_OBJECT (object); +} + + +static void +nm_active_connection_class_init (NMActiveConnectionClass *ap_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (ap_class); + + g_type_class_add_private (ap_class, sizeof (NMActiveConnectionPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMActiveConnection:service-name: + * + * The service name of the active connection. + **/ + g_object_class_install_property + (object_class, PROP_SERVICE_NAME, + g_param_spec_string (NM_ACTIVE_CONNECTION_SERVICE_NAME, + "Service Name", + "Service Name", + NULL, + G_PARAM_READABLE)); + + /** + * NMActiveConnection:connection: + * + * The connection's path of the active connection. + **/ + g_object_class_install_property + (object_class, PROP_CONNECTION, + g_param_spec_string (NM_ACTIVE_CONNECTION_CONNECTION, + "Connection", + "Connection", + NULL, + G_PARAM_READABLE)); + + /** + * NMActiveConnection:specific-object: + * + * The specific object's path of the active connection. + **/ + g_object_class_install_property + (object_class, PROP_SPECIFIC_OBJECT, + g_param_spec_string (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, + "Specific object", + "Specific object", + NULL, + G_PARAM_READABLE)); + + /** + * NMActiveConnection:device: + * + * The devices (#NMDevice) of the active connection. + **/ + g_object_class_install_property + (object_class, PROP_DEVICES, + g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, + "Devices", + "Devices", + NM_TYPE_OBJECT_ARRAY, + G_PARAM_READABLE)); + + /** + * NMActiveConnection:state: + * + * The state of the active connection. + **/ + g_object_class_install_property + (object_class, PROP_STATE, + g_param_spec_uint (NM_ACTIVE_CONNECTION_STATE, + "State", + "State", + NM_ACTIVE_CONNECTION_STATE_UNKNOWN, + NM_ACTIVE_CONNECTION_STATE_ACTIVATED, + NM_ACTIVE_CONNECTION_STATE_UNKNOWN, + G_PARAM_READABLE)); + + /** + * NMActiveConnection:default: + * + * Whether the active connection is the default IPv4 one. + **/ + g_object_class_install_property + (object_class, PROP_DEFAULT, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, + "Default", + "Is the default IPv4 active connection", + FALSE, + G_PARAM_READABLE)); + + /** + * NMActiveConnection:default6: + * + * Whether the active connection is the default IPv6 one. + **/ + g_object_class_install_property + (object_class, PROP_DEFAULT6, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, + "Default6", + "Is the default IPv6 active connection", + FALSE, + G_PARAM_READABLE)); +} diff --git a/libnm-glib/nm-active-connection.h b/libnm-glib/nm-active-connection.h new file mode 100644 index 00000000..30edf047 --- /dev/null +++ b/libnm-glib/nm-active-connection.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2010 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_ACTIVE_CONNECTION_H +#define NM_ACTIVE_CONNECTION_H + +#include +#include +#include "nm-object.h" +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_ACTIVE_CONNECTION (nm_active_connection_get_type ()) +#define NM_ACTIVE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnection)) +#define NM_ACTIVE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionClass)) +#define NM_IS_ACTIVE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_ACTIVE_CONNECTION)) +#define NM_IS_ACTIVE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_ACTIVE_CONNECTION)) +#define NM_ACTIVE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionClass)) + +#define NM_ACTIVE_CONNECTION_SERVICE_NAME "service-name" +#define NM_ACTIVE_CONNECTION_CONNECTION "connection" +#define NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT "specific-object" +#define NM_ACTIVE_CONNECTION_DEVICES "devices" +#define NM_ACTIVE_CONNECTION_STATE "state" +#define NM_ACTIVE_CONNECTION_DEFAULT "default" +#define NM_ACTIVE_CONNECTION_DEFAULT6 "default6" + +typedef struct { + NMObject parent; +} NMActiveConnection; + +typedef struct { + NMObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMActiveConnectionClass; + +GType nm_active_connection_get_type (void); + +GObject *nm_active_connection_new (DBusGConnection *connection, const char *path); + +const char * nm_active_connection_get_service_name (NMActiveConnection *connection); +NMConnectionScope nm_active_connection_get_scope (NMActiveConnection *connection); +const char * nm_active_connection_get_connection (NMActiveConnection *connection); +const char * nm_active_connection_get_specific_object (NMActiveConnection *connection); +const GPtrArray *nm_active_connection_get_devices (NMActiveConnection *connection); +NMActiveConnectionState nm_active_connection_get_state (NMActiveConnection *connection); +gboolean nm_active_connection_get_default (NMActiveConnection *connection); +gboolean nm_active_connection_get_default6 (NMActiveConnection *connection); + +G_END_DECLS + +#endif /* NM_ACTIVE_CONNECTION_H */ diff --git a/libnm-glib/nm-cdma-device.c b/libnm-glib/nm-cdma-device.c new file mode 100644 index 00000000..31b2e99c --- /dev/null +++ b/libnm-glib/nm-cdma-device.c @@ -0,0 +1,130 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#include "nm-cdma-device.h" +#include "nm-device-private.h" +#include "nm-object-private.h" + +G_DEFINE_TYPE (NMCdmaDevice, nm_cdma_device, NM_TYPE_SERIAL_DEVICE) + +#define NM_CDMA_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CDMA_DEVICE, NMCdmaDevicePrivate)) + +typedef struct { + DBusGProxy *proxy; + + gboolean disposed; +} NMCdmaDevicePrivate; + +static void +nm_cdma_device_init (NMCdmaDevice *device) +{ +} + +static void +register_for_property_changed (NMCdmaDevice *device) +{ + NMCdmaDevicePrivate *priv = NM_CDMA_DEVICE_GET_PRIVATE (device); + const NMPropertiesChangedInfo property_changed_info[] = { + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (device), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMCdmaDevicePrivate *priv; + + object = G_OBJECT_CLASS (nm_cdma_device_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_CDMA_DEVICE_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)), + NM_DBUS_SERVICE, + nm_object_get_path (NM_OBJECT (object)), + NM_DBUS_INTERFACE_CDMA_DEVICE); + + register_for_property_changed (NM_CDMA_DEVICE (object)); + + return object; +} + +static void +dispose (GObject *object) +{ + NMCdmaDevicePrivate *priv = NM_CDMA_DEVICE_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_cdma_device_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_cdma_device_parent_class)->dispose (object); +} + +static void +nm_cdma_device_class_init (NMCdmaDeviceClass *device_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (device_class); + + g_type_class_add_private (device_class, sizeof (NMCdmaDevicePrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->dispose = dispose; +} + +/** + * nm_cdma_device_new: + * @connection: the #DBusGConnection + * @path: the DBus object path of the device + * + * Creates a new #NMCdmaDevice. + * + * Returns: a new device + **/ +GObject * +nm_cdma_device_new (DBusGConnection *connection, const char *path) +{ + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return g_object_new (NM_TYPE_CDMA_DEVICE, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); +} diff --git a/libnm-glib/nm-cdma-device.h b/libnm-glib/nm-cdma-device.h new file mode 100644 index 00000000..f40124ac --- /dev/null +++ b/libnm-glib/nm-cdma-device.h @@ -0,0 +1,60 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_CDMA_DEVICE_H +#define NM_CDMA_DEVICE_H + +#include "nm-serial-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_CDMA_DEVICE (nm_cdma_device_get_type ()) +#define NM_CDMA_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CDMA_DEVICE, NMCdmaDevice)) +#define NM_CDMA_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CDMA_DEVICE, NMCdmaDeviceClass)) +#define NM_IS_CDMA_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CDMA_DEVICE)) +#define NM_IS_CDMA_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_CDMA_DEVICE)) +#define NM_CDMA_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CDMA_DEVICE, NMCdmaDeviceClass)) + +typedef struct { + NMSerialDevice parent; +} NMCdmaDevice; + +typedef struct { + NMSerialDeviceClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMCdmaDeviceClass; + +GType nm_cdma_device_get_type (void); + +GObject *nm_cdma_device_new (DBusGConnection *connection, const char *path); + +G_END_DECLS + +#endif /* NM_CDMA_DEVICE_H */ diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c new file mode 100644 index 00000000..00d729a2 --- /dev/null +++ b/libnm-glib/nm-client.c @@ -0,0 +1,1160 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#include +#include +#include + +#include "nm-client.h" +#include "nm-device-ethernet.h" +#include "nm-device-wifi.h" +#include "nm-gsm-device.h" +#include "nm-cdma-device.h" +#include "nm-device-private.h" +#include "nm-marshal.h" +#include "nm-types-private.h" +#include "nm-object-private.h" +#include "nm-active-connection.h" +#include "nm-vpn-connection.h" +#include "nm-object-cache.h" +#include "nm-dbus-glib-types.h" + +#include "nm-client-bindings.h" + +void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled); + + +G_DEFINE_TYPE (NMClient, nm_client, NM_TYPE_OBJECT) + +#define NM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CLIENT, NMClientPrivate)) + +typedef struct { + gboolean disposed; + + DBusGProxy *client_proxy; + DBusGProxy *bus_proxy; + gboolean manager_running; + NMState state; + GPtrArray *devices; + GPtrArray *active_connections; + + gboolean have_networking_enabled; + gboolean networking_enabled; + gboolean wireless_enabled; + gboolean wireless_hw_enabled; + + gboolean wwan_enabled; + gboolean wwan_hw_enabled; +} NMClientPrivate; + +enum { + PROP_0, + PROP_STATE, + PROP_MANAGER_RUNNING, + PROP_NETWORKING_ENABLED, + PROP_WIRELESS_ENABLED, + PROP_WIRELESS_HARDWARE_ENABLED, + PROP_WWAN_ENABLED, + PROP_WWAN_HARDWARE_ENABLED, + PROP_ACTIVE_CONNECTIONS, + + LAST_PROP +}; + +enum { + DEVICE_ADDED, + DEVICE_REMOVED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static void proxy_name_owner_changed (DBusGProxy *proxy, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data); + +static void client_device_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data); +static void client_device_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data); + +static void +handle_net_enabled_changed (GObject *object, + GParamSpec *pspec, + GValue *value, + gpointer user_data) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object); + + /* Update the cache flag when it changes */ + priv->have_networking_enabled = TRUE; +} + +static void +nm_client_init (NMClient *client) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); + + priv->state = NM_STATE_UNKNOWN; + + g_signal_connect (client, + "notify::" NM_CLIENT_NETWORKING_ENABLED, + G_CALLBACK (handle_net_enabled_changed), + client); +} + +static void +poke_wireless_devices_with_rf_status (NMClient *client) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); + int i; + + for (i = 0; priv->devices && (i < priv->devices->len); i++) { + NMDevice *device = g_ptr_array_index (priv->devices, i); + + if (NM_IS_DEVICE_WIFI (device)) + _nm_device_wifi_set_wireless_enabled (NM_DEVICE_WIFI (device), priv->wireless_enabled); + } +} + +static void +update_wireless_status (NMClient *client, gboolean notify) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); + gboolean val; + gboolean poke = FALSE; + + val = _nm_object_get_boolean_property (NM_OBJECT (client), + NM_DBUS_INTERFACE, + "WirelessHardwareEnabled"); + if (val != priv->wireless_hw_enabled) { + priv->wireless_hw_enabled = val; + poke = TRUE; + if (notify) + _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_WIRELESS_HARDWARE_ENABLED); + } + + if (priv->wireless_hw_enabled == FALSE) + val = FALSE; + else + val = _nm_object_get_boolean_property (NM_OBJECT (client), + NM_DBUS_INTERFACE, + "WirelessEnabled"); + if (val != priv->wireless_enabled) { + priv->wireless_enabled = val; + poke = TRUE; + if (notify) + _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_WIRELESS_ENABLED); + } + + if (poke) + poke_wireless_devices_with_rf_status (client); +} + +static void +wireless_enabled_cb (GObject *object, GParamSpec *pspec, gpointer user_data) +{ + poke_wireless_devices_with_rf_status (NM_CLIENT (object)); +} + +static void +update_wwan_status (NMClient *client, gboolean notify) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); + gboolean val; + + val = _nm_object_get_boolean_property (NM_OBJECT (client), + NM_DBUS_INTERFACE, + "WwanHardwareEnabled"); + if (val != priv->wwan_hw_enabled) { + priv->wwan_hw_enabled = val; + if (notify) + _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_WWAN_HARDWARE_ENABLED); + } + + if (priv->wwan_hw_enabled == FALSE) + val = FALSE; + else { + val = _nm_object_get_boolean_property (NM_OBJECT (client), + NM_DBUS_INTERFACE, + "WwanEnabled"); + } + + if (val != priv->wwan_enabled) { + priv->wwan_enabled = val; + if (notify) + _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_WWAN_ENABLED); + } +} + +static GObject * +new_active_connection (DBusGConnection *connection, const char *path) +{ + DBusGProxy *proxy; + GError *error = NULL; + GValue value = {0,}; + GObject *object = NULL; + + proxy = dbus_g_proxy_new_for_name (connection, + NM_DBUS_SERVICE, + path, + "org.freedesktop.DBus.Properties"); + if (!proxy) { + g_warning ("%s: couldn't create D-Bus object proxy.", __func__); + return NULL; + } + + /* Have to create an NMVPNConnection if it's a VPN connection, otherwise + * a plain NMActiveConnection. + */ + if (dbus_g_proxy_call (proxy, + "Get", &error, + G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION, + G_TYPE_STRING, "Vpn", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, G_TYPE_INVALID)) { + if (g_value_get_boolean (&value)) + object = nm_vpn_connection_new (connection, path); + else + object = nm_active_connection_new (connection, path); + } else { + g_warning ("Error in getting active connection 'Vpn' property: (%d) %s", + error->code, error->message); + g_error_free (error); + } + + g_object_unref (proxy); + return object; +} + +static gboolean +demarshal_active_connections (NMObject *object, + GParamSpec *pspec, + GValue *value, + gpointer field) +{ + DBusGConnection *connection; + + connection = nm_object_get_connection (object); + if (!_nm_object_array_demarshal (value, (GPtrArray **) field, connection, new_active_connection)) + return FALSE; + + _nm_object_queue_notify (object, NM_CLIENT_ACTIVE_CONNECTIONS); + return TRUE; +} + +static void +register_for_property_changed (NMClient *client) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_CLIENT_STATE, _nm_object_demarshal_generic, &priv->state }, + { NM_CLIENT_NETWORKING_ENABLED, _nm_object_demarshal_generic, &priv->networking_enabled }, + { NM_CLIENT_WIRELESS_ENABLED, _nm_object_demarshal_generic, &priv->wireless_enabled }, + { NM_CLIENT_WIRELESS_HARDWARE_ENABLED, _nm_object_demarshal_generic, &priv->wireless_hw_enabled }, + { NM_CLIENT_WWAN_ENABLED, _nm_object_demarshal_generic, &priv->wwan_enabled }, + { NM_CLIENT_WWAN_HARDWARE_ENABLED, _nm_object_demarshal_generic, &priv->wwan_hw_enabled }, + { NM_CLIENT_ACTIVE_CONNECTIONS, demarshal_active_connections, &priv->active_connections }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (client), + priv->client_proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + DBusGConnection *connection; + NMClientPrivate *priv; + GError *err = NULL; + + object = (NMObject *) G_OBJECT_CLASS (nm_client_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_CLIENT_GET_PRIVATE (object); + connection = nm_object_get_connection (object); + + priv->client_proxy = dbus_g_proxy_new_for_name (connection, + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE); + + register_for_property_changed (NM_CLIENT (object)); + + dbus_g_proxy_add_signal (priv->client_proxy, "DeviceAdded", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->client_proxy, + "DeviceAdded", + G_CALLBACK (client_device_added_proxy), + object, + NULL); + + dbus_g_proxy_add_signal (priv->client_proxy, "DeviceRemoved", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->client_proxy, + "DeviceRemoved", + G_CALLBACK (client_device_removed_proxy), + object, + NULL); + + priv->bus_proxy = dbus_g_proxy_new_for_name (connection, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + + dbus_g_proxy_add_signal (priv->bus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->bus_proxy, + "NameOwnerChanged", + G_CALLBACK (proxy_name_owner_changed), + object, NULL); + + if (!dbus_g_proxy_call (priv->bus_proxy, + "NameHasOwner", &err, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_INVALID, + G_TYPE_BOOLEAN, &priv->manager_running, + G_TYPE_INVALID)) { + g_warning ("Error on NameHasOwner DBUS call: %s", err->message); + g_error_free (err); + } + + if (priv->manager_running) { + update_wireless_status (NM_CLIENT (object), FALSE); + update_wwan_status (NM_CLIENT (object), FALSE); + nm_client_get_state (NM_CLIENT (object)); + } + + g_signal_connect (G_OBJECT (object), "notify::" NM_CLIENT_WIRELESS_ENABLED, + G_CALLBACK (wireless_enabled_cb), NULL); + + return G_OBJECT (object); +} + +static void +free_object_array (GPtrArray **array) +{ + g_return_if_fail (array != NULL); + + if (*array) { + g_ptr_array_foreach (*array, (GFunc) g_object_unref, NULL); + g_ptr_array_free (*array, TRUE); + *array = NULL; + } +} + +static void +dispose (GObject *object) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_client_parent_class)->dispose (object); + return; + } + + g_object_unref (priv->client_proxy); + g_object_unref (priv->bus_proxy); + + free_object_array (&priv->devices); + free_object_array (&priv->active_connections); + + G_OBJECT_CLASS (nm_client_parent_class)->dispose (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object); + gboolean b; + + switch (prop_id) { + case PROP_WIRELESS_ENABLED: + b = g_value_get_boolean (value); + if (priv->wireless_enabled != b) { + priv->wireless_enabled = b; + _nm_object_queue_notify (NM_OBJECT (object), NM_CLIENT_WIRELESS_ENABLED); + } + break; + case PROP_WIRELESS_HARDWARE_ENABLED: + b = g_value_get_boolean (value); + if (priv->wireless_hw_enabled != b) { + priv->wireless_hw_enabled = b; + _nm_object_queue_notify (NM_OBJECT (object), NM_CLIENT_WIRELESS_HARDWARE_ENABLED); + } + break; + case PROP_WWAN_ENABLED: + b = g_value_get_boolean (value); + if (priv->wwan_enabled != b) { + priv->wwan_enabled = b; + _nm_object_queue_notify (NM_OBJECT (object), NM_CLIENT_WWAN_ENABLED); + } + break; + case PROP_WWAN_HARDWARE_ENABLED: + b = g_value_get_boolean (value); + if (priv->wwan_hw_enabled != b) { + priv->wwan_hw_enabled = b; + _nm_object_queue_notify (NM_OBJECT (object), NM_CLIENT_WWAN_HARDWARE_ENABLED); + } + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMClient *self = NM_CLIENT (object); + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self); + + switch (prop_id) { + case PROP_STATE: + g_value_set_uint (value, nm_client_get_state (self)); + break; + case PROP_MANAGER_RUNNING: + g_value_set_boolean (value, priv->manager_running); + break; + case PROP_NETWORKING_ENABLED: + g_value_set_boolean (value, priv->networking_enabled); + break; + case PROP_WIRELESS_ENABLED: + g_value_set_boolean (value, priv->wireless_enabled); + break; + case PROP_WIRELESS_HARDWARE_ENABLED: + g_value_set_boolean (value, priv->wireless_hw_enabled); + break; + case PROP_WWAN_ENABLED: + g_value_set_boolean (value, priv->wwan_enabled); + break; + case PROP_WWAN_HARDWARE_ENABLED: + g_value_set_boolean (value, priv->wwan_hw_enabled); + break; + case PROP_ACTIVE_CONNECTIONS: + g_value_set_boxed (value, nm_client_get_active_connections (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_client_class_init (NMClientClass *client_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (client_class); + + g_type_class_add_private (client_class, sizeof (NMClientPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->dispose = dispose; + + /* properties */ + + /** + * NMClient:state: + * + * The current daemon state. + **/ + g_object_class_install_property + (object_class, PROP_STATE, + g_param_spec_uint (NM_CLIENT_STATE, + "State", + "NetworkManager state", + NM_STATE_UNKNOWN, NM_STATE_DISCONNECTED, NM_STATE_UNKNOWN, + G_PARAM_READABLE)); + + /** + * NMClient::manager-running: + * + * Whether the daemon is running. + **/ + g_object_class_install_property + (object_class, PROP_MANAGER_RUNNING, + g_param_spec_boolean (NM_CLIENT_MANAGER_RUNNING, + "ManagerRunning", + "Whether NetworkManager is running", + FALSE, + G_PARAM_READABLE)); + + /** + * NMClient::networking-enabled: + * + * Whether networking is enabled. + **/ + g_object_class_install_property + (object_class, PROP_NETWORKING_ENABLED, + g_param_spec_boolean (NM_CLIENT_NETWORKING_ENABLED, + "NetworkingEnabled", + "Is networking enabled", + TRUE, + G_PARAM_READABLE)); + + /** + * NMClient::wireless-enabled: + * + * Whether wireless is enabled. + **/ + g_object_class_install_property + (object_class, PROP_WIRELESS_ENABLED, + g_param_spec_boolean (NM_CLIENT_WIRELESS_ENABLED, + "WirelessEnabled", + "Is wireless enabled", + TRUE, + G_PARAM_READWRITE)); + + /** + * NMClient::wireless-hardware-enabled: + * + * Whether the wireless hardware is enabled. + **/ + g_object_class_install_property + (object_class, PROP_WIRELESS_HARDWARE_ENABLED, + g_param_spec_boolean (NM_CLIENT_WIRELESS_HARDWARE_ENABLED, + "WirelessHardwareEnabled", + "Is wireless hardware enabled", + TRUE, + G_PARAM_READABLE)); + + /** + * NMClient::wwan-enabled: + * + * Whether WWAN functionality is enabled. + **/ + g_object_class_install_property + (object_class, PROP_WWAN_ENABLED, + g_param_spec_boolean (NM_CLIENT_WWAN_ENABLED, + "WwanEnabled", + "Is WWAN enabled", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + + /** + * NMClient::wwan-hardware-enabled: + * + * Whether the WWAN hardware is enabled. + **/ + g_object_class_install_property + (object_class, PROP_WWAN_HARDWARE_ENABLED, + g_param_spec_boolean (NM_CLIENT_WWAN_HARDWARE_ENABLED, + "WwanHardwareEnabled", + "Is WWAN hardware enabled", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /** + * NMClient::active-connections: + * + * The active connections. + **/ + g_object_class_install_property + (object_class, PROP_ACTIVE_CONNECTIONS, + g_param_spec_boxed (NM_CLIENT_ACTIVE_CONNECTIONS, + "Active connections", + "Active connections", + NM_TYPE_OBJECT_ARRAY, + G_PARAM_READABLE)); + + /* signals */ + + /** + * NMClient::device-added: + * @client: the client that received the signal + * @device: the new device + * + * Notifies that a #NMDevice is added. + **/ + signals[DEVICE_ADDED] = + g_signal_new ("device-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMClientClass, device_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + + /** + * NMClient::device-removed: + * @widget: the client that received the signal + * @device: the removed device + * + * Notifies that a #NMDevice is removed. + **/ + signals[DEVICE_REMOVED] = + g_signal_new ("device-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMClientClass, device_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); +} + +/** + * nm_client_new: + * + * Creates a new #NMClient. + * + * Returns: a new #NMClient + **/ +NMClient * +nm_client_new (void) +{ + DBusGConnection *connection; + GError *err = NULL; + + connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); + if (!connection) { + g_warning ("Couldn't connect to system bus: %s", err->message); + g_error_free (err); + return NULL; + } + + return (NMClient *) g_object_new (NM_TYPE_CLIENT, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, NM_DBUS_PATH, + NULL); +} + +static void +proxy_name_owner_changed (DBusGProxy *proxy, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + NMClient *client = NM_CLIENT (user_data); + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); + gboolean old_good = (old_owner && strlen (old_owner)); + gboolean new_good = (new_owner && strlen (new_owner)); + gboolean new_running = FALSE; + + if (!name || strcmp (name, NM_DBUS_SERVICE)) + return; + + if (!old_good && new_good) + new_running = TRUE; + else if (old_good && !new_good) + new_running = FALSE; + + if (new_running == priv->manager_running) + return; + + priv->manager_running = new_running; + if (!priv->manager_running) { + priv->state = NM_STATE_UNKNOWN; + _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING); + poke_wireless_devices_with_rf_status (client); + free_object_array (&priv->devices); + free_object_array (&priv->active_connections); + priv->wireless_enabled = FALSE; + priv->wireless_hw_enabled = FALSE; + priv->wwan_enabled = FALSE; + priv->wwan_hw_enabled = FALSE; + } else { + _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING); + update_wireless_status (client, TRUE); + update_wwan_status (client, TRUE); + } +} + +static void +client_device_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data) +{ + NMClient *client = NM_CLIENT (user_data); + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); + GObject *device; + + device = G_OBJECT (nm_client_get_device_by_path (client, path)); + if (!device) { + DBusGConnection *connection = nm_object_get_connection (NM_OBJECT (client)); + + device = G_OBJECT (_nm_object_cache_get (path)); + if (device) { + g_ptr_array_add (priv->devices, g_object_ref (device)); + } else { + device = G_OBJECT (nm_device_new (connection, path)); + if (device) + g_ptr_array_add (priv->devices, device); + } + } + + if (device) + g_signal_emit (client, signals[DEVICE_ADDED], 0, device); +} + +static void +client_device_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data) +{ + NMClient *client = NM_CLIENT (user_data); + NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); + NMDevice *device; + + device = nm_client_get_device_by_path (client, path); + if (device) { + g_signal_emit (client, signals[DEVICE_REMOVED], 0, device); + g_ptr_array_remove (priv->devices, device); + g_object_unref (device); + } +} + +/** + * nm_client_get_devices: + * @client: a #NMClient + * + * Gets all the detected devices. + * + * Returns: a #GPtrArray containing all the #NMDevices. + * The returned array is owned by the client and should not be modified. + **/ +const GPtrArray * +nm_client_get_devices (NMClient *client) +{ + NMClientPrivate *priv; + DBusGConnection *connection; + GValue value = { 0, }; + GError *error = NULL; + GPtrArray *temp; + + g_return_val_if_fail (NM_IS_CLIENT (client), NULL); + + priv = NM_CLIENT_GET_PRIVATE (client); + if (priv->devices) + return handle_ptr_array_return (priv->devices); + + if (!org_freedesktop_NetworkManager_get_devices (priv->client_proxy, &temp, &error)) { + g_warning ("%s: error getting devices: %s\n", __func__, error->message); + g_error_free (error); + return NULL; + } + + g_value_init (&value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH); + g_value_take_boxed (&value, temp); + connection = nm_object_get_connection (NM_OBJECT (client)); + _nm_object_array_demarshal (&value, &priv->devices, connection, nm_device_new); + g_value_unset (&value); + + return handle_ptr_array_return (priv->devices); +} + +/** + * nm_client_get_device_by_path: + * @client: a #NMClient + * @object_path: the object path to search for + * + * Gets a #NMDevice from a #NMClient. + * + * Returns: the #NMDevice for the given @object_path or %NULL if none is found. + **/ +NMDevice * +nm_client_get_device_by_path (NMClient *client, const char *object_path) +{ + const GPtrArray *devices; + int i; + NMDevice *device = NULL; + + g_return_val_if_fail (NM_IS_CLIENT (client), NULL); + g_return_val_if_fail (object_path, NULL); + + devices = nm_client_get_devices (client); + if (!devices) + return NULL; + + for (i = 0; i < devices->len; i++) { + NMDevice *candidate = g_ptr_array_index (devices, i); + if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), object_path)) { + device = candidate; + break; + } + } + + return device; +} + +typedef struct { + NMClientActivateDeviceFn fn; + gpointer user_data; +} ActivateDeviceInfo; + +static void +activate_cb (DBusGProxy *proxy, + char *path, + GError *error, + gpointer user_data) +{ + ActivateDeviceInfo *info = (ActivateDeviceInfo *) user_data; + + if (info->fn) + info->fn (info->user_data, path, error); + else if (error) + nm_warning ("Device activation failed: (%d) %s", error->code, error->message); + + g_slice_free (ActivateDeviceInfo, info); +} + +/** + * nm_client_activate_connection: + * @client: a #NMClient + * @service_name: the connection's service name + * @connection_path: the connection's DBus path + * @device: the #NMDevice + * @specific_object: the device specific object (currently used only for + * activating wireless devices and should be the #NMAccessPoint's path. + * @callback: the function to call when the call is done + * @user_data: user data to pass to the callback function + * + * Activates a connection with the given #NMDevice. + **/ +void +nm_client_activate_connection (NMClient *client, + const char *service_name, + const char *connection_path, + NMDevice *device, + const char *specific_object, + NMClientActivateDeviceFn callback, + gpointer user_data) +{ + ActivateDeviceInfo *info; + char *internal_so = (char *) specific_object; + + g_return_if_fail (NM_IS_CLIENT (client)); + g_return_if_fail (NM_IS_DEVICE (device)); + g_return_if_fail (service_name != NULL); + g_return_if_fail (connection_path != NULL); + + /* NULL specific object must be translated into "/" because D-Bus does + * not have any idea of NULL object paths. + */ + if (internal_so == NULL) + internal_so = "/"; + + info = g_slice_new (ActivateDeviceInfo); + info->fn = callback; + info->user_data = user_data; + + org_freedesktop_NetworkManager_activate_connection_async (NM_CLIENT_GET_PRIVATE (client)->client_proxy, + service_name, + connection_path, + nm_object_get_path (NM_OBJECT (device)), + internal_so, + activate_cb, + info); +} + +/** + * nm_client_deactivate_connection: + * @client: a #NMClient + * @active: the #NMActiveConnection to deactivate + * + * Deactivates an active #NMActiveConnection. + **/ +void +nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active) +{ + NMClientPrivate *priv; + const char *path; + GError *error = NULL; + + g_return_if_fail (NM_IS_CLIENT (client)); + g_return_if_fail (NM_IS_ACTIVE_CONNECTION (active)); + + // FIXME: return errors + priv = NM_CLIENT_GET_PRIVATE (client); + path = nm_object_get_path (NM_OBJECT (active)); + if (!org_freedesktop_NetworkManager_deactivate_connection (priv->client_proxy, path, &error)) { + g_warning ("Could not deactivate connection '%s': %s", path, error->message); + g_error_free (error); + } +} + +/** + * nm_client_get_active_connections: + * @client: a #NMClient + * + * Gets the active connections. + * + * Returns: a #GPtrArray containing all the active #NMActiveConnections. + * The returned array is owned by the client and should not be modified. + **/ +const GPtrArray * +nm_client_get_active_connections (NMClient *client) +{ + NMClientPrivate *priv; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_CLIENT (client), NULL); + + priv = NM_CLIENT_GET_PRIVATE (client); + if (priv->active_connections) + return handle_ptr_array_return (priv->active_connections); + + if (!priv->manager_running) + return NULL; + + if (!_nm_object_get_property (NM_OBJECT (client), + "org.freedesktop.NetworkManager", + "ActiveConnections", + &value)) { + return NULL; + } + + demarshal_active_connections (NM_OBJECT (client), NULL, &value, &priv->active_connections); + g_value_unset (&value); + + return handle_ptr_array_return (priv->active_connections); +} + +/** + * nm_client_wireless_get_enabled: + * @client: a #NMClient + * + * Determines whether the wireless is enabled. + * + * Returns: %TRUE if wireless is enabled + **/ +gboolean +nm_client_wireless_get_enabled (NMClient *client) +{ + g_return_val_if_fail (NM_IS_CLIENT (client), FALSE); + + return NM_CLIENT_GET_PRIVATE (client)->wireless_enabled; +} + +/** + * nm_client_wireless_set_enabled: + * @client: a #NMClient + * @enabled: %TRUE to enable wireless + * + * Enables or disables wireless devices. + **/ +void +nm_client_wireless_set_enabled (NMClient *client, gboolean enabled) +{ + GValue value = {0,}; + + g_return_if_fail (NM_IS_CLIENT (client)); + + g_value_init (&value, G_TYPE_BOOLEAN); + g_value_set_boolean (&value, enabled); + + _nm_object_set_property (NM_OBJECT (client), + NM_DBUS_INTERFACE, + "WirelessEnabled", + &value); +} + +/** + * nm_client_wireless_hardware_get_enabled: + * @client: a #NMClient + * + * Determines whether the wireless hardware is enabled. + * + * Returns: %TRUE if the wireless hardware is enabled + **/ +gboolean +nm_client_wireless_hardware_get_enabled (NMClient *client) +{ + g_return_val_if_fail (NM_IS_CLIENT (client), FALSE); + + return NM_CLIENT_GET_PRIVATE (client)->wireless_hw_enabled; +} + +/** + * nm_client_wwan_get_enabled: + * @client: a #NMClient + * + * Determines whether WWAN is enabled. + * + * Returns: %TRUE if WWAN is enabled + **/ +gboolean +nm_client_wwan_get_enabled (NMClient *client) +{ + g_return_val_if_fail (NM_IS_CLIENT (client), FALSE); + + return NM_CLIENT_GET_PRIVATE (client)->wwan_enabled; +} + +/** + * nm_client_wwan_set_enabled: + * @client: a #NMClient + * @enabled: %TRUE to enable WWAN + * + * Enables or disables WWAN devices. + **/ +void +nm_client_wwan_set_enabled (NMClient *client, gboolean enabled) +{ + GValue value = {0,}; + + g_return_if_fail (NM_IS_CLIENT (client)); + + g_value_init (&value, G_TYPE_BOOLEAN); + g_value_set_boolean (&value, enabled); + + _nm_object_set_property (NM_OBJECT (client), + NM_DBUS_INTERFACE, + "WwanEnabled", + &value); +} + +/** + * nm_client_wwan_hardware_get_enabled: + * @client: a #NMClient + * + * Determines whether the WWAN hardware is enabled. + * + * Returns: %TRUE if the WWAN hardware is enabled + **/ +gboolean +nm_client_wwan_hardware_get_enabled (NMClient *client) +{ + g_return_val_if_fail (NM_IS_CLIENT (client), FALSE); + + return NM_CLIENT_GET_PRIVATE (client)->wwan_hw_enabled; +} + +/** + * nm_client_get_state: + * @client: a #NMClient + * + * Gets the current daemon state. + * + * Returns: the current %NMState + **/ +NMState +nm_client_get_state (NMClient *client) +{ + NMClientPrivate *priv; + + g_return_val_if_fail (NM_IS_CLIENT (client), NM_STATE_UNKNOWN); + + priv = NM_CLIENT_GET_PRIVATE (client); + + if (!priv->manager_running) + return NM_STATE_UNKNOWN; + + if (priv->state == NM_STATE_UNKNOWN) + priv->state = _nm_object_get_uint_property (NM_OBJECT (client), NM_DBUS_INTERFACE, "State"); + + return priv->state; +} + +/** + * nm_client_networking_get_enabled: + * @client: a #NMClient + * + * Whether networking is enabled or disabled. + * + * Returns: %TRUE if networking is disabled, %FALSE if networking is enabled + **/ +gboolean +nm_client_networking_get_enabled (NMClient *client) +{ + NMClientPrivate *priv; + + g_return_val_if_fail (NM_IS_CLIENT (client), FALSE); + + priv = NM_CLIENT_GET_PRIVATE (client); + if (!priv->have_networking_enabled) { + priv = NM_CLIENT_GET_PRIVATE (client); + if (!priv->networking_enabled) { + priv->networking_enabled = _nm_object_get_boolean_property (NM_OBJECT (client), + NM_DBUS_INTERFACE, + "NetworkingEnabled"); + priv->have_networking_enabled = TRUE; + } + } + + return priv->networking_enabled; +} + +/** + * nm_client_networking_set_enabled: + * @client: a #NMClient + * @enabled: %TRUE to set networking enabled, %FALSE to set networking disabled + * + * Enables or disables networking. When networking is disabled, all controlled + * interfaces are disconnected and deactivated. When networking is enabled, + * all controlled interfaces are available for activation. + **/ +void +nm_client_networking_set_enabled (NMClient *client, gboolean enable) +{ + GError *err = NULL; + + g_return_if_fail (NM_IS_CLIENT (client)); + + if (!org_freedesktop_NetworkManager_enable (NM_CLIENT_GET_PRIVATE (client)->client_proxy, enable, &err)) { + g_warning ("Error enabling/disabling networking: %s", err->message); + g_error_free (err); + } +} + +/** + * nm_client_sleep: + * @client: a #NMClient + * @sleep: %TRUE to put the daemon to sleep + * + * Deprecated; use nm_client_networking_set_enabled() instead. + **/ +void +nm_client_sleep (NMClient *client, gboolean sleep) +{ + nm_client_networking_set_enabled (client, !sleep); +} + +/** + * nm_client_get_manager_running: + * @client: a #NMClient + * + * Determines whether the daemon is running. + * + * Returns: %TRUE if the daemon is running + **/ +gboolean +nm_client_get_manager_running (NMClient *client) +{ + g_return_val_if_fail (NM_IS_CLIENT (client), FALSE); + + return NM_CLIENT_GET_PRIVATE (client)->manager_running; +} + diff --git a/libnm-glib/nm-client.h b/libnm-glib/nm-client.h new file mode 100644 index 00000000..6b912e05 --- /dev/null +++ b/libnm-glib/nm-client.h @@ -0,0 +1,110 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#ifndef NM_CLIENT_H +#define NM_CLIENT_H + +#include +#include +#include +#include +#include "nm-object.h" +#include "nm-device.h" +#include "nm-active-connection.h" + +G_BEGIN_DECLS + +#define NM_TYPE_CLIENT (nm_client_get_type ()) +#define NM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CLIENT, NMClient)) +#define NM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CLIENT, NMClientClass)) +#define NM_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CLIENT)) +#define NM_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_CLIENT)) +#define NM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CLIENT, NMClientClass)) + +#define NM_CLIENT_STATE "state" +#define NM_CLIENT_MANAGER_RUNNING "manager-running" +#define NM_CLIENT_NETWORKING_ENABLED "networking-enabled" +#define NM_CLIENT_WIRELESS_ENABLED "wireless-enabled" +#define NM_CLIENT_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled" +#define NM_CLIENT_WWAN_ENABLED "wwan-enabled" +#define NM_CLIENT_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled" +#define NM_CLIENT_ACTIVE_CONNECTIONS "active-connections" + +typedef struct { + NMObject parent; +} NMClient; + +typedef struct { + NMObjectClass parent; + + /* Signals */ + void (*device_added) (NMClient *client, NMDevice *device); + void (*device_removed) (NMClient *client, NMDevice *device); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMClientClass; + +GType nm_client_get_type (void); + +NMClient *nm_client_new (void); + +const GPtrArray *nm_client_get_devices (NMClient *client); +NMDevice *nm_client_get_device_by_path (NMClient *client, const char *object_path); + +typedef void (*NMClientActivateDeviceFn) (gpointer user_data, const char *object_path, GError *error); + +void nm_client_activate_connection (NMClient *client, + const char *service_name, + const char *connection_path, + NMDevice *device, + const char *specific_object, + NMClientActivateDeviceFn callback, + gpointer user_data); + +void nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active); + +gboolean nm_client_networking_get_enabled (NMClient *client); +void nm_client_networking_set_enabled (NMClient *client, gboolean enabled); + +gboolean nm_client_wireless_get_enabled (NMClient *client); +void nm_client_wireless_set_enabled (NMClient *client, gboolean enabled); +gboolean nm_client_wireless_hardware_get_enabled (NMClient *client); + +gboolean nm_client_wwan_get_enabled (NMClient *client); +void nm_client_wwan_set_enabled (NMClient *client, gboolean enabled); +gboolean nm_client_wwan_hardware_get_enabled (NMClient *client); + +NMState nm_client_get_state (NMClient *client); +gboolean nm_client_get_manager_running (NMClient *client); +const GPtrArray *nm_client_get_active_connections (NMClient *client); +void nm_client_sleep (NMClient *client, gboolean sleep); + +G_END_DECLS + +#endif /* NM_CLIENT_H */ diff --git a/libnm-glib/nm-dbus-utils.c b/libnm-glib/nm-dbus-utils.c new file mode 100644 index 00000000..f641f185 --- /dev/null +++ b/libnm-glib/nm-dbus-utils.c @@ -0,0 +1,215 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#include "nm-dbus-utils.h" + +char * +_nm_dbus_get_string_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name) +{ + GError *err = NULL; + char *str = NULL; + GValue value = {0,}; + + g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); + + if (dbus_g_proxy_call (proxy, "Get", &err, + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + str = g_strdup (g_value_get_string (&value)); + } else { + g_warning ("Error in device_get_property: %s\n", err->message); + g_error_free (err); + } + + return str; +} + +char * +_nm_dbus_get_object_path_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name) +{ + GError *err = NULL; + char *path = NULL; + GValue value = {0,}; + + g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); + + if (dbus_g_proxy_call (proxy, "Get", &err, + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + path = g_strdup (g_value_get_boxed (&value)); + } else { + g_warning ("Error in device_get_property: %s\n", err->message); + g_error_free (err); + } + + return path; +} + +gint32 +_nm_dbus_get_int_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name) +{ + GError *err = NULL; + gint32 i = 0; + GValue value = {0,}; + + g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), 0); + + if (dbus_g_proxy_call (proxy, "Get", &err, + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + i = g_value_get_int (&value); + } else { + g_warning ("Error in device_get_property: %s\n", err->message); + g_error_free (err); + } + + return i; +} + +guint32 +_nm_dbus_get_uint_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name) +{ + GError *err = NULL; + guint32 i = 0; + GValue value = {0,}; + + g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), 0); + + if (dbus_g_proxy_call (proxy, "Get", &err, + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + i = g_value_get_uint (&value); + } else { + g_warning ("Error in device_get_property: %s\n", err->message); + g_error_free (err); + } + + return i; +} + +gboolean +_nm_dbus_get_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name, + GValue *value) +{ + DBusGProxy *properties_proxy; + GError *err = NULL; + gboolean ret = TRUE; + + g_return_val_if_fail (proxy != NULL, FALSE); + g_return_val_if_fail (interface != NULL, FALSE); + g_return_val_if_fail (prop_name != NULL, FALSE); + + properties_proxy = dbus_g_proxy_new_from_proxy (proxy, + "org.freedesktop.DBus.Properties", + dbus_g_proxy_get_path (proxy)); + + if (!dbus_g_proxy_call (properties_proxy, "Get", &err, + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_INVALID, + G_TYPE_VALUE, value, + G_TYPE_INVALID)) { + g_warning ("Error in device_get_property: %s\n", err->message); + g_error_free (err); + ret = FALSE; + } + + g_object_unref (properties_proxy); + + return ret; +} + +void +_nm_dbus_set_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name, + GValue *value) +{ + DBusGProxy *properties_proxy; + + g_return_if_fail (proxy != NULL); + g_return_if_fail (interface != NULL); + g_return_if_fail (prop_name != NULL); + + properties_proxy = dbus_g_proxy_new_from_proxy (proxy, + "org.freedesktop.DBus.Properties", + dbus_g_proxy_get_path (proxy)); + + dbus_g_proxy_call_no_reply (properties_proxy, "Set", + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_VALUE, value, + G_TYPE_INVALID); + + g_object_unref (properties_proxy); +} + +char * +_nm_dbus_introspect (DBusGConnection *connection, + const char *interface, + const char *path) +{ + DBusGProxy *remote_object_introspectable; + char *introspect_data = NULL; + GError *err = NULL; + + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (interface != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + remote_object_introspectable = dbus_g_proxy_new_for_name (connection, + interface, + path, + "org.freedesktop.DBus.Introspectable"); + if (!dbus_g_proxy_call (remote_object_introspectable, "Introspect", &err, + G_TYPE_INVALID, + G_TYPE_STRING, &introspect_data, G_TYPE_INVALID)) { + g_error ("Failed to complete Introspect %s", err->message); + g_error_free (err); + } + + g_object_unref (G_OBJECT (remote_object_introspectable)); + + return introspect_data; +} diff --git a/libnm-glib/nm-dbus-utils.h b/libnm-glib/nm-dbus-utils.h new file mode 100644 index 00000000..4002c3a0 --- /dev/null +++ b/libnm-glib/nm-dbus-utils.h @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_UTILS_H +#define NM_UTILS_H + +#include + +char *_nm_dbus_get_string_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name); + +char *_nm_dbus_get_object_path_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name); + +gint32 _nm_dbus_get_int_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name); + +guint32 _nm_dbus_get_uint_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name); + +gboolean _nm_dbus_get_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name, + GValue *value); +void _nm_dbus_set_property (DBusGProxy *proxy, + const char *interface, + const char *prop_name, + GValue *value); + +char *_nm_dbus_introspect (DBusGConnection *connection, + const char *interface, + const char *path); + +#endif /* NM_UTILS_H */ diff --git a/libnm-glib/nm-device-bt.c b/libnm-glib/nm-device-bt.c new file mode 100644 index 00000000..0451f2b0 --- /dev/null +++ b/libnm-glib/nm-device-bt.c @@ -0,0 +1,307 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2009 Red Hat, Inc. + */ + +#include "nm-device-bt.h" +#include "nm-device-private.h" +#include "nm-object-private.h" + +#include "nm-device-bt-bindings.h" + +G_DEFINE_TYPE (NMDeviceBt, nm_device_bt, NM_TYPE_DEVICE) + +#define NM_DEVICE_BT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BT, NMDeviceBtPrivate)) + +typedef struct { + DBusGProxy *proxy; + + char *hw_address; + char *name; + guint32 bt_capabilities; + gboolean bt_capabilities_valid; + + gboolean disposed; +} NMDeviceBtPrivate; + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_NAME, + PROP_BT_CAPABILITIES, + + LAST_PROP +}; + +#define DBUS_PROP_HW_ADDRESS "HwAddress" +#define DBUS_PROP_NAME "Name" +#define DBUS_PROP_BT_CAPABILITIES "BtCapabilities" + +/** + * nm_device_bt_new: + * @connection: the #DBusGConnection + * @path: the DBus object path of the device + * + * Creates a new #NMDeviceBt. + * + * Returns: a new device + **/ +GObject * +nm_device_bt_new (DBusGConnection *connection, const char *path) +{ + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return g_object_new (NM_TYPE_DEVICE_BT, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); +} + +/** + * nm_device_bt_get_hw_address: + * @device: a #NMDeviceBt + * + * Gets the hardware (MAC) address of the #NMDeviceBt + * + * Returns: the hardware address. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_bt_get_hw_address (NMDeviceBt *device) +{ + NMDeviceBtPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_BT (device), NULL); + + priv = NM_DEVICE_BT_GET_PRIVATE (device); + if (!priv->hw_address) { + priv->hw_address = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_BLUETOOTH, + DBUS_PROP_HW_ADDRESS); + } + + return priv->hw_address; +} + +/** + * nm_device_bt_get_name: + * @device: a #NMDeviceBt + * + * Gets the name of the #NMDeviceBt. + * + * Returns: the name of the device + **/ +const char * +nm_device_bt_get_name (NMDeviceBt *device) +{ + NMDeviceBtPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_BT (device), NULL); + + priv = NM_DEVICE_BT_GET_PRIVATE (device); + if (!priv->name) { + priv->name = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_BLUETOOTH, + DBUS_PROP_NAME); + } + + return priv->name; +} + +/** + * nm_device_bt_get_capabilities: + * @device: a #NMDeviceBt + * + * Returns the Bluetooth device's usable capabilities. + * + * Returns: a combination of #NMBluetoothCapabilities + **/ +NMBluetoothCapabilities +nm_device_bt_get_capabilities (NMDeviceBt *device) +{ + NMDeviceBtPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_BT (device), NM_BT_CAPABILITY_NONE); + + priv = NM_DEVICE_BT_GET_PRIVATE (device); + if (!priv->bt_capabilities_valid) { + priv->bt_capabilities = _nm_object_get_uint_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_BLUETOOTH, + DBUS_PROP_BT_CAPABILITIES); + priv->bt_capabilities_valid = TRUE; + } + + return priv->bt_capabilities; +} + +static void +nm_device_bt_init (NMDeviceBt *device) +{ +} + +static void +register_for_property_changed (NMDeviceBt *device) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_DEVICE_BT_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, + { NM_DEVICE_BT_NAME, _nm_object_demarshal_generic, &priv->name }, + { NM_DEVICE_BT_CAPABILITIES, _nm_object_demarshal_generic, &priv->bt_capabilities }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (device), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + + object = G_OBJECT_CLASS (nm_device_bt_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (object) { + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)), + NM_DBUS_SERVICE, + nm_object_get_path (NM_OBJECT (object)), + NM_DBUS_INTERFACE_DEVICE_BLUETOOTH); + + register_for_property_changed (NM_DEVICE_BT (object)); + } + + return object; +} + +static void +dispose (GObject *object) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_device_bt_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_device_bt_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object); + + g_free (priv->hw_address); + g_free (priv->name); + + G_OBJECT_CLASS (nm_device_bt_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDeviceBt *device = NM_DEVICE_BT (object); + + switch (prop_id) { + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_device_bt_get_hw_address (device)); + break; + case PROP_NAME: + g_value_set_string (value, nm_device_bt_get_name (device)); + break; + case PROP_BT_CAPABILITIES: + g_value_set_uint (value, nm_device_bt_get_capabilities (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_bt_class_init (NMDeviceBtClass *device_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (device_class); + + g_type_class_add_private (device_class, sizeof (NMDeviceBtPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->dispose = dispose; + object_class->finalize = finalize; + object_class->get_property = get_property; + + /* properties */ + + /** + * NMDeviceBt:hw-address: + * + * The hardware (MAC) address of the device. + **/ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_BT_HW_ADDRESS, + "MAC Address", + "Hardware MAC address", + NULL, + G_PARAM_READABLE)); + + /** + * NMDeviceBt:name: + * + * The name of the bluetooth device. + **/ + g_object_class_install_property + (object_class, PROP_NAME, + g_param_spec_string (NM_DEVICE_BT_NAME, + "Name", + "Device name", + NULL, + G_PARAM_READABLE)); + + /** + * NMDeviceBt:bt-capabilities: + * + * The device's bluetooth capabilities, a combination of #NMBluetoothCapabilities. + **/ + g_object_class_install_property + (object_class, PROP_BT_CAPABILITIES, + g_param_spec_uint (NM_DEVICE_BT_CAPABILITIES, + "BtCapabilities", + "Bluetooth capabilities", + NM_BT_CAPABILITY_NONE, G_MAXUINT32, NM_BT_CAPABILITY_NONE, + G_PARAM_READABLE)); + +} + diff --git a/libnm-glib/nm-device-bt.h b/libnm-glib/nm-device-bt.h new file mode 100644 index 00000000..71817f84 --- /dev/null +++ b/libnm-glib/nm-device-bt.h @@ -0,0 +1,71 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 - 2009 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_DEVICE_BT_H +#define NM_DEVICE_BT_H + +#include "NetworkManager.h" +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_BT (nm_device_bt_get_type ()) +#define NM_DEVICE_BT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BT, NMDeviceBt)) +#define NM_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BT, NMDeviceBtClass)) +#define NM_IS_DEVICE_BT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_BT)) +#define NM_IS_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE_BT)) +#define NM_DEVICE_BT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BT, NMDeviceBtClass)) + +#define NM_DEVICE_BT_HW_ADDRESS "hw-address" +#define NM_DEVICE_BT_NAME "name" +#define NM_DEVICE_BT_CAPABILITIES "bt-capabilities" + +typedef struct { + NMDevice parent; +} NMDeviceBt; + +typedef struct { + NMDeviceClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMDeviceBtClass; + +GType nm_device_bt_get_type (void); + +GObject *nm_device_bt_new (DBusGConnection *connection, const char *path); + +const char *nm_device_bt_get_hw_address (NMDeviceBt *device); + +const char *nm_device_bt_get_name (NMDeviceBt *device); + +NMBluetoothCapabilities nm_device_bt_get_capabilities (NMDeviceBt *device); + +G_END_DECLS + +#endif /* NM_DEVICE_BT_H */ diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c new file mode 100644 index 00000000..7a0cd925 --- /dev/null +++ b/libnm-glib/nm-device-ethernet.c @@ -0,0 +1,315 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include "nm-device-ethernet.h" +#include "nm-device-private.h" +#include "nm-object-private.h" + +#include "nm-device-ethernet-bindings.h" + +G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE) + +#define NM_DEVICE_ETHERNET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetPrivate)) + +typedef struct { + DBusGProxy *proxy; + + char * hw_address; + guint32 speed; + gboolean carrier; + gboolean carrier_valid; + + gboolean disposed; +} NMDeviceEthernetPrivate; + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_SPEED, + PROP_CARRIER, + + LAST_PROP +}; + +#define DBUS_PROP_HW_ADDRESS "HwAddress" +#define DBUS_PROP_SPEED "Speed" +#define DBUS_PROP_CARRIER "Carrier" + +/** + * nm_device_ethernet_new: + * @connection: the #DBusGConnection + * @path: the DBus object path of the device + * + * Creates a new #NMDeviceEthernet. + * + * Returns: a new device + **/ +GObject * +nm_device_ethernet_new (DBusGConnection *connection, const char *path) +{ + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return g_object_new (NM_TYPE_DEVICE_ETHERNET, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); +} + +/** + * nm_device_ethernet_get_hw_address: + * @device: a #NMDeviceEthernet + * + * Gets the hardware (MAC) address of the #NMDeviceEthernet + * + * Returns: the hardware address. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_ethernet_get_hw_address (NMDeviceEthernet *device) +{ + NMDeviceEthernetPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL); + + priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + if (!priv->hw_address) { + priv->hw_address = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRED, + DBUS_PROP_HW_ADDRESS); + } + + return priv->hw_address; +} + +/** + * nm_device_ethernet_get_speed: + * @device: a #NMDeviceEthernet + * + * Gets the speed of the #NMDeviceEthernet. + * + * Returns: the speed of the device + **/ +guint32 +nm_device_ethernet_get_speed (NMDeviceEthernet *device) +{ + NMDeviceEthernetPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), 0); + + priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + if (!priv->speed) { + priv->speed = _nm_object_get_uint_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRED, + DBUS_PROP_SPEED); + } + + return priv->speed; +} + +/** + * nm_device_ethernet_get_carrier: + * @device: a #NMDeviceEthernet + * + * Whether the device has carrier. + * + * Returns: %TRUE if the device has carrier + **/ +gboolean +nm_device_ethernet_get_carrier (NMDeviceEthernet *device) +{ + NMDeviceEthernetPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), FALSE); + + priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + if (!priv->carrier_valid) { + priv->carrier = _nm_object_get_boolean_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRED, + DBUS_PROP_CARRIER); + priv->carrier_valid = TRUE; + } + + return priv->carrier; +} + +static void +nm_device_ethernet_init (NMDeviceEthernet *device) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + + priv->disposed = FALSE; + priv->carrier = FALSE; + priv->carrier_valid = FALSE; +} + +static void +register_for_property_changed (NMDeviceEthernet *device) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_DEVICE_ETHERNET_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, + { NM_DEVICE_ETHERNET_SPEED, _nm_object_demarshal_generic, &priv->speed }, + { NM_DEVICE_ETHERNET_CARRIER, _nm_object_demarshal_generic, &priv->carrier }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (device), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMDeviceEthernetPrivate *priv; + + object = G_OBJECT_CLASS (nm_device_ethernet_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)), + NM_DBUS_SERVICE, + nm_object_get_path (NM_OBJECT (object)), + NM_DBUS_INTERFACE_DEVICE_WIRED); + + register_for_property_changed (NM_DEVICE_ETHERNET (object)); + + return object; +} + +static void +dispose (GObject *object) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object); + + if (priv->hw_address) + g_free (priv->hw_address); + + G_OBJECT_CLASS (nm_device_ethernet_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDeviceEthernet *device = NM_DEVICE_ETHERNET (object); + + switch (prop_id) { + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_device_ethernet_get_hw_address (device)); + break; + case PROP_SPEED: + g_value_set_uint (value, nm_device_ethernet_get_speed (device)); + break; + case PROP_CARRIER: + g_value_set_boolean (value, nm_device_ethernet_get_carrier (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_ethernet_class_init (NMDeviceEthernetClass *device_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (device_class); + + g_type_class_add_private (device_class, sizeof (NMDeviceEthernetPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->dispose = dispose; + object_class->finalize = finalize; + object_class->get_property = get_property; + + /* properties */ + + /** + * NMDeviceEthernet:hw-address: + * + * The hardware (MAC) address of the device. + **/ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS, + "MAC Address", + "Hardware MAC address", + NULL, + G_PARAM_READABLE)); + + /** + * NMDeviceEthernet:speed: + * + * The speed of the device. + **/ + g_object_class_install_property + (object_class, PROP_SPEED, + g_param_spec_uint (NM_DEVICE_ETHERNET_SPEED, + "Speed", + "Speed", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + /** + * NMDeviceEthernet:carrier: + * + * Whether the device has carrier. + **/ + g_object_class_install_property + (object_class, PROP_CARRIER, + g_param_spec_boolean (NM_DEVICE_ETHERNET_CARRIER, + "Carrier", + "Carrier", + FALSE, + G_PARAM_READABLE)); + +} + diff --git a/libnm-glib/nm-device-ethernet.h b/libnm-glib/nm-device-ethernet.h new file mode 100644 index 00000000..565e3e7e --- /dev/null +++ b/libnm-glib/nm-device-ethernet.h @@ -0,0 +1,68 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_ETHERNET_H +#define NM_DEVICE_ETHERNET_H + +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_ETHERNET (nm_device_ethernet_get_type ()) +#define NM_DEVICE_ETHERNET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernet)) +#define NM_DEVICE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass)) +#define NM_IS_DEVICE_ETHERNET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_ETHERNET)) +#define NM_IS_DEVICE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE_ETHERNET)) +#define NM_DEVICE_ETHERNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass)) + +#define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address" +#define NM_DEVICE_ETHERNET_SPEED "speed" +#define NM_DEVICE_ETHERNET_CARRIER "carrier" + +typedef struct { + NMDevice parent; +} NMDeviceEthernet; + +typedef struct { + NMDeviceClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMDeviceEthernetClass; + +GType nm_device_ethernet_get_type (void); + +GObject *nm_device_ethernet_new (DBusGConnection *connection, const char *path); + +const char * nm_device_ethernet_get_hw_address (NMDeviceEthernet *device); +guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device); +gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *device); + +G_END_DECLS + +#endif /* NM_DEVICE_ETHERNET_H */ diff --git a/libnm-glib/nm-device-private.h b/libnm-glib/nm-device-private.h new file mode 100644 index 00000000..2c56a0e6 --- /dev/null +++ b/libnm-glib/nm-device-private.h @@ -0,0 +1,36 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_PRIVATE_H +#define NM_DEVICE_PRIVATE_H + +#include + +DBusGConnection *nm_device_get_connection (NMDevice *device); +const char *nm_device_get_path (NMDevice *device); +DBusGProxy *nm_device_get_properties_proxy (NMDevice *device); + +/* static methods */ +NMDeviceType nm_device_type_for_path (DBusGConnection *connection, + const char *path); + +#endif /* NM_DEVICE_PRIVATE_H */ diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c new file mode 100644 index 00000000..1729c8aa --- /dev/null +++ b/libnm-glib/nm-device-wifi.c @@ -0,0 +1,759 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include + +#include "nm-device-wifi.h" +#include "nm-device-private.h" +#include "nm-object-private.h" +#include "nm-object-cache.h" +#include "nm-dbus-glib-types.h" +#include "nm-types-private.h" + +#include "nm-device-wifi-bindings.h" + +G_DEFINE_TYPE (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE) + +#define NM_DEVICE_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WIFI, NMDeviceWifiPrivate)) + +static gboolean demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field); + +void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled); + +typedef struct { + gboolean disposed; + DBusGProxy *proxy; + + char *hw_address; + NM80211Mode mode; + guint32 rate; + NMAccessPoint *active_ap; + gboolean null_active_ap; + guint32 wireless_caps; + GPtrArray *aps; + + gboolean wireless_enabled; +} NMDeviceWifiPrivate; + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_MODE, + PROP_BITRATE, + PROP_ACTIVE_ACCESS_POINT, + PROP_WIRELESS_CAPABILITIES, + + LAST_PROP +}; + +#define DBUS_PROP_HW_ADDRESS "HwAddress" +#define DBUS_PROP_MODE "Mode" +#define DBUS_PROP_BITRATE "Bitrate" +#define DBUS_PROP_ACTIVE_ACCESS_POINT "ActiveAccessPoint" +#define DBUS_PROP_WIRELESS_CAPABILITIES "WirelessCapabilities" + +enum { + ACCESS_POINT_ADDED, + ACCESS_POINT_REMOVED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +/** + * nm_device_wifi_new: + * @connection: the #DBusGConnection + * @path: the DBus object path of the device + * + * Creates a new #NMDeviceWifi. + * + * Returns: a new device + **/ +GObject * +nm_device_wifi_new (DBusGConnection *connection, const char *path) +{ + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return g_object_new (NM_TYPE_DEVICE_WIFI, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); +} + +/** + * nm_device_wifi_get_hw_address: + * @device: a #NMDeviceWifi + * + * Gets the hardware (MAC) address of the #NMDeviceWifi + * + * Returns: the hardware address. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_wifi_get_hw_address (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + if (!priv->hw_address) { + priv->hw_address = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + DBUS_PROP_HW_ADDRESS); + } + + return priv->hw_address; +} + +/** + * nm_device_wifi_get_mode: + * @device: a #NMDeviceWifi + * + * Gets the #NMDeviceWifi mode. + * + * Returns: the mode + **/ +NM80211Mode +nm_device_wifi_get_mode (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + if (!priv->mode) { + priv->mode = _nm_object_get_uint_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + DBUS_PROP_MODE); + } + + return priv->mode; +} + +/** + * nm_device_wifi_get_bitrate: + * @device: a #NMDeviceWifi + * + * Gets the bit rate of the #NMDeviceWifi. + * + * Returns: the bit rate + **/ +guint32 +nm_device_wifi_get_bitrate (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv; + NMDeviceState state; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0); + + state = nm_device_get_state (NM_DEVICE (device)); + switch (state) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + case NM_DEVICE_STATE_ACTIVATED: + break; + default: + return 0; + break; + } + + priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + if (!priv->rate) { + priv->rate = _nm_object_get_uint_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + DBUS_PROP_BITRATE); + } + + return priv->rate; +} + +/** + * nm_device_wifi_get_capabilities: + * @device: a #NMDeviceWifi + * + * Gets the WIFI capabilities of the #NMDeviceWifi. + * + * Returns: the capabilities + **/ +guint32 +nm_device_wifi_get_capabilities (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + if (!priv->wireless_caps) { + priv->wireless_caps = _nm_object_get_uint_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + DBUS_PROP_WIRELESS_CAPABILITIES); + } + + return priv->wireless_caps; +} + +/** + * nm_device_wifi_get_active_access_point: + * @device: a #NMDeviceWifi + * + * Gets the active #NMAccessPoint. + * + * Returns: the access point or %NULL if none is active + **/ +NMAccessPoint * +nm_device_wifi_get_active_access_point (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv; + NMDeviceState state; + char *path; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL); + + state = nm_device_get_state (NM_DEVICE (device)); + switch (state) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + case NM_DEVICE_STATE_ACTIVATED: + break; + default: + return NULL; + break; + } + + priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + if (priv->active_ap) + return priv->active_ap; + if (priv->null_active_ap) + return NULL; + + path = _nm_object_get_object_path_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE_WIRELESS, + DBUS_PROP_ACTIVE_ACCESS_POINT); + if (path) { + g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH); + g_value_take_boxed (&value, path); + demarshal_active_ap (NM_OBJECT (device), NULL, &value, &priv->active_ap); + g_value_unset (&value); + } + + return priv->active_ap; +} + +/** + * nm_device_wifi_get_access_points: + * @device: a #NMDeviceWifi + * + * Gets all the scanned access points of the #NMDeviceWifi. + * + * Returns: a #GPtrArray containing all the scanned #NMAccessPoints. + * The returned array is owned by the client and should not be modified. + **/ +const GPtrArray * +nm_device_wifi_get_access_points (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv; + DBusGConnection *connection; + GValue value = { 0, }; + GError *error = NULL; + GPtrArray *temp; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + if (priv->aps) + return handle_ptr_array_return (priv->aps); + + if (!org_freedesktop_NetworkManager_Device_Wireless_get_access_points (priv->proxy, &temp, &error)) { + g_warning ("%s: error getting access points: %s", __func__, error->message); + g_error_free (error); + return NULL; + } + + g_value_init (&value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH); + g_value_take_boxed (&value, temp); + connection = nm_object_get_connection (NM_OBJECT (device)); + _nm_object_array_demarshal (&value, &priv->aps, connection, nm_access_point_new); + g_value_unset (&value); + + return handle_ptr_array_return (priv->aps); +} + +/** + * nm_device_wifi_get_access_point_by_path: + * @device: a #NMDeviceWifi + * @path: the object path of the access point + * + * Gets a #NMAccessPoint by path. + * + * Returns: the access point or %NULL if none is found. + **/ +NMAccessPoint * +nm_device_wifi_get_access_point_by_path (NMDeviceWifi *device, + const char *path) +{ + const GPtrArray *aps; + int i; + NMAccessPoint *ap = NULL; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL); + g_return_val_if_fail (path != NULL, NULL); + + aps = nm_device_wifi_get_access_points (device); + if (!aps) + return NULL; + + for (i = 0; i < aps->len; i++) { + NMAccessPoint *candidate = g_ptr_array_index (aps, i); + if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), path)) { + ap = candidate; + break; + } + } + + return ap; +} + +static void +access_point_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (user_data); + NMDeviceWifiPrivate *priv; + GObject *ap; + + g_return_if_fail (self != NULL); + + ap = G_OBJECT (nm_device_wifi_get_access_point_by_path (self, path)); + if (!ap) { + DBusGConnection *connection = nm_object_get_connection (NM_OBJECT (self)); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + ap = G_OBJECT (_nm_object_cache_get (path)); + if (ap) { + g_ptr_array_add (priv->aps, g_object_ref (ap)); + } else { + ap = G_OBJECT (nm_access_point_new (connection, path)); + if (ap) + g_ptr_array_add (priv->aps, ap); + } + } + + if (ap) + g_signal_emit (self, signals[ACCESS_POINT_ADDED], 0, NM_ACCESS_POINT (ap)); +} + +static void +access_point_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (user_data); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMAccessPoint *ap; + + g_return_if_fail (self != NULL); + + ap = nm_device_wifi_get_access_point_by_path (self, path); + if (ap) { + if (ap == priv->active_ap) { + g_object_unref (priv->active_ap); + priv->active_ap = NULL; + priv->null_active_ap = FALSE; + + _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT); + priv->rate = 0; + _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIFI_BITRATE); + } + + g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap); + g_ptr_array_remove (priv->aps, ap); + g_object_unref (G_OBJECT (ap)); + } +} + +static void +clean_up_aps (NMDeviceWifi *self, gboolean notify) +{ + NMDeviceWifiPrivate *priv; + + g_return_if_fail (NM_IS_DEVICE_WIFI (self)); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + if (priv->active_ap) { + g_object_unref (priv->active_ap); + priv->active_ap = NULL; + } + + if (priv->aps) { + while (priv->aps->len) { + NMAccessPoint *ap = NM_ACCESS_POINT (g_ptr_array_index (priv->aps, 0)); + + if (notify) + g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap); + g_ptr_array_remove (priv->aps, ap); + g_object_unref (ap); + } + g_ptr_array_free (priv->aps, TRUE); + priv->aps = NULL; + } +} + +/** + * _nm_device_wifi_set_wireless_enabled: + * @device: a #NMDeviceWifi + * @enabled: %TRUE to enable the device + * + * Enables or disables the wireless device. + **/ +void +_nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, + gboolean enabled) +{ + g_return_if_fail (NM_IS_DEVICE_WIFI (device)); + + if (!enabled) + clean_up_aps (device, TRUE); +} + + +/**************************************************************/ + +static void +nm_device_wifi_init (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + + priv->disposed = FALSE; +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (object); + + switch (prop_id) { + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_device_wifi_get_hw_address (self)); + break; + case PROP_MODE: + g_value_set_uint (value, nm_device_wifi_get_mode (self)); + break; + case PROP_BITRATE: + g_value_set_uint (value, nm_device_wifi_get_bitrate (self)); + break; + case PROP_ACTIVE_ACCESS_POINT: + g_value_set_object (value, nm_device_wifi_get_active_access_point (self)); + break; + case PROP_WIRELESS_CAPABILITIES: + g_value_set_uint (value, nm_device_wifi_get_capabilities (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (device); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + switch (nm_device_get_state (device)) { + case NM_DEVICE_STATE_UNKNOWN: + case NM_DEVICE_STATE_UNMANAGED: + case NM_DEVICE_STATE_UNAVAILABLE: + case NM_DEVICE_STATE_DISCONNECTED: + case NM_DEVICE_STATE_FAILED: + /* Just clear active AP; don't clear the AP list unless wireless is disabled completely */ + if (priv->active_ap) { + g_object_unref (priv->active_ap); + priv->active_ap = NULL; + priv->null_active_ap = FALSE; + } + _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT); + priv->rate = 0; + _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIFI_BITRATE); + break; + default: + break; + } +} + +static gboolean +demarshal_active_ap (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object); + const char *path; + NMAccessPoint *ap = NULL; + DBusGConnection *connection; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) + return FALSE; + + priv->null_active_ap = FALSE; + + path = g_value_get_boxed (value); + if (path) { + if (!strcmp (path, "/")) + priv->null_active_ap = TRUE; + else { + ap = NM_ACCESS_POINT (_nm_object_cache_get (path)); + if (ap) + ap = g_object_ref (ap); + else { + connection = nm_object_get_connection (object); + ap = NM_ACCESS_POINT (nm_access_point_new (connection, path)); + } + } + } + + if (priv->active_ap) { + g_object_unref (priv->active_ap); + priv->active_ap = NULL; + } + + if (ap) + priv->active_ap = ap; + + _nm_object_queue_notify (object, NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT); + return TRUE; +} + +static void +register_for_property_changed (NMDeviceWifi *device) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_DEVICE_WIFI_HW_ADDRESS, _nm_object_demarshal_generic, &priv->hw_address }, + { NM_DEVICE_WIFI_MODE, _nm_object_demarshal_generic, &priv->mode }, + { NM_DEVICE_WIFI_BITRATE, _nm_object_demarshal_generic, &priv->rate }, + { NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, demarshal_active_ap, &priv->active_ap }, + { NM_DEVICE_WIFI_CAPABILITIES, _nm_object_demarshal_generic, &priv->wireless_caps }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (device), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMDeviceWifiPrivate *priv; + + object = G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_DEVICE_WIFI_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)), + NM_DBUS_SERVICE, + nm_object_get_path (NM_OBJECT (object)), + NM_DBUS_INTERFACE_DEVICE_WIRELESS); + + dbus_g_proxy_add_signal (priv->proxy, "AccessPointAdded", + DBUS_TYPE_G_OBJECT_PATH, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "AccessPointAdded", + G_CALLBACK (access_point_added_proxy), + object, NULL); + + dbus_g_proxy_add_signal (priv->proxy, "AccessPointRemoved", + DBUS_TYPE_G_OBJECT_PATH, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "AccessPointRemoved", + G_CALLBACK (access_point_removed_proxy), + object, NULL); + + register_for_property_changed (NM_DEVICE_WIFI (object)); + + g_signal_connect (NM_DEVICE (object), + "notify::" NM_DEVICE_STATE, + G_CALLBACK (state_changed_cb), + NULL); + + return object; +} + +static void +dispose (GObject *object) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + clean_up_aps (NM_DEVICE_WIFI (object), FALSE); + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object); + + if (priv->hw_address) + g_free (priv->hw_address); + + G_OBJECT_CLASS (nm_device_wifi_parent_class)->finalize (object); +} + +static void +nm_device_wifi_class_init (NMDeviceWifiClass *device_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (device_class); + + g_type_class_add_private (device_class, sizeof (NMDeviceWifiPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMDeviceWifi:hw-address: + * + * The hardware (MAC) address of the device. + **/ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, + "MAC Address", + "Hardware MAC address", + NULL, + G_PARAM_READABLE)); + + /** + * NMDeviceWifi:mode: + * + * The mode of the device. + **/ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_uint (NM_DEVICE_WIFI_MODE, + "Mode", + "Mode", + NM_802_11_MODE_UNKNOWN, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA, + G_PARAM_READABLE)); + + /** + * NMDeviceWifi:bitrate: + * + * The bit rate of the device. + **/ + g_object_class_install_property + (object_class, PROP_BITRATE, + g_param_spec_uint (NM_DEVICE_WIFI_BITRATE, + "Bit Rate", + "Bit Rate", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + /** + * NMDeviceWifi:active-access-point: + * + * The active #NMAccessPoint of the device. + **/ + g_object_class_install_property + (object_class, PROP_ACTIVE_ACCESS_POINT, + g_param_spec_object (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, + "Active Access Point", + "Active Access Point", + NM_TYPE_ACCESS_POINT, + G_PARAM_READABLE)); + + /** + * NMDeviceWifi:wireless-capabilities: + * + * The wireless capabilities of the device. + **/ + g_object_class_install_property + (object_class, PROP_WIRELESS_CAPABILITIES, + g_param_spec_uint (NM_DEVICE_WIFI_CAPABILITIES, + "Wireless Capabilities", + "Wireless Capabilities", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + /* signals */ + + /** + * NMDeviceWifi::access-point-added: + * @device: the wifi device that received the signal + * @ap: the new access point + * + * Notifies that a #NMAccessPoint is added to the wifi device. + **/ + signals[ACCESS_POINT_ADDED] = + g_signal_new ("access-point-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + + /** + * NMDeviceWifi::access-point-removed: + * @device: the wifi device that received the signal + * @ap: the removed access point + * + * Notifies that a #NMAccessPoint is removed from the wifi device. + **/ + signals[ACCESS_POINT_REMOVED] = + g_signal_new ("access-point-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); +} diff --git a/libnm-glib/nm-device-wifi.h b/libnm-glib/nm-device-wifi.h new file mode 100644 index 00000000..9152ab29 --- /dev/null +++ b/libnm-glib/nm-device-wifi.h @@ -0,0 +1,82 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_WIFI_H +#define NM_DEVICE_WIFI_H + +#include "nm-device.h" +#include "nm-access-point.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_WIFI (nm_device_wifi_get_type ()) +#define NM_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifi)) +#define NM_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass)) +#define NM_IS_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_WIFI)) +#define NM_IS_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE_WIFI)) +#define NM_DEVICE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass)) + +#define NM_DEVICE_WIFI_HW_ADDRESS "hw-address" +#define NM_DEVICE_WIFI_MODE "mode" +#define NM_DEVICE_WIFI_BITRATE "bitrate" +#define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point" +#define NM_DEVICE_WIFI_CAPABILITIES "wireless-capabilities" + +typedef struct { + NMDevice parent; +} NMDeviceWifi; + +typedef struct { + NMDeviceClass parent; + + /* Signals */ + void (*access_point_added) (NMDeviceWifi *device, NMAccessPoint *ap); + void (*access_point_removed) (NMDeviceWifi *device, NMAccessPoint *ap); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMDeviceWifiClass; + +GType nm_device_wifi_get_type (void); + +GObject *nm_device_wifi_new (DBusGConnection *connection, const char *path); + +const char * nm_device_wifi_get_hw_address (NMDeviceWifi *device); +NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *device); +guint32 nm_device_wifi_get_bitrate (NMDeviceWifi *device); +guint32 nm_device_wifi_get_capabilities (NMDeviceWifi *device); +NMAccessPoint * nm_device_wifi_get_active_access_point (NMDeviceWifi *device); + +NMAccessPoint * nm_device_wifi_get_access_point_by_path (NMDeviceWifi *device, + const char *path); + +const GPtrArray *nm_device_wifi_get_access_points (NMDeviceWifi *device); + +G_END_DECLS + +#endif /* NM_DEVICE_WIFI_H */ diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c new file mode 100644 index 00000000..5e9eb506 --- /dev/null +++ b/libnm-glib/nm-device.c @@ -0,0 +1,1246 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include + +#define G_UDEV_API_IS_SUBJECT_TO_CHANGE +#include + +#include "NetworkManager.h" +#include "nm-device-ethernet.h" +#include "nm-device-wifi.h" +#include "nm-gsm-device.h" +#include "nm-cdma-device.h" +#include "nm-device-bt.h" +#include "nm-device.h" +#include "nm-device-private.h" +#include "nm-object-private.h" +#include "nm-object-cache.h" +#include "nm-marshal.h" + +#include "nm-device-bindings.h" + +G_DEFINE_TYPE (NMDevice, nm_device, NM_TYPE_OBJECT) + +#define NM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE, NMDevicePrivate)) + +typedef struct { + gboolean disposed; + DBusGProxy *proxy; + + char *iface; + char *udi; + char *driver; + guint32 capabilities; + gboolean managed; + NMIP4Config *ip4_config; + gboolean null_ip4_config; + NMDHCP4Config *dhcp4_config; + gboolean null_dhcp4_config; + NMIP6Config *ip6_config; + gboolean null_ip6_config; + NMDHCP6Config *dhcp6_config; + gboolean null_dhcp6_config; + NMDeviceState state; + + GUdevClient *client; + char *product; + char *vendor; +} NMDevicePrivate; + +enum { + PROP_0, + PROP_INTERFACE, + PROP_UDI, + PROP_DRIVER, + PROP_CAPABILITIES, + PROP_MANAGED, + PROP_IP4_CONFIG, + PROP_DHCP4_CONFIG, + PROP_IP6_CONFIG, + PROP_STATE, + PROP_PRODUCT, + PROP_VENDOR, + PROP_DHCP6_CONFIG, + + LAST_PROP +}; + +enum { + STATE_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + +static void +nm_device_init (NMDevice *device) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + + priv->state = NM_DEVICE_STATE_UNKNOWN; +} + +static gboolean +demarshal_ip4_config (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + const char *path; + NMIP4Config *config = NULL; + DBusGConnection *connection; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) + return FALSE; + + priv->null_ip4_config = FALSE; + + path = g_value_get_boxed (value); + if (path) { + if (!strcmp (path, "/")) + priv->null_ip4_config = TRUE; + else { + config = NM_IP4_CONFIG (_nm_object_cache_get (path)); + if (config) + config = g_object_ref (config); + else { + connection = nm_object_get_connection (object); + config = NM_IP4_CONFIG (nm_ip4_config_new (connection, path)); + } + } + } + + if (priv->ip4_config) { + g_object_unref (priv->ip4_config); + priv->ip4_config = NULL; + } + + if (config) + priv->ip4_config = config; + + _nm_object_queue_notify (object, NM_DEVICE_IP4_CONFIG); + return TRUE; +} + +static gboolean +demarshal_dhcp4_config (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + const char *path; + NMDHCP4Config *config = NULL; + DBusGConnection *connection; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) + return FALSE; + + priv->null_dhcp4_config = FALSE; + + path = g_value_get_boxed (value); + if (path) { + if (!strcmp (path, "/")) + priv->null_dhcp4_config = TRUE; + else { + config = NM_DHCP4_CONFIG (_nm_object_cache_get (path)); + if (config) + config = g_object_ref (config); + else { + connection = nm_object_get_connection (object); + config = NM_DHCP4_CONFIG (nm_dhcp4_config_new (connection, path)); + } + } + } + + if (priv->dhcp4_config) { + g_object_unref (priv->dhcp4_config); + priv->dhcp4_config = NULL; + } + + if (config) + priv->dhcp4_config = config; + + _nm_object_queue_notify (object, NM_DEVICE_DHCP4_CONFIG); + return TRUE; +} + +static gboolean +demarshal_ip6_config (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + const char *path; + NMIP6Config *config = NULL; + DBusGConnection *connection; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) + return FALSE; + + priv->null_ip6_config = FALSE; + + path = g_value_get_boxed (value); + if (path) { + if (!strcmp (path, "/")) + priv->null_ip6_config = TRUE; + else { + config = NM_IP6_CONFIG (_nm_object_cache_get (path)); + if (config) + config = g_object_ref (config); + else { + connection = nm_object_get_connection (object); + config = NM_IP6_CONFIG (nm_ip6_config_new (connection, path)); + } + } + } + + if (priv->ip6_config) { + g_object_unref (priv->ip6_config); + priv->ip6_config = NULL; + } + + if (config) + priv->ip6_config = config; + + _nm_object_queue_notify (object, NM_DEVICE_IP6_CONFIG); + return TRUE; +} + +static gboolean +demarshal_dhcp6_config (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + const char *path; + NMDHCP6Config *config = NULL; + DBusGConnection *connection; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) + return FALSE; + + priv->null_dhcp6_config = FALSE; + + path = g_value_get_boxed (value); + if (path) { + if (!strcmp (path, "/")) + priv->null_dhcp6_config = TRUE; + else { + config = NM_DHCP6_CONFIG (_nm_object_cache_get (path)); + if (config) + config = g_object_ref (config); + else { + connection = nm_object_get_connection (object); + config = NM_DHCP6_CONFIG (nm_dhcp6_config_new (connection, path)); + } + } + } + + if (priv->dhcp6_config) { + g_object_unref (priv->dhcp6_config); + priv->dhcp6_config = NULL; + } + + if (config) + priv->dhcp6_config = config; + + _nm_object_queue_notify (object, NM_DEVICE_DHCP6_CONFIG); + return TRUE; +} + +static void +register_for_property_changed (NMDevice *device) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_DEVICE_UDI, _nm_object_demarshal_generic, &priv->udi }, + { NM_DEVICE_INTERFACE, _nm_object_demarshal_generic, &priv->iface }, + { NM_DEVICE_DRIVER, _nm_object_demarshal_generic, &priv->driver }, + { NM_DEVICE_CAPABILITIES, _nm_object_demarshal_generic, &priv->capabilities }, + { NM_DEVICE_MANAGED, _nm_object_demarshal_generic, &priv->managed }, + { NM_DEVICE_IP4_CONFIG, demarshal_ip4_config, &priv->ip4_config }, + { NM_DEVICE_DHCP4_CONFIG, demarshal_dhcp4_config, &priv->dhcp4_config }, + { NM_DEVICE_IP6_CONFIG, demarshal_ip6_config, &priv->ip6_config }, + { NM_DEVICE_DHCP6_CONFIG, demarshal_dhcp6_config, &priv->dhcp6_config }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (device), + priv->proxy, + property_changed_info); +} + +static void +device_state_changed (DBusGProxy *proxy, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->state != new_state) { + priv->state = new_state; + g_signal_emit (self, signals[STATE_CHANGED], 0, new_state, old_state, reason); + _nm_object_queue_notify (NM_OBJECT (self), "state"); + } +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + NMDevicePrivate *priv; + + object = (NMObject *) G_OBJECT_CLASS (nm_device_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_DEVICE_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object), + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE_DEVICE); + + register_for_property_changed (NM_DEVICE (object)); + + dbus_g_object_register_marshaller (_nm_marshal_VOID__UINT_UINT_UINT, + G_TYPE_NONE, + G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, + G_TYPE_INVALID); + + dbus_g_proxy_add_signal (priv->proxy, + "StateChanged", + G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, + G_TYPE_INVALID); + + dbus_g_proxy_connect_signal (priv->proxy, "StateChanged", + G_CALLBACK (device_state_changed), + NM_DEVICE (object), + NULL); + + return G_OBJECT (object); +} + +static void +dispose (GObject *object) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_device_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + g_object_unref (priv->proxy); + if (priv->ip4_config) + g_object_unref (priv->ip4_config); + if (priv->dhcp4_config) + g_object_unref (priv->dhcp4_config); + if (priv->ip6_config) + g_object_unref (priv->ip6_config); + if (priv->dhcp6_config) + g_object_unref (priv->dhcp6_config); + if (priv->client) + g_object_unref (priv->client); + + G_OBJECT_CLASS (nm_device_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + + g_free (priv->iface); + g_free (priv->udi); + g_free (priv->driver); + g_free (priv->product); + g_free (priv->vendor); + + G_OBJECT_CLASS (nm_device_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDevice *device = NM_DEVICE (object); + + switch (prop_id) { + case PROP_UDI: + g_value_set_string (value, nm_device_get_udi (device)); + break; + case PROP_INTERFACE: + g_value_set_string (value, nm_device_get_iface (device)); + break; + case PROP_DRIVER: + g_value_set_string (value, nm_device_get_driver (device)); + break; + case PROP_CAPABILITIES: + g_value_set_uint (value, nm_device_get_capabilities (device)); + break; + case PROP_MANAGED: + g_value_set_boolean (value, nm_device_get_managed (device)); + break; + case PROP_IP4_CONFIG: + g_value_set_object (value, nm_device_get_ip4_config (device)); + break; + case PROP_DHCP4_CONFIG: + g_value_set_object (value, nm_device_get_dhcp4_config (device)); + break; + case PROP_IP6_CONFIG: + g_value_set_object (value, nm_device_get_ip6_config (device)); + break; + case PROP_DHCP6_CONFIG: + g_value_set_object (value, nm_device_get_dhcp6_config (device)); + break; + case PROP_STATE: + g_value_set_uint (value, nm_device_get_state (device)); + break; + case PROP_PRODUCT: + g_value_set_string (value, nm_device_get_product (device)); + break; + case PROP_VENDOR: + g_value_set_string (value, nm_device_get_vendor (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_class_init (NMDeviceClass *device_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (device_class); + + g_type_class_add_private (device_class, sizeof (NMDevicePrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMDevice:interface: + * + * The interface of the device. + **/ + g_object_class_install_property + (object_class, PROP_INTERFACE, + g_param_spec_string (NM_DEVICE_INTERFACE, + "Interface", + "Interface name", + NULL, + G_PARAM_READABLE)); + + /** + * NMDevice:udi: + * + * The Unique Device Identifier of the device. + **/ + g_object_class_install_property + (object_class, PROP_UDI, + g_param_spec_string (NM_DEVICE_UDI, + "UDI", + "Unique Device Identifier", + NULL, + G_PARAM_READABLE)); + + /** + * NMDevice:driver: + * + * The driver of the device. + **/ + g_object_class_install_property + (object_class, PROP_DRIVER, + g_param_spec_string (NM_DEVICE_DRIVER, + "Driver", + "Driver", + NULL, + G_PARAM_READABLE)); + + /** + * NMDevice:capabilities: + * + * The capabilities of the device. + **/ + g_object_class_install_property + (object_class, PROP_CAPABILITIES, + g_param_spec_uint (NM_DEVICE_CAPABILITIES, + "Capabilities", + "Capabilities", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + /** + * NMDevice:managed: + * + * Whether the device is managed by NetworkManager. + **/ + g_object_class_install_property + (object_class, PROP_MANAGED, + g_param_spec_boolean (NM_DEVICE_MANAGED, + "Managed", + "Managed", + FALSE, + G_PARAM_READABLE)); + + /** + * NMDevice:ip4-config: + * + * The #NMIP4Config of the device. + **/ + g_object_class_install_property + (object_class, PROP_IP4_CONFIG, + g_param_spec_object (NM_DEVICE_IP4_CONFIG, + "IP4 Config", + "IP4 Config", + NM_TYPE_IP4_CONFIG, + G_PARAM_READABLE)); + + /** + * NMDevice:dhcp4-config: + * + * The #NMDHCP4Config of the device. + **/ + g_object_class_install_property + (object_class, PROP_DHCP4_CONFIG, + g_param_spec_object (NM_DEVICE_DHCP4_CONFIG, + "DHCP4 Config", + "DHCP4 Config", + NM_TYPE_DHCP4_CONFIG, + G_PARAM_READABLE)); + + /** + * NMDevice:ip6-config: + * + * The #NMIP6Config of the device. + **/ + g_object_class_install_property + (object_class, PROP_IP6_CONFIG, + g_param_spec_object (NM_DEVICE_IP6_CONFIG, + "IP6 Config", + "IP6 Config", + NM_TYPE_IP6_CONFIG, + G_PARAM_READABLE)); + + /** + * NMDevice:dhcp6-config: + * + * The #NMDHCP6Config of the device. + **/ + g_object_class_install_property + (object_class, PROP_DHCP6_CONFIG, + g_param_spec_object (NM_DEVICE_DHCP6_CONFIG, + "DHCP6 Config", + "DHCP6 Config", + NM_TYPE_DHCP6_CONFIG, + G_PARAM_READABLE)); + + /** + * NMDevice:state: + * + * The state of the device. + **/ + g_object_class_install_property + (object_class, PROP_STATE, + g_param_spec_uint (NM_DEVICE_STATE, + "State", + "State", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + /** + * NMDevice:vendor: + * + * The vendor string of the device. + **/ + g_object_class_install_property + (object_class, PROP_VENDOR, + g_param_spec_string (NM_DEVICE_VENDOR, + "Vendor", + "Vendor string", + NULL, + G_PARAM_READABLE)); + + /** + * NMDevice:product: + * + * The product string of the device. + **/ + g_object_class_install_property + (object_class, PROP_PRODUCT, + g_param_spec_string (NM_DEVICE_PRODUCT, + "Product", + "Product string", + NULL, + G_PARAM_READABLE)); + + /* signals */ + + /** + * NMDevice::state-changed: + * @device: the client that received the signal + * @state: the new state of the device + * + * Notifies the state change of a #NMDevice. + **/ + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceClass, state_changed), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT_UINT, + G_TYPE_NONE, 3, + G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); +} + +/** + * nm_device_new: + * @connection: the #DBusGConnection + * @path: the DBus object path of the device + * + * Creates a new #NMDevice. + * + * Returns: a new device + **/ +GObject * +nm_device_new (DBusGConnection *connection, const char *path) +{ + DBusGProxy *proxy; + GError *err = NULL; + GValue value = {0,}; + GType dtype = 0; + NMDevice *device = NULL; + + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + proxy = dbus_g_proxy_new_for_name (connection, + NM_DBUS_SERVICE, + path, + "org.freedesktop.DBus.Properties"); + if (!proxy) { + g_warning ("%s: couldn't create D-Bus object proxy.", __func__); + return NULL; + } + + if (!dbus_g_proxy_call (proxy, + "Get", &err, + G_TYPE_STRING, NM_DBUS_INTERFACE_DEVICE, + G_TYPE_STRING, "DeviceType", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, G_TYPE_INVALID)) { + g_warning ("Error in get_property: %s\n", err->message); + g_error_free (err); + goto out; + } + + switch (g_value_get_uint (&value)) { + case NM_DEVICE_TYPE_ETHERNET: + dtype = NM_TYPE_DEVICE_ETHERNET; + break; + case NM_DEVICE_TYPE_WIFI: + dtype = NM_TYPE_DEVICE_WIFI; + break; + case NM_DEVICE_TYPE_GSM: + dtype = NM_TYPE_GSM_DEVICE; + break; + case NM_DEVICE_TYPE_CDMA: + dtype = NM_TYPE_CDMA_DEVICE; + break; + case NM_DEVICE_TYPE_BT: + dtype = NM_TYPE_DEVICE_BT; + break; + default: + g_warning ("Unknown device type %d", g_value_get_uint (&value)); + break; + } + + if (dtype) { + device = (NMDevice *) g_object_new (dtype, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); + } + +out: + g_object_unref (proxy); + return G_OBJECT (device); +} + +/** + * nm_device_get_iface: + * @device: a #NMDevice + * + * Gets the interface name of the #NMDevice. + * + * Returns: the interface of the device. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_get_iface (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->iface) { + priv->iface = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "Interface"); + } + + return priv->iface; +} + +/** + * nm_device_get_udi: + * @device: a #NMDevice + * + * Gets the Unique Device Identifier of the #NMDevice. + * + * Returns: the Unique Device Identifier of the device. This identifier may be + * used to gather more information about the device from various operating + * system services like udev or sysfs. + **/ +const char * +nm_device_get_udi (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->udi) { + priv->udi = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "Udi"); + } + + return priv->udi; +} + +/** + * nm_device_get_driver: + * @device: a #NMDevice + * + * Gets the driver of the #NMDevice. + * + * Returns: the driver of the device. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_get_driver (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->driver) { + priv->driver = _nm_object_get_string_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "Driver"); + } + + return priv->driver; +} + +/** + * nm_device_get_capabilities: + * @device: a #NMDevice + * + * Gets the device' capabilities. + * + * Returns: the capabilities + **/ +guint32 +nm_device_get_capabilities (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), 0); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->capabilities) { + priv->capabilities = _nm_object_get_uint_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "Capabilities"); + } + + return priv->capabilities; +} + +/** + * nm_device_get_managed: + * @device: a #NMDevice + * + * Whether the #NMDevice is managed by NetworkManager. + * + * Returns: %TRUE if the device is managed by NetworkManager + **/ +gboolean +nm_device_get_managed (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), 0); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->managed) { + priv->managed = _nm_object_get_boolean_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "Managed"); + } + + return priv->managed; +} + +/** + * nm_device_get_ip4_config: + * @device: a #NMDevice + * + * Gets the current #NMIP4Config associated with the #NMDevice. + * + * Returns: the #NMIP4Config or %NULL if the device is not activated. + **/ +NMIP4Config * +nm_device_get_ip4_config (NMDevice *device) +{ + NMDevicePrivate *priv; + char *path; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (priv->ip4_config) + return priv->ip4_config; + if (priv->null_ip4_config) + return NULL; + + path = _nm_object_get_object_path_property (NM_OBJECT (device), NM_DBUS_INTERFACE_DEVICE, "Ip4Config"); + if (path) { + g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH); + g_value_take_boxed (&value, path); + demarshal_ip4_config (NM_OBJECT (device), NULL, &value, &priv->ip4_config); + g_value_unset (&value); + } + + return priv->ip4_config; +} + +/** + * nm_device_get_dhcp4_config: + * @device: a #NMDevice + * + * Gets the current #NMDHCP4Config associated with the #NMDevice. + * + * Returns: the #NMDHCPConfig or %NULL if the device is not activated or not + * using DHCP. + **/ +NMDHCP4Config * +nm_device_get_dhcp4_config (NMDevice *device) +{ + NMDevicePrivate *priv; + char *path; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (priv->dhcp4_config) + return priv->dhcp4_config; + if (priv->null_dhcp4_config) + return NULL; + + path = _nm_object_get_object_path_property (NM_OBJECT (device), NM_DBUS_INTERFACE_DEVICE, "Dhcp4Config"); + if (path) { + g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH); + g_value_take_boxed (&value, path); + demarshal_dhcp4_config (NM_OBJECT (device), NULL, &value, &priv->dhcp4_config); + g_value_unset (&value); + } + + return priv->dhcp4_config; +} + +/** + * nm_device_get_ip6_config: + * @device: a #NMDevice + * + * Gets the current #NMIP6Config associated with the #NMDevice. + * + * Returns: the #NMIP6Config or %NULL if the device is not activated. + **/ +NMIP6Config * +nm_device_get_ip6_config (NMDevice *device) +{ + NMDevicePrivate *priv; + char *path; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (priv->ip6_config) + return priv->ip6_config; + if (priv->null_ip6_config) + return NULL; + + path = _nm_object_get_object_path_property (NM_OBJECT (device), NM_DBUS_INTERFACE_DEVICE, "Ip6Config"); + if (path) { + g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH); + g_value_take_boxed (&value, path); + demarshal_ip6_config (NM_OBJECT (device), NULL, &value, &priv->ip6_config); + g_value_unset (&value); + } + + return priv->ip6_config; +} + +/** + * nm_device_get_dhcp6_config: + * @device: a #NMDevice + * + * Gets the current #NMDHCP6Config associated with the #NMDevice. + * + * Returns: the #NMDHCPConfig or %NULL if the device is not activated or not + * using DHCP. + **/ +NMDHCP6Config * +nm_device_get_dhcp6_config (NMDevice *device) +{ + NMDevicePrivate *priv; + char *path; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (priv->dhcp6_config) + return priv->dhcp6_config; + if (priv->null_dhcp6_config) + return NULL; + + path = _nm_object_get_object_path_property (NM_OBJECT (device), NM_DBUS_INTERFACE_DEVICE, "Dhcp6Config"); + if (path) { + g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH); + g_value_take_boxed (&value, path); + demarshal_dhcp6_config (NM_OBJECT (device), NULL, &value, &priv->dhcp6_config); + g_value_unset (&value); + } + + return priv->dhcp6_config; +} + +/** + * nm_device_get_state: + * @device: a #NMDevice + * + * Gets the current #NMDevice state. + * + * Returns: the current device state + **/ +NMDeviceState +nm_device_get_state (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), NM_DEVICE_STATE_UNKNOWN); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (priv->state == NM_DEVICE_STATE_UNKNOWN) { + priv->state = _nm_object_get_uint_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "State"); + } + + return priv->state; +} + +/* From hostap, Copyright (c) 2002-2005, Jouni Malinen */ + +static int hex2num (char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + return -1; +} + +static int hex2byte (const char *hex) +{ + int a, b; + a = hex2num(*hex++); + if (a < 0) + return -1; + b = hex2num(*hex++); + if (b < 0) + return -1; + return (a << 4) | b; +} + +/* End from hostap */ + +static char * +get_decoded_property (GUdevDevice *device, const char *property) +{ + const char *orig, *p; + char *unescaped, *n; + guint len; + + p = orig = g_udev_device_get_property (device, property); + if (!orig) + return NULL; + + len = strlen (orig); + n = unescaped = g_malloc0 (len + 1); + while (*p) { + if ((len >= 4) && (*p == '\\') && (*(p+1) == 'x')) { + *n++ = (char) hex2byte (p + 2); + p += 4; + len -= 4; + } else { + *n++ = *p++; + len--; + } + } + + return unescaped; +} + +static void +nm_device_update_description (NMDevice *device) +{ + NMDevicePrivate *priv; + const char *subsys[3] = { "net", "tty", NULL }; + GUdevDevice *udev_device = NULL, *tmpdev, *olddev; + const char *ifname; + guint32 count = 0; + const char *vendor, *model; + + g_return_if_fail (NM_IS_DEVICE (device)); + priv = NM_DEVICE_GET_PRIVATE (device); + + if (!priv->client) { + priv->client = g_udev_client_new (subsys); + if (!priv->client) + return; + } + + ifname = nm_device_get_iface (device); + if (!ifname) + return; + + udev_device = g_udev_client_query_by_subsystem_and_name (priv->client, "net", ifname); + if (!udev_device) + udev_device = g_udev_client_query_by_subsystem_and_name (priv->client, "tty", ifname); + if (!udev_device) + return; + + g_free (priv->product); + priv->product = NULL; + g_free (priv->vendor); + priv->vendor = NULL; + + /* Walk up the chain of the device and its parents a few steps to grab + * vendor and device ID information off it. + */ + + /* Ref the device again becuase we have to unref it each iteration, + * as g_udev_device_get_parent() returns a ref-ed object. + */ + tmpdev = g_object_ref (udev_device); + while ((count++ < 3) && tmpdev && (!priv->vendor || !priv->product)) { + if (!priv->vendor) + priv->vendor = get_decoded_property (tmpdev, "ID_VENDOR_ENC"); + + if (!priv->product) + priv->product = get_decoded_property (tmpdev, "ID_MODEL_ENC"); + + olddev = tmpdev; + tmpdev = g_udev_device_get_parent (tmpdev); + g_object_unref (olddev); + } + + /* Unref the last device if we found what we needed before running out + * of parents. + */ + if (tmpdev) + g_object_unref (tmpdev); + + /* If we didn't get strings directly from the device, try database strings */ + + /* Again, ref the original device as we need to unref it every iteration + * since g_udev_device_get_parent() returns a refed object. + */ + tmpdev = g_object_ref (udev_device); + count = 0; + while ((count++ < 3) && tmpdev && (!priv->vendor || !priv->product)) { + if (!priv->vendor) { + vendor = g_udev_device_get_property (tmpdev, "ID_VENDOR_FROM_DATABASE"); + if (vendor) + priv->vendor = g_strdup (vendor); + } + + if (!priv->product) { + model = g_udev_device_get_property (tmpdev, "ID_MODEL_FROM_DATABASE"); + if (model) + priv->product = g_strdup (model); + } + + olddev = tmpdev; + tmpdev = g_udev_device_get_parent (tmpdev); + g_object_unref (olddev); + } + + /* Unref the last device if we found what we needed before running out + * of parents. + */ + if (tmpdev) + g_object_unref (tmpdev); + + /* Balance the initial g_udev_client_query_by_subsystem_and_name() */ + g_object_unref (udev_device); + + _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_VENDOR); + _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_PRODUCT); +} + +/** + * nm_device_get_product: + * @device: a #NMDevice + * + * Gets the product string of the #NMDevice. + * + * Returns: the product name of the device. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_get_product (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->product) + nm_device_update_description (device); + return priv->product; +} + +/** + * nm_device_get_vendor: + * @device: a #NMDevice + * + * Gets the vendor string of the #NMDevice. + * + * Returns: the vendor name of the device. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_device_get_vendor (NMDevice *device) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (!priv->vendor) + nm_device_update_description (device); + return priv->vendor; +} + +typedef struct { + NMDevice *device; + NMDeviceDeactivateFn fn; + gpointer user_data; +} DeactivateInfo; + +static void +deactivate_cb (DBusGProxy *proxy, + GError *error, + gpointer user_data) +{ + DeactivateInfo *info = user_data; + + if (info->fn) + info->fn (info->device, error, info->user_data); + else if (error) { + g_warning ("%s: device %s deactivation failed: (%d) %s", + __func__, + nm_object_get_path (NM_OBJECT (info->device)), + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } + + g_object_unref (info->device); + g_slice_free (DeactivateInfo, info); +} + +/** + * nm_device_disconnect: + * @device: a #NMDevice + * @callback: callback to be called when disconnect operation completes + * @user_data: caller-specific data passed to @callback + * + * Disconnects the device if currently connected, and prevents the device from + * automatically connecting to networks until the next manual network connection + * request. + **/ +void +nm_device_disconnect (NMDevice *device, + NMDeviceDeactivateFn callback, + gpointer user_data) +{ + DeactivateInfo *info; + + g_return_if_fail (NM_IS_DEVICE (device)); + + info = g_slice_new (DeactivateInfo); + info->fn = callback; + info->user_data = user_data; + info->device = g_object_ref (device); + + org_freedesktop_NetworkManager_Device_disconnect_async (NM_DEVICE_GET_PRIVATE (device)->proxy, + deactivate_cb, + info); +} + diff --git a/libnm-glib/nm-device.h b/libnm-glib/nm-device.h new file mode 100644 index 00000000..64694ec8 --- /dev/null +++ b/libnm-glib/nm-device.h @@ -0,0 +1,107 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_H +#define NM_DEVICE_H + +#include +#include +#include +#include "nm-object.h" +#include "NetworkManager.h" +#include "nm-ip4-config.h" +#include "nm-dhcp4-config.h" +#include "nm-ip6-config.h" +#include "nm-dhcp6-config.h" +#include "nm-connection.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE (nm_device_get_type ()) +#define NM_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE, NMDevice)) +#define NM_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE, NMDeviceClass)) +#define NM_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE)) +#define NM_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE)) +#define NM_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE, NMDeviceClass)) + +#define NM_DEVICE_UDI "udi" +#define NM_DEVICE_INTERFACE "interface" +#define NM_DEVICE_DRIVER "driver" +#define NM_DEVICE_CAPABILITIES "capabilities" +#define NM_DEVICE_MANAGED "managed" +#define NM_DEVICE_IP4_CONFIG "ip4-config" +#define NM_DEVICE_DHCP4_CONFIG "dhcp4-config" +#define NM_DEVICE_IP6_CONFIG "ip6-config" +#define NM_DEVICE_DHCP6_CONFIG "dhcp6-config" +#define NM_DEVICE_STATE "state" +#define NM_DEVICE_VENDOR "vendor" +#define NM_DEVICE_PRODUCT "product" + +typedef struct { + NMObject parent; +} NMDevice; + +typedef struct { + NMObjectClass parent; + + /* Signals */ + void (*state_changed) (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMDeviceClass; + +GType nm_device_get_type (void); + +GObject * nm_device_new (DBusGConnection *connection, const char *path); + +const char * nm_device_get_iface (NMDevice *device); +const char * nm_device_get_udi (NMDevice *device); +const char * nm_device_get_driver (NMDevice *device); +guint32 nm_device_get_capabilities (NMDevice *device); +gboolean nm_device_get_managed (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); +NMDeviceState nm_device_get_state (NMDevice *device); +const char * nm_device_get_product (NMDevice *device); +const char * nm_device_get_vendor (NMDevice *device); + +typedef void (*NMDeviceDeactivateFn) (NMDevice *device, GError *error, gpointer user_data); + +void nm_device_disconnect (NMDevice *device, + NMDeviceDeactivateFn callback, + gpointer user_data); + +G_END_DECLS + +#endif /* NM_DEVICE_H */ diff --git a/libnm-glib/nm-dhcp4-config.c b/libnm-glib/nm-dhcp4-config.c new file mode 100644 index 00000000..c87feedf --- /dev/null +++ b/libnm-glib/nm-dhcp4-config.c @@ -0,0 +1,248 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#include + +#include "nm-dhcp4-config.h" +#include "NetworkManager.h" +#include "nm-types-private.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 { + DBusGProxy *proxy; + + GHashTable *options; +} NMDHCP4ConfigPrivate; + +enum { + PROP_0, + PROP_OPTIONS, + + LAST_PROP +}; + +static void +nm_dhcp4_config_init (NMDHCP4Config *config) +{ +} + +static void +copy_options (gpointer key, gpointer data, gpointer user_data) +{ + GHashTable *options = (GHashTable *) user_data; + GValue *value = (GValue *) data; + + g_hash_table_insert (options, g_strdup (key), g_value_dup_string (value)); +} + +static gboolean +demarshal_dhcp4_options (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object); + GHashTable *new_options; + + g_hash_table_remove_all (priv->options); + + new_options = g_value_get_boxed (value); + if (new_options) + g_hash_table_foreach (new_options, copy_options, priv->options); + + _nm_object_queue_notify (object, NM_DHCP4_CONFIG_OPTIONS); + return TRUE; +} + +static void +register_for_property_changed (NMDHCP4Config *config) +{ + NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (config); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_DHCP4_CONFIG_OPTIONS, demarshal_dhcp4_options, &priv->options }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (config), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + DBusGConnection *connection; + NMDHCP4ConfigPrivate *priv; + + object = (NMObject *) G_OBJECT_CLASS (nm_dhcp4_config_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_DHCP4_CONFIG_GET_PRIVATE (object); + priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + + connection = nm_object_get_connection (object); + + priv->proxy = dbus_g_proxy_new_for_name (connection, + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE_DHCP4_CONFIG); + + register_for_property_changed (NM_DHCP4_CONFIG (object)); + + return G_OBJECT (object); +} + +static void +finalize (GObject *object) +{ + NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object); + + if (priv->options) + g_hash_table_destroy (priv->options); + + g_object_unref (priv->proxy); + + 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); + + g_type_class_add_private (config_class, sizeof (NMDHCP4ConfigPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMDHCP4Config:options: + * + * The #GHashTable containing options of the configuration. + **/ + g_object_class_install_property + (object_class, PROP_OPTIONS, + g_param_spec_boxed (NM_DHCP4_CONFIG_OPTIONS, + "Options", + "Options", + G_TYPE_HASH_TABLE, + G_PARAM_READABLE)); +} + +/** + * nm_dhcp4_config_new: + * @connection: the #DBusGConnection + * @object_path: the DBus object path of the device + * + * Creates a new #NMDHCP4Config. + * + * Returns: a new configuration + **/ +GObject * +nm_dhcp4_config_new (DBusGConnection *connection, const char *object_path) +{ + return (GObject *) g_object_new (NM_TYPE_DHCP4_CONFIG, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, object_path, + NULL); +} + +/** + * nm_dhcp4_config_get_options: + * @config: a #NMDHCP4Config + * + * Gets all the options contained in the configuration. + * + * Returns: 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) +{ + NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (config); + GValue value = { 0, }; + + if (g_hash_table_size (priv->options)) + return priv->options; + + if (!_nm_object_get_property (NM_OBJECT (config), + "org.freedesktop.DBus.Properties", + "Options", + &value)) + goto out; + + demarshal_dhcp4_options (NM_OBJECT (config), NULL, &value, &priv->options); + g_value_unset (&value); + +out: + return priv->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-glib/nm-dhcp4-config.h b/libnm-glib/nm-dhcp4-config.h new file mode 100644 index 00000000..da5b57b3 --- /dev/null +++ b/libnm-glib/nm-dhcp4-config.h @@ -0,0 +1,68 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_DHCP4_CONFIG_H +#define NM_DHCP4_CONFIG_H + +#include +#include +#include +#include "nm-object.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DHCP4_CONFIG (nm_dhcp4_config_get_type ()) +#define NM_DHCP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP4_CONFIG, NMDHCP4Config)) +#define NM_DHCP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP4_CONFIG, NMDHCP4ConfigClass)) +#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 ((obj), NM_TYPE_DHCP4_CONFIG)) + +typedef struct { + NMObject parent; +} NMDHCP4Config; + +typedef struct { + NMObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMDHCP4ConfigClass; + +#define NM_DHCP4_CONFIG_OPTIONS "options" + +GType nm_dhcp4_config_get_type (void); + +GObject *nm_dhcp4_config_new (DBusGConnection *connection, const char *object_path); + +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-glib/nm-dhcp6-config.c b/libnm-glib/nm-dhcp6-config.c new file mode 100644 index 00000000..49eeda39 --- /dev/null +++ b/libnm-glib/nm-dhcp6-config.c @@ -0,0 +1,248 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 - 2010 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#include + +#include "nm-dhcp6-config.h" +#include "NetworkManager.h" +#include "nm-types-private.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 { + DBusGProxy *proxy; + + GHashTable *options; +} NMDHCP6ConfigPrivate; + +enum { + PROP_0, + PROP_OPTIONS, + + LAST_PROP +}; + +static void +nm_dhcp6_config_init (NMDHCP6Config *config) +{ +} + +static void +copy_options (gpointer key, gpointer data, gpointer user_data) +{ + GHashTable *options = (GHashTable *) user_data; + GValue *value = (GValue *) data; + + g_hash_table_insert (options, g_strdup (key), g_value_dup_string (value)); +} + +static gboolean +demarshal_dhcp6_options (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + GHashTable *new_options; + + g_hash_table_remove_all (priv->options); + + new_options = g_value_get_boxed (value); + if (new_options) + g_hash_table_foreach (new_options, copy_options, priv->options); + + _nm_object_queue_notify (object, NM_DHCP6_CONFIG_OPTIONS); + return TRUE; +} + +static void +register_for_property_changed (NMDHCP6Config *config) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (config); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_DHCP6_CONFIG_OPTIONS, demarshal_dhcp6_options, &priv->options }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (config), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + DBusGConnection *connection; + NMDHCP6ConfigPrivate *priv; + + object = (NMObject *) G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + + connection = nm_object_get_connection (object); + + priv->proxy = dbus_g_proxy_new_for_name (connection, + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE_DHCP6_CONFIG); + + register_for_property_changed (NM_DHCP6_CONFIG (object)); + + return G_OBJECT (object); +} + +static void +finalize (GObject *object) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + + if (priv->options) + g_hash_table_destroy (priv->options); + + g_object_unref (priv->proxy); + + 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); + + g_type_class_add_private (config_class, sizeof (NMDHCP6ConfigPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMDHCP6Config:options: + * + * The #GHashTable containing options of the configuration. + **/ + g_object_class_install_property + (object_class, PROP_OPTIONS, + g_param_spec_boxed (NM_DHCP6_CONFIG_OPTIONS, + "Options", + "Options", + G_TYPE_HASH_TABLE, + G_PARAM_READABLE)); +} + +/** + * nm_dhcp6_config_new: + * @connection: the #DBusGConnection + * @object_path: the DBus object path of the device + * + * Creates a new #NMDHCP6Config. + * + * Returns: a new configuration + **/ +GObject * +nm_dhcp6_config_new (DBusGConnection *connection, const char *object_path) +{ + return (GObject *) g_object_new (NM_TYPE_DHCP6_CONFIG, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, object_path, + NULL); +} + +/** + * nm_dhcp6_config_get_options: + * @config: a #NMDHCP6Config + * + * Gets all the options contained in the configuration. + * + * Returns: 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) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (config); + GValue value = { 0, }; + + if (g_hash_table_size (priv->options)) + return priv->options; + + if (!_nm_object_get_property (NM_OBJECT (config), + "org.freedesktop.DBus.Properties", + "Options", + &value)) + goto out; + + demarshal_dhcp6_options (NM_OBJECT (config), NULL, &value, &priv->options); + g_value_unset (&value); + +out: + return priv->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-glib/nm-dhcp6-config.h b/libnm-glib/nm-dhcp6-config.h new file mode 100644 index 00000000..91f32fa0 --- /dev/null +++ b/libnm-glib/nm-dhcp6-config.h @@ -0,0 +1,68 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 - 2010 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_DHCP6_CONFIG_H +#define NM_DHCP6_CONFIG_H + +#include +#include +#include +#include "nm-object.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DHCP6_CONFIG (nm_dhcp6_config_get_type ()) +#define NM_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP6_CONFIG, NMDHCP6Config)) +#define NM_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigClass)) +#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 ((obj), NM_TYPE_DHCP6_CONFIG)) + +typedef struct { + NMObject parent; +} NMDHCP6Config; + +typedef struct { + NMObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMDHCP6ConfigClass; + +#define NM_DHCP6_CONFIG_OPTIONS "options" + +GType nm_dhcp6_config_get_type (void); + +GObject *nm_dhcp6_config_new (DBusGConnection *connection, const char *object_path); + +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-glib/nm-exported-connection.c b/libnm-glib/nm-exported-connection.c new file mode 100644 index 00000000..3a8e51ce --- /dev/null +++ b/libnm-glib/nm-exported-connection.c @@ -0,0 +1,281 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2008 Novell, Inc. + * (C) Copyright 2008 - 2009 Red Hat, Inc. + */ + +#include +#include +#include + +#include "nm-exported-connection.h" +#include "nm-settings-interface.h" +#include "nm-settings-connection-interface.h" + +static gboolean impl_exported_connection_get_settings (NMExportedConnection *connection, + GHashTable **settings, + GError **error); + +static void impl_exported_connection_update (NMExportedConnection *connection, + GHashTable *new_settings, + DBusGMethodInvocation *context); + +static void impl_exported_connection_delete (NMExportedConnection *connection, + DBusGMethodInvocation *context); + +static void impl_exported_connection_get_secrets (NMExportedConnection *connection, + const gchar *setting_name, + const gchar **hints, + gboolean request_new, + DBusGMethodInvocation *context); + +#include "nm-exported-connection-glue.h" + +static void settings_connection_interface_init (NMSettingsConnectionInterface *class); + +G_DEFINE_TYPE_EXTENDED (NMExportedConnection, nm_exported_connection, NM_TYPE_CONNECTION, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, + settings_connection_interface_init)) + +#define NM_EXPORTED_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_EXPORTED_CONNECTION, \ + NMExportedConnectionPrivate)) + +typedef struct { + gboolean foo; +} NMExportedConnectionPrivate; + + +/**************************************************************/ + +static GHashTable * +real_get_settings (NMExportedConnection *self, GError **error) +{ + NMConnection *no_secrets; + GHashTable *settings; + + /* Secrets should *never* be returned by the GetSettings method, they + * get returned by the GetSecrets method which can be better + * protected against leakage of secrets to unprivileged callers. + */ + no_secrets = nm_connection_duplicate (NM_CONNECTION (self)); + g_assert (no_secrets); + nm_connection_clear_secrets (no_secrets); + settings = nm_connection_to_hash (no_secrets); + g_assert (settings); + g_object_unref (no_secrets); + + return settings; +} + +/**************************************************************/ + +static gboolean +check_writable (NMConnection *connection, GError **error) +{ + NMSettingConnection *s_con; + + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_CONNECTION); + if (!s_con) { + g_set_error_literal (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, + "Connection did not have required 'connection' setting"); + return FALSE; + } + + /* If the connection is read-only, that has to be changed at the source of + * the problem (ex a system settings plugin that can't write connections out) + * instead of over D-Bus. + */ + if (nm_setting_connection_get_read_only (s_con)) { + g_set_error_literal (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_READ_ONLY_CONNECTION, + "Connection is read-only"); + return FALSE; + } + + return TRUE; +} + +static gboolean +impl_exported_connection_get_settings (NMExportedConnection *self, + GHashTable **settings, + GError **error) +{ + /* Must always be implemented */ + g_assert (NM_EXPORTED_CONNECTION_GET_CLASS (self)->get_settings); + *settings = NM_EXPORTED_CONNECTION_GET_CLASS (self)->get_settings (self, error); + return *settings ? TRUE : FALSE; +} + +static gboolean +update (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceUpdateFunc callback, + gpointer user_data) +{ + g_object_ref (connection); + nm_settings_connection_interface_emit_updated (connection); + callback (connection, NULL, user_data); + g_object_unref (connection); + return TRUE; +} + +static void +impl_exported_connection_update (NMExportedConnection *self, + GHashTable *new_settings, + DBusGMethodInvocation *context) +{ + NMConnection *tmp; + GError *error = NULL; + + /* If the connection is read-only, that has to be changed at the source of + * the problem (ex a system settings plugin that can't write connections out) + * instead of over D-Bus. + */ + if (!check_writable (NM_CONNECTION (self), &error)) { + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + /* Check if the settings are valid first */ + tmp = nm_connection_new_from_hash (new_settings, &error); + if (!tmp) { + g_assert (error); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + g_object_unref (tmp); + + if (NM_EXPORTED_CONNECTION_GET_CLASS (self)->update) + NM_EXPORTED_CONNECTION_GET_CLASS (self)->update (self, new_settings, context); + else { + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s: %s:%d update() unimplemented", __func__, __FILE__, __LINE__); + dbus_g_method_return_error (context, error); + g_error_free (error); + } +} + +static gboolean +do_delete (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceDeleteFunc callback, + gpointer user_data) +{ + g_object_ref (connection); + g_signal_emit_by_name (connection, "removed"); + callback (connection, NULL, user_data); + g_object_unref (connection); + return TRUE; +} + +static void +impl_exported_connection_delete (NMExportedConnection *self, + DBusGMethodInvocation *context) +{ + GError *error = NULL; + + if (!check_writable (NM_CONNECTION (self), &error)) { + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + if (NM_EXPORTED_CONNECTION_GET_CLASS (self)->delete) + NM_EXPORTED_CONNECTION_GET_CLASS (self)->delete (self, context); + else { + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s: %s:%d delete() unimplemented", __func__, __FILE__, __LINE__); + dbus_g_method_return_error (context, error); + g_error_free (error); + } +} + +static void +impl_exported_connection_get_secrets (NMExportedConnection *self, + const gchar *setting_name, + const gchar **hints, + gboolean request_new, + DBusGMethodInvocation *context) +{ + GError *error = NULL; + + if (NM_EXPORTED_CONNECTION_GET_CLASS (self)->get_secrets) + NM_EXPORTED_CONNECTION_GET_CLASS (self)->get_secrets (self, setting_name, hints, request_new, context); + else { + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s: %s:%d get_secrets() unimplemented", __func__, __FILE__, __LINE__); + dbus_g_method_return_error (context, error); + g_error_free (error); + } +} + +/**************************************************************/ + +static void +settings_connection_interface_init (NMSettingsConnectionInterface *iface) +{ + iface->update = update; + iface->delete = do_delete; +} + +/** + * nm_exported_connection_new: + * @scope: the Connection scope (either user or system) + * + * Creates a new object representing the remote connection. + * + * Returns: the new exported connection object on success, or %NULL on failure + **/ +NMExportedConnection * +nm_exported_connection_new (NMConnectionScope scope) +{ + g_return_val_if_fail (scope != NM_CONNECTION_SCOPE_UNKNOWN, NULL); + + return (NMExportedConnection *) g_object_new (NM_TYPE_EXPORTED_CONNECTION, + NM_CONNECTION_SCOPE, scope, + NULL); +} + +static void +nm_exported_connection_init (NMExportedConnection *self) +{ +} + +static void +nm_exported_connection_class_init (NMExportedConnectionClass *class) +{ + g_type_class_add_private (class, sizeof (NMExportedConnectionPrivate)); + + /* Virtual methods */ + class->get_settings = real_get_settings; + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (class), + &dbus_glib_nm_exported_connection_object_info); +} diff --git a/libnm-glib/nm-exported-connection.h b/libnm-glib/nm-exported-connection.h new file mode 100644 index 00000000..53dc3b02 --- /dev/null +++ b/libnm-glib/nm-exported-connection.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2009 Red Hat, Inc. + */ + +#ifndef NM_EXPORTED_CONNECTION_H +#define NM_EXPORTED_CONNECTION_H + +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_EXPORTED_CONNECTION (nm_exported_connection_get_type ()) +#define NM_EXPORTED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnection)) +#define NM_EXPORTED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnectionClass)) +#define NM_IS_EXPORTED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_EXPORTED_CONNECTION)) +#define NM_IS_EXPORTED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_EXPORTED_CONNECTION)) +#define NM_EXPORTED_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_EXPORTED_CONNECTION, NMExportedConnectionClass)) + +typedef struct { + NMConnection parent; +} NMExportedConnection; + +typedef struct { + NMConnectionClass parent; + + GHashTable * (*get_settings) (NMExportedConnection *self, + GError **error); + + void (*update) (NMExportedConnection *self, + GHashTable *new_settings, + DBusGMethodInvocation *context); + + void (*delete) (NMExportedConnection *self, + DBusGMethodInvocation *context); + + void (*get_secrets) (NMExportedConnection *self, + const gchar *setting_name, + const gchar **hints, + gboolean request_new, + DBusGMethodInvocation *context); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMExportedConnectionClass; + +GType nm_exported_connection_get_type (void); + +NMExportedConnection *nm_exported_connection_new (NMConnectionScope scope); + +G_END_DECLS + +#endif /* NM_EXPORTED_CONNECTION_H */ diff --git a/libnm-glib/nm-gsm-device.c b/libnm-glib/nm-gsm-device.c new file mode 100644 index 00000000..aacbbb82 --- /dev/null +++ b/libnm-glib/nm-gsm-device.c @@ -0,0 +1,130 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include "nm-gsm-device.h" +#include "nm-device-private.h" +#include "nm-object-private.h" + +G_DEFINE_TYPE (NMGsmDevice, nm_gsm_device, NM_TYPE_SERIAL_DEVICE) + +#define NM_GSM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_GSM_DEVICE, NMGsmDevicePrivate)) + +typedef struct { + DBusGProxy *proxy; + + gboolean disposed; +} NMGsmDevicePrivate; + +static void +nm_gsm_device_init (NMGsmDevice *device) +{ +} + +static void +register_for_property_changed (NMGsmDevice *device) +{ + NMGsmDevicePrivate *priv = NM_GSM_DEVICE_GET_PRIVATE (device); + const NMPropertiesChangedInfo property_changed_info[] = { + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (device), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMGsmDevicePrivate *priv; + + object = G_OBJECT_CLASS (nm_gsm_device_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_GSM_DEVICE_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)), + NM_DBUS_SERVICE, + nm_object_get_path (NM_OBJECT (object)), + NM_DBUS_INTERFACE_GSM_DEVICE); + + register_for_property_changed (NM_GSM_DEVICE (object)); + + return object; +} + +static void +dispose (GObject *object) +{ + NMGsmDevicePrivate *priv = NM_GSM_DEVICE_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_gsm_device_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_gsm_device_parent_class)->dispose (object); +} + +static void +nm_gsm_device_class_init (NMGsmDeviceClass *device_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (device_class); + + g_type_class_add_private (device_class, sizeof (NMGsmDevicePrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->dispose = dispose; +} + +/** + * nm_gsm_device_new: + * @connection: the #DBusGConnection + * @path: the DBus object path of the device + * + * Creates a new #NMGsmDevice. + * + * Returns: a new device + **/ +NMGsmDevice * +nm_gsm_device_new (DBusGConnection *connection, const char *path) +{ + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return (NMGsmDevice *) g_object_new (NM_TYPE_GSM_DEVICE, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, path, + NULL); +} diff --git a/libnm-glib/nm-gsm-device.h b/libnm-glib/nm-gsm-device.h new file mode 100644 index 00000000..d8440973 --- /dev/null +++ b/libnm-glib/nm-gsm-device.h @@ -0,0 +1,61 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_GSM_DEVICE_H +#define NM_GSM_DEVICE_H + +#include "nm-serial-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_GSM_DEVICE (nm_gsm_device_get_type ()) +#define NM_GSM_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_GSM_DEVICE, NMGsmDevice)) +#define NM_GSM_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_GSM_DEVICE, NMGsmDeviceClass)) +#define NM_IS_GSM_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_GSM_DEVICE)) +#define NM_IS_GSM_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_GSM_DEVICE)) +#define NM_GSM_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_GSM_DEVICE, NMGsmDeviceClass)) + +typedef struct { + NMSerialDevice parent; +} NMGsmDevice; + +typedef struct { + NMSerialDeviceClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMGsmDeviceClass; + +GType nm_gsm_device_get_type (void); + +NMGsmDevice *nm_gsm_device_new (DBusGConnection *connection, + const char *path); + +G_END_DECLS + +#endif /* NM_GSM_DEVICE_H */ diff --git a/libnm-glib/nm-ip4-config.c b/libnm-glib/nm-ip4-config.c new file mode 100644 index 00000000..4bedc7a1 --- /dev/null +++ b/libnm-glib/nm-ip4-config.c @@ -0,0 +1,526 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include + +#include +#include "nm-ip4-config.h" +#include "NetworkManager.h" +#include "nm-types-private.h" +#include "nm-object-private.h" +#include "nm-utils.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 { + DBusGProxy *proxy; + + GSList *addresses; + GArray *nameservers; + GPtrArray *domains; + GSList *routes; + GArray *wins; +} NMIP4ConfigPrivate; + +enum { + PROP_0, + PROP_ADDRESSES, + PROP_HOSTNAME, + PROP_NAMESERVERS, + PROP_DOMAINS, + PROP_ROUTES, + PROP_WINS_SERVERS, + + LAST_PROP +}; + +static void +nm_ip4_config_init (NMIP4Config *config) +{ +} + +static gboolean +demarshal_ip4_address_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object); + + g_slist_foreach (priv->addresses, (GFunc) nm_ip4_address_unref, NULL); + g_slist_free (priv->addresses); + priv->addresses = NULL; + + priv->addresses = nm_utils_ip4_addresses_from_gvalue (value); + _nm_object_queue_notify (object, NM_IP4_CONFIG_ADDRESSES); + + return TRUE; +} + +static gboolean +demarshal_ip4_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + if (!_nm_uint_array_demarshal (value, (GArray **) field)) + return FALSE; + + if (!strcmp (pspec->name, NM_IP4_CONFIG_NAMESERVERS)) + _nm_object_queue_notify (object, NM_IP4_CONFIG_NAMESERVERS); + else if (!strcmp (pspec->name, NM_IP4_CONFIG_WINS_SERVERS)) + _nm_object_queue_notify (object, NM_IP4_CONFIG_WINS_SERVERS); + + return TRUE; +} + +static gboolean +demarshal_domains (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + if (!_nm_string_array_demarshal (value, (GPtrArray **) field)) + return FALSE; + + _nm_object_queue_notify (object, NM_IP4_CONFIG_DOMAINS); + return TRUE; +} + +static gboolean +demarshal_ip4_routes_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object); + + g_slist_foreach (priv->routes, (GFunc) g_free, NULL); + g_slist_free (priv->routes); + priv->routes = NULL; + + priv->routes = nm_utils_ip4_routes_from_gvalue (value); + _nm_object_queue_notify (object, NM_IP4_CONFIG_ROUTES); + + return TRUE; +} + +static void +register_for_property_changed (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_IP4_CONFIG_ADDRESSES, demarshal_ip4_address_array, &priv->addresses }, + { NM_IP4_CONFIG_NAMESERVERS, demarshal_ip4_array, &priv->nameservers }, + { NM_IP4_CONFIG_DOMAINS, demarshal_domains, &priv->domains }, + { NM_IP4_CONFIG_ROUTES, demarshal_ip4_routes_array, &priv->routes }, + { NM_IP4_CONFIG_WINS_SERVERS, demarshal_ip4_array, &priv->wins }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (config), + priv->proxy, + property_changed_info); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + DBusGConnection *connection; + NMIP4ConfigPrivate *priv; + + object = (NMObject *) G_OBJECT_CLASS (nm_ip4_config_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_IP4_CONFIG_GET_PRIVATE (object); + connection = nm_object_get_connection (object); + + priv->proxy = dbus_g_proxy_new_for_name (connection, + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE_IP4_CONFIG); + + register_for_property_changed (NM_IP4_CONFIG (object)); + + return G_OBJECT (object); +} + +static void +finalize (GObject *object) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object); + + g_slist_foreach (priv->addresses, (GFunc) g_free, NULL); + g_slist_free (priv->addresses); + + g_slist_foreach (priv->routes, (GFunc) g_free, NULL); + g_slist_free (priv->routes); + + if (priv->nameservers) + g_array_free (priv->nameservers, TRUE); + + if (priv->wins) + g_array_free (priv->wins, TRUE); + + if (priv->domains) { + g_ptr_array_foreach (priv->domains, (GFunc) g_free, NULL); + g_ptr_array_free (priv->domains, TRUE); + } + + g_object_unref (priv->proxy); + + 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); + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self); + + switch (prop_id) { + case PROP_ADDRESSES: + nm_utils_ip4_addresses_to_gvalue (priv->addresses, value); + break; + case PROP_HOSTNAME: + g_value_set_string (value, NULL); + break; + case PROP_NAMESERVERS: + g_value_set_boxed (value, nm_ip4_config_get_nameservers (self)); + break; + case PROP_DOMAINS: + g_value_set_boxed (value, nm_ip4_config_get_domains (self)); + break; + case PROP_ROUTES: + nm_utils_ip4_routes_to_gvalue (priv->routes, value); + break; + case PROP_WINS_SERVERS: + g_value_set_boxed (value, 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); + + g_type_class_add_private (config_class, sizeof (NMIP4ConfigPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMIP4Config:addresses: + * + * The #GPtrArray containing #NMSettingIP4Addresses of the configuration. + **/ + g_object_class_install_property + (object_class, PROP_ADDRESSES, + g_param_spec_pointer (NM_IP4_CONFIG_ADDRESSES, + "Addresses", + "Addresses", + G_PARAM_READABLE)); + + /** + * NMIP4Config:hostname: + * + * DEPRECATED. Don't use. + **/ + g_object_class_install_property + (object_class, PROP_HOSTNAME, + g_param_spec_string (NM_IP4_CONFIG_HOSTNAME, + "Hostname", + "Hostname", + NULL, + G_PARAM_READABLE)); + + /** + * NMIP4Config:nameservers: + * + * The #GArray containing name servers (%guint32es) of the configuration. + **/ + g_object_class_install_property + (object_class, PROP_NAMESERVERS, + g_param_spec_boxed (NM_IP4_CONFIG_NAMESERVERS, + "Nameservers", + "Nameservers", + NM_TYPE_UINT_ARRAY, + G_PARAM_READABLE)); + + /** + * NMIP4Config:domains: + * + * The #GPtrArray containing domain strings of the configuration. + **/ + g_object_class_install_property + (object_class, PROP_DOMAINS, + g_param_spec_boxed (NM_IP4_CONFIG_DOMAINS, + "Domains", + "Domains", + NM_TYPE_STRING_ARRAY, + G_PARAM_READABLE)); + + /** + * NMIP4Config:routes: + * + * The #GPtrArray containing #NMSettingIP4Routes of the configuration. + **/ + g_object_class_install_property + (object_class, PROP_ROUTES, + g_param_spec_pointer (NM_IP4_CONFIG_ROUTES, + "Routes", + "Routes", + G_PARAM_READABLE)); + + /** + * NMIP4Config:wins-servers: + * + * The #GArray containing WINS servers (%guint32es) of the configuration. + **/ + g_object_class_install_property + (object_class, PROP_WINS_SERVERS, + g_param_spec_boxed (NM_IP4_CONFIG_WINS_SERVERS, + "WINS Servers", + "WINS Servers", + NM_TYPE_UINT_ARRAY, + G_PARAM_READABLE)); +} + +/** + * nm_ip4_config_new: + * @connection: the #DBusGConnection + * @object_path: the DBus object path of the device + * + * Creates a new #NMIP4Config. + * + * Returns: a new IP4 configuration + **/ +GObject * +nm_ip4_config_new (DBusGConnection *connection, const char *object_path) +{ + return (GObject *) g_object_new (NM_TYPE_IP4_CONFIG, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, object_path, + NULL); +} + +/** + * nm_ip4_config_get_addresses: + * @config: a #NMIP4Config + * + * Gets the IP4 addresses (containing the address, prefix, and gateway). + * + * Returns: the #GSList containing #NMSettingIP4Addresses. This is the internal copy + * used by the configuration and must not be modified. + **/ +const GSList * +nm_ip4_config_get_addresses (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (priv->addresses) + return priv->addresses; + + if (!_nm_object_get_property (NM_OBJECT (config), + NM_DBUS_INTERFACE_IP4_CONFIG, + "Addresses", + &value)) { + return NULL; + } + + demarshal_ip4_address_array (NM_OBJECT (config), NULL, &value, &priv->addresses); + g_value_unset (&value); + + return priv->addresses; +} + +/** + * nm_ip4_config_get_hostname: + * @config: a #NMIP4Config + * + * DEPRECATED. Don't use. + * + * Returns: NULL + **/ +const char * +nm_ip4_config_get_hostname (NMIP4Config *config) +{ + return NULL; +} + +/** + * nm_ip4_config_get_nameservers: + * @config: a #NMIP4Config + * + * Gets the domain name servers (DNS). + * + * Returns: the #GArray containing %guint32s. This is the internal copy used by the + * configuration and must not be modified. + **/ +const GArray * +nm_ip4_config_get_nameservers (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + GArray *array = NULL; + GValue value = {0,}; + + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (!priv->nameservers) { + if (_nm_object_get_property (NM_OBJECT (config), + NM_DBUS_INTERFACE_IP4_CONFIG, + "Nameservers", + &value)) { + array = (GArray *) g_value_get_boxed (&value); + if (array && array->len) { + priv->nameservers = g_array_sized_new (FALSE, TRUE, sizeof (guint32), array->len); + g_array_append_vals (priv->nameservers, array->data, array->len); + } + g_value_unset (&value); + } + } + + return priv->nameservers; +} + +/** + * nm_ip4_config_get_domains: + * @config: a #NMIP4Config + * + * Gets the domain names. + * + * Returns: the #GPtrArray containing domains as strings. This is the + * internal copy used by the configuration, and must not be modified. + **/ +const GPtrArray * +nm_ip4_config_get_domains (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + GValue value = {0,}; + + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (priv->domains) + return handle_ptr_array_return (priv->domains); + + if (_nm_object_get_property (NM_OBJECT (config), + NM_DBUS_INTERFACE_IP4_CONFIG, + "Domains", + &value)) { + char **array = NULL, **p; + + array = (char **) g_value_get_boxed (&value); + if (array && g_strv_length (array)) { + priv->domains = g_ptr_array_sized_new (g_strv_length (array)); + for (p = array; *p; p++) + g_ptr_array_add (priv->domains, g_strdup (*p)); + } + g_value_unset (&value); + } + + return handle_ptr_array_return (priv->domains); +} + +/** + * nm_ip4_config_get_wins_servers: + * @config: a #NMIP4Config + * + * Gets the Windows Internet Name Service servers (WINS). + * + * Returns: the #GArray containing %guint32s. This is the internal copy used by the + * configuration and must not be modified. + **/ +const GArray * +nm_ip4_config_get_wins_servers (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + GArray *array = NULL; + GValue value = {0,}; + + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (!priv->nameservers) { + if (_nm_object_get_property (NM_OBJECT (config), + NM_DBUS_INTERFACE_IP4_CONFIG, + "Nameservers", + &value)) { + array = (GArray *) g_value_get_boxed (&value); + if (array && array->len) { + priv->nameservers = g_array_sized_new (FALSE, TRUE, sizeof (guint32), array->len); + g_array_append_vals (priv->nameservers, array->data, array->len); + } + g_value_unset (&value); + } + } + + return priv->nameservers; +} + +/** + * nm_ip4_config_get_routes: + * @config: a #NMIP4Config + * + * Gets the routes. + * + * Returns: the #GSList containing #NMSettingIP4Routes. This is the + * internal copy used by the configuration, and must not be modified. + **/ +const GSList * +nm_ip4_config_get_routes (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (priv->routes) + return priv->routes; + + if (!_nm_object_get_property (NM_OBJECT (config), + NM_DBUS_INTERFACE_IP4_CONFIG, + "Routes", + &value)) { + return NULL; + } + + demarshal_ip4_routes_array (NM_OBJECT (config), NULL, &value, &priv->routes); + g_value_unset (&value); + + return priv->routes; +} + diff --git a/libnm-glib/nm-ip4-config.h b/libnm-glib/nm-ip4-config.h new file mode 100644 index 00000000..373d12e1 --- /dev/null +++ b/libnm-glib/nm-ip4-config.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_IP4_CONFIG_H +#define NM_IP4_CONFIG_H + +#include +#include +#include +#include "nm-object.h" + +G_BEGIN_DECLS + +#define NM_TYPE_IP4_CONFIG (nm_ip4_config_get_type ()) +#define NM_IP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP4_CONFIG, NMIP4Config)) +#define NM_IP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IP4_CONFIG, NMIP4ConfigClass)) +#define NM_IS_IP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IP4_CONFIG)) +#define NM_IS_IP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IP4_CONFIG)) +#define NM_IP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP4_CONFIG, NMIP4ConfigClass)) + +typedef struct { + NMObject parent; +} NMIP4Config; + +typedef struct { + NMObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMIP4ConfigClass; + +#define NM_IP4_CONFIG_ADDRESSES "addresses" +#define NM_IP4_CONFIG_HOSTNAME "hostname" /* DEPRECATED */ +#define NM_IP4_CONFIG_NAMESERVERS "nameservers" +#define NM_IP4_CONFIG_DOMAINS "domains" +#define NM_IP4_CONFIG_ROUTES "routes" +#define NM_IP4_CONFIG_WINS_SERVERS "wins-servers" + +GType nm_ip4_config_get_type (void); + +GObject *nm_ip4_config_new (DBusGConnection *connection, const char *object_path); + +const GSList * nm_ip4_config_get_addresses (NMIP4Config *config); +const char * nm_ip4_config_get_hostname (NMIP4Config *config); /* DEPRECATED */ +const GArray * nm_ip4_config_get_nameservers (NMIP4Config *config); +const GPtrArray *nm_ip4_config_get_domains (NMIP4Config *config); +const GSList * nm_ip4_config_get_routes (NMIP4Config *config); +const GArray * nm_ip4_config_get_wins_servers (NMIP4Config *config); + +G_END_DECLS + +#endif /* NM_IP4_CONFIG_H */ diff --git a/libnm-glib/nm-ip6-config.c b/libnm-glib/nm-ip6-config.c new file mode 100644 index 00000000..1f2d13be --- /dev/null +++ b/libnm-glib/nm-ip6-config.c @@ -0,0 +1,438 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include + +#include +#include "nm-ip6-config.h" +#include "NetworkManager.h" +#include "nm-types-private.h" +#include "nm-object-private.h" +#include "nm-utils.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 { + DBusGProxy *proxy; + + GSList *addresses; + GSList *nameservers; + GPtrArray *domains; + GSList *routes; +} NMIP6ConfigPrivate; + +enum { + PROP_0, + PROP_ADDRESSES, + PROP_NAMESERVERS, + PROP_DOMAINS, + PROP_ROUTES, + + LAST_PROP +}; + +/** + * nm_ip6_config_new: + * @connection: the #DBusGConnection + * @object_path: the DBus object path of the device + * + * Creates a new #NMIP6Config. + * + * Returns: a new IP6 configuration + **/ +GObject * +nm_ip6_config_new (DBusGConnection *connection, const char *object_path) +{ + return (GObject *) g_object_new (NM_TYPE_IP6_CONFIG, + NM_OBJECT_DBUS_CONNECTION, connection, + NM_OBJECT_DBUS_PATH, object_path, + NULL); +} + +static gboolean +demarshal_ip6_address_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object); + + g_slist_foreach (priv->addresses, (GFunc) nm_ip6_address_unref, NULL); + g_slist_free (priv->addresses); + priv->addresses = NULL; + + priv->addresses = nm_utils_ip6_addresses_from_gvalue (value); + _nm_object_queue_notify (object, NM_IP6_CONFIG_ADDRESSES); + + return TRUE; +} + +static gboolean +demarshal_ip6_nameserver_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + if (!_nm_ip6_address_array_demarshal (value, (GSList **) field)) + return FALSE; + + if (pspec && !strcmp (pspec->name, NM_IP6_CONFIG_NAMESERVERS)) + _nm_object_queue_notify (object, NM_IP6_CONFIG_NAMESERVERS); + + return TRUE; +} + +static gboolean +demarshal_domains (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + if (!_nm_string_array_demarshal (value, (GPtrArray **) field)) + return FALSE; + + _nm_object_queue_notify (object, NM_IP6_CONFIG_DOMAINS); + return TRUE; +} + +static gboolean +demarshal_ip6_routes_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) +{ + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object); + + g_slist_foreach (priv->routes, (GFunc) nm_ip6_route_unref, NULL); + g_slist_free (priv->routes); + priv->routes = NULL; + + priv->routes = nm_utils_ip6_routes_from_gvalue (value); + _nm_object_queue_notify (object, NM_IP6_CONFIG_ROUTES); + + return TRUE; +} + +static void +register_for_property_changed (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config); + const NMPropertiesChangedInfo property_changed_info[] = { + { NM_IP6_CONFIG_ADDRESSES, demarshal_ip6_address_array, &priv->addresses }, + { NM_IP6_CONFIG_NAMESERVERS, demarshal_ip6_nameserver_array, &priv->nameservers }, + { NM_IP6_CONFIG_DOMAINS, demarshal_domains, &priv->domains }, + { NM_IP6_CONFIG_ROUTES, demarshal_ip6_routes_array, &priv->routes }, + { NULL }, + }; + + _nm_object_handle_properties_changed (NM_OBJECT (config), + priv->proxy, + property_changed_info); +} + +/** + * nm_ip6_config_get_addresses: + * @config: a #NMIP6Config + * + * Gets the IP6 addresses (containing the address, prefix, and gateway). + * + * Returns: the #GSList containing #NMSettingIP6Addresses. This is the internal copy + * used by the configuration and must not be modified. + **/ +const GSList * +nm_ip6_config_get_addresses (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + if (priv->addresses) + return priv->addresses; + + if (!_nm_object_get_property (NM_OBJECT (config), + "org.freedesktop.DBus.Properties", + "Addresses", + &value)) { + return NULL; + } + + demarshal_ip6_address_array (NM_OBJECT (config), NULL, &value, &priv->addresses); + g_value_unset (&value); + + return priv->addresses; +} + +/** + * nm_ip6_config_get_nameservers: + * @config: a #NMIP6Config + * + * Gets the domain name servers (DNS). + * + * Returns: a #GSList containing elements of type 'struct in6_addr' which contain + * the addresses of nameservers of the configuration. This is the internal copy + * used by the configuration and must not be modified. + **/ +const GSList * +nm_ip6_config_get_nameservers (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + GParamSpec *pspec; + GValue value = {0,}; + + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + if (priv->nameservers) + return priv->nameservers; + + if (!_nm_object_get_property (NM_OBJECT (config), + NM_DBUS_INTERFACE_IP6_CONFIG, + "Nameservers", + &value)) { + return NULL; + } + + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (config)), NM_IP6_CONFIG_NAMESERVERS); + demarshal_ip6_nameserver_array (NM_OBJECT (config), pspec, &value, &priv->nameservers); + g_value_unset (&value); + + return priv->nameservers; +} + +/** + * nm_ip6_config_get_domains: + * @config: a #NMIP6Config + * + * Gets the domain names. + * + * Returns: the #GPtrArray containing domains as strings. This is the + * internal copy used by the configuration, and must not be modified. + **/ +const GPtrArray * +nm_ip6_config_get_domains (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + GValue value = {0,}; + + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + if (priv->domains) + return handle_ptr_array_return (priv->domains); + + if (!_nm_object_get_property (NM_OBJECT (config), + NM_DBUS_INTERFACE_IP6_CONFIG, + "Domains", + &value)) { + return NULL; + } + + demarshal_domains (NM_OBJECT (config), NULL, &value, &priv->domains); + g_value_unset (&value); + + return handle_ptr_array_return (priv->domains); +} + +/** + * nm_ip6_config_get_routes: + * @config: a #NMIP6Config + * + * Gets the routes. + * + * Returns: the #GSList containing #NMSettingIP6Routes. This is the + * internal copy used by the configuration, and must not be modified. + **/ +const GSList * +nm_ip6_config_get_routes (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + GValue value = { 0, }; + + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + if (priv->routes) + return priv->routes; + + if (!_nm_object_get_property (NM_OBJECT (config), + NM_DBUS_INTERFACE_IP6_CONFIG, + "Routes", + &value)) { + return NULL; + } + + demarshal_ip6_routes_array (NM_OBJECT (config), NULL, &value, &priv->routes); + g_value_unset (&value); + + return priv->routes; +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + DBusGConnection *connection; + NMIP6ConfigPrivate *priv; + + object = G_OBJECT_CLASS (nm_ip6_config_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_IP6_CONFIG_GET_PRIVATE (object); + connection = nm_object_get_connection (NM_OBJECT (object)); + + priv->proxy = dbus_g_proxy_new_for_name (connection, + NM_DBUS_SERVICE, + nm_object_get_path (NM_OBJECT (object)), + NM_DBUS_INTERFACE_IP6_CONFIG); + + register_for_property_changed (NM_IP6_CONFIG (object)); + + return object; +} + +static void +finalize (GObject *object) +{ + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object); + + g_slist_foreach (priv->addresses, (GFunc) nm_ip6_address_unref, NULL); + g_slist_free (priv->addresses); + + g_slist_foreach (priv->routes, (GFunc) nm_ip6_route_unref, NULL); + g_slist_free (priv->routes); + + g_slist_foreach (priv->nameservers, (GFunc) g_free, NULL); + g_slist_free (priv->nameservers); + + if (priv->domains) { + g_ptr_array_foreach (priv->domains, (GFunc) g_free, NULL); + g_ptr_array_free (priv->domains, TRUE); + } + + g_object_unref (priv->proxy); + + 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); + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (self); + + switch (prop_id) { + case PROP_ADDRESSES: + nm_utils_ip6_addresses_to_gvalue (priv->addresses, value); + break; + case PROP_NAMESERVERS: + g_value_set_boxed (value, nm_ip6_config_get_nameservers (self)); + break; + case PROP_DOMAINS: + g_value_set_boxed (value, nm_ip6_config_get_domains (self)); + break; + case PROP_ROUTES: + nm_utils_ip6_routes_to_gvalue (priv->routes, value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_ip6_config_init (NMIP6Config *config) +{ +} + +static void +nm_ip6_config_class_init (NMIP6ConfigClass *config_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (config_class); + + g_type_class_add_private (config_class, sizeof (NMIP6ConfigPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMIP6Config:addresses: + * + * The #GPtrArray containing the IPv6 addresses; use + * nm_utils_ip6_addresses_from_gvalue() to return a #GSList of + * #NMSettingIP6Address objects that is more usable than the raw data. + **/ + g_object_class_install_property + (object_class, PROP_ADDRESSES, + g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, + "Addresses", + "Addresses", + NM_TYPE_IP6_ADDRESS_OBJECT_ARRAY, + G_PARAM_READABLE)); + + /** + * 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, + "Nameservers", + "Nameservers", + NM_TYPE_IP6_ADDRESS_ARRAY, + G_PARAM_READABLE)); + + /** + * 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, + "Domains", + "Domains", + NM_TYPE_STRING_ARRAY, + G_PARAM_READABLE)); + + /** + * NMIP6Config:routes: + * + * The #GPtrArray containing the IPv6 routes; use + * nm_utils_ip6_routes_from_gvalue() to return a #GSList of + * #NMSettingIP6Address objects that is more usable than the raw data. + **/ + g_object_class_install_property + (object_class, PROP_ROUTES, + g_param_spec_boxed (NM_IP6_CONFIG_ROUTES, + "Routes", + "Routes", + NM_TYPE_IP6_ROUTE_OBJECT_ARRAY, + G_PARAM_READABLE)); +} + diff --git a/libnm-glib/nm-ip6-config.h b/libnm-glib/nm-ip6-config.h new file mode 100644 index 00000000..7865dfdb --- /dev/null +++ b/libnm-glib/nm-ip6-config.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_IP6_CONFIG_H +#define NM_IP6_CONFIG_H + +#include +#include +#include +#include "nm-object.h" + +G_BEGIN_DECLS + +#define NM_TYPE_IP6_CONFIG (nm_ip6_config_get_type ()) +#define NM_IP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP6_CONFIG, NMIP6Config)) +#define NM_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IP6_CONFIG, NMIP6ConfigClass)) +#define NM_IS_IP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IP6_CONFIG)) +#define NM_IS_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IP6_CONFIG)) +#define NM_IP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP6_CONFIG, NMIP6ConfigClass)) + +typedef struct { + NMObject parent; +} NMIP6Config; + +typedef struct { + NMObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMIP6ConfigClass; + +#define NM_IP6_CONFIG_ADDRESSES "addresses" +#define NM_IP6_CONFIG_NAMESERVERS "nameservers" +#define NM_IP6_CONFIG_DOMAINS "domains" +#define NM_IP6_CONFIG_ROUTES "routes" + +GType nm_ip6_config_get_type (void); + +GObject *nm_ip6_config_new (DBusGConnection *connection, const char *object_path); + +const GSList * nm_ip6_config_get_addresses (NMIP6Config *config); +const GSList * nm_ip6_config_get_nameservers (NMIP6Config *config); +const GPtrArray *nm_ip6_config_get_domains (NMIP6Config *config); +const GSList * nm_ip6_config_get_routes (NMIP6Config *config); + +G_END_DECLS + +#endif /* NM_IP6_CONFIG_H */ diff --git a/libnm-glib/nm-object-cache.c b/libnm-glib/nm-object-cache.c new file mode 100644 index 00000000..fdbca00f --- /dev/null +++ b/libnm-glib/nm-object-cache.c @@ -0,0 +1,72 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include +#include +#include "nm-object-cache.h" +#include "nm-object.h" + +static GHashTable *cache = NULL; + +static void +_init_cache (void) +{ + if (G_UNLIKELY (cache == NULL)) + cache = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); +} + +void +_nm_object_cache_remove_by_path (const char *path) +{ + _init_cache (); + g_hash_table_remove (cache, path); +} + +void +_nm_object_cache_remove_by_object (NMObject *object) +{ + _init_cache (); + g_hash_table_remove (cache, nm_object_get_path (object)); +} + +void +_nm_object_cache_add (NMObject *object) +{ + char *path; + + _init_cache (); + path = g_strdup (nm_object_get_path (object)); + g_hash_table_insert (cache, path, object); + g_object_set_data_full (G_OBJECT (object), "nm-object-cache-tag", + path, (GDestroyNotify) _nm_object_cache_remove_by_path); +} + +NMObject * +_nm_object_cache_get (const char *path) +{ + NMObject *object; + + _init_cache (); + object = g_hash_table_lookup (cache, path); + return object; +} + diff --git a/libnm-glib/nm-object-cache.h b/libnm-glib/nm-object-cache.h new file mode 100644 index 00000000..b8cf2121 --- /dev/null +++ b/libnm-glib/nm-object-cache.h @@ -0,0 +1,39 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_OBJECT_CACHE_H +#define NM_OBJECT_CACHE_H + +#include +#include +#include "nm-object.h" + +G_BEGIN_DECLS + +NMObject *_nm_object_cache_get (const char *path); +void _nm_object_cache_add (NMObject *object); +void _nm_object_cache_remove_by_object (NMObject *object); +void _nm_object_cache_remove_by_path (const char *path); + +G_END_DECLS + +#endif /* NM_OBJECT_CACHE_H */ diff --git a/libnm-glib/nm-object-private.h b/libnm-glib/nm-object-private.h new file mode 100644 index 00000000..93514cbe --- /dev/null +++ b/libnm-glib/nm-object-private.h @@ -0,0 +1,101 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_OBJECT_PRIVATE_H +#define NM_OBJECT_PRIVATE_H + +#include +#include +#include "nm-object.h" + +typedef gboolean (*PropChangedMarshalFunc) (NMObject *, GParamSpec *, GValue *, gpointer); +typedef GObject * (*NMObjectCreatorFunc) (DBusGConnection *, const char *); + +typedef struct { + const char *name; + PropChangedMarshalFunc func; + gpointer field; +} NMPropertiesChangedInfo; + + +void _nm_object_handle_properties_changed (NMObject *object, + DBusGProxy *proxy, + const NMPropertiesChangedInfo *info); + +gboolean _nm_object_demarshal_generic (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field); + +void _nm_object_queue_notify (NMObject *object, const char *property); + +/* DBus property accessors */ + +gboolean _nm_object_get_property (NMObject *object, + const char *interface, + const char *prop_name, + GValue *value); + +void _nm_object_set_property (NMObject *object, + const char *interface, + const char *prop_name, + GValue *value); + +char *_nm_object_get_string_property (NMObject *object, + const char *interface, + const char *prop_name); + +char *_nm_object_get_object_path_property (NMObject *object, + const char *interface, + const char *prop_name); + +gint32 _nm_object_get_int_property (NMObject *object, + const char *interface, + const char *prop_name); + +guint32 _nm_object_get_uint_property (NMObject *object, + const char *interface, + const char *prop_name); + +gboolean _nm_object_get_boolean_property (NMObject *object, + const char *interface, + const char *prop_name); + +gint8 _nm_object_get_byte_property (NMObject *object, + const char *interface, + const char *prop_name); + +gdouble _nm_object_get_double_property (NMObject *object, + const char *interface, + const char *prop_name); + +GByteArray *_nm_object_get_byte_array_property (NMObject *object, + const char *interface, + const char *prop_name); + +static inline const GPtrArray * +handle_ptr_array_return (GPtrArray *array) +{ + /* zero-length is special-case; return NULL */ + if (!array || !array->len) + return NULL; + return array; +} + +#endif /* NM_OBJECT_PRIVATE_H */ diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c new file mode 100644 index 00000000..72ea0500 --- /dev/null +++ b/libnm-glib/nm-object.c @@ -0,0 +1,675 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include +#include +#include "NetworkManager.h" +#include "nm-object.h" +#include "nm-object-cache.h" +#include "nm-object-private.h" +#include "nm-dbus-glib-types.h" + + +G_DEFINE_ABSTRACT_TYPE (NMObject, nm_object, G_TYPE_OBJECT) + +#define NM_OBJECT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_OBJECT, NMObjectPrivate)) + +typedef struct { + PropChangedMarshalFunc func; + gpointer field; +} PropChangedInfo; + +typedef struct { + DBusGConnection *connection; + char *path; + DBusGProxy *properties_proxy; + GSList *pcs; + NMObject *parent; + + GSList *notify_props; + guint32 notify_id; + gboolean disposed; +} NMObjectPrivate; + +enum { + PROP_0, + PROP_CONNECTION, + PROP_PATH, + + LAST_PROP +}; + +static void +nm_object_init (NMObject *object) +{ +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMObjectPrivate *priv; + + object = G_OBJECT_CLASS (nm_object_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + _nm_object_cache_add (NM_OBJECT (object)); + + priv = NM_OBJECT_GET_PRIVATE (object); + + if (priv->connection == NULL || priv->path == NULL) { + g_warning ("%s: bus connection and path required.", __func__); + g_object_unref (object); + return NULL; + } + + priv->properties_proxy = dbus_g_proxy_new_for_name (priv->connection, + NM_DBUS_SERVICE, + priv->path, + "org.freedesktop.DBus.Properties"); + + return object; +} + +static void +dispose (GObject *object) +{ + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_object_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + if (priv->notify_id) { + g_source_remove (priv->notify_id); + priv->notify_id = 0; + } + + g_slist_foreach (priv->notify_props, (GFunc) g_free, NULL); + g_slist_free (priv->notify_props); + + g_object_unref (priv->properties_proxy); + dbus_g_connection_unref (priv->connection); + + G_OBJECT_CLASS (nm_object_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + + g_slist_foreach (priv->pcs, (GFunc) g_hash_table_destroy, NULL); + g_slist_free (priv->pcs); + g_free (priv->path); + + G_OBJECT_CLASS (nm_object_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_CONNECTION: + /* Construct only */ + priv->connection = dbus_g_connection_ref ((DBusGConnection *) g_value_get_boxed (value)); + break; + case PROP_PATH: + /* Construct only */ + priv->path = g_value_dup_string (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) +{ + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_CONNECTION: + g_value_set_boxed (value, priv->connection); + break; + case PROP_PATH: + g_value_set_string (value, priv->path); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_object_class_init (NMObjectClass *nm_object_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (nm_object_class); + + g_type_class_add_private (nm_object_class, sizeof (NMObjectPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + /* porperties */ + + /** + * NMObject:connection: + * + * The #DBusGConnection of the object. + **/ + g_object_class_install_property + (object_class, PROP_CONNECTION, + g_param_spec_boxed (NM_OBJECT_DBUS_CONNECTION, + "Connection", + "Connection", + DBUS_TYPE_G_CONNECTION, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /** + * NMObject:path: + * + * The DBus object path. + **/ + g_object_class_install_property + (object_class, PROP_PATH, + g_param_spec_string (NM_OBJECT_DBUS_PATH, + "Object Path", + "DBus Object Path", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +} + +/** + * nm_object_get_connection: + * @object: a #NMObject + * + * Gets the #NMObject's DBusGConnection. + * + * Returns: the connection + **/ +DBusGConnection * +nm_object_get_connection (NMObject *object) +{ + g_return_val_if_fail (NM_IS_OBJECT (object), NULL); + + return NM_OBJECT_GET_PRIVATE (object)->connection; +} + +/** + * nm_object_get_path: + * @object: a #NMObject + * + * Gets the DBus path of the #NMObject. + * + * Returns: the object's path. This is the internal string used by the + * device, and must not be modified. + **/ +const char * +nm_object_get_path (NMObject *object) +{ + g_return_val_if_fail (NM_IS_OBJECT (object), NULL); + + return NM_OBJECT_GET_PRIVATE (object)->path; +} + +static gboolean +deferred_notify_cb (gpointer data) +{ + NMObject *object = NM_OBJECT (data); + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + GSList *props, *iter; + + priv->notify_id = 0; + + /* Clear priv->notify_props early so that an NMObject subclass that + * listens to property changes can queue up other property changes + * during the g_object_notify() call separately from the property + * list we're iterating. + */ + props = g_slist_reverse (priv->notify_props); + priv->notify_props = NULL; + + for (iter = props; iter; iter = g_slist_next (iter)) { + g_object_notify (G_OBJECT (object), (const char *) iter->data); + g_free (iter->data); + } + g_slist_free (props); + return FALSE; +} + +void +_nm_object_queue_notify (NMObject *object, const char *property) +{ + NMObjectPrivate *priv; + gboolean found = FALSE; + GSList *iter; + + g_return_if_fail (NM_IS_OBJECT (object)); + g_return_if_fail (property != NULL); + + priv = NM_OBJECT_GET_PRIVATE (object); + if (!priv->notify_id) + priv->notify_id = g_idle_add_full (G_PRIORITY_LOW, deferred_notify_cb, object, NULL); + + for (iter = priv->notify_props; iter; iter = g_slist_next (iter)) { + if (!strcmp ((char *) iter->data, property)) { + found = TRUE; + break; + } + } + + if (!found) + priv->notify_props = g_slist_prepend (priv->notify_props, g_strdup (property)); +} + +/* Stolen from dbus-glib */ +static char* +wincaps_to_dash (const char *caps) +{ + const char *p; + GString *str; + + str = g_string_new (NULL); + p = caps; + while (*p) { + if (g_ascii_isupper (*p)) { + if (str->len > 0 && (str->len < 2 || str->str[str->len-2] != '-')) + g_string_append_c (str, '-'); + g_string_append_c (str, g_ascii_tolower (*p)); + } else + g_string_append_c (str, *p); + ++p; + } + + return g_string_free (str, FALSE); +} + +static void +handle_property_changed (gpointer key, gpointer data, gpointer user_data) +{ + NMObject *self = NM_OBJECT (user_data); + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (self); + char *prop_name; + PropChangedInfo *pci; + GParamSpec *pspec; + gboolean success = FALSE, found = FALSE; + GSList *iter; + + prop_name = wincaps_to_dash ((char *) key); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (self)), prop_name); + if (!pspec) { + g_warning ("%s: property '%s' changed but wasn't defined by object type %s.", + __func__, + prop_name, + G_OBJECT_TYPE_NAME (self)); + goto out; + } + + /* Iterate through the object and it's parents to find the property */ + for (iter = priv->pcs; iter; iter = g_slist_next (iter)) { + pci = g_hash_table_lookup ((GHashTable *) iter->data, prop_name); + if (pci) { + found = TRUE; + success = (*(pci->func)) (self, pspec, (GValue *) data, pci->field); + if (success) + break; + } + } + + if (!found) { +#if DEBUG + g_warning ("Property '%s' unhandled.", prop_name); +#endif + } else if (!success) { + g_warning ("%s: failed to update property '%s' of object type %s.", + __func__, + prop_name, + G_OBJECT_TYPE_NAME (self)); + } + +out: + g_free (prop_name); +} + +static void +properties_changed_proxy (DBusGProxy *proxy, + GHashTable *properties, + gpointer user_data) +{ + g_hash_table_foreach (properties, handle_property_changed, user_data); +} + +void +_nm_object_handle_properties_changed (NMObject *object, + DBusGProxy *proxy, + const NMPropertiesChangedInfo *info) +{ + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + NMPropertiesChangedInfo *tmp; + GHashTable *instance; + + g_return_if_fail (NM_IS_OBJECT (object)); + g_return_if_fail (proxy != NULL); + g_return_if_fail (info != NULL); + + dbus_g_proxy_add_signal (proxy, "PropertiesChanged", DBUS_TYPE_G_MAP_OF_VARIANT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (proxy, + "PropertiesChanged", + G_CALLBACK (properties_changed_proxy), + object, + NULL); + + instance = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + priv->pcs = g_slist_prepend (priv->pcs, instance); + + for (tmp = (NMPropertiesChangedInfo *) info; tmp->name; tmp++) { + PropChangedInfo *pci; + + if (!tmp->name || !tmp->func || !tmp->field) { + g_warning ("%s: missing field in NMPropertiesChangedInfo", __func__); + continue; + } + + pci = g_malloc0 (sizeof (PropChangedInfo)); + if (!pci) { + g_warning ("%s: not enough memory for PropChangedInfo", __func__); + continue; + } + pci->func = tmp->func; + pci->field = tmp->field; + g_hash_table_insert (instance, g_strdup (tmp->name), pci); + } +} + +#define HANDLE_TYPE(ucase, lcase) \ + } else if (pspec->value_type == G_TYPE_##ucase) { \ + if (G_VALUE_HOLDS_##ucase (value)) { \ + g##lcase *param = (g##lcase *) field; \ + *param = g_value_get_##lcase (value); \ + } else { \ + success = FALSE; \ + goto done; \ + } + +gboolean +_nm_object_demarshal_generic (NMObject *object, + GParamSpec *pspec, + GValue *value, + gpointer field) +{ + gboolean success = TRUE; + + if (pspec->value_type == G_TYPE_STRING) { + if (G_VALUE_HOLDS_STRING (value)) { + char **param = (char **) field; + g_free (*param); + *param = g_value_dup_string (value); + } else if (G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) { + char **param = (char **) field; + g_free (*param); + *param = g_strdup (g_value_get_boxed (value)); + } else { + success = FALSE; + goto done; + } + HANDLE_TYPE(BOOLEAN, boolean) + HANDLE_TYPE(CHAR, char) + HANDLE_TYPE(UCHAR, uchar) + HANDLE_TYPE(DOUBLE, double) + HANDLE_TYPE(INT, int) + HANDLE_TYPE(UINT, uint) + HANDLE_TYPE(INT64, int) + HANDLE_TYPE(UINT64, uint) + HANDLE_TYPE(LONG, long) + HANDLE_TYPE(ULONG, ulong) + } else { + g_warning ("%s: %s/%s unhandled type %s.", + __func__, G_OBJECT_TYPE_NAME (object), pspec->name, + g_type_name (pspec->value_type)); + success = FALSE; + } + +done: + if (success) { + _nm_object_queue_notify (object, pspec->name); + } else { + g_warning ("%s: %s/%s (type %s) couldn't be set with type %s.", + __func__, G_OBJECT_TYPE_NAME (object), pspec->name, + g_type_name (pspec->value_type), G_VALUE_TYPE_NAME (value)); + } + return success; +} + +gboolean +_nm_object_get_property (NMObject *object, + const char *interface, + const char *prop_name, + GValue *value) +{ + GError *err = NULL; + + g_return_val_if_fail (NM_IS_OBJECT (object), FALSE); + g_return_val_if_fail (interface != NULL, FALSE); + g_return_val_if_fail (prop_name != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + if (!dbus_g_proxy_call_with_timeout (NM_OBJECT_GET_PRIVATE (object)->properties_proxy, + "Get", 15000, &err, + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_INVALID, + G_TYPE_VALUE, value, + G_TYPE_INVALID)) { + /* Don't warn about D-Bus no reply/timeout errors; it's mostly noise and + * happens for example when NM quits and the applet is still running. + */ + if (!(err->domain == DBUS_GERROR && err->code == DBUS_GERROR_NO_REPLY)) { + g_warning ("%s: Error getting '%s' for %s: (%d) %s\n", + __func__, + prop_name, + nm_object_get_path (object), + err->code, + err->message); + } + g_error_free (err); + return FALSE; + } + + return TRUE; +} + +void +_nm_object_set_property (NMObject *object, + const char *interface, + const char *prop_name, + GValue *value) +{ + g_return_if_fail (NM_IS_OBJECT (object)); + g_return_if_fail (interface != NULL); + g_return_if_fail (prop_name != NULL); + g_return_if_fail (G_IS_VALUE (value)); + + dbus_g_proxy_call_no_reply (NM_OBJECT_GET_PRIVATE (object)->properties_proxy, + "Set", + G_TYPE_STRING, interface, + G_TYPE_STRING, prop_name, + G_TYPE_VALUE, value, + G_TYPE_INVALID); +} + +char * +_nm_object_get_string_property (NMObject *object, + const char *interface, + const char *prop_name) +{ + char *str = NULL; + GValue value = {0,}; + + if (_nm_object_get_property (object, interface, prop_name, &value)) { + if (G_VALUE_HOLDS_STRING (&value)) + str = g_strdup (g_value_get_string (&value)); + else if (G_VALUE_HOLDS (&value, DBUS_TYPE_G_OBJECT_PATH)) + str = g_strdup (g_value_get_boxed (&value)); + g_value_unset (&value); + } + + return str; +} + +char * +_nm_object_get_object_path_property (NMObject *object, + const char *interface, + const char *prop_name) +{ + char *path = NULL; + GValue value = {0,}; + + if (_nm_object_get_property (object, interface, prop_name, &value)) { + path = g_strdup (g_value_get_boxed (&value)); + g_value_unset (&value); + } + + return path; +} + +gint32 +_nm_object_get_int_property (NMObject *object, + const char *interface, + const char *prop_name) +{ + gint32 i = 0; + GValue value = {0,}; + + if (_nm_object_get_property (object, interface, prop_name, &value)) { + i = g_value_get_int (&value); + g_value_unset (&value); + } + + return i; +} + +guint32 +_nm_object_get_uint_property (NMObject *object, + const char *interface, + const char *prop_name) +{ + guint32 i = 0; + GValue value = {0,}; + + if (_nm_object_get_property (object, interface, prop_name, &value)) { + i = g_value_get_uint (&value); + g_value_unset (&value); + } + + return i; +} + +gboolean +_nm_object_get_boolean_property (NMObject *object, + const char *interface, + const char *prop_name) +{ + gboolean b = FALSE; // FIXME: somehow convey failure if needed + GValue value = {0,}; + + if (_nm_object_get_property (object, interface, prop_name, &value)) { + b = g_value_get_boolean (&value); + g_value_unset (&value); + } + + return b; +} + +gint8 +_nm_object_get_byte_property (NMObject *object, + const char *interface, + const char *prop_name) +{ + gint8 b = G_MAXINT8; + GValue value = {0,}; + + if (_nm_object_get_property (object, interface, prop_name, &value)) { + b = g_value_get_uchar (&value); + g_value_unset (&value); + } + + return b; +} + +gdouble +_nm_object_get_double_property (NMObject *object, + const char *interface, + const char *prop_name) +{ + gdouble d = G_MAXDOUBLE; + GValue value = {0,}; + + if (_nm_object_get_property (object, interface, prop_name, &value)) { + d = g_value_get_double (&value); + g_value_unset (&value); + } + + return d; +} + +GByteArray * +_nm_object_get_byte_array_property (NMObject *object, + const char *interface, + const char *prop_name) +{ + GByteArray * array = NULL; + GValue value = {0,}; + + if (_nm_object_get_property (object, interface, prop_name, &value)) { + GArray * tmp = g_value_get_boxed (&value); + int i; + unsigned char byte; + + array = g_byte_array_sized_new (tmp->len); + for (i = 0; i < tmp->len; i++) { + byte = g_array_index (tmp, unsigned char, i); + g_byte_array_append (array, &byte, 1); + } + g_value_unset (&value); + } + + return array; +} diff --git a/libnm-glib/nm-object.h b/libnm-glib/nm-object.h new file mode 100644 index 00000000..3f7b36cf --- /dev/null +++ b/libnm-glib/nm-object.h @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_OBJECT_H +#define NM_OBJECT_H + +#include +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_OBJECT (nm_object_get_type ()) +#define NM_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_OBJECT, NMObject)) +#define NM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_OBJECT, NMObjectClass)) +#define NM_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_OBJECT)) +#define NM_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_OBJECT)) +#define NM_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_OBJECT, NMObjectClass)) + +#define NM_OBJECT_DBUS_CONNECTION "dbus-connection" +#define NM_OBJECT_DBUS_PATH "dbus-path" + +typedef struct { + GObject parent; +} NMObject; + +typedef struct { + GObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMObjectClass; + +GType nm_object_get_type (void); + +DBusGConnection *nm_object_get_connection (NMObject *object); +const char *nm_object_get_path (NMObject *object); + +G_END_DECLS + +#endif /* NM_OBJECT_H */ diff --git a/libnm-glib/nm-remote-connection-private.h b/libnm-glib/nm-remote-connection-private.h new file mode 100644 index 00000000..22d84ae7 --- /dev/null +++ b/libnm-glib/nm-remote-connection-private.h @@ -0,0 +1,35 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2009 Red Hat, Inc. + */ + +#ifndef __NM_REMOTE_CONNECTION_PRIVATE_H__ +#define __NM_REMOTE_CONNECTION_PRIVATE_H__ + +#define NM_REMOTE_CONNECTION_INIT_RESULT "init-result" + +typedef enum { + NM_REMOTE_CONNECTION_INIT_RESULT_UNKNOWN = 0, + NM_REMOTE_CONNECTION_INIT_RESULT_SUCCESS, + NM_REMOTE_CONNECTION_INIT_RESULT_ERROR +} NMRemoteConnectionInitResult; + +#endif /* __NM_REMOTE_CONNECTION_PRIVATE__ */ + diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c new file mode 100644 index 00000000..1039a7d1 --- /dev/null +++ b/libnm-glib/nm-remote-connection.c @@ -0,0 +1,439 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#include + +#include +#include +#include +#include "nm-remote-connection.h" +#include "nm-remote-connection-private.h" +#include "nm-dbus-glib-types.h" +#include "nm-exported-connection-bindings.h" +#include "nm-settings-connection-interface.h" + +#define NM_REMOTE_CONNECTION_BUS "bus" + +static void settings_connection_interface_init (NMSettingsConnectionInterface *klass); + +G_DEFINE_TYPE_EXTENDED (NMRemoteConnection, nm_remote_connection, NM_TYPE_CONNECTION, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, settings_connection_interface_init)) + +enum { + PROP_0, + PROP_BUS, + PROP_INIT_RESULT, + + LAST_PROP +}; + + +typedef struct { + NMRemoteConnection *self; + DBusGProxy *proxy; + DBusGProxyCall *call; + GFunc callback; + gpointer user_data; +} RemoteCall; + +typedef struct { + DBusGConnection *bus; + DBusGProxy *proxy; + DBusGProxy *secrets_proxy; + GSList *calls; + + NMRemoteConnectionInitResult init_result; + gboolean disposed; +} NMRemoteConnectionPrivate; + +#define NM_REMOTE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnectionPrivate)) + +/****************************************************************/ + +static void +remote_call_complete (NMRemoteConnection *self, RemoteCall *call) +{ + NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); + + priv->calls = g_slist_remove (priv->calls, call); + /* Don't need to cancel it since this function should only be called from + * the dispose handler (where the proxy will be destroyed immediately after) + * or from the call's completion callback. + */ + memset (call, 0, sizeof (RemoteCall)); + g_free (call); +} + +static void +update_cb (DBusGProxy *proxy, GError *error, gpointer user_data) +{ + RemoteCall *call = user_data; + NMSettingsConnectionInterfaceUpdateFunc func = (NMSettingsConnectionInterfaceUpdateFunc) call->callback; + + (*func)(NM_SETTINGS_CONNECTION_INTERFACE (call->self), error, call->user_data); + remote_call_complete (call->self, call); +} + +static gboolean +update (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceUpdateFunc callback, + gpointer user_data) +{ + NMRemoteConnection *self = NM_REMOTE_CONNECTION (connection); + NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); + GHashTable *settings = NULL; + RemoteCall *call; + + call = g_malloc0 (sizeof (RemoteCall)); + call->self = self; + call->callback = (GFunc) callback; + call->user_data = user_data; + call->proxy = priv->proxy; + + settings = nm_connection_to_hash (NM_CONNECTION (self)); + + call->call = org_freedesktop_NetworkManagerSettings_Connection_update_async (priv->proxy, + settings, + update_cb, + call); + g_assert (call->call); + priv->calls = g_slist_append (priv->calls, call); + + g_hash_table_destroy (settings); + + return TRUE; +} + +static void +delete_cb (DBusGProxy *proxy, GError *error, gpointer user_data) +{ + RemoteCall *call = user_data; + NMSettingsConnectionInterfaceDeleteFunc func = (NMSettingsConnectionInterfaceDeleteFunc) call->callback; + + (*func)(NM_SETTINGS_CONNECTION_INTERFACE (call->self), error, call->user_data); + remote_call_complete (call->self, call); +} + +static gboolean +do_delete (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceDeleteFunc callback, + gpointer user_data) +{ + NMRemoteConnection *self = NM_REMOTE_CONNECTION (connection); + NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); + RemoteCall *call; + + call = g_malloc0 (sizeof (RemoteCall)); + call->self = self; + call->callback = (GFunc) callback; + call->user_data = user_data; + call->proxy = priv->proxy; + + call->call = org_freedesktop_NetworkManagerSettings_Connection_delete_async (priv->proxy, + delete_cb, + call); + g_assert (call->call); + priv->calls = g_slist_append (priv->calls, call); + + return TRUE; +} + +static void +get_secrets_cb (DBusGProxy *proxy, GHashTable *secrets, GError *error, gpointer user_data) +{ + RemoteCall *call = user_data; + NMSettingsConnectionInterfaceGetSecretsFunc func = (NMSettingsConnectionInterfaceGetSecretsFunc) call->callback; + + (*func)(NM_SETTINGS_CONNECTION_INTERFACE (call->self), error ? NULL : secrets, error, call->user_data); + remote_call_complete (call->self, call); +} + +static gboolean +get_secrets (NMSettingsConnectionInterface *connection, + const char *setting_name, + const char **hints, + gboolean request_new, + NMSettingsConnectionInterfaceGetSecretsFunc callback, + gpointer user_data) +{ + NMRemoteConnection *self = NM_REMOTE_CONNECTION (connection); + NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); + RemoteCall *call; + + call = g_malloc0 (sizeof (RemoteCall)); + call->self = self; + call->callback = (GFunc) callback; + call->user_data = user_data; + call->proxy = priv->secrets_proxy; + + call->call = org_freedesktop_NetworkManagerSettings_Connection_Secrets_get_secrets_async (priv->secrets_proxy, + setting_name, + hints, + request_new, + get_secrets_cb, + call); + g_assert (call->call); + priv->calls = g_slist_append (priv->calls, call); + + return TRUE; +} + +/****************************************************************/ + +static gboolean +replace_settings (NMRemoteConnection *self, GHashTable *new_settings) +{ + GError *error = NULL; + + if (!nm_connection_replace_settings (NM_CONNECTION (self), new_settings, &error)) { + g_warning ("%s: error updating %s connection %s settings: (%d) %s", + __func__, + (nm_connection_get_scope (NM_CONNECTION (self)) == NM_CONNECTION_SCOPE_USER) ? "user" : "system", + nm_connection_get_path (NM_CONNECTION (self)), + error ? error->code : -1, + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + return FALSE; + } + + /* Emit update irregardless to let listeners figure out what to do with + * the connection; whether to delete / ignore it or not. + */ + nm_settings_connection_interface_emit_updated (NM_SETTINGS_CONNECTION_INTERFACE (self)); + return TRUE; +} + +static void +get_settings_cb (DBusGProxy *proxy, + GHashTable *new_settings, + GError *error, + gpointer user_data) +{ + NMRemoteConnection *self = user_data; + NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); + + if (error) { + g_warning ("%s: error getting %s connection %s settings: (%d) %s", + __func__, + (nm_connection_get_scope (NM_CONNECTION (self)) == NM_CONNECTION_SCOPE_USER) ? "user" : "system", + nm_connection_get_path (NM_CONNECTION (self)), + error ? error->code : -1, + (error && error->message) ? error->message : "(unknown)"); + g_error_free (error); + priv->init_result = NM_REMOTE_CONNECTION_INIT_RESULT_ERROR; + g_object_notify (G_OBJECT (self), NM_REMOTE_CONNECTION_INIT_RESULT); + } else { + replace_settings (self, new_settings); + g_hash_table_destroy (new_settings); + priv->init_result = NM_REMOTE_CONNECTION_INIT_RESULT_SUCCESS; + g_object_notify (G_OBJECT (self), NM_REMOTE_CONNECTION_INIT_RESULT); + } +} + +static void +updated_cb (DBusGProxy *proxy, GHashTable *settings, gpointer user_data) +{ + replace_settings (NM_REMOTE_CONNECTION (user_data), settings); +} + +static void +removed_cb (DBusGProxy *proxy, gpointer user_data) +{ + g_signal_emit_by_name (G_OBJECT (user_data), "removed"); +} + +/****************************************************************/ + +static void +settings_connection_interface_init (NMSettingsConnectionInterface *klass) +{ + /* interface implementation */ + klass->update = update; + klass->delete = do_delete; + klass->get_secrets = get_secrets; +} + +/** + * nm_remote_connection_new: + * @bus: a valid and connected D-Bus connection + * @scope: the Connection scope (either user or system) + * @path: the D-Bus path of the connection as exported by the settings service + * indicated by @scope + * + * Creates a new object representing the remote connection. + * + * Returns: the new remote connection object on success, or %NULL on failure + **/ +NMRemoteConnection * +nm_remote_connection_new (DBusGConnection *bus, + NMConnectionScope scope, + const char *path) +{ + g_return_val_if_fail (bus != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return (NMRemoteConnection *) g_object_new (NM_TYPE_REMOTE_CONNECTION, + NM_REMOTE_CONNECTION_BUS, bus, + NM_CONNECTION_SCOPE, scope, + NM_CONNECTION_PATH, path, + NULL); +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMRemoteConnectionPrivate *priv; + const char *service = NM_DBUS_SERVICE_USER_SETTINGS; + + object = G_OBJECT_CLASS (nm_remote_connection_parent_class)->constructor (type, n_construct_params, construct_params); + if (!object) + return NULL; + + priv = NM_REMOTE_CONNECTION_GET_PRIVATE (object); + g_assert (priv->bus); + g_assert (nm_connection_get_path (NM_CONNECTION (object))); + + if (nm_connection_get_scope (NM_CONNECTION (object)) == NM_CONNECTION_SCOPE_SYSTEM) + service = NM_DBUS_SERVICE_SYSTEM_SETTINGS; + + priv->proxy = dbus_g_proxy_new_for_name (priv->bus, + service, + nm_connection_get_path (NM_CONNECTION (object)), + NM_DBUS_IFACE_SETTINGS_CONNECTION); + g_assert (priv->proxy); + dbus_g_proxy_set_default_timeout (priv->proxy, G_MAXINT); + + priv->secrets_proxy = dbus_g_proxy_new_for_name (priv->bus, + service, + nm_connection_get_path (NM_CONNECTION (object)), + NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS); + g_assert (priv->secrets_proxy); + dbus_g_proxy_set_default_timeout (priv->secrets_proxy, G_MAXINT); + + dbus_g_proxy_add_signal (priv->proxy, "Updated", DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "Updated", G_CALLBACK (updated_cb), object, NULL); + + dbus_g_proxy_add_signal (priv->proxy, "Removed", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "Removed", G_CALLBACK (removed_cb), object, NULL); + + org_freedesktop_NetworkManagerSettings_Connection_get_settings_async (priv->proxy, + get_settings_cb, + object); + return object; +} + +static void +nm_remote_connection_init (NMRemoteConnection *self) +{ +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_BUS: + /* Construct only */ + priv->bus = dbus_g_connection_ref ((DBusGConnection *) g_value_get_boxed (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMRemoteConnection *self = NM_REMOTE_CONNECTION (object); + NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); + + switch (prop_id) { + case PROP_INIT_RESULT: + g_value_set_uint (value, priv->init_result); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMRemoteConnection *self = NM_REMOTE_CONNECTION (object); + NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (object); + + if (!priv->disposed) { + priv->disposed = TRUE; + + while (g_slist_length (priv->calls)) + remote_call_complete (self, priv->calls->data); + + g_object_unref (priv->proxy); + g_object_unref (priv->secrets_proxy); + dbus_g_connection_unref (priv->bus); + } + + G_OBJECT_CLASS (nm_remote_connection_parent_class)->dispose (object); +} + +static void +nm_remote_connection_class_init (NMRemoteConnectionClass *remote_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (remote_class); + + g_type_class_add_private (object_class, sizeof (NMRemoteConnectionPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->constructor = constructor; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_BUS, + g_param_spec_boxed (NM_REMOTE_CONNECTION_BUS, + "DBusGConnection", + "DBusGConnection", + DBUS_TYPE_G_CONNECTION, + G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_INIT_RESULT, + g_param_spec_uint (NM_REMOTE_CONNECTION_INIT_RESULT, + "Initialization result (PRIVATE)", + "Initialization result (PRIVATE)", + NM_REMOTE_CONNECTION_INIT_RESULT_UNKNOWN, + NM_REMOTE_CONNECTION_INIT_RESULT_ERROR, + NM_REMOTE_CONNECTION_INIT_RESULT_UNKNOWN, + G_PARAM_READABLE)); +} + diff --git a/libnm-glib/nm-remote-connection.h b/libnm-glib/nm-remote-connection.h new file mode 100644 index 00000000..ef5452f9 --- /dev/null +++ b/libnm-glib/nm-remote-connection.h @@ -0,0 +1,65 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2009 Red Hat, Inc. + */ + +#ifndef __NM_REMOTE_CONNECTION_H__ +#define __NM_REMOTE_CONNECTION_H__ + +#include +#include + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_REMOTE_CONNECTION (nm_remote_connection_get_type ()) +#define NM_REMOTE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnection)) +#define NM_REMOTE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnectionClass)) +#define NM_IS_REMOTE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_REMOTE_CONNECTION)) +#define NM_IS_REMOTE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_REMOTE_CONNECTION)) +#define NM_REMOTE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnectionClass)) + +typedef struct { + NMConnection parent; +} NMRemoteConnection; + +typedef struct { + NMConnectionClass parent_class; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMRemoteConnectionClass; + +GType nm_remote_connection_get_type (void); + +NMRemoteConnection *nm_remote_connection_new (DBusGConnection *bus, + NMConnectionScope scope, + const char *path); +G_END_DECLS + +#endif /* __NM_REMOTE_CONNECTION__ */ + diff --git a/libnm-glib/nm-remote-settings-system.c b/libnm-glib/nm-remote-settings-system.c new file mode 100644 index 00000000..95098c7e --- /dev/null +++ b/libnm-glib/nm-remote-settings-system.c @@ -0,0 +1,375 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. + */ + +#include +#include +#include + +#include "nm-marshal.h" +#include "nm-dbus-glib-types.h" +#include "nm-remote-settings-system.h" +#include "nm-settings-system-bindings.h" +#include "nm-settings-system-interface.h" + +static void settings_system_interface_init (NMSettingsSystemInterface *klass); + +G_DEFINE_TYPE_EXTENDED (NMRemoteSettingsSystem, nm_remote_settings_system, NM_TYPE_REMOTE_SETTINGS, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_SYSTEM_INTERFACE, settings_system_interface_init)) + +#define NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_REMOTE_SETTINGS_SYSTEM, NMRemoteSettingsSystemPrivate)) + +typedef struct { + DBusGProxy *proxy; + DBusGProxy *props_proxy; + + char *hostname; + gboolean can_modify; + + NMSettingsSystemPermissions permissions; + gboolean have_permissions; + + gboolean disposed; +} NMRemoteSettingsSystemPrivate; + +static void +properties_changed_cb (DBusGProxy *proxy, + GHashTable *properties, + gpointer user_data) +{ + NMRemoteSettingsSystem *self = NM_REMOTE_SETTINGS_SYSTEM (user_data); + NMRemoteSettingsSystemPrivate *priv = NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE (self); + GHashTableIter iter; + gpointer key, tmp; + + g_hash_table_iter_init (&iter, properties); + while (g_hash_table_iter_next (&iter, &key, &tmp)) { + GValue *value = tmp; + + if (!strcmp ((const char *) key, "Hostname")) { + g_free (priv->hostname); + priv->hostname = g_value_dup_string (value); + g_object_notify (G_OBJECT (self), NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME); + } + + if (!strcmp ((const char *) key, "CanModify")) { + priv->can_modify = g_value_get_boolean (value); + g_object_notify (G_OBJECT (self), NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY); + } + } +} + +static void +get_all_cb (DBusGProxy *proxy, + DBusGProxyCall *call, + gpointer user_data) +{ + NMRemoteSettingsSystem *self = NM_REMOTE_SETTINGS_SYSTEM (user_data); + GHashTable *props = NULL; + GError *error = NULL; + + if (!dbus_g_proxy_end_call (proxy, call, &error, + DBUS_TYPE_G_MAP_OF_VARIANT, &props, + G_TYPE_INVALID)) { + /* Don't warn when the call times out because the settings service can't + * be activated or whatever. + */ + if (!(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_NO_REPLY)) { + g_warning ("%s: couldn't retrieve system settings properties: (%d) %s.", + __func__, + error ? error->code : -1, + (error && error->message) ? error->message : "(unknown)"); + } + g_clear_error (&error); + return; + } + + properties_changed_cb (NULL, props, self); + g_hash_table_destroy (props); +} + +typedef struct { + NMSettingsSystemInterface *settings; + NMSettingsSystemSaveHostnameFunc callback; + gpointer callback_data; +} SaveHostnameInfo; + +static void +save_hostname_cb (DBusGProxy *proxy, + DBusGProxyCall *call, + gpointer user_data) +{ + SaveHostnameInfo *info = user_data; + GError *error = NULL; + + dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); + info->callback (info->settings, error, info->callback_data); + g_clear_error (&error); +} + +static gboolean +save_hostname (NMSettingsSystemInterface *settings, + const char *hostname, + NMSettingsSystemSaveHostnameFunc callback, + gpointer user_data) +{ + NMRemoteSettingsSystem *self = NM_REMOTE_SETTINGS_SYSTEM (settings); + NMRemoteSettingsSystemPrivate *priv = NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE (self); + SaveHostnameInfo *info; + + info = g_malloc0 (sizeof (SaveHostnameInfo)); + info->settings = settings; + info->callback = callback; + info->callback_data = user_data; + + dbus_g_proxy_begin_call (priv->proxy, "SaveHostname", + save_hostname_cb, + info, + g_free, + G_TYPE_STRING, hostname ? hostname : "", + G_TYPE_INVALID); + return TRUE; +} + +typedef struct { + NMSettingsSystemInterface *settings; + NMSettingsSystemGetPermissionsFunc callback; + gpointer callback_data; +} GetPermissionsInfo; + +static void +get_permissions_cb (DBusGProxy *proxy, + DBusGProxyCall *call, + gpointer user_data) +{ + GetPermissionsInfo *info = user_data; + NMRemoteSettingsSystem *self = NM_REMOTE_SETTINGS_SYSTEM (info->settings); + NMRemoteSettingsSystemPrivate *priv = NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE (self); + NMSettingsSystemPermissions permissions = NM_SETTINGS_SYSTEM_PERMISSION_NONE; + GError *error = NULL; + + dbus_g_proxy_end_call (proxy, call, &error, + G_TYPE_UINT, &permissions, + G_TYPE_INVALID); + priv->permissions = permissions; + priv->have_permissions = !error; + info->callback (info->settings, permissions, error, info->callback_data); + g_clear_error (&error); +} + +static gboolean +get_permissions (NMSettingsSystemInterface *settings, + NMSettingsSystemGetPermissionsFunc callback, + gpointer user_data) +{ + NMRemoteSettingsSystemPrivate *priv = NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE (settings); + GetPermissionsInfo *info; + + /* Skip D-Bus if we already have permissions */ + if (priv->have_permissions) { + callback (settings, priv->permissions, NULL, user_data); + return TRUE; + } + + /* Otherwise fetch them from NM */ + info = g_malloc0 (sizeof (GetPermissionsInfo)); + info->settings = settings; + info->callback = callback; + info->callback_data = user_data; + + dbus_g_proxy_begin_call (priv->proxy, "GetPermissions", + get_permissions_cb, + info, + g_free, + G_TYPE_INVALID); + return TRUE; +} + +static void +check_permissions_cb (DBusGProxy *proxy, gpointer user_data) +{ + NMRemoteSettingsSystem *self = NM_REMOTE_SETTINGS_SYSTEM (user_data); + NMRemoteSettingsSystemPrivate *priv = NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE (self); + + /* Permissions need to be re-fetched */ + priv->have_permissions = FALSE; + g_signal_emit_by_name (self, NM_SETTINGS_SYSTEM_INTERFACE_CHECK_PERMISSIONS); +} + +/****************************************************************/ + +static void +settings_system_interface_init (NMSettingsSystemInterface *klass) +{ + /* interface implementation */ + klass->save_hostname = save_hostname; + klass->get_permissions = get_permissions; +} + +/** + * nm_remote_settings_system_new: + * @bus: a valid and connected D-Bus connection + * + * Creates a new object representing the remote system settings service. + * + * Returns: the new remote system settings object on success, or %NULL on failure + **/ +NMRemoteSettingsSystem * +nm_remote_settings_system_new (DBusGConnection *bus) +{ + g_return_val_if_fail (bus != NULL, NULL); + + return (NMRemoteSettingsSystem *) g_object_new (NM_TYPE_REMOTE_SETTINGS_SYSTEM, + NM_REMOTE_SETTINGS_BUS, bus, + NM_REMOTE_SETTINGS_SCOPE, NM_CONNECTION_SCOPE_SYSTEM, + NULL); +} + +static void +nm_remote_settings_system_init (NMRemoteSettingsSystem *self) +{ +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMRemoteSettingsSystemPrivate *priv; + DBusGConnection *bus = NULL; + + object = G_OBJECT_CLASS (nm_remote_settings_system_parent_class)->constructor (type, n_construct_params, construct_params); + if (!object) + return NULL; + + priv = NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE (object); + + g_object_get (G_OBJECT (object), NM_REMOTE_SETTINGS_BUS, &bus, NULL); + g_assert (bus); + + /* D-Bus properties proxy */ + priv->props_proxy = dbus_g_proxy_new_for_name (bus, + NM_DBUS_SERVICE_SYSTEM_SETTINGS, + NM_DBUS_PATH_SETTINGS, + "org.freedesktop.DBus.Properties"); + g_assert (priv->props_proxy); + + /* System settings proxy */ + priv->proxy = dbus_g_proxy_new_for_name (bus, + NM_DBUS_SERVICE_SYSTEM_SETTINGS, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS_SYSTEM); + g_assert (priv->proxy); + dbus_g_proxy_set_default_timeout (priv->proxy, G_MAXINT); + + 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->proxy, "PropertiesChanged", + DBUS_TYPE_G_MAP_OF_VARIANT, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "PropertiesChanged", + G_CALLBACK (properties_changed_cb), + object, + NULL); + + /* Monitor for permissions changes */ + dbus_g_proxy_add_signal (priv->proxy, "CheckPermissions", G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "CheckPermissions", + G_CALLBACK (check_permissions_cb), + object, + NULL); + + /* Get properties */ + dbus_g_proxy_begin_call (priv->props_proxy, "GetAll", + get_all_cb, + object, + NULL, + G_TYPE_STRING, NM_DBUS_IFACE_SETTINGS_SYSTEM, + G_TYPE_INVALID); + + dbus_g_connection_unref (bus); + + return object; +} + +static void +dispose (GObject *object) +{ + NMRemoteSettingsSystemPrivate *priv = NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE (object); + + if (priv->disposed) + return; + + priv->disposed = TRUE; + + g_free (priv->hostname); + + g_object_unref (priv->props_proxy); + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_remote_settings_system_parent_class)->dispose (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMRemoteSettingsSystemPrivate *priv = NM_REMOTE_SETTINGS_SYSTEM_GET_PRIVATE (object); + + switch (prop_id) { + case NM_SETTINGS_SYSTEM_INTERFACE_PROP_HOSTNAME: + g_value_set_string (value, priv->hostname); + break; + case NM_SETTINGS_SYSTEM_INTERFACE_PROP_CAN_MODIFY: + g_value_set_boolean (value, priv->can_modify); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_remote_settings_system_class_init (NMRemoteSettingsSystemClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (NMRemoteSettingsSystemPrivate)); + + /* Virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->dispose = dispose; + + /* Properties */ + g_object_class_override_property (object_class, + NM_SETTINGS_SYSTEM_INTERFACE_PROP_HOSTNAME, + NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME); + + g_object_class_override_property (object_class, + NM_SETTINGS_SYSTEM_INTERFACE_PROP_CAN_MODIFY, + NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY); +} + diff --git a/libnm-glib/nm-remote-settings-system.h b/libnm-glib/nm-remote-settings-system.h new file mode 100644 index 00000000..b5182273 --- /dev/null +++ b/libnm-glib/nm-remote-settings-system.h @@ -0,0 +1,64 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2009 Red Hat, Inc. + */ + +#ifndef NM_REMOTE_SETTINGS_SYSTEM_H +#define NM_REMOTE_SETTINGS_SYSTEM_H + +#include +#include + +#include "nm-remote-settings.h" +#include "nm-settings-system-interface.h" + +G_BEGIN_DECLS + +#define NM_TYPE_REMOTE_SETTINGS_SYSTEM (nm_remote_settings_system_get_type ()) +#define NM_REMOTE_SETTINGS_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_REMOTE_SETTINGS_SYSTEM, NMRemoteSettingsSystem)) +#define NM_REMOTE_SETTINGS_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_REMOTE_SETTINGS_SYSTEM, NMRemoteSettingsSystemClass)) +#define NM_IS_REMOTE_SETTINGS_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_REMOTE_SETTINGS_SYSTEM)) +#define NM_IS_REMOTE_SETTINGS_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_REMOTE_SETTINGS_SYSTEM)) +#define NM_REMOTE_SETTINGS_SYSTEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_REMOTE_SETTINGS_SYSTEM, NMRemoteSettingsSystemClass)) + +typedef struct { + NMRemoteSettings parent; +} NMRemoteSettingsSystem; + +typedef struct { + NMRemoteSettingsClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMRemoteSettingsSystemClass; + +GType nm_remote_settings_system_get_type (void); + +NMRemoteSettingsSystem *nm_remote_settings_system_new (DBusGConnection *bus); + +G_END_DECLS + +#endif /* NM_REMOTE_SETTINGS_SYSTEM_H */ diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c new file mode 100644 index 00000000..92814a15 --- /dev/null +++ b/libnm-glib/nm-remote-settings.c @@ -0,0 +1,540 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2009 - 2010 Red Hat, Inc. + */ + +#include +#include +#include + +#include "nm-marshal.h" +#include "nm-remote-settings.h" +#include "nm-settings-bindings.h" +#include "nm-settings-interface.h" +#include "nm-remote-connection-private.h" + +static void settings_interface_init (NMSettingsInterface *class); + +G_DEFINE_TYPE_EXTENDED (NMRemoteSettings, nm_remote_settings, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_INTERFACE, settings_interface_init)) + +#define NM_REMOTE_SETTINGS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettingsPrivate)) + +typedef struct { + DBusGConnection *bus; + NMConnectionScope scope; + + DBusGProxy *proxy; + GHashTable *connections; + GHashTable *pending; /* Connections we don't have settings for yet */ + gboolean service_running; + + DBusGProxy *dbus_proxy; + + guint fetch_id; + + gboolean disposed; +} NMRemoteSettingsPrivate; + +enum { + PROP_0, + PROP_BUS, + PROP_SCOPE, + PROP_SERVICE_RUNNING, + + LAST_PROP +}; + +static NMSettingsConnectionInterface * +get_connection_by_path (NMSettingsInterface *settings, const char *path) +{ + return g_hash_table_lookup (NM_REMOTE_SETTINGS_GET_PRIVATE (settings)->connections, path); +} + +static void +connection_removed_cb (NMRemoteConnection *remote, gpointer user_data) +{ + NMRemoteSettings *self = NM_REMOTE_SETTINGS (user_data); + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + const char *path; + + path = nm_connection_get_path (NM_CONNECTION (remote)); + g_hash_table_remove (priv->connections, path); + g_hash_table_remove (priv->pending, path); +} + +static void +connection_init_result_cb (NMRemoteConnection *remote, + GParamSpec *pspec, + gpointer user_data) +{ + NMRemoteSettings *self = NM_REMOTE_SETTINGS (user_data); + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + guint32 init_result = NM_REMOTE_CONNECTION_INIT_RESULT_UNKNOWN; + const char *path; + + /* Disconnect from the init-result signal just to be safe */ + g_signal_handlers_disconnect_matched (remote, + G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, + 0, + 0, + NULL, + G_CALLBACK (connection_init_result_cb), + self); + + path = nm_connection_get_path (NM_CONNECTION (remote)); + + g_object_get (G_OBJECT (remote), + NM_REMOTE_CONNECTION_INIT_RESULT, &init_result, + NULL); + + switch (init_result) { + case NM_REMOTE_CONNECTION_INIT_RESULT_SUCCESS: + /* ref it when adding to ->connections, since removing it from ->pending + * will unref it. + */ + g_hash_table_insert (priv->connections, g_strdup (path), g_object_ref (remote)); + + /* Finally, let users know of the new connection now that it has all + * its settings and is valid. + */ + g_signal_emit_by_name (self, "new-connection", remote); + break; + case NM_REMOTE_CONNECTION_INIT_RESULT_ERROR: + default: + break; + } + + g_hash_table_remove (priv->pending, path); + + /* Let listeners know that all connections have been found */ + if (!g_hash_table_size (priv->pending)) + g_signal_emit_by_name (self, NM_SETTINGS_INTERFACE_CONNECTIONS_READ); +} + +static void +new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data) +{ + NMRemoteSettings *self = NM_REMOTE_SETTINGS (user_data); + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + NMRemoteConnection *connection; + + connection = nm_remote_connection_new (priv->bus, priv->scope, path); + if (connection) { + g_signal_connect (connection, "removed", + G_CALLBACK (connection_removed_cb), + self); + + g_signal_connect (connection, "notify::" NM_REMOTE_CONNECTION_INIT_RESULT, + G_CALLBACK (connection_init_result_cb), + 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 + * really valid until it has all its settings, so hide it until it does. + */ + g_hash_table_insert (priv->pending, g_strdup (path), connection); + } +} + +static void +fetch_connections_done (DBusGProxy *proxy, + GPtrArray *connections, + GError *error, + gpointer user_data) +{ + NMRemoteSettings *self = NM_REMOTE_SETTINGS (user_data); + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + int i; + + if (error) { + g_warning ("%s: error fetching %s connections: (%d) %s.", + __func__, + priv->scope == NM_CONNECTION_SCOPE_USER ? "user" : "system", + error->code, + error->message ? error->message : "(unknown)"); + g_clear_error (&error); + return; + } + + /* Let listeners know we are done getting connections */ + if (connections->len == 0) { + g_signal_emit_by_name (self, NM_SETTINGS_INTERFACE_CONNECTIONS_READ); + return; + } + + for (i = 0; connections && (i < connections->len); i++) { + char *path = g_ptr_array_index (connections, i); + + new_connection_cb (proxy, path, user_data); + g_free (path); + } + g_ptr_array_free (connections, TRUE); +} + +static gboolean +fetch_connections (gpointer user_data) +{ + NMRemoteSettings *self = NM_REMOTE_SETTINGS (user_data); + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + + priv->fetch_id = 0; + + org_freedesktop_NetworkManagerSettings_list_connections_async (priv->proxy, + fetch_connections_done, + self); + return FALSE; +} + +static GSList * +list_connections (NMSettingsInterface *settings) +{ + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (settings); + GSList *list = NULL; + GHashTableIter iter; + gpointer value; + + g_hash_table_iter_init (&iter, priv->connections); + while (g_hash_table_iter_next (&iter, NULL, &value)) + list = g_slist_prepend (list, NM_REMOTE_CONNECTION (value)); + + return list; +} + +typedef struct { + NMSettingsInterface *self; + NMSettingsAddConnectionFunc callback; + gpointer callback_data; +} AddConnectionInfo; + +static void +add_connection_done (DBusGProxy *proxy, + GError *error, + gpointer user_data) +{ + AddConnectionInfo *info = user_data; + + info->callback (info->self, error, info->callback_data); + g_free (info); +} + +static gboolean +add_connection (NMSettingsInterface *settings, + NMConnection *connection, + NMSettingsAddConnectionFunc callback, + gpointer user_data) +{ + NMRemoteSettings *self = NM_REMOTE_SETTINGS (settings); + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + AddConnectionInfo *info; + GHashTable *new_settings; + + info = g_malloc0 (sizeof (AddConnectionInfo)); + info->self = settings; + info->callback = callback; + info->callback_data = user_data; + + new_settings = nm_connection_to_hash (connection); + org_freedesktop_NetworkManagerSettings_add_connection_async (priv->proxy, + new_settings, + add_connection_done, + info); + g_hash_table_destroy (new_settings); + return TRUE; +} + +static gboolean +remove_connections (gpointer user_data) +{ + NMRemoteSettings *self = NM_REMOTE_SETTINGS (user_data); + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + GHashTableIter iter; + gpointer value; + GSList *list = NULL, *list_iter; + + /* Build up the list of connections; we can't emit "removed" during hash + * table iteration because emission of the "removed" signal may trigger code + * that explicitly removes the the connection from the hash table somewhere + * else. + */ + g_hash_table_iter_init (&iter, priv->connections); + while (g_hash_table_iter_next (&iter, NULL, &value)) + list = g_slist_prepend (list, NM_REMOTE_CONNECTION (value)); + + for (list_iter = list; list_iter; list_iter = g_slist_next (list_iter)) + g_signal_emit_by_name (NM_REMOTE_CONNECTION (list_iter->data), "removed"); + g_slist_free (list); + + g_hash_table_remove_all (priv->connections); + return FALSE; +} + +static void +name_owner_changed (DBusGProxy *proxy, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + NMRemoteSettings *self = NM_REMOTE_SETTINGS (user_data); + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + const char *sname = NM_DBUS_SERVICE_USER_SETTINGS; + + if (priv->scope == NM_CONNECTION_SCOPE_SYSTEM) + sname = NM_DBUS_SERVICE_SYSTEM_SETTINGS; + + if (!strcmp (name, sname)) { + if (priv->fetch_id) + g_source_remove (priv->fetch_id); + + if (new_owner && strlen (new_owner) > 0) { + priv->fetch_id = g_idle_add (fetch_connections, self); + priv->service_running = TRUE; + } else { + priv->fetch_id = g_idle_add (remove_connections, self); + priv->service_running = FALSE; + } + g_object_notify (G_OBJECT (self), NM_REMOTE_SETTINGS_SERVICE_RUNNING); + } +} + +/****************************************************************/ + +static void +settings_interface_init (NMSettingsInterface *iface) +{ + /* interface implementation */ + iface->list_connections = list_connections; + iface->get_connection_by_path = get_connection_by_path; + iface->add_connection = add_connection; +} + +/** + * nm_remote_settings_new: + * @bus: a valid and connected D-Bus connection + * @scope: the settings service scope (either user or system) + * + * Creates a new object representing the remote settings service. + * + * Returns: the new remote settings object on success, or %NULL on failure + **/ +NMRemoteSettings * +nm_remote_settings_new (DBusGConnection *bus, NMConnectionScope scope) +{ + g_return_val_if_fail (bus != NULL, NULL); + g_return_val_if_fail (scope != NM_CONNECTION_SCOPE_UNKNOWN, NULL); + + return (NMRemoteSettings *) g_object_new (NM_TYPE_REMOTE_SETTINGS, + NM_REMOTE_SETTINGS_BUS, bus, + NM_REMOTE_SETTINGS_SCOPE, scope, + NULL); +} + +static void +nm_remote_settings_init (NMRemoteSettings *self) +{ + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (self); + + priv->connections = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + priv->pending = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMRemoteSettingsPrivate *priv; + const char *service = NM_DBUS_SERVICE_USER_SETTINGS; + GError *error = NULL; + + object = G_OBJECT_CLASS (nm_remote_settings_parent_class)->constructor (type, n_construct_params, construct_params); + if (!object) + return NULL; + + priv = NM_REMOTE_SETTINGS_GET_PRIVATE (object); + + /* D-Bus proxy for clearing connections on NameOwnerChanged */ + priv->dbus_proxy = dbus_g_proxy_new_for_name (priv->bus, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + g_assert (priv->dbus_proxy); + + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING_STRING, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->dbus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->dbus_proxy, + "NameOwnerChanged", + G_CALLBACK (name_owner_changed), + object, NULL); + + /* Settings service proxy */ + if (priv->scope == NM_CONNECTION_SCOPE_SYSTEM) + service = NM_DBUS_SERVICE_SYSTEM_SETTINGS; + + if (!dbus_g_proxy_call (priv->dbus_proxy, "NameHasOwner", &error, + G_TYPE_STRING, service, + G_TYPE_INVALID, + G_TYPE_BOOLEAN, &priv->service_running, + G_TYPE_INVALID)) { + g_warning ("%s (NMRemoteSettings) error getting remote settings service status: (%d) %s\n", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + priv->service_running = FALSE; + } + + priv->proxy = dbus_g_proxy_new_for_name (priv->bus, + service, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS); + g_assert (priv->proxy); + dbus_g_proxy_set_default_timeout (priv->proxy, G_MAXINT); + + dbus_g_proxy_add_signal (priv->proxy, "NewConnection", + DBUS_TYPE_G_OBJECT_PATH, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "NewConnection", + G_CALLBACK (new_connection_cb), + object, + NULL); + + priv->fetch_id = g_idle_add (fetch_connections, object); + + return object; +} + +static void +dispose (GObject *object) +{ + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (object); + + if (priv->disposed) + return; + + priv->disposed = TRUE; + + if (priv->fetch_id) + g_source_remove (priv->fetch_id); + + if (priv->connections) + g_hash_table_destroy (priv->connections); + + if (priv->pending) + g_hash_table_destroy (priv->pending); + + g_object_unref (priv->dbus_proxy); + g_object_unref (priv->proxy); + dbus_g_connection_unref (priv->bus); + + G_OBJECT_CLASS (nm_remote_settings_parent_class)->dispose (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_BUS: + /* Construct only */ + priv->bus = dbus_g_connection_ref ((DBusGConnection *) g_value_get_boxed (value)); + break; + case PROP_SCOPE: + priv->scope = (NMConnectionScope) g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_BUS: + g_value_set_boxed (value, priv->bus); + break; + case PROP_SCOPE: + g_value_set_uint (value, priv->scope); + break; + case PROP_SERVICE_RUNNING: + g_value_set_boolean (value, priv->service_running); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_remote_settings_class_init (NMRemoteSettingsClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + g_type_class_add_private (class, sizeof (NMRemoteSettingsPrivate)); + + /* Virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->dispose = dispose; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_BUS, + g_param_spec_boxed (NM_REMOTE_SETTINGS_BUS, + "DBusGConnection", + "DBusGConnection", + DBUS_TYPE_G_CONNECTION, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_SCOPE, + g_param_spec_uint (NM_REMOTE_SETTINGS_SCOPE, + "Scope", + "NMConnection scope", + NM_CONNECTION_SCOPE_UNKNOWN, + NM_CONNECTION_SCOPE_USER, + NM_CONNECTION_SCOPE_USER, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_SERVICE_RUNNING, + g_param_spec_boolean (NM_REMOTE_SETTINGS_SERVICE_RUNNING, + "Service running", + "Is service running", + FALSE, + G_PARAM_READABLE)); +} + diff --git a/libnm-glib/nm-remote-settings.h b/libnm-glib/nm-remote-settings.h new file mode 100644 index 00000000..d3085566 --- /dev/null +++ b/libnm-glib/nm-remote-settings.h @@ -0,0 +1,67 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2009 Red Hat, Inc. + */ + +#ifndef NM_REMOTE_SETTINGS_H +#define NM_REMOTE_SETTINGS_H + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_REMOTE_SETTINGS (nm_remote_settings_get_type ()) +#define NM_REMOTE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettings)) +#define NM_REMOTE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettingsClass)) +#define NM_IS_REMOTE_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_REMOTE_SETTINGS)) +#define NM_IS_REMOTE_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_REMOTE_SETTINGS)) +#define NM_REMOTE_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_REMOTE_SETTINGS, NMRemoteSettingsClass)) + +#define NM_REMOTE_SETTINGS_BUS "bus" +#define NM_REMOTE_SETTINGS_SCOPE "scope" +#define NM_REMOTE_SETTINGS_SERVICE_RUNNING "service-running" + +typedef struct { + GObject parent; +} NMRemoteSettings; + +typedef struct { + GObjectClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMRemoteSettingsClass; + +GType nm_remote_settings_get_type (void); + +NMRemoteSettings *nm_remote_settings_new (DBusGConnection *bus, NMConnectionScope scope); + +G_END_DECLS + +#endif /* NM_REMOTE_SETTINGS_H */ diff --git a/libnm-glib/nm-serial-device.c b/libnm-glib/nm-serial-device.c new file mode 100644 index 00000000..bb45d7c4 --- /dev/null +++ b/libnm-glib/nm-serial-device.c @@ -0,0 +1,207 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + */ + +#include "nm-serial-device.h" +#include "nm-device-private.h" +#include "nm-object-private.h" +#include "nm-marshal.h" + +G_DEFINE_ABSTRACT_TYPE (NMSerialDevice, nm_serial_device, NM_TYPE_DEVICE) + +#define NM_SERIAL_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SERIAL_DEVICE, NMSerialDevicePrivate)) + +typedef struct { + DBusGProxy *proxy; + + guint32 in_bytes; + guint32 out_bytes; + + gboolean disposed; +} NMSerialDevicePrivate; + +enum { + PPP_STATS, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +/** + * nm_serial_device_get_bytes_received: + * @self: a #NMSerialDevice + * + * Gets the amount of bytes received by the serial device. + * This counter is reset when the device is activated. + * + * Returns: bytes received + **/ +guint32 +nm_serial_device_get_bytes_received (NMSerialDevice *self) +{ + g_return_val_if_fail (NM_IS_SERIAL_DEVICE (self), 0); + + return NM_SERIAL_DEVICE_GET_PRIVATE (self)->in_bytes; +} + +/** + * nm_serial_device_get_bytes_sent: + * @self: a #NMSerialDevice + * + * Gets the amount of bytes sent by the serial device. + * This counter is reset when the device is activated. + * + * Returns: bytes sent + **/ +guint32 +nm_serial_device_get_bytes_sent (NMSerialDevice *self) +{ + g_return_val_if_fail (NM_IS_SERIAL_DEVICE (self), 0); + + return NM_SERIAL_DEVICE_GET_PRIVATE (self)->out_bytes; +} + +static void +ppp_stats (DBusGProxy *proxy, + guint32 in_bytes, + guint32 out_bytes, + gpointer user_data) +{ + NMSerialDevice *self = NM_SERIAL_DEVICE (user_data); + NMSerialDevicePrivate *priv = NM_SERIAL_DEVICE_GET_PRIVATE (self); + + priv->in_bytes = in_bytes; + priv->out_bytes = out_bytes; + + g_signal_emit (self, signals[PPP_STATS], 0, in_bytes, out_bytes); +} + +static void +device_state_changed (NMDevice *device, GParamSpec *pspec, gpointer user_data) +{ + NMSerialDevicePrivate *priv; + + switch (nm_device_get_state (device)) { + case NM_DEVICE_STATE_UNMANAGED: + case NM_DEVICE_STATE_UNAVAILABLE: + case NM_DEVICE_STATE_DISCONNECTED: + priv = NM_SERIAL_DEVICE_GET_PRIVATE (device); + priv->in_bytes = priv->out_bytes = 0; + break; + default: + break; + } +} + +static void +nm_serial_device_init (NMSerialDevice *device) +{ +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMSerialDevicePrivate *priv; + + object = G_OBJECT_CLASS (nm_serial_device_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_SERIAL_DEVICE_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)), + NM_DBUS_SERVICE, + nm_object_get_path (NM_OBJECT (object)), + NM_DBUS_INTERFACE_SERIAL_DEVICE); + + dbus_g_object_register_marshaller (_nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, + G_TYPE_UINT, G_TYPE_UINT, + G_TYPE_INVALID); + + dbus_g_proxy_add_signal (priv->proxy, "PppStats", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "PppStats", + G_CALLBACK (ppp_stats), + object, + NULL); + + /* Catch NMDevice::state changes to reset the counters */ + g_signal_connect (object, "notify::state", + G_CALLBACK (device_state_changed), + object); + + return object; +} + +static void +dispose (GObject *object) +{ + NMSerialDevicePrivate *priv = NM_SERIAL_DEVICE_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_serial_device_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_serial_device_parent_class)->dispose (object); +} + +static void +nm_serial_device_class_init (NMSerialDeviceClass *device_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (device_class); + + g_type_class_add_private (device_class, sizeof (NMSerialDevicePrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->dispose = dispose; + + /* Signals */ + + /** + * NMSerialDevice::ppp-stats: + * @device: the serial device that received the signal + * @in_bytes: the amount of bytes received + * @out_bytes: the amount of bytes sent + * + * Notifies that a #NMAccessPoint is added to the wifi device. + **/ + signals[PPP_STATS] = + g_signal_new ("ppp-stats", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSerialDeviceClass, ppp_stats), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); +} diff --git a/libnm-glib/nm-serial-device.h b/libnm-glib/nm-serial-device.h new file mode 100644 index 00000000..51f08df3 --- /dev/null +++ b/libnm-glib/nm-serial-device.h @@ -0,0 +1,63 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_SERIAL_DEVICE_H +#define NM_SERIAL_DEVICE_H + +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SERIAL_DEVICE (nm_serial_device_get_type ()) +#define NM_SERIAL_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SERIAL_DEVICE, NMSerialDevice)) +#define NM_SERIAL_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SERIAL_DEVICE, NMSerialDeviceClass)) +#define NM_IS_SERIAL_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SERIAL_DEVICE)) +#define NM_IS_SERIAL_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SERIAL_DEVICE)) +#define NM_SERIAL_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SERIAL_DEVICE, NMSerialDeviceClass)) + +typedef struct { + NMDevice parent; +} NMSerialDevice; + +typedef struct { + NMDeviceClass parent; + + /* Signals */ + void (*ppp_stats) (NMSerialDevice *self, guint32 in_bytes, guint32 out_bytes); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMSerialDeviceClass; + +GType nm_serial_device_get_type (void); + +guint32 nm_serial_device_get_bytes_received (NMSerialDevice *self); +guint32 nm_serial_device_get_bytes_sent (NMSerialDevice *self); + +G_END_DECLS + +#endif /* NM_SERIAL_DEVICE_H */ diff --git a/libnm-glib/nm-settings-connection-interface.c b/libnm-glib/nm-settings-connection-interface.c new file mode 100644 index 00000000..868ad047 --- /dev/null +++ b/libnm-glib/nm-settings-connection-interface.c @@ -0,0 +1,192 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2009 Red Hat, Inc. + */ + +#include "nm-settings-connection-interface.h" +#include "nm-dbus-glib-types.h" + +/** + * nm_settings_connection_interface_update: + * @connection: an object implementing #NMSettingsConnectionInterface + * @callback: a function to be called when the update completes + * @user_data: caller-specific data to be passed to @callback + * + * Update the connection with current settings and properties. + * + * Returns: TRUE on success, FALSE on failure + **/ +gboolean +nm_settings_connection_interface_update (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceUpdateFunc callback, + gpointer user_data) +{ + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection), FALSE); + g_return_val_if_fail (callback != NULL, FALSE); + + if (NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->update) { + return NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->update (connection, + callback, + user_data); + } + return FALSE; +} + +/** + * nm_settings_connection_interface_delete: + * @connection: a objecting implementing #NMSettingsConnectionInterface + * @callback: a function to be called when the delete completes + * @user_data: caller-specific data to be passed to @callback + * + * Delete the connection. + * + * Returns: TRUE on success, FALSE on failure + **/ +gboolean +nm_settings_connection_interface_delete (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceDeleteFunc callback, + gpointer user_data) +{ + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection), FALSE); + g_return_val_if_fail (callback != NULL, FALSE); + + if (NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->delete) { + return NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->delete (connection, + callback, + user_data); + } + return FALSE; +} + +/** + * nm_settings_connection_interface_get_secrets: + * @connection: a object implementing #NMSettingsConnectionInterface + * @setting_name: the #NMSetting object name to get secrets for + * @hints: #NMSetting key names to get secrets for (optional) + * @request_new: hint that new secrets (instead of cached or stored secrets) + * should be returned + * @callback: a function to be called when the update completes + * @user_data: caller-specific data to be passed to @callback + * + * Request the connection's secrets. + * + * Returns: TRUE on success, FALSE on failure + **/ +gboolean +nm_settings_connection_interface_get_secrets (NMSettingsConnectionInterface *connection, + const char *setting_name, + const char **hints, + gboolean request_new, + NMSettingsConnectionInterfaceGetSecretsFunc callback, + gpointer user_data) +{ + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection), FALSE); + g_return_val_if_fail (callback != NULL, FALSE); + + if (NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->get_secrets) { + return NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->get_secrets (connection, + setting_name, + hints, + request_new, + callback, + user_data); + } + return FALSE; +} + +void +nm_settings_connection_interface_emit_updated (NMSettingsConnectionInterface *connection) +{ + if (NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->emit_updated) + NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE (connection)->emit_updated (connection); + else { + NMConnection *tmp; + GHashTable *settings; + + tmp = nm_connection_duplicate (NM_CONNECTION (connection)); + nm_connection_clear_secrets (tmp); + settings = nm_connection_to_hash (tmp); + g_object_unref (tmp); + + g_signal_emit_by_name (connection, NM_SETTINGS_CONNECTION_INTERFACE_UPDATED, settings); + g_hash_table_destroy (settings); + } +} + +static void +nm_settings_connection_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 (NM_SETTINGS_CONNECTION_INTERFACE_UPDATED, + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSettingsConnectionInterface, updated), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT); + + g_signal_new (NM_SETTINGS_CONNECTION_INTERFACE_REMOVED, + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSettingsConnectionInterface, removed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + initialized = TRUE; +} + +GType +nm_settings_connection_interface_get_type (void) +{ + static GType itype = 0; + + if (!itype) { + const GTypeInfo iinfo = { + sizeof (NMSettingsConnectionInterface), /* class_size */ + nm_settings_connection_interface_init, /* base_init */ + NULL, /* base_finalize */ + NULL, + NULL, /* class_finalize */ + NULL, /* class_data */ + 0, + 0, /* n_preallocs */ + NULL + }; + + itype = g_type_register_static (G_TYPE_INTERFACE, + "NMSettingsConnectionInterface", + &iinfo, 0); + + g_type_interface_add_prerequisite (itype, NM_TYPE_CONNECTION); + } + + return itype; +} + diff --git a/libnm-glib/nm-settings-connection-interface.h b/libnm-glib/nm-settings-connection-interface.h new file mode 100644 index 00000000..7c7a198c --- /dev/null +++ b/libnm-glib/nm-settings-connection-interface.h @@ -0,0 +1,116 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2009 Red Hat, Inc. + */ + +#ifndef __NM_SETTINGS_CONNECTION_INTERFACE_H__ +#define __NM_SETTINGS_CONNECTION_INTERFACE_H__ + +#include +#include + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTINGS_CONNECTION_INTERFACE (nm_settings_connection_interface_get_type ()) +#define NM_SETTINGS_CONNECTION_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_CONNECTION_INTERFACE, NMSettingsConnectionInterface)) +#define NM_IS_SETTINGS_CONNECTION_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS_CONNECTION_INTERFACE)) +#define NM_SETTINGS_CONNECTION_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_CONNECTION_INTERFACE, NMSettingsConnectionInterface)) + +#define NM_SETTINGS_CONNECTION_INTERFACE_UPDATED "updated" +#define NM_SETTINGS_CONNECTION_INTERFACE_REMOVED "removed" + +typedef struct _NMSettingsConnectionInterface NMSettingsConnectionInterface; + +typedef void (*NMSettingsConnectionInterfaceUpdateFunc) (NMSettingsConnectionInterface *connection, + GError *error, + gpointer user_data); + +typedef void (*NMSettingsConnectionInterfaceDeleteFunc) (NMSettingsConnectionInterface *connection, + GError *error, + gpointer user_data); + +typedef void (*NMSettingsConnectionInterfaceGetSecretsFunc) (NMSettingsConnectionInterface *connection, + GHashTable *secrets, + GError *error, + gpointer user_data); + +struct _NMSettingsConnectionInterface { + GTypeInterface g_iface; + + /* Methods */ + gboolean (*update) (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceUpdateFunc callback, + gpointer user_data); + + gboolean (*delete) (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceDeleteFunc callback, + gpointer user_data); + + gboolean (*get_secrets) (NMSettingsConnectionInterface *connection, + const char *setting_name, + const char **hints, + gboolean request_new, + NMSettingsConnectionInterfaceGetSecretsFunc callback, + gpointer user_data); + + void (*emit_updated) (NMSettingsConnectionInterface *connection); + + /* Signals */ + /* 'new_settings' hash should *not* contain secrets */ + void (*updated) (NMSettingsConnectionInterface *connection, + GHashTable *new_settings); + + void (*removed) (NMSettingsConnectionInterface *connection); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +}; + +GType nm_settings_connection_interface_get_type (void); + +gboolean nm_settings_connection_interface_update (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceUpdateFunc callback, + gpointer user_data); + +gboolean nm_settings_connection_interface_delete (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceDeleteFunc callback, + gpointer user_data); + +gboolean nm_settings_connection_interface_get_secrets (NMSettingsConnectionInterface *connection, + const char *setting_name, + const char **hints, + gboolean request_new, + NMSettingsConnectionInterfaceGetSecretsFunc callback, + gpointer user_data); + +void nm_settings_connection_interface_emit_updated (NMSettingsConnectionInterface *connection); + +G_END_DECLS + +#endif /* __NM_SETTINGS_CONNECTION_INTERFACE_H__ */ + diff --git a/libnm-glib/nm-settings-interface.c b/libnm-glib/nm-settings-interface.c new file mode 100644 index 00000000..3bd4037a --- /dev/null +++ b/libnm-glib/nm-settings-interface.c @@ -0,0 +1,206 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#include "nm-settings-interface.h" + + +/** + * nm_settings_interface_error_quark: + * + * Setting error quark. + * + * Returns: the setting error quark + **/ +GQuark +nm_settings_interface_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-settings-interface-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_settings_interface_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* The connection was invalid. */ + ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, "InvalidConnection"), + /* The connection is read-only; modifications are not allowed. */ + ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_READ_ONLY_CONNECTION, "ReadOnlyConnection"), + /* A bug in the settings service caused the error. */ + ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, "InternalError"), + /* Retrieval or request of secrets failed. */ + ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_SECRETS_UNAVAILABLE, "SecretsUnavailable"), + /* The request for secrets was canceled. */ + ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_SECRETS_REQUEST_CANCELED, "SecretsRequestCanceled"), + /* The request could not be completed because permission was denied. */ + ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_PERMISSION_DENIED, "PermissionDenied"), + /* The requested setting does not existing in this connection. */ + ENUM_ENTRY (NM_SETTINGS_INTERFACE_ERROR_INVALID_SETTING, "InvalidSetting"), + { 0, 0, 0 }, + }; + etype = g_enum_register_static ("NMSettingsInterfaceError", values); + } + return etype; +} + + +/** + * nm_settings_list_connections: + * @settings: a object implementing %NMSettingsInterface + * + * Returns: all connections known to the object. + **/ +GSList * +nm_settings_interface_list_connections (NMSettingsInterface *settings) +{ + g_return_val_if_fail (settings != NULL, NULL); + g_return_val_if_fail (NM_IS_SETTINGS_INTERFACE (settings), NULL); + + if (NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->list_connections) + return NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->list_connections (settings); + return NULL; +} + +/** + * nm_settings_get_connection_by_path: + * @settings: a object implementing %NMSettingsInterface + * @path: the D-Bus object path of the remote connection + * + * Returns the object implementing %NMSettingsConnectionInterface at @path. + * + * Returns: the remote connection object on success, or NULL if the object was + * not known + **/ +NMSettingsConnectionInterface * +nm_settings_interface_get_connection_by_path (NMSettingsInterface *settings, + const char *path) +{ + g_return_val_if_fail (settings != NULL, NULL); + g_return_val_if_fail (NM_IS_SETTINGS_INTERFACE (settings), NULL); + g_return_val_if_fail (path != NULL, NULL); + + if (NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->get_connection_by_path) + return NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->get_connection_by_path (settings, path); + return NULL; +} + +/** + * nm_settings_interface_add_connection: + * @settings: a object implementing %NMSettingsInterface + * @connection: the settings to add; note that this object's settings will be + * added, not the object itself + * @callback: callback to be called when the add operation completes + * @user_data: caller-specific data passed to @callback + * + * Requests that the settings service add the given settings to a new connection. + * + * Returns: TRUE if the request was successful, FALSE if it failed + **/ +gboolean +nm_settings_interface_add_connection (NMSettingsInterface *settings, + NMConnection *connection, + NMSettingsAddConnectionFunc callback, + gpointer user_data) +{ + g_return_val_if_fail (settings != NULL, FALSE); + g_return_val_if_fail (NM_IS_SETTINGS_INTERFACE (settings), FALSE); + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + g_return_val_if_fail (callback != NULL, FALSE); + + if (NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->add_connection) { + return NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->add_connection (settings, + connection, + callback, + user_data); + } + return FALSE; +} + +/*****************************************************************/ + +static void +nm_settings_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 (NM_SETTINGS_INTERFACE_NEW_CONNECTION, + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSettingsInterface, new_connection), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_OBJECT); + + g_signal_new (NM_SETTINGS_INTERFACE_CONNECTIONS_READ, + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSettingsInterface, connections_read), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + initialized = TRUE; +} + +GType +nm_settings_interface_get_type (void) +{ + static GType settings_interface_type = 0; + + if (!settings_interface_type) { + const GTypeInfo settings_interface_info = { + sizeof (NMSettingsInterface), /* class_size */ + nm_settings_interface_init, /* base_init */ + NULL, /* base_finalize */ + NULL, + NULL, /* class_finalize */ + NULL, /* class_data */ + 0, + 0, /* n_preallocs */ + NULL + }; + + settings_interface_type = g_type_register_static (G_TYPE_INTERFACE, + "NMSettingsInterface", + &settings_interface_info, 0); + + g_type_interface_add_prerequisite (settings_interface_type, G_TYPE_OBJECT); + } + + return settings_interface_type; +} + diff --git a/libnm-glib/nm-settings-interface.h b/libnm-glib/nm-settings-interface.h new file mode 100644 index 00000000..5920bd82 --- /dev/null +++ b/libnm-glib/nm-settings-interface.h @@ -0,0 +1,109 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#ifndef NM_SETTINGS_INTERFACE_H +#define NM_SETTINGS_INTERFACE_H + +#include + +#include "NetworkManager.h" +#include "nm-settings-connection-interface.h" + +G_BEGIN_DECLS + +typedef enum { + NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION = 0, + NM_SETTINGS_INTERFACE_ERROR_READ_ONLY_CONNECTION, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + NM_SETTINGS_INTERFACE_ERROR_SECRETS_UNAVAILABLE, + NM_SETTINGS_INTERFACE_ERROR_SECRETS_REQUEST_CANCELED, + NM_SETTINGS_INTERFACE_ERROR_PERMISSION_DENIED, + NM_SETTINGS_INTERFACE_ERROR_INVALID_SETTING, +} NMSettingsInterfaceError; + +#define NM_SETTINGS_INTERFACE_ERROR (nm_settings_interface_error_quark ()) +GQuark nm_settings_interface_error_quark (void); + +#define NM_TYPE_SETTINGS_INTERFACE_ERROR (nm_settings_interface_error_get_type ()) +GType nm_settings_interface_error_get_type (void); + + +#define NM_TYPE_SETTINGS_INTERFACE (nm_settings_interface_get_type ()) +#define NM_SETTINGS_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_INTERFACE, NMSettingsInterface)) +#define NM_IS_SETTINGS_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS_INTERFACE)) +#define NM_SETTINGS_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_INTERFACE, NMSettingsInterface)) + +#define NM_SETTINGS_INTERFACE_NEW_CONNECTION "new-connection" +#define NM_SETTINGS_INTERFACE_CONNECTIONS_READ "connections-read" + +typedef struct _NMSettingsInterface NMSettingsInterface; + +typedef void (*NMSettingsAddConnectionFunc) (NMSettingsInterface *settings, + GError *error, + gpointer user_data); + +struct _NMSettingsInterface { + GTypeInterface g_iface; + + /* Methods */ + /* Returns a list of objects implementing NMSettingsConnectionInterface */ + GSList * (*list_connections) (NMSettingsInterface *settings); + + NMSettingsConnectionInterface * (*get_connection_by_path) (NMSettingsInterface *settings, + const char *path); + + gboolean (*add_connection) (NMSettingsInterface *settings, + NMConnection *connection, + NMSettingsAddConnectionFunc callback, + gpointer user_data); + + /* Signals */ + void (*new_connection) (NMSettingsInterface *settings, + NMSettingsConnectionInterface *connection); + + void (*connections_read) (NMSettingsInterface *settings); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +}; + +GType nm_settings_interface_get_type (void); + +/* Returns a list of objects implementing NMSettingsConnectionInterface */ +GSList *nm_settings_interface_list_connections (NMSettingsInterface *settings); + +NMSettingsConnectionInterface *nm_settings_interface_get_connection_by_path (NMSettingsInterface *settings, + const char *path); + +gboolean nm_settings_interface_add_connection (NMSettingsInterface *settings, + NMConnection *connection, + NMSettingsAddConnectionFunc callback, + gpointer user_data); + +G_END_DECLS + +#endif /* NM_SETTINGS_INTERFACE_H */ diff --git a/libnm-glib/nm-settings-service.c b/libnm-glib/nm-settings-service.c new file mode 100644 index 00000000..6266d10d --- /dev/null +++ b/libnm-glib/nm-settings-service.c @@ -0,0 +1,372 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2008 Novell, Inc. + * (C) Copyright 2008 - 2009 Red Hat, Inc. + */ + +#include +#include +#include + +#include "nm-settings-service.h" +#include "nm-settings-interface.h" +#include "nm-exported-connection.h" + +static gboolean impl_settings_list_connections (NMSettingsService *self, + GPtrArray **connections, + GError **error); + +static void impl_settings_add_connection (NMSettingsService *self, + GHashTable *settings, + DBusGMethodInvocation *context); + +#include "nm-settings-glue.h" + +static void settings_interface_init (NMSettingsInterface *class); + +G_DEFINE_TYPE_EXTENDED (NMSettingsService, nm_settings_service, G_TYPE_OBJECT, G_TYPE_FLAG_ABSTRACT, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_INTERFACE, settings_interface_init)) + +#define NM_SETTINGS_SERVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_SETTINGS_SERVICE, \ + NMSettingsServicePrivate)) + +typedef struct { + DBusGConnection *bus; + NMConnectionScope scope; + gboolean exported; + + gboolean disposed; +} NMSettingsServicePrivate; + +enum { + PROP_0, + PROP_BUS, + PROP_SCOPE, + + LAST_PROP +}; + + +/**************************************************************/ + +void +nm_settings_service_export (NMSettingsService *self) +{ + NMSettingsServicePrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_SETTINGS_SERVICE (self)); + + priv = NM_SETTINGS_SERVICE_GET_PRIVATE (self); + + g_return_if_fail (priv->bus != NULL); + + /* Don't allow exporting twice */ + g_return_if_fail (priv->exported == FALSE); + + dbus_g_connection_register_g_object (priv->bus, + NM_DBUS_PATH_SETTINGS, + G_OBJECT (self)); + priv->exported = TRUE; +} + +/**************************************************************/ + +static GSList * +list_connections (NMSettingsInterface *settings) +{ + /* Must always be implemented */ + g_assert (NM_SETTINGS_SERVICE_GET_CLASS (settings)->list_connections); + return NM_SETTINGS_SERVICE_GET_CLASS (settings)->list_connections (NM_SETTINGS_SERVICE (settings)); +} + +static gboolean +impl_settings_list_connections (NMSettingsService *self, + GPtrArray **connections, + GError **error) +{ + GSList *list = NULL, *iter; + + list = list_connections (NM_SETTINGS_INTERFACE (self)); + *connections = g_ptr_array_sized_new (g_slist_length (list) + 1); + for (iter = list; iter; iter = g_slist_next (iter)) { + g_ptr_array_add (*connections, + g_strdup (nm_connection_get_path (NM_CONNECTION (iter->data)))); + } + g_slist_free (list); + return TRUE; +} + +static NMSettingsConnectionInterface * +get_connection_by_path (NMSettingsInterface *settings, const char *path) +{ + NMExportedConnection *connection = NULL; + GSList *list = NULL, *iter; + + list = list_connections (settings); + for (iter = list; iter; iter = g_slist_next (iter)) { + if (!strcmp (nm_connection_get_path (NM_CONNECTION (iter->data)), path)) { + connection = NM_EXPORTED_CONNECTION (iter->data); + break; + } + } + g_slist_free (list); + + return (NMSettingsConnectionInterface *) connection; +} + +NMExportedConnection * +nm_settings_service_get_connection_by_path (NMSettingsService *self, + const char *path) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_SETTINGS_SERVICE (self), NULL); + + return (NMExportedConnection *) get_connection_by_path (NM_SETTINGS_INTERFACE (self), path); +} + +static gboolean +add_connection (NMSettingsInterface *settings, + NMConnection *connection, + NMSettingsAddConnectionFunc callback, + gpointer user_data) +{ + NMSettingsService *self = NM_SETTINGS_SERVICE (settings); + GError *error = NULL; + gboolean success = FALSE; + + if (NM_SETTINGS_SERVICE_GET_CLASS (self)->add_connection) { + NM_SETTINGS_SERVICE_GET_CLASS (self)->add_connection (NM_SETTINGS_SERVICE (self), + connection, + NULL, + callback, + user_data); + success = TRUE; + } else { + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s: %s:%d add_connection() not implemented", + __func__, __FILE__, __LINE__); + callback (settings, error, user_data); + g_error_free (error); + } + + return success; +} + +static void +dbus_add_connection_cb (NMSettingsInterface *settings, + GError *error, + gpointer user_data) +{ + DBusGMethodInvocation *context = user_data; + + if (error) + dbus_g_method_return_error (context, error); + else + dbus_g_method_return (context); +} + +static void +impl_settings_add_connection (NMSettingsService *self, + GHashTable *settings, + DBusGMethodInvocation *context) +{ + NMConnection *tmp; + GError *error = NULL; + + /* Check if the settings are valid first */ + tmp = nm_connection_new_from_hash (settings, &error); + if (!tmp) { + g_assert (error); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + if (NM_SETTINGS_SERVICE_GET_CLASS (self)->add_connection) { + NM_SETTINGS_SERVICE_GET_CLASS (self)->add_connection (NM_SETTINGS_SERVICE (self), + tmp, + context, + dbus_add_connection_cb, + context); + } else { + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s: %s:%d add_connection() not implemented", + __func__, __FILE__, __LINE__); + dbus_g_method_return_error (context, error); + g_error_free (error); + } + + g_object_unref (tmp); +} + +void +nm_settings_service_export_connection (NMSettingsService *self, + NMSettingsConnectionInterface *connection) +{ + NMSettingsServicePrivate *priv = NM_SETTINGS_SERVICE_GET_PRIVATE (self); + static guint32 ec_counter = 0; + char *path; + + g_return_if_fail (connection != NULL); + g_return_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection)); + g_return_if_fail (priv->bus != NULL); + + /* Don't allow exporting twice */ + g_return_if_fail (nm_connection_get_path (NM_CONNECTION (connection)) == NULL); + + path = g_strdup_printf ("%s/%u", NM_DBUS_PATH_SETTINGS, ec_counter++); + nm_connection_set_path (NM_CONNECTION (connection), path); + nm_connection_set_scope (NM_CONNECTION (connection), priv->scope); + + dbus_g_connection_register_g_object (priv->bus, path, G_OBJECT (connection)); + g_free (path); +} + +/**************************************************************/ + +static void +settings_interface_init (NMSettingsInterface *iface) +{ + /* interface implementation */ + iface->list_connections = list_connections; + iface->get_connection_by_path = get_connection_by_path; + iface->add_connection = add_connection; + + dbus_g_object_type_install_info (G_TYPE_FROM_INTERFACE (iface), + &dbus_glib_nm_settings_object_info); +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + + object = G_OBJECT_CLASS (nm_settings_service_parent_class)->constructor (type, n_construct_params, construct_params); + if (object) { + g_assert (NM_SETTINGS_SERVICE_GET_PRIVATE (object)->scope != NM_CONNECTION_SCOPE_UNKNOWN); + } + return object; +} + +static void +nm_settings_service_init (NMSettingsService *self) +{ +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingsServicePrivate *priv = NM_SETTINGS_SERVICE_GET_PRIVATE (object); + DBusGConnection *bus; + + switch (prop_id) { + case PROP_BUS: + /* Construct only */ + bus = g_value_get_boxed (value); + if (bus) + priv->bus = dbus_g_connection_ref (bus); + break; + case PROP_SCOPE: + /* Construct only */ + priv->scope = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingsServicePrivate *priv = NM_SETTINGS_SERVICE_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_BUS: + g_value_set_boxed (value, priv->bus); + break; + case PROP_SCOPE: + g_value_set_uint (value, priv->scope); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMSettingsServicePrivate *priv = NM_SETTINGS_SERVICE_GET_PRIVATE (object); + + if (!priv->disposed) { + priv->disposed = TRUE; + if (priv->bus) + dbus_g_connection_unref (priv->bus); + } + + G_OBJECT_CLASS (nm_settings_service_parent_class)->dispose (object); +} + +static void +nm_settings_service_class_init (NMSettingsServiceClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + g_type_class_add_private (class, sizeof (NMSettingsServicePrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->set_property = set_property; + + /** + * NMSettingsService:bus: + * + * The %DBusGConnection which this object is exported on + **/ + g_object_class_install_property (object_class, PROP_BUS, + g_param_spec_boxed (NM_SETTINGS_SERVICE_BUS, + "Bus", + "Bus", + DBUS_TYPE_G_CONNECTION, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + /** + * NMSettingsService:scope: + * + * The capabilities of the device. + **/ + g_object_class_install_property (object_class, PROP_SCOPE, + g_param_spec_uint (NM_SETTINGS_SERVICE_SCOPE, + "Scope", + "Scope", + NM_CONNECTION_SCOPE_SYSTEM, + NM_CONNECTION_SCOPE_USER, + NM_CONNECTION_SCOPE_USER, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +} diff --git a/libnm-glib/nm-settings-service.h b/libnm-glib/nm-settings-service.h new file mode 100644 index 00000000..9f4b95fc --- /dev/null +++ b/libnm-glib/nm-settings-service.h @@ -0,0 +1,82 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2009 Red Hat, Inc. + */ + +#ifndef NM_SETTINGS_SERVICE_H +#define NM_SETTINGS_SERVICE_H + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTINGS_SERVICE (nm_settings_service_get_type ()) +#define NM_SETTINGS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_SERVICE, NMSettingsService)) +#define NM_SETTINGS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTINGS_SERVICE, NMSettingsServiceClass)) +#define NM_IS_SETTINGS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS_SERVICE)) +#define NM_IS_SETTINGS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTINGS_SERVICE)) +#define NM_SETTINGS_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS_SERVICE, NMSettingsServiceClass)) + +#define NM_SETTINGS_SERVICE_BUS "bus" +#define NM_SETTINGS_SERVICE_SCOPE "scope" + +typedef struct { + GObject parent; +} NMSettingsService; + +typedef struct { + GObjectClass parent; + + /* Returned list must contain all NMExportedConnection objects exported + * by the settings service. The list (but not the NMExportedConnection + * objects) will be freed by caller. + */ + GSList * (*list_connections) (NMSettingsService *self); + + void (*add_connection) (NMSettingsService *self, + NMConnection *connection, + DBusGMethodInvocation *context, /* Only present for D-Bus calls */ + NMSettingsAddConnectionFunc callback, + gpointer user_data); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMSettingsServiceClass; + +GType nm_settings_service_get_type (void); + +NMExportedConnection *nm_settings_service_get_connection_by_path (NMSettingsService *self, + const char *path); + +void nm_settings_service_export (NMSettingsService *self); + +void nm_settings_service_export_connection (NMSettingsService *self, + NMSettingsConnectionInterface *exported); + +G_END_DECLS + +#endif /* NM_SETTINGS_SERVICE_H */ diff --git a/libnm-glib/nm-settings-system-interface.c b/libnm-glib/nm-settings-system-interface.c new file mode 100644 index 00000000..0f59377a --- /dev/null +++ b/libnm-glib/nm-settings-system-interface.c @@ -0,0 +1,150 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include "nm-settings-interface.h" +#include "nm-settings-system-interface.h" + + +/** + * nm_settings_system_interface_save_hostname: + * @settings: a object implementing %NMSettingsSystemInterface + * @hostname: the new persistent hostname to set, or NULL to clear any existing + * persistent hostname + * @callback: callback to be called when the hostname operation completes + * @user_data: caller-specific data passed to @callback + * + * Requests that the machine's persistent hostname be set to the specified value + * or cleared. + * + * Returns: TRUE if the request was successful, FALSE if it failed + **/ +gboolean +nm_settings_system_interface_save_hostname (NMSettingsSystemInterface *settings, + const char *hostname, + NMSettingsSystemSaveHostnameFunc callback, + gpointer user_data) +{ + g_return_val_if_fail (settings != NULL, FALSE); + g_return_val_if_fail (NM_IS_SETTINGS_SYSTEM_INTERFACE (settings), FALSE); + g_return_val_if_fail (hostname != NULL, FALSE); + g_return_val_if_fail (callback != NULL, FALSE); + + if (NM_SETTINGS_SYSTEM_INTERFACE_GET_INTERFACE (settings)->save_hostname) { + return NM_SETTINGS_SYSTEM_INTERFACE_GET_INTERFACE (settings)->save_hostname (settings, + hostname, + callback, + user_data); + } + return FALSE; +} + +/** + * nm_settings_system_interface_get_permissions: + * @settings: a object implementing %NMSettingsSystemInterface + * @callback: callback to be called when the permissions operation completes + * @user_data: caller-specific data passed to @callback + * + * Requests an indication of the operations the caller is permitted to perform + * including those that may require authorization. + * + * Returns: TRUE if the request was successful, FALSE if it failed + **/ +gboolean +nm_settings_system_interface_get_permissions (NMSettingsSystemInterface *settings, + NMSettingsSystemGetPermissionsFunc callback, + gpointer user_data) +{ + g_return_val_if_fail (settings != NULL, FALSE); + g_return_val_if_fail (NM_IS_SETTINGS_SYSTEM_INTERFACE (settings), FALSE); + g_return_val_if_fail (callback != NULL, FALSE); + + if (NM_SETTINGS_SYSTEM_INTERFACE_GET_INTERFACE (settings)->get_permissions) + return NM_SETTINGS_SYSTEM_INTERFACE_GET_INTERFACE (settings)->get_permissions (settings, callback, user_data); + return FALSE; +} + +static void +nm_settings_system_interface_init (gpointer g_iface) +{ + GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); + static gboolean initialized = FALSE; + + if (initialized) + return; + + /* Properties */ + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME, + "Hostname", + "Persistent hostname", + NULL, + G_PARAM_READABLE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_boolean (NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY, + "CanModify", + "Can modify anything (hostname, connections, etc)", + FALSE, + G_PARAM_READABLE)); + + /* Signals */ + g_signal_new (NM_SETTINGS_SYSTEM_INTERFACE_CHECK_PERMISSIONS, + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSettingsSystemInterface, check_permissions), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + initialized = TRUE; +} + +GType +nm_settings_system_interface_get_type (void) +{ + static GType itype = 0; + + if (!itype) { + const GTypeInfo iinfo = { + sizeof (NMSettingsSystemInterface), /* class_size */ + nm_settings_system_interface_init, /* base_init */ + NULL, /* base_finalize */ + NULL, + NULL, /* class_finalize */ + NULL, /* class_data */ + 0, + 0, /* n_preallocs */ + NULL + }; + + itype = g_type_register_static (G_TYPE_INTERFACE, + "NMSettingsSystemInterface", + &iinfo, 0); + + g_type_interface_add_prerequisite (itype, NM_TYPE_SETTINGS_INTERFACE); + } + + return itype; +} + diff --git a/libnm-glib/nm-settings-system-interface.h b/libnm-glib/nm-settings-system-interface.h new file mode 100644 index 00000000..d0165561 --- /dev/null +++ b/libnm-glib/nm-settings-system-interface.h @@ -0,0 +1,108 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2009 Red Hat, Inc. + */ + +#ifndef NM_SETTINGS_SYSTEM_INTERFACE_H +#define NM_SETTINGS_SYSTEM_INTERFACE_H + +#include + +#include "NetworkManager.h" + +G_BEGIN_DECLS + +typedef enum { + NM_SETTINGS_SYSTEM_PERMISSION_NONE = 0x0, + NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY = 0x1, + NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_PROTECTED = 0x2, + NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_OPEN = 0x4, + NM_SETTINGS_SYSTEM_PERMISSION_HOSTNAME_MODIFY = 0x8 +} NMSettingsSystemPermissions; + +#define NM_TYPE_SETTINGS_SYSTEM_INTERFACE (nm_settings_system_interface_get_type ()) +#define NM_SETTINGS_SYSTEM_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS_SYSTEM_INTERFACE, NMSettingsSystemInterface)) +#define NM_IS_SETTINGS_SYSTEM_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS_SYSTEM_INTERFACE)) +#define NM_SETTINGS_SYSTEM_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SETTINGS_SYSTEM_INTERFACE, NMSettingsSystemInterface)) + +#define NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME "hostname" +#define NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY "can-modify" + +#define NM_SETTINGS_SYSTEM_INTERFACE_CHECK_PERMISSIONS "check-permissions" + +typedef enum { + NM_SETTINGS_SYSTEM_INTERFACE_PROP_FIRST = 0x1000, + + NM_SETTINGS_SYSTEM_INTERFACE_PROP_HOSTNAME = NM_SETTINGS_SYSTEM_INTERFACE_PROP_FIRST, + NM_SETTINGS_SYSTEM_INTERFACE_PROP_CAN_MODIFY +} NMSettingsSystemInterfaceProp; + + +typedef struct _NMSettingsSystemInterface NMSettingsSystemInterface; + + +typedef void (*NMSettingsSystemSaveHostnameFunc) (NMSettingsSystemInterface *settings, + GError *error, + gpointer user_data); + +typedef void (*NMSettingsSystemGetPermissionsFunc) (NMSettingsSystemInterface *settings, + NMSettingsSystemPermissions permissions, + GError *error, + gpointer user_data); + +struct _NMSettingsSystemInterface { + GTypeInterface g_iface; + + /* Methods */ + gboolean (*save_hostname) (NMSettingsSystemInterface *settings, + const char *hostname, + NMSettingsSystemSaveHostnameFunc callback, + gpointer user_data); + + gboolean (*get_permissions) (NMSettingsSystemInterface *settings, + NMSettingsSystemGetPermissionsFunc callback, + gpointer user_data); + + /* Signals */ + void (*check_permissions) (NMSettingsSystemInterface *settings); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +}; + +GType nm_settings_system_interface_get_type (void); + +gboolean nm_settings_system_interface_save_hostname (NMSettingsSystemInterface *settings, + const char *hostname, + NMSettingsSystemSaveHostnameFunc callback, + gpointer user_data); + +gboolean nm_settings_system_interface_get_permissions (NMSettingsSystemInterface *settings, + NMSettingsSystemGetPermissionsFunc callback, + gpointer user_data); + +G_END_DECLS + +#endif /* NM_SETTINGS_SYSTEM_INTERFACE_H */ diff --git a/libnm-glib/nm-types-private.h b/libnm-glib/nm-types-private.h new file mode 100644 index 00000000..178890da --- /dev/null +++ b/libnm-glib/nm-types-private.h @@ -0,0 +1,39 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_TYPES_PRIVATE_H +#define NM_TYPES_PRIVATE_H + +#include +#include "nm-types.h" +#include "nm-object-private.h" + +gboolean _nm_ssid_demarshal (GValue *value, GByteArray **dest); +gboolean _nm_uint_array_demarshal (GValue *value, GArray **dest); +gboolean _nm_string_array_demarshal (GValue *value, GPtrArray **dest); +gboolean _nm_object_array_demarshal (GValue *value, + GPtrArray **dest, + DBusGConnection *connection, + NMObjectCreatorFunc func); +gboolean _nm_ip6_address_array_demarshal (GValue *value, GSList **dest); + +#endif /* NM_TYPES_PRIVATE_H */ diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c new file mode 100644 index 00000000..cf9e084c --- /dev/null +++ b/libnm-glib/nm-types.c @@ -0,0 +1,423 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include +#include +#include +#include "nm-types.h" +#include "nm-types-private.h" +#include "nm-object-private.h" +#include "nm-object-cache.h" +#include "nm-dbus-glib-types.h" +#include "nm-setting-ip6-config.h" + +static gpointer +nm_ssid_copy (GByteArray *src) +{ + GByteArray *dest; + + dest = g_byte_array_sized_new (src->len); + g_byte_array_append (dest, src->data, src->len); + return dest; +} + +static void +nm_ssid_free (GByteArray *ssid) +{ + g_byte_array_free (ssid, TRUE); +} + +GType +nm_ssid_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static (g_intern_static_string ("nm-ssid"), + (GBoxedCopyFunc) nm_ssid_copy, + (GBoxedFreeFunc) nm_ssid_free); + return our_type; +} + +gboolean +_nm_ssid_demarshal (GValue *value, GByteArray **dest) +{ + GByteArray *array; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_UCHAR_ARRAY)) + return FALSE; + + if (*dest) { + g_boxed_free (NM_TYPE_SSID, *dest); + *dest = NULL; + } + + array = (GByteArray *) g_value_get_boxed (value); + if (array && (array->len > 0)) { + *dest = g_byte_array_sized_new (array->len); + (*dest)->len = array->len; + memcpy ((*dest)->data, array->data, array->len); + } + + return TRUE; +} + +/*****************************/ + +static gpointer +nm_uint_array_copy (GArray *src) +{ + GArray *dest; + + dest = g_array_sized_new (FALSE, TRUE, sizeof (guint32), src->len); + g_array_append_vals (dest, src->data, src->len); + return dest; +} + +static void +nm_uint_array_free (GArray *array) +{ + g_array_free (array, TRUE); +} + +GType +nm_uint_array_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static (g_intern_static_string ("nm-uint-array"), + (GBoxedCopyFunc) nm_uint_array_copy, + (GBoxedFreeFunc) nm_uint_array_free); + return our_type; +} + +gboolean +_nm_uint_array_demarshal (GValue *value, GArray **dest) +{ + GArray *array; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_UINT_ARRAY)) + return FALSE; + + if (*dest) { + g_boxed_free (NM_TYPE_UINT_ARRAY, *dest); + *dest = NULL; + } + + array = (GArray *) g_value_get_boxed (value); + if (array && (array->len > 0)) { + *dest = g_array_sized_new (FALSE, TRUE, sizeof (guint32), array->len); + g_array_append_vals (*dest, array->data, array->len); + } + + return TRUE; +} + +/*****************************/ + +static gpointer +nm_string_array_copy (GPtrArray *src) +{ + GPtrArray *dest; + int i; + + dest = g_ptr_array_sized_new (src->len); + for (i = 0; i < src->len; i++) + g_ptr_array_add (dest, g_strdup (g_ptr_array_index (src, i))); + return dest; +} + +static void +nm_string_array_free (GPtrArray *array) +{ + int i; + + for (i = 0; i < array->len; i++) + g_free (g_ptr_array_index (array, i)); + g_ptr_array_free (array, TRUE); +} + +GType +nm_string_array_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static (g_intern_static_string ("nm-string-array"), + (GBoxedCopyFunc) nm_string_array_copy, + (GBoxedFreeFunc) nm_string_array_free); + return our_type; +} + +gboolean +_nm_string_array_demarshal (GValue *value, GPtrArray **dest) +{ + GPtrArray *array; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_STRING)) + return FALSE; + + if (*dest) { + g_boxed_free (NM_TYPE_STRING_ARRAY, *dest); + *dest = NULL; + } + + array = (GPtrArray *) g_value_get_boxed (value); + if (array && array->len) { + int i; + + *dest = g_ptr_array_sized_new (array->len); + for (i = 0; i < array->len; i++) + g_ptr_array_add (*dest, g_strdup (g_ptr_array_index (array, i))); + } + + return TRUE; +} + +/*****************************/ + +static gpointer +nm_object_array_copy (GPtrArray *src) +{ + GPtrArray *dest; + int i; + + dest = g_ptr_array_sized_new (src->len); + for (i = 0; i < src->len; i++) + g_ptr_array_add (dest, g_object_ref (g_ptr_array_index (src, i))); + return dest; +} + +static void +nm_object_array_free (GPtrArray *array) +{ + int i; + + for (i = 0; i < array->len; i++) + g_object_unref (g_ptr_array_index (array, i)); + g_ptr_array_free (array, TRUE); +} + +GType +nm_object_array_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static (g_intern_static_string ("nm-object-array"), + (GBoxedCopyFunc) nm_object_array_copy, + (GBoxedFreeFunc) nm_object_array_free); + return our_type; +} + +gboolean +_nm_object_array_demarshal (GValue *value, + GPtrArray **dest, + DBusGConnection *connection, + NMObjectCreatorFunc func) +{ + GPtrArray *temp = NULL; + GPtrArray *array; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH)) + return FALSE; + + array = (GPtrArray *) g_value_get_boxed (value); + if (array && array->len) { + int i; + + temp = g_ptr_array_sized_new (array->len); + for (i = 0; i < array->len; i++) { + const char *path; + GObject *object; + + path = g_ptr_array_index (array, i); + object = G_OBJECT (_nm_object_cache_get (path)); + if (object) { + g_ptr_array_add (temp, g_object_ref (object)); + } else { + object = (*func) (connection, path); + if (object) + g_ptr_array_add (temp, object); + else + g_warning ("%s: couldn't create object for %s", __func__, path); + } + } + } else + temp = g_ptr_array_new (); + + /* Deallocate after to ensure that an object that might already + * be in the array doesn't get destroyed due to refcounting. + */ + if (*dest) + g_boxed_free (NM_TYPE_OBJECT_ARRAY, *dest); + *dest = temp; + + return TRUE; +} + +/*****************************/ + +static gpointer +nm_ip6_address_object_array_copy (GPtrArray *src) +{ + GPtrArray *dest; + int i; + + dest = g_ptr_array_sized_new (src->len); + for (i = 0; i < src->len; i++) + g_ptr_array_add (dest, nm_ip6_address_dup (g_ptr_array_index (src, i))); + return dest; +} + +static void +nm_ip6_address_object_array_free (GPtrArray *array) +{ + int i; + + for (i = 0; i < array->len; i++) + nm_ip6_address_unref (g_ptr_array_index (array, i)); + g_ptr_array_free (array, TRUE); +} + +GType +nm_ip6_address_object_array_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static (g_intern_static_string ("nm-ip6-address-object-array"), + (GBoxedCopyFunc) nm_ip6_address_object_array_copy, + (GBoxedFreeFunc) nm_ip6_address_object_array_free); + return our_type; +} + +/*****************************/ + +static gpointer +nm_ip6_address_array_copy (GPtrArray *src) +{ + GPtrArray *dest; + int i; + + dest = g_ptr_array_sized_new (src->len); + for (i = 0; i < src->len; i++) { + struct in6_addr *addr = g_ptr_array_index (src, i); + struct in6_addr *dup; + + dup = g_malloc0 (sizeof (struct in6_addr)); + memcpy (dup, addr, sizeof (struct in6_addr)); + g_ptr_array_add (dest, dup); + } + return dest; +} + +static void +nm_ip6_address_array_free (GPtrArray *array) +{ + int i; + + for (i = 0; i < array->len; i++) + g_free (g_ptr_array_index (array, i)); + g_ptr_array_free (array, TRUE); +} + +GType +nm_ip6_address_array_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static (g_intern_static_string ("nm-ip6-address-array"), + (GBoxedCopyFunc) nm_ip6_address_array_copy, + (GBoxedFreeFunc) nm_ip6_address_array_free); + return our_type; +} + +gboolean +_nm_ip6_address_array_demarshal (GValue *value, GSList **dest) +{ + GPtrArray *array; + + if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR)) + return FALSE; + + if (*dest) { + g_slist_foreach (*dest, (GFunc) g_free, NULL); + g_slist_free (*dest); + *dest = NULL; + } + + array = (GPtrArray *) g_value_get_boxed (value); + if (array && array->len) { + int i; + + for (i = 0; i < array->len; i++) { + GByteArray *bytearray = (GByteArray *) g_ptr_array_index (array, i); + struct in6_addr *addr; + + addr = g_malloc0 (sizeof (struct in6_addr)); + memcpy (addr->s6_addr, bytearray->data, bytearray->len); + *dest = g_slist_append (*dest, addr); + } + } + + return TRUE; +} + +/*****************************/ + +static gpointer +nm_ip6_route_object_array_copy (GPtrArray *src) +{ + GPtrArray *dest; + int i; + + dest = g_ptr_array_sized_new (src->len); + for (i = 0; i < src->len; i++) + g_ptr_array_add (dest, nm_ip6_route_dup (g_ptr_array_index (src, i))); + return dest; +} + +static void +nm_ip6_route_object_array_free (GPtrArray *array) +{ + int i; + + for (i = 0; i < array->len; i++) + nm_ip6_route_unref (g_ptr_array_index (array, i)); + g_ptr_array_free (array, TRUE); +} + +GType +nm_ip6_route_object_array_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static (g_intern_static_string ("nm-ip6-route-object-array"), + (GBoxedCopyFunc) nm_ip6_route_object_array_copy, + (GBoxedFreeFunc) nm_ip6_route_object_array_free); + return our_type; +} + diff --git a/libnm-glib/nm-types.h b/libnm-glib/nm-types.h new file mode 100644 index 00000000..cb1bf872 --- /dev/null +++ b/libnm-glib/nm-types.h @@ -0,0 +1,54 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_TYPES_H +#define NM_TYPES_H + +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SSID (nm_ssid_get_type ()) +GType nm_ssid_get_type (void) G_GNUC_CONST; + +#define NM_TYPE_UINT_ARRAY (nm_uint_array_get_type ()) +GType nm_uint_array_get_type (void) G_GNUC_CONST; + +#define NM_TYPE_STRING_ARRAY (nm_string_array_get_type ()) +GType nm_string_array_get_type (void) G_GNUC_CONST; + +#define NM_TYPE_OBJECT_ARRAY (nm_object_array_get_type ()) +GType nm_object_array_get_type (void) G_GNUC_CONST; + +#define NM_TYPE_IP6_ADDRESS_OBJECT_ARRAY (nm_ip6_address_object_array_get_type ()) +GType nm_ip6_address_object_array_get_type (void) G_GNUC_CONST; + +#define NM_TYPE_IP6_ADDRESS_ARRAY (nm_ip6_address_array_get_type ()) +GType nm_ip6_address_array_get_type (void) G_GNUC_CONST; + +#define NM_TYPE_IP6_ROUTE_OBJECT_ARRAY (nm_ip6_route_object_array_get_type ()) +GType nm_ip6_route_object_array_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* NM_TYPES_H */ diff --git a/libnm-glib/nm-vpn-connection.c b/libnm-glib/nm-vpn-connection.c new file mode 100644 index 00000000..6910b6f6 --- /dev/null +++ b/libnm-glib/nm-vpn-connection.c @@ -0,0 +1,257 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#include +#include "nm-vpn-connection.h" +#include "NetworkManager.h" +#include "nm-utils.h" +#include "nm-vpn-connection-bindings.h" +#include "nm-marshal.h" +#include "nm-object-private.h" +#include "nm-active-connection.h" + +G_DEFINE_TYPE (NMVPNConnection, nm_vpn_connection, NM_TYPE_ACTIVE_CONNECTION) + +#define NM_VPN_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_CONNECTION, NMVPNConnectionPrivate)) + +typedef struct { + DBusGProxy *proxy; + char *banner; + NMVPNConnectionState vpn_state; +} NMVPNConnectionPrivate; + +enum { + PROP_0, + PROP_VPN_STATE, + PROP_BANNER, + + LAST_PROP +}; + +#define DBUS_PROP_VPN_STATE "VpnState" +#define DBUS_PROP_BANNER "Banner" + +enum { + VPN_STATE_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + +GObject * +nm_vpn_connection_new (DBusGConnection *dbus_connection, const char *path) +{ + g_return_val_if_fail (dbus_connection != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + + return g_object_new (NM_TYPE_VPN_CONNECTION, + NM_OBJECT_DBUS_CONNECTION, dbus_connection, + NM_OBJECT_DBUS_PATH, path, + NULL); +} + +const char * +nm_vpn_connection_get_banner (NMVPNConnection *vpn) +{ + NMVPNConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_VPN_CONNECTION (vpn), NULL); + + priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn); + if (priv->vpn_state != NM_VPN_CONNECTION_STATE_ACTIVATED) + return NULL; + + if (!priv->banner) { + priv->banner = _nm_object_get_string_property (NM_OBJECT (vpn), + NM_DBUS_INTERFACE_VPN_CONNECTION, + DBUS_PROP_BANNER); + if (priv->banner && !strlen (priv->banner)) { + g_free (priv->banner); + priv->banner = NULL; + } + } + return priv->banner; +} + +NMVPNConnectionState +nm_vpn_connection_get_vpn_state (NMVPNConnection *vpn) +{ + NMVPNConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_VPN_CONNECTION (vpn), NM_VPN_CONNECTION_STATE_UNKNOWN); + + priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn); + if (priv->vpn_state == NM_VPN_CONNECTION_STATE_UNKNOWN) { + priv->vpn_state = _nm_object_get_uint_property (NM_OBJECT (vpn), + NM_DBUS_INTERFACE_VPN_CONNECTION, + DBUS_PROP_VPN_STATE); + } + return priv->vpn_state; +} + +static void +vpn_state_changed_proxy (DBusGProxy *proxy, + NMVPNConnectionState vpn_state, + NMVPNConnectionStateReason reason, + gpointer user_data) +{ + NMVPNConnection *connection = NM_VPN_CONNECTION (user_data); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + if (priv->vpn_state != vpn_state) { + priv->vpn_state = vpn_state; + g_signal_emit (connection, signals[VPN_STATE_CHANGED], 0, vpn_state, reason); + } +} + +/*****************************************************************************/ + +static void +nm_vpn_connection_init (NMVPNConnection *connection) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + priv->vpn_state = NM_VPN_CONNECTION_STATE_UNKNOWN; +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + NMObject *object; + NMVPNConnectionPrivate *priv; + + object = (NMObject *) G_OBJECT_CLASS (nm_vpn_connection_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_VPN_CONNECTION_GET_PRIVATE (object); + + priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object), + NM_DBUS_SERVICE, + nm_object_get_path (object), + NM_DBUS_INTERFACE_VPN_CONNECTION); + + dbus_g_object_register_marshaller (_nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, + G_TYPE_UINT, G_TYPE_UINT, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->proxy, "VpnStateChanged", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, + "VpnStateChanged", + G_CALLBACK (vpn_state_changed_proxy), + object, + NULL); + return G_OBJECT (object); +} + +static void +finalize (GObject *object) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object); + + if (priv->banner) + g_free (priv->banner); + + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_vpn_connection_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMVPNConnection *self = NM_VPN_CONNECTION (object); + + switch (prop_id) { + case PROP_VPN_STATE: + g_value_set_uint (value, nm_vpn_connection_get_vpn_state (self)); + break; + case PROP_BANNER: + g_value_set_string (value, nm_vpn_connection_get_banner (self)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_vpn_connection_class_init (NMVPNConnectionClass *connection_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (connection_class); + + g_type_class_add_private (connection_class, sizeof (NMVPNConnectionPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMVPNConnection:vpn-state: + * + * The VPN state of the active VPN connection. + **/ + g_object_class_install_property (object_class, PROP_VPN_STATE, + g_param_spec_uint (NM_VPN_CONNECTION_VPN_STATE, + "VpnState", + "Current VPN state", + NM_VPN_CONNECTION_STATE_UNKNOWN, + NM_VPN_CONNECTION_STATE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_UNKNOWN, + G_PARAM_READABLE)); + + /** + * NMVPNConnection:banner: + * + * The VPN login banner of the active VPN connection. + **/ + g_object_class_install_property (object_class, PROP_BANNER, + g_param_spec_string (NM_VPN_CONNECTION_BANNER, + "Banner", + "Login Banner", + NULL, + G_PARAM_READABLE)); + + /* signals */ + signals[VPN_STATE_CHANGED] = + g_signal_new ("vpn-state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNConnectionClass, vpn_state_changed), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); +} diff --git a/libnm-glib/nm-vpn-connection.h b/libnm-glib/nm-vpn-connection.h new file mode 100644 index 00000000..e03a80c7 --- /dev/null +++ b/libnm-glib/nm-vpn-connection.h @@ -0,0 +1,75 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#ifndef NM_VPN_CONNECTION_H +#define NM_VPN_CONNECTION_H + +#include +#include +#include +#include "nm-active-connection.h" +#include "NetworkManagerVPN.h" + +G_BEGIN_DECLS + +#define NM_TYPE_VPN_CONNECTION (nm_vpn_connection_get_type ()) +#define NM_VPN_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_CONNECTION, NMVPNConnection)) +#define NM_VPN_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_CONNECTION, NMVPNConnectionClass)) +#define NM_IS_VPN_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_CONNECTION)) +#define NM_IS_VPN_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_VPN_CONNECTION)) +#define NM_VPN_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_CONNECTION, NMVPNConnectionClass)) + +#define NM_VPN_CONNECTION_VPN_STATE "vpn-state" +#define NM_VPN_CONNECTION_BANNER "banner" + +typedef struct { + NMActiveConnection parent; +} NMVPNConnection; + +typedef struct { + NMActiveConnectionClass parent; + + /* Signals */ + void (*vpn_state_changed) (NMVPNConnection *connection, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMVPNConnectionClass; + +GType nm_vpn_connection_get_type (void); + +GObject * nm_vpn_connection_new (DBusGConnection *dbus_connection, const char *path); + +NMVPNConnectionState nm_vpn_connection_get_vpn_state (NMVPNConnection *vpn); +const char * nm_vpn_connection_get_banner (NMVPNConnection *vpn); + +G_END_DECLS + +#endif /* NM_VPN_CONNECTION_H */ diff --git a/libnm-glib/nm-vpn-plugin-ui-interface.c b/libnm-glib/nm-vpn-plugin-ui-interface.c new file mode 100644 index 00000000..ca3b738a --- /dev/null +++ b/libnm-glib/nm-vpn-plugin-ui-interface.c @@ -0,0 +1,245 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 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 */ + g_object_interface_install_property (g_iface, + g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_NAME, + "Name", + "VPN Plugin name", + NULL, + G_PARAM_READABLE)); + + g_object_interface_install_property (g_iface, + g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_DESC, + "Desc", + "VPN Plugin description", + NULL, + G_PARAM_READABLE)); + + g_object_interface_install_property (g_iface, + g_param_spec_string (NM_VPN_PLUGIN_UI_INTERFACE_SERVICE, + "Service", + "VPN Plugin D-Bus service name", + NULL, + G_PARAM_READABLE)); + + 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; +} + + +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); +} + +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 != NULL, NULL); + return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->import (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 != NULL, FALSE); + return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->export (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; +} + +gboolean +nm_vpn_plugin_ui_interface_delete_connection (NMVpnPluginUiInterface *iface, + NMConnection *connection, + GError **error) +{ + g_return_val_if_fail (NM_IS_VPN_PLUGIN_UI_INTERFACE (iface), FALSE); + + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + return NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE (iface)->delete_connection (iface, connection, error); +} + + +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; +} + +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); +} + +gboolean +nm_vpn_plugin_ui_widget_interface_save_secrets (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)->save_secrets (iface, connection, error); +} + diff --git a/libnm-glib/nm-vpn-plugin-ui-interface.h b/libnm-glib/nm-vpn-plugin-ui-interface.h new file mode 100644 index 00000000..44348c12 --- /dev/null +++ b/libnm-glib/nm-vpn-plugin-ui-interface.h @@ -0,0 +1,204 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_VPN_PLUGIN_UI_INTERFACE_H +#define NM_VPN_PLUGIN_UI_INTERFACE_H + +#include +#include +#include + +G_BEGIN_DECLS + +typedef struct _NMVpnPluginUiInterface NMVpnPluginUiInterface; +typedef struct _NMVpnPluginUiWidgetInterface NMVpnPluginUiWidgetInterface; + +/* Plugin's factory function that returns a GObject that implements + * NMVpnPluginUiInterface. + */ +typedef NMVpnPluginUiInterface * (*NMVpnPluginUiFactory) (GError **error); +NMVpnPluginUiInterface *nm_vpn_plugin_ui_factory (GError **error); + + +/**************************************************/ +/* 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)) + +#define NM_VPN_PLUGIN_UI_CAPABILITY_NONE 0x00 +#define NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT 0x01 +#define NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT 0x02 + +/* Short display name of the VPN plugin */ +#define NM_VPN_PLUGIN_UI_INTERFACE_NAME "name" + +/* Longer description of the 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" + +typedef enum { + NM_VPN_PLUGIN_UI_INTERFACE_PROP_FIRST = 0x1000, + + 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) (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) (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); + + /* Called when the user has chosen to remove the connection (for user + * connections only; system connections are handled by the system + * settings service). Should clear out any VPN-specific secrets or data + * related to the connection. + */ + gboolean (*delete_connection) (NMVpnPluginUiInterface *iface, NMConnection *connection, GError **error); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +}; + +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); + +gboolean nm_vpn_plugin_ui_interface_delete_connection (NMVpnPluginUiInterface *iface, + NMConnection *connection, + GError **error); + + +/**************************************************/ +/* 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); + + /* Called when the user has chosen to save the connection (for user + * connections only; system connections are handled by the system + * settings service). Should save VPN-specific connection secrets in + * a way that the auth-dialog can read them. + */ + gboolean (*save_secrets) (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); + +gboolean nm_vpn_plugin_ui_widget_interface_save_secrets (NMVpnPluginUiWidgetInterface *iface, + NMConnection *connection, + GError **error); + +G_END_DECLS + +#endif /* NM_VPN_PLUGIN_UI_INTERFACE_H */ diff --git a/libnm-glib/nm-vpn-plugin.c b/libnm-glib/nm-vpn-plugin.c new file mode 100644 index 00000000..fe7a2b63 --- /dev/null +++ b/libnm-glib/nm-vpn-plugin.c @@ -0,0 +1,807 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include +#include "nm-glib-compat.h" +#include "nm-vpn-plugin.h" +#include "nm-utils.h" +#include "nm-connection.h" +#include "nm-dbus-glib-types.h" + +static gboolean impl_vpn_plugin_connect (NMVPNPlugin *plugin, + GHashTable *connection, + GError **err); + +static gboolean impl_vpn_plugin_need_secrets (NMVPNPlugin *plugin, + GHashTable *connection, + char **service_name, + GError **err); + +static gboolean impl_vpn_plugin_disconnect (NMVPNPlugin *plugin, + GError **err); + +static gboolean impl_vpn_plugin_set_ip4_config (NMVPNPlugin *plugin, + GHashTable *config, + GError **err); + +static gboolean impl_vpn_plugin_set_failure (NMVPNPlugin *plugin, + char *reason, + GError **err); + +#include "nm-vpn-plugin-glue.h" + +#define NM_VPN_PLUGIN_CONNECT_TIMER 60 +#define NM_VPN_PLUGIN_QUIT_TIMER 20 + +G_DEFINE_ABSTRACT_TYPE (NMVPNPlugin, nm_vpn_plugin, G_TYPE_OBJECT) + +typedef struct { + NMVPNServiceState state; + + /* DBUS-y stuff */ + DBusGConnection *connection; + char *dbus_service_name; + + /* GObject-y stuff */ + gboolean disposed; + + /* Temporary stuff */ + guint connect_timer; + guint quit_timer; + guint fail_stop_id; +} NMVPNPluginPrivate; + +#define NM_VPN_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_PLUGIN, NMVPNPluginPrivate)) + +enum { + STATE_CHANGED, + IP4_CONFIG, + LOGIN_BANNER, + FAILURE, + QUIT, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_DBUS_SERVICE_NAME, + PROP_STATE, + + LAST_PROP +}; + +static GSList *active_plugins = NULL; + + +GQuark +nm_vpn_plugin_error_quark (void) +{ + static GQuark quark = 0; + + if (!quark) + quark = g_quark_from_static_string ("nm_vpn_plugin_error"); + + return quark; +} + +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_vpn_plugin_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_GENERAL, "General"), + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_STARTING_IN_PROGRESS, "StartingInProgress"), + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_ALREADY_STARTED, "AlreadyStarted"), + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_STOPPING_IN_PROGRESS, "StoppingInProgress"), + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_ALREADY_STOPPED, "AlreadyStopped"), + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_WRONG_STATE, "WrongState"), + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, "BadArguments"), + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED, "LaunchFailed"), + ENUM_ENTRY (NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + { 0, 0, 0 } + }; + + etype = g_enum_register_static ("NMVPNPluginError", values); + } + + return etype; +} + + +static void +nm_vpn_plugin_set_connection (NMVPNPlugin *plugin, + DBusGConnection *connection) +{ + NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin); + + if (priv->connection) + dbus_g_connection_unref (priv->connection); + + priv->connection = connection; +} + +DBusGConnection * +nm_vpn_plugin_get_connection (NMVPNPlugin *plugin) +{ + DBusGConnection *connection; + + g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), NULL); + + connection = NM_VPN_PLUGIN_GET_PRIVATE (plugin)->connection; + + if (connection) + dbus_g_connection_ref (connection); + + return connection; +} + +NMVPNServiceState +nm_vpn_plugin_get_state (NMVPNPlugin *plugin) +{ + g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), NM_VPN_SERVICE_STATE_UNKNOWN); + + return NM_VPN_PLUGIN_GET_PRIVATE (plugin)->state; +} + +void +nm_vpn_plugin_set_state (NMVPNPlugin *plugin, + NMVPNServiceState state) +{ + NMVPNPluginPrivate *priv; + + g_return_if_fail (NM_IS_VPN_PLUGIN (plugin)); + + priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin); + if (priv->state != state) { + priv->state = state; + g_signal_emit (plugin, signals[STATE_CHANGED], 0, state); + } +} + +void +nm_vpn_plugin_set_login_banner (NMVPNPlugin *plugin, + const char *banner) +{ + g_return_if_fail (NM_IS_VPN_PLUGIN (plugin)); + g_return_if_fail (banner != NULL); + + g_signal_emit (plugin, signals[LOGIN_BANNER], 0, banner); +} + +void +nm_vpn_plugin_failure (NMVPNPlugin *plugin, + NMVPNPluginFailure reason) +{ + g_return_if_fail (NM_IS_VPN_PLUGIN (plugin)); + + g_signal_emit (plugin, signals[FAILURE], 0, reason); +} + +gboolean +nm_vpn_plugin_disconnect (NMVPNPlugin *plugin, GError **err) +{ + gboolean ret = FALSE; + NMVPNServiceState state; + + g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), FALSE); + + state = nm_vpn_plugin_get_state (plugin); + switch (state) { + case NM_VPN_SERVICE_STATE_STOPPING: + g_set_error (err, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_STOPPING_IN_PROGRESS, + "%s", + "Could not process the request because the VPN connection is already being stopped."); + break; + case NM_VPN_SERVICE_STATE_STOPPED: + g_set_error (err, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_ALREADY_STOPPED, + "%s", + "Could not process the request because no VPN connection was active."); + break; + case NM_VPN_SERVICE_STATE_STARTING: + case NM_VPN_SERVICE_STATE_STARTED: + nm_vpn_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPING); + ret = NM_VPN_PLUGIN_GET_CLASS (plugin)->disconnect (plugin, err); + nm_vpn_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPED); + break; + case NM_VPN_SERVICE_STATE_INIT: + ret = TRUE; + break; + + default: + g_warning ("Unhandled VPN service state %d", state); + g_assert_not_reached (); + break; + } + + return ret; +} + +static void +nm_vpn_plugin_emit_quit (NMVPNPlugin *plugin) +{ + g_signal_emit (plugin, signals[QUIT], 0); +} + +static gboolean +connect_timer_expired (gpointer data) +{ + NMVPNPlugin *plugin = NM_VPN_PLUGIN (data); + GError *err = NULL; + + nm_info ("Connect timer expired, disconnecting."); + nm_vpn_plugin_disconnect (plugin, &err); + if (err) { + nm_warning ("Disconnect failed: %s", err->message); + g_error_free (err); + } + + return FALSE; +} + +static gboolean +quit_timer_expired (gpointer data) +{ + NMVPNPlugin *plugin = NM_VPN_PLUGIN (data); + + nm_vpn_plugin_emit_quit (plugin); + + return FALSE; +} + +static gboolean +fail_stop (gpointer data) +{ + NMVPNPlugin *plugin = NM_VPN_PLUGIN (data); + + nm_vpn_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPED); + return FALSE; +} + +static gboolean +nm_vpn_plugin_connect (NMVPNPlugin *plugin, + NMConnection *connection, + GError **err) +{ + NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin); + gboolean ret = FALSE; + NMVPNServiceState state; + + g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), FALSE); + + state = nm_vpn_plugin_get_state (plugin); + switch (state) { + case NM_VPN_SERVICE_STATE_STARTING: + g_set_error (err, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_STARTING_IN_PROGRESS, + "%s", + "Could not process the request because the VPN connection is already being started."); + break; + case NM_VPN_SERVICE_STATE_STARTED: + g_set_error (err, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_ALREADY_STARTED, + "%s", + "Could not process the request because a VPN connection was already active."); + break; + case NM_VPN_SERVICE_STATE_STOPPING: + g_set_error (err, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_STOPPING_IN_PROGRESS, + "%s", + "Could not process the request because the VPN connection is being stopped."); + break; + case NM_VPN_SERVICE_STATE_STOPPED: + case NM_VPN_SERVICE_STATE_INIT: + nm_vpn_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STARTING); + ret = NM_VPN_PLUGIN_GET_CLASS (plugin)->connect (plugin, connection, err); + if (!ret) { + /* Stop the plugin from and idle handler so that the Connect + * method return gets sent before the STOP StateChanged signal. + */ + if (priv->fail_stop_id) + g_source_remove (priv->fail_stop_id); + priv->fail_stop_id = g_idle_add (fail_stop, plugin); + } + break; + + default: + g_assert_not_reached (); + break; + } + + return ret; +} + +void +nm_vpn_plugin_set_ip4_config (NMVPNPlugin *plugin, + GHashTable *ip4_config) +{ + g_return_if_fail (NM_IS_VPN_PLUGIN (plugin)); + g_return_if_fail (ip4_config != NULL); + + g_signal_emit (plugin, signals[IP4_CONFIG], 0, ip4_config); + + nm_vpn_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STARTED); +} + + +static gboolean +impl_vpn_plugin_connect (NMVPNPlugin *plugin, + GHashTable *properties, + GError **error) +{ + NMConnection *connection; + gboolean success = FALSE; + + connection = nm_connection_new_from_hash (properties, error); + if (!connection) { + nm_warning ("%s: Invalid connection: '%s' / '%s' invalid: %d", + __func__, + g_type_name (nm_connection_lookup_setting_type_by_quark ((*error)->domain)), + (*error)->message, + (*error)->code); + } else { + success = nm_vpn_plugin_connect (plugin, connection, error); + g_object_unref (connection); + } + + return success; +} + +static gboolean +impl_vpn_plugin_need_secrets (NMVPNPlugin *plugin, + GHashTable *properties, + char **setting_name, + GError **err) +{ + gboolean ret = FALSE; + NMConnection *connection; + char *sn = NULL; + GError *ns_err = NULL; + gboolean needed = FALSE; + GError *cnfh_err = NULL; + + g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), FALSE); + g_return_val_if_fail (properties != NULL, FALSE); + + connection = nm_connection_new_from_hash (properties, &cnfh_err); + if (!connection) { + g_set_error (err, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID, + "The connection was invalid: '%s' / '%s' invalid: %d.", + g_type_name (nm_connection_lookup_setting_type_by_quark (cnfh_err->domain)), + cnfh_err->message, cnfh_err->code); + g_error_free (cnfh_err); + return FALSE; + } + + if (!NM_VPN_PLUGIN_GET_CLASS (plugin)->need_secrets) { + *setting_name = ""; + ret = TRUE; + goto out; + } + + needed = NM_VPN_PLUGIN_GET_CLASS (plugin)->need_secrets (plugin, connection, &sn, &ns_err); + if (ns_err) { + *err = g_error_copy (ns_err); + g_error_free (ns_err); + goto out; + } + + ret = TRUE; + if (needed) { + g_assert (sn); + *setting_name = g_strdup (sn); + } else { + /* No secrets required */ + *setting_name = g_strdup (""); + } + +out: + return ret; +} + +static gboolean +impl_vpn_plugin_disconnect (NMVPNPlugin *plugin, + GError **err) +{ + return nm_vpn_plugin_disconnect (plugin, err); +} + +static gboolean +impl_vpn_plugin_set_ip4_config (NMVPNPlugin *plugin, + GHashTable *config, + GError **err) +{ + nm_vpn_plugin_set_ip4_config (plugin, config); + + return TRUE; +} + +static gboolean +impl_vpn_plugin_set_failure (NMVPNPlugin *plugin, + char *reason, + GError **err) +{ + nm_vpn_plugin_failure (plugin, NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG); + + return TRUE; +} + +/*********************************************************************/ + +static void +sigterm_handler (int signum) +{ + g_slist_foreach (active_plugins, (GFunc) nm_vpn_plugin_emit_quit, NULL); +} + +static void +setup_unix_signal_handler (void) +{ + struct sigaction action; + sigset_t block_mask; + + action.sa_handler = sigterm_handler; + sigemptyset (&block_mask); + action.sa_mask = block_mask; + action.sa_flags = 0; + sigaction (SIGINT, &action, NULL); + sigaction (SIGTERM, &action, NULL); +} + +/*********************************************************************/ + +static void +one_plugin_destroyed (gpointer data, + GObject *object) +{ + active_plugins = g_slist_remove (active_plugins, object); +} + +static void +nm_vpn_plugin_init (NMVPNPlugin *plugin) +{ + active_plugins = g_slist_append (active_plugins, plugin); + g_object_weak_ref (G_OBJECT (plugin), + one_plugin_destroyed, + NULL); +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMVPNPlugin *plugin; + NMVPNPluginPrivate *priv; + DBusGConnection *connection; + DBusGProxy *proxy; + guint request_name_result; + GError *err = NULL; + + object = G_OBJECT_CLASS (nm_vpn_plugin_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_VPN_PLUGIN_GET_PRIVATE (object); + if (!priv->dbus_service_name) + goto err; + + connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); + if (!connection) + goto err; + + proxy = dbus_g_proxy_new_for_name (connection, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + + if (!dbus_g_proxy_call (proxy, "RequestName", &err, + G_TYPE_STRING, priv->dbus_service_name, + G_TYPE_UINT, 0, + G_TYPE_INVALID, + G_TYPE_UINT, &request_name_result, + G_TYPE_INVALID)) { + g_object_unref (proxy); + goto err; + } + + g_object_unref (proxy); + + dbus_g_connection_register_g_object (connection, + NM_VPN_DBUS_PLUGIN_PATH, + object); + + plugin = NM_VPN_PLUGIN (object); + + nm_vpn_plugin_set_connection (plugin, connection); + nm_vpn_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_INIT); + + return object; + + err: + if (err) { + nm_warning ("%s", err->message); + g_error_free (err); + } + + if (object) + g_object_unref (object); + + return NULL; +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_DBUS_SERVICE_NAME: + /* Construct-only */ + priv->dbus_service_name = g_strdup (g_value_get_string (value)); + break; + case PROP_STATE: + nm_vpn_plugin_set_state (NM_VPN_PLUGIN (object), + (NMVPNServiceState) g_value_get_uint (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_DBUS_SERVICE_NAME: + g_value_set_string (value, priv->dbus_service_name); + break; + case PROP_STATE: + g_value_set_uint (value, nm_vpn_plugin_get_state (NM_VPN_PLUGIN (object))); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMVPNPlugin *plugin = NM_VPN_PLUGIN (object); + NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin); + NMVPNServiceState state; + GError *err = NULL; + + if (priv->disposed) { + G_OBJECT_CLASS (nm_vpn_plugin_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + if (priv->fail_stop_id) + g_source_remove (priv->fail_stop_id); + + state = nm_vpn_plugin_get_state (plugin); + + if (state == NM_VPN_SERVICE_STATE_STARTED || + state == NM_VPN_SERVICE_STATE_STARTING) + nm_vpn_plugin_disconnect (plugin, &err); + + if (err) { + nm_warning ("%s", err->message); + g_error_free (err); + } + + G_OBJECT_CLASS (nm_vpn_plugin_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMVPNPlugin *plugin = NM_VPN_PLUGIN (object); + NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin); + + nm_vpn_plugin_set_connection (plugin, NULL); + g_free (priv->dbus_service_name); + + G_OBJECT_CLASS (nm_vpn_plugin_parent_class)->finalize (object); +} + +static void +connect_timer_removed (gpointer data) +{ + NM_VPN_PLUGIN_GET_PRIVATE (data)->connect_timer = 0; +} + +static void +quit_timer_removed (gpointer data) +{ + NM_VPN_PLUGIN_GET_PRIVATE (data)->quit_timer = 0; +} + +static void +state_changed (NMVPNPlugin *plugin, NMVPNServiceState state) +{ + NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin); + + switch (state) { + case NM_VPN_SERVICE_STATE_STARTING: + /* Remove the quit timer. */ + if (priv->quit_timer) + g_source_remove (priv->quit_timer); + + if (priv->fail_stop_id) { + g_source_remove (priv->fail_stop_id); + priv->fail_stop_id = 0; + } + + /* Add a timer to make sure we do not wait indefinitely for the successful connect. */ + priv->connect_timer = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, + NM_VPN_PLUGIN_CONNECT_TIMER, + connect_timer_expired, + plugin, + connect_timer_removed); + break; + case NM_VPN_SERVICE_STATE_STOPPED: + priv->quit_timer = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, + NM_VPN_PLUGIN_QUIT_TIMER, + quit_timer_expired, + plugin, + quit_timer_removed); + break; + default: + /* Clean up all timers we might have set up. */ + if (priv->connect_timer) + g_source_remove (priv->connect_timer); + + if (priv->quit_timer) + g_source_remove (priv->quit_timer); + + if (priv->fail_stop_id) { + g_source_remove (priv->fail_stop_id); + priv->fail_stop_id = 0; + } + break; + } +} + +static void +nm_vpn_plugin_class_init (NMVPNPluginClass *plugin_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (plugin_class); + + g_type_class_add_private (object_class, sizeof (NMVPNPluginPrivate)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (plugin_class), + &dbus_glib_nm_vpn_plugin_object_info); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + plugin_class->state_changed = state_changed; + + /* properties */ + g_object_class_install_property + (object_class, PROP_DBUS_SERVICE_NAME, + g_param_spec_string (NM_VPN_PLUGIN_DBUS_SERVICE_NAME, + "DBus service name", + "DBus service name", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_STATE, + g_param_spec_uint (NM_VPN_PLUGIN_STATE, + "State", + "Current VPN service state", + NM_VPN_SERVICE_STATE_UNKNOWN, + NM_VPN_SERVICE_STATE_STOPPED, + NM_VPN_SERVICE_STATE_INIT, + G_PARAM_READWRITE)); + + /* signals */ + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNPluginClass, state_changed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, + G_TYPE_UINT); + + signals[IP4_CONFIG] = + g_signal_new ("ip4-config", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNPluginClass, ip4_config), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + DBUS_TYPE_G_MAP_OF_VARIANT); + + signals[LOGIN_BANNER] = + g_signal_new ("login-banner", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNPluginClass, login_banner), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); + + signals[FAILURE] = + g_signal_new ("failure", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNPluginClass, failure), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, + G_TYPE_UINT); + + signals[QUIT] = + g_signal_new ("quit", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNPluginClass, quit), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, + G_TYPE_NONE); + + dbus_g_error_domain_register (NM_VPN_PLUGIN_ERROR, + NULL, + NM_TYPE_VPN_PLUGIN_ERROR); + + setup_unix_signal_handler (); +} diff --git a/libnm-glib/nm-vpn-plugin.h b/libnm-glib/nm-vpn-plugin.h new file mode 100644 index 00000000..8a3c2f1d --- /dev/null +++ b/libnm-glib/nm-vpn-plugin.h @@ -0,0 +1,127 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * libnm_glib -- Access network status & information from glib applications + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_VPN_PLUGIN_H +#define NM_VPN_PLUGIN_H + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_VPN_PLUGIN (nm_vpn_plugin_get_type ()) +#define NM_VPN_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_PLUGIN, NMVPNPlugin)) +#define NM_VPN_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_PLUGIN, NMVPNPluginClass)) +#define NM_IS_VPN_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_PLUGIN)) +#define NM_IS_VPN_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_VPN_PLUGIN)) +#define NM_VPN_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_PLUGIN, NMVPNPluginClass)) + +#define NM_VPN_PLUGIN_DBUS_SERVICE_NAME "service-name" +#define NM_VPN_PLUGIN_STATE "state" + +typedef enum { + NM_VPN_PLUGIN_ERROR_GENERAL, + NM_VPN_PLUGIN_ERROR_STARTING_IN_PROGRESS, + NM_VPN_PLUGIN_ERROR_ALREADY_STARTED, + NM_VPN_PLUGIN_ERROR_STOPPING_IN_PROGRESS, + NM_VPN_PLUGIN_ERROR_ALREADY_STOPPED, + NM_VPN_PLUGIN_ERROR_WRONG_STATE, + NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, + NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED, + NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID, +} NMVPNPluginError; + +#define NM_VPN_PLUGIN_ERROR (nm_vpn_plugin_error_quark ()) +#define NM_TYPE_VPN_PLUGIN_ERROR (nm_vpn_plugin_error_get_type ()) + +typedef struct { + GObject parent; +} NMVPNPlugin; + +typedef struct { + GObjectClass parent; + + /* virtual methods */ + gboolean (*connect) (NMVPNPlugin *plugin, + NMConnection *connection, + GError **err); + + gboolean (*need_secrets) (NMVPNPlugin *plugin, + NMConnection *connection, + char **setting_name, + GError **error); + + gboolean (*disconnect) (NMVPNPlugin *plugin, + GError **err); + + /* Signals */ + void (*state_changed) (NMVPNPlugin *plugin, + NMVPNServiceState state); + + void (*ip4_config) (NMVPNPlugin *plugin, + GHashTable *ip4_config); + + void (*login_banner) (NMVPNPlugin *plugin, + const char *banner); + + void (*failure) (NMVPNPlugin *plugin, + NMVPNPluginFailure reason); + + void (*quit) (NMVPNPlugin *plugin); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); + void (*_reserved5) (void); + void (*_reserved6) (void); +} NMVPNPluginClass; + +GType nm_vpn_plugin_get_type (void); +GQuark nm_vpn_plugin_error_quark (void); +GType nm_vpn_plugin_error_get_type (void); + +DBusGConnection *nm_vpn_plugin_get_connection (NMVPNPlugin *plugin); +NMVPNServiceState nm_vpn_plugin_get_state (NMVPNPlugin *plugin); +void nm_vpn_plugin_set_state (NMVPNPlugin *plugin, + NMVPNServiceState state); + +void nm_vpn_plugin_set_login_banner (NMVPNPlugin *plugin, + const char *banner); + +void nm_vpn_plugin_failure (NMVPNPlugin *plugin, + NMVPNPluginFailure reason); + +void nm_vpn_plugin_set_ip4_config (NMVPNPlugin *plugin, + GHashTable *ip4_config); + +gboolean nm_vpn_plugin_disconnect (NMVPNPlugin *plugin, + GError **err); + +G_END_DECLS + +#endif /* NM_VPN_PLUGIN_H */ diff --git a/libnm-util/COPYING b/libnm-util/COPYING new file mode 100644 index 00000000..2ec1380e --- /dev/null +++ b/libnm-util/COPYING @@ -0,0 +1,488 @@ +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. + + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library 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. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am new file mode 100644 index 00000000..ddc68408 --- /dev/null +++ b/libnm-util/Makefile.am @@ -0,0 +1,113 @@ +SUBDIRS=. tests + +INCLUDES = -I${top_srcdir} -I${top_srcdir}/include + +lib_LTLIBRARIES=libnm-util.la + +libnm_util_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(UUID_CFLAGS) \ + -DG_DISABLE_DEPRECATED + +libnm_util_include_HEADERS = \ + nm-connection.h \ + nm-setting.h \ + nm-setting-8021x.h \ + nm-setting-bluetooth.h \ + nm-setting-connection.h \ + nm-setting-ip4-config.h \ + nm-setting-ip6-config.h \ + nm-setting-ppp.h \ + nm-setting-pppoe.h \ + nm-setting-serial.h \ + nm-setting-gsm.h \ + nm-setting-cdma.h \ + nm-setting-olpc-mesh.h \ + nm-setting-wired.h \ + nm-setting-wireless.h \ + nm-setting-wireless-security.h \ + nm-setting-vpn.h \ + nm-utils.h + +libnm_util_la_SOURCES= \ + crypto.c \ + crypto.h \ + nm-connection.c \ + nm-param-spec-specialized.c \ + nm-param-spec-specialized.h \ + nm-setting.c \ + nm-setting-8021x.c \ + nm-setting-bluetooth.c \ + nm-setting-connection.c \ + nm-setting-ip4-config.c \ + nm-setting-ip6-config.c \ + nm-setting-ppp.c \ + nm-setting-pppoe.c \ + nm-setting-serial.c \ + nm-setting-gsm.c \ + nm-setting-cdma.c \ + nm-setting-olpc-mesh.c \ + nm-setting-wired.c \ + nm-setting-wireless.c \ + nm-setting-wireless-security.c \ + nm-setting-vpn.c \ + nm-utils.c \ + nm-utils-private.h \ + $(libnm_util_include_HEADERS) + +libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) + +libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ + -version-info "4:4:3" + +if WITH_GNUTLS +libnm_util_la_SOURCES += crypto_gnutls.c +libnm_util_la_CPPFLAGS += $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS) +libnm_util_la_LIBADD += $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +endif + +if WITH_NSS +libnm_util_la_SOURCES += crypto_nss.c +libnm_util_la_CPPFLAGS += $(NSS_CFLAGS) +libnm_util_la_LIBADD += $(NSS_LIBS) +endif + +libnm_util_includedir=$(includedir)/NetworkManager + + +########################################### +# Crypto test library +########################################### + +noinst_LTLIBRARIES = libtest-crypto.la + +libtest_crypto_la_SOURCES = crypto.c + +libtest_crypto_la_CPPFLAGS = \ + $(GLIB_CFLAGS) + +libtest_crypto_la_LIBADD = \ + $(GLIB_LIBS) + +if WITH_GNUTLS +libtest_crypto_la_SOURCES += crypto_gnutls.c +libtest_crypto_la_CPPFLAGS += $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS) +libtest_crypto_la_LIBADD += $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +endif + +if WITH_NSS +libtest_crypto_la_SOURCES += crypto_nss.c +libtest_crypto_la_CPPFLAGS += $(NSS_CFLAGS) +libtest_crypto_la_LIBADD += $(NSS_LIBS) +endif + + + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libnm-util.pc + +DISTCLEANFILES = libnm-util.pc + +EXTRA_DIST = libnm-util.pc.in libnm-util.ver + diff --git a/libnm-util/Makefile.in b/libnm-util/Makefile.in new file mode 100644 index 00000000..2da64da9 --- /dev/null +++ b/libnm-util/Makefile.in @@ -0,0 +1,1121 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@WITH_GNUTLS_TRUE@am__append_1 = crypto_gnutls.c +@WITH_GNUTLS_TRUE@am__append_2 = $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS) +@WITH_GNUTLS_TRUE@am__append_3 = $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +@WITH_NSS_TRUE@am__append_4 = crypto_nss.c +@WITH_NSS_TRUE@am__append_5 = $(NSS_CFLAGS) +@WITH_NSS_TRUE@am__append_6 = $(NSS_LIBS) +@WITH_GNUTLS_TRUE@am__append_7 = crypto_gnutls.c +@WITH_GNUTLS_TRUE@am__append_8 = $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS) +@WITH_GNUTLS_TRUE@am__append_9 = $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +@WITH_NSS_TRUE@am__append_10 = crypto_nss.c +@WITH_NSS_TRUE@am__append_11 = $(NSS_CFLAGS) +@WITH_NSS_TRUE@am__append_12 = $(NSS_LIBS) +subdir = libnm-util +DIST_COMMON = $(libnm_util_include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/libnm-util.pc.in COPYING +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = libnm-util.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(libnm_util_includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +@WITH_GNUTLS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ +@WITH_GNUTLS_TRUE@ $(am__DEPENDENCIES_1) +@WITH_NSS_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) +libnm_util_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +am__libnm_util_la_SOURCES_DIST = crypto.c crypto.h nm-connection.c \ + nm-param-spec-specialized.c nm-param-spec-specialized.h \ + nm-setting.c nm-setting-8021x.c nm-setting-bluetooth.c \ + nm-setting-connection.c nm-setting-ip4-config.c \ + nm-setting-ip6-config.c nm-setting-ppp.c nm-setting-pppoe.c \ + nm-setting-serial.c nm-setting-gsm.c nm-setting-cdma.c \ + nm-setting-olpc-mesh.c nm-setting-wired.c \ + nm-setting-wireless.c nm-setting-wireless-security.c \ + nm-setting-vpn.c nm-utils.c nm-utils-private.h nm-connection.h \ + nm-setting.h nm-setting-8021x.h nm-setting-bluetooth.h \ + nm-setting-connection.h nm-setting-ip4-config.h \ + nm-setting-ip6-config.h nm-setting-ppp.h nm-setting-pppoe.h \ + nm-setting-serial.h nm-setting-gsm.h nm-setting-cdma.h \ + nm-setting-olpc-mesh.h nm-setting-wired.h \ + nm-setting-wireless.h nm-setting-wireless-security.h \ + nm-setting-vpn.h nm-utils.h crypto_gnutls.c crypto_nss.c +am__objects_1 = +@WITH_GNUTLS_TRUE@am__objects_2 = libnm_util_la-crypto_gnutls.lo +@WITH_NSS_TRUE@am__objects_3 = libnm_util_la-crypto_nss.lo +am_libnm_util_la_OBJECTS = libnm_util_la-crypto.lo \ + libnm_util_la-nm-connection.lo \ + libnm_util_la-nm-param-spec-specialized.lo \ + libnm_util_la-nm-setting.lo libnm_util_la-nm-setting-8021x.lo \ + libnm_util_la-nm-setting-bluetooth.lo \ + libnm_util_la-nm-setting-connection.lo \ + libnm_util_la-nm-setting-ip4-config.lo \ + libnm_util_la-nm-setting-ip6-config.lo \ + libnm_util_la-nm-setting-ppp.lo \ + libnm_util_la-nm-setting-pppoe.lo \ + libnm_util_la-nm-setting-serial.lo \ + libnm_util_la-nm-setting-gsm.lo \ + libnm_util_la-nm-setting-cdma.lo \ + libnm_util_la-nm-setting-olpc-mesh.lo \ + libnm_util_la-nm-setting-wired.lo \ + libnm_util_la-nm-setting-wireless.lo \ + libnm_util_la-nm-setting-wireless-security.lo \ + libnm_util_la-nm-setting-vpn.lo libnm_util_la-nm-utils.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) +libnm_util_la_OBJECTS = $(am_libnm_util_la_OBJECTS) +libnm_util_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libnm_util_la_LDFLAGS) $(LDFLAGS) -o $@ +libtest_crypto_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +am__libtest_crypto_la_SOURCES_DIST = crypto.c crypto_gnutls.c \ + crypto_nss.c +@WITH_GNUTLS_TRUE@am__objects_4 = libtest_crypto_la-crypto_gnutls.lo +@WITH_NSS_TRUE@am__objects_5 = libtest_crypto_la-crypto_nss.lo +am_libtest_crypto_la_OBJECTS = libtest_crypto_la-crypto.lo \ + $(am__objects_4) $(am__objects_5) +libtest_crypto_la_OBJECTS = $(am_libtest_crypto_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnm_util_la_SOURCES) $(libtest_crypto_la_SOURCES) +DIST_SOURCES = $(am__libnm_util_la_SOURCES_DIST) \ + $(am__libtest_crypto_la_SOURCES_DIST) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +DATA = $(pkgconfig_DATA) +HEADERS = $(libnm_util_include_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = . tests +INCLUDES = -I${top_srcdir} -I${top_srcdir}/include +lib_LTLIBRARIES = libnm-util.la +libnm_util_la_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(UUID_CFLAGS) \ + -DG_DISABLE_DEPRECATED $(am__append_2) $(am__append_5) +libnm_util_include_HEADERS = \ + nm-connection.h \ + nm-setting.h \ + nm-setting-8021x.h \ + nm-setting-bluetooth.h \ + nm-setting-connection.h \ + nm-setting-ip4-config.h \ + nm-setting-ip6-config.h \ + nm-setting-ppp.h \ + nm-setting-pppoe.h \ + nm-setting-serial.h \ + nm-setting-gsm.h \ + nm-setting-cdma.h \ + nm-setting-olpc-mesh.h \ + nm-setting-wired.h \ + nm-setting-wireless.h \ + nm-setting-wireless-security.h \ + nm-setting-vpn.h \ + nm-utils.h + +libnm_util_la_SOURCES = crypto.c crypto.h nm-connection.c \ + nm-param-spec-specialized.c nm-param-spec-specialized.h \ + nm-setting.c nm-setting-8021x.c nm-setting-bluetooth.c \ + nm-setting-connection.c nm-setting-ip4-config.c \ + nm-setting-ip6-config.c nm-setting-ppp.c nm-setting-pppoe.c \ + nm-setting-serial.c nm-setting-gsm.c nm-setting-cdma.c \ + nm-setting-olpc-mesh.c nm-setting-wired.c \ + nm-setting-wireless.c nm-setting-wireless-security.c \ + nm-setting-vpn.c nm-utils.c nm-utils-private.h \ + $(libnm_util_include_HEADERS) $(am__append_1) $(am__append_4) +libnm_util_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) $(UUID_LIBS) \ + $(am__append_3) $(am__append_6) +libnm_util_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-util.ver \ + -version-info "4:4:3" + +libnm_util_includedir = $(includedir)/NetworkManager + +########################################### +# Crypto test library +########################################### +noinst_LTLIBRARIES = libtest-crypto.la +libtest_crypto_la_SOURCES = crypto.c $(am__append_7) $(am__append_10) +libtest_crypto_la_CPPFLAGS = $(GLIB_CFLAGS) $(am__append_8) \ + $(am__append_11) +libtest_crypto_la_LIBADD = $(GLIB_LIBS) $(am__append_9) \ + $(am__append_12) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libnm-util.pc +DISTCLEANFILES = libnm-util.pc +EXTRA_DIST = libnm-util.pc.in libnm-util.ver +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libnm-util/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libnm-util/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +libnm-util.pc: $(top_builddir)/config.status $(srcdir)/libnm-util.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnm-util.la: $(libnm_util_la_OBJECTS) $(libnm_util_la_DEPENDENCIES) + $(libnm_util_la_LINK) -rpath $(libdir) $(libnm_util_la_OBJECTS) $(libnm_util_la_LIBADD) $(LIBS) +libtest-crypto.la: $(libtest_crypto_la_OBJECTS) $(libtest_crypto_la_DEPENDENCIES) + $(LINK) $(libtest_crypto_la_OBJECTS) $(libtest_crypto_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-crypto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-crypto_gnutls.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-crypto_nss.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-param-spec-specialized.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-8021x.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-bluetooth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-cdma.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-gsm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-ip4-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-ip6-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-olpc-mesh.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-ppp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-pppoe.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-serial.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-vpn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-wired.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-wireless-security.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting-wireless.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-setting.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_util_la-nm-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_crypto_la-crypto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_crypto_la-crypto_gnutls.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_crypto_la-crypto_nss.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnm_util_la-crypto.lo: crypto.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-crypto.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-crypto.Tpo -c -o libnm_util_la-crypto.lo `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-crypto.Tpo $(DEPDIR)/libnm_util_la-crypto.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypto.c' object='libnm_util_la-crypto.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-crypto.lo `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c + +libnm_util_la-nm-connection.lo: nm-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-connection.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-connection.Tpo -c -o libnm_util_la-nm-connection.lo `test -f 'nm-connection.c' || echo '$(srcdir)/'`nm-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-connection.Tpo $(DEPDIR)/libnm_util_la-nm-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-connection.c' object='libnm_util_la-nm-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-connection.lo `test -f 'nm-connection.c' || echo '$(srcdir)/'`nm-connection.c + +libnm_util_la-nm-param-spec-specialized.lo: nm-param-spec-specialized.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-param-spec-specialized.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-param-spec-specialized.Tpo -c -o libnm_util_la-nm-param-spec-specialized.lo `test -f 'nm-param-spec-specialized.c' || echo '$(srcdir)/'`nm-param-spec-specialized.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-param-spec-specialized.Tpo $(DEPDIR)/libnm_util_la-nm-param-spec-specialized.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-param-spec-specialized.c' object='libnm_util_la-nm-param-spec-specialized.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-param-spec-specialized.lo `test -f 'nm-param-spec-specialized.c' || echo '$(srcdir)/'`nm-param-spec-specialized.c + +libnm_util_la-nm-setting.lo: nm-setting.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting.Tpo -c -o libnm_util_la-nm-setting.lo `test -f 'nm-setting.c' || echo '$(srcdir)/'`nm-setting.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting.Tpo $(DEPDIR)/libnm_util_la-nm-setting.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting.c' object='libnm_util_la-nm-setting.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting.lo `test -f 'nm-setting.c' || echo '$(srcdir)/'`nm-setting.c + +libnm_util_la-nm-setting-8021x.lo: nm-setting-8021x.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-8021x.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-8021x.Tpo -c -o libnm_util_la-nm-setting-8021x.lo `test -f 'nm-setting-8021x.c' || echo '$(srcdir)/'`nm-setting-8021x.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-8021x.Tpo $(DEPDIR)/libnm_util_la-nm-setting-8021x.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-8021x.c' object='libnm_util_la-nm-setting-8021x.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-8021x.lo `test -f 'nm-setting-8021x.c' || echo '$(srcdir)/'`nm-setting-8021x.c + +libnm_util_la-nm-setting-bluetooth.lo: nm-setting-bluetooth.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-bluetooth.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-bluetooth.Tpo -c -o libnm_util_la-nm-setting-bluetooth.lo `test -f 'nm-setting-bluetooth.c' || echo '$(srcdir)/'`nm-setting-bluetooth.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-bluetooth.Tpo $(DEPDIR)/libnm_util_la-nm-setting-bluetooth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-bluetooth.c' object='libnm_util_la-nm-setting-bluetooth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-bluetooth.lo `test -f 'nm-setting-bluetooth.c' || echo '$(srcdir)/'`nm-setting-bluetooth.c + +libnm_util_la-nm-setting-connection.lo: nm-setting-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-connection.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-connection.Tpo -c -o libnm_util_la-nm-setting-connection.lo `test -f 'nm-setting-connection.c' || echo '$(srcdir)/'`nm-setting-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-connection.Tpo $(DEPDIR)/libnm_util_la-nm-setting-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-connection.c' object='libnm_util_la-nm-setting-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-connection.lo `test -f 'nm-setting-connection.c' || echo '$(srcdir)/'`nm-setting-connection.c + +libnm_util_la-nm-setting-ip4-config.lo: nm-setting-ip4-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-ip4-config.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-ip4-config.Tpo -c -o libnm_util_la-nm-setting-ip4-config.lo `test -f 'nm-setting-ip4-config.c' || echo '$(srcdir)/'`nm-setting-ip4-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-ip4-config.Tpo $(DEPDIR)/libnm_util_la-nm-setting-ip4-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-ip4-config.c' object='libnm_util_la-nm-setting-ip4-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-ip4-config.lo `test -f 'nm-setting-ip4-config.c' || echo '$(srcdir)/'`nm-setting-ip4-config.c + +libnm_util_la-nm-setting-ip6-config.lo: nm-setting-ip6-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-ip6-config.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-ip6-config.Tpo -c -o libnm_util_la-nm-setting-ip6-config.lo `test -f 'nm-setting-ip6-config.c' || echo '$(srcdir)/'`nm-setting-ip6-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-ip6-config.Tpo $(DEPDIR)/libnm_util_la-nm-setting-ip6-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-ip6-config.c' object='libnm_util_la-nm-setting-ip6-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-ip6-config.lo `test -f 'nm-setting-ip6-config.c' || echo '$(srcdir)/'`nm-setting-ip6-config.c + +libnm_util_la-nm-setting-ppp.lo: nm-setting-ppp.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-ppp.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-ppp.Tpo -c -o libnm_util_la-nm-setting-ppp.lo `test -f 'nm-setting-ppp.c' || echo '$(srcdir)/'`nm-setting-ppp.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-ppp.Tpo $(DEPDIR)/libnm_util_la-nm-setting-ppp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-ppp.c' object='libnm_util_la-nm-setting-ppp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-ppp.lo `test -f 'nm-setting-ppp.c' || echo '$(srcdir)/'`nm-setting-ppp.c + +libnm_util_la-nm-setting-pppoe.lo: nm-setting-pppoe.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-pppoe.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-pppoe.Tpo -c -o libnm_util_la-nm-setting-pppoe.lo `test -f 'nm-setting-pppoe.c' || echo '$(srcdir)/'`nm-setting-pppoe.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-pppoe.Tpo $(DEPDIR)/libnm_util_la-nm-setting-pppoe.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-pppoe.c' object='libnm_util_la-nm-setting-pppoe.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-pppoe.lo `test -f 'nm-setting-pppoe.c' || echo '$(srcdir)/'`nm-setting-pppoe.c + +libnm_util_la-nm-setting-serial.lo: nm-setting-serial.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-serial.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-serial.Tpo -c -o libnm_util_la-nm-setting-serial.lo `test -f 'nm-setting-serial.c' || echo '$(srcdir)/'`nm-setting-serial.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-serial.Tpo $(DEPDIR)/libnm_util_la-nm-setting-serial.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-serial.c' object='libnm_util_la-nm-setting-serial.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-serial.lo `test -f 'nm-setting-serial.c' || echo '$(srcdir)/'`nm-setting-serial.c + +libnm_util_la-nm-setting-gsm.lo: nm-setting-gsm.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-gsm.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-gsm.Tpo -c -o libnm_util_la-nm-setting-gsm.lo `test -f 'nm-setting-gsm.c' || echo '$(srcdir)/'`nm-setting-gsm.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-gsm.Tpo $(DEPDIR)/libnm_util_la-nm-setting-gsm.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-gsm.c' object='libnm_util_la-nm-setting-gsm.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-gsm.lo `test -f 'nm-setting-gsm.c' || echo '$(srcdir)/'`nm-setting-gsm.c + +libnm_util_la-nm-setting-cdma.lo: nm-setting-cdma.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-cdma.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-cdma.Tpo -c -o libnm_util_la-nm-setting-cdma.lo `test -f 'nm-setting-cdma.c' || echo '$(srcdir)/'`nm-setting-cdma.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-cdma.Tpo $(DEPDIR)/libnm_util_la-nm-setting-cdma.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-cdma.c' object='libnm_util_la-nm-setting-cdma.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-cdma.lo `test -f 'nm-setting-cdma.c' || echo '$(srcdir)/'`nm-setting-cdma.c + +libnm_util_la-nm-setting-olpc-mesh.lo: nm-setting-olpc-mesh.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-olpc-mesh.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-olpc-mesh.Tpo -c -o libnm_util_la-nm-setting-olpc-mesh.lo `test -f 'nm-setting-olpc-mesh.c' || echo '$(srcdir)/'`nm-setting-olpc-mesh.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-olpc-mesh.Tpo $(DEPDIR)/libnm_util_la-nm-setting-olpc-mesh.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-olpc-mesh.c' object='libnm_util_la-nm-setting-olpc-mesh.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-olpc-mesh.lo `test -f 'nm-setting-olpc-mesh.c' || echo '$(srcdir)/'`nm-setting-olpc-mesh.c + +libnm_util_la-nm-setting-wired.lo: nm-setting-wired.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-wired.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-wired.Tpo -c -o libnm_util_la-nm-setting-wired.lo `test -f 'nm-setting-wired.c' || echo '$(srcdir)/'`nm-setting-wired.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-wired.Tpo $(DEPDIR)/libnm_util_la-nm-setting-wired.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-wired.c' object='libnm_util_la-nm-setting-wired.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-wired.lo `test -f 'nm-setting-wired.c' || echo '$(srcdir)/'`nm-setting-wired.c + +libnm_util_la-nm-setting-wireless.lo: nm-setting-wireless.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-wireless.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-wireless.Tpo -c -o libnm_util_la-nm-setting-wireless.lo `test -f 'nm-setting-wireless.c' || echo '$(srcdir)/'`nm-setting-wireless.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-wireless.Tpo $(DEPDIR)/libnm_util_la-nm-setting-wireless.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-wireless.c' object='libnm_util_la-nm-setting-wireless.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-wireless.lo `test -f 'nm-setting-wireless.c' || echo '$(srcdir)/'`nm-setting-wireless.c + +libnm_util_la-nm-setting-wireless-security.lo: nm-setting-wireless-security.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-wireless-security.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-wireless-security.Tpo -c -o libnm_util_la-nm-setting-wireless-security.lo `test -f 'nm-setting-wireless-security.c' || echo '$(srcdir)/'`nm-setting-wireless-security.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-wireless-security.Tpo $(DEPDIR)/libnm_util_la-nm-setting-wireless-security.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-wireless-security.c' object='libnm_util_la-nm-setting-wireless-security.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-wireless-security.lo `test -f 'nm-setting-wireless-security.c' || echo '$(srcdir)/'`nm-setting-wireless-security.c + +libnm_util_la-nm-setting-vpn.lo: nm-setting-vpn.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-setting-vpn.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-setting-vpn.Tpo -c -o libnm_util_la-nm-setting-vpn.lo `test -f 'nm-setting-vpn.c' || echo '$(srcdir)/'`nm-setting-vpn.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-setting-vpn.Tpo $(DEPDIR)/libnm_util_la-nm-setting-vpn.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-setting-vpn.c' object='libnm_util_la-nm-setting-vpn.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-setting-vpn.lo `test -f 'nm-setting-vpn.c' || echo '$(srcdir)/'`nm-setting-vpn.c + +libnm_util_la-nm-utils.lo: nm-utils.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-nm-utils.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-nm-utils.Tpo -c -o libnm_util_la-nm-utils.lo `test -f 'nm-utils.c' || echo '$(srcdir)/'`nm-utils.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-nm-utils.Tpo $(DEPDIR)/libnm_util_la-nm-utils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-utils.c' object='libnm_util_la-nm-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-nm-utils.lo `test -f 'nm-utils.c' || echo '$(srcdir)/'`nm-utils.c + +libnm_util_la-crypto_gnutls.lo: crypto_gnutls.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-crypto_gnutls.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-crypto_gnutls.Tpo -c -o libnm_util_la-crypto_gnutls.lo `test -f 'crypto_gnutls.c' || echo '$(srcdir)/'`crypto_gnutls.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-crypto_gnutls.Tpo $(DEPDIR)/libnm_util_la-crypto_gnutls.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypto_gnutls.c' object='libnm_util_la-crypto_gnutls.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-crypto_gnutls.lo `test -f 'crypto_gnutls.c' || echo '$(srcdir)/'`crypto_gnutls.c + +libnm_util_la-crypto_nss.lo: crypto_nss.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_util_la-crypto_nss.lo -MD -MP -MF $(DEPDIR)/libnm_util_la-crypto_nss.Tpo -c -o libnm_util_la-crypto_nss.lo `test -f 'crypto_nss.c' || echo '$(srcdir)/'`crypto_nss.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_util_la-crypto_nss.Tpo $(DEPDIR)/libnm_util_la-crypto_nss.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypto_nss.c' object='libnm_util_la-crypto_nss.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_util_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_util_la-crypto_nss.lo `test -f 'crypto_nss.c' || echo '$(srcdir)/'`crypto_nss.c + +libtest_crypto_la-crypto.lo: crypto.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_crypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_crypto_la-crypto.lo -MD -MP -MF $(DEPDIR)/libtest_crypto_la-crypto.Tpo -c -o libtest_crypto_la-crypto.lo `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_crypto_la-crypto.Tpo $(DEPDIR)/libtest_crypto_la-crypto.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypto.c' object='libtest_crypto_la-crypto.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_crypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_crypto_la-crypto.lo `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c + +libtest_crypto_la-crypto_gnutls.lo: crypto_gnutls.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_crypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_crypto_la-crypto_gnutls.lo -MD -MP -MF $(DEPDIR)/libtest_crypto_la-crypto_gnutls.Tpo -c -o libtest_crypto_la-crypto_gnutls.lo `test -f 'crypto_gnutls.c' || echo '$(srcdir)/'`crypto_gnutls.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_crypto_la-crypto_gnutls.Tpo $(DEPDIR)/libtest_crypto_la-crypto_gnutls.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypto_gnutls.c' object='libtest_crypto_la-crypto_gnutls.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_crypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_crypto_la-crypto_gnutls.lo `test -f 'crypto_gnutls.c' || echo '$(srcdir)/'`crypto_gnutls.c + +libtest_crypto_la-crypto_nss.lo: crypto_nss.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_crypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_crypto_la-crypto_nss.lo -MD -MP -MF $(DEPDIR)/libtest_crypto_la-crypto_nss.Tpo -c -o libtest_crypto_la-crypto_nss.lo `test -f 'crypto_nss.c' || echo '$(srcdir)/'`crypto_nss.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_crypto_la-crypto_nss.Tpo $(DEPDIR)/libtest_crypto_la-crypto_nss.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crypto_nss.c' object='libtest_crypto_la-crypto_nss.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_crypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_crypto_la-crypto_nss.lo `test -f 'crypto_nss.c' || echo '$(srcdir)/'`crypto_nss.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files +install-libnm_util_includeHEADERS: $(libnm_util_include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(libnm_util_includedir)" || $(MKDIR_P) "$(DESTDIR)$(libnm_util_includedir)" + @list='$(libnm_util_include_HEADERS)'; test -n "$(libnm_util_includedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libnm_util_includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libnm_util_includedir)" || exit $$?; \ + done + +uninstall-libnm_util_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libnm_util_include_HEADERS)'; test -n "$(libnm_util_includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libnm_util_includedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libnm_util_includedir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libnm_util_includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-libnm_util_includeHEADERS \ + install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-libnm_util_includeHEADERS uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ + ctags ctags-recursive distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-libnm_util_includeHEADERS install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-libnm_util_includeHEADERS uninstall-pkgconfigDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c new file mode 100644 index 00000000..813cbc8e --- /dev/null +++ b/libnm-util/crypto.c @@ -0,0 +1,636 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2009 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include + +#include "crypto.h" + +GQuark +_nm_crypto_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-crypto-error-quark"); + return quark; +} + + +static const char *pem_rsa_key_begin = "-----BEGIN RSA PRIVATE KEY-----"; +static const char *pem_rsa_key_end = "-----END RSA PRIVATE KEY-----"; + +static const char *pem_dsa_key_begin = "-----BEGIN DSA PRIVATE KEY-----"; +static const char *pem_dsa_key_end = "-----END DSA PRIVATE KEY-----"; + +static const char *pem_cert_begin = "-----BEGIN CERTIFICATE-----"; +static const char *pem_cert_end = "-----END CERTIFICATE-----"; + +static const char * +find_tag (const char *tag, const char *buf, gsize len) +{ + gsize i, taglen; + + taglen = strlen (tag); + if (len < taglen) + return NULL; + + for (i = 0; i < len - taglen + 1; i++) { + if (memcmp (buf + i, tag, taglen) == 0) + return buf + i; + } + return NULL; +} + +#define DEK_INFO_TAG "DEK-Info: " +#define PROC_TYPE_TAG "Proc-Type: " + +static GByteArray * +parse_old_openssl_key_file (GByteArray *contents, + int key_type, + char **out_cipher, + char **out_iv, + GError **error) +{ + GByteArray *bindata = NULL; + char **lines = NULL; + char **ln = NULL; + const char *pos; + const char *end; + GString *str = NULL; + int enc_tags = 0; + char *iv = NULL; + char *cipher = NULL; + unsigned char *tmp = NULL; + gsize tmp_len = 0; + const char *start_tag; + const char *end_tag; + + switch (key_type) { + case NM_CRYPTO_KEY_TYPE_RSA: + start_tag = pem_rsa_key_begin; + end_tag = pem_rsa_key_end; + break; + case NM_CRYPTO_KEY_TYPE_DSA: + start_tag = pem_dsa_key_begin; + end_tag = pem_dsa_key_end; + break; + default: + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_UNKNOWN_KEY_TYPE, + "Unknown key type %d", + key_type); + g_assert_not_reached (); + return NULL; + } + + pos = find_tag (start_tag, (const char *) contents->data, contents->len); + if (!pos) + goto parse_error; + + pos += strlen (start_tag); + + end = find_tag (end_tag, pos, (const char *) contents->data + contents->len - pos); + if (end == NULL) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("PEM key file had no end tag '%s'."), + end_tag); + goto parse_error; + } + *((char *) end) = '\0'; + + lines = g_strsplit (pos, "\n", 0); + if (!lines || g_strv_length (lines) <= 1) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Doesn't look like a PEM private key file.")); + goto parse_error; + } + + str = g_string_new_len (NULL, end - pos); + if (!str) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory to store PEM file data.")); + goto parse_error; + } + + for (ln = lines; *ln; ln++) { + char *p = *ln; + + /* Chug leading spaces */ + p = g_strstrip (p); + if (!*p) + continue; + + if (!strncmp (p, PROC_TYPE_TAG, strlen (PROC_TYPE_TAG))) { + if (enc_tags++ != 0) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Malformed PEM file: Proc-Type was not first tag.")); + goto parse_error; + } + + p += strlen (PROC_TYPE_TAG); + if (strcmp (p, "4,ENCRYPTED")) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Malformed PEM file: unknown Proc-Type tag '%s'."), + p); + goto parse_error; + } + } else if (!strncmp (p, DEK_INFO_TAG, strlen (DEK_INFO_TAG))) { + char *comma; + + if (enc_tags++ != 1) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Malformed PEM file: DEK-Info was not the second tag.")); + goto parse_error; + } + + p += strlen (DEK_INFO_TAG); + + /* Grab the IV first */ + comma = strchr (p, ','); + if (!comma || (*(comma + 1) == '\0')) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Malformed PEM file: no IV found in DEK-Info tag.")); + goto parse_error; + } + *comma++ = '\0'; + if (!g_ascii_isxdigit (*comma)) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Malformed PEM file: invalid format of IV in DEK-Info tag.")); + goto parse_error; + } + iv = g_strdup (comma); + + /* Get the private key cipher */ + if (!strcasecmp (p, "DES-EDE3-CBC")) { + cipher = g_strdup (p); + } else if (!strcasecmp (p, "DES-CBC")) { + cipher = g_strdup (p); + } else { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_UNKNOWN_KEY_TYPE, + _("Malformed PEM file: unknown private key cipher '%s'."), + p); + goto parse_error; + } + } else { + if ((enc_tags != 0) && (enc_tags != 2)) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + "Malformed PEM file: both Proc-Type and DEK-Info tags are required."); + goto parse_error; + } + g_string_append (str, p); + } + } + + tmp = g_base64_decode (str->str, &tmp_len); + if (tmp == NULL || !tmp_len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_DECODE_FAILED, + _("Could not decode private key.")); + goto parse_error; + } + + if (lines) + g_strfreev (lines); + + bindata = g_byte_array_sized_new (tmp_len); + g_byte_array_append (bindata, tmp, tmp_len); + *out_iv = iv; + *out_cipher = cipher; + return bindata; + +parse_error: + g_free (cipher); + g_free (iv); + if (lines) + g_strfreev (lines); + return NULL; +} + +static GByteArray * +file_to_g_byte_array (const char *filename, + gboolean privkey, + GError **error) +{ + char *contents, *der = NULL; + GByteArray *array = NULL; + gsize length = 0; + const char *pos = NULL; + + if (!g_file_get_contents (filename, &contents, &length, error)) + return NULL; + + if (!privkey) + pos = find_tag (pem_cert_begin, contents, length); + + if (pos) { + const char *end; + + pos += strlen (pem_cert_begin); + end = find_tag (pem_cert_end, pos, contents + length - pos); + if (end == NULL) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("PEM certificate '%s' had no end tag '%s'."), + filename, pem_cert_end); + goto done; + } + + contents[end - contents - 1] = '\0'; + der = (char *) g_base64_decode (pos, &length); + if (der == NULL || !length) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_DECODE_FAILED, + _("Failed to decode certificate.")); + goto done; + } + } + + array = g_byte_array_sized_new (length); + if (!array) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory to store certificate data.")); + goto done; + } + + g_byte_array_append (array, der ? (unsigned char *) der : (unsigned char *) contents, length); + if (array->len != length) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory to store file data.")); + g_byte_array_free (array, TRUE); + array = NULL; + } + +done: + g_free (der); + g_free (contents); + return array; +} + +/* + * Convert a hex string into bytes. + */ +static char * +convert_iv (const char *src, + gsize *out_len, + GError **error) +{ + int num; + int i; + char conv[3]; + char *c; + + g_return_val_if_fail (src != NULL, NULL); + + num = strlen (src); + if (num % 2) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_RAW_IV_INVALID, + _("IV must be an even number of bytes in length.")); + return NULL; + } + + num /= 2; + c = g_malloc0 (num + 1); + if (c == NULL) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory to store the IV.")); + return NULL; + } + + conv[2] = '\0'; + for (i = 0; i < num; i++) { + conv[0] = src[(i * 2)]; + conv[1] = src[(i * 2) + 1]; + if (!g_ascii_isxdigit (conv[0]) || !g_ascii_isxdigit (conv[1])) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_RAW_IV_INVALID, + _("IV contains non-hexadecimal digits.")); + goto error; + } + + c[i] = strtol(conv, NULL, 16); + } + *out_len = num; + return c; + +error: + g_free (c); + return NULL; +} + +static char * +make_des_key (const char *cipher, + const char *salt, + const gsize salt_len, + const char *password, + gsize *out_len, + GError **error) +{ + char *key; + guint32 digest_len; + + g_return_val_if_fail (cipher != NULL, NULL); + 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 (!strcmp (cipher, "DES-EDE3-CBC")) + digest_len = 24; + else if (!strcmp (cipher, "DES-CBC")) + digest_len = 8; + else { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_UNKNOWN_CIPHER, + _("Private key cipher '%s' was unknown."), + cipher); + return NULL; + } + + key = g_malloc0 (digest_len + 1); + if (!key) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory to decrypt private key.")); + return NULL; + } + + if (!crypto_md5_hash (salt, + salt_len, + password, + strlen (password), + key, + digest_len, + error)) + goto error; + + *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 char * +decrypt_key (const char *cipher, + int key_type, + GByteArray *data, + const char *iv, + const char *password, + gsize *out_len, + GError **error) +{ + char *bin_iv = NULL; + gsize bin_iv_len = 0; + char *key = NULL; + gsize key_len = 0; + char *output = NULL; + + bin_iv = convert_iv (iv, &bin_iv_len, error); + if (!bin_iv) + return NULL; + + /* Convert the PIN and IV into a DES key */ + key = make_des_key (cipher, bin_iv, bin_iv_len, password, &key_len, error); + if (!key || !key_len) + goto out; + + output = crypto_decrypt (cipher, key_type, + data, + bin_iv, bin_iv_len, + key, key_len, + out_len, + error); + if (!output) + goto out; + + if (*out_len == 0) { + g_free (output); + output = NULL; + goto out; + } + +out: + if (key) { + /* Don't leak stale key material */ + memset (key, 0, key_len); + g_free (key); + } + g_free (bin_iv); + return output; +} + +GByteArray * +crypto_get_private_key_data (GByteArray *contents, + const char *password, + NMCryptoKeyType *out_key_type, + NMCryptoFileFormat *out_file_type, + GError **error) +{ + GByteArray *array = NULL; + NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_RSA; + GByteArray *data; + char *iv = NULL; + char *cipher = NULL; + char *decrypted = NULL; + gsize decrypted_len = 0; + + g_return_val_if_fail (contents != NULL, NULL); + g_return_val_if_fail (password != NULL, NULL); + g_return_val_if_fail (out_key_type != NULL, NULL); + g_return_val_if_fail (*out_key_type == NM_CRYPTO_KEY_TYPE_UNKNOWN, NULL); + g_return_val_if_fail (out_file_type != NULL, NULL); + g_return_val_if_fail (*out_file_type == NM_CRYPTO_FILE_FORMAT_UNKNOWN, NULL); + + /* Try PKCS#12 first */ + if (crypto_verify_pkcs12 (contents, password, NULL)) { + *out_key_type = NM_CRYPTO_KEY_TYPE_ENCRYPTED; + *out_file_type = NM_CRYPTO_FILE_FORMAT_PKCS12; + + array = g_byte_array_sized_new (contents->len); + g_byte_array_append (array, contents->data, contents->len); + return array; + } + + /* OpenSSL non-standard legacy PEM files */ + + /* Try RSA keys first */ + data = parse_old_openssl_key_file (contents, key_type, &cipher, &iv, error); + if (!data) { + g_clear_error (error); + + /* DSA next */ + key_type = NM_CRYPTO_KEY_TYPE_DSA; + data = parse_old_openssl_key_file (contents, key_type, &cipher, &iv, error); + if (!data) { + g_clear_error (error); + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Unable to determine private key type.")); + goto out; + } + } + + decrypted = decrypt_key (cipher, + key_type, + data, + iv, + password, + &decrypted_len, + error); + if (!decrypted) + goto out; + + array = g_byte_array_sized_new (decrypted_len); + if (!array) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory to store decrypted private key.")); + goto out; + } + + g_byte_array_append (array, (const guint8 *) decrypted, decrypted_len); + *out_key_type = key_type; + *out_file_type = NM_CRYPTO_FILE_FORMAT_RAW_KEY; + +out: + if (decrypted) { + /* Don't expose key material */ + memset (decrypted, 0, decrypted_len); + g_free (decrypted); + } + if (data) + g_byte_array_free (data, TRUE); + g_free (cipher); + g_free (iv); + return array; +} + +GByteArray * +crypto_get_private_key (const char *file, + const char *password, + NMCryptoKeyType *out_key_type, + NMCryptoFileFormat *out_file_type, + GError **error) +{ + GByteArray *contents; + GByteArray *key = NULL; + + contents = file_to_g_byte_array (file, TRUE, error); + if (contents) { + key = crypto_get_private_key_data (contents, password, out_key_type, out_file_type, error); + g_byte_array_free (contents, TRUE); + } + return key; +} + +GByteArray * +crypto_load_and_verify_certificate (const char *file, + NMCryptoFileFormat *out_file_format, + GError **error) +{ + GByteArray *array; + + g_return_val_if_fail (file != NULL, NULL); + g_return_val_if_fail (out_file_format != NULL, NULL); + g_return_val_if_fail (*out_file_format == NM_CRYPTO_FILE_FORMAT_UNKNOWN, NULL); + + array = file_to_g_byte_array (file, FALSE, error); + if (!array) + return NULL; + + *out_file_format = crypto_verify_cert (array->data, array->len, error); + if (*out_file_format == NM_CRYPTO_FILE_FORMAT_UNKNOWN) { + /* Try PKCS#12 */ + if (crypto_is_pkcs12_data (array)) { + *out_file_format = NM_CRYPTO_FILE_FORMAT_PKCS12; + g_clear_error (error); + } else { + g_byte_array_free (array, TRUE); + array = NULL; + } + } + + return array; +} + +gboolean +crypto_is_pkcs12_data (const GByteArray *data) +{ + GError *error = NULL; + gboolean success; + + g_return_val_if_fail (data != NULL, FALSE); + + success = crypto_verify_pkcs12 (data, NULL, &error); + if (success) + return TRUE; + + /* 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_ERR_CIPHER_DECRYPT_FAILED)) + success = TRUE; + g_error_free (error); + } + + return success; +} + +gboolean +crypto_is_pkcs12_file (const char *file, GError **error) +{ + GByteArray *contents; + gboolean success = FALSE; + + g_return_val_if_fail (file != NULL, FALSE); + + contents = file_to_g_byte_array (file, TRUE, error); + if (contents) { + success = crypto_is_pkcs12_data (contents); + g_byte_array_free (contents, TRUE); + } + return success; +} + diff --git a/libnm-util/crypto.h b/libnm-util/crypto.h new file mode 100644 index 00000000..38471cea --- /dev/null +++ b/libnm-util/crypto.h @@ -0,0 +1,131 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + */ + +#include + +#define MD5_HASH_LEN 20 +#define CIPHER_DES_EDE3_CBC "DES-EDE3-CBC" +#define CIPHER_DES_CBC "DES-CBC" + +enum { + NM_CRYPTO_ERR_NONE = 0, + NM_CRYPTO_ERR_INIT_FAILED, + NM_CRYPTO_ERR_CANT_READ_FILE, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + NM_CRYPTO_ERR_CERT_FORMAT_INVALID, + NM_CRYPTO_ERR_DECODE_FAILED, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + NM_CRYPTO_ERR_UNKNOWN_KEY_TYPE, + NM_CRYPTO_ERR_UNKNOWN_CIPHER, + NM_CRYPTO_ERR_RAW_IV_INVALID, + NM_CRYPTO_ERR_MD5_INIT_FAILED, + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + NM_CRYPTO_ERR_CIPHER_SET_KEY_FAILED, + NM_CRYPTO_ERR_CIPHER_SET_IV_FAILED, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + NM_CRYPTO_ERR_INVALID_PASSWORD, + NM_CRYPTO_ERR_CIPHER_ENCRYPT_FAILED, + NM_CRYPTO_ERR_RANDOMIZE_FAILED +}; + +typedef enum { + NM_CRYPTO_KEY_TYPE_UNKNOWN = 0, + NM_CRYPTO_KEY_TYPE_RSA, + NM_CRYPTO_KEY_TYPE_DSA, + NM_CRYPTO_KEY_TYPE_ENCRYPTED +} NMCryptoKeyType; + +typedef enum { + NM_CRYPTO_FILE_FORMAT_UNKNOWN = 0, + NM_CRYPTO_FILE_FORMAT_X509, + NM_CRYPTO_FILE_FORMAT_RAW_KEY, + NM_CRYPTO_FILE_FORMAT_PKCS12 +} NMCryptoFileFormat; + +#define NM_CRYPTO_ERROR _nm_crypto_error_quark () +GQuark _nm_crypto_error_quark (void); + +gboolean crypto_init (GError **error); + +void crypto_deinit (void); + +GByteArray * crypto_get_private_key_data (GByteArray *contents, + const char *password, + NMCryptoKeyType *out_key_type, + NMCryptoFileFormat *out_file_format, + GError **error); + +GByteArray * crypto_get_private_key (const char *file, + const char *password, + NMCryptoKeyType *out_key_type, + NMCryptoFileFormat *out_file_format, + GError **error); + +GByteArray * crypto_load_and_verify_certificate (const char *file, + NMCryptoFileFormat *out_file_format, + GError **error); + +gboolean crypto_is_pkcs12_file (const char *file, GError **error); + +gboolean crypto_is_pkcs12_data (const GByteArray *data); + + +/* 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); + +char * crypto_decrypt (const char *cipher, + int key_type, + GByteArray *data, + const char *iv, + const gsize iv_len, + const char *key, + const gsize key_len, + gsize *out_len, + GError **error); + +char * crypto_encrypt (const char *cipher, + const GByteArray *data, + const char *iv, + gsize iv_len, + const char *key, + gsize key_len, + gsize *out_len, + GError **error); + +gboolean crypto_randomize (void *buffer, gsize buffer_len, GError **error); + +NMCryptoFileFormat crypto_verify_cert (const unsigned char *data, + gsize len, + GError **error); + +gboolean crypto_verify_pkcs12 (const GByteArray *data, + const char *password, + GError **error); + diff --git a/libnm-util/crypto_gnutls.c b/libnm-util/crypto_gnutls.c new file mode 100644 index 00000000..edfc16af --- /dev/null +++ b/libnm-util/crypto_gnutls.c @@ -0,0 +1,448 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager Wireless Applet -- Display wireless access points and allow user control + * + * Dan Williams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2009 Red Hat, Inc. + */ + +#include +#include + +#include +#include +#include +#include + +#include "crypto.h" + +#define SALT_LEN 8 + +static gboolean initialized = FALSE; + +gboolean +crypto_init (GError **error) +{ + if (initialized) + return TRUE; + + if (gnutls_global_init() != 0) { + gnutls_global_deinit(); + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_INIT_FAILED, + "%s", + _("Failed to initialize the crypto engine.")); + return FALSE; + } + + initialized = TRUE; + return TRUE; +} + +void +crypto_deinit (void) +{ + if (initialized) + gnutls_global_deinit(); +} + +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_ERR_MD5_INIT_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, + GByteArray *data, + const char *iv, + const gsize iv_len, + const char *key, + const gsize key_len, + gsize *out_len, + GError **error) +{ + gcry_cipher_hd_t ctx; + gcry_error_t err; + int cipher_mech, i; + char *output = NULL; + gboolean success = FALSE; + gsize pad_len, real_iv_len; + + if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) { + cipher_mech = GCRY_CIPHER_3DES; + real_iv_len = SALT_LEN; + } else if (!strcmp (cipher, CIPHER_DES_CBC)) { + cipher_mech = GCRY_CIPHER_DES; + real_iv_len = SALT_LEN; + } else { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_UNKNOWN_CIPHER, + _("Private key cipher '%s' was unknown."), + cipher); + return NULL; + } + + if (iv_len < real_iv_len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_RAW_IV_INVALID, + _("Invalid IV length (must be at least %zd)."), + real_iv_len); + return NULL; + } + + output = g_malloc0 (data->len); + if (!output) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory for decrypted key buffer.")); + return NULL; + } + + err = gcry_cipher_open (&ctx, cipher_mech, GCRY_CIPHER_MODE_CBC, 0); + if (err) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + _("Failed to initialize the decryption cipher context: %s / %s."), + gcry_strsource (err), gcry_strerror (err)); + goto out; + } + + err = gcry_cipher_setkey (ctx, key, key_len); + if (err) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_SET_KEY_FAILED, + _("Failed to set symmetric key for decryption: %s / %s."), + gcry_strsource (err), gcry_strerror (err)); + goto out; + } + + err = gcry_cipher_setiv (ctx, iv, iv_len); + if (err) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_SET_IV_FAILED, + _("Failed to set IV for decryption: %s / %s."), + gcry_strsource (err), gcry_strerror (err)); + goto out; + } + + err = gcry_cipher_decrypt (ctx, output, data->len, data->data, data->len); + if (err) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to decrypt the private key: %s / %s."), + gcry_strsource (err), gcry_strerror (err)); + goto out; + } + pad_len = output[data->len - 1]; + + /* Check if the padding at the end of the decrypted data is valid */ + if (pad_len == 0 || pad_len > real_iv_len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to decrypt the private key: unexpected padding length.")); + goto out; + } + + /* Validate tail padding; last byte is the padding size, and all pad bytes + * should contain the padding size. + */ + for (i = 1; i <= pad_len; ++i) { + if (output[data->len - i] != pad_len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to decrypt the private key.")); + goto out; + } + } + + *out_len = data->len - pad_len; + success = TRUE; + +out: + if (!success) { + if (output) { + /* Don't expose key material */ + memset (output, 0, data->len); + g_free (output); + output = NULL; + } + } + gcry_cipher_close (ctx); + return output; +} + +char * +crypto_encrypt (const char *cipher, + const GByteArray *data, + const char *iv, + const gsize iv_len, + const char *key, + gsize key_len, + gsize *out_len, + GError **error) +{ + gcry_cipher_hd_t ctx; + gcry_error_t err; + int cipher_mech; + char *output = NULL; + gboolean success = FALSE; + gsize padded_buf_len, pad_len, output_len; + char *padded_buf = NULL; + guint32 i; + + if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) + cipher_mech = GCRY_CIPHER_3DES; + else { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_UNKNOWN_CIPHER, + _("Private key cipher '%s' was unknown."), + cipher); + return NULL; + } + + /* If data->len % ivlen == 0, then we add another complete block + * onto the end so that the decrypter knows there's padding. + */ + pad_len = iv_len - (data->len % iv_len); + output_len = padded_buf_len = data->len + pad_len; + padded_buf = g_malloc0 (padded_buf_len); + + memcpy (padded_buf, data->data, data->len); + for (i = 0; i < pad_len; i++) + padded_buf[data->len + i] = (guint8) (pad_len & 0xFF); + + output = g_malloc0 (output_len); + if (!output) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Could not allocate memory for encrypting.")); + return NULL; + } + + err = gcry_cipher_open (&ctx, cipher_mech, GCRY_CIPHER_MODE_CBC, 0); + if (err) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + _("Failed to initialize the encryption cipher context: %s / %s."), + gcry_strsource (err), gcry_strerror (err)); + goto out; + } + + err = gcry_cipher_setkey (ctx, key, key_len); + if (err) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_SET_KEY_FAILED, + _("Failed to set symmetric key for encryption: %s / %s."), + gcry_strsource (err), gcry_strerror (err)); + goto out; + } + + /* gcrypt only wants 8 bytes of the IV (same as the DES block length) */ + err = gcry_cipher_setiv (ctx, iv, SALT_LEN); + if (err) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_SET_IV_FAILED, + _("Failed to set IV for encryption: %s / %s."), + gcry_strsource (err), gcry_strerror (err)); + goto out; + } + + err = gcry_cipher_encrypt (ctx, output, output_len, padded_buf, padded_buf_len); + if (err) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to encrypt the data: %s / %s."), + gcry_strsource (err), gcry_strerror (err)); + goto out; + } + + *out_len = output_len; + success = TRUE; + +out: + if (padded_buf) { + memset (padded_buf, 0, padded_buf_len); + g_free (padded_buf); + padded_buf = NULL; + } + + if (!success) { + if (output) { + /* Don't expose key material */ + memset (output, 0, output_len); + g_free (output); + output = NULL; + } + } + gcry_cipher_close (ctx); + return output; +} + +NMCryptoFileFormat +crypto_verify_cert (const unsigned char *data, + gsize len, + GError **error) +{ + gnutls_x509_crt_t der; + gnutls_datum dt; + int err; + + err = gnutls_x509_crt_init (&der); + if (err < 0) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CERT_FORMAT_INVALID, + _("Error initializing certificate data: %s"), + gnutls_strerror (err)); + return NM_CRYPTO_FILE_FORMAT_UNKNOWN; + } + + /* Try DER first */ + dt.data = (unsigned char *) data; + dt.size = len; + err = gnutls_x509_crt_import (der, &dt, GNUTLS_X509_FMT_DER); + if (err == GNUTLS_E_SUCCESS) { + gnutls_x509_crt_deinit (der); + return NM_CRYPTO_FILE_FORMAT_X509; + } + + /* And PEM next */ + err = gnutls_x509_crt_import (der, &dt, GNUTLS_X509_FMT_PEM); + gnutls_x509_crt_deinit (der); + if (err == GNUTLS_E_SUCCESS) + return NM_CRYPTO_FILE_FORMAT_X509; + + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CERT_FORMAT_INVALID, + _("Couldn't decode certificate: %s"), + gnutls_strerror (err)); + return NM_CRYPTO_FILE_FORMAT_UNKNOWN; +} + +gboolean +crypto_verify_pkcs12 (const GByteArray *data, + const char *password, + GError **error) +{ + gnutls_pkcs12_t p12; + gnutls_datum dt; + gboolean success = FALSE; + int err; + + g_return_val_if_fail (data != NULL, FALSE); + + dt.data = (unsigned char *) data->data; + dt.size = data->len; + + err = gnutls_pkcs12_init (&p12); + if (err < 0) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_DECODE_FAILED, + _("Couldn't initialize PKCS#12 decoder: %s"), + gnutls_strerror (err)); + return FALSE; + } + + /* DER first */ + err = gnutls_pkcs12_import (p12, &dt, GNUTLS_X509_FMT_DER, 0); + if (err < 0) { + /* PEM next */ + err = gnutls_pkcs12_import (p12, &dt, GNUTLS_X509_FMT_PEM, 0); + if (err < 0) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Couldn't decode PKCS#12 file: %s"), + gnutls_strerror (err)); + goto out; + } + } + + err = gnutls_pkcs12_verify_mac (p12, password); + if (err == GNUTLS_E_SUCCESS) + success = TRUE; + else { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Couldn't verify PKCS#12 file: %s"), + gnutls_strerror (err)); + } + +out: + gnutls_pkcs12_deinit (p12); + return success; +} + +gboolean +crypto_randomize (void *buffer, gsize buffer_len, GError **error) +{ + gcry_randomize (buffer, buffer_len, GCRY_STRONG_RANDOM); + return TRUE; +} + diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c new file mode 100644 index 00000000..490d5fe9 --- /dev/null +++ b/libnm-util/crypto_nss.c @@ -0,0 +1,562 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2009 Red Hat, Inc. + */ + +#include "config.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "crypto.h" + +static gboolean initialized = FALSE; + +gboolean +crypto_init (GError **error) +{ + SECStatus ret; + + if (initialized) + return TRUE; + + PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 1); + ret = NSS_NoDB_Init (NULL); + if (ret != SECSuccess) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_INIT_FAILED, + _("Failed to initialize the crypto engine: %d."), + PR_GetError ()); + PR_Cleanup (); + return FALSE; + } + + SEC_PKCS12EnableCipher(PKCS12_RC4_40, 1); + SEC_PKCS12EnableCipher(PKCS12_RC4_128, 1); + SEC_PKCS12EnableCipher(PKCS12_RC2_CBC_40, 1); + SEC_PKCS12EnableCipher(PKCS12_RC2_CBC_128, 1); + SEC_PKCS12EnableCipher(PKCS12_DES_56, 1); + SEC_PKCS12EnableCipher(PKCS12_DES_EDE3_168, 1); + SEC_PKCS12SetPreferredCipher(PKCS12_DES_EDE3_168, 1); + + initialized = TRUE; + return TRUE; +} + +void +crypto_deinit (void) +{ + if (initialized) { + NSS_Shutdown (); + PR_Cleanup (); + } +} + +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_ERR_MD5_INIT_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, + GByteArray *data, + const char *iv, + const gsize iv_len, + const char *key, + const gsize key_len, + gsize *out_len, + GError **error) +{ + char *output = NULL; + int decrypted_len = 0; + CK_MECHANISM_TYPE cipher_mech; + PK11SlotInfo *slot = NULL; + SECItem key_item; + PK11SymKey *sym_key = NULL; + SECItem *sec_param = NULL; + PK11Context *ctx = NULL; + SECStatus s; + gboolean success = FALSE; + unsigned int pad_len = 0, extra = 0; + guint32 i, real_iv_len = 0; + + if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) { + cipher_mech = CKM_DES3_CBC_PAD; + real_iv_len = 8; + } else if (!strcmp (cipher, CIPHER_DES_CBC)) { + cipher_mech = CKM_DES_CBC_PAD; + real_iv_len = 8; + } else { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_UNKNOWN_CIPHER, + _("Private key cipher '%s' was unknown."), + cipher); + return NULL; + } + + if (iv_len < real_iv_len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_RAW_IV_INVALID, + _("Invalid IV length (must be at least %d)."), + real_iv_len); + return NULL; + } + + output = g_malloc0 (data->len); + if (!output) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory for decrypted key buffer.")); + return NULL; + } + + slot = PK11_GetBestSlot (cipher_mech, NULL); + if (!slot) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + _("Failed to initialize the decryption cipher slot.")); + goto out; + } + + key_item.data = (unsigned char *) key; + key_item.len = key_len; + sym_key = PK11_ImportSymKey (slot, cipher_mech, PK11_OriginUnwrap, CKA_DECRYPT, &key_item, NULL); + if (!sym_key) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_SET_KEY_FAILED, + _("Failed to set symmetric key for decryption.")); + goto out; + } + + key_item.data = (unsigned char *) iv; + key_item.len = real_iv_len; + sec_param = PK11_ParamFromIV (cipher_mech, &key_item); + if (!sec_param) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_SET_IV_FAILED, + _("Failed to set IV for decryption.")); + goto out; + } + + ctx = PK11_CreateContextBySymKey (cipher_mech, CKA_DECRYPT, sym_key, sec_param); + if (!ctx) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + _("Failed to initialize the decryption context.")); + goto out; + } + + s = PK11_CipherOp (ctx, + (unsigned char *) output, + &decrypted_len, + data->len, + data->data, + data->len); + if (s != SECSuccess) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to decrypt the private key: %d."), + PORT_GetError ()); + goto out; + } + + if (decrypted_len > data->len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to decrypt the private key: decrypted data too large.")); + goto out; + } + + s = PK11_DigestFinal (ctx, + (unsigned char *) (output + decrypted_len), + &extra, + data->len - decrypted_len); + if (s != SECSuccess) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to finalize decryption of the private key: %d."), + PORT_GetError ()); + goto out; + } + decrypted_len += extra; + pad_len = data->len - decrypted_len; + + /* Check if the padding at the end of the decrypted data is valid */ + if (pad_len == 0 || pad_len > real_iv_len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to decrypt the private key: unexpected padding length.")); + goto out; + } + + /* Validate tail padding; last byte is the padding size, and all pad bytes + * should contain the padding size. + */ + for (i = pad_len; i > 0; i--) { + if (output[data->len - i] != pad_len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Failed to decrypt the private key.")); + goto out; + } + } + + *out_len = decrypted_len; + success = TRUE; + +out: + if (ctx) + PK11_DestroyContext (ctx, PR_TRUE); + if (sym_key) + PK11_FreeSymKey (sym_key); + if (sec_param) + SECITEM_FreeItem (sec_param, PR_TRUE); + if (slot) + PK11_FreeSlot (slot); + + if (!success) { + if (output) { + /* Don't expose key material */ + memset (output, 0, data->len); + g_free (output); + output = NULL; + } + } + return output; +} + +char * +crypto_encrypt (const char *cipher, + const GByteArray *data, + const char *iv, + gsize iv_len, + const char *key, + gsize key_len, + gsize *out_len, + GError **error) +{ + SECStatus ret; + CK_MECHANISM_TYPE cipher_mech = CKM_DES3_CBC_PAD; + PK11SlotInfo *slot = NULL; + SECItem key_item = { .data = (unsigned char *) key, .len = key_len }; + SECItem iv_item = { .data = (unsigned char *) iv, .len = iv_len }; + PK11SymKey *sym_key = NULL; + SECItem *sec_param = NULL; + PK11Context *ctx = NULL; + unsigned char *output, *padded_buf; + gsize output_len; + int encrypted_len = 0, i; + gboolean success = FALSE; + gsize padded_buf_len, pad_len; + + if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) + cipher_mech = CKM_DES3_CBC_PAD; + else { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_UNKNOWN_CIPHER, + _("Private key cipher '%s' was unknown."), + cipher); + return NULL; + } + + /* If data->len % ivlen == 0, then we add another complete block + * onto the end so that the decrypter knows there's padding. + */ + pad_len = iv_len - (data->len % iv_len); + output_len = padded_buf_len = data->len + pad_len; + padded_buf = g_malloc0 (padded_buf_len); + + memcpy (padded_buf, data->data, data->len); + for (i = 0; i < pad_len; i++) + padded_buf[data->len + i] = (guint8) (pad_len & 0xFF); + + output = g_malloc0 (output_len); + if (!output) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Could not allocate memory for encrypting.")); + return NULL; + } + + slot = PK11_GetBestSlot (cipher_mech, NULL); + if (!slot) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + _("Failed to initialize the encryption cipher slot.")); + goto out; + } + + sym_key = PK11_ImportSymKey (slot, cipher_mech, PK11_OriginUnwrap, CKA_ENCRYPT, &key_item, NULL); + if (!sym_key) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_SET_KEY_FAILED, + _("Failed to set symmetric key for encryption.")); + goto out; + } + + sec_param = PK11_ParamFromIV (cipher_mech, &iv_item); + if (!sec_param) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_SET_IV_FAILED, + _("Failed to set IV for encryption.")); + goto out; + } + + ctx = PK11_CreateContextBySymKey (cipher_mech, CKA_ENCRYPT, sym_key, sec_param); + if (!ctx) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + _("Failed to initialize the encryption context.")); + goto out; + } + + ret = PK11_CipherOp (ctx, output, &encrypted_len, output_len, padded_buf, padded_buf_len); + if (ret != SECSuccess) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_ENCRYPT_FAILED, + _("Failed to encrypt: %d."), + PORT_GetError ()); + goto out; + } + + if (encrypted_len != output_len) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_ENCRYPT_FAILED, + _("Unexpected amount of data after encrypting.")); + goto out; + } + + *out_len = encrypted_len; + success = TRUE; + +out: + if (ctx) + PK11_DestroyContext (ctx, PR_TRUE); + if (sym_key) + PK11_FreeSymKey (sym_key); + if (sec_param) + SECITEM_FreeItem (sec_param, PR_TRUE); + if (slot) + PK11_FreeSlot (slot); + + if (padded_buf) { + memset (padded_buf, 0, padded_buf_len); + g_free (padded_buf); + padded_buf = NULL; + } + + if (!success) { + memset (output, 0, output_len); + g_free (output); + output = NULL; + } + return (char *) output; +} + +NMCryptoFileFormat +crypto_verify_cert (const unsigned char *data, + gsize len, + GError **error) +{ + CERTCertificate *cert; + + /* Try DER/PEM first */ + cert = CERT_DecodeCertFromPackage ((char *) data, len); + if (!cert) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CERT_FORMAT_INVALID, + _("Couldn't decode certificate: %d"), + PORT_GetError()); + return NM_CRYPTO_FILE_FORMAT_UNKNOWN; + } + + CERT_DestroyCertificate (cert); + return NM_CRYPTO_FILE_FORMAT_X509; +} + +gboolean +crypto_verify_pkcs12 (const GByteArray *data, + const char *password, + GError **error) +{ + SEC_PKCS12DecoderContext *p12ctx = NULL; + SECItem pw = { 0 }; + PK11SlotInfo *slot = NULL; + SECStatus s; + char *ucs2_password; + glong ucs2_chars = 0; +#ifndef WORDS_BIGENDIAN + guint16 *p; +#endif /* WORDS_BIGENDIAN */ + + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + /* PKCS#12 passwords are apparently UCS2 BIG ENDIAN, and NSS doesn't do + * any conversions for us. + */ + if (password && strlen (password)) { + ucs2_password = (char *) g_utf8_to_utf16 (password, strlen (password), NULL, &ucs2_chars, NULL); + if (!ucs2_password || !ucs2_chars) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_INVALID_PASSWORD, + _("Couldn't convert password to UCS2: %d"), + PORT_GetError()); + return FALSE; + } + + ucs2_chars *= 2; /* convert # UCS2 characters -> bytes */ + pw.data = PORT_ZAlloc(ucs2_chars + 2); + memcpy (pw.data, ucs2_password, ucs2_chars); + pw.len = ucs2_chars + 2; /* include terminating NULL */ + + memset (ucs2_password, 0, ucs2_chars); + g_free (ucs2_password); + +#ifndef WORDS_BIGENDIAN + for (p = (guint16 *) pw.data; p < (guint16 *) (pw.data + pw.len); p++) + *p = GUINT16_SWAP_LE_BE (*p); +#endif /* WORDS_BIGENDIAN */ + } else { + /* NULL password */ + pw.data = NULL; + pw.len = 0; + } + + slot = PK11_GetInternalKeySlot(); + p12ctx = SEC_PKCS12DecoderStart (&pw, slot, NULL, NULL, NULL, NULL, NULL, NULL); + if (!p12ctx) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_DECODE_FAILED, + _("Couldn't initialize PKCS#12 decoder: %d"), + PORT_GetError()); + goto error; + } + + s = SEC_PKCS12DecoderUpdate (p12ctx, data->data, data->len); + if (s != SECSuccess) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_FILE_FORMAT_INVALID, + _("Couldn't decode PKCS#12 file: %d"), + PORT_GetError()); + goto error; + } + + s = SEC_PKCS12DecoderVerify (p12ctx); + if (s != SECSuccess) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, + _("Couldn't verify PKCS#12 file: %d"), + PORT_GetError()); + goto error; + } + + SEC_PKCS12DecoderFinish (p12ctx); + SECITEM_ZfreeItem (&pw, PR_FALSE); + return TRUE; + +error: + if (p12ctx) + SEC_PKCS12DecoderFinish (p12ctx); + + if (slot) + PK11_FreeSlot(slot); + + SECITEM_ZfreeItem (&pw, PR_FALSE); + return FALSE; +} + +gboolean +crypto_randomize (void *buffer, gsize buffer_len, GError **error) +{ + SECStatus s; + + s = PK11_GenerateRandom (buffer, buffer_len); + if (s != SECSuccess) { + g_set_error_literal (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_RANDOMIZE_FAILED, + _("Could not generate random data.")); + return FALSE; + } + return TRUE; +} + diff --git a/libnm-util/libnm-util.pc.in b/libnm-util/libnm-util.pc.in new file mode 100644 index 00000000..a6e8ee59 --- /dev/null +++ b/libnm-util/libnm-util.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libnm-util +Description: Convenience library for clients of NetworkManager +Version: @VERSION@ +Requires: glib-2.0 dbus-glib-1 +Cflags: -I${includedir}/NetworkManager +Libs: -L${libdir} -lnm-util + + diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver new file mode 100644 index 00000000..ed1d8a48 --- /dev/null +++ b/libnm-util/libnm-util.ver @@ -0,0 +1,394 @@ +{ +global: + nm_connection_add_setting; + nm_connection_clear_secrets; + nm_connection_compare; + nm_connection_create_setting; + nm_connection_dump; + nm_connection_duplicate; + nm_connection_error_get_type; + nm_connection_error_quark; + nm_connection_for_each_setting_value; + nm_connection_get_path; + nm_connection_get_scope; + nm_connection_get_setting; + nm_connection_get_setting_by_name; + nm_connection_get_type; + nm_connection_lookup_setting_type; + nm_connection_lookup_setting_type_by_quark; + nm_connection_need_secrets; + nm_connection_new; + nm_connection_new_from_hash; + nm_connection_remove_setting; + nm_connection_replace_settings; + nm_connection_set_path; + nm_connection_set_scope; + nm_connection_to_hash; + nm_connection_update_secrets; + nm_connection_verify; + nm_setting_802_1x_add_eap_method; + nm_setting_802_1x_clear_eap_methods; + nm_setting_802_1x_error_get_type; + nm_setting_802_1x_error_quark; + nm_setting_802_1x_get_anonymous_identity; + nm_setting_802_1x_get_ca_cert; + nm_setting_802_1x_get_ca_cert_blob; + nm_setting_802_1x_set_ca_cert_from_file; + nm_setting_802_1x_get_ca_cert_path; + nm_setting_802_1x_get_ca_cert_scheme; + nm_setting_802_1x_set_ca_cert; + nm_setting_802_1x_get_ca_path; + nm_setting_802_1x_get_client_cert; + nm_setting_802_1x_get_client_cert_blob; + nm_setting_802_1x_set_client_cert_from_file; + nm_setting_802_1x_get_client_cert_path; + nm_setting_802_1x_get_client_cert_scheme; + nm_setting_802_1x_set_client_cert; + nm_setting_802_1x_get_eap_method; + nm_setting_802_1x_get_identity; + nm_setting_802_1x_get_num_eap_methods; + nm_setting_802_1x_get_password; + nm_setting_802_1x_get_phase1_fast_provisioning; + nm_setting_802_1x_get_phase1_peaplabel; + nm_setting_802_1x_get_phase1_peapver; + nm_setting_802_1x_get_phase2_auth; + nm_setting_802_1x_get_phase2_autheap; + nm_setting_802_1x_get_phase2_ca_cert; + nm_setting_802_1x_get_phase2_ca_cert_blob; + nm_setting_802_1x_set_phase2_ca_cert_from_file; + nm_setting_802_1x_get_phase2_ca_cert_path; + nm_setting_802_1x_get_phase2_ca_cert_scheme; + nm_setting_802_1x_set_phase2_ca_cert; + nm_setting_802_1x_get_phase2_ca_path; + nm_setting_802_1x_get_phase2_client_cert; + nm_setting_802_1x_get_phase2_client_cert_blob; + nm_setting_802_1x_set_phase2_client_cert_from_file; + nm_setting_802_1x_get_phase2_client_cert_path; + nm_setting_802_1x_get_phase2_client_cert_scheme; + nm_setting_802_1x_set_phase2_client_cert; + nm_setting_802_1x_get_phase2_private_key; + nm_setting_802_1x_get_phase2_private_key_blob; + nm_setting_802_1x_get_phase2_private_key_format; + nm_setting_802_1x_set_phase2_private_key_from_file; + nm_setting_802_1x_get_phase2_private_key_password; + nm_setting_802_1x_get_phase2_private_key_path; + nm_setting_802_1x_get_phase2_private_key_scheme; + nm_setting_802_1x_get_phase2_private_key_type; + nm_setting_802_1x_set_phase2_private_key; + nm_setting_802_1x_get_pin; + nm_setting_802_1x_get_private_key; + nm_setting_802_1x_get_private_key_blob; + nm_setting_802_1x_get_private_key_format; + nm_setting_802_1x_set_private_key_from_file; + nm_setting_802_1x_get_private_key_password; + nm_setting_802_1x_get_private_key_path; + nm_setting_802_1x_get_private_key_scheme; + nm_setting_802_1x_get_private_key_type; + nm_setting_802_1x_set_private_key; + nm_setting_802_1x_get_psk; + nm_setting_802_1x_get_system_ca_certs; + nm_setting_802_1x_get_type; + nm_setting_802_1x_new; + nm_setting_802_1x_remove_eap_method; + nm_setting_bluetooth_error_get_type; + nm_setting_bluetooth_error_quark; + nm_setting_bluetooth_get_type; + nm_setting_bluetooth_new; + nm_setting_bluetooth_get_bdaddr; + nm_setting_bluetooth_get_connection_type; + nm_setting_cdma_error_get_type; + nm_setting_cdma_error_quark; + nm_setting_cdma_get_type; + nm_setting_cdma_new; + nm_setting_cdma_get_number; + nm_setting_cdma_get_username; + nm_setting_cdma_get_password; + nm_setting_clear_secrets; + nm_setting_compare; + nm_setting_connection_error_get_type; + nm_setting_connection_error_quark; + nm_setting_connection_get_type; + nm_setting_connection_new; + nm_setting_connection_get_id; + nm_setting_connection_get_uuid; + nm_setting_connection_get_connection_type; + nm_setting_connection_get_autoconnect; + nm_setting_connection_get_timestamp; + nm_setting_connection_get_read_only; + nm_setting_duplicate; + nm_setting_enumerate_values; + nm_setting_error_get_type; + nm_setting_error_quark; + nm_setting_new_from_hash; + nm_setting_get_name; + nm_setting_get_type; + nm_setting_gsm_error_get_type; + nm_setting_gsm_error_quark; + nm_setting_gsm_get_type; + nm_setting_gsm_new; + nm_setting_gsm_get_number; + nm_setting_gsm_get_username; + nm_setting_gsm_get_password; + nm_setting_gsm_get_apn; + nm_setting_gsm_get_network_id; + nm_setting_gsm_get_network_type; + nm_setting_gsm_get_allowed_bands; + nm_setting_gsm_get_band; + nm_setting_gsm_get_pin; + nm_setting_gsm_get_puk; + nm_setting_gsm_get_home_only; + nm_setting_ip4_config_error_get_type; + nm_setting_ip4_config_error_quark; + nm_setting_ip4_config_get_type; + nm_setting_ip4_config_new; + nm_setting_ip4_config_get_method; + nm_setting_ip4_config_get_num_dns; + nm_setting_ip4_config_get_dns; + nm_setting_ip4_config_add_dns; + nm_setting_ip4_config_remove_dns; + nm_setting_ip4_config_clear_dns; + nm_setting_ip4_config_get_num_dns_searches; + nm_setting_ip4_config_get_dns_search; + nm_setting_ip4_config_add_dns_search; + nm_setting_ip4_config_remove_dns_search; + nm_setting_ip4_config_clear_dns_searches; + nm_setting_ip4_config_get_num_addresses; + nm_setting_ip4_config_get_address; + nm_setting_ip4_config_add_address; + nm_setting_ip4_config_remove_address; + nm_setting_ip4_config_clear_addresses; + nm_setting_ip4_config_get_num_routes; + nm_setting_ip4_config_get_route; + nm_setting_ip4_config_add_route; + nm_setting_ip4_config_remove_route; + nm_setting_ip4_config_clear_routes; + nm_setting_ip4_config_get_ignore_auto_routes; + nm_setting_ip4_config_get_ignore_auto_dns; + 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_never_default; + nm_setting_ip4_config_get_may_fail; + nm_ip6_address_new; + nm_ip6_address_dup; + nm_ip6_address_ref; + nm_ip6_address_unref; + nm_ip6_address_compare; + nm_ip6_address_get_address; + nm_ip6_address_set_address; + nm_ip6_address_get_gateway; + nm_ip6_address_set_gateway; + nm_ip6_address_get_prefix; + nm_ip6_address_set_prefix; + nm_ip6_route_new; + nm_ip6_route_dup; + nm_ip6_route_ref; + nm_ip6_route_unref; + nm_ip6_route_compare; + nm_ip6_route_get_dest; + nm_ip6_route_set_dest; + nm_ip6_route_get_prefix; + nm_ip6_route_set_prefix; + nm_ip6_route_get_next_hop; + nm_ip6_route_set_next_hop; + nm_ip6_route_get_metric; + nm_ip6_route_set_metric; + nm_setting_ip6_config_error_get_type; + nm_setting_ip6_config_error_quark; + nm_setting_ip6_config_get_type; + nm_setting_ip6_config_new; + nm_setting_ip6_config_get_method; + nm_setting_ip6_config_get_num_dns; + nm_setting_ip6_config_get_dns; + nm_setting_ip6_config_add_dns; + nm_setting_ip6_config_remove_dns; + nm_setting_ip6_config_clear_dns; + nm_setting_ip6_config_get_num_dns_searches; + nm_setting_ip6_config_get_dns_search; + nm_setting_ip6_config_add_dns_search; + nm_setting_ip6_config_remove_dns_search; + nm_setting_ip6_config_clear_dns_searches; + nm_setting_ip6_config_get_num_addresses; + nm_setting_ip6_config_get_address; + nm_setting_ip6_config_add_address; + nm_setting_ip6_config_remove_address; + nm_setting_ip6_config_clear_addresses; + nm_setting_ip6_config_get_num_routes; + nm_setting_ip6_config_get_route; + nm_setting_ip6_config_add_route; + nm_setting_ip6_config_remove_route; + nm_setting_ip6_config_clear_routes; + nm_setting_ip6_config_get_ignore_auto_routes; + nm_setting_ip6_config_get_ignore_auto_dns; + nm_setting_ip6_config_get_never_default; + nm_setting_ip6_config_get_may_fail; + nm_setting_need_secrets; + nm_setting_ppp_error_get_type; + nm_setting_ppp_error_quark; + nm_setting_ppp_get_type; + nm_setting_ppp_new; + nm_setting_ppp_get_noauth; + nm_setting_ppp_get_refuse_eap; + nm_setting_ppp_get_refuse_pap; + nm_setting_ppp_get_refuse_chap; + nm_setting_ppp_get_refuse_mschap; + nm_setting_ppp_get_refuse_mschapv2; + nm_setting_ppp_get_nobsdcomp; + nm_setting_ppp_get_nodeflate; + nm_setting_ppp_get_no_vj_comp; + nm_setting_ppp_get_require_mppe; + nm_setting_ppp_get_require_mppe_128; + nm_setting_ppp_get_mppe_stateful; + nm_setting_ppp_get_crtscts; + nm_setting_ppp_get_baud; + nm_setting_ppp_get_mru; + nm_setting_ppp_get_mtu; + nm_setting_ppp_get_lcp_echo_failure; + nm_setting_ppp_get_lcp_echo_interval; + nm_setting_pppoe_error_get_type; + nm_setting_pppoe_error_quark; + nm_setting_pppoe_get_type; + nm_setting_pppoe_new; + nm_setting_pppoe_get_service; + nm_setting_pppoe_get_username; + nm_setting_pppoe_get_password; + nm_setting_serial_error_get_type; + nm_setting_serial_error_quark; + nm_setting_serial_get_type; + nm_setting_serial_new; + nm_setting_serial_get_baud; + nm_setting_serial_get_bits; + nm_setting_serial_get_parity; + nm_setting_serial_get_stopbits; + nm_setting_serial_get_send_delay; + nm_setting_to_hash; + nm_setting_to_string; + nm_setting_update_secrets; + nm_setting_verify; + nm_setting_vpn_error_get_type; + nm_setting_vpn_error_quark; + nm_setting_vpn_get_type; + nm_setting_vpn_new; + nm_setting_vpn_get_service_type; + nm_setting_vpn_get_user_name; + nm_setting_vpn_add_data_item; + nm_setting_vpn_foreach_data_item; + nm_setting_vpn_get_data_item; + nm_setting_vpn_remove_data_item; + nm_setting_vpn_add_secret; + nm_setting_vpn_foreach_secret; + nm_setting_vpn_get_secret; + nm_setting_vpn_remove_secret; + nm_setting_wired_error_get_type; + nm_setting_wired_error_quark; + nm_setting_wired_get_type; + nm_setting_wired_new; + nm_setting_wired_get_port; + nm_setting_wired_get_speed; + nm_setting_wired_get_duplex; + nm_setting_wired_get_auto_negotiate; + nm_setting_wired_get_mac_address; + nm_setting_wired_get_mtu; + nm_setting_wireless_ap_security_compatible; + nm_setting_wireless_error_get_type; + nm_setting_wireless_error_quark; + nm_setting_wireless_get_type; + nm_setting_wireless_new; + nm_setting_wireless_get_ssid; + nm_setting_wireless_get_mode; + nm_setting_wireless_get_band; + nm_setting_wireless_get_channel; + nm_setting_wireless_get_bssid; + nm_setting_wireless_get_rate; + nm_setting_wireless_get_tx_power; + nm_setting_wireless_get_mac_address; + nm_setting_wireless_get_mtu; + nm_setting_wireless_get_security; + nm_setting_wireless_add_seen_bssid; + nm_setting_wireless_get_num_seen_bssids; + nm_setting_wireless_get_seen_bssid; + nm_setting_wireless_security_add_proto; + nm_setting_wireless_security_add_pairwise; + nm_setting_wireless_security_add_group; + nm_setting_wireless_security_clear_groups; + nm_setting_wireless_security_clear_pairwise; + nm_setting_wireless_security_clear_protos; + nm_setting_wireless_security_error_get_type; + nm_setting_wireless_security_error_quark; + nm_setting_wireless_security_get_auth_alg; + nm_setting_wireless_security_get_group; + nm_setting_wireless_security_get_key_mgmt; + nm_setting_wireless_security_get_leap_username; + nm_setting_wireless_security_get_leap_password; + nm_setting_wireless_security_get_num_groups; + nm_setting_wireless_security_get_num_pairwise; + nm_setting_wireless_security_get_num_protos; + nm_setting_wireless_security_get_pairwise; + nm_setting_wireless_security_get_proto; + nm_setting_wireless_security_get_psk; + nm_setting_wireless_security_get_type; + nm_setting_wireless_security_get_wep_key; + nm_setting_wireless_security_get_wep_key_type; + nm_setting_wireless_security_get_wep_tx_keyidx; + nm_setting_wireless_security_new; + nm_setting_wireless_security_remove_group; + nm_setting_wireless_security_remove_pairwise; + nm_setting_wireless_security_remove_proto; + nm_setting_wireless_security_set_wep_key; + nm_setting_olpc_mesh_error_quark; + nm_setting_olpc_mesh_error_get_type; + nm_setting_olpc_mesh_get_type; + nm_setting_olpc_mesh_get_ssid; + nm_setting_olpc_mesh_get_channel; + nm_setting_olpc_mesh_get_dhcp_anycast_address; + nm_setting_olpc_mesh_new; + nm_utils_deinit; + nm_utils_rsa_key_encrypt; + nm_utils_escape_ssid; + nm_utils_gvalue_hash_dup; + nm_utils_init; + nm_utils_ip4_addresses_from_gvalue; + nm_utils_ip4_addresses_to_gvalue; + nm_utils_ip4_netmask_to_prefix; + nm_utils_ip4_prefix_to_netmask; + nm_utils_ip4_get_default_prefix; + nm_utils_ip4_routes_from_gvalue; + nm_utils_ip4_routes_to_gvalue; + nm_utils_ip6_addresses_from_gvalue; + nm_utils_ip6_addresses_to_gvalue; + nm_utils_ip6_routes_from_gvalue; + nm_utils_ip6_routes_to_gvalue; + nm_utils_is_empty_ssid; + nm_utils_same_ssid; + nm_utils_security_valid; + nm_utils_slist_free; + nm_utils_ssid_to_utf8; + nm_utils_uuid_generate; + nm_utils_uuid_generate_from_string; + nm_ip4_address_compare; + nm_ip4_address_dup; + nm_ip4_address_get_address; + nm_ip4_address_get_prefix; + nm_ip4_address_get_gateway; + nm_ip4_address_new; + nm_ip4_address_ref; + nm_ip4_address_set_address; + nm_ip4_address_set_prefix; + nm_ip4_address_set_gateway; + nm_ip4_address_unref; + nm_ip4_route_compare; + nm_ip4_route_dup; + nm_ip4_route_get_dest; + nm_ip4_route_get_prefix; + nm_ip4_route_get_next_hop; + nm_ip4_route_get_metric; + nm_ip4_route_new; + nm_ip4_route_ref; + nm_ip4_route_unref; + nm_ip4_route_set_dest; + nm_ip4_route_set_prefix; + nm_ip4_route_set_next_hop; + nm_ip4_route_set_metric; +local: + *; +}; diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c new file mode 100644 index 00000000..d9cdc270 --- /dev/null +++ b/libnm-util/nm-connection.c @@ -0,0 +1,1210 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2009 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include "nm-connection.h" +#include "nm-utils.h" +#include "nm-utils-private.h" + +#include "nm-setting-8021x.h" +#include "nm-setting-bluetooth.h" +#include "nm-setting-connection.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-ip6-config.h" +#include "nm-setting-ppp.h" +#include "nm-setting-pppoe.h" +#include "nm-setting-wired.h" +#include "nm-setting-wireless.h" +#include "nm-setting-wireless-security.h" +#include "nm-setting-vpn.h" +#include "nm-setting-olpc-mesh.h" + +#include "nm-setting-serial.h" +#include "nm-setting-gsm.h" +#include "nm-setting-cdma.h" + +/** + * SECTION:nm-connection + * @short_description: Describes a connection to specific network or provider + * @include: nm-connection.h + * + * An #NMConnection describes all the settings and configuration values that + * are necessary to configure network devices for operation on a specific + * network. Connections are the fundamental operating object for + * NetworkManager; no device is connected without a #NMConnection, or + * disconnected without having been connected with a #NMConnection. + * + * Each #NMConnection contains a list of #NMSetting objects usually referenced + * by name (using nm_connection_get_setting_by_name()) or by type (with + * nm_connection_get_setting()). The settings describe the actual parameters + * with which the network devices are configured, including device-specific + * parameters (MTU, SSID, APN, channel, rate, etc) and IP-level parameters + * (addresses, routes, addressing methods, etc). + * + * Most connections also have a %NMConnectionScope; a connection will be + * provided over D-Bus either by the user settings service + * (org.freedesktop.NetworkManagerUserSettings) running in an active user + * session, or by the system-wide system settings service + * (org.freedesktop.NetworkManagerSystemSettings) which provides connections + * for all users. + */ + +/** + * nm_connection_error_quark: + * + * Registers an error quark for #NMConnection if necessary. + * + * Returns: the error quark used for #NMConnection errors. + **/ +GQuark +nm_connection_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-connection-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_connection_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_CONNECTION_ERROR_UNKNOWN, "UnknownError"), + ENUM_ENTRY (NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND, "ConnectionSettingNotFound"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMConnectionError", values); + } + return etype; +} + +typedef struct { + GHashTable *settings; + + /* Type of the connection (system or user) */ + NMConnectionScope scope; + + /* D-Bus path of the connection, if any */ + char *path; +} NMConnectionPrivate; + +#define NM_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CONNECTION, NMConnectionPrivate)) + +G_DEFINE_TYPE (NMConnection, nm_connection, G_TYPE_OBJECT) + +enum { + PROP_0, + PROP_SCOPE, + PROP_PATH, + + LAST_PROP +}; + +enum { + SECRETS_UPDATED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static GHashTable *registered_settings = NULL; + +#define DEFAULT_MAP_SIZE 15 + +static struct SettingInfo { + const char *name; + GType type; + guint32 priority; + GQuark error_quark; +} default_map[DEFAULT_MAP_SIZE] = { { NULL } }; + +static void +setting_register (const char *name, GType type) +{ + g_return_if_fail (name != NULL); + g_return_if_fail (G_TYPE_IS_INSTANTIATABLE (type)); + + if (G_UNLIKELY (!registered_settings)) { + registered_settings = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) g_free); + } + + if (g_hash_table_lookup (registered_settings, name)) + g_warning ("Already have a creator function for '%s', overriding", name); + + g_hash_table_insert (registered_settings, g_strdup (name), g_strdup (g_type_name (type))); +} + +#if UNUSED +static void +setting_unregister (const char *name) +{ + if (registered_settings) + g_hash_table_remove (registered_settings, name); +} +#endif + +static void +register_one_setting (const char *name, GType type, GQuark error_quark, guint32 priority) +{ + static guint32 i = 0; + + g_return_if_fail (i < DEFAULT_MAP_SIZE); + g_return_if_fail (default_map[i].name == NULL); + + default_map[i].name = name; + default_map[i].type = type; + default_map[i].error_quark = error_quark; + default_map[i].priority = priority; + i++; + + setting_register (name, type); +} + +static void +register_default_settings (void) +{ + _nm_utils_register_value_transformations (); + + if (G_LIKELY (default_map[0].name)) + return; + + register_one_setting (NM_SETTING_CONNECTION_SETTING_NAME, + NM_TYPE_SETTING_CONNECTION, + NM_SETTING_CONNECTION_ERROR, + 0); + + register_one_setting (NM_SETTING_WIRED_SETTING_NAME, + NM_TYPE_SETTING_WIRED, + NM_SETTING_WIRED_ERROR, + 1); + + register_one_setting (NM_SETTING_WIRELESS_SETTING_NAME, + NM_TYPE_SETTING_WIRELESS, + NM_SETTING_WIRELESS_ERROR, + 1); + + register_one_setting (NM_SETTING_OLPC_MESH_SETTING_NAME, + NM_TYPE_SETTING_OLPC_MESH, + NM_SETTING_OLPC_MESH_ERROR, + 1); + + register_one_setting (NM_SETTING_GSM_SETTING_NAME, + NM_TYPE_SETTING_GSM, + NM_SETTING_GSM_ERROR, + 1); + + register_one_setting (NM_SETTING_CDMA_SETTING_NAME, + NM_TYPE_SETTING_CDMA, + NM_SETTING_CDMA_ERROR, + 1); + + register_one_setting (NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_TYPE_SETTING_BLUETOOTH, + NM_SETTING_BLUETOOTH_ERROR, + 1); + + register_one_setting (NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_TYPE_SETTING_WIRELESS_SECURITY, + NM_SETTING_WIRELESS_SECURITY_ERROR, + 2); + + register_one_setting (NM_SETTING_SERIAL_SETTING_NAME, + NM_TYPE_SETTING_SERIAL, + NM_SETTING_SERIAL_ERROR, + 2); + + register_one_setting (NM_SETTING_PPP_SETTING_NAME, + NM_TYPE_SETTING_PPP, + NM_SETTING_PPP_ERROR, + 3); + + register_one_setting (NM_SETTING_PPPOE_SETTING_NAME, + NM_TYPE_SETTING_PPPOE, + NM_SETTING_PPPOE_ERROR, + 3); + + register_one_setting (NM_SETTING_802_1X_SETTING_NAME, + NM_TYPE_SETTING_802_1X, + NM_SETTING_802_1X_ERROR, + 3); + + register_one_setting (NM_SETTING_VPN_SETTING_NAME, + NM_TYPE_SETTING_VPN, + NM_SETTING_VPN_ERROR, + 4); + + register_one_setting (NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_TYPE_SETTING_IP4_CONFIG, + NM_SETTING_IP4_CONFIG_ERROR, + 6); + + register_one_setting (NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_TYPE_SETTING_IP6_CONFIG, + NM_SETTING_IP6_CONFIG_ERROR, + 6); + + /* Be sure to update DEFAULT_MAP_SIZE if you add another setting!! */ +} + +static guint32 +get_priority_for_setting_type (GType type) +{ + int i; + + for (i = 0; default_map[i].name; i++) { + if (default_map[i].type == type) + return default_map[i].priority; + } + + return G_MAXUINT32; +} + +/** + * nm_connection_lookup_setting_type: + * @name: a setting name + * + * Returns the #GType of the setting's class for a given setting name. + * + * Returns: the #GType of the setting's class + **/ +GType +nm_connection_lookup_setting_type (const char *name) +{ + char *type_name; + GType type; + + g_return_val_if_fail (name != NULL, G_TYPE_NONE); + + if (!registered_settings) + register_default_settings (); + + type_name = (char *) g_hash_table_lookup (registered_settings, name); + if (type_name) { + type = g_type_from_name (type_name); + if (!type) + g_warning ("Can not get type for '%s'.", type_name); + } else { + type = 0; + g_warning ("Unknown setting '%s'", name); + } + + return type; +} + +/** + * nm_connection_lookup_setting_type_by_quark: + * @error_quark: a setting error quark + * + * Returns the #GType of the setting's class for a given setting error quark. + * Useful for figuring out which setting a returned error is for. + * + * Returns: the #GType of the setting's class + **/ +GType +nm_connection_lookup_setting_type_by_quark (GQuark error_quark) +{ + int i; + + for (i = 0; default_map[i].name; i++) { + if (default_map[i].error_quark == error_quark) + return default_map[i].type; + } + + return G_TYPE_INVALID; +} + +/** + * nm_connection_create_setting: + * @name: a setting name + * + * Create a new #NMSetting object of the desired type, given a setting name. + * + * Returns: the new setting object, or NULL if the setting name was unknown + **/ +NMSetting * +nm_connection_create_setting (const char *name) +{ + GType type; + NMSetting *setting = NULL; + + g_return_val_if_fail (name != NULL, NULL); + + type = nm_connection_lookup_setting_type (name); + if (type) + setting = (NMSetting *) g_object_new (type, NULL); + + return setting; +} + +static void +parse_one_setting (gpointer key, gpointer value, gpointer user_data) +{ + NMConnection *connection = (NMConnection *) user_data; + GType type; + NMSetting *setting = NULL; + + type = nm_connection_lookup_setting_type ((char *) key); + if (type) + setting = nm_setting_new_from_hash (type, (GHashTable *) value); + if (setting) + nm_connection_add_setting (connection, setting); +} + +/** + * nm_connection_add_setting: + * @connection: a #NMConnection + * @setting: the #NMSetting to add to the connection object + * + * Adds a #NMSetting to the connection, replacing any previous #NMSetting of the + * same name which has previously been added to the #NMConnection. The + * connection takes ownership of the #NMSetting object and does not increase + * the setting object's reference count. + **/ +void +nm_connection_add_setting (NMConnection *connection, NMSetting *setting) +{ + g_return_if_fail (NM_IS_CONNECTION (connection)); + g_return_if_fail (NM_IS_SETTING (setting)); + + g_hash_table_insert (NM_CONNECTION_GET_PRIVATE (connection)->settings, + g_strdup (G_OBJECT_TYPE_NAME (setting)), setting); +} + +/** + * nm_connection_remove_setting: + * @connection: a #NMConnection + * @setting_type: the #GType of the setting object to remove + * + * Removes the #NMSetting with the given #GType from the #NMConnection. This + * operation dereferences the #NMSetting object. + **/ +void +nm_connection_remove_setting (NMConnection *connection, GType setting_type) +{ + g_return_if_fail (NM_IS_CONNECTION (connection)); + g_return_if_fail (g_type_is_a (setting_type, NM_TYPE_SETTING)); + + g_hash_table_remove (NM_CONNECTION_GET_PRIVATE (connection)->settings, g_type_name (setting_type)); +} + +/** + * nm_connection_get_setting: + * @connection: a #NMConnection + * @setting_type: the #GType of the setting object to return + * + * Gets the #NMSetting with the given #GType, if one has been previously added + * to the #NMConnection. + * + * Returns: the #NMSetting, or NULL if no setting of that type was previously + * added to the #NMConnection + **/ +NMSetting * +nm_connection_get_setting (NMConnection *connection, GType setting_type) +{ + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + g_return_val_if_fail (g_type_is_a (setting_type, NM_TYPE_SETTING), NULL); + + return (NMSetting *) g_hash_table_lookup (NM_CONNECTION_GET_PRIVATE (connection)->settings, + g_type_name (setting_type)); +} + +/** + * nm_connection_get_setting_by_name: + * @connection: a #NMConnection + * @name: a setting name + * + * Gets the #NMSetting with the given name, if one has been previously added + * the the #NMConnection. + * + * Returns: the #NMSetting, or NULL if no setting with that name was previously + * added to the #NMConnection + **/ +NMSetting * +nm_connection_get_setting_by_name (NMConnection *connection, const char *name) +{ + GType type; + + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + g_return_val_if_fail (name != NULL, NULL); + + type = nm_connection_lookup_setting_type (name); + + return type ? nm_connection_get_setting (connection, type) : NULL; +} + +/** + * nm_connection_replace_settings: + * @connection: a #NMConnection + * @new_settings: a #GHashTable of settings + * @error: location to store error, or %NULL + * + * Returns: %TRUE if the settings were valid and added to the connection, %FALSE + * if they were not + **/ +gboolean +nm_connection_replace_settings (NMConnection *connection, + GHashTable *new_settings, + GError **error) +{ + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + g_return_val_if_fail (new_settings != NULL, FALSE); + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + g_hash_table_remove_all (NM_CONNECTION_GET_PRIVATE (connection)->settings); + g_hash_table_foreach (new_settings, parse_one_setting, connection); + + return nm_connection_verify (connection, error); +} + +typedef struct { + NMConnection *other; + gboolean failed; + NMSettingCompareFlags flags; +} CompareConnectionInfo; + +static void +compare_one_setting (gpointer key, gpointer value, gpointer user_data) +{ + NMSetting *setting = (NMSetting *) value; + CompareConnectionInfo *info = (CompareConnectionInfo *) user_data; + NMSetting *other_setting; + + if (info->failed) + return; + + other_setting = nm_connection_get_setting (info->other, G_OBJECT_TYPE (setting)); + if (other_setting) + info->failed = nm_setting_compare (setting, other_setting, info->flags) ? FALSE : TRUE; + else + info->failed = TRUE; +} + +/** + * nm_connection_compare: + * @a: a #NMConnection + * @b: a second #NMConnection to compare with the first + * @flags: compare flags, e.g. %NM_SETTING_COMPARE_FLAG_EXACT + * + * Compares two #NMConnection objects for similarity, with comparison behavior + * modified by a set of flags. See nm_setting_compare() for a description of + * each flag's behavior. + * + * Returns: %TRUE if the comparison succeeds, %FALSE if it does not + **/ +gboolean +nm_connection_compare (NMConnection *a, + NMConnection *b, + NMSettingCompareFlags flags) +{ + NMConnectionPrivate *priv; + CompareConnectionInfo info = { b, FALSE, flags }; + + if (!a && !b) + return TRUE; + + if (!a || !b) + return FALSE; + + priv = NM_CONNECTION_GET_PRIVATE (a); + g_hash_table_foreach (priv->settings, compare_one_setting, &info); + if (info.failed == FALSE) { + /* compare A to B, then if that is the same compare B to A to ensure + * that keys that are in B but not A will make the comparison fail. + */ + info.failed = FALSE; + info.other = a; + priv = NM_CONNECTION_GET_PRIVATE (b); + g_hash_table_foreach (priv->settings, compare_one_setting, &info); + } + + return info.failed ? FALSE : TRUE; +} + +typedef struct { + gboolean success; + GSList *all_settings; + GError **error; +} VerifySettingsInfo; + +static void +verify_one_setting (gpointer data, gpointer user_data) +{ + NMSetting *setting = NM_SETTING (data); + VerifySettingsInfo *info = (VerifySettingsInfo *) user_data; + + if (info->success) + info->success = nm_setting_verify (setting, info->all_settings, info->error); +} + +static void +hash_values_to_slist (gpointer key, gpointer value, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + + *list = g_slist_prepend (*list, value); +} + +/** + * nm_connection_verify: + * @connection: the #NMConnection to verify + * @error: location to store error, or %NULL + * + * Validates the connection and all its settings. Each setting's properties + * have allowed values, and some values are dependent on other values. For + * example, if a WiFi connection is security enabled, the #NMSettingWireless + * setting object's 'security' property must contain the setting name of the + * #NMSettingWirelessSecurity object, which must also be present in the + * connection for the connection to be valid. As another example, the + * #NMSettingWired object's 'mac-address' property must be a validly formatted + * MAC address. The returned #GError contains information about which + * setting and which property failed validation, and how it failed validation. + * + * Returns: %TRUE if the connection is valid, %FALSE if it is not + **/ +gboolean +nm_connection_verify (NMConnection *connection, GError **error) +{ + NMConnectionPrivate *priv; + NMSetting *s_con; + VerifySettingsInfo info; + + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + if (!NM_IS_CONNECTION (connection)) { + g_set_error (error, + NM_SETTING_CONNECTION_ERROR, + NM_SETTING_CONNECTION_ERROR_UNKNOWN, + "invalid connection; failed verification"); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + } + + priv = NM_CONNECTION_GET_PRIVATE (connection); + + /* First, make sure there's at least 'connection' setting */ + s_con = nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (!s_con) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND, + "connection setting not found"); + return FALSE; + } + + /* Now, run the verify function of each setting */ + memset (&info, 0, sizeof (info)); + info.success = TRUE; + info.error = error; + g_hash_table_foreach (priv->settings, hash_values_to_slist, &info.all_settings); + + g_slist_foreach (info.all_settings, verify_one_setting, &info); + g_slist_free (info.all_settings); + return info.success; +} + +/** + * nm_connection_update_secrets: + * @connection: the #NMConnection + * @setting_name: the setting object name to which the secrets apply + * @secrets: a #GHashTable mapping string:#GValue of setting property names and + * secrets + * @error: location to store error, or %NULL + * + * Update the specified setting's secrets, given a hash table of secrets + * intended for that setting (deserialized from D-Bus for example). + * + * Returns: %TRUE if the secrets were successfully updated and the connection + * is valid, %FALSE on failure or if the setting was never added to the connection + **/ +gboolean +nm_connection_update_secrets (NMConnection *connection, + const char *setting_name, + GHashTable *secrets, + GError **error) +{ + NMSetting *setting; + gboolean success; + + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + g_return_val_if_fail (setting_name != NULL, FALSE); + g_return_val_if_fail (secrets != NULL, FALSE); + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + setting = nm_connection_get_setting (connection, nm_connection_lookup_setting_type (setting_name)); + if (!setting) { + g_set_error (error, NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND, + "%s", setting_name); + return FALSE; + } + + success = nm_setting_update_secrets (setting, secrets, error); + if (success) + g_signal_emit (connection, signals[SECRETS_UPDATED], 0, setting_name); + return success; +} + +static gint +setting_priority_compare (gconstpointer a, gconstpointer b) +{ + guint32 prio_a, prio_b; + + prio_a = get_priority_for_setting_type (G_OBJECT_TYPE (NM_SETTING (a))); + prio_b = get_priority_for_setting_type (G_OBJECT_TYPE (NM_SETTING (b))); + + if (prio_a < prio_b) + return -1; + else if (prio_a == prio_b) + return 0; + return 1; +} + +static void +add_setting_to_list (gpointer key, gpointer data, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + + *list = g_slist_insert_sorted (*list, NM_SETTING (data), setting_priority_compare); +} + +/** + * nm_connection_need_secrets: + * @connection: the #NMConnection + * @hints: the address of a pointer to a #GPtrArray, initialized to NULL, which + * on return points to an allocated #GPtrArray containing the property names of + * secrets of the #NMSetting which may be required; the caller owns the array + * and must free the each array element with g_free(), as well as the array + * itself with g_ptr_array_free() + * + * Returns the name of the first setting object in the connection which would + * need secrets to make a successful connection. The returned hints are only + * intended as a guide to what secrets may be required, because in some + * circumstances, there is no way to conclusively determine exactly which + * secrets are needed. + * + * Returns: the setting name of the #NMSetting object which has invalid or + * missing secrets + **/ +const char * +nm_connection_need_secrets (NMConnection *connection, + GPtrArray **hints) +{ + NMConnectionPrivate *priv; + GSList *settings = NULL; + GSList *iter; + char *name = NULL; + + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + if (hints) + g_return_val_if_fail (*hints == NULL, NULL); + + priv = NM_CONNECTION_GET_PRIVATE (connection); + + /* Get list of settings in priority order */ + g_hash_table_foreach (priv->settings, add_setting_to_list, &settings); + + for (iter = settings; iter; iter = g_slist_next (iter)) { + NMSetting *setting = NM_SETTING (iter->data); + GPtrArray *secrets; + + // FIXME: do something with requested secrets rather than asking for + // all of them. Maybe make secrets a hash table mapping + // settings name :: [list of secrets key names]. + secrets = nm_setting_need_secrets (setting); + if (secrets) { + if (hints) + *hints = secrets; + else + g_ptr_array_free (secrets, TRUE); + + name = (char *) nm_setting_get_name (setting); + break; + } + } + + g_slist_free (settings); + return name; +} + +static void +clear_setting_secrets (gpointer key, gpointer data, gpointer user_data) +{ + nm_setting_clear_secrets (NM_SETTING (data)); +} + +/** + * nm_connection_clear_secrets: + * @connection: the #NMConnection + * + * Clears and frees any secrets that may be stored in the connection, to avoid + * keeping secret data in memory when not needed. + **/ +void +nm_connection_clear_secrets (NMConnection *connection) +{ + NMConnectionPrivate *priv; + + g_return_if_fail (NM_IS_CONNECTION (connection)); + + priv = NM_CONNECTION_GET_PRIVATE (connection); + g_hash_table_foreach (priv->settings, clear_setting_secrets, NULL); +} + +static void +add_one_setting_to_hash (gpointer key, gpointer data, gpointer user_data) +{ + NMSetting *setting = (NMSetting *) data; + GHashTable *connection_hash = (GHashTable *) user_data; + GHashTable *setting_hash; + + g_return_if_fail (setting != NULL); + g_return_if_fail (connection_hash != NULL); + + setting_hash = nm_setting_to_hash (setting); + if (setting_hash) + g_hash_table_insert (connection_hash, + g_strdup (nm_setting_get_name (setting)), + setting_hash); +} + +/** + * nm_connection_to_hash: + * @connection: the #NMConnection + * + * Converts the #NMConnection into a #GHashTable describing the connection, + * suitable for marshalling over D-Bus or serializing. The hash table mapping + * is string:#GHashTable with each element in the returned hash representing + * a #NMSetting object. The keys are setting object names, and the values + * are #GHashTables mapping string:GValue, each of which represents the + * properties of the #NMSetting object. + * + * Returns: a new #GHashTable describing the connection, its settings, and + * each setting's properties. The caller owns the hash table and must unref + * the hash table with g_hash_table_unref() when it is no longer needed. + **/ +GHashTable * +nm_connection_to_hash (NMConnection *connection) +{ + NMConnectionPrivate *priv; + GHashTable *connection_hash; + + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + connection_hash = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, (GDestroyNotify) g_hash_table_destroy); + + priv = NM_CONNECTION_GET_PRIVATE (connection); + g_hash_table_foreach (priv->settings, add_one_setting_to_hash, connection_hash); + + /* Don't send empty hashes */ + if (g_hash_table_size (connection_hash) < 1) { + g_hash_table_destroy (connection_hash); + connection_hash = NULL; + } + + return connection_hash; +} + +typedef struct ForEachValueInfo { + NMSettingValueIterFn func; + gpointer user_data; +} ForEachValueInfo; + +static void +for_each_setting (gpointer key, gpointer value, gpointer user_data) +{ + ForEachValueInfo *info = (ForEachValueInfo *) user_data; + + nm_setting_enumerate_values (NM_SETTING (value), info->func, info->user_data); +} + +/** + * nm_connection_for_each_setting_value: + * @connection: the #NMConnection + * @func: user-supplied function called for each setting's property + * @user_data: user data passed to @func at each invocation + * + * Iterates over the properties of each #NMSetting object in the #NMConnection, + * calling the supplied user function for each property. + **/ +void +nm_connection_for_each_setting_value (NMConnection *connection, + NMSettingValueIterFn func, + gpointer user_data) +{ + NMConnectionPrivate *priv; + ForEachValueInfo *info; + + g_return_if_fail (NM_IS_CONNECTION (connection)); + g_return_if_fail (func != NULL); + + priv = NM_CONNECTION_GET_PRIVATE (connection); + + info = g_slice_new0 (ForEachValueInfo); + if (!info) { + g_warning ("Not enough memory to enumerate values."); + return; + } + info->func = func; + info->user_data = user_data; + + g_hash_table_foreach (priv->settings, for_each_setting, info); + + g_slice_free (ForEachValueInfo, info); +} + +static void +dump_setting (gpointer key, gpointer value, gpointer user_data) +{ + char *str; + + str = nm_setting_to_string (NM_SETTING (value)); + g_print ("%s\n", str); + g_free (str); +} + +/** + * nm_connection_dump: + * @connection: the #NMConnection + * + * Print the connection to stdout. For debugging purposes ONLY, should NOT + * be used for serialization of the connection or machine-parsed in any way. The + * output format is not guaranteed to be stable and may change at any time. + **/ +void +nm_connection_dump (NMConnection *connection) +{ + g_return_if_fail (NM_IS_CONNECTION (connection)); + + g_hash_table_foreach (NM_CONNECTION_GET_PRIVATE (connection)->settings, dump_setting, NULL); +} + +/** + * nm_connection_set_scope: + * @connection: the #NMConnection + * @scope: the scope of the connection + * + * Sets the scope of the connection. This property is not serialized, and is + * only for the reference of the caller. A connection may have no scope + * (internal, temporary connections), "system" scope (provided by the system + * settings service), or "user" scope, provided by a user settings service. The + * creator of the #NMConnection object is responsible for setting the + * connection's scope if needed. Sets the #NMConnection:scope property. + **/ +void +nm_connection_set_scope (NMConnection *connection, NMConnectionScope scope) +{ + g_return_if_fail (NM_IS_CONNECTION (connection)); + + NM_CONNECTION_GET_PRIVATE (connection)->scope = scope; +} + +/** + * nm_connection_get_scope: + * @connection: the #NMConnection + * + * Returns the connection scope. + * + * Returns: the scope of the connection, previously set by a call to + * nm_connection_set_scope(). + **/ +NMConnectionScope +nm_connection_get_scope (NMConnection *connection) +{ + g_return_val_if_fail (NM_IS_CONNECTION (connection), NM_CONNECTION_SCOPE_UNKNOWN); + + return NM_CONNECTION_GET_PRIVATE (connection)->scope; +} + +/** + * nm_connection_set_path: + * @connection: the #NMConnection + * @path: the D-Bus path of the connection as given by the settings service + * which provides the connection + * + * Sets the D-Bus path of the connection. This property is not serialized, and + * is only for the reference of the caller. Sets the #NMConnection:path + * property. + **/ +void +nm_connection_set_path (NMConnection *connection, const char *path) +{ + NMConnectionPrivate *priv; + + g_return_if_fail (NM_IS_CONNECTION (connection)); + + priv = NM_CONNECTION_GET_PRIVATE (connection); + + if (priv->path) { + g_free (priv->path); + priv->path = NULL; + } + + if (path) + priv->path = g_strdup (path); +} + +/** + * nm_connection_get_path: + * @connection: the #NMConnection + * + * Returns the connection's D-Bus path. + * + * Returns: the D-Bus path of the connection, previously set by a call to + * nm_connection_set_path(). + **/ +const char * +nm_connection_get_path (NMConnection *connection) +{ + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + return NM_CONNECTION_GET_PRIVATE (connection)->path; +} + +/** + * nm_connection_new: + * + * Creates a new #NMConnection object with no #NMSetting objects. + * + * Returns: the new empty #NMConnection object + **/ +NMConnection * +nm_connection_new (void) +{ + GObject *object; + + if (!registered_settings) + register_default_settings (); + + object = g_object_new (NM_TYPE_CONNECTION, NULL); + + return NM_CONNECTION (object); +} + +/** + * nm_connection_new_from_hash: + * @hash: the #GHashTable describing the connection + * @error: on unsuccessful return, an error + * + * Creates a new #NMConnection from a hash table describing the connection. See + * nm_connection_to_hash() for a description of the expected hash table. + * + * Returns: the new #NMConnection object, populated with settings created + * from the values in the hash table, or NULL if the connection failed to + * validate + **/ +NMConnection * +nm_connection_new_from_hash (GHashTable *hash, GError **error) +{ + NMConnection *connection; + + g_return_val_if_fail (hash != NULL, NULL); + + connection = nm_connection_new (); + g_hash_table_foreach (hash, parse_one_setting, connection); + + if (!nm_connection_verify (connection, error)) { + g_object_unref (connection); + return NULL; + } + + return connection; +} + +static void +duplicate_cb (gpointer key, gpointer value, gpointer user_data) +{ + nm_connection_add_setting (NM_CONNECTION (user_data), nm_setting_duplicate (NM_SETTING (value))); +} + +/** + * nm_connection_duplicate: + * @connection: the #NMConnection to duplicate + * + * Duplicates a #NMConnection. + * + * Returns: a new #NMConnection containing the same settings and properties + * as the source #NMConnection + **/ +NMConnection * +nm_connection_duplicate (NMConnection *connection) +{ + NMConnection *dup; + + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + dup = nm_connection_new (); + nm_connection_set_scope (dup, nm_connection_get_scope (connection)); + nm_connection_set_path (dup, nm_connection_get_path (connection)); + g_hash_table_foreach (NM_CONNECTION_GET_PRIVATE (connection)->settings, duplicate_cb, dup); + + return dup; +} + +static void +nm_connection_init (NMConnection *connection) +{ + NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (connection); + + priv->settings = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); +} + +static void +finalize (GObject *object) +{ + NMConnection *connection = NM_CONNECTION (object); + NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (connection); + + g_hash_table_destroy (priv->settings); + priv->settings = NULL; + + g_free (priv->path); + priv->path = NULL; + + G_OBJECT_CLASS (nm_connection_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMConnection *connection = NM_CONNECTION (object); + + switch (prop_id) { + case PROP_SCOPE: + nm_connection_set_scope (connection, g_value_get_uint (value)); + break; + case PROP_PATH: + nm_connection_set_path (connection, g_value_get_string (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) +{ + NMConnection *connection = NM_CONNECTION (object); + + switch (prop_id) { + case PROP_SCOPE: + g_value_set_uint (value, nm_connection_get_scope (connection)); + break; + case PROP_PATH: + g_value_set_string (value, nm_connection_get_path (connection)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_connection_class_init (NMConnectionClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (NMConnectionPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* Properties */ + + /** + * NMConnection:scope: + * + * The connection's scope, used only by the calling process as a record + * of which settings service the connection is provided by. One of the + * NM_CONNECTION_SCOPE_* defines. + **/ + g_object_class_install_property + (object_class, PROP_SCOPE, + g_param_spec_uint (NM_CONNECTION_SCOPE, + "Scope", + "Scope", + NM_CONNECTION_SCOPE_UNKNOWN, + NM_CONNECTION_SCOPE_USER, + NM_CONNECTION_SCOPE_UNKNOWN, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + + /** + * NMConnection:path: + * + * The connection's D-Bus path, used only by the calling process as a record + * of the D-Bus path of the connection as provided by a settings service. + **/ + g_object_class_install_property + (object_class, PROP_PATH, + g_param_spec_string (NM_CONNECTION_PATH, + "Path", + "Path", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + + /* Signals */ + + /** + * NMConnection::secrets-updated: + * @connection: the object on which the signal is emitted + * @setting_name: the setting name of the #NMSetting for which secrets were + * updated + * + * The ::secrets-updated signal is emitted when the secrets of a setting + * have been changed. + */ + signals[SECRETS_UPDATED] = + g_signal_new ("secrets-updated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMConnectionClass, secrets_updated), + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); +} + diff --git a/libnm-util/nm-connection.h b/libnm-util/nm-connection.h new file mode 100644 index 00000000..576db049 --- /dev/null +++ b/libnm-util/nm-connection.h @@ -0,0 +1,167 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_CONNECTION_H +#define NM_CONNECTION_H + +#include +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_CONNECTION (nm_connection_get_type ()) +#define NM_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONNECTION, NMConnection)) +#define NM_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CONNECTION, NMConnectionClass)) +#define NM_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION)) +#define NM_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_CONNECTION)) +#define NM_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CONNECTION, NMConnectionClass)) + +/** + * NMConnectionScope: + * @NM_CONNECTION_SCOPE_UNKNOWN: scope not known or not yet set + * @NM_CONNECTION_SCOPE_SYSTEM: connection is provided by the system settings + * service + * @NM_CONNECTION_SCOPE_USER: connection is provided by a user settings service + * + * Connection scope indicated what settings service, if any, provides the + * connection. + * + **/ +typedef enum { + NM_CONNECTION_SCOPE_UNKNOWN = 0, + NM_CONNECTION_SCOPE_SYSTEM, + NM_CONNECTION_SCOPE_USER +} NMConnectionScope; + + +/** + * NMConnectionError: + * @NM_CONNECTION_ERROR_UNKNOWN: unknown or unclassified error + * @NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND: the #NMConnection object + * did not contain the required #NMSettingConnection object, which must be + * present for all connections + * + * Describes errors that may result from operations involving a #NMConnection. + * + **/ +typedef enum +{ + NM_CONNECTION_ERROR_UNKNOWN = 0, + NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND +} NMConnectionError; + +#define NM_TYPE_CONNECTION_ERROR (nm_connection_error_get_type ()) +GType nm_connection_error_get_type (void); + +#define NM_CONNECTION_ERROR nm_connection_error_quark () +GQuark nm_connection_error_quark (void); + +#define NM_CONNECTION_SCOPE "scope" +#define NM_CONNECTION_PATH "path" + +/** + * NMConnection: + * + * The NMConnection struct contains only private data. + * It should only be accessed through the functions described below. + */ +typedef struct { + GObject parent; +} NMConnection; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*secrets_updated) (NMConnection *connection, const char * setting); +} NMConnectionClass; + +GType nm_connection_get_type (void); + +NMConnection *nm_connection_new (void); + +NMConnection *nm_connection_new_from_hash (GHashTable *hash, GError **error); + +NMConnection *nm_connection_duplicate (NMConnection *connection); + +void nm_connection_add_setting (NMConnection *connection, + NMSetting *setting); + +void nm_connection_remove_setting (NMConnection *connection, + GType setting_type); + +NMSetting *nm_connection_get_setting (NMConnection *connection, + GType setting_type); + +NMSetting *nm_connection_get_setting_by_name (NMConnection *connection, + const char *name); + +gboolean nm_connection_replace_settings (NMConnection *connection, + GHashTable *new_settings, + GError **error); + +gboolean nm_connection_compare (NMConnection *a, + NMConnection *b, + NMSettingCompareFlags flags); + +gboolean nm_connection_verify (NMConnection *connection, GError **error); + +const char * nm_connection_need_secrets (NMConnection *connection, + GPtrArray **hints); + +void nm_connection_clear_secrets (NMConnection *connection); + +gboolean nm_connection_update_secrets (NMConnection *connection, + const char *setting_name, + GHashTable *secrets, + GError **error); + +void nm_connection_set_scope (NMConnection *connection, + NMConnectionScope scope); + +NMConnectionScope nm_connection_get_scope (NMConnection *connection); + +void nm_connection_set_path (NMConnection *connection, + const char *path); + +const char * nm_connection_get_path (NMConnection *connection); + +void nm_connection_for_each_setting_value (NMConnection *connection, + NMSettingValueIterFn func, + gpointer user_data); + +GHashTable *nm_connection_to_hash (NMConnection *connection); +void nm_connection_dump (NMConnection *connection); + +NMSetting *nm_connection_create_setting (const char *name); + +GType nm_connection_lookup_setting_type (const char *name); + +GType nm_connection_lookup_setting_type_by_quark (GQuark error_quark); + +G_END_DECLS + +#endif /* NM_CONNECTION_H */ diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c new file mode 100644 index 00000000..f5a362ce --- /dev/null +++ b/libnm-util/nm-param-spec-specialized.c @@ -0,0 +1,973 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include "nm-param-spec-specialized.h" + +struct _NMParamSpecSpecialized { + GParamSpec parent; +}; + +#include +#include +#include +#include + +#include "nm-dbus-glib-types.h" + +/***********************************************************/ +/* nm_gvalues_compare */ + +static gint nm_gvalues_compare (const GValue *value1, const GValue *value2); + +static gboolean +type_is_fixed_size (GType type, gsize *tsize) +{ + switch (type) { + case G_TYPE_CHAR: + if (tsize) *tsize = sizeof (char); + return TRUE; + case G_TYPE_UCHAR: + if (tsize) *tsize = sizeof (guchar); + return TRUE; + case G_TYPE_BOOLEAN: + if (tsize) *tsize = sizeof (gboolean); + return TRUE; + case G_TYPE_LONG: + if (tsize) *tsize = sizeof (glong); + return TRUE; + case G_TYPE_ULONG: + if (tsize) *tsize = sizeof (gulong); + return TRUE; + case G_TYPE_INT: + if (tsize) *tsize = sizeof (gint); + return TRUE; + case G_TYPE_UINT: + if (tsize) *tsize = sizeof (guint); + return TRUE; + case G_TYPE_INT64: + if (tsize) *tsize = sizeof (gint64); + return TRUE; + case G_TYPE_UINT64: + if (tsize) *tsize = sizeof (guint64); + return TRUE; + case G_TYPE_FLOAT: + if (tsize) *tsize = sizeof (gfloat); + return TRUE; + case G_TYPE_DOUBLE: + if (tsize) *tsize = sizeof (gdouble); + return TRUE; + default: + return FALSE; + } +} + +#define FLOAT_FACTOR 0.00000001 + +static gint +nm_gvalues_compare_fixed (const GValue *value1, const GValue *value2) +{ + int ret = 0; + + switch (G_VALUE_TYPE (value1)) { + case G_TYPE_CHAR: { + gchar val1 = g_value_get_char (value1); + gchar val2 = g_value_get_char (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_UCHAR: { + guchar val1 = g_value_get_uchar (value1); + guchar val2 = g_value_get_uchar (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_BOOLEAN: { + gboolean val1 = g_value_get_boolean (value1); + gboolean val2 = g_value_get_boolean (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_LONG: { + glong val1 = g_value_get_long (value1); + glong val2 = g_value_get_long (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_ULONG: { + gulong val1 = g_value_get_ulong (value1); + gulong val2 = g_value_get_ulong (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_INT: { + gint val1 = g_value_get_int (value1); + gint val2 = g_value_get_int (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_UINT: { + guint val1 = g_value_get_uint (value1); + guint val2 = g_value_get_uint (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_INT64: { + gint64 val1 = g_value_get_int64 (value1); + gint64 val2 = g_value_get_int64 (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_UINT64: { + guint64 val1 = g_value_get_uint64 (value1); + guint64 val2 = g_value_get_uint64 (value2); + if (val1 != val2) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_FLOAT: { + gfloat val1 = g_value_get_float (value1); + gfloat val2 = g_value_get_float (value2); + /* Can't use == or != here due to inexactness of FP */ + if (fabsf (val1 - val2) > FLOAT_FACTOR) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + case G_TYPE_DOUBLE: { + gdouble val1 = g_value_get_double (value1); + gdouble val2 = g_value_get_double (value2); + if (fabs (val1 - val2) > FLOAT_FACTOR) + ret = val1 < val2 ? -1 : val1 > val2; + break; + } + default: + g_warning ("Unhandled fixed size type '%s'", G_VALUE_TYPE_NAME (value1)); + } + + return ret; +} + +static gint +nm_gvalues_compare_string (const GValue *value1, const GValue *value2) +{ + const char *str1 = g_value_get_string (value1); + const char *str2 = g_value_get_string (value2); + + if (str1 == str2) + return 0; + + if (!str1) + return 1; + if (!str2) + return -1; + + return strcmp (str1, str2); +} + +static gint +nm_gvalues_compare_strv (const GValue *value1, const GValue *value2) +{ + char **strv1; + char **strv2; + gint ret; + guint i = 0; + + strv1 = (char **) g_value_get_boxed (value1); + strv2 = (char **) g_value_get_boxed (value2); + + while (strv1[i] && strv2[i]) { + ret = strcmp (strv1[i], strv2[i]); + if (ret) + return ret; + i++; + } + + if (strv1[i] == NULL && strv2[i] == NULL) + return 0; + + if (strv1[i]) + return 1; + + return -1; +} + +static void +nm_gvalue_destroy (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static GValue * +nm_gvalue_dup (const GValue *value) +{ + GValue *dup; + + dup = g_slice_new0 (GValue); + g_value_init (dup, G_VALUE_TYPE (value)); + g_value_copy (value, dup); + + return dup; +} + +static void +iterate_collection (const GValue *value, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + + *list = g_slist_prepend (*list, nm_gvalue_dup (value)); +} + +static gint +nm_gvalues_compare_collection (const GValue *value1, const GValue *value2) +{ + gint ret; + guint len1; + guint len2; + GType value_type = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value1)); + gsize element_size = 0; + + if (type_is_fixed_size (value_type, &element_size)) { + gpointer data1 = NULL; + gpointer data2 = NULL; + + dbus_g_type_collection_get_fixed ((GValue *) value1, &data1, &len1); + dbus_g_type_collection_get_fixed ((GValue *) value2, &data2, &len2); + + if (len1 != len2) + ret = len1 < len2 ? -1 : len1 > len2; + else + ret = memcmp (data1, data2, len1 * element_size); + } else { + GSList *list1 = NULL; + GSList *list2 = NULL; + + dbus_g_type_collection_value_iterate (value1, iterate_collection, &list1); + len1 = g_slist_length (list1); + dbus_g_type_collection_value_iterate (value2, iterate_collection, &list2); + len2 = g_slist_length (list2); + + if (len1 != len2) + ret = len1 < len2 ? -1 : len1 > len2; + else { + GSList *iter1; + GSList *iter2; + + for (iter1 = list1, iter2 = list2, ret = 0; + ret == 0 && iter1 && iter2; + iter1 = iter1->next, iter2 = iter2->next) + ret = nm_gvalues_compare ((GValue *) iter1->data, (GValue *) iter2->data); + } + + g_slist_foreach (list1, (GFunc) nm_gvalue_destroy, NULL); + g_slist_free (list1); + g_slist_foreach (list2, (GFunc) nm_gvalue_destroy, NULL); + g_slist_free (list2); + } + + return ret; +} + +static void +iterate_map (const GValue *key_val, + const GValue *value_val, + gpointer user_data) +{ + GHashTable **hash = (GHashTable **) user_data; + + g_hash_table_insert (*hash, g_value_dup_string (key_val), nm_gvalue_dup (value_val)); +} + +typedef struct { + GHashTable *hash2; + gint ret; +} CompareMapInfo; + +static void +compare_one_map_item (gpointer key, gpointer val, gpointer user_data) +{ + CompareMapInfo *info = (CompareMapInfo *) user_data; + GValue *value2; + + if (info->ret) + return; + + value2 = (GValue *) g_hash_table_lookup (info->hash2, key); + if (value2) + info->ret = nm_gvalues_compare ((GValue *) val, value2); + else + info->ret = 1; +} + +static gint +nm_gvalues_compare_map (const GValue *value1, const GValue *value2) +{ + GHashTable *hash1 = NULL; + GHashTable *hash2 = NULL; + guint len1; + guint len2; + gint ret = 0; + + if (dbus_g_type_get_map_key_specialization (G_VALUE_TYPE (value1)) != G_TYPE_STRING) { + g_warning ("Can not compare maps with '%s' for keys", + g_type_name (dbus_g_type_get_map_key_specialization (G_VALUE_TYPE (value1)))); + return 0; + } + + hash1 = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy); + dbus_g_type_map_value_iterate (value1, iterate_map, &hash1); + len1 = g_hash_table_size (hash1); + + hash2 = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy); + dbus_g_type_map_value_iterate (value2, iterate_map, &hash2); + len2 = g_hash_table_size (hash2); + + if (len1 != len2) + ret = len1 < len2 ? -1 : len1 > len2; + else { + CompareMapInfo info; + + info.ret = 0; + info.hash2 = hash2; + g_hash_table_foreach (hash1, compare_one_map_item, &info); + ret = info.ret; + } + + g_hash_table_destroy (hash1); + g_hash_table_destroy (hash2); + + return ret; +} + +static gint +nm_gvalue_ip6_address_compare (const GValue *value1, const GValue *value2) +{ + GValueArray *values1, *values2; + GValue *tmp_val; + GByteArray *addr1, *addr2; + guint32 prefix1, prefix2; + GByteArray *gw1, *gw2; + gint ret = 0; + int i; + + /* IP6 addresses are GValueArrays (see nm-dbus-glib-types.h) */ + values1 = g_value_get_boxed (value1); + values2 = g_value_get_boxed (value2); + + /* Since they are NM IPv6 address structures, we expect both + * to contain two elements as specified in nm-dbus-glib-types.h. + */ + g_return_val_if_fail (values1->n_values == 3, 0); + g_return_val_if_fail (values2->n_values == 3, 0); + + /* First struct IPv6 address */ + tmp_val = g_value_array_get_nth (values1, 0); + addr1 = g_value_get_boxed (tmp_val); + /* First struct IPv6 prefix */ + tmp_val = g_value_array_get_nth (values1, 1); + prefix1 = g_value_get_uint (tmp_val); + /* First struct IPv6 gateway */ + tmp_val = g_value_array_get_nth (values1, 2); + gw1 = g_value_get_boxed (tmp_val); + + /* Second struct IPv6 address */ + tmp_val = g_value_array_get_nth (values2, 0); + addr2 = g_value_get_boxed (tmp_val); + /* Second struct IPv6 prefix */ + tmp_val = g_value_array_get_nth (values2, 1); + prefix2 = g_value_get_uint (tmp_val); + /* Second struct IPv6 gateway */ + tmp_val = g_value_array_get_nth (values2, 2); + gw2 = g_value_get_boxed (tmp_val); + + /* Compare IPv6 addresses */ + if (prefix1 != prefix2) + return prefix1 < prefix2 ? -1 : prefix1 > prefix2; + + if (!IN6_ARE_ADDR_EQUAL ((struct in6_addr *)addr1->data, (struct in6_addr *)addr2->data)) { + for (i = 0; ret == 0 && i < addr1->len; i++) + ret = addr1->data[i] < addr2->data[i] ? -1 : addr1->data[i] > addr2->data[i]; + } + + if (!IN6_ARE_ADDR_EQUAL ((struct in6_addr *) gw1->data, (struct in6_addr *) gw2->data)) { + for (i = 0; ret == 0 && i < gw1->len; i++) + ret = gw1->data[i] < gw2->data[i] ? -1 : gw1->data[i] > gw2->data[i]; + } + + return ret; +} + +static gint +nm_gvalue_ip6_route_compare (const GValue *value1, const GValue *value2) +{ + GValueArray *values1, *values2; + GValue *tmp_val; + GByteArray *dest1, *dest2; + GByteArray *next_hop1, *next_hop2; + guint32 prefix1, prefix2; + guint32 metric1, metric2; + gint ret = 0; + int i; + + /* IP6 routes are GValueArrays (see nm-dbus-glib-types.h) */ + values1 = g_value_get_boxed (value1); + values2 = g_value_get_boxed (value2); + + /* Since they are NM IPv6 route structures, we expect both + * to contain 4 elements as specified in nm-dbus-glib-types.h. + */ + g_return_val_if_fail (values1->n_values == 4, 0); + g_return_val_if_fail (values2->n_values == 4, 0); + + /* First struct IPv6 route */ + tmp_val = g_value_array_get_nth (values1, 0); + dest1 = g_value_get_boxed (tmp_val); + tmp_val = g_value_array_get_nth (values1, 1); + prefix1 = g_value_get_uint (tmp_val); + tmp_val = g_value_array_get_nth (values1, 2); + next_hop1 = g_value_get_boxed (tmp_val); + tmp_val = g_value_array_get_nth (values1, 3); + metric1 = g_value_get_uint (tmp_val); + + /* Second struct IPv6 route */ + tmp_val = g_value_array_get_nth (values2, 0); + dest2 = g_value_get_boxed (tmp_val); + tmp_val = g_value_array_get_nth (values2, 1); + prefix2 = g_value_get_uint (tmp_val); + tmp_val = g_value_array_get_nth (values2, 2); + next_hop2 = g_value_get_boxed (tmp_val); + tmp_val = g_value_array_get_nth (values2, 3); + metric2 = g_value_get_uint (tmp_val); + + /* Compare the routes */ + if (prefix1 != prefix2) + return prefix1 < prefix2 ? -1 : prefix1 > prefix2; + + if (!IN6_ARE_ADDR_EQUAL ((struct in6_addr *)dest1->data, (struct in6_addr *)dest2->data)) { + for (i = 0; ret == 0 && i < dest1->len; i++) + ret = dest1->data[i] < dest2->data[i] ? -1 : dest1->data[i] > dest2->data[i]; + } + + if (!IN6_ARE_ADDR_EQUAL ((struct in6_addr *)next_hop1->data, (struct in6_addr *)next_hop2->data)) { + for (i = 0; ret == 0 && i < next_hop1->len; i++) + ret = next_hop1->data[i] < next_hop2->data[i] ? -1 : next_hop1->data[i] > next_hop2->data[i]; + } + + if (metric1 != metric2) + ret = metric1 < metric2 ? -1 : metric1 > metric2; + + return ret; +} + +static gint +nm_gvalues_compare_struct (const GValue *value1, const GValue *value2) +{ + /* value1 and value2 must contain the same type since + * nm_gvalues_compare() enforced that already. + */ + + if (G_VALUE_HOLDS (value1, DBUS_TYPE_G_IP6_ADDRESS)) { + return nm_gvalue_ip6_address_compare (value1, value2); + } else if (G_VALUE_HOLDS (value1, DBUS_TYPE_G_IP6_ROUTE)) { + return nm_gvalue_ip6_route_compare (value1, value2); + } else { + g_warning ("Don't know how to compare structures"); + return (value1 == value2); + } +} + +gint +nm_gvalues_compare (const GValue *value1, const GValue *value2) +{ + GType type1; + GType type2; + gint ret; + + if (value1 == value2) + return 0; + if (!value1) + return 1; + if (!value2) + return -1; + + type1 = G_VALUE_TYPE (value1); + type2 = G_VALUE_TYPE (value2); + + if (type1 != type2) + return type1 < type2 ? -1 : type1 > type2; + + if (type_is_fixed_size (type1, NULL)) + ret = nm_gvalues_compare_fixed (value1, value2); + else if (type1 == G_TYPE_STRING) + ret = nm_gvalues_compare_string (value1, value2); + else if (G_VALUE_HOLDS_BOXED (value1)) { + gpointer p1 = g_value_get_boxed (value1); + gpointer p2 = g_value_get_boxed (value2); + + if (p1 == p2) + ret = 0; /* Exactly the same values */ + else if (!p1) + ret = 1; /* The comparision functions below don't handle NULLs */ + else if (!p2) + ret = -1; /* The comparision functions below don't handle NULLs */ + else if (type1 == G_TYPE_STRV) + ret = nm_gvalues_compare_strv (value1, value2); + else if (dbus_g_type_is_collection (type1)) + ret = nm_gvalues_compare_collection (value1, value2); + else if (dbus_g_type_is_map (type1)) + ret = nm_gvalues_compare_map (value1, value2); + else if (dbus_g_type_is_struct (type1)) + ret = nm_gvalues_compare_struct (value1, value2); + else if (type1 == G_TYPE_VALUE) + ret = nm_gvalues_compare ((GValue *) g_value_get_boxed (value1), (GValue *) g_value_get_boxed (value2)); + else { + g_warning ("Don't know how to compare boxed types '%s'", g_type_name (type1)); + ret = value1 == value2; + } + } else { + g_warning ("Don't know how to compare types '%s'", g_type_name (type1)); + ret = value1 == value2; + } + + return ret; +} + +/***********************************************************/ + +static void +param_specialized_init (GParamSpec *pspec) +{ +} + +static void +param_specialized_set_default (GParamSpec *pspec, GValue *value) +{ + value->data[0].v_pointer = NULL; +} + +static gboolean +param_specialized_validate (GParamSpec *pspec, GValue *value) +{ + NMParamSpecSpecialized *sspec = NM_PARAM_SPEC_SPECIALIZED (pspec); + GType value_type = G_VALUE_TYPE (value); + gboolean changed = FALSE; + + if (!g_value_type_compatible (value_type, G_PARAM_SPEC_VALUE_TYPE (sspec))) { + g_value_reset (value); + changed = TRUE; + } + + return changed; +} + +static gint +param_specialized_values_cmp (GParamSpec *pspec, + const GValue *value1, + const GValue *value2) +{ + return nm_gvalues_compare (value1, value2); +} + +GType +_nm_param_spec_specialized_get_type (void) +{ + static GType type; + + if (G_UNLIKELY (type) == 0) { + static const GParamSpecTypeInfo pspec_info = { + sizeof (NMParamSpecSpecialized), + 0, + param_specialized_init, + G_TYPE_OBJECT, /* value_type */ + NULL, /* finalize */ + param_specialized_set_default, + param_specialized_validate, + param_specialized_values_cmp, + }; + type = g_param_type_register_static ("NMParamSpecSpecialized", &pspec_info); + } + + return type; +} + +GParamSpec * +_nm_param_spec_specialized (const char *name, + const char *nick, + const char *blurb, + GType specialized_type, + GParamFlags flags) +{ + NMParamSpecSpecialized *pspec; + + g_return_val_if_fail (g_type_is_a (specialized_type, G_TYPE_BOXED), NULL); + + pspec = g_param_spec_internal (NM_TYPE_PARAM_SPEC_SPECIALIZED, + name, nick, blurb, flags); + + G_PARAM_SPEC (pspec)->value_type = specialized_type; + + return G_PARAM_SPEC (pspec); +} + +/***********************************************************/ +/* Tests */ + +#if 0 + +static void +compare_ints (void) +{ + GValue value1 = { 0 }; + GValue value2 = { 0 }; + + g_value_init (&value1, G_TYPE_INT); + g_value_init (&value2, G_TYPE_INT); + + g_value_set_int (&value1, 5); + g_value_set_int (&value2, 5); + g_print ("Comparing ints 5 and 5: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_int (&value2, 10); + g_print ("Comparing ints 5 and 10: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_int (&value2, 1); + g_print ("Comparing ints 5 and 1: %d\n", nm_gvalues_compare (&value1, &value2)); +} + +static void +compare_strings (void) +{ + GValue value1 = { 0 }; + GValue value2 = { 0 }; + const char *str1 = "hello"; + const char *str2 = "world"; + + g_value_init (&value1, G_TYPE_STRING); + g_value_init (&value2, G_TYPE_STRING); + + g_value_set_string (&value1, str1); + g_value_set_string (&value2, str1); + g_print ("Comparing identical strings: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_string (&value2, str2); + g_print ("Comparing different strings: %d\n", nm_gvalues_compare (&value1, &value2)); +} + +static void +compare_strv (void) +{ + GValue value1 = { 0 }; + GValue value2 = { 0 }; + char *strv1[] = { "foo", "bar", "baz", NULL }; + char *strv2[] = { "foo", "bar", "bar", NULL }; + char *strv3[] = { "foo", "bar", NULL }; + char *strv4[] = { "foo", "bar", "baz", "bam", NULL }; + + g_value_init (&value1, G_TYPE_STRV); + g_value_init (&value2, G_TYPE_STRV); + + g_value_set_boxed (&value1, strv1); + g_value_set_boxed (&value2, strv1); + g_print ("Comparing identical strv's: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_boxed (&value2, strv2); + g_print ("Comparing different strv's: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_boxed (&value2, strv3); + g_print ("Comparing different len (smaller) strv's: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_boxed (&value2, strv4); + g_print ("Comparing different len (longer) strv's: %d\n", nm_gvalues_compare (&value1, &value2)); +} + +static void +compare_garrays (void) +{ + GArray *array1; + GArray *array2; + GValue value1 = { 0 }; + GValue value2 = { 0 }; + int i; + + g_value_init (&value1, DBUS_TYPE_G_UINT_ARRAY); + array1 = g_array_new (FALSE, FALSE, sizeof (guint32)); + + g_value_init (&value2, DBUS_TYPE_G_UINT_ARRAY); + array2 = g_array_new (FALSE, FALSE, sizeof (guint32)); + + for (i = 0; i < 5; i++) { + g_array_append_val (array1, i); + g_array_append_val (array2, i); + } + + g_value_set_boxed (&value1, array1); + g_value_set_boxed (&value2, array2); + + g_print ("Comparing identical arrays's: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_array_remove_index (array2, 0); + g_value_set_boxed (&value2, array2); + g_print ("Comparing different length arrays's: %d\n", nm_gvalues_compare (&value1, &value2)); + + i = 7; + g_array_prepend_val (array2, i); + g_value_set_boxed (&value2, array2); + g_print ("Comparing different arrays's: %d\n", nm_gvalues_compare (&value1, &value2)); +} + +static void +compare_ptrarrays (void) +{ + GPtrArray *array1; + GPtrArray *array2; + GValue value1 = { 0 }; + GValue value2 = { 0 }; + + g_value_init (&value1, dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING)); + array1 = g_ptr_array_new (); + + g_value_init (&value2, dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING)); + array2 = g_ptr_array_new (); + + g_ptr_array_add (array1, "hello"); + g_ptr_array_add (array1, "world"); + g_value_set_boxed (&value1, array1); + + g_ptr_array_add (array2, "hello"); + g_ptr_array_add (array2, "world"); + g_value_set_boxed (&value2, array2); + + g_print ("Comparing identical ptr arrays's: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_ptr_array_add (array2, "boo"); + g_value_set_boxed (&value2, array2); + g_print ("Comparing different len ptr arrays's: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_ptr_array_add (array1, "booz"); + g_value_set_boxed (&value1, array1); + g_print ("Comparing different ptr arrays's: %d\n", nm_gvalues_compare (&value1, &value2)); +} + +static void +compare_str_hash (void) +{ + GHashTable *hash1; + GHashTable *hash2; + GValue value1 = { 0 }; + GValue value2 = { 0 }; + + g_value_init (&value1, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)); + g_value_init (&value2, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)); + + hash1 = g_hash_table_new (g_str_hash, g_str_equal); + hash2 = g_hash_table_new (g_str_hash, g_str_equal); + + g_hash_table_insert (hash1, "key1", "hello"); + g_hash_table_insert (hash1, "key2", "world"); + + g_hash_table_insert (hash2, "key1", "hello"); + g_hash_table_insert (hash2, "key2", "world"); + + g_value_set_boxed (&value1, hash1); + g_value_set_boxed (&value2, hash2); + g_print ("Comparing identical str hashes: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_hash_table_remove (hash2, "key2"); + g_value_set_boxed (&value2, hash2); + g_print ("Comparing different length str hashes: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_hash_table_insert (hash2, "key2", "moon"); + g_value_set_boxed (&value2, hash2); + g_print ("Comparing different str hashes: %d\n", nm_gvalues_compare (&value1, &value2)); +} + +static GValue * +str_to_gvalue (const char *str) +{ + GValue *value; + + value = g_slice_new0 (GValue); + g_value_init (value, G_TYPE_STRING); + g_value_set_string (value, str); + + return value; +} + +static GValue * +int_to_gvalue (int i) +{ + GValue *value; + + value = g_slice_new0 (GValue); + g_value_init (value, G_TYPE_INT); + g_value_set_int (value, i); + + return value; +} + +static void +compare_gvalue_hash (void) +{ + GHashTable *hash1; + GHashTable *hash2; + GValue value1 = { 0 }; + GValue value2 = { 0 }; + + g_value_init (&value1, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)); + g_value_init (&value2, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)); + + hash1 = g_hash_table_new (g_str_hash, g_str_equal); + hash2 = g_hash_table_new (g_str_hash, g_str_equal); + + g_hash_table_insert (hash1, "key1", str_to_gvalue ("hello")); + g_hash_table_insert (hash1, "key2", int_to_gvalue (5)); + + g_hash_table_insert (hash2, "key1", str_to_gvalue ("hello")); + g_hash_table_insert (hash2, "key2", int_to_gvalue (5)); + + g_value_set_boxed (&value1, hash1); + g_value_set_boxed (&value2, hash2); + g_print ("Comparing identical gvalue hashes: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_hash_table_remove (hash2, "key2"); + g_value_set_boxed (&value2, hash2); + g_print ("Comparing different length str hashes: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_hash_table_insert (hash2, "key2", str_to_gvalue ("moon")); + g_value_set_boxed (&value2, hash2); + g_print ("Comparing different str hashes: %d\n", nm_gvalues_compare (&value1, &value2)); +} + +static void +compare_ip6_addresses (void) +{ + GValueArray *array1; + GValueArray *array2; + GValueArray *array3; + GByteArray *ba1; + GByteArray *ba2; + GByteArray *ba3; + GValue element = { 0 }; + GValue value1 = { 0 }; + GValue value2 = { 0 }; + struct in6_addr addr1; + struct in6_addr addr2; + struct in6_addr addr3; + guint32 prefix1 = 64; + guint32 prefix2 = 64; + guint32 prefix3 = 0; + + inet_pton (AF_INET6, "1:2:3:4:5:6:7:8", &addr1, sizeof (struct in6_addr)); + inet_pton (AF_INET6, "ffff:2:3:4:5:6:7:8", &addr2, sizeof (struct in6_addr)); + inet_pton (AF_INET6, "::", &addr3, sizeof (struct in6_addr)); + + /* address 1 */ + ba1 = g_byte_array_new (); + array1 = g_value_array_new (2); + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + g_byte_array_append (ba1, (guint8 *) addr1.s6_addr, 16); + g_value_take_boxed (&element, ba1); + g_value_array_append (array1, &element); + g_value_unset (&element); + + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, prefix1); + g_value_array_append (array1, &element); + g_value_unset (&element); + + /* address 2 */ + ba2 = g_byte_array_new (); + array2 = g_value_array_new (2); + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + g_byte_array_append (ba2, (guint8 *) addr2.s6_addr, 16); + g_value_take_boxed (&element, ba2); + g_value_array_append (array2, &element); + g_value_unset (&element); + + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, prefix2); + g_value_array_append (array2, &element); + g_value_unset (&element); + + /* address 3 */ + ba3 = g_byte_array_new (); + array3 = g_value_array_new (2); + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + g_byte_array_append (ba3, (guint8 *) addr3.s6_addr, 16); + g_value_take_boxed (&element, ba3); + g_value_array_append (array3, &element); + g_value_unset (&element); + + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, prefix3); + g_value_array_append (array3, &element); + g_value_unset (&element); + + g_value_init (&value1, DBUS_TYPE_G_IP6_ADDRESS); + g_value_init (&value2, DBUS_TYPE_G_IP6_ADDRESS); + + g_value_set_boxed (&value1, array1); + g_value_set_boxed (&value2, array1); + g_print ("Comparing identical IPv6 address structures: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_boxed (&value1, array1); + g_value_set_boxed (&value2, array2); + g_print ("Comparing different IPv6 address structures: %d\n", nm_gvalues_compare (&value1, &value2)); + + g_value_set_boxed (&value1, array1); + g_value_set_boxed (&value2, array3); + g_print ("Comparing different IPv6 address structures: %d\n", nm_gvalues_compare (&value1, &value2)); +} + +int +main (int argc, char *argv[]) +{ + DBusGConnection *bus; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + compare_ints (); + compare_strings (); + compare_strv (); + compare_garrays (); + compare_ptrarrays (); + compare_str_hash (); + compare_gvalue_hash (); + compare_ip6_addresses (); + + return 0; +} + +#endif diff --git a/libnm-util/nm-param-spec-specialized.h b/libnm-util/nm-param-spec-specialized.h new file mode 100644 index 00000000..a6173674 --- /dev/null +++ b/libnm-util/nm-param-spec-specialized.h @@ -0,0 +1,46 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_PARAM_SPEC_SPECIALIZED_H +#define NM_PARAM_SPEC_SPECIALIZED_H + +#include + +typedef struct _NMParamSpecSpecialized NMParamSpecSpecialized; + +#define NM_TYPE_PARAM_SPEC_SPECIALIZED (_nm_param_spec_specialized_get_type ()) + +#define NM_IS_PARAM_SPEC_SPECIALIZED(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), NM_TYPE_PARAM_SPEC_SPECIALIZED)) +#define NM_PARAM_SPEC_SPECIALIZED(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), NM_TYPE_PARAM_SPEC_SPECIALIZED, NMParamSpecSpecialized)) + +GType _nm_param_spec_specialized_get_type (void); + +GParamSpec *_nm_param_spec_specialized (const char *name, + const char *nick, + const char *blurb, + GType specialized_type, + GParamFlags flags); + +#endif /* NM_PARAM_SPEC_SPECIALIZED_H */ diff --git a/libnm-util/nm-setting-8021x.c b/libnm-util/nm-setting-8021x.c new file mode 100644 index 00000000..eea6ba5e --- /dev/null +++ b/libnm-util/nm-setting-8021x.c @@ -0,0 +1,3440 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include "nm-setting-8021x.h" +#include "nm-param-spec-specialized.h" +#include "nm-utils.h" +#include "nm-dbus-glib-types.h" +#include "crypto.h" +#include "nm-utils-private.h" + +/** + * SECTION:nm-setting-8021x + * @short_description: Describes 802.1x-authenticated connection properties + * @include: nm-setting-8021x.h + * + * The #NMSetting8021x object is a #NMSetting subclass that describes + * properties necessary for connection to 802.1x-authenticated networks, such as + * WPA and WPA2 Enterprise WiFi networks and wired 802.1x networks. 802.1x + * connections typically use certificates and/or EAP authentication methods to + * securely verify, identify, and authenticate the client to the network itself, + * instead of simply relying on a widely shared static key. + * + * It's a good idea to read up on wpa_supplicant configuration before using this + * setting extensively, since most of the options here correspond closely with + * the relevant wpa_supplicant configuration options. + * + * Furthermore, to get a good idea of 802.1x, EAP, TLS, TTLS, etc and their + * applications to WiFi and wired networks, you'll want to get copies of the + * following books. + * + * 802.11 Wireless Networks: The Definitive Guide, Second Edition + * Author: Matthew Gast + * ISBN: 978-0596100520 + * + * Cisco Wireless LAN Security + * Authors: Krishna Sankar, Sri Sundaralingam, Darrin Miller, and Andrew Balinsky + * ISBN: 978-1587051548 + **/ + +#define SCHEME_PATH "file://" + +/** + * nm_setting_802_1x_error_quark: + * + * Registers an error quark for #NMSetting8021x if necessary. + * + * Returns: the error quark used for #NMSetting8021x errors. + **/ +GQuark +nm_setting_802_1x_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-802-1x-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_802_1x_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_802_1X_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, "MissingProperty"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSetting8021xError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING) + +#define NM_SETTING_802_1X_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_802_1X, NMSetting8021xPrivate)) + +typedef struct { + GSList *eap; /* GSList of strings */ + char *identity; + char *anonymous_identity; + GByteArray *ca_cert; + char *ca_path; + GByteArray *client_cert; + char *phase1_peapver; + char *phase1_peaplabel; + char *phase1_fast_provisioning; + char *phase2_auth; + char *phase2_autheap; + GByteArray *phase2_ca_cert; + char *phase2_ca_path; + GByteArray *phase2_client_cert; + char *password; + char *pin; + char *psk; + GByteArray *private_key; + char *private_key_password; + GByteArray *phase2_private_key; + char *phase2_private_key_password; + gboolean system_ca_certs; +} NMSetting8021xPrivate; + +enum { + PROP_0, + PROP_EAP, + PROP_IDENTITY, + PROP_ANONYMOUS_IDENTITY, + PROP_CA_CERT, + PROP_CA_PATH, + PROP_CLIENT_CERT, + PROP_PHASE1_PEAPVER, + PROP_PHASE1_PEAPLABEL, + PROP_PHASE1_FAST_PROVISIONING, + PROP_PHASE2_AUTH, + PROP_PHASE2_AUTHEAP, + PROP_PHASE2_CA_CERT, + PROP_PHASE2_CA_PATH, + PROP_PHASE2_CLIENT_CERT, + PROP_PASSWORD, + PROP_PRIVATE_KEY, + PROP_PRIVATE_KEY_PASSWORD, + PROP_PHASE2_PRIVATE_KEY, + PROP_PHASE2_PRIVATE_KEY_PASSWORD, + PROP_PIN, + PROP_PSK, + PROP_SYSTEM_CA_CERTS, + + LAST_PROP +}; + +/** + * nm_setting_802_1x_new: + * + * Creates a new #NMSetting8021x object with default values. + * + * Returns: the new empty #NMSetting8021x object + **/ +NMSetting * +nm_setting_802_1x_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_802_1X, NULL); +} + +/** + * nm_setting_802_1x_get_num_eap_methods: + * @setting: the #NMSetting8021x + * + * Returns the number of eap methods allowed for use when connecting to the + * network. Generally only one EAP method is used. Use the functions + * nm_setting_802_1x_get_eap_method(), nm_setting_802_1x_add_eap_method(), + * and nm_setting_802_1x_remove_eap_method() for adding, removing, and retrieving + * allowed EAP methods. + * + * Returns: the number of allowed EAP methods + **/ +guint32 +nm_setting_802_1x_get_num_eap_methods (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), 0); + + return g_slist_length (NM_SETTING_802_1X_GET_PRIVATE (setting)->eap); +} + +/** + * nm_setting_802_1x_get_eap_method: + * @setting: the #NMSetting8021x + * @i: the index of the EAP method name to return + * + * Returns the name of the allowed EAP method at index @i. + * + * Returns: the name of the allowed EAP method at index @i + **/ +const char * +nm_setting_802_1x_get_eap_method (NMSetting8021x *setting, guint32 i) +{ + NMSetting8021xPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + priv = NM_SETTING_802_1X_GET_PRIVATE (setting); + g_return_val_if_fail (i <= g_slist_length (priv->eap), NULL); + + return (const char *) g_slist_nth_data (priv->eap, i); +} + +/** + * nm_setting_802_1x_add_eap_method: + * @setting: the #NMSetting8021x + * @eap: the name of the EAP method to allow for this connection + * + * Adds an allowed EAP method. The setting is not valid until at least one + * EAP method has been added. See #NMSetting8021x:eap property for a list of + * allowed EAP methods. + * + * Returns: TRUE if the EAP method was successfully added, FALSE if it was + * not a valid method or if it was already allowed. + **/ +gboolean +nm_setting_802_1x_add_eap_method (NMSetting8021x *setting, const char *eap) +{ + NMSetting8021xPrivate *priv; + GSList *iter; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), FALSE); + g_return_val_if_fail (eap != NULL, FALSE); + + priv = NM_SETTING_802_1X_GET_PRIVATE (setting); + for (iter = priv->eap; iter; iter = g_slist_next (iter)) { + if (!strcmp (eap, (char *) iter->data)) + return FALSE; + } + + priv->eap = g_slist_append (priv->eap, g_ascii_strdown (eap, -1)); + return TRUE; +} + +/** + * nm_setting_802_1x_remove_eap_method: + * @setting: the #NMSetting8021x + * @i: the index of the EAP method to remove + * + * Removes the allowed EAP method at the specified index. + **/ +void +nm_setting_802_1x_remove_eap_method (NMSetting8021x *setting, guint32 i) +{ + NMSetting8021xPrivate *priv; + GSList *elt; + + g_return_if_fail (NM_IS_SETTING_802_1X (setting)); + + priv = NM_SETTING_802_1X_GET_PRIVATE (setting); + elt = g_slist_nth (priv->eap, i); + g_return_if_fail (elt != NULL); + + g_free (elt->data); + priv->eap = g_slist_delete_link (priv->eap, elt); +} + +/** + * nm_setting_802_1x_clear_eap_methods: + * @setting: the #NMSetting8021x + * + * Clears all allowed EAP methods. + **/ +void +nm_setting_802_1x_clear_eap_methods (NMSetting8021x *setting) +{ + NMSetting8021xPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_802_1X (setting)); + + priv = NM_SETTING_802_1X_GET_PRIVATE (setting); + nm_utils_slist_free (priv->eap, g_free); + priv->eap = NULL; +} + +/** + * nm_setting_802_1x_get_identity: + * @setting: the #NMSetting8021x + * + * Returns the identifier used by some EAP methods (like TLS) to + * authenticate the user. Often this is a username or login name. + * + * Returns: the user identifier + **/ +const char * +nm_setting_802_1x_get_identity (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->identity; +} + +/** + * nm_setting_802_1x_get_anonymous_identity: + * @setting: the #NMSetting8021x + * + * Returns the anonymous identifier used by some EAP methods (like TTLS) to + * authenticate the user in the outer unencrypted "phase 1" authentication. The + * inner "phase 2" authentication will use the #NMSetting8021x:identity in + * a secure form, if applicable for that EAP method. + * + * Returns: the anonymous identifier + **/ +const char * +nm_setting_802_1x_get_anonymous_identity (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->anonymous_identity; +} + +/** + * nm_setting_802_1x_get_ca_path: + * @setting: the #NMSetting8021x + * + * Returns the path of the CA certificate directory if previously set. Systems + * will often have a directory that contains multiple individual CA certificates + * which the supplicant can then add to the verification chain. This may be + * used in addition to the #NMSetting8021x:ca-cert property to add more CA + * certificates for verifying the network to client. + * + * Returns: the CA certificate directory path + **/ +const char * +nm_setting_802_1x_get_ca_path (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->ca_path; +} + +/** + * nm_setting_802_1x_get_system_ca_certs: + * @setting: the #NMSetting8021x + * + * Sets the #NMSetting8021x:system-ca-certs property. The + * #NMSetting8021x:ca-path and #NMSetting8021x:phase2-ca-path + * properties are ignored if the #NMSetting8021x:system-ca-certs property is + * TRUE, in which case a system-wide CA certificate directory specified at + * compile time (using the --system-ca-path configure option) is used in place + * of these properties. + * + * Returns: TRUE if a system CA certificate path should be used, FALSE if not + **/ +gboolean +nm_setting_802_1x_get_system_ca_certs (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), FALSE); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->system_ca_certs; +} + +static NMSetting8021xCKScheme +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; + + return NM_SETTING_802_1X_CK_SCHEME_BLOB; +} + +/** + * nm_setting_802_1x_get_ca_cert_scheme: + * @setting: the #NMSetting8021x + * + * Returns the scheme used to store the CA certificate. If the returned scheme + * is %NM_SETTING_802_1X_CK_SCHEME_BLOB, use nm_setting_802_1x_get_ca_cert_blob(); + * if %NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_ca_cert_path(). + * + * Returns: scheme used to store the CA certificate (blob or path) + **/ +NMSetting8021xCKScheme +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); +} + +/** + * nm_setting_802_1x_get_ca_cert_blob: + * @setting: the #NMSetting8021x + * + * Returns the CA certificate blob if the CA certificate is stored using the + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. Not all EAP methods use a + * CA certificate (LEAP for example), and those that can take advantage of the + * CA certificate allow it to be unset. Note that lack of a CA certificate + * reduces security by allowing man-in-the-middle attacks, because the identity + * of the network cannot be confirmed by the client. + * + * Returns: the CA certificate data + **/ +const GByteArray * +nm_setting_802_1x_get_ca_cert_blob (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_ca_cert_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB, NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->ca_cert; +} + +/** + * nm_setting_802_1x_get_ca_cert: + * @setting: the #NMSetting8021x + * + * Returns the CA certificate blob if the CA certificate is stored using the + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. Not all EAP methods use a + * CA certificate (LEAP for example), and those that can take advantage of the + * CA certificate allow it to be unset. Note that lack of a CA certificate + * reduces security by allowing man-in-the-middle attacks, because the identity + * of the network cannot be confirmed by the client. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_get_ca_cert_blob(). + * + * Returns: the CA certificate data + **/ +const GByteArray * +nm_setting_802_1x_get_ca_cert (NMSetting8021x *setting) +{ + return nm_setting_802_1x_get_ca_cert_blob (setting); +} + +/** + * nm_setting_802_1x_get_ca_cert_path: + * @setting: the #NMSetting8021x + * + * Returns the CA certificate path if the CA certificate is stored using the + * %NM_SETTING_802_1X_CK_SCHEME_PATH scheme. Not all EAP methods use a + * CA certificate (LEAP for example), and those that can take advantage of the + * CA certificate allow it to be unset. Note that lack of a CA certificate + * reduces security by allowing man-in-the-middle attacks, because the identity + * of the network cannot be confirmed by the client. + * + * Returns: path to the CA certificate file + **/ +const char * +nm_setting_802_1x_get_ca_cert_path (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_ca_cert_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL); + + return (const char *) (NM_SETTING_802_1X_GET_PRIVATE (setting)->ca_cert->data + strlen (SCHEME_PATH)); +} + +/** + * nm_setting_802_1x_set_ca_cert: + * @setting: the #NMSetting8021x + * @value: 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 CA certificate file + * (PEM or DER format). The path must be UTF-8 encoded; use + * g_filename_to_utf8() to convert if needed. Passing NULL with any @scheme + * clears the CA certificate. + * @scheme: desired storage scheme for the certificate + * @out_format: on successful return, the type of the certificate added + * @error: on unsuccessful return, an error + * + * Reads a certificate from disk and sets the #NMSetting8021x:ca-cert property + * with the raw certificate data if using the %NM_SETTING_802_1X_CK_SCHEME_BLOB + * scheme, or with the path to the certificate file if using the + * %NM_SETTING_802_1X_CK_SCHEME_PATH scheme. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_ca_cert (NMSetting8021x *self, + const char *value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error) +{ + NMSetting8021xPrivate *priv; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + GByteArray *data; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (self), FALSE); + + if (value) { + g_return_val_if_fail (g_utf8_validate (value, -1, NULL), FALSE); + g_return_val_if_fail ( scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB + || scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, + FALSE); + } + + if (out_format) + g_return_val_if_fail (*out_format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN, FALSE); + + priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + /* Clear out any previous ca_cert blob */ + if (priv->ca_cert) { + g_byte_array_free (priv->ca_cert, TRUE); + priv->ca_cert = NULL; + } + + if (!value) + return TRUE; + + data = crypto_load_and_verify_certificate (value, &format, error); + if (data) { + /* wpa_supplicant can only use raw x509 CA certs */ + switch (format) { + case NM_CRYPTO_FILE_FORMAT_X509: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_X509; + break; + default: + g_byte_array_free (data, TRUE); + data = NULL; + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_CA_CERT); + break; + } + + if (data) { + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + priv->ca_cert = data; + else if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) { + /* Add the path scheme tag to the front, then the fielname */ + priv->ca_cert = g_byte_array_sized_new (strlen (value) + strlen (SCHEME_PATH) + 1); + g_byte_array_append (priv->ca_cert, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH)); + g_byte_array_append (priv->ca_cert, (const guint8 *) value, strlen (value)); + g_byte_array_append (priv->ca_cert, (const guint8 *) "\0", 1); + } else + g_assert_not_reached (); + } + } + + return priv->ca_cert != NULL; +} + +static NMSetting8021xCKType +ck_format_to_type (NMSetting8021xCKFormat format) +{ + switch (format) { + case NM_SETTING_802_1X_CK_FORMAT_X509: + return NM_SETTING_802_1X_CK_TYPE_X509; + case NM_SETTING_802_1X_CK_FORMAT_RAW_KEY: + return NM_SETTING_802_1X_CK_TYPE_RAW_KEY; + case NM_SETTING_802_1X_CK_FORMAT_PKCS12: + return NM_SETTING_802_1X_CK_TYPE_PKCS12; + default: + break; + } + return NM_SETTING_802_1X_CK_TYPE_UNKNOWN; +} + +/** + * nm_setting_802_1x_set_ca_cert_from_file: + * @setting: the #NMSetting8021x + * @filename: the path of the CA certificate file (PEM or DER format). Passing + * NULL clears the CA certificate. + * @out_ck_type: on successful return, the type of the certificate added + * @error: on unsuccessful return, an error + * + * Reads a certificate from disk and sets the #NMSetting8021x:ca-cert property + * with the raw certificate data using the %NM_SETTING_802_1X_CK_SCHEME_BLOB + * scheme. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_set_ca_cert() with the + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_ca_cert_from_file (NMSetting8021x *setting, + const char *filename, + NMSetting8021xCKType *out_ck_type, + GError **error) +{ + gboolean success; + NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + success = nm_setting_802_1x_set_ca_cert (setting, + filename, + NM_SETTING_802_1X_CK_SCHEME_BLOB, + &format, + error); + if (success && out_ck_type) + *out_ck_type = ck_format_to_type (format); + + return success; +} + +/** + * nm_setting_802_1x_get_client_cert_scheme: + * @setting: the #NMSetting8021x + * + * Returns the scheme used to store the client certificate. If the returned scheme + * is %NM_SETTING_802_1X_CK_SCHEME_BLOB, use nm_setting_802_1x_get_client_cert_blob(); + * if %NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_client_cert_path(). + * + * Returns: scheme used to store the client certificate (blob or path) + **/ +NMSetting8021xCKScheme +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); +} + +/** + * nm_setting_802_1x_get_client_cert_blob: + * @setting: the #NMSetting8021x + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: the client certificate data + **/ +const GByteArray * +nm_setting_802_1x_get_client_cert_blob (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_client_cert_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB, NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->client_cert; +} + +/** + * nm_setting_802_1x_get_client_cert: + * @setting: the #NMSetting8021x + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_get_client_cert_blob(). + * + * Returns: the client certificate data + **/ +const GByteArray * +nm_setting_802_1x_get_client_cert (NMSetting8021x *setting) +{ + return nm_setting_802_1x_get_client_cert_blob (setting); +} + +/** + * nm_setting_802_1x_get_client_cert_path: + * @setting: the #NMSetting8021x + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: path to the client certificate file + **/ +const char * +nm_setting_802_1x_get_client_cert_path (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_client_cert_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL); + + return (const char *) (NM_SETTING_802_1X_GET_PRIVATE (setting)->client_cert->data + strlen (SCHEME_PATH)); +} + +/** + * nm_setting_802_1x_set_client_cert: + * @setting: the #NMSetting8021x + * @value: 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 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 + * @out_format: on successful return, the type of the certificate added + * @error: on unsuccessful return, an error + * + * Reads a certificate from disk and sets the #NMSetting8021x:client-cert + * property with the raw certificate data if using the + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the certificate + * file if using the %NM_SETTING_802_1X_CK_SCHEME_PATH scheme. + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_client_cert (NMSetting8021x *self, + const char *value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error) +{ + NMSetting8021xPrivate *priv; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + GByteArray *data; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (self), FALSE); + + if (value) { + g_return_val_if_fail (g_utf8_validate (value, -1, NULL), FALSE); + g_return_val_if_fail ( scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB + || scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, + FALSE); + } + + if (out_format) + g_return_val_if_fail (*out_format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN, FALSE); + + priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + /* Clear out any previous ca_cert blob */ + if (priv->client_cert) { + g_byte_array_free (priv->client_cert, TRUE); + priv->client_cert = NULL; + } + + if (!value) + return TRUE; + + data = crypto_load_and_verify_certificate (value, &format, error); + if (data) { + /* wpa_supplicant can only use raw x509 CA certs */ + switch (format) { + case NM_CRYPTO_FILE_FORMAT_X509: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_X509; + break; + case NM_CRYPTO_FILE_FORMAT_PKCS12: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_PKCS12; + break; + default: + g_byte_array_free (data, TRUE); + data = NULL; + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_CLIENT_CERT); + break; + } + + if (data) { + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + priv->client_cert = data; + else if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) { + /* Add the path scheme tag to the front, then the fielname */ + priv->client_cert = g_byte_array_sized_new (strlen (value) + strlen (SCHEME_PATH) + 1); + g_byte_array_append (priv->client_cert, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH)); + g_byte_array_append (priv->client_cert, (const guint8 *) value, strlen (value)); + g_byte_array_append (priv->client_cert, (const guint8 *) "\0", 1); + } else + g_assert_not_reached (); + } + } + + return priv->client_cert != NULL; +} + +/** + * nm_setting_802_1x_set_client_cert_from_file: + * @setting: the #NMSetting8021x + * @filename: the path of the client certificate file (PEM, DER, or + * PKCS#12 format). Passing NULL clears the client certificate. + * @out_ck_type: on successful return, the type of the certificate added + * @error: on unsuccessful return, an error + * + * Reads a certificate from disk and sets the #NMSetting8021x:client-cert + * property with the raw certificate data. + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_set_client_cert() with the + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_client_cert_from_file (NMSetting8021x *setting, + const char *filename, + NMSetting8021xCKType *out_ck_type, + GError **error) +{ + gboolean success; + NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + success = nm_setting_802_1x_set_client_cert (setting, + filename, + NM_SETTING_802_1X_CK_SCHEME_BLOB, + &format, + error); + if (success && out_ck_type) + *out_ck_type = ck_format_to_type (format); + + return success; +} + +/** + * nm_setting_802_1x_get_phase1_peapver: + * @setting: the #NMSetting8021x + * + * Returns: the "phase 1" PEAP version to be used when authenticating with + * EAP-PEAP as contained in the #NMSetting8021x:phase1-peapver property. Valid + * values are NULL (unset), "0" (PEAP version 0), and "1" (PEAP version 1). + **/ +const char * +nm_setting_802_1x_get_phase1_peapver (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase1_peapver; +} + +/** + * nm_setting_802_1x_get_phase1_peaplabel: + * @setting: the #NMSetting8021x + * + * Returns: whether the "phase 1" PEAP label is new-style or old-style, to be + * used when authenticating with EAP-PEAP, as contained in the + * #NMSetting8021x:phase1-peaplabel property. Valid values are NULL (unset), + * "0" (use old-style label), and "1" (use new-style label). See the + * wpa_supplicant documentation for more details. + **/ +const char * +nm_setting_802_1x_get_phase1_peaplabel (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase1_peaplabel; +} + +/** + * nm_setting_802_1x_get_phase1_fast_provisioning: + * @setting: the #NMSetting8021x + * + * Returns: whether "phase 1" PEAP fast provisioning should be used, as specified + * by the #NMSetting8021x:phase1-fast-provisioning property. See the + * wpa_supplicant documentation for more details. + **/ +const char * +nm_setting_802_1x_get_phase1_fast_provisioning (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase1_fast_provisioning; +} + +/** + * nm_setting_802_1x_get_phase2_auth: + * @setting: the #NMSetting8021x + * + * Returns: the "phase 2" non-EAP (ex MD5) allowed authentication method as + * specified by the #NMSetting8021x:phase2-auth property. + **/ +const char * +nm_setting_802_1x_get_phase2_auth (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_auth; +} + +/** + * nm_setting_802_1x_get_phase2_autheap: + * @setting: the #NMSetting8021x + * + * Returns: the "phase 2" EAP-based (ex TLS) allowed authentication method as + * specified by the #NMSetting8021x:phase2-autheap property. + **/ +const char * +nm_setting_802_1x_get_phase2_autheap (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_autheap; +} + +/** + * nm_setting_802_1x_get_phase2_ca_path: + * @setting: the #NMSetting8021x + * + * Returns the path of the "phase 2" CA certificate directory if previously set. + * Systems will often have a directory that contains multiple individual CA + * certificates which the supplicant can then add to the verification chain. + * This may be used in addition to the #NMSetting8021x:phase2-ca-cert property + * to add more CA certificates for verifying the network to client. + * + * Returns: the "phase 2" CA certificate directory path + **/ +const char * +nm_setting_802_1x_get_phase2_ca_path (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_ca_path; +} + +/** + * nm_setting_802_1x_get_phase2_ca_cert_scheme: + * @setting: the #NMSetting8021x + * + * Returns the scheme used to store the "phase 2" CA certificate. If the + * returned scheme is %NM_SETTING_802_1X_CK_SCHEME_BLOB, use + * nm_setting_802_1x_get_ca_cert_blob(); if %NM_SETTING_802_1X_CK_SCHEME_PATH, + * use nm_setting_802_1x_get_ca_cert_path(). + * + * Returns: scheme used to store the "phase 2" CA certificate (blob or path) + **/ +NMSetting8021xCKScheme +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); +} + +/** + * nm_setting_802_1x_get_phase2_ca_cert_blob: + * @setting: the #NMSetting8021x + * + * Returns the "phase 2" CA certificate blob if the CA certificate is stored + * using the %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. Not all EAP methods use + * a CA certificate (LEAP for example), and those that can take advantage of the + * CA certificate allow it to be unset. Note that lack of a CA certificate + * reduces security by allowing man-in-the-middle attacks, because the identity + * of the network cannot be confirmed by the client. + * + * Returns: the "phase 2" CA certificate data + **/ +const GByteArray * +nm_setting_802_1x_get_phase2_ca_cert_blob (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_phase2_ca_cert_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB, NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_ca_cert; +} + +/** + * nm_setting_802_1x_get_phase2_ca_cert: + * @setting: the #NMSetting8021x + * + * Returns the "phase 2" CA certificate blob. Not all EAP methods use + * a CA certificate (LEAP for example), and those that can take advantage of the + * CA certificate allow it to be unset. Note that lack of a CA certificate + * reduces security by allowing man-in-the-middle attacks, because the identity + * of the network cannot be confirmed by the client. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_get_phase2_ca_cert_blob(). + * + * Returns: the "phase 2" CA certificate data + **/ +const GByteArray * +nm_setting_802_1x_get_phase2_ca_cert (NMSetting8021x *setting) +{ + return nm_setting_802_1x_get_phase2_ca_cert_blob (setting); +} + +/** + * nm_setting_802_1x_get_phase2_ca_cert_path: + * @setting: the #NMSetting8021x + * + * Returns the "phase 2" CA certificate path if the CA certificate is stored + * using the %NM_SETTING_802_1X_CK_SCHEME_PATH scheme. Not all EAP methods use + * a CA certificate (LEAP for example), and those that can take advantage of the + * CA certificate allow it to be unset. Note that lack of a CA certificate + * reduces security by allowing man-in-the-middle attacks, because the identity + * of the network cannot be confirmed by the client. + * + * Returns: path to the "phase 2" CA certificate file + **/ +const char * +nm_setting_802_1x_get_phase2_ca_cert_path (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_phase2_ca_cert_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL); + + return (const char *) (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_ca_cert->data + strlen (SCHEME_PATH)); +} + +/** + * nm_setting_802_1x_set_phase2_ca_cert: + * @setting: the #NMSetting8021x + * @value: 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" CA + * certificate file (PEM or DER 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" CA certificate. + * @scheme: desired storage scheme for the certificate + * @out_format: on successful return, the type of the certificate added + * @error: on unsuccessful return, an error + * + * Reads a certificate from disk and sets the #NMSetting8021x:phase2-ca-cert + * property with the raw certificate data if using the + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the certificate + * file if using the %NM_SETTING_802_1X_CK_SCHEME_PATH scheme. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_phase2_ca_cert (NMSetting8021x *self, + const char *value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error) +{ + NMSetting8021xPrivate *priv; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + GByteArray *data; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (self), FALSE); + + if (value) { + g_return_val_if_fail (g_utf8_validate (value, -1, NULL), FALSE); + g_return_val_if_fail ( scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB + || scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, + FALSE); + } + + if (out_format) + g_return_val_if_fail (*out_format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN, FALSE); + + priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + /* Clear out any previous ca_cert blob */ + if (priv->phase2_ca_cert) { + g_byte_array_free (priv->phase2_ca_cert, TRUE); + priv->phase2_ca_cert = NULL; + } + + if (!value) + return TRUE; + + data = crypto_load_and_verify_certificate (value, &format, error); + if (data) { + /* wpa_supplicant can only use raw x509 CA certs */ + switch (format) { + case NM_CRYPTO_FILE_FORMAT_X509: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_X509; + break; + default: + g_byte_array_free (data, TRUE); + data = NULL; + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_CA_CERT); + break; + } + + if (data) { + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + priv->phase2_ca_cert = data; + else if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) { + /* Add the path scheme tag to the front, then the fielname */ + priv->phase2_ca_cert = g_byte_array_sized_new (strlen (value) + strlen (SCHEME_PATH) + 1); + g_byte_array_append (priv->phase2_ca_cert, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH)); + g_byte_array_append (priv->phase2_ca_cert, (const guint8 *) value, strlen (value)); + g_byte_array_append (priv->phase2_ca_cert, (const guint8 *) "\0", 1); + } else + g_assert_not_reached (); + } + } + + return priv->phase2_ca_cert != NULL; +} + +/** + * nm_setting_802_1x_set_phase2_ca_cert_from_file: + * @setting: the #NMSetting8021x + * @filename: the path of the "phase2" CA certificate file (PEM or DER format). + * Passing NULL with any @scheme clears the "phase2" CA certificate. + * @out_ck_type: on successful return, the type of the certificate added + * @error: on unsuccessful return, an error + * + * Reads a certificate from disk and sets the #NMSetting8021x:phase2-ca-cert + * property with the raw certificate data. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_set_phase2_ca_cert(). + * with the %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_phase2_ca_cert_from_file (NMSetting8021x *setting, + const char *filename, + NMSetting8021xCKType *out_ck_type, + GError **error) +{ + gboolean success; + NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + success = nm_setting_802_1x_set_phase2_ca_cert (setting, + filename, + NM_SETTING_802_1X_CK_SCHEME_BLOB, + &format, + error); + if (success && out_ck_type) + *out_ck_type = ck_format_to_type (format); + + return success; +} + +/** + * nm_setting_802_1x_get_phase2_client_cert_scheme: + * @setting: the #NMSetting8021x + * + * Returns the scheme used to store the "phase 2" client certificate. If the + * returned scheme is %NM_SETTING_802_1X_CK_SCHEME_BLOB, use + * nm_setting_802_1x_get_client_cert_blob(); if + * %NM_SETTING_802_1X_CK_SCHEME_PATH, use + * nm_setting_802_1x_get_client_cert_path(). + * + * Returns: scheme used to store the "phase 2" client certificate (blob or path) + **/ +NMSetting8021xCKScheme +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); +} + +/** + * nm_setting_802_1x_get_phase2_client_cert_blob: + * @setting: the #NMSetting8021x + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: the "phase 2" client certificate data + **/ +const GByteArray * +nm_setting_802_1x_get_phase2_client_cert_blob (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_phase2_client_cert_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB, NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_client_cert; +} + +/** + * nm_setting_802_1x_get_phase2_client_cert: + * @setting: the #NMSetting8021x + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_get_phase2_client_cert_blob(). + * + * Returns: the "phase 2" client certificate data + **/ +const GByteArray * +nm_setting_802_1x_get_phase2_client_cert (NMSetting8021x *setting) +{ + return nm_setting_802_1x_get_phase2_client_cert_blob (setting); +} + +/** + * nm_setting_802_1x_get_phase2_client_cert_path: + * @setting: the #NMSetting8021x + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: path to the "phase 2" client certificate file + **/ +const char * +nm_setting_802_1x_get_phase2_client_cert_path (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_phase2_client_cert_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL); + + return (const char *) (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_client_cert->data + strlen (SCHEME_PATH)); +} + +/** + * nm_setting_802_1x_set_phase2_client_cert: + * @setting: the #NMSetting8021x + * @value: 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 + * 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 + * @out_format: on successful return, the type of the certificate added + * @error: on unsuccessful return, an error + * + * Reads a certificate from disk and sets the #NMSetting8021x:phase2-client-cert + * property with the raw certificate data if using the + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the certificate + * file if using the %NM_SETTING_802_1X_CK_SCHEME_PATH scheme. + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_phase2_client_cert (NMSetting8021x *self, + const char *value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error) +{ + NMSetting8021xPrivate *priv; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + GByteArray *data; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (self), FALSE); + + if (value) { + g_return_val_if_fail (g_utf8_validate (value, -1, NULL), FALSE); + g_return_val_if_fail ( scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB + || scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, + FALSE); + } + + if (out_format) + g_return_val_if_fail (*out_format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN, FALSE); + + priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + /* Clear out any previous ca_cert blob */ + if (priv->phase2_client_cert) { + g_byte_array_free (priv->phase2_client_cert, TRUE); + priv->phase2_client_cert = NULL; + } + + if (!value) + return TRUE; + + data = crypto_load_and_verify_certificate (value, &format, error); + if (data) { + /* wpa_supplicant can only use raw x509 CA certs */ + switch (format) { + case NM_CRYPTO_FILE_FORMAT_X509: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_X509; + break; + case NM_CRYPTO_FILE_FORMAT_PKCS12: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_PKCS12; + break; + default: + g_byte_array_free (data, TRUE); + data = NULL; + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_CLIENT_CERT); + break; + } + + if (data) { + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + priv->phase2_client_cert = data; + else if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) { + /* Add the path scheme tag to the front, then the fielname */ + priv->phase2_client_cert = g_byte_array_sized_new (strlen (value) + strlen (SCHEME_PATH) + 1); + g_byte_array_append (priv->phase2_client_cert, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH)); + g_byte_array_append (priv->phase2_client_cert, (const guint8 *) value, strlen (value)); + g_byte_array_append (priv->phase2_client_cert, (const guint8 *) "\0", 1); + } else + g_assert_not_reached (); + } + } + + return priv->phase2_client_cert != NULL; +} + +/** + * nm_setting_802_1x_set_phase2_client_cert_from_file: + * @setting: the #NMSetting8021x + * @filename: pass the path of the "phase2" client certificate file (PEM, DER, + * or PKCS#12 format). Passing NULL clears the "phase2" client certificate. + * @out_ck_type: on successful return, the type of the certificate added + * @error: on unsuccessful return, an error + * + * Reads a certificate from disk and sets the #NMSetting8021x:phase2-client-cert + * property with the raw certificate data. + * + * Client certificates are used to identify the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_set_phase2_client_cert() with the. + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_phase2_client_cert_from_file (NMSetting8021x *setting, + const char *filename, + NMSetting8021xCKType *out_ck_type, + GError **error) +{ + gboolean success; + NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + success = nm_setting_802_1x_set_phase2_client_cert (setting, + filename, + NM_SETTING_802_1X_CK_SCHEME_BLOB, + &format, + error); + if (success && out_ck_type) + *out_ck_type = ck_format_to_type (format); + + return success; +} + +/** + * nm_setting_802_1x_get_password: + * @setting: the #NMSetting8021x + * + * Returns: the password used by the authentication method, if any, as specified + * by the #NMSetting8021x:password property + **/ +const char * +nm_setting_802_1x_get_password (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->password; +} + +/** + * nm_setting_802_1x_get_pin: + * @setting: the #NMSetting8021x + * + * Returns: the PIN used by the authentication method, if any, as specified + * by the #NMSetting8021x:pin property + **/ +const char * +nm_setting_802_1x_get_pin (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->pin; +} + +/** + * nm_setting_802_1x_get_psk: + * @setting: the #NMSetting8021x + * + * Returns: the Pre-Shared-Key used by the authentication method, if any, as + * specified by the #NMSetting8021x:psk property + **/ +const char * +nm_setting_802_1x_get_psk (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->psk; +} + +/** + * nm_setting_802_1x_get_private_key_scheme: + * @setting: the #NMSetting8021x + * + * Returns the scheme used to store the private key. If the returned scheme is + * %NM_SETTING_802_1X_CK_SCHEME_BLOB, use + * nm_setting_802_1x_get_client_cert_blob(); if + * %NM_SETTING_802_1X_CK_SCHEME_PATH, use + * nm_setting_802_1x_get_client_cert_path(). + * + * Returns: scheme used to store the private key (blob or path) + **/ +NMSetting8021xCKScheme +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); +} + +/** + * nm_setting_802_1x_get_private_key_blob: + * @setting: the #NMSetting8021x + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: the private key data + **/ +const GByteArray * +nm_setting_802_1x_get_private_key_blob (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_private_key_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB, NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->private_key; +} + +/** + * nm_setting_802_1x_get_private_key: + * @setting: the #NMSetting8021x + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_get_private_key_blob(). + * + * Returns: the private key data + **/ +const GByteArray * +nm_setting_802_1x_get_private_key (NMSetting8021x *setting) +{ + return nm_setting_802_1x_get_private_key_blob (setting); +} + +/** + * nm_setting_802_1x_get_private_key_path: + * @setting: the #NMSetting8021x + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: path to the private key file + **/ +const char * +nm_setting_802_1x_get_private_key_path (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_private_key_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL); + + return (const char *) (NM_SETTING_802_1X_GET_PRIVATE (setting)->private_key->data + strlen (SCHEME_PATH)); +} + +/** + * nm_setting_802_1x_set_private_key: + * @setting: the #NMSetting8021x + * @value: 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 + * 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 + * @scheme: desired storage scheme for the private key + * @out_format: on successful return, the type of the private key added + * @error: on unsuccessful return, an error + * + * Reads a private key from disk and sets the #NMSetting8021x:private-key + * property with the raw private key data if using the + * %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the private key + * file if using the %NM_SETTING_802_1X_CK_SCHEME_PATH scheme. + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_private_key (NMSetting8021x *self, + const char *value, + const char *password, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error) +{ + NMSetting8021xPrivate *priv; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN; + GByteArray *data; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (self), FALSE); + + if (value) { + g_return_val_if_fail (g_utf8_validate (value, -1, NULL), FALSE); + g_return_val_if_fail ( scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB + || scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, + FALSE); + } + + if (out_format) + g_return_val_if_fail (*out_format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN, FALSE); + + priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + /* Clear out any previous private key blob */ + if (priv->private_key) { + /* Try not to leave the private key around in memory */ + memset (priv->private_key, 0, priv->private_key->len); + g_byte_array_free (priv->private_key, TRUE); + priv->private_key = NULL; + } + + g_free (priv->private_key_password); + priv->private_key_password = NULL; + + if (!value) + return TRUE; + + /* Verify the key and the private key password */ + data = crypto_get_private_key (value, + password, + &key_type, + &format, + error); + if (!data) { + /* As a special case for private keys, even if the decrypt fails, + * return the key's file type. + */ + if (out_format && crypto_is_pkcs12_file (value, NULL)) + *out_format = NM_SETTING_802_1X_CK_FORMAT_PKCS12; + + return FALSE; + } + + switch (format) { + case NM_CRYPTO_FILE_FORMAT_RAW_KEY: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_RAW_KEY; + break; + case NM_CRYPTO_FILE_FORMAT_X509: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_X509; + break; + case NM_CRYPTO_FILE_FORMAT_PKCS12: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_PKCS12; + break; + default: + memset (data->data, 0, data->len); + g_byte_array_free (data, TRUE); + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PRIVATE_KEY); + return FALSE; + } + + g_assert (data); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) { + priv->private_key = data; + data = NULL; + + /* Always update the private key for blob + pkcs12 since the + * pkcs12 files are encrypted + */ + if (format == NM_CRYPTO_FILE_FORMAT_PKCS12) + priv->private_key_password = g_strdup (password); + } else if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) { + /* Add the path scheme tag to the front, then the fielname */ + priv->private_key = g_byte_array_sized_new (strlen (value) + strlen (SCHEME_PATH) + 1); + g_byte_array_append (priv->private_key, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH)); + g_byte_array_append (priv->private_key, (const guint8 *) value, strlen (value)); + g_byte_array_append (priv->private_key, (const guint8 *) "\0", 1); + + /* Always update the private key with paths since the key the + * cert refers to is encrypted. + */ + priv->private_key_password = g_strdup (password); + } else + g_assert_not_reached (); + + /* Clear and free private key data if it's no longer needed */ + if (data) { + memset (data->data, 0, data->len); + g_byte_array_free (data, TRUE); + } + + /* As required by NM and wpa_supplicant, set the client-cert + * property to the same PKCS#12 data. + */ + if (format == NM_CRYPTO_FILE_FORMAT_PKCS12) { + if (priv->client_cert) + g_byte_array_free (priv->client_cert, TRUE); + + priv->client_cert = g_byte_array_sized_new (priv->private_key->len); + g_byte_array_append (priv->client_cert, priv->private_key->data, priv->private_key->len); + } + + return priv->private_key != NULL; +} + +/** + * nm_setting_802_1x_set_private_key_from_file: + * @setting: the #NMSetting8021x + * @filename: the path of the private key file (PEM, DER, or PKCS#12 format). + * Passing NULL clears the private key. + * @password: password used to decrypt the private key + * @out_ck_type: on successful return, the type of the private key added + * @error: on unsuccessful return, an error + * + * Reads a private key from disk and sets the #NMSetting8021x:private-key + * property with the raw private key data. + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_set_private_key() with. + * the %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_private_key_from_file (NMSetting8021x *setting, + const char *filename, + const char *password, + NMSetting8021xCKType *out_ck_type, + GError **error) +{ + gboolean success; + NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + success = nm_setting_802_1x_set_private_key (setting, + filename, + password, + NM_SETTING_802_1X_CK_SCHEME_BLOB, + &format, + error); + if (success && out_ck_type) + *out_ck_type = ck_format_to_type (format); + + return success; +} + +/** + * nm_setting_802_1x_get_private_key_password: + * @setting: the #NMSetting8021x + * + * Returns: the private key password used to decrypt the private key if + * previously set with nm_setting_802_1x_set_private_key_from_file(), + * nm_setting_802_1x_set_private_key_path(), or the + * #NMSetting8021x:private-key-password property. + **/ +const char * +nm_setting_802_1x_get_private_key_password (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->private_key_password; +} + +/** + * nm_setting_802_1x_get_private_key_format: + * @setting: the #NMSetting8021x + * + * Returns: the data format of the private key data stored in the + * #NMSetting8021x:private-key property + **/ +NMSetting8021xCKFormat +nm_setting_802_1x_get_private_key_format (NMSetting8021x *setting) +{ + NMSetting8021xPrivate *priv; + const char *path; + GError *error = NULL; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NM_SETTING_802_1X_CK_FORMAT_UNKNOWN); + priv = NM_SETTING_802_1X_GET_PRIVATE (setting); + + if (!priv->private_key) + return NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + switch (nm_setting_802_1x_get_private_key_scheme (setting)) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + if (crypto_is_pkcs12_data (priv->private_key)) + return NM_SETTING_802_1X_CK_FORMAT_PKCS12; + return NM_SETTING_802_1X_CK_FORMAT_X509; + 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 */ + g_error_free (error); + return NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + } + return NM_SETTING_802_1X_CK_FORMAT_X509; + default: + break; + } + + return NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; +} + +/** + * nm_setting_802_1x_get_private_key_type: + * @setting: the #NMSetting8021x + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_get_private_key_format(). + * + * Returns: the data format of the private key data stored in the + * #NMSetting8021x:private-key property + **/ +NMSetting8021xCKType +nm_setting_802_1x_get_private_key_type (NMSetting8021x *setting) +{ + return ck_format_to_type (nm_setting_802_1x_get_private_key_format (setting)); +} + +/** + * nm_setting_802_1x_get_phase2_private_key_password: + * @setting: the #NMSetting8021x + * + * Returns: the private key password used to decrypt the private key if + * previously set with nm_setting_802_1x_set_phase2_private_key_from_file(), + * nm_setting_802_1x_set_phase2_private_key_path(), or the + * #NMSetting8021x:phase2-private-key-password property. + **/ +const char * +nm_setting_802_1x_get_phase2_private_key_password (NMSetting8021x *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_private_key_password; +} + +/** + * nm_setting_802_1x_get_phase2_private_key_scheme: + * @setting: the #NMSetting8021x + * + * Returns the scheme used to store the "phase 2" private key. If the returned + * scheme is %NM_SETTING_802_1X_CK_SCHEME_BLOB, use + * nm_setting_802_1x_get_client_cert_blob(); if + * %NM_SETTING_802_1X_CK_SCHEME_PATH, use + * nm_setting_802_1x_get_client_cert_path(). + * + * Returns: scheme used to store the "phase 2" private key (blob or path) + **/ +NMSetting8021xCKScheme +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); +} + +/** + * nm_setting_802_1x_get_phase2_private_key_blob: + * @setting: the #NMSetting8021x + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: the "phase 2" private key data + **/ +const GByteArray * +nm_setting_802_1x_get_phase2_private_key_blob (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_phase2_private_key_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB, NULL); + + return NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_private_key; +} + +/** + * nm_setting_802_1x_get_phase2_private_key: + * @setting: the #NMSetting8021x + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_get_private_key_blob(). + * + * Returns: the "phase 2" private key data + **/ +const GByteArray * +nm_setting_802_1x_get_phase2_private_key (NMSetting8021x *setting) +{ + return nm_setting_802_1x_get_phase2_private_key_blob (setting); +} + +/** + * nm_setting_802_1x_get_phase2_private_key_path: + * @setting: the #NMSetting8021x + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: path to the "phase 2" private key file + **/ +const char * +nm_setting_802_1x_get_phase2_private_key_path (NMSetting8021x *setting) +{ + NMSetting8021xCKScheme scheme; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NULL); + + scheme = nm_setting_802_1x_get_phase2_private_key_scheme (setting); + g_return_val_if_fail (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, NULL); + + return (const char *) (NM_SETTING_802_1X_GET_PRIVATE (setting)->phase2_private_key->data + strlen (SCHEME_PATH)); +} + +/** + * nm_setting_802_1x_set_phase2_private_key: + * @setting: the #NMSetting8021x + * @value: 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; + * use g_filename_to_utf8() to convert if needed. Passing NULL with any + * @scheme clears the "phase2" private key. + * @password: password used to decrypt the private key + * @scheme: desired storage scheme for the private key + * @out_format: on successful return, the type of the private key added + * @error: on unsuccessful return, an error + * + * Reads a "phase 2" private key from disk and sets the + * #NMSetting8021x:phase2-private-key property with the raw private key data if + * using the %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the + * private key file if using the %NM_SETTING_802_1X_CK_SCHEME_PATH scheme. + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_phase2_private_key (NMSetting8021x *self, + const char *value, + const char *password, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error) +{ + NMSetting8021xPrivate *priv; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN; + GByteArray *data; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (self), FALSE); + + if (value) { + g_return_val_if_fail (g_utf8_validate (value, -1, NULL), FALSE); + g_return_val_if_fail ( scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB + || scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, + FALSE); + } + + if (out_format) + g_return_val_if_fail (*out_format == NM_SETTING_802_1X_CK_FORMAT_UNKNOWN, FALSE); + + priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + /* Clear out any previous private key blob */ + if (priv->phase2_private_key) { + /* Try not to leave the private key around in memory */ + memset (priv->phase2_private_key, 0, priv->phase2_private_key->len); + g_byte_array_free (priv->phase2_private_key, TRUE); + priv->phase2_private_key = NULL; + } + + g_free (priv->phase2_private_key_password); + priv->phase2_private_key_password = NULL; + + if (!value) + return TRUE; + + /* Verify the key and the private key password */ + data = crypto_get_private_key (value, + password, + &key_type, + &format, + error); + if (!data) { + /* As a special case for private keys, even if the decrypt fails, + * return the key's file type. + */ + if (out_format && crypto_is_pkcs12_file (value, NULL)) + *out_format = NM_SETTING_802_1X_CK_FORMAT_PKCS12; + + return FALSE; + } + + switch (format) { + case NM_CRYPTO_FILE_FORMAT_RAW_KEY: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_RAW_KEY; + break; + case NM_CRYPTO_FILE_FORMAT_X509: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_X509; + break; + case NM_CRYPTO_FILE_FORMAT_PKCS12: + if (out_format) + *out_format = NM_SETTING_802_1X_CK_FORMAT_PKCS12; + break; + default: + memset (data->data, 0, data->len); + g_byte_array_free (data, TRUE); + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY); + return FALSE; + } + + g_assert (data); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) { + priv->phase2_private_key = data; + data = NULL; + + /* Always update the private key for blob + pkcs12 since the + * pkcs12 files are encrypted + */ + if (format == NM_CRYPTO_FILE_FORMAT_PKCS12) + priv->phase2_private_key_password = g_strdup (password); + } else if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) { + /* Add the path scheme tag to the front, then the fielname */ + priv->phase2_private_key = g_byte_array_sized_new (strlen (value) + strlen (SCHEME_PATH) + 1); + g_byte_array_append (priv->phase2_private_key, (const guint8 *) SCHEME_PATH, strlen (SCHEME_PATH)); + g_byte_array_append (priv->phase2_private_key, (const guint8 *) value, strlen (value)); + g_byte_array_append (priv->phase2_private_key, (const guint8 *) "\0", 1); + + /* Always update the private key with paths since the key the + * cert refers to is encrypted. + */ + priv->phase2_private_key_password = g_strdup (password); + } else + g_assert_not_reached (); + + /* Clear and free private key data if it's no longer needed */ + if (data) { + memset (data->data, 0, data->len); + g_byte_array_free (data, TRUE); + } + + /* As required by NM and wpa_supplicant, set the client-cert + * property to the same PKCS#12 data. + */ + if (format == NM_CRYPTO_FILE_FORMAT_PKCS12) { + if (priv->phase2_client_cert) + g_byte_array_free (priv->phase2_client_cert, TRUE); + + priv->phase2_client_cert = g_byte_array_sized_new (priv->phase2_private_key->len); + g_byte_array_append (priv->phase2_client_cert, priv->phase2_private_key->data, priv->phase2_private_key->len); + } + + return priv->phase2_private_key != NULL; +} + +/** + * nm_setting_802_1x_set_phase2_private_key_from_file: + * @setting: the #NMSetting8021x + * @filename: the path of the "phase2" private key file (PEM, DER, or PKCS#12 + * format). Passing NULL clears the "phase2" private key. + * @password: password used to decrypt the private key + * @out_ck_type: on successful return, the type of the private key added + * @error: on unsuccessful return, an error + * + * Reads a "phase 2" private key from disk and sets the + * #NMSetting8021x:phase2-private-key property with the raw private key data. + * + * Private keys are used to authenticate the connecting client to the network + * when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x + * authentication method. + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_set_phase2_private_key() with + * the %NM_SETTING_802_1X_CK_SCHEME_BLOB scheme. + * + * Returns: TRUE if the operation succeeded, FALSE if it was unsuccessful + **/ +gboolean +nm_setting_802_1x_set_phase2_private_key_from_file (NMSetting8021x *setting, + const char *filename, + const char *password, + NMSetting8021xCKType *out_ck_type, + GError **error) +{ + gboolean success; + NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + success = nm_setting_802_1x_set_phase2_private_key (setting, + filename, + password, + NM_SETTING_802_1X_CK_SCHEME_BLOB, + &format, + error); + if (success && out_ck_type) + *out_ck_type = ck_format_to_type (format); + + return success; +} + +/** + * nm_setting_802_1x_get_phase2_private_key_format: + * @setting: the #NMSetting8021x + * + * Returns: the data format of the "phase 2" private key data stored in the + * #NMSetting8021x:phase2-private-key property + **/ +NMSetting8021xCKFormat +nm_setting_802_1x_get_phase2_private_key_format (NMSetting8021x *setting) +{ + NMSetting8021xPrivate *priv; + const char *path; + GError *error = NULL; + + g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), NM_SETTING_802_1X_CK_FORMAT_UNKNOWN); + priv = NM_SETTING_802_1X_GET_PRIVATE (setting); + + if (!priv->phase2_private_key) + return NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + switch (nm_setting_802_1x_get_phase2_private_key_scheme (setting)) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + if (crypto_is_pkcs12_data (priv->phase2_private_key)) + return NM_SETTING_802_1X_CK_FORMAT_PKCS12; + return NM_SETTING_802_1X_CK_FORMAT_X509; + 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 */ + g_error_free (error); + return NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + } + return NM_SETTING_802_1X_CK_FORMAT_X509; + default: + break; + } + + return NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; +} + +/** + * nm_setting_802_1x_get_phase2_private_key_type: + * @setting: the #NMSetting8021x + * + * Deprecated: 0.8: This function has been deprecated and should + * not be used in newly written code. Calling this function is + * equivalent to calling nm_setting_802_1x_get_phase2_private_key_format(). + * + * Returns: the data format of the private key data stored in the + * #NMSetting8021x:phase2-private-key property + **/ +NMSetting8021xCKType +nm_setting_802_1x_get_phase2_private_key_type (NMSetting8021x *setting) +{ + return ck_format_to_type (nm_setting_802_1x_get_phase2_private_key_format (setting)); +} + +static void +need_secrets_password (NMSetting8021x *self, + GPtrArray *secrets, + gboolean phase2) +{ + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + if (!priv->password || !strlen (priv->password)) + g_ptr_array_add (secrets, NM_SETTING_802_1X_PASSWORD); +} + +static void +need_secrets_sim (NMSetting8021x *self, + GPtrArray *secrets, + gboolean phase2) +{ + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + if (!priv->pin || !strlen (priv->pin)) + g_ptr_array_add (secrets, NM_SETTING_802_1X_PIN); +} + +static gboolean +need_private_key_password (const GByteArray *blob, + const char *path, + const char *password) +{ + /* Private key password is only un-needed if the private key scheme is BLOB, + * because BLOB keys are decrypted by the settings service. A private key + * password is required if the private key is PKCS#12 format, or if the + * private key scheme is PATH. + */ + if (path) { + GByteArray *tmp; + NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN; + NMCryptoFileFormat key_format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + + /* check the password */ + tmp = crypto_get_private_key (path, password, &key_type, &key_format, NULL); + if (tmp) { + /* Decrypt/verify successful; password must be OK */ + g_byte_array_free (tmp, TRUE); + return FALSE; + } + } else if (blob) { + /* Non-PKCS#12 blob-scheme keys are already decrypted by their settings + * service, thus if the private key is not PKCS#12 format, a new password + * is not required. If the PKCS#12 key can be decrypted with the given + * password, then we don't need a new password either. + */ + if (!crypto_is_pkcs12_data (blob) || crypto_verify_pkcs12 (blob, password, NULL)) + return FALSE; + } else + g_warning ("%s: unknown private key password scheme", __func__); + + return TRUE; +} + +static void +need_secrets_tls (NMSetting8021x *self, + GPtrArray *secrets, + gboolean phase2) +{ + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + NMSetting8021xCKScheme scheme; + const GByteArray *blob = NULL; + const char *path = NULL; + + if (phase2) { + if (!priv->phase2_private_key || !priv->phase2_private_key->len) { + g_ptr_array_add (secrets, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY); + return; + } + + scheme = nm_setting_802_1x_get_phase2_private_key_scheme (self); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + path = nm_setting_802_1x_get_phase2_private_key_path (self); + else if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + blob = nm_setting_802_1x_get_phase2_private_key_blob (self); + else { + g_warning ("%s: unknown phase2 private key scheme %d", __func__, scheme); + g_ptr_array_add (secrets, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY); + return; + } + + if (need_private_key_password (blob, path, priv->phase2_private_key_password)) + g_ptr_array_add (secrets, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD); + } else { + if (!priv->private_key || !priv->private_key->len) { + g_ptr_array_add (secrets, NM_SETTING_802_1X_PRIVATE_KEY); + return; + } + + scheme = nm_setting_802_1x_get_private_key_scheme (self); + if (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH) + path = nm_setting_802_1x_get_private_key_path (self); + else if (scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB) + blob = nm_setting_802_1x_get_private_key_blob (self); + else { + g_warning ("%s: unknown private key scheme %d", __func__, scheme); + g_ptr_array_add (secrets, NM_SETTING_802_1X_PRIVATE_KEY); + return; + } + + if (need_private_key_password (blob, path, priv->private_key_password)) + g_ptr_array_add (secrets, NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD); + } +} + +static gboolean +verify_tls (NMSetting8021x *self, gboolean phase2, GError **error) +{ + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + if (phase2) { + if (!priv->phase2_client_cert) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, + NM_SETTING_802_1X_PHASE2_CLIENT_CERT); + return FALSE; + } else if (!priv->phase2_client_cert->len) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_CLIENT_CERT); + return FALSE; + } + + /* If the private key is PKCS#12, check that it matches the client cert */ + if (priv->phase2_private_key && crypto_is_pkcs12_data (priv->phase2_private_key)) { + if (priv->phase2_private_key->len != priv->phase2_client_cert->len) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_CLIENT_CERT); + return FALSE; + } + + if (memcmp (priv->phase2_private_key->data, + priv->phase2_client_cert->data, + priv->phase2_private_key->len)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_CLIENT_CERT); + return FALSE; + } + } + } else { + if (!priv->client_cert) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, + NM_SETTING_802_1X_CLIENT_CERT); + return FALSE; + } else if (!priv->client_cert->len) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_CLIENT_CERT); + return FALSE; + } + + /* If the private key is PKCS#12, check that it matches the client cert */ + if (priv->private_key && crypto_is_pkcs12_data (priv->private_key)) { + if (priv->private_key->len != priv->client_cert->len) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_CLIENT_CERT); + return FALSE; + } + + if (memcmp (priv->private_key->data, + priv->client_cert->data, + priv->private_key->len)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_CLIENT_CERT); + return FALSE; + } + } + } + + return TRUE; +} + +static gboolean +verify_ttls (NMSetting8021x *self, gboolean phase2, GError **error) +{ + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + if ( (!priv->identity || !strlen (priv->identity)) + && (!priv->anonymous_identity || !strlen (priv->anonymous_identity))) { + if (!priv->identity) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, + NM_SETTING_802_1X_IDENTITY); + } else if (!strlen (priv->identity)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_IDENTITY); + } else if (!priv->anonymous_identity) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, + NM_SETTING_802_1X_ANONYMOUS_IDENTITY); + } else { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_ANONYMOUS_IDENTITY); + } + return FALSE; + } + + if ( (!priv->phase2_auth || !strlen (priv->phase2_auth)) + && (!priv->phase2_autheap || !strlen (priv->phase2_autheap))) { + if (!priv->phase2_auth) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, + NM_SETTING_802_1X_PHASE2_AUTH); + } else if (!strlen (priv->phase2_auth)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_AUTH); + } else if (!priv->phase2_autheap) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, + NM_SETTING_802_1X_PHASE2_AUTHEAP); + } else { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_AUTHEAP); + } + return FALSE; + } + + return TRUE; +} + +static gboolean +verify_identity (NMSetting8021x *self, gboolean phase2, GError **error) +{ + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + if (!priv->identity) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, + NM_SETTING_802_1X_IDENTITY); + } else if (!strlen (priv->identity)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_IDENTITY); + } + + return TRUE; +} + +/* Implemented below... */ +static void need_secrets_phase2 (NMSetting8021x *self, + GPtrArray *secrets, + gboolean phase2); + + +typedef void (*EAPMethodNeedSecretsFunc) (NMSetting8021x *self, + GPtrArray *secrets, + gboolean phase2); + +typedef gboolean (*EAPMethodValidateFunc)(NMSetting8021x *self, + gboolean phase2, + GError **error); + +typedef struct { + const char *method; + EAPMethodNeedSecretsFunc ns_func; + EAPMethodValidateFunc v_func; +} EAPMethodsTable; + +static EAPMethodsTable eap_methods_table[] = { + { "leap", need_secrets_password, verify_identity }, + { "md5", need_secrets_password, verify_identity }, + { "pap", need_secrets_password, verify_identity }, + { "chap", need_secrets_password, verify_identity }, + { "mschap", need_secrets_password, verify_identity }, + { "mschapv2", need_secrets_password, verify_identity }, + { "fast", need_secrets_password, verify_identity }, + { "tls", need_secrets_tls, verify_tls }, + { "peap", need_secrets_phase2, verify_ttls }, + { "ttls", need_secrets_phase2, verify_ttls }, + { "sim", need_secrets_sim, NULL }, + { "gtc", need_secrets_password, verify_identity }, + { "otp", NULL, NULL }, // FIXME: implement + { NULL, NULL, NULL } +}; + +static void +need_secrets_phase2 (NMSetting8021x *self, + GPtrArray *secrets, + gboolean phase2) +{ + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + char *method = NULL; + int i; + + g_return_if_fail (phase2 == FALSE); + + /* Check phase2_auth and phase2_autheap */ + method = priv->phase2_auth; + if (!method && priv->phase2_autheap) + method = priv->phase2_autheap; + + if (!method) { + g_warning ("Couldn't find EAP method."); + g_assert_not_reached(); + return; + } + + /* Ask the configured phase2 method if it needs secrets */ + for (i = 0; eap_methods_table[i].method; i++) { + if (eap_methods_table[i].ns_func == NULL) + continue; + if (!strcmp (eap_methods_table[i].method, method)) { + (*eap_methods_table[i].ns_func) (self, secrets, TRUE); + break; + } + } +} + + +static GPtrArray * +need_secrets (NMSetting *setting) +{ + NMSetting8021x *self = NM_SETTING_802_1X (setting); + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + GSList *iter; + GPtrArray *secrets; + gboolean eap_method_found = FALSE; + + secrets = g_ptr_array_sized_new (4); + + /* Ask each configured EAP method if it needs secrets */ + for (iter = priv->eap; iter && !eap_method_found; iter = g_slist_next (iter)) { + const char *method = (const char *) iter->data; + int i; + + for (i = 0; eap_methods_table[i].method; i++) { + if (eap_methods_table[i].ns_func == NULL) + continue; + if (!strcmp (eap_methods_table[i].method, method)) { + (*eap_methods_table[i].ns_func) (self, secrets, FALSE); + + /* Only break out of the outer loop if this EAP method + * needed secrets. + */ + if (secrets->len > 0) + eap_method_found = TRUE; + break; + } + } + } + + if (secrets->len == 0) { + g_ptr_array_free (secrets, TRUE); + secrets = NULL; + } + + return secrets; +} + +static gboolean +verify_cert (GByteArray *array, const char *prop_name, GError **error) +{ + if (!array) + 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 (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + "%s", prop_name); + return FALSE; +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSetting8021x *self = NM_SETTING_802_1X (setting); + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + const char *valid_eap[] = { "leap", "md5", "tls", "peap", "ttls", "sim", "fast", NULL }; + const char *valid_phase1_peapver[] = { "0", "1", NULL }; + const char *valid_phase1_peaplabel[] = { "0", "1", NULL }; + const char *valid_phase1_fast_pac[] = { "0", "1", "2", "3", NULL }; + const char *valid_phase2_auth[] = { "pap", "chap", "mschap", "mschapv2", "gtc", "otp", "md5", "tls", NULL }; + const char *valid_phase2_autheap[] = { "md5", "mschapv2", "otp", "gtc", "tls", NULL }; + GSList *iter; + + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + if (!priv->eap) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY, + NM_SETTING_802_1X_EAP); + return FALSE; + } + + if (!_nm_utils_string_slist_validate (priv->eap, valid_eap)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_EAP); + return FALSE; + } + + /* Ask each configured EAP method if its valid */ + for (iter = priv->eap; iter; iter = g_slist_next (iter)) { + const char *method = (const char *) iter->data; + int i; + + for (i = 0; eap_methods_table[i].method; i++) { + if (eap_methods_table[i].v_func == NULL) + continue; + if (!strcmp (eap_methods_table[i].method, method)) { + if (!(*eap_methods_table[i].v_func) (self, FALSE, error)) + return FALSE; + break; + } + } + } + + if (priv->phase1_peapver && !_nm_utils_string_in_list (priv->phase1_peapver, valid_phase1_peapver)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE1_PEAPVER); + return FALSE; + } + + if (priv->phase1_peaplabel && !_nm_utils_string_in_list (priv->phase1_peaplabel, valid_phase1_peaplabel)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE1_PEAPLABEL); + return FALSE; + } + + if (priv->phase1_fast_provisioning && !_nm_utils_string_in_list (priv->phase1_fast_provisioning, valid_phase1_fast_pac)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING); + return FALSE; + } + + if (priv->phase2_auth && !_nm_utils_string_in_list (priv->phase2_auth, valid_phase2_auth)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_AUTH); + return FALSE; + } + + if (priv->phase2_autheap && !_nm_utils_string_in_list (priv->phase2_autheap, valid_phase2_autheap)) { + g_set_error (error, + NM_SETTING_802_1X_ERROR, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_PHASE2_AUTHEAP); + return FALSE; + } + + if (!verify_cert (priv->ca_cert, NM_SETTING_802_1X_CA_CERT, error)) + return FALSE; + if (!verify_cert (priv->phase2_ca_cert, NM_SETTING_802_1X_PHASE2_CA_CERT, error)) + return FALSE; + + if (!verify_cert (priv->client_cert, NM_SETTING_802_1X_CLIENT_CERT, error)) + return FALSE; + if (!verify_cert (priv->phase2_client_cert, NM_SETTING_802_1X_PHASE2_CLIENT_CERT, error)) + return FALSE; + + if (!verify_cert (priv->private_key, NM_SETTING_802_1X_PRIVATE_KEY, error)) + return FALSE; + if (!verify_cert (priv->phase2_private_key, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, error)) + return FALSE; + + /* FIXME: finish */ + + return TRUE; +} + +static void +nm_setting_802_1x_init (NMSetting8021x *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_802_1X_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSetting8021x *self = NM_SETTING_802_1X (object); + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self); + + /* Strings first. g_free() already checks for NULLs so we don't have to */ + + g_free (priv->identity); + g_free (priv->anonymous_identity); + g_free (priv->ca_path); + g_free (priv->phase1_peapver); + g_free (priv->phase1_peaplabel); + g_free (priv->phase1_fast_provisioning); + g_free (priv->phase2_auth); + g_free (priv->phase2_autheap); + g_free (priv->phase2_ca_path); + g_free (priv->password); + + nm_utils_slist_free (priv->eap, g_free); + + if (priv->ca_cert) + g_byte_array_free (priv->ca_cert, TRUE); + if (priv->client_cert) + g_byte_array_free (priv->client_cert, TRUE); + if (priv->private_key) + g_byte_array_free (priv->private_key, TRUE); + g_free (priv->private_key_password); + if (priv->phase2_ca_cert) + g_byte_array_free (priv->phase2_ca_cert, TRUE); + if (priv->phase2_client_cert) + g_byte_array_free (priv->phase2_client_cert, TRUE); + if (priv->phase2_private_key) + g_byte_array_free (priv->phase2_private_key, TRUE); + g_free (priv->phase2_private_key_password); + + G_OBJECT_CLASS (nm_setting_802_1x_parent_class)->finalize (object); +} + +static GByteArray * +set_cert_prop_helper (const GValue *value, const char *prop_name, GError **error) +{ + gboolean valid; + GByteArray *data = NULL; + + data = g_value_dup_boxed (value); + /* Verify the new data */ + if (data) { + valid = verify_cert (data, prop_name, error); + if (!valid) { + g_byte_array_free (data, TRUE); + data = NULL; + } + } + return data; +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSetting8021x *setting = NM_SETTING_802_1X (object); + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (setting); + GError *error = NULL; + + switch (prop_id) { + case PROP_EAP: + nm_utils_slist_free (priv->eap, g_free); + priv->eap = g_value_dup_boxed (value); + break; + case PROP_IDENTITY: + g_free (priv->identity); + priv->identity = g_value_dup_string (value); + break; + case PROP_ANONYMOUS_IDENTITY: + g_free (priv->anonymous_identity); + priv->anonymous_identity = g_value_dup_string (value); + break; + case PROP_CA_CERT: + if (priv->ca_cert) { + g_byte_array_free (priv->ca_cert, TRUE); + priv->ca_cert = NULL; + } + priv->ca_cert = set_cert_prop_helper (value, NM_SETTING_802_1X_CA_CERT, &error); + if (error) { + g_warning ("Error setting certificate (invalid data): (%d) %s", + error->code, error->message); + g_error_free (error); + } + break; + case PROP_CA_PATH: + g_free (priv->ca_path); + priv->ca_path = g_value_dup_string (value); + break; + case PROP_CLIENT_CERT: + if (priv->client_cert) { + g_byte_array_free (priv->client_cert, TRUE); + priv->client_cert = NULL; + } + priv->client_cert = set_cert_prop_helper (value, NM_SETTING_802_1X_CLIENT_CERT, &error); + if (error) { + g_warning ("Error setting certificate (invalid data): (%d) %s", + error->code, error->message); + g_error_free (error); + } + break; + case PROP_PHASE1_PEAPVER: + g_free (priv->phase1_peapver); + priv->phase1_peapver = g_value_dup_string (value); + break; + case PROP_PHASE1_PEAPLABEL: + g_free (priv->phase1_peaplabel); + priv->phase1_peaplabel = g_value_dup_string (value); + break; + case PROP_PHASE1_FAST_PROVISIONING: + g_free (priv->phase1_fast_provisioning); + priv->phase1_fast_provisioning = g_value_dup_string (value); + break; + case PROP_PHASE2_AUTH: + g_free (priv->phase2_auth); + priv->phase2_auth = g_value_dup_string (value); + break; + case PROP_PHASE2_AUTHEAP: + g_free (priv->phase2_autheap); + priv->phase2_autheap = g_value_dup_string (value); + break; + case PROP_PHASE2_CA_CERT: + if (priv->phase2_ca_cert) { + g_byte_array_free (priv->phase2_ca_cert, TRUE); + priv->phase2_ca_cert = NULL; + } + priv->phase2_ca_cert = set_cert_prop_helper (value, NM_SETTING_802_1X_PHASE2_CA_CERT, &error); + if (error) { + g_warning ("Error setting certificate (invalid data): (%d) %s", + error->code, error->message); + g_error_free (error); + } + break; + case PROP_PHASE2_CA_PATH: + g_free (priv->phase2_ca_path); + priv->phase2_ca_path = g_value_dup_string (value); + break; + case PROP_PHASE2_CLIENT_CERT: + if (priv->phase2_client_cert) { + g_byte_array_free (priv->phase2_client_cert, TRUE); + priv->phase2_client_cert = NULL; + } + priv->phase2_client_cert = set_cert_prop_helper (value, NM_SETTING_802_1X_PHASE2_CLIENT_CERT, &error); + if (error) { + g_warning ("Error setting certificate (invalid data): (%d) %s", + error->code, error->message); + g_error_free (error); + } + break; + case PROP_PASSWORD: + g_free (priv->password); + priv->password = g_value_dup_string (value); + break; + case PROP_PRIVATE_KEY: + if (priv->private_key) { + g_byte_array_free (priv->private_key, TRUE); + priv->private_key = NULL; + } + priv->private_key = set_cert_prop_helper (value, NM_SETTING_802_1X_PRIVATE_KEY, &error); + if (error) { + g_warning ("Error setting private key (invalid data): (%d) %s", + error->code, error->message); + g_error_free (error); + } + break; + case PROP_PRIVATE_KEY_PASSWORD: + g_free (priv->private_key_password); + priv->private_key_password = g_value_dup_string (value); + break; + case PROP_PHASE2_PRIVATE_KEY: + if (priv->phase2_private_key) { + g_byte_array_free (priv->phase2_private_key, TRUE); + priv->phase2_private_key = NULL; + } + priv->phase2_private_key = set_cert_prop_helper (value, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, &error); + if (error) { + g_warning ("Error setting private key (invalid data): (%d) %s", + error->code, error->message); + g_error_free (error); + } + break; + case PROP_PHASE2_PRIVATE_KEY_PASSWORD: + g_free (priv->phase2_private_key_password); + priv->phase2_private_key_password = g_value_dup_string (value); + break; + case PROP_SYSTEM_CA_CERTS: + priv->system_ca_certs = 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) +{ + NMSetting8021x *setting = NM_SETTING_802_1X (object); + NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_EAP: + g_value_set_boxed (value, priv->eap); + break; + case PROP_IDENTITY: + g_value_set_string (value, priv->identity); + break; + case PROP_ANONYMOUS_IDENTITY: + g_value_set_string (value, priv->anonymous_identity); + break; + case PROP_CA_CERT: + g_value_set_boxed (value, priv->ca_cert); + break; + case PROP_CA_PATH: + g_value_set_string (value, priv->ca_path); + break; + case PROP_CLIENT_CERT: + g_value_set_boxed (value, priv->client_cert); + break; + case PROP_PHASE1_PEAPVER: + g_value_set_string (value, priv->phase1_peapver); + break; + case PROP_PHASE1_PEAPLABEL: + g_value_set_string (value, priv->phase1_peaplabel); + break; + case PROP_PHASE1_FAST_PROVISIONING: + g_value_set_string (value, priv->phase1_fast_provisioning); + break; + case PROP_PHASE2_AUTH: + g_value_set_string (value, priv->phase2_auth); + break; + case PROP_PHASE2_AUTHEAP: + g_value_set_string (value, priv->phase2_autheap); + break; + case PROP_PHASE2_CA_CERT: + g_value_set_boxed (value, priv->phase2_ca_cert); + break; + case PROP_PHASE2_CA_PATH: + g_value_set_string (value, priv->phase2_ca_path); + break; + case PROP_PHASE2_CLIENT_CERT: + g_value_set_boxed (value, priv->phase2_client_cert); + break; + case PROP_PASSWORD: + g_value_set_string (value, priv->password); + break; + case PROP_PRIVATE_KEY: + g_value_set_boxed (value, priv->private_key); + break; + case PROP_PRIVATE_KEY_PASSWORD: + g_value_set_string (value, priv->private_key_password); + break; + case PROP_PHASE2_PRIVATE_KEY: + g_value_set_boxed (value, priv->phase2_private_key); + break; + case PROP_PHASE2_PRIVATE_KEY_PASSWORD: + g_value_set_string (value, priv->phase2_private_key_password); + break; + case PROP_SYSTEM_CA_CERTS: + g_value_set_boolean (value, priv->system_ca_certs); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +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)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + parent_class->verify = verify; + parent_class->need_secrets = need_secrets; + + /* Properties */ + + /** + * NMSetting8021x:eap: + * + * The allowed EAP method to be used when authenticating to the network with + * 802.1x. Valid methods are: "leap", "md5", "tls", "peap", "ttls", and + * "fast". Each method requires different configuration using the + * properties of this object; refer to wpa_supplicant documentation for the + * allowed combinations. + **/ + g_object_class_install_property + (object_class, PROP_EAP, + _nm_param_spec_specialized (NM_SETTING_802_1X_EAP, + "EAP", + "The allowed EAP method to be used when " + "authenticating to the network with 802.1x. " + "Valid methods are: 'leap', 'md5', 'tls', 'peap', " + "'ttls', and 'fast'. Each method requires " + "different configuration using the properties of " + "this setting; refer to wpa_supplicant " + "documentation for the allowed combinations.", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:identity: + * + * Identity string for EAP authentication methods. Often the user's + * user or login name. + **/ + g_object_class_install_property + (object_class, PROP_IDENTITY, + g_param_spec_string (NM_SETTING_802_1X_IDENTITY, + "Identity", + "Identity string for EAP authentication methods. " + "Often the user's user or login name.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:anonymous-identity: + * + * Anonymous identity string for EAP authentication methods. Used as the + * unencrypted identity with EAP types that support different tunneled + * identity like EAP-TTLS. + **/ + g_object_class_install_property + (object_class, PROP_ANONYMOUS_IDENTITY, + g_param_spec_string (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, + "Anonymous identity", + "Anonymous identity string for EAP authentication " + "methods. Used as the unencrypted identity with EAP " + "types that support different tunneled identity like " + "EAP-TTLS.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:ca-cert: + * + * Contains the CA certificate if used by the EAP method specified in the + * #NMSetting8021x:eap property. Setting this property directly is + * discouraged; use the nm_setting_802_1x_set_ca_cert() function instead. + **/ + g_object_class_install_property + (object_class, PROP_CA_CERT, + _nm_param_spec_specialized (NM_SETTING_802_1X_CA_CERT, + "CA certificate", + "Contains the CA certificate if used by the EAP " + "method specified in the 'eap' property. " + "Certificate data is specified using a 'scheme'; " + "two are currently supported: blob and path. " + "When using the blob scheme (which is backwards " + "compatible with NM 0.7.x) this property should " + "be set to the certificate's DER encoded data. " + "When using the path scheme, this property should " + "be set to the full UTF-8 encoded path of the " + "certificate, prefixed with the string 'file://' " + "and ending with a terminating NULL byte. This " + "property can be unset even if the EAP method " + "supports CA certificates, but this allows " + "man-in-the-middle attacks and is NOT recommended.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:ca-path: + * + * UTF-8 encoded path to a directory containing PEM or DER formatted + * certificates to be added to the verification chain in addition to the + * certificate specified in the #NMSetting8021x:ca-cert property. + **/ + g_object_class_install_property + (object_class, PROP_CA_PATH, + g_param_spec_string (NM_SETTING_802_1X_CA_PATH, + "CA path", + "UTF-8 encoded path to a directory containing PEM or " + "DER formatted certificates to be added to the " + "verification chain in addition to the certificate " + "specified in the 'ca-cert' property.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:client-cert: + * + * Contains the client certificate if used by the EAP method specified in + * the #NMSetting8021x:eap property. Setting this property directly is + * discouraged; use the nm_setting_802_1x_set_client_cert() function instead. + **/ + g_object_class_install_property + (object_class, PROP_CLIENT_CERT, + _nm_param_spec_specialized (NM_SETTING_802_1X_CLIENT_CERT, + "Client certificate", + "Contains the client certificate if used by the " + "EAP method specified in the 'eap' property. " + "Certificate data is specified using a 'scheme'; " + "two are currently supported: blob and path. " + "When using the blob scheme (which is backwards " + "compatible with NM 0.7.x) this property should " + "be set to the certificate's DER encoded data. " + "When using the path scheme, this property should " + "be set to the full UTF-8 encoded path of the " + "certificate, prefixed with the string 'file://' " + "and ending with a terminating NULL byte.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:phase1-peapver: + * + * Forces which PEAP version is used when PEAP is set as the EAP method in + * the #NMSetting8021x:eap property. When unset, the version reported by + * the server will be used. Sometimes when using older RADIUS servers, it + * is necessary to force the client to use a particular PEAP version. To do + * so, this property may be set to "0" or "1" to force that specific PEAP + * version. + **/ + g_object_class_install_property + (object_class, PROP_PHASE1_PEAPVER, + g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPVER, + "Phase1 PEAPVER", + "Forces which PEAP version is used when PEAP is set " + "as the EAP method in 'eap' property. When unset, " + "the version reported by the server will be used. " + "Sometimes when using older RADIUS servers, it is " + "necessary to force the client to use a particular " + "PEAP version. To do so, this property may be set to " + "'0' or '1; to force that specific PEAP version.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:phase1-peaplabel: + * + * Forces use of the new PEAP label during key derivation. Some RADIUS + * servers may require forcing the new PEAP label to interoperate with + * PEAPv1. Set to "1" to force use of the new PEAP label. See the + * wpa_supplicant documentation for more details. + **/ + g_object_class_install_property + (object_class, PROP_PHASE1_PEAPLABEL, + g_param_spec_string (NM_SETTING_802_1X_PHASE1_PEAPLABEL, + "Phase1 PEAP label", + "Forces use of the new PEAP label during key " + "derivation. Some RADIUS servers may require forcing " + "the new PEAP label to interoperate with PEAPv1. " + "Set to '1' to force use of the new PEAP label. See " + "the wpa_supplicant documentation for more details.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:phase1-fast-provisioning: + * + * Enables or disables in-line provisioning of EAP-FAST credentials when + * FAST is specified as the EAP method in the #NMSetting8021x:eap property. + * Recognized values are "0" (disabled), "1" (allow unauthenticated + * provisioning), "2" (allow authenticated provisioning), and "3" (allow + * both authenticated and unauthenticated provisioning). See the + * wpa_supplicant documentation for more details. + **/ + g_object_class_install_property + (object_class, PROP_PHASE1_FAST_PROVISIONING, + g_param_spec_string (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, + "Phase1 fast provisioning", + "Enables or disables in-line provisioning of EAP-FAST " + "credentials when FAST is specified as the EAP method " + "in the #NMSetting8021x:eap property. Allowed values " + "are '0' (disabled), '1' (allow unauthenticated " + "provisioning), '2' (allow authenticated provisioning), " + "and '3' (allow both authenticated and unauthenticated " + "provisioning). See the wpa_supplicant documentation " + "for more details.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:phase2-auth: + * + * Specifies the allowed "phase 2" inner non-EAP authentication methods when + * an EAP method that uses an inner TLS tunnel is specified in the + * #NMSetting8021x:eap property. Recognized non-EAP phase2 methods are + * "pap", "chap", "mschap", "mschapv2", "gtc", "otp", "md5", and "tls". + * Each 'phase 2' inner method requires specific parameters for successful + * authentication; see the wpa_supplicant documentation for more details. + **/ + g_object_class_install_property + (object_class, PROP_PHASE2_AUTH, + g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTH, + "Phase2 auth", + "Specifies the allowed 'phase 2' inner non-EAP " + "authentication methods when an EAP method that uses " + "an inner TLS tunnel is specified in the 'eap' " + "property. Recognized non-EAP phase2 methods are 'pap', " + "'chap', 'mschap', 'mschapv2', 'gtc', 'otp', 'md5', " + "and 'tls'. Each 'phase 2' inner method requires " + "specific parameters for successful authentication; " + "see the wpa_supplicant documentation for more details.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:phase2-autheap: + * + * Specifies the allowed "phase 2" inner EAP-based authentication methods + * when an EAP method that uses an inner TLS tunnel is specified in the + * #NMSetting8021x:eap property. Recognized EAP-based phase2 methods are + * "md5", "mschapv2", "otp", "gtc", and "tls". Each 'phase 2' inner method + * requires specific parameters for successful authentication; see the + * wpa_supplicant documentation for more details. + **/ + g_object_class_install_property + (object_class, PROP_PHASE2_AUTHEAP, + g_param_spec_string (NM_SETTING_802_1X_PHASE2_AUTHEAP, + "Phase2 autheap", + "Specifies the allowed 'phase 2' inner EAP-based " + "authentication methods when an EAP method that uses " + "an inner TLS tunnel is specified in the 'eap' " + "property. Recognized EAP-based 'phase 2' methods are " + "'md5', 'mschapv2', 'otp', 'gtc', and 'tls'. Each " + "'phase 2' inner method requires specific parameters " + "for successful authentication; see the wpa_supplicant " + "documentation for more details.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:phase2-ca-cert: + * + * Contains the CA certificate if used by the EAP method specified in the + * #NMSetting8021x:phase2-auth or #NMSetting8021x:phase2-autheap properties. + * Setting this property directly is discouraged; use the + * nm_setting_802_1x_set_phase2_ca_cert() function instead. + **/ + g_object_class_install_property + (object_class, PROP_PHASE2_CA_CERT, + _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_CA_CERT, + "Phase2 CA certificate", + "Contains the 'phase 2' CA certificate if used by " + "the EAP method specified in the 'phase2-auth' or " + "'phase2-autheap' properties. Certificate data " + "is specified using a 'scheme'; two are currently" + "supported: blob and path. When using the blob " + "scheme (which is backwards compatible with NM " + "0.7.x) this property should be set to the " + "certificate's DER encoded data. When using the " + "path scheme, this property should be set to the " + "full UTF-8 encoded path of the certificate, " + "prefixed with the string 'file://' and ending " + "with a terminating NULL byte. This property can " + "be unset even if the EAP method supports CA " + "certificates, but this allows man-in-the-middle " + "attacks and is NOT recommended.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:phase2-ca-path: + * + * UTF-8 encoded path to a directory containing PEM or DER formatted + * certificates to be added to the verification chain in addition to the + * certificate specified in the #NMSetting8021x:phase2-ca-cert property. + **/ + g_object_class_install_property + (object_class, PROP_PHASE2_CA_PATH, + g_param_spec_string (NM_SETTING_802_1X_PHASE2_CA_PATH, + "Phase2 auth CA path", + "UTF-8 encoded path to a directory containing PEM or " + "DER formatted certificates to be added to the " + "verification chain in addition to the certificate " + "specified in the 'phase2-ca-cert' property.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:phase2-client-cert: + * + * Contains the client certificate if used by the EAP method specified in + * the #NMSetting8021x:phase2-auth or #NMSetting8021x:phase2-autheap + * properties. Setting this property directly is discouraged; use the + * nm_setting_802_1x_set_phase2_client_cert() function instead. + **/ + g_object_class_install_property + (object_class, PROP_PHASE2_CLIENT_CERT, + _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, + "Phase2 client certificate", + "Contains the 'phase 2' client certificate if " + "used by the EAP method specified in the " + "'phase2-eap' or 'phase2-autheap' properties. " + "Certificate data is specified using a 'scheme'; " + "two are currently supported: blob and path. " + "When using the blob scheme (which is backwards " + "compatible with NM 0.7.x) this property should " + "be set to the certificate's DER encoded data. " + "When using the path scheme, this property should " + "be set to the full UTF-8 encoded path of the " + "certificate, prefixed with the string 'file://' " + "and ending with a terminating NULL byte.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSetting8021x:password: + * + * Password used for EAP authentication methods. + **/ + g_object_class_install_property + (object_class, PROP_PASSWORD, + g_param_spec_string (NM_SETTING_802_1X_PASSWORD, + "Password", + "Password used for EAP authentication methods.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSetting8021x:private-key: + * + * Contains the private key if the #NMSetting8021x:eap property is set to + * 'tls'. Setting this property directly is discouraged; use the + * nm_setting_802_1x_set_private_key() function instead. + **/ + g_object_class_install_property + (object_class, PROP_PRIVATE_KEY, + _nm_param_spec_specialized (NM_SETTING_802_1X_PRIVATE_KEY, + "Private key", + "Contains the private key when the 'eap' property " + "is set to 'tls'. Key data is specified using a " + "'scheme'; two are currently supported: blob and " + "path. When using the blob scheme and X.509 private " + "keys, this property should be set to the keys's " + "decrypted DER encoded data. When using X.509 " + "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 " + "and ending with a terminating NULL byte. When " + "using PKCS#12 format private keys and the blob " + "scheme, this property should be set to the " + "PKCS#12 data (which is encrypted) and the " + "'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 NULL 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.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSetting8021x:private-key-password: + * + * The password used to decrypt the private key specified in + * #NMSetting8021x:private-key when the private key either uses the 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. + **/ + g_object_class_install_property + (object_class, PROP_PRIVATE_KEY_PASSWORD, + g_param_spec_string (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, + "Private key password", + "The password used to decrypt the private key " + "specified in the 'private-key' property when the " + "private key either uses the path scheme, or if the " + "private key is a PKCS#12 format key.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSetting8021x:phase2-private-key: + * + * Private key data used by "phase 2" inner authentication methods. + * + * Contains the "phase 2" inner private key if the #NMSetting8021x:auth or + * #NMSetting8021x:phase2-autheap property is set to 'tls'. Setting this + * property directly is discouraged; use the + * nm_setting_802_1x_set_phase2_private_key() function instead. + **/ + g_object_class_install_property + (object_class, PROP_PHASE2_PRIVATE_KEY, + _nm_param_spec_specialized (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, + "Phase2 private key", + "Contains the 'phase 2' inner private key when " + "the 'phase2-eap' or 'phase2-autheap' property " + "is set to 'tls'. Key data is specified using a " + "'scheme'; two are currently supported: blob and " + "path. When using the blob scheme and X.509 private " + "keys, this property should be set to the keys's " + "decrypted DER encoded data. When using X.509 " + "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 " + "and ending with a terminating NULL byte. When " + "using PKCS#12 format private keys and the blob " + "scheme, this property should be set to the " + "PKCS#12 data (which is encrypted) and the " + "'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 NULL 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.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSetting8021x:phase2-private-key-password: + * + * The password used to decrypt the private key specified in + * #NMSetting8021x:phase2-private-key when the private key either uses the + * 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_phase2_private_key() function. + **/ + g_object_class_install_property + (object_class, PROP_PHASE2_PRIVATE_KEY_PASSWORD, + g_param_spec_string (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, + "Phase2 private key password", + "The password used to decrypt the 'phase 2' private " + "key specified in the 'private-key' property when the " + "phase2 private key either uses the path scheme, or " + "if the phase2 private key is a PKCS#12 format key.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSetting8021x:system-ca-certs: + * + * When TRUE, overrides #NMSetting8021x:ca-path and + * #NMSetting8021x:phase2-ca-path properties using the system CA directory + * specified at configure time with the --system-ca-path switch. The + * certificates in this directory are added to the verification chain in + * addition to any certificates specified by the #NMSetting8021x:ca-cert, + * #NMSetting8021x:ca-cert-path, #NMSetting8021x:phase2-ca-cert and + * #NMSetting8021x:phase2-ca-cert-path properties. + **/ + g_object_class_install_property + (object_class, PROP_SYSTEM_CA_CERTS, + g_param_spec_boolean (NM_SETTING_802_1X_SYSTEM_CA_CERTS, + "Use system CA certificates", + "When TRUE, overrides 'ca-path' and 'phase2-ca-path' " + "properties using the system CA directory " + "specified at configure time with the " + "--system-ca-path switch. The certificates in " + "this directory are added to the verification " + "chain in addition to any certificates specified " + "by the 'ca-cert' and 'phase2-ca-cert' properties.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /* 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-util/nm-setting-8021x.h b/libnm-util/nm-setting-8021x.h new file mode 100644 index 00000000..7ee868a0 --- /dev/null +++ b/libnm-util/nm-setting-8021x.h @@ -0,0 +1,280 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2009 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_8021X_H +#define NM_SETTING_8021X_H + +#include + +G_BEGIN_DECLS + +typedef enum { + NM_SETTING_802_1X_CK_FORMAT_UNKNOWN = 0, + NM_SETTING_802_1X_CK_FORMAT_X509, + NM_SETTING_802_1X_CK_FORMAT_RAW_KEY, + NM_SETTING_802_1X_CK_FORMAT_PKCS12 +} NMSetting8021xCKFormat; + +typedef enum { + NM_SETTING_802_1X_CK_SCHEME_UNKNOWN = 0, + NM_SETTING_802_1X_CK_SCHEME_BLOB, + NM_SETTING_802_1X_CK_SCHEME_PATH +} NMSetting8021xCKScheme; + +#define NM_TYPE_SETTING_802_1X (nm_setting_802_1x_get_type ()) +#define NM_SETTING_802_1X(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_802_1X, NMSetting8021x)) +#define NM_SETTING_802_1X_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_802_1X, NMSetting8021xClass)) +#define NM_IS_SETTING_802_1X(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_802_1X)) +#define NM_IS_SETTING_802_1X_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_802_1X)) +#define NM_SETTING_802_1X_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_802_1X, NMSetting8021xClass)) + +#define NM_SETTING_802_1X_SETTING_NAME "802-1x" + +typedef enum +{ + NM_SETTING_802_1X_ERROR_UNKNOWN = 0, + NM_SETTING_802_1X_ERROR_INVALID_PROPERTY, + NM_SETTING_802_1X_ERROR_MISSING_PROPERTY +} NMSetting8021xError; + +#define NM_TYPE_SETTING_802_1X_ERROR (nm_setting_802_1x_error_get_type ()) +GType nm_setting_802_1x_error_get_type (void); + +#define NM_SETTING_802_1X_ERROR nm_setting_802_1x_error_quark () +GQuark nm_setting_802_1x_error_quark (void); + + +#define NM_SETTING_802_1X_EAP "eap" +#define NM_SETTING_802_1X_IDENTITY "identity" +#define NM_SETTING_802_1X_ANONYMOUS_IDENTITY "anonymous-identity" +#define NM_SETTING_802_1X_CA_CERT "ca-cert" +#define NM_SETTING_802_1X_CA_PATH "ca-path" +#define NM_SETTING_802_1X_CLIENT_CERT "client-cert" +#define NM_SETTING_802_1X_PHASE1_PEAPVER "phase1-peapver" +#define NM_SETTING_802_1X_PHASE1_PEAPLABEL "phase1-peaplabel" +#define NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING "phase1-fast-provisioning" +#define NM_SETTING_802_1X_PHASE2_AUTH "phase2-auth" +#define NM_SETTING_802_1X_PHASE2_AUTHEAP "phase2-autheap" +#define NM_SETTING_802_1X_PHASE2_CA_CERT "phase2-ca-cert" +#define NM_SETTING_802_1X_PHASE2_CA_PATH "phase2-ca-path" +#define NM_SETTING_802_1X_PHASE2_CLIENT_CERT "phase2-client-cert" +#define NM_SETTING_802_1X_PASSWORD "password" +#define NM_SETTING_802_1X_PRIVATE_KEY "private-key" +#define NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD "private-key-password" +#define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY "phase2-private-key" +#define NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD "phase2-private-key-password" +#define NM_SETTING_802_1X_PIN "pin" +#define NM_SETTING_802_1X_PSK "psk" +#define NM_SETTING_802_1X_SYSTEM_CA_CERTS "system-ca-certs" + +/* PRIVATE KEY NOTE: when setting PKCS#12 private keys directly via properties + * using the "blob" scheme, the data must be passed in PKCS#12 format. In this + * case, the private key password must also be passed to NetworkManager, and the + * appropriate "client-cert" (or "phase2-client-cert") property of the + * NMSetting8021x object must also contain the exact same PKCS#12 data that the + * private key will when NetworkManager requests secrets. This is because the + * PKCS#12 file contains both the private key and client certificate, so both + * properties need to be set to the same thing. When using the "path" scheme, + * just set both the private-key and client-cert properties to the same path, + * and set the private-key password correctly. + * + * When setting OpenSSL-derived "traditional" format (ie S/MIME style, not + * PKCS#8) RSA and DSA keys directly via properties with the "blob" scheme, they + * must passed to NetworkManager completely decrypted because the OpenSSL + * "traditional" format is non-standard and is not complete enough for all + * crypto libraries to use. Thus, for OpenSSL "traditional" format keys, the + * private key password is not passed to NetworkManager (because the data is + * already decrypted by the client), and the appropriate "client-cert" (or + * "phase2-client-cert") property of the NMSetting8021x object must be a valid + * client certificate. When using the "path" scheme, just set the private-key + * and client-cert properties to the paths to their respective objects, and + * set the private-key password correctly. + */ + +typedef struct { + NMSetting parent; +} NMSetting8021x; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSetting8021xClass; + +GType nm_setting_802_1x_get_type (void); + +NMSetting *nm_setting_802_1x_new (void); + +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); +void nm_setting_802_1x_remove_eap_method (NMSetting8021x *setting, guint32 i); +void nm_setting_802_1x_clear_eap_methods (NMSetting8021x *setting); + +const char * nm_setting_802_1x_get_identity (NMSetting8021x *setting); + +const char * nm_setting_802_1x_get_anonymous_identity (NMSetting8021x *setting); + +gboolean nm_setting_802_1x_get_system_ca_certs (NMSetting8021x *setting); +const char * nm_setting_802_1x_get_ca_path (NMSetting8021x *setting); +const char * nm_setting_802_1x_get_phase2_ca_path (NMSetting8021x *setting); + +NMSetting8021xCKScheme nm_setting_802_1x_get_ca_cert_scheme (NMSetting8021x *setting); +const GByteArray * nm_setting_802_1x_get_ca_cert_blob (NMSetting8021x *setting); +const char * nm_setting_802_1x_get_ca_cert_path (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_ca_cert (NMSetting8021x *setting, + const char *value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error); + +NMSetting8021xCKScheme nm_setting_802_1x_get_client_cert_scheme (NMSetting8021x *setting); +const GByteArray * nm_setting_802_1x_get_client_cert_blob (NMSetting8021x *setting); +const char * nm_setting_802_1x_get_client_cert_path (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_client_cert (NMSetting8021x *setting, + const char *value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error); + +const char * nm_setting_802_1x_get_phase1_peapver (NMSetting8021x *setting); + +const char * nm_setting_802_1x_get_phase1_peaplabel (NMSetting8021x *setting); + +const char * nm_setting_802_1x_get_phase1_fast_provisioning (NMSetting8021x *setting); + +const char * nm_setting_802_1x_get_phase2_auth (NMSetting8021x *setting); + +const char * nm_setting_802_1x_get_phase2_autheap (NMSetting8021x *setting); + +NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_ca_cert_scheme (NMSetting8021x *setting); +const GByteArray * nm_setting_802_1x_get_phase2_ca_cert_blob (NMSetting8021x *setting); +const char * nm_setting_802_1x_get_phase2_ca_cert_path (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_phase2_ca_cert (NMSetting8021x *setting, + const char *value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error); + +NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_client_cert_scheme (NMSetting8021x *setting); +const GByteArray * nm_setting_802_1x_get_phase2_client_cert_blob (NMSetting8021x *setting); +const char * nm_setting_802_1x_get_phase2_client_cert_path (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_phase2_client_cert (NMSetting8021x *setting, + const char *value, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error); + +const char * nm_setting_802_1x_get_password (NMSetting8021x *setting); + +const char * nm_setting_802_1x_get_pin (NMSetting8021x *setting); + +const char * nm_setting_802_1x_get_psk (NMSetting8021x *setting); + +NMSetting8021xCKScheme nm_setting_802_1x_get_private_key_scheme (NMSetting8021x *setting); +const GByteArray * nm_setting_802_1x_get_private_key_blob (NMSetting8021x *setting); +const char * nm_setting_802_1x_get_private_key_path (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_private_key (NMSetting8021x *setting, + const char *value, + const char *password, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error); +const char * nm_setting_802_1x_get_private_key_password (NMSetting8021x *setting); + +NMSetting8021xCKFormat nm_setting_802_1x_get_private_key_format (NMSetting8021x *setting); + +NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_private_key_scheme (NMSetting8021x *setting); +const GByteArray * nm_setting_802_1x_get_phase2_private_key_blob (NMSetting8021x *setting); +const char * nm_setting_802_1x_get_phase2_private_key_path (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_phase2_private_key (NMSetting8021x *setting, + const char *value, + const char *password, + NMSetting8021xCKScheme scheme, + NMSetting8021xCKFormat *out_format, + GError **error); +const char * nm_setting_802_1x_get_phase2_private_key_password (NMSetting8021x *setting); + +NMSetting8021xCKFormat nm_setting_802_1x_get_phase2_private_key_format (NMSetting8021x *setting); + + +/***** DEPRECATED; anything below will be removed in version 0.9 *****/ + +typedef enum { + NM_SETTING_802_1X_CK_TYPE_UNKNOWN = 0, + NM_SETTING_802_1X_CK_TYPE_X509, + NM_SETTING_802_1X_CK_TYPE_RAW_KEY, + NM_SETTING_802_1X_CK_TYPE_PKCS12 +} NMSetting8021xCKType; + +const GByteArray *nm_setting_802_1x_get_ca_cert (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_ca_cert_from_file (NMSetting8021x *setting, + const char *filename, + NMSetting8021xCKType *out_ck_type, + GError **error); + +const GByteArray *nm_setting_802_1x_get_client_cert (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_client_cert_from_file (NMSetting8021x *setting, + const char *filename, + NMSetting8021xCKType *out_ck_type, + GError **error); + +const GByteArray *nm_setting_802_1x_get_phase2_ca_cert (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_phase2_ca_cert_from_file (NMSetting8021x *setting, + const char *filename, + NMSetting8021xCKType *out_ck_type, + GError **error); + +const GByteArray *nm_setting_802_1x_get_phase2_client_cert (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_phase2_client_cert_from_file (NMSetting8021x *setting, + const char *filename, + NMSetting8021xCKType *out_ck_type, + GError **error); + +const GByteArray *nm_setting_802_1x_get_private_key (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_private_key_from_file (NMSetting8021x *setting, + const char *filename, + const char *password, + NMSetting8021xCKType *out_ck_type, + GError **error); + +NMSetting8021xCKType nm_setting_802_1x_get_private_key_type (NMSetting8021x *setting); + +const GByteArray *nm_setting_802_1x_get_phase2_private_key (NMSetting8021x *setting); +gboolean nm_setting_802_1x_set_phase2_private_key_from_file (NMSetting8021x *setting, + const char *filename, + const char *password, + NMSetting8021xCKType *out_ck_type, + GError **error); + +NMSetting8021xCKType nm_setting_802_1x_get_phase2_private_key_type (NMSetting8021x *setting); + +G_END_DECLS + +#endif /* NM_SETTING_8021X_H */ diff --git a/libnm-util/nm-setting-bluetooth.c b/libnm-util/nm-setting-bluetooth.c new file mode 100644 index 00000000..70840df9 --- /dev/null +++ b/libnm-util/nm-setting-bluetooth.c @@ -0,0 +1,282 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Bastien Nocera + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2009 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include + +#include "nm-param-spec-specialized.h" +#include "nm-dbus-glib-types.h" +#include "nm-setting-bluetooth.h" +#include "nm-setting-cdma.h" +#include "nm-setting-gsm.h" + +GQuark +nm_setting_bluetooth_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-bluetooth-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_bluetooth_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_UNKNOWN, "UnknownError"), + ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_INVALID_PROPERTY, "InvalidProperty"), + ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_MISSING_PROPERTY, "MissingProperty"), + ENUM_ENTRY (NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND, "TypeSettingNotFound"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingBluetoothError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING) + +#define NM_SETTING_BLUETOOTH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothPrivate)) + +typedef struct { + GByteArray *bdaddr; + char *type; +} NMSettingBluetoothPrivate; + +enum { + PROP_0, + PROP_BDADDR, + PROP_TYPE, + + LAST_PROP +}; + +NMSetting *nm_setting_bluetooth_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_BLUETOOTH, NULL); +} + +const char * +nm_setting_bluetooth_get_connection_type (NMSettingBluetooth *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_BLUETOOTH (setting), 0); + + return NM_SETTING_BLUETOOTH_GET_PRIVATE (setting)->type; +} + +const GByteArray * +nm_setting_bluetooth_get_bdaddr (NMSettingBluetooth *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_BLUETOOTH (setting), NULL); + + return NM_SETTING_BLUETOOTH_GET_PRIVATE (setting)->bdaddr; +} + +static gint +find_setting_by_name (gconstpointer a, gconstpointer b) +{ + NMSetting *setting = NM_SETTING (a); + const char *str = (const char *) b; + + return strcmp (nm_setting_get_name (setting), str); +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingBluetoothPrivate *priv = NM_SETTING_BLUETOOTH_GET_PRIVATE (setting); + + if (!priv->bdaddr) { + g_set_error (error, + NM_SETTING_BLUETOOTH_ERROR, + NM_SETTING_BLUETOOTH_ERROR_MISSING_PROPERTY, + NM_SETTING_BLUETOOTH_BDADDR); + return FALSE; + } + + if (priv->bdaddr && priv->bdaddr->len != ETH_ALEN) { + g_set_error (error, + NM_SETTING_BLUETOOTH_ERROR, + NM_SETTING_BLUETOOTH_ERROR_INVALID_PROPERTY, + NM_SETTING_BLUETOOTH_BDADDR); + return FALSE; + } + + if (!priv->type) { + g_set_error (error, + NM_SETTING_BLUETOOTH_ERROR, + NM_SETTING_BLUETOOTH_ERROR_MISSING_PROPERTY, + NM_SETTING_BLUETOOTH_TYPE); + return FALSE; + } else if (!g_str_equal (priv->type, NM_SETTING_BLUETOOTH_TYPE_DUN) && + !g_str_equal (priv->type, NM_SETTING_BLUETOOTH_TYPE_PANU)) { + g_set_error (error, + NM_SETTING_BLUETOOTH_ERROR, + NM_SETTING_BLUETOOTH_ERROR_INVALID_PROPERTY, + NM_SETTING_BLUETOOTH_TYPE); + return FALSE; + } + + /* Make sure the corresponding 'type' setting is present */ + if ( all_settings + && !strcmp (priv->type, NM_SETTING_BLUETOOTH_TYPE_DUN)) { + gboolean gsm = FALSE, cdma = FALSE; + + gsm = !!g_slist_find_custom (all_settings, + (gpointer) NM_SETTING_GSM_SETTING_NAME, + find_setting_by_name); + cdma = !!g_slist_find_custom (all_settings, + (gpointer) NM_SETTING_CDMA_SETTING_NAME, + find_setting_by_name); + + if (!gsm && !cdma) { + g_set_error (error, + NM_SETTING_BLUETOOTH_ERROR, + NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND, + NM_SETTING_BLUETOOTH_TYPE); + return FALSE; + } + } + /* PANU doesn't need a 'type' setting since no further configuration + * is required at the interface level. + */ + + return TRUE; +} + +static void +nm_setting_bluetooth_init (NMSettingBluetooth *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_BLUETOOTH_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSettingBluetoothPrivate *priv = NM_SETTING_BLUETOOTH_GET_PRIVATE (object); + + if (priv->bdaddr) + g_byte_array_free (priv->bdaddr, TRUE); + + G_OBJECT_CLASS (nm_setting_bluetooth_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingBluetoothPrivate *priv = NM_SETTING_BLUETOOTH_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_BDADDR: + if (priv->bdaddr) + g_byte_array_free (priv->bdaddr, TRUE); + priv->bdaddr = g_value_dup_boxed (value); + break; + case PROP_TYPE: + g_free (priv->type); + priv->type = g_value_dup_string (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) +{ + NMSettingBluetooth *setting = NM_SETTING_BLUETOOTH (object); + + switch (prop_id) { + case PROP_BDADDR: + g_value_set_boxed (value, nm_setting_bluetooth_get_bdaddr (setting)); + break; + case PROP_TYPE: + g_value_set_string (value, nm_setting_bluetooth_get_connection_type (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_bluetooth_class_init (NMSettingBluetoothClass *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 (NMSettingBluetoothPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + + /** + * NMSettingBluetooth:bdaddr: + * + * The Bluetooth address of the device. + **/ + g_object_class_install_property + (object_class, PROP_BDADDR, + _nm_param_spec_specialized (NM_SETTING_BLUETOOTH_BDADDR, + "Bluetooth address", + "The Bluetooth address of the device", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingBluetooth:type: + * + * Either 'dun' for Dial-Up Networking connections (not yet supported) or + * 'panu' for Personal Area Networking connections. + **/ + g_object_class_install_property + (object_class, PROP_TYPE, + g_param_spec_string (NM_SETTING_BLUETOOTH_TYPE, + "Connection type", + "Either '" NM_SETTING_BLUETOOTH_TYPE_DUN "' for " + "Dial-Up Networking connections (not yet supported) " + " or '" NM_SETTING_BLUETOOTH_TYPE_PANU "' for " + "Personal Area Networking connections.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); +} diff --git a/libnm-util/nm-setting-bluetooth.h b/libnm-util/nm-setting-bluetooth.h new file mode 100644 index 00000000..e41183bc --- /dev/null +++ b/libnm-util/nm-setting-bluetooth.h @@ -0,0 +1,85 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Bastien Nocera + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2009 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_BLUETOOTH_H +#define NM_SETTING_BLUETOOTH_H + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_BLUETOOTH (nm_setting_bluetooth_get_type ()) +#define NM_SETTING_BLUETOOTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetooth)) +#define NM_SETTING_BLUETOOTH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothClass)) +#define NM_IS_SETTING_BLUETOOTH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_BLUETOOTH)) +#define NM_IS_SETTING_BLUETOOTH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_BLUETOOTH)) +#define NM_SETTING_BLUETOOTH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothClass)) + +#define NM_SETTING_BLUETOOTH_SETTING_NAME "bluetooth" + +typedef enum +{ + NM_SETTING_BLUETOOTH_ERROR_UNKNOWN = 0, + NM_SETTING_BLUETOOTH_ERROR_INVALID_PROPERTY, + NM_SETTING_BLUETOOTH_ERROR_MISSING_PROPERTY, + NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND, +} NMSettingBluetoothError; + +#define NM_TYPE_SETTING_BLUETOOTH_ERROR (nm_setting_bluetooth_error_get_type ()) +GType nm_setting_bluetooth_error_get_type (void); + +#define NM_SETTING_BLUETOOTH_ERROR nm_setting_bluetooth_error_quark () +GQuark nm_setting_bluetooth_error_quark (void); + +#define NM_SETTING_BLUETOOTH_BDADDR "bdaddr" +#define NM_SETTING_BLUETOOTH_TYPE "type" + +#define NM_SETTING_BLUETOOTH_TYPE_DUN "dun" +#define NM_SETTING_BLUETOOTH_TYPE_PANU "panu" + +typedef struct { + NMSetting parent; +} NMSettingBluetooth; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingBluetoothClass; + +GType nm_setting_bluetooth_get_type (void); + +NMSetting * nm_setting_bluetooth_new (void); +const GByteArray *nm_setting_bluetooth_get_bdaddr (NMSettingBluetooth *setting); +const char * nm_setting_bluetooth_get_connection_type (NMSettingBluetooth *setting); + +G_END_DECLS + +#endif /* NM_SETTING_BLUETOOTH_H */ diff --git a/libnm-util/nm-setting-cdma.c b/libnm-util/nm-setting-cdma.c new file mode 100644 index 00000000..7255eb91 --- /dev/null +++ b/libnm-util/nm-setting-cdma.c @@ -0,0 +1,363 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + */ + +#include +#include "nm-setting-cdma.h" +#include "nm-setting-serial.h" +#include "nm-utils.h" + +/** + * SECTION:nm-setting-cdma + * @short_description: Describes CDMA-based mobile broadband properties + * @include: nm-setting-cdma.h + * + * The #NMSettingCdma object is a #NMSetting subclass that describes + * properties that allow connections to IS-95-based mobile broadband + * networks, including those using CDMA2000/EVDO technology. + */ + +/** + * nm_setting_cdma_error_quark: + * + * Registers an error quark for #NMSettingCdma if necessary. + * + * Returns: the error quark used for #NMSettingCdma errors. + **/ +GQuark +nm_setting_cdma_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-cdma-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_cdma_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_CDMA_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_CDMA_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The required serial setting is missing */ + ENUM_ENTRY (NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING, "MissingSerialSetting"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingCdmaError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING) + +#define NM_SETTING_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CDMA, NMSettingCdmaPrivate)) + +typedef struct { + char *number; /* For dialing, duh */ + char *username; + char *password; +} NMSettingCdmaPrivate; + +enum { + PROP_0, + PROP_NUMBER, + PROP_USERNAME, + PROP_PASSWORD, + + LAST_PROP +}; + +/** + * nm_setting_cdma_new: + * + * Creates a new #NMSettingCdma object with default values. + * + * Returns: the new empty #NMSettingCdma object + **/ +NMSetting * +nm_setting_cdma_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_CDMA, NULL); +} + +/** + * nm_setting_cdma_get_number: + * @setting: the #NMSettingCdma + * + * Returns: the #NMSettingCdma:number property of the setting + **/ +const char * +nm_setting_cdma_get_number (NMSettingCdma *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CDMA (setting), NULL); + + return NM_SETTING_CDMA_GET_PRIVATE (setting)->number; +} + +/** + * nm_setting_cdma_get_username: + * @setting: the #NMSettingCdma + * + * Returns: the #NMSettingCdma:username property of the setting + **/ +const char * +nm_setting_cdma_get_username (NMSettingCdma *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CDMA (setting), NULL); + + return NM_SETTING_CDMA_GET_PRIVATE (setting)->username; +} + +/** + * nm_setting_cdma_get_password: + * @setting: the #NMSettingCdma + * + * Returns: the #NMSettingCdma:password property of the setting + **/ +const char * +nm_setting_cdma_get_password (NMSettingCdma *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CDMA (setting), NULL); + + return NM_SETTING_CDMA_GET_PRIVATE (setting)->password; +} + +static gint +find_setting_by_name (gconstpointer a, gconstpointer b) +{ + NMSetting *setting = NM_SETTING (a); + const char *str = (const char *) b; + + return strcmp (nm_setting_get_name (setting), str); +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (setting); + + /* Serial connections require a PPP setting */ + if (all_settings && + !g_slist_find_custom (all_settings, NM_SETTING_SERIAL_SETTING_NAME, find_setting_by_name)) { + g_set_error (error, + NM_SETTING_CDMA_ERROR, + NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING, + NULL); + return FALSE; + } + + if (!priv->number) { + g_set_error (error, + NM_SETTING_CDMA_ERROR, + NM_SETTING_CDMA_ERROR_MISSING_PROPERTY, + NM_SETTING_CDMA_NUMBER); + return FALSE; + } else if (!strlen (priv->number)) { + g_set_error (error, + NM_SETTING_CDMA_ERROR, + NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, + NM_SETTING_CDMA_NUMBER); + return FALSE; + } + + if (priv->username && !strlen (priv->username)) { + g_set_error (error, + NM_SETTING_CDMA_ERROR, + NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, + NM_SETTING_CDMA_USERNAME); + return FALSE; + } + + if (priv->password && !strlen (priv->password)) { + g_set_error (error, + NM_SETTING_CDMA_ERROR, + NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, + NM_SETTING_CDMA_PASSWORD); + return FALSE; + } + + return TRUE; +} + +static GPtrArray * +need_secrets (NMSetting *setting) +{ + NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (setting); + GPtrArray *secrets = NULL; + + if (priv->password) + return NULL; + + if (priv->username) { + secrets = g_ptr_array_sized_new (1); + g_ptr_array_add (secrets, NM_SETTING_CDMA_PASSWORD); + } + + return secrets; +} + +static void +nm_setting_cdma_init (NMSettingCdma *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_CDMA_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (object); + + g_free (priv->number); + g_free (priv->username); + g_free (priv->password); + + G_OBJECT_CLASS (nm_setting_cdma_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_NUMBER: + g_free (priv->number); + priv->number = g_value_dup_string (value); + break; + case PROP_USERNAME: + g_free (priv->username); + priv->username = g_value_dup_string (value); + break; + case PROP_PASSWORD: + g_free (priv->password); + priv->password = g_value_dup_string (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) +{ + NMSettingCdma *setting = NM_SETTING_CDMA (object); + + switch (prop_id) { + case PROP_NUMBER: + g_value_set_string (value, nm_setting_cdma_get_number (setting)); + break; + case PROP_USERNAME: + g_value_set_string (value, nm_setting_cdma_get_username (setting)); + break; + case PROP_PASSWORD: + g_value_set_string (value, nm_setting_cdma_get_password (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_cdma_class_init (NMSettingCdmaClass *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 (NMSettingCdmaPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + parent_class->need_secrets = need_secrets; + + /* Properties */ + + /** + * NMSettingCdma:number: + * + * The number to dial to establish the connection to the CDMA-based mobile + * broadband network, if any. If not specified, the default number (#777) + * is used when required. + **/ + g_object_class_install_property + (object_class, PROP_NUMBER, + g_param_spec_string (NM_SETTING_CDMA_NUMBER, + "Number", + "Number to dial when establishing a PPP data session " + "with the CDMA-based mobile broadband network. If not " + "specified, the default number (#777) is used when " + "required.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingCdma:username: + * + * The username used to authenticate with the network, if required. Many + * providers do not require a username, or accept any username. But if a + * username is required, it is specified here. + **/ + g_object_class_install_property + (object_class, PROP_USERNAME, + g_param_spec_string (NM_SETTING_CDMA_USERNAME, + "Username", + "Username used to authenticate with the network, if " + "required. Note that many providers do not require " + "a username or accept any username.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingCdma:password: + * + * The password used to authenticate with the network, if required. Many + * providers do not require a password, or accept any password. But if a + * password is required, it is specified here. + **/ + g_object_class_install_property + (object_class, PROP_PASSWORD, + g_param_spec_string (NM_SETTING_CDMA_PASSWORD, + "Password", + "Password used to authenticate with the network, if " + "required. Note that many providers do not require " + "a password or accept any password.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); +} diff --git a/libnm-util/nm-setting-cdma.h b/libnm-util/nm-setting-cdma.h new file mode 100644 index 00000000..8a6c4505 --- /dev/null +++ b/libnm-util/nm-setting-cdma.h @@ -0,0 +1,83 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_CDMA_H +#define NM_SETTING_CDMA_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_CDMA (nm_setting_cdma_get_type ()) +#define NM_SETTING_CDMA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_CDMA, NMSettingCdma)) +#define NM_SETTING_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_CDMA, NMSettingCdmaClass)) +#define NM_IS_SETTING_CDMA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_CDMA)) +#define NM_IS_SETTING_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_CDMA)) +#define NM_SETTING_CDMA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_CDMA, NMSettingCdmaClass)) + +#define NM_SETTING_CDMA_SETTING_NAME "cdma" + +typedef enum +{ + NM_SETTING_CDMA_ERROR_UNKNOWN = 0, + NM_SETTING_CDMA_ERROR_INVALID_PROPERTY, + NM_SETTING_CDMA_ERROR_MISSING_PROPERTY, + NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING +} NMSettingCdmaError; + +#define NM_TYPE_SETTING_CDMA_ERROR (nm_setting_cdma_error_get_type ()) +GType nm_setting_cdma_error_get_type (void); + +#define NM_SETTING_CDMA_ERROR nm_setting_cdma_error_quark () +GQuark nm_setting_cdma_error_quark (void); + +#define NM_SETTING_CDMA_NUMBER "number" +#define NM_SETTING_CDMA_USERNAME "username" +#define NM_SETTING_CDMA_PASSWORD "password" + +typedef struct { + NMSetting parent; +} NMSettingCdma; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingCdmaClass; + +GType nm_setting_cdma_get_type (void); + +NMSetting *nm_setting_cdma_new (void); +const char *nm_setting_cdma_get_number (NMSettingCdma *setting); +const char *nm_setting_cdma_get_username (NMSettingCdma *setting); +const char *nm_setting_cdma_get_password (NMSettingCdma *setting); + +G_END_DECLS + +#endif /* NM_SETTING_CDMA_H */ diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c new file mode 100644 index 00000000..65f613eb --- /dev/null +++ b/libnm-util/nm-setting-connection.c @@ -0,0 +1,521 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include "nm-setting-connection.h" + +/** + * SECTION:nm-setting-connection + * @short_description: Describes general connection properties + * @include: nm-setting-connection.h + * + * The #NMSettingConnection object is a #NMSetting subclass that describes + * properties that apply to all #NMConnection objects, regardless of what type + * of network connection they describe. Each #NMConnection object must contain + * a #NMSettingConnection setting. + **/ + +/** + * nm_setting_connection_error_quark: + * + * Registers an error quark for #NMSettingConnection if necessary. + * + * Returns: the error quark used for #NMSettingConnection errors. + **/ +GQuark +nm_setting_connection_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-connection-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_connection_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_UNKNOWN, "UnknownError"), + ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY, "InvalidProperty"), + ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY, "MissingProperty"), + ENUM_ENTRY (NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND, "TypeSettingNotFound"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingConnectionError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING) + +#define NM_SETTING_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionPrivate)) + +typedef struct { + char *id; + char *uuid; + char *type; + gboolean autoconnect; + guint64 timestamp; + gboolean read_only; +} NMSettingConnectionPrivate; + +enum { + PROP_0, + PROP_ID, + PROP_UUID, + PROP_TYPE, + PROP_AUTOCONNECT, + PROP_TIMESTAMP, + PROP_READ_ONLY, + + LAST_PROP +}; + +/** + * nm_setting_connection_new: + * + * Creates a new #NMSettingConnection object with default values. + * + * Returns: the new empty #NMSettingConnection object + **/ +NMSetting *nm_setting_connection_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_CONNECTION, NULL); +} + +/** + * nm_setting_connection_get_id: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:id property of the connection. + * + * Returns: the connection ID + **/ +const char * +nm_setting_connection_get_id (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), NULL); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->id; +} + +/** + * nm_setting_connection_get_uuid: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:uuid property of the connection. + * + * Returns: the connection UUID + **/ +const char * +nm_setting_connection_get_uuid (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), NULL); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->uuid; +} + +/** + * nm_setting_connection_get_connection_type: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:type property of the connection. + * + * Returns: the connection type + **/ +const char * +nm_setting_connection_get_connection_type (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), NULL); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->type; +} + +/** + * nm_setting_connection_get_autoconnect: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:autoconnect property of the connection. + * + * Returns: the connection's autoconnect behavior + **/ +gboolean +nm_setting_connection_get_autoconnect (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), FALSE); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->autoconnect; +} + +/** + * nm_setting_connection_get_timestamp: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:timestamp property of the connection. + * + * Returns: the connection's timestamp + **/ +guint64 +nm_setting_connection_get_timestamp (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), 0); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->timestamp; +} + +/** + * nm_setting_connection_get_read_only: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:read-only property of the connection. + * + * Returns: %TRUE if the connection is read-only, %FALSE if it is not + **/ +gboolean +nm_setting_connection_get_read_only (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), TRUE); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->read_only; +} + +static gint +find_setting_by_name (gconstpointer a, gconstpointer b) +{ + NMSetting *setting = NM_SETTING (a); + const char *str = (const char *) b; + + return strcmp (nm_setting_get_name (setting), str); +} + +static gboolean +validate_uuid (const char *uuid) +{ + int i; + + if (!uuid || !strlen (uuid)) + return FALSE; + + for (i = 0; i < strlen (uuid); i++) { + if (!isxdigit (uuid[i]) && (uuid[i] != '-')) + return FALSE; + } + + return TRUE; +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (setting); + + if (!priv->id) { + g_set_error (error, + NM_SETTING_CONNECTION_ERROR, + NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY, + NM_SETTING_CONNECTION_ID); + return FALSE; + } else if (!strlen (priv->id)) { + g_set_error (error, + NM_SETTING_CONNECTION_ERROR, + NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY, + NM_SETTING_CONNECTION_ID); + return FALSE; + } + + if (!priv->uuid) { + g_set_error (error, + NM_SETTING_CONNECTION_ERROR, + NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY, + NM_SETTING_CONNECTION_UUID); + return FALSE; + } else if (!validate_uuid (priv->uuid)) { + g_set_error (error, + NM_SETTING_CONNECTION_ERROR, + NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY, + NM_SETTING_CONNECTION_UUID); + return FALSE; + } + + if (!priv->type) { + g_set_error (error, + NM_SETTING_CONNECTION_ERROR, + NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY, + NM_SETTING_CONNECTION_TYPE); + return FALSE; + } else if (!strlen (priv->type)) { + g_set_error (error, + NM_SETTING_CONNECTION_ERROR, + NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY, + NM_SETTING_CONNECTION_TYPE); + return FALSE; + } + + /* Make sure the corresponding 'type' item is present */ + if (all_settings && !g_slist_find_custom (all_settings, priv->type, find_setting_by_name)) { + g_set_error (error, + NM_SETTING_CONNECTION_ERROR, + NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND, + NM_SETTING_CONNECTION_TYPE); + return FALSE; + } + + return TRUE; +} + +static void +nm_setting_connection_init (NMSettingConnection *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_CONNECTION_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (object); + + g_free (priv->id); + g_free (priv->uuid); + g_free (priv->type); + + G_OBJECT_CLASS (nm_setting_connection_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_ID: + g_free (priv->id); + priv->id = g_value_dup_string (value); + break; + case PROP_UUID: + g_free (priv->uuid); + priv->uuid = g_value_dup_string (value); + break; + case PROP_TYPE: + g_free (priv->type); + priv->type = g_value_dup_string (value); + break; + case PROP_AUTOCONNECT: + priv->autoconnect = g_value_get_boolean (value); + break; + case PROP_TIMESTAMP: + priv->timestamp = g_value_get_uint64 (value); + break; + case PROP_READ_ONLY: + priv->read_only = 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) +{ + NMSettingConnection *setting = NM_SETTING_CONNECTION (object); + + switch (prop_id) { + case PROP_ID: + g_value_set_string (value, nm_setting_connection_get_id (setting)); + break; + case PROP_UUID: + g_value_set_string (value, nm_setting_connection_get_uuid (setting)); + break; + case PROP_TYPE: + g_value_set_string (value, nm_setting_connection_get_connection_type (setting)); + break; + case PROP_AUTOCONNECT: + g_value_set_boolean (value, nm_setting_connection_get_autoconnect (setting)); + break; + case PROP_TIMESTAMP: + g_value_set_uint64 (value, nm_setting_connection_get_timestamp (setting)); + break; + case PROP_READ_ONLY: + g_value_set_boolean (value, nm_setting_connection_get_read_only (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_connection_class_init (NMSettingConnectionClass *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 (NMSettingConnectionPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + + /** + * NMSettingConnection:id: + * + * A human readable unique idenfier for the connection, like "Work WiFi" or + * "T-Mobile 3G". + **/ + g_object_class_install_property + (object_class, PROP_ID, + g_param_spec_string (NM_SETTING_CONNECTION_ID, + "ID", + "User-readable connection identifier/name. Must be " + "one or more characters and may change over the lifetime " + "of the connection if the user decides to rename it.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingConnection:uuid: + * + * A universally unique idenfier for the connection, for example generated + * with libuuid. Should be assigned when the connection is created, and + * never changed as long as the connection still applies to the same + * network. For example, should not be changed when the + * #NMSettingConnection:id or #NMSettingIP4Config changes, but might need + * to be re-created when the WiFi SSID, mobile broadband network provider, + * or #NMSettingConnection:type changes. + * + * The UUID must be in the format '2815492f-7e56-435e-b2e9-246bd7cdc664' + * (ie, contains only hexadecimal characters and '-'). A suitable UUID may + * be generated by nm_utils_uuid_generate() or + * nm_utils_uuid_generate_from_string(). + **/ + g_object_class_install_property + (object_class, PROP_UUID, + g_param_spec_string (NM_SETTING_CONNECTION_UUID, + "UUID", + "Universally unique connection identifier. Must be " + "in the format '2815492f-7e56-435e-b2e9-246bd7cdc664' " + "(ie, contains only hexadecimal characters and '-'). " + "The UUID should be assigned when the connection is " + "created and never changed as long as the connection " + "still applies to the same network. For example, " + "it should not be changed when the user changes the " + "connection's 'id', but should be recreated when the " + "WiFi SSID, mobile broadband network provider, or the " + "connection type changes.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingConnection:type: + * + * The general hardware type of the device used for the network connection, + * contains the name of the #NMSetting object that describes that hardware + * type's parameters. For example, for WiFi devices, the name of the + * #NMSettingWireless setting. + **/ + g_object_class_install_property + (object_class, PROP_TYPE, + g_param_spec_string (NM_SETTING_CONNECTION_TYPE, + "Type", + "Base type of the connection. For hardware-dependent " + "connections, should contain the setting name of the " + "hardware-type specific setting (ie, '802-3-ethernet' " + "or '802-11-wireless' or 'bluetooth', etc), and for " + "non-hardware dependent connections like VPN or " + "otherwise, should contain the setting name of that " + "setting type (ie, 'vpn' or 'bridge', etc).", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingConnection:autoconnect: + * + * Whether or not the connection should be automatically connected by + * NetworkManager when the resources for the connection are available. + * %TRUE to automatically activate the connection, %FALSE to require manual + * intervention to activate the connection. Defaults to %TRUE. + **/ + g_object_class_install_property + (object_class, PROP_AUTOCONNECT, + g_param_spec_boolean (NM_SETTING_CONNECTION_AUTOCONNECT, + "Autoconnect", + "If TRUE, NetworkManager will activate this connection " + "when its network resources are available. If FALSE, " + "the connection must be manually activated by the user " + "or some other mechanism.", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingConnection:timestamp: + * + * The time, in seconds since the Unix Epoch, that the connection was last + * _successfully_ fully activated. + **/ + g_object_class_install_property + (object_class, PROP_TIMESTAMP, + g_param_spec_uint64 (NM_SETTING_CONNECTION_TIMESTAMP, + "Timestamp", + "Timestamp (in seconds since the Unix Epoch) that the " + "connection was last successfully activated. Settings " + "services should update the connection timestamp " + "periodically when the connection is active to ensure " + "that an active connection has the latest timestamp.", + 0, G_MAXUINT64, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingConnection:read-only: + * + * %TRUE if the connection can be modified using the providing settings + * service's D-Bus interface with the right privileges, or %FALSE + * if the connection is read-only and cannot be modified. + **/ + g_object_class_install_property + (object_class, PROP_READ_ONLY, + g_param_spec_boolean (NM_SETTING_CONNECTION_READ_ONLY, + "Read-Only", + "If TRUE, the connection is read-only and cannot be " + "changed by the user or any other mechanism. This is " + "normally set for system connections whose plugin " + "cannot yet write updated connections back out.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); +} diff --git a/libnm-util/nm-setting-connection.h b/libnm-util/nm-setting-connection.h new file mode 100644 index 00000000..6dedca22 --- /dev/null +++ b/libnm-util/nm-setting-connection.h @@ -0,0 +1,110 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_CONNECTION_H +#define NM_SETTING_CONNECTION_H + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_CONNECTION (nm_setting_connection_get_type ()) +#define NM_SETTING_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_CONNECTION, NMSettingConnection)) +#define NM_SETTING_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionClass)) +#define NM_IS_SETTING_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_CONNECTION)) +#define NM_IS_SETTING_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_CONNECTION)) +#define NM_SETTING_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionClass)) + +#define NM_SETTING_CONNECTION_SETTING_NAME "connection" + +/** + * NMSettingConnectionError: + * @NM_SETTING_CONNECTION_ERROR_UNKNOWN: unknown or unclassified error + * @NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY: the property's value is + * invalid + * @NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY: a required property is not + * present + * @NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND: the #NMSetting object + * referenced by the setting name contained in the + * #NMSettingConnection:type property was not present in the #NMConnection + * + * Describes errors that may result from operations involving a + * #NMSettingConnection. + * + **/ +typedef enum +{ + NM_SETTING_CONNECTION_ERROR_UNKNOWN = 0, + NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY, + NM_SETTING_CONNECTION_ERROR_MISSING_PROPERTY, + NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND +} NMSettingConnectionError; + +#define NM_TYPE_SETTING_CONNECTION_ERROR (nm_setting_connection_error_get_type ()) +GType nm_setting_connection_error_get_type (void); + +#define NM_SETTING_CONNECTION_ERROR nm_setting_connection_error_quark () +GQuark nm_setting_connection_error_quark (void); + +#define NM_SETTING_CONNECTION_ID "id" +#define NM_SETTING_CONNECTION_UUID "uuid" +#define NM_SETTING_CONNECTION_TYPE "type" +#define NM_SETTING_CONNECTION_AUTOCONNECT "autoconnect" +#define NM_SETTING_CONNECTION_TIMESTAMP "timestamp" +#define NM_SETTING_CONNECTION_READ_ONLY "read-only" + +/** + * NMSettingConnection: + * + * The NMSettingConnection struct contains only private data. + * It should only be accessed through the functions described below. + */ +typedef struct { + NMSetting parent; +} NMSettingConnection; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingConnectionClass; + +GType nm_setting_connection_get_type (void); + +NMSetting * nm_setting_connection_new (void); +const char *nm_setting_connection_get_id (NMSettingConnection *setting); +const char *nm_setting_connection_get_uuid (NMSettingConnection *setting); +const char *nm_setting_connection_get_connection_type (NMSettingConnection *setting); +gboolean nm_setting_connection_get_autoconnect (NMSettingConnection *setting); +guint64 nm_setting_connection_get_timestamp (NMSettingConnection *setting); +gboolean nm_setting_connection_get_read_only (NMSettingConnection *setting); + +G_END_DECLS + +#endif /* NM_SETTING_CONNECTION_H */ diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c new file mode 100644 index 00000000..4b4560cd --- /dev/null +++ b/libnm-util/nm-setting-gsm.c @@ -0,0 +1,656 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include "nm-setting-gsm.h" +#include "nm-setting-serial.h" +#include "nm-utils.h" + +GQuark +nm_setting_gsm_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-gsm-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_gsm_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_GSM_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_GSM_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_GSM_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The required serial setting is missing */ + ENUM_ENTRY (NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING, "MissingSerialSetting"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingGsmError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING) + +#define NM_SETTING_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GSM, NMSettingGsmPrivate)) + +typedef struct { + char *number; /* For dialing, duh */ + char *username; + char *password; + + char *apn; /* NULL for dynamic */ + char *network_id; /* for manual registration or NULL for automatic */ + int network_type; /* One of the NM_SETTING_GSM_NETWORK_TYPE_* */ + guint32 allowed_bands; /* A bitfield of NM_SETTING_GSM_BAND_* */ + + char *pin; + + gboolean home_only; +} NMSettingGsmPrivate; + +enum { + PROP_0, + PROP_NUMBER, + PROP_USERNAME, + PROP_PASSWORD, + PROP_APN, + PROP_NETWORK_ID, + PROP_NETWORK_TYPE, + PROP_BAND, + PROP_PIN, + PROP_PUK, + PROP_ALLOWED_BANDS, + PROP_HOME_ONLY, + + LAST_PROP +}; + +NMSetting * +nm_setting_gsm_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_GSM, NULL); +} + +static gint +find_setting_by_name (gconstpointer a, gconstpointer b) +{ + NMSetting *setting = NM_SETTING (a); + const char *str = (const char *) b; + + return strcmp (nm_setting_get_name (setting), str); +} + +const char * +nm_setting_gsm_get_number (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->number; +} + +const char * +nm_setting_gsm_get_username (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->username; +} + +const char * +nm_setting_gsm_get_password (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->password; +} + +const char * +nm_setting_gsm_get_apn (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->apn; +} + +const char * +nm_setting_gsm_get_network_id (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->network_id; +} + +int +nm_setting_gsm_get_network_type (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), -1); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->network_type; +} + +int +nm_setting_gsm_get_band (NMSettingGsm *setting) +{ + g_warning ("Tried to get deprecated property " NM_SETTING_GSM_SETTING_NAME "/" NM_SETTING_GSM_BAND); + return -1; +} + +guint32 +nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NM_SETTING_GSM_BAND_UNKNOWN); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->allowed_bands; +} + +const char * +nm_setting_gsm_get_pin (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->pin; +} + +const char * +nm_setting_gsm_get_puk (NMSettingGsm *setting) +{ + g_warning ("Tried to get deprecated property " NM_SETTING_GSM_SETTING_NAME "/" NM_SETTING_GSM_PUK); + return NULL; +} + +gboolean +nm_setting_gsm_get_home_only (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), FALSE); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->home_only; +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (setting); + + /* Serial connections require a PPP setting */ + if (all_settings && + !g_slist_find_custom (all_settings, NM_SETTING_SERIAL_SETTING_NAME, find_setting_by_name)) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING, + NULL); + return FALSE; + } + + if (!priv->number) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_MISSING_PROPERTY, + NM_SETTING_GSM_NUMBER); + return FALSE; + } else if (!strlen (priv->number)) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_NUMBER); + return FALSE; + } + + if (priv->apn && (strlen (priv->apn) < 1 || strchr (priv->apn, '"'))) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_APN); + return FALSE; + } + + if (priv->username && !strlen (priv->username)) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_USERNAME); + return FALSE; + } + + if (priv->password && !strlen (priv->password)) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_USERNAME); + return FALSE; + } + + if (priv->network_id) { + guint32 nid_len = strlen (priv->network_id); + guint32 i; + + /* Accept both 5 and 6 digit MCC/MNC codes */ + if ((nid_len < 5) || (nid_len > 6)) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_NETWORK_ID); + return FALSE; + } + + for (i = 0; i < nid_len; i++) { + if (!isdigit (priv->network_id[i])) { + g_set_error (error, + NM_SETTING_GSM_ERROR, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_NETWORK_ID); + return FALSE; + } + } + } + + return TRUE; +} + +static GPtrArray * +need_secrets (NMSetting *setting) +{ + NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (setting); + GPtrArray *secrets = NULL; + + if (priv->password) + return NULL; + + if (priv->username) { + secrets = g_ptr_array_sized_new (1); + g_ptr_array_add (secrets, NM_SETTING_GSM_PASSWORD); + } + + return secrets; +} + +static void +nm_setting_gsm_init (NMSettingGsm *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_GSM_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (object); + + g_free (priv->number); + g_free (priv->username); + g_free (priv->password); + g_free (priv->apn); + g_free (priv->network_id); + g_free (priv->pin); + + G_OBJECT_CLASS (nm_setting_gsm_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (object); + const char *str; + + switch (prop_id) { + case PROP_NUMBER: + g_free (priv->number); + priv->number = g_value_dup_string (value); + break; + case PROP_USERNAME: + g_free (priv->username); + priv->username = g_value_dup_string (value); + break; + case PROP_PASSWORD: + g_free (priv->password); + priv->password = g_value_dup_string (value); + break; + case PROP_APN: + g_free (priv->apn); + priv->apn = g_value_dup_string (value); + break; + case PROP_NETWORK_ID: + g_free (priv->network_id); + priv->network_id = g_value_dup_string (value); + break; + case PROP_NETWORK_TYPE: + priv->network_type = g_value_get_int (value); + break; + case PROP_BAND: + if (g_value_get_int (value) != -1) + g_warning ("Tried to set deprecated property " NM_SETTING_GSM_SETTING_NAME "/" NM_SETTING_GSM_BAND); + break; + case PROP_ALLOWED_BANDS: + priv->allowed_bands = g_value_get_uint (value); + break; + case PROP_PIN: + g_free (priv->pin); + priv->pin = g_value_dup_string (value); + break; + case PROP_PUK: + str = g_value_get_string (value); + if (str && strlen (str)) + g_warning ("Tried to set deprecated property " NM_SETTING_GSM_SETTING_NAME "/" NM_SETTING_GSM_PUK); + break; + case PROP_HOME_ONLY: + priv->home_only = 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) +{ + NMSettingGsm *setting = NM_SETTING_GSM (object); + + switch (prop_id) { + case PROP_NUMBER: + g_value_set_string (value, nm_setting_gsm_get_number (setting)); + break; + case PROP_USERNAME: + g_value_set_string (value, nm_setting_gsm_get_username (setting)); + break; + case PROP_PASSWORD: + g_value_set_string (value, nm_setting_gsm_get_password (setting)); + break; + case PROP_APN: + g_value_set_string (value, nm_setting_gsm_get_apn (setting)); + break; + case PROP_NETWORK_ID: + g_value_set_string (value, nm_setting_gsm_get_network_id (setting)); + break; + case PROP_NETWORK_TYPE: + g_value_set_int (value, nm_setting_gsm_get_network_type (setting)); + break; + case PROP_ALLOWED_BANDS: + g_value_set_uint (value, nm_setting_gsm_get_allowed_bands (setting)); + break; + case PROP_PIN: + g_value_set_string (value, nm_setting_gsm_get_pin (setting)); + break; + case PROP_PUK: + /* deprecated */ + g_value_set_string (value, NULL); + break; + case PROP_BAND: + /* deprecated */ + g_value_set_int (value, -1); + break; + case PROP_HOME_ONLY: + g_value_set_boolean (value, nm_setting_gsm_get_home_only (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_gsm_class_init (NMSettingGsmClass *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 (NMSettingGsmPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + parent_class->need_secrets = need_secrets; + + /* Properties */ + + /** + * NMSettingGsm:number: + * + * Number to dial when establishing a PPP data session with the GSM-based + * mobile broadband network. In most cases, leave the number blank and a + * number selecting the APN specified in the 'apn' property will be used + * automatically when required. + **/ + g_object_class_install_property + (object_class, PROP_NUMBER, + g_param_spec_string (NM_SETTING_GSM_NUMBER, + "Number", + "Number to dial when establishing a PPP data session " + "with the GSM-based mobile broadband network. In most " + "cases, leave the number blank and a number selecting " + "the APN specified in the 'apn' property will be used " + "automatically when required.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingGsm:username: + * + * The username used to authenticate with the network, if required. Many + * providers do not require a username, or accept any username. But if a + * username is required, it is specified here. + **/ + g_object_class_install_property + (object_class, PROP_USERNAME, + g_param_spec_string (NM_SETTING_GSM_USERNAME, + "Username", + "Username used to authenticate with the network, if " + "required. Note that many providers do not require " + "a username or accept any username.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingGsm:password: + * + * The password used to authenticate with the network, if required. Many + * providers do not require a password, or accept any password. But if a + * password is required, it is specified here. + **/ + g_object_class_install_property + (object_class, PROP_PASSWORD, + g_param_spec_string (NM_SETTING_GSM_PASSWORD, + "Password", + "Password used to authenticate with the network, if " + "required. Note that many providers do not require " + "a password or accept any password.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingGsm:apn: + * + * The GPRS Access Point Name specifying the APN used when establishing a + * data session with the GSM-based network. The APN often determines how + * the user will be billed for their network usage and whether the user has + * access to the Internet or just a provider-specific walled-garden, so it + * is important to use the correct APN for the user's mobile broadband plan. + **/ + g_object_class_install_property + (object_class, PROP_APN, + g_param_spec_string (NM_SETTING_GSM_APN, + "APN", + "The GPRS Access Point Name specifying the APN used " + "when establishing a data session with the GSM-based " + "network. The APN often determines how the user will " + "be billed for their network usage and whether the " + "user has access to the Internet or just a provider-" + "specific walled-garden, so it is important to use " + "the correct APN for the user's mobile broadband " + "plan.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingGsm:network-id: + * + * The Network ID (GSM LAI format, ie MCC-MNC) to force specific network + * registration. If the Network ID is specified, NetworkManager will + * attempt to force the device to register only on the specified network. + * This can be used to ensure that the device does not roam when direct + * roaming control of the device is not otherwise possible. + **/ + g_object_class_install_property + (object_class, PROP_NETWORK_ID, + g_param_spec_string (NM_SETTING_GSM_NETWORK_ID, + "Network ID", + "The Network ID (GSM LAI format, ie MCC-MNC) to force " + "specific network registration. If the Network ID is " + "specified, NetworkManager will attempt to force the " + "device to register only on the specified network. " + "This can be used to ensure that the device does not " + "roam when direct roaming control of the device is " + "not otherwise possible.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingGsm:network-type: + * + * Network preference to force the device to only use specific network + * technologies. The permitted values are: -1: any, 0: 3G only, + * 1: GPRS/EDGE only, 2: prefer 3G, and 3: prefer 2G. Note that not all + * devices allow network preference control. + **/ + g_object_class_install_property + (object_class, PROP_NETWORK_TYPE, + g_param_spec_int (NM_SETTING_GSM_NETWORK_TYPE, + "Network type", + "Network preference to force the device to only use " + "specific network technologies. The permitted values " + "are: -1: any, 0: 3G only, 1: GPRS/EDGE only, " + "2: prefer 3G, and 3: prefer 2G. Note that not all " + "devices allow network preference control.", + NM_SETTING_GSM_NETWORK_TYPE_ANY, + NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE, + NM_SETTING_GSM_NETWORK_TYPE_ANY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingGsm:allowed-bands: + * + * Bitfield of allowed frequency bands. Note that not all devices allow + * frequency band control. + **/ + g_object_class_install_property + (object_class, PROP_ALLOWED_BANDS, + g_param_spec_uint (NM_SETTING_GSM_ALLOWED_BANDS, + "Allowed Bands", + "Bitfield of allowed frequency bands. Note that " + "not all devices allow frequency band control.", + NM_SETTING_GSM_BAND_UNKNOWN, + NM_SETTING_GSM_BAND_UNKNOWN + || NM_SETTING_GSM_BAND_ANY + || NM_SETTING_GSM_BAND_EGSM + || NM_SETTING_GSM_BAND_DCS + || NM_SETTING_GSM_BAND_PCS + || NM_SETTING_GSM_BAND_G850 + || NM_SETTING_GSM_BAND_U2100 + || NM_SETTING_GSM_BAND_U1800 + || NM_SETTING_GSM_BAND_U17IV + || NM_SETTING_GSM_BAND_U800 + || NM_SETTING_GSM_BAND_U850 + || NM_SETTING_GSM_BAND_U900 + || NM_SETTING_GSM_BAND_U17IX + || NM_SETTING_GSM_BAND_U1900, + NM_SETTING_GSM_BAND_ANY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingGsm:pin: + * + * If the SIM is locked with a PIN it must be unlocked before any other + * operations are requested. Specify the PIN here to allow operation of + * the device. + **/ + g_object_class_install_property + (object_class, PROP_PIN, + g_param_spec_string (NM_SETTING_GSM_PIN, + "PIN", + "If the SIM is locked with a PIN it must be unlocked " + "before any other operations are requested. Specify " + "the PIN here to allow operation of the device.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingGsm:home-only: + * + * When TRUE, only connections to the home network will be allowed. + * Connections to roaming networks will not be made. + **/ + g_object_class_install_property + (object_class, PROP_HOME_ONLY, + g_param_spec_boolean (NM_SETTING_GSM_HOME_ONLY, + "PIN", + "When TRUE, only connections to the home network will " + "be allowed. Connections to roaming networks will " + "not be made.", + FALSE, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /* Deprecated properties */ + /** + * NMSettingGsm:puk: + * + * DEPRECATED + **/ + g_object_class_install_property + (object_class, PROP_PUK, + g_param_spec_string (NM_SETTING_GSM_PUK, + "PUK (DEPRECATED and UNUSED)", + "PUK (DEPRECATED and UNUSED)", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingGsm:band: + * + * DEPRECATED + **/ + g_object_class_install_property + (object_class, PROP_BAND, + g_param_spec_int (NM_SETTING_GSM_BAND, + "Band (DEPRECATED and UNUSED)", + "Band (DEPRECATED and UNUSED)", + -1, 5, -1, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); +} diff --git a/libnm-util/nm-setting-gsm.h b/libnm-util/nm-setting-gsm.h new file mode 100644 index 00000000..0ac71224 --- /dev/null +++ b/libnm-util/nm-setting-gsm.h @@ -0,0 +1,135 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_GSM_H +#define NM_SETTING_GSM_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_GSM (nm_setting_gsm_get_type ()) +#define NM_SETTING_GSM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_GSM, NMSettingGsm)) +#define NM_SETTING_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_GSM, NMSettingGsmClass)) +#define NM_IS_SETTING_GSM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_GSM)) +#define NM_IS_SETTING_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_GSM)) +#define NM_SETTING_GSM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_GSM, NMSettingGsmClass)) + +#define NM_SETTING_GSM_SETTING_NAME "gsm" + +typedef enum +{ + NM_SETTING_GSM_ERROR_UNKNOWN = 0, + NM_SETTING_GSM_ERROR_INVALID_PROPERTY, + NM_SETTING_GSM_ERROR_MISSING_PROPERTY, + NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING +} NMSettingGsmError; + +#define NM_TYPE_SETTING_GSM_ERROR (nm_setting_gsm_error_get_type ()) +GType nm_setting_gsm_error_get_type (void); + +#define NM_SETTING_GSM_ERROR nm_setting_gsm_error_quark () +GQuark nm_setting_gsm_error_quark (void); + +#define NM_SETTING_GSM_NUMBER "number" +#define NM_SETTING_GSM_USERNAME "username" +#define NM_SETTING_GSM_PASSWORD "password" +#define NM_SETTING_GSM_APN "apn" +#define NM_SETTING_GSM_NETWORK_ID "network-id" +#define NM_SETTING_GSM_NETWORK_TYPE "network-type" +#define NM_SETTING_GSM_ALLOWED_BANDS "allowed-bands" +#define NM_SETTING_GSM_PIN "pin" +#define NM_SETTING_GSM_HOME_ONLY "home-only" + +/* DEPRECATED & UNUSED */ +#define NM_SETTING_GSM_PUK "puk" +#define NM_SETTING_GSM_BAND "band" + +/* DEPRECATED, use NM_SETTING_NETWORK_TYPE_* instead */ +#define NM_GSM_NETWORK_ANY NM_SETTING_GSM_NETWORK_TYPE_ANY +#define NM_GSM_NETWORK_UMTS_HSPA NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA +#define NM_GSM_NETWORK_GPRS_EDGE NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE +#define NM_GSM_NETWORK_PREFER_UMTS_HSPA NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA +#define NM_GSM_NETWORK_PREFER_GPRS_EDGE NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE + +typedef enum { + NM_SETTING_GSM_NETWORK_TYPE_ANY = -1, + NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA = 0, + NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE = 1, + NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA = 2, + NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE = 3 +} NMSettingGsmNetworkType; + +typedef enum { + NM_SETTING_GSM_BAND_UNKNOWN = 0x00000000, + NM_SETTING_GSM_BAND_ANY = 0x00000001, + NM_SETTING_GSM_BAND_EGSM = 0x00000002, /* 900 MHz */ + NM_SETTING_GSM_BAND_DCS = 0x00000004, /* 1800 MHz */ + NM_SETTING_GSM_BAND_PCS = 0x00000008, /* 1900 MHz */ + NM_SETTING_GSM_BAND_G850 = 0x00000010, /* 850 MHz */ + NM_SETTING_GSM_BAND_U2100 = 0x00000020, /* WCDMA 3GPP UMTS 2100 MHz (Class I) */ + NM_SETTING_GSM_BAND_U1800 = 0x00000040, /* WCDMA 3GPP UMTS 1800 MHz (Class III) */ + NM_SETTING_GSM_BAND_U17IV = 0x00000080, /* WCDMA 3GPP AWS 1700/2100 MHz (Class IV) */ + NM_SETTING_GSM_BAND_U800 = 0x00000100, /* WCDMA 3GPP UMTS 800 MHz (Class VI) */ + NM_SETTING_GSM_BAND_U850 = 0x00000200, /* WCDMA 3GPP UMTS 850 MHz (Class V) */ + NM_SETTING_GSM_BAND_U900 = 0x00000400, /* WCDMA 3GPP UMTS 900 MHz (Class VIII) */ + NM_SETTING_GSM_BAND_U17IX = 0x00000800, /* WCDMA 3GPP UMTS 1700 MHz (Class IX) */ + NM_SETTING_GSM_BAND_U1900 = 0x00001000, /* WCDMA 3GPP UMTS 1900 MHz (Class II) */ +} NMSettingGsmNetworkBand; + +typedef struct { + NMSetting parent; +} NMSettingGsm; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingGsmClass; + +GType nm_setting_gsm_get_type (void); + +NMSetting *nm_setting_gsm_new (void); +const char *nm_setting_gsm_get_number (NMSettingGsm *setting); +const char *nm_setting_gsm_get_username (NMSettingGsm *setting); +const char *nm_setting_gsm_get_password (NMSettingGsm *setting); +const char *nm_setting_gsm_get_apn (NMSettingGsm *setting); +const char *nm_setting_gsm_get_network_id (NMSettingGsm *setting); +int nm_setting_gsm_get_network_type (NMSettingGsm *setting); +guint32 nm_setting_gsm_get_allowed_bands (NMSettingGsm *setting); +const char *nm_setting_gsm_get_pin (NMSettingGsm *setting); +gboolean nm_setting_gsm_get_home_only (NMSettingGsm *setting); + +/* DEPRECATED & UNUSED */ +const char *nm_setting_gsm_get_puk (NMSettingGsm *setting); +int nm_setting_gsm_get_band (NMSettingGsm *setting); + +G_END_DECLS + +#endif /* NM_SETTING_GSM_H */ diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c new file mode 100644 index 00000000..186e41e2 --- /dev/null +++ b/libnm-util/nm-setting-ip4-config.c @@ -0,0 +1,1287 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include + +#include +#include "nm-setting-ip4-config.h" +#include "nm-param-spec-specialized.h" +#include "nm-utils.h" +#include "nm-dbus-glib-types.h" + +GQuark +nm_setting_ip4_config_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-ip4-config-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_ip4_config_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The specified property was not allowed in combination with the current 'method' */ + ENUM_ENTRY (NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, "NotAllowedForMethod"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingIP4ConfigError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingIP4Config, nm_setting_ip4_config, NM_TYPE_SETTING) + +#define NM_SETTING_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigPrivate)) + +typedef struct { + char *method; + GArray *dns; /* array of guint32; elements in network byte order */ + GSList *dns_search; /* list of strings */ + GSList *addresses; /* array of NMIP4Address */ + 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_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 +}; + +NMSetting * +nm_setting_ip4_config_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP4_CONFIG, NULL); +} + +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; +} + +guint32 +nm_setting_ip4_config_get_num_dns (NMSettingIP4Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), 0); + + return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns->len; +} + +guint32 +nm_setting_ip4_config_get_dns (NMSettingIP4Config *setting, guint32 i) +{ + NMSettingIP4ConfigPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), 0); + + priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); + g_return_val_if_fail (i <= priv->dns->len, 0); + + return g_array_index (priv->dns, guint32, i); +} + +gboolean +nm_setting_ip4_config_add_dns (NMSettingIP4Config *setting, guint32 dns) +{ + NMSettingIP4ConfigPrivate *priv; + int i; + + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE); + + priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); + for (i = 0; i < priv->dns->len; i++) { + if (dns == g_array_index (priv->dns, guint32, i)) + return FALSE; + } + + g_array_append_val (priv->dns, dns); + return TRUE; +} + +void +nm_setting_ip4_config_remove_dns (NMSettingIP4Config *setting, guint32 i) +{ + NMSettingIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting)); + + priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); + g_return_if_fail (i <= priv->dns->len); + + g_array_remove_index (priv->dns, i); +} + +void +nm_setting_ip4_config_clear_dns (NMSettingIP4Config *setting) +{ + NMSettingIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting)); + + priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); + g_array_remove_range (priv->dns, 0, priv->dns->len); +} + +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); +} + +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); +} + +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)); + return TRUE; +} + +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); +} + +void +nm_setting_ip4_config_clear_dns_searches (NMSettingIP4Config *setting) +{ + g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting)); + + nm_utils_slist_free (NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns_search, g_free); + NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dns_search = NULL; +} + +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); +} + +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); +} + +gboolean +nm_setting_ip4_config_add_address (NMSettingIP4Config *setting, + NMIP4Address *address) +{ + 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); + + 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); + g_return_val_if_fail (copy != NULL, FALSE); + + priv->addresses = g_slist_append (priv->addresses, copy); + return TRUE; +} + +void +nm_setting_ip4_config_remove_address (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->addresses, i); + g_return_if_fail (elt != NULL); + + nm_ip4_address_unref ((NMIP4Address *) elt->data); + priv->addresses = g_slist_delete_link (priv->addresses, elt); +} + +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)); + + nm_utils_slist_free (priv->addresses, (GDestroyNotify) nm_ip4_address_unref); + priv->addresses = NULL; +} + +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); +} + +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); +} + +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); + g_return_val_if_fail (copy != NULL, FALSE); + + priv->routes = g_slist_append (priv->routes, copy); + return TRUE; +} + +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); +} + +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)); + + nm_utils_slist_free (priv->routes, (GDestroyNotify) nm_ip4_route_unref); + priv->routes = NULL; +} + +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; +} + +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; +} + +const char * +nm_setting_ip4_config_get_dhcp_client_id (NMSettingIP4Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE); + + return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_client_id; +} + +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; +} + +const char * +nm_setting_ip4_config_get_dhcp_hostname (NMSettingIP4Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE); + + return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_hostname; +} + +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; +} + +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 (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); + GSList *iter; + int i; + + if (!priv->method) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_MISSING_PROPERTY, + NM_SETTING_IP4_CONFIG_METHOD); + return FALSE; + } + + if (!strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) { + if (!priv->addresses) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_MISSING_PROPERTY, + NM_SETTING_IP4_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 && priv->dns->len) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, + NM_SETTING_IP4_CONFIG_DNS); + return FALSE; + } + + if (g_slist_length (priv->dns_search)) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, + NM_SETTING_IP4_CONFIG_DNS_SEARCH); + return FALSE; + } + + if (g_slist_length (priv->addresses)) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, + NM_SETTING_IP4_CONFIG_ADDRESSES); + return FALSE; + } + } else if (!strcmp (priv->method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { + /* nothing to do */ + } else { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP4_CONFIG_METHOD); + return FALSE; + } + + if (priv->dhcp_client_id && !strlen (priv->dhcp_client_id)) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID); + return FALSE; + } + + if (priv->dhcp_hostname && !strlen (priv->dhcp_hostname)) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME); + return FALSE; + } + + /* Validate addresses */ + for (iter = priv->addresses, i = 0; iter; iter = g_slist_next (iter), i++) { + NMIP4Address *addr = (NMIP4Address *) iter->data; + guint32 prefix = nm_ip4_address_get_prefix (addr); + + if (!nm_ip4_address_get_address (addr)) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP4_CONFIG_ADDRESSES); + return FALSE; + } + + if (!prefix || prefix > 32) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP4_CONFIG_ADDRESSES); + 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_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP4_CONFIG_ROUTES); + return FALSE; + } + + if (!prefix || prefix > 32) { + g_set_error (error, + NM_SETTING_IP4_CONFIG_ERROR, + NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP4_CONFIG_ROUTES); + return FALSE; + } + } + + return TRUE; +} + + +static void +nm_setting_ip4_config_init (NMSettingIP4Config *setting) +{ + NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); + + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_IP4_CONFIG_SETTING_NAME, NULL); + + priv->dns = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); +} + +static void +finalize (GObject *object) +{ + NMSettingIP4Config *self = NM_SETTING_IP4_CONFIG (object); + NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (self); + + g_free (priv->method); + + g_array_free (priv->dns, TRUE); + + nm_utils_slist_free (priv->dns_search, g_free); + nm_utils_slist_free (priv->addresses, (GDestroyNotify) nm_ip4_address_unref); + nm_utils_slist_free (priv->routes, (GDestroyNotify) nm_ip4_route_unref); + + G_OBJECT_CLASS (nm_setting_ip4_config_parent_class)->finalize (object); +} + +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); + + switch (prop_id) { + case PROP_METHOD: + g_free (priv->method); + priv->method = g_value_dup_string (value); + break; + case PROP_DNS: + g_array_free (priv->dns, TRUE); + priv->dns = g_value_dup_boxed (value); + if (!priv->dns) + priv->dns = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); + break; + case PROP_DNS_SEARCH: + nm_utils_slist_free (priv->dns_search, g_free); + priv->dns_search = g_value_dup_boxed (value); + break; + case PROP_ADDRESSES: + nm_utils_slist_free (priv->addresses, (GDestroyNotify) nm_ip4_address_unref); + priv->addresses = nm_utils_ip4_addresses_from_gvalue (value); + break; + case PROP_ROUTES: + nm_utils_slist_free (priv->routes, (GDestroyNotify) nm_ip4_route_unref); + priv->routes = nm_utils_ip4_routes_from_gvalue (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_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); + /* FIXME: Is this a good idea? */ + if (priv->dhcp_hostname) + priv->dhcp_send_hostname = TRUE; + 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) +{ + NMSettingIP4Config *setting = NM_SETTING_IP4_CONFIG (object); + NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_METHOD: + g_value_set_string (value, nm_setting_ip4_config_get_method (setting)); + break; + case PROP_DNS: + g_value_set_boxed (value, priv->dns); + break; + case PROP_DNS_SEARCH: + g_value_set_boxed (value, priv->dns_search); + break; + case PROP_ADDRESSES: + nm_utils_ip4_addresses_to_gvalue (priv->addresses, value); + break; + case PROP_ROUTES: + nm_utils_ip4_routes_to_gvalue (priv->routes, value); + 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); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *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 (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, + "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.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP4Config:dns: + * + * List of DNS servers (network byte order). 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 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, + _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS, + "DNS", + "List of DNS servers (network byte order). 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 usptream network. In all " + "other methods, these DNS servers are used as the " + "only DNS servers for this connection.", + DBUS_TYPE_G_UINT_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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, + _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS_SEARCH, + "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.", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP4Config:addresses: + * + * 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. + **/ + g_object_class_install_property + (object_class, PROP_ADDRESSES, + _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ADDRESSES, + "Addresses", + "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.", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP4Config:routes: + * + * 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. 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. + **/ + g_object_class_install_property + (object_class, PROP_ROUTES, + _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ROUTES, + "Routes", + "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. " + "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 " + "as there is no upstream network.", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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 + * #NMSettingIP4Config:routes, 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, + "Ignore automatic routes", + "When the method is set to 'auto' and this property " + "to TRUE, automatically configured routes are " + "ignored and only routes specified in the 'routes' " + "property, if any, are used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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 #NMSettingIP4Config:dns and + * #NMSettingIP4Config:dns-search, 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, + "Ignore automatic 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 'dns' and 'dns-search' " + "properties, if any, are used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP4Config:dhcp-client-id: + * + * A string sent to the DHCP server to identify the local machine which the + * DHCP server may use to cusomize 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, + "DHCP Client ID", + "A string sent to the DHCP server to identify the " + "local machine which the DHCP server may use to " + "cusomize the DHCP lease and options.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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 + * #NMSettingIP4Config:dhcp-hostname 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, + "Send DHCP hostname", + "If TRUE, a hostname is sent to the DHCP server when " + "acquiring a lease. Some DHCP servers use this " + "hostname to update DNS databases, essentially " + "providing a static hostname for the computer. If " + "the 'dhcp-hostname' property is empty and this " + "property is TRUE, the current persistent hostname " + "of the computer is sent.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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, + "DHCP Hostname", + "If the 'dhcp-send-hostname' property is TRUE, then " + "the specified name will be sent to the DHCP server " + "when acquiring a lease.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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, + "Never default", + "If TRUE, this connection will never be the default " + "IPv4 connection, meaning it will never be assigned " + "the default route by NetworkManager.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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, + "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.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); +} + + +struct NMIP4Address { + guint32 refcount; + guint32 address; /* network byte order */ + guint32 prefix; + guint32 gateway; /* network byte order */ +}; + +NMIP4Address * +nm_ip4_address_new (void) +{ + NMIP4Address *address; + + address = g_malloc0 (sizeof (NMIP4Address)); + address->refcount = 1; + return address; +} + +NMIP4Address * +nm_ip4_address_dup (NMIP4Address *source) +{ + NMIP4Address *address; + + g_return_val_if_fail (source != NULL, NULL); + g_return_val_if_fail (source->refcount > 0, NULL); + + address = nm_ip4_address_new (); + address->address = source->address; + address->prefix = source->prefix; + address->gateway = source->gateway; + + return address; +} + +void +nm_ip4_address_ref (NMIP4Address *address) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + + address->refcount++; +} + +void +nm_ip4_address_unref (NMIP4Address *address) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + + address->refcount--; + if (address->refcount == 0) { + memset (address, 0, sizeof (NMIP4Address)); + g_free (address); + } +} + +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; +} + +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; +} + +void +nm_ip4_address_set_address (NMIP4Address *address, guint32 addr) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + + address->address = addr; +} + +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); + + return address->prefix; +} + +void +nm_ip4_address_set_prefix (NMIP4Address *address, guint32 prefix) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + + address->prefix = prefix; +} + +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); + + return address->gateway; +} + +void +nm_ip4_address_set_gateway (NMIP4Address *address, guint32 gateway) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + + address->gateway = gateway; +} + + +struct NMIP4Route { + guint32 refcount; + + guint32 dest; /* network byte order */ + guint32 prefix; + guint32 next_hop; /* network byte order */ + guint32 metric; /* lower metric == more preferred */ +}; + +NMIP4Route * +nm_ip4_route_new (void) +{ + NMIP4Route *route; + + route = g_malloc0 (sizeof (NMIP4Route)); + route->refcount = 1; + return route; +} + +NMIP4Route * +nm_ip4_route_dup (NMIP4Route *source) +{ + NMIP4Route *route; + + g_return_val_if_fail (source != NULL, NULL); + g_return_val_if_fail (source->refcount > 0, NULL); + + 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; +} + +void +nm_ip4_route_ref (NMIP4Route *route) +{ + g_return_if_fail (route != NULL); + g_return_if_fail (route->refcount > 0); + + route->refcount++; +} + +void +nm_ip4_route_unref (NMIP4Route *route) +{ + g_return_if_fail (route != NULL); + g_return_if_fail (route->refcount > 0); + + route->refcount--; + if (route->refcount == 0) { + memset (route, 0, sizeof (NMIP4Route)); + g_free (route); + } +} + +gboolean +nm_ip4_route_compare (NMIP4Route *route, NMIP4Route *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->dest != other->dest + || route->prefix != other->prefix + || route->next_hop != other->next_hop + || route->metric != other->metric) + return FALSE; + return TRUE; +} + +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; +} + +void +nm_ip4_route_set_dest (NMIP4Route *route, guint32 dest) +{ + g_return_if_fail (route != NULL); + g_return_if_fail (route->refcount > 0); + + route->dest = dest; +} + +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; +} + +void +nm_ip4_route_set_prefix (NMIP4Route *route, guint32 prefix) +{ + g_return_if_fail (route != NULL); + g_return_if_fail (route->refcount > 0); + + route->prefix = prefix; +} + +guint32 +nm_ip4_route_get_next_hop (NMIP4Route *route) +{ + g_return_val_if_fail (route != NULL, 0); + g_return_val_if_fail (route->refcount > 0, 0); + + return route->next_hop; +} + +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); + + route->next_hop = next_hop; +} + +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); + + return route->metric; +} + +void +nm_ip4_route_set_metric (NMIP4Route *route, guint32 metric) +{ + g_return_if_fail (route != NULL); + g_return_if_fail (route->refcount > 0); + + route->metric = metric; +} + diff --git a/libnm-util/nm-setting-ip4-config.h b/libnm-util/nm-setting-ip4-config.h new file mode 100644 index 00000000..80ddd475 --- /dev/null +++ b/libnm-util/nm-setting-ip4-config.h @@ -0,0 +1,177 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_IP4_CONFIG_H +#define NM_SETTING_IP4_CONFIG_H + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_IP4_CONFIG (nm_setting_ip4_config_get_type ()) +#define NM_SETTING_IP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4Config)) +#define NM_SETTING_IP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_IP4CONFIG, NMSettingIP4ConfigClass)) +#define NM_IS_SETTING_IP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_IP4_CONFIG)) +#define NM_IS_SETTING_IP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_IP4_CONFIG)) +#define NM_SETTING_IP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigClass)) + +#define NM_SETTING_IP4_CONFIG_SETTING_NAME "ipv4" + +typedef enum +{ + NM_SETTING_IP4_CONFIG_ERROR_UNKNOWN = 0, + NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP4_CONFIG_ERROR_MISSING_PROPERTY, + NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD +} NMSettingIP4ConfigError; + +#define NM_TYPE_SETTING_IP4_CONFIG_ERROR (nm_setting_ip4_config_error_get_type ()) +GType nm_setting_ip4_config_error_get_type (void); + +#define NM_SETTING_IP4_CONFIG_ERROR nm_setting_ip4_config_error_quark () +GQuark nm_setting_ip4_config_error_quark (void); + +#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" + +#define NM_SETTING_IP4_CONFIG_METHOD_AUTO "auto" +#define NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL "link-local" +#define NM_SETTING_IP4_CONFIG_METHOD_MANUAL "manual" +#define NM_SETTING_IP4_CONFIG_METHOD_SHARED "shared" +#define NM_SETTING_IP4_CONFIG_METHOD_DISABLED "disabled" + +typedef struct NMIP4Address NMIP4Address; + +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; + +NMIP4Route * nm_ip4_route_new (void); +NMIP4Route * nm_ip4_route_dup (NMIP4Route *route); +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); + + +typedef struct { + NMSetting parent; +} NMSettingIP4Config; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingIP4ConfigClass; + +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); +guint32 nm_setting_ip4_config_get_dns (NMSettingIP4Config *setting, guint32 i); +gboolean nm_setting_ip4_config_add_dns (NMSettingIP4Config *setting, guint32 dns); +void nm_setting_ip4_config_remove_dns (NMSettingIP4Config *setting, guint32 i); +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); +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); +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); +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); + +G_END_DECLS + +#endif /* NM_SETTING_IP4_CONFIG_H */ diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c new file mode 100644 index 00000000..32c3a4a2 --- /dev/null +++ b/libnm-util/nm-setting-ip6-config.c @@ -0,0 +1,1120 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * David Cantrell + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + */ + +#include + +#include +#include "nm-setting-ip6-config.h" +#include "nm-param-spec-specialized.h" +#include "nm-utils.h" +#include "nm-dbus-glib-types.h" + +GQuark +nm_setting_ip6_config_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-ip6-config-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_ip6_config_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The specified property was not allowed in combination with the current 'method' */ + ENUM_ENTRY (NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, "NotAllowedForMethod"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingIP6ConfigError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING) + +#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate)) + +typedef struct { + char *method; + 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; +} NMSettingIP6ConfigPrivate; + + +enum { + PROP_0, + PROP_METHOD, + PROP_DNS, + PROP_DNS_SEARCH, + PROP_ADDRESSES, + PROP_ROUTES, + PROP_IGNORE_AUTO_ROUTES, + PROP_IGNORE_AUTO_DNS, + PROP_NEVER_DEFAULT, + PROP_MAY_FAIL, + + LAST_PROP +}; + +NMSetting * +nm_setting_ip6_config_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP6_CONFIG, NULL); +} + +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; +} + +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); +} + +const struct in6_addr * +nm_setting_ip6_config_get_dns (NMSettingIP6Config *setting, guint32 i) +{ + NMSettingIP6ConfigPrivate *priv; + + + g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0); + + priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting); + g_return_val_if_fail (i <= g_slist_length (priv->dns), NULL); + + return (const struct in6_addr *) g_slist_nth_data (priv->dns, i); +} + +gboolean +nm_setting_ip6_config_add_dns (NMSettingIP6Config *setting, const struct in6_addr *addr) +{ + NMSettingIP6ConfigPrivate *priv; + struct in6_addr *copy; + GSList *iter; + + g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE); + + priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting); + for (iter = priv->dns; iter; iter = g_slist_next (iter)) { + if (!memcmp (addr, (struct in6_addr *) iter->data, sizeof (struct in6_addr))) + return FALSE; + } + + copy = g_malloc0 (sizeof (struct in6_addr)); + memcpy (copy, addr, sizeof (struct in6_addr)); + priv->dns = g_slist_append (priv->dns, copy); + + return TRUE; +} + +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); +} + +void +nm_setting_ip6_config_clear_dns (NMSettingIP6Config *setting) +{ + g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting)); + + nm_utils_slist_free (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns, g_free); + NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns = NULL; +} + +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); +} + +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); +} + +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)); + return TRUE; +} + +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); +} + +void +nm_setting_ip6_config_clear_dns_searches (NMSettingIP6Config *setting) +{ + g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting)); + + nm_utils_slist_free (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns_search, g_free); + NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns_search = NULL; +} + +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); +} + +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); +} + +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); + g_return_val_if_fail (copy != NULL, FALSE); + + priv->addresses = g_slist_append (priv->addresses, copy); + return TRUE; +} + +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); +} + +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)); + + nm_utils_slist_free (priv->addresses, (GDestroyNotify) nm_ip6_address_unref); + priv->addresses = NULL; +} + +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); +} + +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); +} + +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); + g_return_val_if_fail (copy != NULL, FALSE); + + priv->routes = g_slist_append (priv->routes, copy); + return TRUE; +} + +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); +} + +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)); + + nm_utils_slist_free (priv->routes, (GDestroyNotify) nm_ip6_route_unref); + priv->routes = NULL; +} + +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; +} + +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; +} + +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; +} + +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; +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting); + + if (!priv->method) { + g_set_error (error, + NM_SETTING_IP6_CONFIG_ERROR, + NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY, + NM_SETTING_IP6_CONFIG_METHOD); + return FALSE; + } + + if (!strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + if (!priv->addresses) { + g_set_error (error, + NM_SETTING_IP6_CONFIG_ERROR, + NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY, + NM_SETTING_IP6_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 (g_slist_length (priv->dns)) { + g_set_error (error, + NM_SETTING_IP6_CONFIG_ERROR, + NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, + NM_SETTING_IP6_CONFIG_DNS); + return FALSE; + } + + if (g_slist_length (priv->dns_search)) { + g_set_error (error, + NM_SETTING_IP6_CONFIG_ERROR, + NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, + NM_SETTING_IP6_CONFIG_DNS_SEARCH); + return FALSE; + } + + if (g_slist_length (priv->addresses)) { + g_set_error (error, + NM_SETTING_IP6_CONFIG_ERROR, + NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD, + NM_SETTING_IP6_CONFIG_ADDRESSES); + return FALSE; + } + } else if (!strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + /* nothing to do */ + } else { + g_set_error (error, + NM_SETTING_IP6_CONFIG_ERROR, + NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP6_CONFIG_METHOD); + return FALSE; + } + + return TRUE; +} + + +static void +nm_setting_ip6_config_init (NMSettingIP6Config *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_IP6_CONFIG_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object); + + g_free (priv->method); + + if (priv->dns) + g_slist_free (priv->dns); + + nm_utils_slist_free (priv->dns_search, g_free); + nm_utils_slist_free (priv->addresses, g_free); + nm_utils_slist_free (priv->routes, g_free); + + G_OBJECT_CLASS (nm_setting_ip6_config_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + 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: + nm_utils_slist_free (priv->dns, g_free); + priv->dns = nm_utils_ip6_dns_from_gvalue (value); + break; + case PROP_DNS_SEARCH: + nm_utils_slist_free (priv->dns_search, g_free); + priv->dns_search = g_value_dup_boxed (value); + break; + case PROP_ADDRESSES: + nm_utils_slist_free (priv->addresses, g_free); + priv->addresses = nm_utils_ip6_addresses_from_gvalue (value); + break; + case PROP_ROUTES: + nm_utils_slist_free (priv->routes, g_free); + priv->routes = nm_utils_ip6_routes_from_gvalue (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_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) +{ + 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: + nm_utils_ip6_dns_to_gvalue (priv->dns, value); + break; + case PROP_DNS_SEARCH: + g_value_set_boxed (value, priv->dns_search); + break; + case PROP_ADDRESSES: + nm_utils_ip6_addresses_to_gvalue (priv->addresses, value); + break; + case PROP_ROUTES: + nm_utils_ip6_routes_to_gvalue (priv->routes, value); + 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_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 +nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *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 (NMSettingIP6ConfigPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + /** + * NMSettingIP6Config:method: + * + * IPv6 configuration method. If 'auto' is specified then the appropriate + * automatic method (DHCP, PPP, router advertisement, etc) is used for the + * interface and most other properties can be left unset. 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 + * 'ignored' is specified, IPv6 configuration is not done. This property + * must be set. NOTE: the 'shared' method are not yet supported. + **/ + g_object_class_install_property + (object_class, PROP_METHOD, + g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD, + "Method", + "IPv6 configuration method. If 'auto' is specified " + "then the appropriate automatic method (DHCP, PPP, " + "router advertisement, etc) is used for the " + "interface and most other properties can be left " + "unset. 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 " + "'ignored' is specified, IPv6 configuration is not " + "done. This property must be set. NOTE: the " + "'shared' method are not yet supported.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP6Config:dns: + * + * Array of DNS servers, where each member of the array is a byte array + * containing the IPv6 address of the DNS server (in network byte order). + * 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, + _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_DNS, + "DNS", + "Array of DNS servers, where each member of the " + "array is a byte array containing the IPv6 address " + "of the DNS server (in network byte order). 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.", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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, + _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_DNS_SEARCH, + "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.", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP6Config:addresses: + * + * Array of IPv6 address structures. Each IPv6 address structure is + * composed of 3 members, the first being a byte array containing the IPv6 + * address (network byte order), the second a 32-bit integer containing the + * IPv6 address prefix, and the third a byte array containing the IPv6 + * address (network byte order) of the gateway associated with this address, + * if any. If no gateway is given, the third element should be given as + * all zeros. 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. + **/ + g_object_class_install_property + (object_class, PROP_ADDRESSES, + _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ADDRESSES, + "Addresses", + "Array of IPv6 address structures. Each IPv6 " + "address structure is composed of 3 members, the " + "first being a byte array containing the IPv6 " + "address (network byte order), the second a " + "32-bit integer containing the IPv6 address " + "prefix, and the third a byte array containing " + "the IPv6 address (network byte order) of the " + "gateway associated with this address, if any. " + "If no gateway is given, the third element should " + "be given as all zeros. 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.", + DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP6Config:routes: + * + * Array of IPv6 route structures. Each IPv6 route structure is composed + * of 4 members; the first being the destination IPv6 network or + * address (network byte order) as a byte array, the second the destination + * network or address IPv6 prefix, the third being the next-hop IPv6 address + * (network byte order) if any, and the fourth being the route metric. 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. + **/ + g_object_class_install_property + (object_class, PROP_ROUTES, + _nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ROUTES, + "Routes", + "Array of IPv6 route structures. Each IPv6 route " + "structure is composed of 4 members; the first " + "being the destination IPv6 network or address " + "(network byte order) as a byte array, the second " + "the destination network or address IPv6 prefix, " + "the third being the next-hop IPv6 address " + "(network byte order) if any, and the fourth " + "being the route metric. 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.", + DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP6Config:ignore-auto-routes: + * + * When the method is set to 'auto' and this property is set to TRUE, + * automatically configured routes are ignored and only routes specified + * in #NMSettingIP6Config:routes, 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, + "Ignore automatic routes", + "When the method is set to 'auto' and this property " + "is set to TRUE, automatically configured routes are " + "ignored and only routes specified in the 'routes' " + "property, if any, are used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingIP6Config:ignore-auto-dns: + * + * When the method is set to 'auto' and this property is set to TRUE, + * automatically configured nameservers and search domains are ignored + * and only nameservers and search domains specified in + * #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search, 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, + "Ignore DHCPv6/RDNSS DNS", + "When the method is set to 'auto' and this property " + "is set to TRUE, automatically configured nameservers " + "and search domains are ignored and only nameservers " + "and search domains specified in 'dns' and 'dns-search' " + "properties, if any, are used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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, + "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.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * 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, + "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.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); +} + +/********************************************************************/ + +struct NMIP6Address { + guint32 refcount; + struct in6_addr address; + guint32 prefix; + struct in6_addr gateway; +}; + +NMIP6Address * +nm_ip6_address_new (void) +{ + NMIP6Address *address; + + address = g_malloc0 (sizeof (NMIP6Address)); + address->refcount = 1; + return address; +} + +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; +} + +void +nm_ip6_address_ref (NMIP6Address *address) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + + address->refcount++; +} + +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); + } +} + +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; +} + +const struct in6_addr * +nm_ip6_address_get_address (NMIP6Address *address) +{ + g_return_val_if_fail (address != NULL, 0); + g_return_val_if_fail (address->refcount > 0, 0); + + return &address->address; +} + +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)); +} + +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; +} + +void +nm_ip6_address_set_prefix (NMIP6Address *address, guint32 prefix) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + + address->prefix = prefix; +} + +const struct in6_addr * +nm_ip6_address_get_gateway (NMIP6Address *address) +{ + g_return_val_if_fail (address != NULL, 0); + g_return_val_if_fail (address->refcount > 0, 0); + + return &address->gateway; +} + +void +nm_ip6_address_set_gateway (NMIP6Address *address, const struct in6_addr *gw) +{ + g_return_if_fail (address != NULL); + g_return_if_fail (address->refcount > 0); + g_return_if_fail (gw != NULL); + + memcpy (&address->gateway, gw, 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 */ +}; + +NMIP6Route * +nm_ip6_route_new (void) +{ + NMIP6Route *route; + + route = g_malloc0 (sizeof (NMIP6Route)); + route->refcount = 1; + return route; +} + +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; +} + +void +nm_ip6_route_ref (NMIP6Route *route) +{ + g_return_if_fail (route != NULL); + g_return_if_fail (route->refcount > 0); + + route->refcount++; +} + +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); + } +} + +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; +} + +const struct in6_addr * +nm_ip6_route_get_dest (NMIP6Route *route) +{ + g_return_val_if_fail (route != NULL, 0); + g_return_val_if_fail (route->refcount > 0, 0); + + return &route->dest; +} + +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)); +} + +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; +} + +void +nm_ip6_route_set_prefix (NMIP6Route *route, guint32 prefix) +{ + g_return_if_fail (route != NULL); + g_return_if_fail (route->refcount > 0); + + route->prefix = prefix; +} + +const struct in6_addr * +nm_ip6_route_get_next_hop (NMIP6Route *route) +{ + g_return_val_if_fail (route != NULL, 0); + g_return_val_if_fail (route->refcount > 0, 0); + + return &route->next_hop; +} + +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)); +} + +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; +} + +void +nm_ip6_route_set_metric (NMIP6Route *route, guint32 metric) +{ + g_return_if_fail (route != NULL); + g_return_if_fail (route->refcount > 0); + + route->metric = metric; +} diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h new file mode 100644 index 00000000..06e5c5c1 --- /dev/null +++ b/libnm-util/nm-setting-ip6-config.h @@ -0,0 +1,170 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * David Cantrell + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + */ + +#ifndef NM_SETTING_IP6_CONFIG_H +#define NM_SETTING_IP6_CONFIG_H + +#include + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_IP6_CONFIG (nm_setting_ip6_config_get_type ()) +#define NM_SETTING_IP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6Config)) +#define NM_SETTING_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_IP6CONFIG, NMSettingIP6ConfigClass)) +#define NM_IS_SETTING_IP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_IP6_CONFIG)) +#define NM_IS_SETTING_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_IP6_CONFIG)) +#define NM_SETTING_IP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigClass)) + +#define NM_SETTING_IP6_CONFIG_SETTING_NAME "ipv6" + +typedef enum +{ + NM_SETTING_IP6_CONFIG_ERROR_UNKNOWN = 0, + NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY, + NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY, + NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD +} NMSettingIP6ConfigError; + +#define NM_TYPE_SETTING_IP6_CONFIG_ERROR (nm_setting_ip6_config_error_get_type ()) +GType nm_setting_ip6_config_error_get_type (void); + +#define NM_SETTING_IP6_CONFIG_ERROR nm_setting_ip6_config_error_quark () +GQuark nm_setting_ip6_config_error_quark (void); + +#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_METHOD_IGNORE "ignore" +#define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto" +#define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local" +#define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual" +#define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared" + + +typedef struct NMIP6Address NMIP6Address; + +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 *gw); + +typedef struct NMIP6Route NMIP6Route; + +NMIP6Route * nm_ip6_route_new (void); +NMIP6Route * nm_ip6_route_dup (NMIP6Route *route); +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); + +typedef struct { + NMSetting parent; +} NMSettingIP6Config; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingIP6ConfigClass; + +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 struct in6_addr *nm_setting_ip6_config_get_dns (NMSettingIP6Config *setting, guint32 i); +gboolean nm_setting_ip6_config_add_dns (NMSettingIP6Config *setting, const struct in6_addr *dns); +void nm_setting_ip6_config_remove_dns (NMSettingIP6Config *setting, guint32 i); +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); +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); +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); +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); +gboolean nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting); +gboolean nm_setting_ip6_config_get_may_fail (NMSettingIP6Config *setting); + +G_END_DECLS + +#endif /* NM_SETTING_IP6_CONFIG_H */ diff --git a/libnm-util/nm-setting-olpc-mesh.c b/libnm-util/nm-setting-olpc-mesh.c new file mode 100644 index 00000000..1653bb07 --- /dev/null +++ b/libnm-util/nm-setting-olpc-mesh.c @@ -0,0 +1,296 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Dan Williams + * Tambet Ingo + * Sjoerd Simons + * Daniel Drake + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + * (C) Copyright 2009 One Laptop per Child + */ + +#include +#include +#include + +#include "NetworkManager.h" +#include "nm-setting-olpc-mesh.h" +#include "nm-param-spec-specialized.h" +#include "nm-utils.h" +#include "nm-dbus-glib-types.h" +#include "nm-utils-private.h" + +GQuark +nm_setting_olpc_mesh_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-olpc-mesh-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_olpc_mesh_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY, "MissingProperty"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingOlpcMeshError", values); + } + return etype; +} + +static void nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting); + +G_DEFINE_TYPE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING) + +#define NM_SETTING_OLPC_MESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMeshPrivate)) + +typedef struct { + GByteArray *ssid; + guint32 channel; + GByteArray *dhcp_anycast_addr; +} NMSettingOlpcMeshPrivate; + +enum { + PROP_0, + PROP_SSID, + PROP_CHANNEL, + PROP_DHCP_ANYCAST_ADDRESS, + + LAST_PROP +}; + +/** + * nm_setting_olpc_mesh_new: + * + * Creates a new #NMSettingOlpcMesh object with default values. + * + * Returns: the new empty #NMSettingOlpcMesh object + **/ +NMSetting *nm_setting_olpc_mesh_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_OLPC_MESH, NULL); +} + +static void +nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_OLPC_MESH_SETTING_NAME, NULL); +} + +const GByteArray * +nm_setting_olpc_mesh_get_ssid (NMSettingOlpcMesh *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_OLPC_MESH (setting), NULL); + + return NM_SETTING_OLPC_MESH_GET_PRIVATE (setting)->ssid; +} + +guint32 +nm_setting_olpc_mesh_get_channel (NMSettingOlpcMesh *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_OLPC_MESH (setting), 0); + + return NM_SETTING_OLPC_MESH_GET_PRIVATE (setting)->channel; +} + +const GByteArray * +nm_setting_olpc_mesh_get_dhcp_anycast_address (NMSettingOlpcMesh *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_OLPC_MESH (setting), NULL); + + return NM_SETTING_OLPC_MESH_GET_PRIVATE (setting)->dhcp_anycast_addr; +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingOlpcMeshPrivate *priv = NM_SETTING_OLPC_MESH_GET_PRIVATE (setting); + + if (!priv->ssid) { + g_set_error (error, + NM_SETTING_OLPC_MESH_ERROR, + NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY, + NM_SETTING_OLPC_MESH_SSID); + return FALSE; + } + + if (!priv->ssid->len || priv->ssid->len > 32) { + g_set_error (error, + NM_SETTING_OLPC_MESH_ERROR, + NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY, + NM_SETTING_OLPC_MESH_SSID); + return FALSE; + } + + if (priv->channel == 0 || priv->channel > 13) { + g_set_error (error, + NM_SETTING_OLPC_MESH_ERROR, + NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY, + NM_SETTING_OLPC_MESH_CHANNEL); + return FALSE; + } + + if (priv->dhcp_anycast_addr && priv->dhcp_anycast_addr->len != ETH_ALEN) { + g_set_error (error, + NM_SETTING_OLPC_MESH_ERROR, + NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY, + NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS); + return FALSE; + } + + return TRUE; +} + +static void +finalize (GObject *object) +{ + NMSettingOlpcMeshPrivate *priv = NM_SETTING_OLPC_MESH_GET_PRIVATE (object); + + if (priv->ssid) + g_byte_array_free (priv->ssid, TRUE); + if (priv->dhcp_anycast_addr) + g_byte_array_free (priv->dhcp_anycast_addr, TRUE); + + G_OBJECT_CLASS (nm_setting_olpc_mesh_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingOlpcMeshPrivate *priv = NM_SETTING_OLPC_MESH_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_SSID: + if (priv->ssid) + g_byte_array_free (priv->ssid, TRUE); + priv->ssid = g_value_dup_boxed (value); + break; + case PROP_CHANNEL: + priv->channel = g_value_get_uint (value); + break; + case PROP_DHCP_ANYCAST_ADDRESS: + if (priv->dhcp_anycast_addr) + g_byte_array_free (priv->dhcp_anycast_addr, TRUE); + priv->dhcp_anycast_addr = g_value_dup_boxed (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingOlpcMesh *setting = NM_SETTING_OLPC_MESH (object); + + switch (prop_id) { + case PROP_SSID: + g_value_set_boxed (value, nm_setting_olpc_mesh_get_ssid (setting)); + break; + case PROP_CHANNEL: + g_value_set_uint (value, nm_setting_olpc_mesh_get_channel (setting)); + break; + case PROP_DHCP_ANYCAST_ADDRESS: + g_value_set_boxed (value, nm_setting_olpc_mesh_get_dhcp_anycast_address (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_olpc_mesh_class_init (NMSettingOlpcMeshClass *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 (NMSettingOlpcMeshPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + /** + * NMSettingOlpcMesh:ssid: + * + * SSID of the mesh network to join. + **/ + g_object_class_install_property + (object_class, PROP_SSID, + _nm_param_spec_specialized (NM_SETTING_OLPC_MESH_SSID, + "SSID", + "SSID of the mesh network to join.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingOlpcMesh:channel: + * + * Channel on which the mesh network to join is located. + **/ + g_object_class_install_property + (object_class, PROP_CHANNEL, + g_param_spec_uint (NM_SETTING_OLPC_MESH_CHANNEL, + "Channel", + "Channel on which the mesh network to join is located.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingOlpcMesh:dhcp-anycast-address: + * + * Anycast DHCP address used when requesting an IP address via DHCP. The + * specific anycast address used determines which DHCP server class answers + * the request. + **/ + g_object_class_install_property + (object_class, PROP_DHCP_ANYCAST_ADDRESS, + _nm_param_spec_specialized (NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS, + "Anycast DHCP MAC address", + "Anycast DHCP MAC address used when " + "requesting an IP address via DHCP. The " + "specific anycast address used determines " + "which DHCP server class answers the " + "the request.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + +} diff --git a/libnm-util/nm-setting-olpc-mesh.h b/libnm-util/nm-setting-olpc-mesh.h new file mode 100644 index 00000000..84abd126 --- /dev/null +++ b/libnm-util/nm-setting-olpc-mesh.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Dan Williams + * Tambet Ingo + * Sjoerd Simons + * Daniel Drake + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + * (C) Copyright 2009 One Laptop per Child + */ + +#ifndef NM_SETTING_OLPC_MESH_H +#define NM_SETTING_OLPC_MESH_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_OLPC_MESH (nm_setting_olpc_mesh_get_type ()) +#define NM_SETTING_OLPC_MESH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMesh)) +#define NM_SETTING_OLPC_MESH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMeshClass)) +#define NM_IS_SETTING_OLPC_MESH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_OLPC_MESH)) +#define NM_IS_SETTING_OLPC_MESH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_OLPC_MESH)) +#define NM_SETTING_OLPC_MESH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMeshClass)) + +#define NM_SETTING_OLPC_MESH_SETTING_NAME "802-11-olpc-mesh" + +typedef enum +{ + NM_SETTING_OLPC_MESH_ERROR_UNKNOWN = 0, + NM_SETTING_OLPC_MESH_ERROR_INVALID_PROPERTY, + NM_SETTING_OLPC_MESH_ERROR_MISSING_PROPERTY +} NMSettingOlpcMeshError; + +#define NM_TYPE_SETTING_OLPC_MESH_ERROR (nm_setting_olpc_mesh_error_get_type ()) +GType nm_setting_olpc_mesh_error_get_type (void); + +#define NM_SETTING_OLPC_MESH_ERROR nm_setting_olpc_mesh_error_quark () +GQuark nm_setting_olpc_mesh_error_quark (void); + +#define NM_SETTING_OLPC_MESH_SSID "ssid" +#define NM_SETTING_OLPC_MESH_CHANNEL "channel" +#define NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS "dhcp-anycast-address" + +typedef struct { + NMSetting parent; +} NMSettingOlpcMesh; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingOlpcMeshClass; + +GType nm_setting_olpc_mesh_get_type (void); + +NMSetting * nm_setting_olpc_mesh_new (void); +const GByteArray *nm_setting_olpc_mesh_get_ssid (NMSettingOlpcMesh *setting); +guint32 nm_setting_olpc_mesh_get_channel (NMSettingOlpcMesh *setting); +const GByteArray *nm_setting_olpc_mesh_get_dhcp_anycast_address (NMSettingOlpcMesh *setting); + +G_END_DECLS + +#endif /* NM_SETTING_OLPC_MESH_H */ diff --git a/libnm-util/nm-setting-ppp.c b/libnm-util/nm-setting-ppp.c new file mode 100644 index 00000000..fd6043f1 --- /dev/null +++ b/libnm-util/nm-setting-ppp.c @@ -0,0 +1,730 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include "nm-setting-ppp.h" + +GQuark +nm_setting_ppp_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-ppp-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_ppp_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_PPP_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_PPP_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_PPP_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The 'require-mppe' option is not allowed in conjunction with the specified authentication. */ + ENUM_ENTRY (NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED, "RequireMPPENotAllowed"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingPPPError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingPPP, nm_setting_ppp, NM_TYPE_SETTING) + +#define NM_SETTING_PPP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPP, NMSettingPPPPrivate)) + +typedef struct { + gboolean noauth; + gboolean refuse_eap; + gboolean refuse_pap; + gboolean refuse_chap; + gboolean refuse_mschap; + gboolean refuse_mschapv2; + gboolean nobsdcomp; + gboolean nodeflate; + gboolean no_vj_comp; + gboolean require_mppe; + gboolean require_mppe_128; + gboolean mppe_stateful; + gboolean crtscts; + guint32 baud; + guint32 mru; + guint32 mtu; + guint32 lcp_echo_failure; + guint32 lcp_echo_interval; +} NMSettingPPPPrivate; + +enum { + PROP_0, + PROP_NOAUTH, + PROP_REFUSE_EAP, + PROP_REFUSE_PAP, + PROP_REFUSE_CHAP, + PROP_REFUSE_MSCHAP, + PROP_REFUSE_MSCHAPV2, + PROP_NOBSDCOMP, + PROP_NODEFLATE, + PROP_NO_VJ_COMP, + PROP_REQUIRE_MPPE, + PROP_REQUIRE_MPPE_128, + PROP_MPPE_STATEFUL, + PROP_CRTSCTS, + PROP_BAUD, + PROP_MRU, + PROP_MTU, + PROP_LCP_ECHO_FAILURE, + PROP_LCP_ECHO_INTERVAL, + + LAST_PROP +}; + +NMSetting * +nm_setting_ppp_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_PPP, NULL); +} + +gboolean +nm_setting_ppp_get_noauth (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->noauth; +} + +gboolean +nm_setting_ppp_get_refuse_eap (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->refuse_eap; +} + +gboolean +nm_setting_ppp_get_refuse_pap (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->refuse_pap; +} + +gboolean +nm_setting_ppp_get_refuse_chap (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->refuse_chap; +} + +gboolean +nm_setting_ppp_get_refuse_mschap (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->refuse_mschap; +} + +gboolean +nm_setting_ppp_get_refuse_mschapv2 (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->refuse_mschapv2; +} + +gboolean +nm_setting_ppp_get_nobsdcomp (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->nobsdcomp; +} + +gboolean +nm_setting_ppp_get_nodeflate (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->nodeflate; +} + +gboolean +nm_setting_ppp_get_no_vj_comp (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->no_vj_comp; +} + +gboolean +nm_setting_ppp_get_require_mppe (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->require_mppe; +} + +gboolean +nm_setting_ppp_get_require_mppe_128 (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->require_mppe_128; +} + +gboolean +nm_setting_ppp_get_mppe_stateful (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->mppe_stateful; +} + +gboolean +nm_setting_ppp_get_crtscts (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->crtscts; +} + +guint32 +nm_setting_ppp_get_baud (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), 0); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->baud; +} + +guint32 +nm_setting_ppp_get_mru (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), 0); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->mru; +} + +guint32 +nm_setting_ppp_get_mtu (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), 0); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->mtu; +} + +guint32 +nm_setting_ppp_get_lcp_echo_failure (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), 0); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->lcp_echo_failure; +} + +guint32 +nm_setting_ppp_get_lcp_echo_interval (NMSettingPPP *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPP (setting), 0); + + return NM_SETTING_PPP_GET_PRIVATE (setting)->lcp_echo_interval; +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingPPPPrivate *priv = NM_SETTING_PPP_GET_PRIVATE (setting); + + /* FIXME: Do we even want this or can we just let pppd evaluate the options? */ + if (priv->mru > 0) { + if (priv->mru < 128 || priv->mru > 16384) { + g_set_error (error, + NM_SETTING_PPP_ERROR, + NM_SETTING_PPP_ERROR_INVALID_PROPERTY, + NM_SETTING_PPP_MRU); + return FALSE; + } + } + + if (priv->lcp_echo_failure > 0) { + /* lcp_echo_interval must also be non-zero */ + if (priv->lcp_echo_interval == 0) { + g_set_error (error, + NM_SETTING_PPP_ERROR, + NM_SETTING_PPP_ERROR_INVALID_PROPERTY, + NM_SETTING_PPP_LCP_ECHO_FAILURE); + return FALSE; + } + } + + return TRUE; +} + +static void +nm_setting_ppp_init (NMSettingPPP *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_PPP_SETTING_NAME, NULL); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingPPPPrivate *priv = NM_SETTING_PPP_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_NOAUTH: + priv->noauth = g_value_get_boolean (value); + break; + case PROP_REFUSE_EAP: + priv->refuse_eap = g_value_get_boolean (value); + break; + case PROP_REFUSE_PAP: + priv->refuse_pap = g_value_get_boolean (value); + break; + case PROP_REFUSE_CHAP: + priv->refuse_chap = g_value_get_boolean (value); + break; + case PROP_REFUSE_MSCHAP: + priv->refuse_mschap = g_value_get_boolean (value); + break; + case PROP_REFUSE_MSCHAPV2: + priv->refuse_mschapv2 = g_value_get_boolean (value); + break; + case PROP_NOBSDCOMP: + priv->nobsdcomp = g_value_get_boolean (value); + break; + case PROP_NODEFLATE: + priv->nodeflate = g_value_get_boolean (value); + break; + case PROP_NO_VJ_COMP: + priv->no_vj_comp = g_value_get_boolean (value); + break; + case PROP_REQUIRE_MPPE: + priv->require_mppe = g_value_get_boolean (value); + break; + case PROP_REQUIRE_MPPE_128: + priv->require_mppe_128 = g_value_get_boolean (value); + break; + case PROP_MPPE_STATEFUL: + priv->mppe_stateful = g_value_get_boolean (value); + break; + case PROP_CRTSCTS: + priv->crtscts = g_value_get_boolean (value); + break; + case PROP_BAUD: + priv->baud = g_value_get_uint (value); + break; + case PROP_MRU: + priv->mru = g_value_get_uint (value); + break; + case PROP_MTU: + priv->mtu = g_value_get_uint (value); + break; + case PROP_LCP_ECHO_FAILURE: + priv->lcp_echo_failure = g_value_get_uint (value); + break; + case PROP_LCP_ECHO_INTERVAL: + priv->lcp_echo_interval = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingPPP *setting = NM_SETTING_PPP (object); + + switch (prop_id) { + case PROP_NOAUTH: + g_value_set_boolean (value, nm_setting_ppp_get_noauth (setting)); + break; + case PROP_REFUSE_EAP: + g_value_set_boolean (value, nm_setting_ppp_get_refuse_eap (setting)); + break; + case PROP_REFUSE_PAP: + g_value_set_boolean (value, nm_setting_ppp_get_refuse_pap (setting)); + break; + case PROP_REFUSE_CHAP: + g_value_set_boolean (value, nm_setting_ppp_get_refuse_chap (setting)); + break; + case PROP_REFUSE_MSCHAP: + g_value_set_boolean (value, nm_setting_ppp_get_refuse_mschap (setting)); + break; + case PROP_REFUSE_MSCHAPV2: + g_value_set_boolean (value, nm_setting_ppp_get_refuse_mschapv2 (setting)); + break; + case PROP_NOBSDCOMP: + g_value_set_boolean (value, nm_setting_ppp_get_nobsdcomp (setting)); + break; + case PROP_NODEFLATE: + g_value_set_boolean (value, nm_setting_ppp_get_nodeflate (setting)); + break; + case PROP_NO_VJ_COMP: + g_value_set_boolean (value, nm_setting_ppp_get_no_vj_comp (setting)); + break; + case PROP_REQUIRE_MPPE: + g_value_set_boolean (value, nm_setting_ppp_get_require_mppe (setting)); + break; + case PROP_REQUIRE_MPPE_128: + g_value_set_boolean (value, nm_setting_ppp_get_require_mppe_128 (setting)); + break; + case PROP_MPPE_STATEFUL: + g_value_set_boolean (value, nm_setting_ppp_get_mppe_stateful (setting)); + break; + case PROP_CRTSCTS: + g_value_set_boolean (value, nm_setting_ppp_get_crtscts (setting)); + break; + case PROP_BAUD: + g_value_set_uint (value, nm_setting_ppp_get_baud (setting)); + break; + case PROP_MRU: + g_value_set_uint (value, nm_setting_ppp_get_mru (setting)); + break; + case PROP_MTU: + g_value_set_uint (value, nm_setting_ppp_get_mtu (setting)); + break; + case PROP_LCP_ECHO_FAILURE: + g_value_set_uint (value, nm_setting_ppp_get_lcp_echo_failure (setting)); + break; + case PROP_LCP_ECHO_INTERVAL: + g_value_set_uint (value, nm_setting_ppp_get_lcp_echo_interval (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_ppp_class_init (NMSettingPPPClass *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 (NMSettingPPPPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + parent_class->verify = verify; + + /* Properties */ + /** + * NMSettingPPP:noauth: + * + * If TRUE, do not require the other side (usually the PPP server) to + * authenticate itself to the client. If FALSE, require authentication from + * the remote side. In almost all cases, this should be TRUE. + **/ + g_object_class_install_property + (object_class, PROP_NOAUTH, + g_param_spec_boolean (NM_SETTING_PPP_NOAUTH, + "NoAuth", + "If TRUE, do not require the other side (usually the " + "PPP server) to authenticate itself to the client. " + "If FALSE, require authentication from the remote " + "side. In almost all cases, this should be TRUE.", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:refuse-eap: + * + * If TRUE, the EAP authentication method will not be used. + **/ + g_object_class_install_property + (object_class, PROP_REFUSE_EAP, + g_param_spec_boolean (NM_SETTING_PPP_REFUSE_EAP, + "Refuse EAP", + "If TRUE, the EAP authentication method will not be used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:refuse-pap: + * + * If TRUE, the PAP authentication method will not be used. + **/ + g_object_class_install_property + (object_class, PROP_REFUSE_PAP, + g_param_spec_boolean (NM_SETTING_PPP_REFUSE_PAP, + "Refuse PAP", + "If TRUE, the PAP authentication method will not be used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:refuse-chap: + * + * If TRUE, the CHAP authentication method will not be used. + **/ + g_object_class_install_property + (object_class, PROP_REFUSE_CHAP, + g_param_spec_boolean (NM_SETTING_PPP_REFUSE_CHAP, + "Refuse CHAP", + "If TRUE, the CHAP authentication method will not be used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:refuse-mschap: + * + * If TRUE, the MSCHAP authentication method will not be used. + **/ + g_object_class_install_property + (object_class, PROP_REFUSE_MSCHAP, + g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAP, + "Refuse MSCHAP", + "If TRUE, the MSCHAP authentication method will not be used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:refuse-mschapv2: + * + * If TRUE, the MSCHAPv2 authentication method will not be used. + **/ + g_object_class_install_property + (object_class, PROP_REFUSE_MSCHAPV2, + g_param_spec_boolean (NM_SETTING_PPP_REFUSE_MSCHAPV2, + "Refuse MSCHAPv2", + "If TRUE, the MSCHAPv2 authentication method will not be used.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:nobsdcomp: + * + * If TRUE, BSD compression will not be requested. + **/ + g_object_class_install_property + (object_class, PROP_NOBSDCOMP, + g_param_spec_boolean (NM_SETTING_PPP_NOBSDCOMP, + "No BSD compression", + "If TRUE, BSD compression will not be requested.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingPPP:nodeflate: + * + * If TRUE, 'deflate' compression will not be requested. + **/ + g_object_class_install_property + (object_class, PROP_NODEFLATE, + g_param_spec_boolean (NM_SETTING_PPP_NODEFLATE, + "No deflate", + "If TRUE, 'deflate' compression will not be requested.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingPPP:no-vj-comp: + * + * If TRUE, Van Jacobsen TCP header compression will not be requested. + **/ + g_object_class_install_property + (object_class, PROP_NO_VJ_COMP, + g_param_spec_boolean (NM_SETTING_PPP_NO_VJ_COMP, + "No VJ compression", + "If TRUE, Van Jacobsen TCP header compression will not be requested.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingPPP:require-mppe: + * + * If TRUE, MPPE (Microsoft Point-to-Point Encrpytion) will be required for + * the PPP session. If either 64-bit or 128-bit MPPE is not available the + * session will fail. Note that MPPE is not used on mobile broadband + * connections. + **/ + g_object_class_install_property + (object_class, PROP_REQUIRE_MPPE, + g_param_spec_boolean (NM_SETTING_PPP_REQUIRE_MPPE, + "Require MPPE", + "If TRUE, MPPE (Microsoft Point-to-Point Encrpytion) " + "will be required for the PPP session. If either " + "64-bit or 128-bit MPPE is not available the session " + "will fail. Note that MPPE is not used on mobile " + "broadband connections.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:require-mppe-128: + * + * If TRUE, 128-bit MPPE (Microsoft Point-to-Point Encrpytion) will be + * required for the PPP session, and the 'require-mppe' property must also + * be set to TRUE. If 128-bit MPPE is not available the session will fail. + **/ + g_object_class_install_property + (object_class, PROP_REQUIRE_MPPE_128, + g_param_spec_boolean (NM_SETTING_PPP_REQUIRE_MPPE_128, + "Require MPPE 128", + "If TRUE, 128-bit MPPE (Microsoft Point-to-Point " + "Encrpytion) will be required for the PPP session, " + "and the '" NM_SETTING_PPP_REQUIRE_MPPE "' property " + "must also be set to TRUE. If 128-bit MPPE is not " + "available the session will fail.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT| NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:mppe-stateful: + * + * If TRUE, stateful MPPE is used. See pppd documentation for more + * information on stateful MPPE.", + **/ + g_object_class_install_property + (object_class, PROP_MPPE_STATEFUL, + g_param_spec_boolean (NM_SETTING_PPP_MPPE_STATEFUL, + "MPPE stateful", + "If TRUE, stateful MPPE is used. See pppd documentation " + "for more information on stateful MPPE.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:crtscts: + * + * If TRUE, specify that pppd should set the serial port to use hardware + * flow control with RTS and CTS signals. This value should normally be + * set to FALSE. + **/ + g_object_class_install_property + (object_class, PROP_CRTSCTS, + g_param_spec_boolean (NM_SETTING_PPP_CRTSCTS, + "CRTSCTS", + "If TRUE, specify that pppd should set the serial " + "port to use hardware flow control with RTS and CTS " + "signals. This value should normally be set to " + "FALSE.", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:baud: + * + * If non-zero, instruct pppd to set the serial port to the specified + * baudrate. This value should normally be left as 0 to automatically + * choose the speed. + **/ + g_object_class_install_property + (object_class, PROP_BAUD, + g_param_spec_uint (NM_SETTING_PPP_BAUD, + "Baud", + "If non-zero, instruct pppd to set the serial port to " + "the specified baudrate. This value should normally be " + "left as 0 to automatically choose the speed.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingPPP:mru: + * + * If non-zero, instruct pppd to request that the peer send packets no + * larger than the specified size. If non-zero, the MRU should be between + * 128 and 16384. + */ + g_object_class_install_property + (object_class, PROP_MRU, + g_param_spec_uint (NM_SETTING_PPP_MRU, + "MRU", + "If non-zero, instruct pppd to request that the peer " + "send packets no larger than the specified size. If " + "non-zero, the MRU should be between 128 and 16384.", + 0, 16384, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPP:mtu: + * + * If non-zero, instruct pppd to send packets no larger than the specified + * size. + **/ + g_object_class_install_property + (object_class, PROP_MTU, + g_param_spec_uint (NM_SETTING_PPP_MTU, + "MTU", + "If non-zero, instruct pppd to send packets no larger " + "than the specified size.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingPPP:lcp-echo-failure: + * + * If non-zero, instruct pppd to presume the connection to the peer has + * failed if the specified number of LCP echo-requests go unanswered by the + * peer. The 'lcp-echo-interval' property must also be set to a non-zero + * value if this property is used. + **/ + g_object_class_install_property + (object_class, PROP_LCP_ECHO_FAILURE, + g_param_spec_uint (NM_SETTING_PPP_LCP_ECHO_FAILURE, + "LCP echo failure", + "If non-zero, instruct pppd to presume the connection to " + "the peer has failed if the specified number of LCP " + "echo-requests go unanswered by the peer. The " + "'" NM_SETTING_PPP_LCP_ECHO_INTERVAL "' property must " + "also be set to a non-zero value if this property is " + "used.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingPPP:lcp-echo-interval: + * + * If non-zero, instruct pppd to send an LCP echo-request frame to the peer + * every n seconds (where n is the specified value). Note that some PPP + * peers will respond to echo requests and some will not, and it is not + * possible to autodetect this. + **/ + g_object_class_install_property + (object_class, PROP_LCP_ECHO_INTERVAL, + g_param_spec_uint (NM_SETTING_PPP_LCP_ECHO_INTERVAL, + "LCP echo interval", + "If non-zero, instruct pppd to send an LCP echo-request " + "frame to the peer every n seconds (where n is the " + "specified value). Note that some PPP peers will respond " + "to echo requests and some will not, and it is not " + "possible to autodetect this.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); +} diff --git a/libnm-util/nm-setting-ppp.h b/libnm-util/nm-setting-ppp.h new file mode 100644 index 00000000..cfa1f57a --- /dev/null +++ b/libnm-util/nm-setting-ppp.h @@ -0,0 +1,113 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_PPP_H +#define NM_SETTING_PPP_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_PPP (nm_setting_ppp_get_type ()) +#define NM_SETTING_PPP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_PPP, NMSettingPPP)) +#define NM_SETTING_PPP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_PPP, NMSettingPPPClass)) +#define NM_IS_SETTING_PPP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_PPP)) +#define NM_IS_SETTING_PPP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_PPP)) +#define NM_SETTING_PPP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_PPP, NMSettingPPPClass)) + +#define NM_SETTING_PPP_SETTING_NAME "ppp" + +typedef enum +{ + NM_SETTING_PPP_ERROR_UNKNOWN = 0, + NM_SETTING_PPP_ERROR_INVALID_PROPERTY, + NM_SETTING_PPP_ERROR_MISSING_PROPERTY, + NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED +} NMSettingPPPError; + +#define NM_TYPE_SETTING_PPP_ERROR (nm_setting_ppp_error_get_type ()) +GType nm_setting_ppp_error_get_type (void); + +#define NM_SETTING_PPP_ERROR nm_setting_ppp_error_quark () +GQuark nm_setting_ppp_error_quark (void); + +#define NM_SETTING_PPP_NOAUTH "noauth" +#define NM_SETTING_PPP_REFUSE_EAP "refuse-eap" +#define NM_SETTING_PPP_REFUSE_PAP "refuse-pap" +#define NM_SETTING_PPP_REFUSE_CHAP "refuse-chap" +#define NM_SETTING_PPP_REFUSE_MSCHAP "refuse-mschap" +#define NM_SETTING_PPP_REFUSE_MSCHAPV2 "refuse-mschapv2" +#define NM_SETTING_PPP_NOBSDCOMP "nobsdcomp" +#define NM_SETTING_PPP_NODEFLATE "nodeflate" +#define NM_SETTING_PPP_NO_VJ_COMP "no-vj-comp" +#define NM_SETTING_PPP_REQUIRE_MPPE "require-mppe" +#define NM_SETTING_PPP_REQUIRE_MPPE_128 "require-mppe-128" +#define NM_SETTING_PPP_MPPE_STATEFUL "mppe-stateful" +#define NM_SETTING_PPP_CRTSCTS "crtscts" +#define NM_SETTING_PPP_BAUD "baud" +#define NM_SETTING_PPP_MRU "mru" +#define NM_SETTING_PPP_MTU "mtu" +#define NM_SETTING_PPP_LCP_ECHO_FAILURE "lcp-echo-failure" +#define NM_SETTING_PPP_LCP_ECHO_INTERVAL "lcp-echo-interval" + +typedef struct { + NMSetting parent; +} NMSettingPPP; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingPPPClass; + +GType nm_setting_ppp_get_type (void); + +NMSetting *nm_setting_ppp_new (void); +gboolean nm_setting_ppp_get_noauth (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_refuse_eap (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_refuse_pap (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_refuse_chap (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_refuse_mschap (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_refuse_mschapv2 (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_nobsdcomp (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_nodeflate (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_no_vj_comp (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_require_mppe (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_require_mppe_128 (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_mppe_stateful (NMSettingPPP *setting); +gboolean nm_setting_ppp_get_crtscts (NMSettingPPP *setting); +guint32 nm_setting_ppp_get_baud (NMSettingPPP *setting); +guint32 nm_setting_ppp_get_mru (NMSettingPPP *setting); +guint32 nm_setting_ppp_get_mtu (NMSettingPPP *setting); +guint32 nm_setting_ppp_get_lcp_echo_failure (NMSettingPPP *setting); +guint32 nm_setting_ppp_get_lcp_echo_interval (NMSettingPPP *setting); + +G_END_DECLS + +#endif /* NM_SETTING_PPP_H */ diff --git a/libnm-util/nm-setting-pppoe.c b/libnm-util/nm-setting-pppoe.c new file mode 100644 index 00000000..d1aba43d --- /dev/null +++ b/libnm-util/nm-setting-pppoe.c @@ -0,0 +1,274 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2010 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include "nm-setting-pppoe.h" +#include "nm-setting-ppp.h" + +GQuark +nm_setting_pppoe_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-pppoe-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_pppoe_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The required PPP setting is missing */ + ENUM_ENTRY (NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING, "MissingPPPSetting"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingPPPOEError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingPPPOE, nm_setting_pppoe, NM_TYPE_SETTING) + +#define NM_SETTING_PPPOE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPPOE, NMSettingPPPOEPrivate)) + +typedef struct { + char *service; + char *username; + char *password; +} NMSettingPPPOEPrivate; + +enum { + PROP_0, + PROP_SERVICE, + PROP_USERNAME, + PROP_PASSWORD, + + LAST_PROP +}; + +NMSetting * +nm_setting_pppoe_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_PPPOE, NULL); +} + +const char * +nm_setting_pppoe_get_service (NMSettingPPPOE *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPPOE (setting), NULL); + + return NM_SETTING_PPPOE_GET_PRIVATE (setting)->service; +} + +const char * +nm_setting_pppoe_get_username (NMSettingPPPOE *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPPOE (setting), NULL); + + return NM_SETTING_PPPOE_GET_PRIVATE (setting)->username; +} + +const char * +nm_setting_pppoe_get_password (NMSettingPPPOE *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_PPPOE (setting), NULL); + + return NM_SETTING_PPPOE_GET_PRIVATE (setting)->password; +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingPPPOEPrivate *priv = NM_SETTING_PPPOE_GET_PRIVATE (setting); + + if (!priv->username) { + g_set_error (error, + NM_SETTING_PPPOE_ERROR, + NM_SETTING_PPPOE_ERROR_MISSING_PROPERTY, + NM_SETTING_PPPOE_USERNAME); + return FALSE; + } else if (!strlen (priv->username)) { + g_set_error (error, + NM_SETTING_PPPOE_ERROR, + NM_SETTING_PPPOE_ERROR_INVALID_PROPERTY, + NM_SETTING_PPPOE_USERNAME); + return FALSE; + } + + if (priv->service && !strlen (priv->service)) { + g_set_error (error, + NM_SETTING_PPPOE_ERROR, + NM_SETTING_PPPOE_ERROR_INVALID_PROPERTY, + NM_SETTING_PPPOE_SERVICE); + return FALSE; + } + + return TRUE; +} + +static GPtrArray * +need_secrets (NMSetting *setting) +{ + NMSettingPPPOEPrivate *priv = NM_SETTING_PPPOE_GET_PRIVATE (setting); + GPtrArray *secrets; + + if (priv->password) + return NULL; + + secrets = g_ptr_array_sized_new (1); + g_ptr_array_add (secrets, NM_SETTING_PPPOE_PASSWORD); + + return secrets; +} + +static void +nm_setting_pppoe_init (NMSettingPPPOE *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_PPPOE_SETTING_NAME, NULL); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingPPPOEPrivate *priv = NM_SETTING_PPPOE_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_SERVICE: + g_free (priv->service); + priv->service = g_value_dup_string (value); + break; + case PROP_USERNAME: + g_free (priv->username); + priv->username = g_value_dup_string (value); + break; + case PROP_PASSWORD: + g_free (priv->password); + priv->password = g_value_dup_string (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) +{ + NMSettingPPPOE *setting = NM_SETTING_PPPOE (object); + + switch (prop_id) { + case PROP_SERVICE: + g_value_set_string (value, nm_setting_pppoe_get_service (setting)); + break; + case PROP_USERNAME: + g_value_set_string (value, nm_setting_pppoe_get_username (setting)); + break; + case PROP_PASSWORD: + g_value_set_string (value, nm_setting_pppoe_get_password (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_pppoe_class_init (NMSettingPPPOEClass *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 (NMSettingPPPOEPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + parent_class->verify = verify; + parent_class->need_secrets = need_secrets; + + /* Properties */ + /** + * NMSettingPPPOE:service: + * + * If specified, instruct PPPoE to only initiate sessions with access + * concentrators that provide the specified serivce. For most providers, + * this should be left blank. It is only required if there are multiple + * access concentrators or a specific service is known to be required. + **/ + g_object_class_install_property + (object_class, PROP_SERVICE, + g_param_spec_string (NM_SETTING_PPPOE_SERVICE, + "Service", + "If specified, instruct PPPoE to only initiate sessions " + "with access concentrators that provide the specified " + "serivce. For most providers, this should be left " + "blank. It is only required if there are multiple " + "access concentrators or a specific service is known " + "to be required.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPPOE:username: + * + * Username used to authenticate with the PPPoE service. + **/ + g_object_class_install_property + (object_class, PROP_USERNAME, + g_param_spec_string (NM_SETTING_PPPOE_USERNAME, + "Username", + "Username used to authenticate with the PPPoE service.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingPPPOE:password: + * + * Password used to authenticate with the PPPoE service. + **/ + g_object_class_install_property + (object_class, PROP_PASSWORD, + g_param_spec_string (NM_SETTING_PPPOE_PASSWORD, + "Password", + "Password used to authenticate with the PPPoE service.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); +} diff --git a/libnm-util/nm-setting-pppoe.h b/libnm-util/nm-setting-pppoe.h new file mode 100644 index 00000000..83e95d4e --- /dev/null +++ b/libnm-util/nm-setting-pppoe.h @@ -0,0 +1,83 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_PPPOE_H +#define NM_SETTING_PPPOE_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_PPPOE (nm_setting_pppoe_get_type ()) +#define NM_SETTING_PPPOE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_PPPOE, NMSettingPPPOE)) +#define NM_SETTING_PPPOE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_PPPOE, NMSettingPPPOEClass)) +#define NM_IS_SETTING_PPPOE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_PPPOE)) +#define NM_IS_SETTING_PPPOE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_PPPOE)) +#define NM_SETTING_PPPOE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_PPPOE, NMSettingPPPOEClass)) + +#define NM_SETTING_PPPOE_SETTING_NAME "pppoe" + +typedef enum +{ + NM_SETTING_PPPOE_ERROR_UNKNOWN = 0, + NM_SETTING_PPPOE_ERROR_INVALID_PROPERTY, + NM_SETTING_PPPOE_ERROR_MISSING_PROPERTY, + NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING +} NMSettingPPPOEError; + +#define NM_TYPE_SETTING_PPPOE_ERROR (nm_setting_pppoe_error_get_type ()) +GType nm_setting_pppoe_error_get_type (void); + +#define NM_SETTING_PPPOE_ERROR nm_setting_pppoe_error_quark () +GQuark nm_setting_pppoe_error_quark (void); + +#define NM_SETTING_PPPOE_SERVICE "service" +#define NM_SETTING_PPPOE_USERNAME "username" +#define NM_SETTING_PPPOE_PASSWORD "password" + +typedef struct { + NMSetting parent; +} NMSettingPPPOE; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingPPPOEClass; + +GType nm_setting_pppoe_get_type (void); + +NMSetting *nm_setting_pppoe_new (void); +const char *nm_setting_pppoe_get_service (NMSettingPPPOE *setting); +const char *nm_setting_pppoe_get_username (NMSettingPPPOE *setting); +const char *nm_setting_pppoe_get_password (NMSettingPPPOE *setting); + +G_END_DECLS + +#endif /* NM_SETTING_PPPOE_H */ diff --git a/libnm-util/nm-setting-serial.c b/libnm-util/nm-setting-serial.c new file mode 100644 index 00000000..7a20688a --- /dev/null +++ b/libnm-util/nm-setting-serial.c @@ -0,0 +1,314 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include + +#include "nm-setting-serial.h" +#include "nm-setting-ppp.h" + +GQuark +nm_setting_serial_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-serial-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_serial_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The required PPP setting is missing */ + ENUM_ENTRY (NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING, "MissingPPPSetting"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingSerialError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING) + +#define NM_SETTING_SERIAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_SERIAL, NMSettingSerialPrivate)) + +typedef struct { + guint baud; + guint bits; + char parity; + guint stopbits; + guint64 send_delay; +} NMSettingSerialPrivate; + + +enum { + PROP_0, + PROP_BAUD, + PROP_BITS, + PROP_PARITY, + PROP_STOPBITS, + PROP_SEND_DELAY, + + LAST_PROP +}; + +NMSetting * +nm_setting_serial_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_SERIAL, NULL); +} + +guint +nm_setting_serial_get_baud (NMSettingSerial *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_SERIAL (setting), 0); + + return NM_SETTING_SERIAL_GET_PRIVATE (setting)->baud; +} + +guint +nm_setting_serial_get_bits (NMSettingSerial *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_SERIAL (setting), 0); + + return NM_SETTING_SERIAL_GET_PRIVATE (setting)->bits; +} + +char +nm_setting_serial_get_parity (NMSettingSerial *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_SERIAL (setting), 0); + + return NM_SETTING_SERIAL_GET_PRIVATE (setting)->parity; +} + +guint +nm_setting_serial_get_stopbits (NMSettingSerial *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_SERIAL (setting), 0); + + return NM_SETTING_SERIAL_GET_PRIVATE (setting)->stopbits; +} + +guint64 +nm_setting_serial_get_send_delay (NMSettingSerial *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_SERIAL (setting), 0); + + return NM_SETTING_SERIAL_GET_PRIVATE (setting)->send_delay; +} + +static gint +find_setting_by_name (gconstpointer a, gconstpointer b) +{ + NMSetting *setting = NM_SETTING (a); + const char *str = (const char *) b; + + return strcmp (nm_setting_get_name (setting), str); +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + /* Serial connections require a PPP setting */ + if (all_settings && + !g_slist_find_custom (all_settings, NM_SETTING_PPP_SETTING_NAME, find_setting_by_name)) { + g_set_error (error, + NM_SETTING_SERIAL_ERROR, + NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING, + NULL); + return FALSE; + } + + return TRUE; +} + +static void +nm_setting_serial_init (NMSettingSerial *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_SERIAL_SETTING_NAME, NULL); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingSerialPrivate *priv = NM_SETTING_SERIAL_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_BAUD: + priv->baud = g_value_get_uint (value); + break; + case PROP_BITS: + priv->bits = g_value_get_uint (value); + break; + case PROP_PARITY: + priv->parity = g_value_get_char (value); + break; + case PROP_STOPBITS: + priv->stopbits = g_value_get_uint (value); + break; + case PROP_SEND_DELAY: + priv->send_delay = g_value_get_uint64 (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) +{ + NMSettingSerial *setting = NM_SETTING_SERIAL (object); + + switch (prop_id) { + case PROP_BAUD: + g_value_set_uint (value, nm_setting_serial_get_baud (setting)); + break; + case PROP_BITS: + g_value_set_uint (value, nm_setting_serial_get_bits (setting)); + break; + case PROP_PARITY: + g_value_set_char (value, nm_setting_serial_get_parity (setting)); + break; + case PROP_STOPBITS: + g_value_set_uint (value, nm_setting_serial_get_stopbits (setting)); + break; + case PROP_SEND_DELAY: + g_value_set_uint64 (value, nm_setting_serial_get_send_delay (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_serial_class_init (NMSettingSerialClass *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 (NMSettingSerialPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + parent_class->verify = verify; + + /* Properties */ + + /** + * NMSettingSerial:baud: + * + * Speed to use for communication over the serial port. Note that this value + * usually has no effect for mobile broadband modems as they generally + * ignore speed settings and use the highest available speed. + **/ + g_object_class_install_property + (object_class, PROP_BAUD, + g_param_spec_uint (NM_SETTING_SERIAL_BAUD, + "Baud", + "Speed to use for communication over the serial port. " + "Note that this value usually has no effect for mobile " + "broadband modems as they generally ignore speed " + "settings and use the highest available speed.", + 0, G_MAXUINT, 57600, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingSerial:bits: + * + * Byte-width of the serial communication. + **/ + g_object_class_install_property + (object_class, PROP_BITS, + g_param_spec_uint (NM_SETTING_SERIAL_BITS, + "Bits", + "Byte-width of the serial communication. The 8 in " + "'8n1' for example.", + 5, 8, 8, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingSerial:parity: + * + * Parity setting of the serial port. Either 'E' for even parity, 'o' for + * odd parity, or 'n' for no parity. + **/ + g_object_class_install_property + (object_class, PROP_PARITY, + g_param_spec_char (NM_SETTING_SERIAL_PARITY, + "Parity", + "Parity setting of the serial port. Either 'E' for even " + "parity, 'o' for odd parity, or 'n' for no parity.", + 'E', 'o', 'n', + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingSerial:stopbits: + * + * Number of stop bits for communication on the serial port. Either 1 or 2. + * The 1 in '8n1' for example. + **/ + g_object_class_install_property + (object_class, PROP_STOPBITS, + g_param_spec_uint (NM_SETTING_SERIAL_STOPBITS, + "Stopbits", + "Number of stop bits for communication on the serial " + "port. Either 1 or 2. The 1 in '8n1' for example.", + 1, 2, 1, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingSerial:send-delay: + * + * Time to delay between each byte sent to the modem, in microseconds. + **/ + g_object_class_install_property + (object_class, PROP_SEND_DELAY, + g_param_spec_uint64 (NM_SETTING_SERIAL_SEND_DELAY, + "SendDelay", + "Time to delay between each byte sent to the modem, " + "in microseconds.", + 0, G_MAXUINT64, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); +} diff --git a/libnm-util/nm-setting-serial.h b/libnm-util/nm-setting-serial.h new file mode 100644 index 00000000..d39e5a79 --- /dev/null +++ b/libnm-util/nm-setting-serial.h @@ -0,0 +1,87 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_SERIAL_H +#define NM_SETTING_SERIAL_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_SERIAL (nm_setting_serial_get_type ()) +#define NM_SETTING_SERIAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_SERIAL, NMSettingSerial)) +#define NM_SETTING_SERIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_SERIAL, NMSettingSerialClass)) +#define NM_IS_SETTING_SERIAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_SERIAL)) +#define NM_IS_SETTING_SERIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_SERIAL)) +#define NM_SETTING_SERIAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_SERIAL, NMSettingSerialClass)) + +#define NM_SETTING_SERIAL_SETTING_NAME "serial" + +typedef enum +{ + NM_SETTING_SERIAL_ERROR_UNKNOWN = 0, + NM_SETTING_SERIAL_ERROR_INVALID_PROPERTY, + NM_SETTING_SERIAL_ERROR_MISSING_PROPERTY, + NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING +} NMSettingSerialError; + +#define NM_TYPE_SETTING_SERIAL_ERROR (nm_setting_serial_error_get_type ()) +GType nm_setting_serial_error_get_type (void); + +#define NM_SETTING_SERIAL_ERROR nm_setting_serial_error_quark () +GQuark nm_setting_serial_error_quark (void); + +#define NM_SETTING_SERIAL_BAUD "baud" +#define NM_SETTING_SERIAL_BITS "bits" +#define NM_SETTING_SERIAL_PARITY "parity" +#define NM_SETTING_SERIAL_STOPBITS "stopbits" +#define NM_SETTING_SERIAL_SEND_DELAY "send-delay" + +typedef struct { + NMSetting parent; +} NMSettingSerial; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingSerialClass; + +GType nm_setting_serial_get_type (void); + +NMSetting *nm_setting_serial_new (void); +guint nm_setting_serial_get_baud (NMSettingSerial *setting); +guint nm_setting_serial_get_bits (NMSettingSerial *setting); +char nm_setting_serial_get_parity (NMSettingSerial *setting); +guint nm_setting_serial_get_stopbits (NMSettingSerial *setting); +guint64 nm_setting_serial_get_send_delay (NMSettingSerial *setting); + +G_END_DECLS + +#endif /* NM_SETTING_SERIAL_H */ diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c new file mode 100644 index 00000000..53b609e2 --- /dev/null +++ b/libnm-util/nm-setting-vpn.c @@ -0,0 +1,464 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include "nm-setting-vpn.h" +#include "nm-param-spec-specialized.h" +#include "nm-utils.h" +#include "nm-dbus-glib-types.h" + +GQuark +nm_setting_vpn_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-vpn-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_vpn_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_VPN_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_VPN_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_VPN_ERROR_MISSING_PROPERTY, "MissingProperty"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingVpnError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingVPN, nm_setting_vpn, NM_TYPE_SETTING) + +#define NM_SETTING_VPN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VPN, NMSettingVPNPrivate)) + +typedef struct { + char *service_type; + + /* username of the user requesting this connection, thus + * it's really only valid for user connections, and it also + * should never be saved out to persistent config. + */ + char *user_name; + + /* The hash table is created at setting object + * init time and should not be replaced. It is + * a char * -> char * mapping, and both the key + * and value are owned by the hash table, and should + * be allocated with functions whose value can be + * freed with g_free(). Should not contain secrets. + */ + GHashTable *data; + + /* The hash table is created at setting object + * init time and should not be replaced. It is + * a char * -> char * mapping, and both the key + * and value are owned by the hash table, and should + * be allocated with functions whose value can be + * freed with g_free(). Should contain secrets only. + */ + GHashTable *secrets; +} NMSettingVPNPrivate; + +enum { + PROP_0, + PROP_SERVICE_TYPE, + PROP_USER_NAME, + PROP_DATA, + PROP_SECRETS, + + LAST_PROP +}; + +NMSetting * +nm_setting_vpn_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_VPN, NULL); +} + +const char * +nm_setting_vpn_get_service_type (NMSettingVPN *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VPN (setting), NULL); + + return NM_SETTING_VPN_GET_PRIVATE (setting)->service_type; +} + +const char * +nm_setting_vpn_get_user_name (NMSettingVPN *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VPN (setting), NULL); + + return NM_SETTING_VPN_GET_PRIVATE (setting)->user_name; +} + +void +nm_setting_vpn_add_data_item (NMSettingVPN *setting, + const char *key, + const char *item) +{ + g_return_if_fail (NM_IS_SETTING_VPN (setting)); + g_return_if_fail (key != NULL); + g_return_if_fail (strlen (key) > 0); + g_return_if_fail (item != NULL); + g_return_if_fail (strlen (item) > 0); + + g_hash_table_insert (NM_SETTING_VPN_GET_PRIVATE (setting)->data, + g_strdup (key), g_strdup (item)); +} + +const char * +nm_setting_vpn_get_data_item (NMSettingVPN *setting, const char *key) +{ + g_return_val_if_fail (NM_IS_SETTING_VPN (setting), NULL); + + return (const char *) g_hash_table_lookup (NM_SETTING_VPN_GET_PRIVATE (setting)->data, key); +} + +void +nm_setting_vpn_remove_data_item (NMSettingVPN *setting, const char *key) +{ + g_return_if_fail (NM_IS_SETTING_VPN (setting)); + + g_hash_table_remove (NM_SETTING_VPN_GET_PRIVATE (setting)->data, key); +} + +void +nm_setting_vpn_foreach_data_item (NMSettingVPN *setting, + VPNIterFunc func, + gpointer user_data) +{ + g_return_if_fail (NM_IS_SETTING_VPN (setting)); + + g_hash_table_foreach (NM_SETTING_VPN_GET_PRIVATE (setting)->data, + (GHFunc) func, user_data); +} + +void +nm_setting_vpn_add_secret (NMSettingVPN *setting, + const char *key, + const char *secret) +{ + g_return_if_fail (NM_IS_SETTING_VPN (setting)); + g_return_if_fail (key != NULL); + g_return_if_fail (strlen (key) > 0); + g_return_if_fail (secret != NULL); + g_return_if_fail (strlen (secret) > 0); + + g_hash_table_insert (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, + g_strdup (key), g_strdup (secret)); +} + +const char * +nm_setting_vpn_get_secret (NMSettingVPN *setting, const char *key) +{ + g_return_val_if_fail (NM_IS_SETTING_VPN (setting), NULL); + + return (const char *) g_hash_table_lookup (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, key); +} + +void +nm_setting_vpn_remove_secret (NMSettingVPN *setting, const char *key) +{ + g_return_if_fail (NM_IS_SETTING_VPN (setting)); + + g_hash_table_remove (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, key); +} + +void +nm_setting_vpn_foreach_secret (NMSettingVPN *setting, + VPNIterFunc func, + gpointer user_data) +{ + g_return_if_fail (NM_IS_SETTING_VPN (setting)); + + g_hash_table_foreach (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, + (GHFunc) func, user_data); +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingVPNPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting); + + if (!priv->service_type) { + g_set_error (error, + NM_SETTING_VPN_ERROR, + NM_SETTING_VPN_ERROR_MISSING_PROPERTY, + NM_SETTING_VPN_SERVICE_TYPE); + return FALSE; + } + + if (!strlen (priv->service_type)) { + g_set_error (error, + NM_SETTING_VPN_ERROR, + NM_SETTING_VPN_ERROR_INVALID_PROPERTY, + NM_SETTING_VPN_SERVICE_TYPE); + return FALSE; + } + + /* default username can be NULL, but can't be zero-length */ + if (priv->user_name && !strlen (priv->user_name)) { + g_set_error (error, + NM_SETTING_VPN_ERROR, + NM_SETTING_VPN_ERROR_INVALID_PROPERTY, + NM_SETTING_VPN_USER_NAME); + return FALSE; + } + + return TRUE; +} + +static gboolean +update_one_secret (NMSetting *setting, const char *key, GValue *value, GError **error) +{ + NMSettingVPNPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting); + char *str; + + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + if (!G_VALUE_HOLDS_STRING (value)) { + g_set_error (error, NM_SETTING_ERROR, + NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH, + "%s", key); + return FALSE; + } + + str = g_value_dup_string (value); + if (!str || !strlen (str)) { + g_set_error (error, NM_SETTING_ERROR, + NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH, + "Secret %s was empty", key); + g_free (str); + return FALSE; + } + + g_hash_table_insert (priv->secrets, g_strdup (key), str); + return TRUE; +} + +static void +destroy_one_secret (gpointer data) +{ + char *secret = (char *) data; + + /* Don't leave the secret lying around in memory */ + memset (secret, 0, strlen (secret)); + g_free (secret); +} + +static void +nm_setting_vpn_init (NMSettingVPN *setting) +{ + NMSettingVPNPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting); + + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_VPN_SETTING_NAME, NULL); + priv->data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + priv->secrets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, destroy_one_secret); +} + +static void +finalize (GObject *object) +{ + NMSettingVPNPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (object); + + g_free (priv->service_type); + g_free (priv->user_name); + g_hash_table_destroy (priv->data); + g_hash_table_destroy (priv->secrets); + + G_OBJECT_CLASS (nm_setting_vpn_parent_class)->finalize (object); +} + +static void +copy_hash (gpointer key, gpointer value, gpointer user_data) +{ + g_hash_table_insert ((GHashTable *) user_data, g_strdup (key), g_strdup (value)); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingVPNPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (object); + GHashTable *new_hash; + + switch (prop_id) { + case PROP_SERVICE_TYPE: + g_free (priv->service_type); + priv->service_type = g_value_dup_string (value); + break; + case PROP_USER_NAME: + g_free (priv->user_name); + priv->user_name = g_value_dup_string (value); + break; + case PROP_DATA: + /* Must make a deep copy of the hash table here... */ + g_hash_table_remove_all (priv->data); + new_hash = g_value_get_boxed (value); + if (new_hash) + g_hash_table_foreach (new_hash, copy_hash, priv->data); + break; + case PROP_SECRETS: + /* Must make a deep copy of the hash table here... */ + g_hash_table_remove_all (priv->secrets); + new_hash = g_value_get_boxed (value); + if (new_hash) + g_hash_table_foreach (new_hash, copy_hash, priv->secrets); + 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) +{ + NMSettingVPN *setting = NM_SETTING_VPN (object); + NMSettingVPNPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_SERVICE_TYPE: + g_value_set_string (value, nm_setting_vpn_get_service_type (setting)); + break; + case PROP_USER_NAME: + g_value_set_string (value, nm_setting_vpn_get_user_name (setting)); + break; + case PROP_DATA: + g_value_set_boxed (value, priv->data); + break; + case PROP_SECRETS: + g_value_set_boxed (value, priv->secrets); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_vpn_class_init (NMSettingVPNClass *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 (NMSettingVPNPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + parent_class->update_one_secret = update_one_secret; + + /* Properties */ + /** + * NMSettingVPN:service-type: + * + * D-Bus service name of the VPN plugin that this setting uses to connect + * to its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc + * plugin. + **/ + g_object_class_install_property + (object_class, PROP_SERVICE_TYPE, + g_param_spec_string (NM_SETTING_VPN_SERVICE_TYPE, + "Service type", + "D-Bus service name of the VPN plugin that this " + "setting uses to connect to its network. i.e. " + "org.freedesktop.NetworkManager.vpnc for the vpnc " + "plugin.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettinVPN:user-name: + * + * User name of the currently logged in user for connections provided by the + * user settings service. This name is provided to the VPN plugin to use in + * lieu of a custom username provided by that VPN plugins specific + * configuration. The VPN plugin itself decides which user name to use. + **/ + g_object_class_install_property + (object_class, PROP_USER_NAME, + g_param_spec_string (NM_SETTING_VPN_USER_NAME, + "User name", + "User name of the currently logged in user for " + "connections provided by the user settings service. " + "This name is provided to the VPN plugin to use in " + "lieu of a custom username provided by that VPN " + "plugins specific configuration. The VPN plugin " + "itself decides which user name to use.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingVPN:data: + * + * Dictionary of key/value pairs of VPN plugin specific data. Both keys + * and values must be strings. + **/ + g_object_class_install_property + (object_class, PROP_DATA, + _nm_param_spec_specialized (NM_SETTING_VPN_DATA, + "Data", + "Dictionary of key/value pairs of VPN plugin " + "specific data. Both keys and values must be " + "strings.", + DBUS_TYPE_G_MAP_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingVPN:secrets: + * + * Dictionary of key/value pairs of VPN plugin specific secrets like + * passwords or private keys. Both keys and values must be strings. + **/ + g_object_class_install_property + (object_class, PROP_SECRETS, + _nm_param_spec_specialized (NM_SETTING_VPN_SECRETS, + "Secrets", + "Dictionary of key/value pairs of VPN plugin " + "specific secrets like passwords or private keys." + " Both keys and values must be strings.", + DBUS_TYPE_G_MAP_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); +} + diff --git a/libnm-util/nm-setting-vpn.h b/libnm-util/nm-setting-vpn.h new file mode 100644 index 00000000..9c684bbf --- /dev/null +++ b/libnm-util/nm-setting-vpn.h @@ -0,0 +1,106 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_VPN_H +#define NM_SETTING_VPN_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_VPN (nm_setting_vpn_get_type ()) +#define NM_SETTING_VPN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_VPN, NMSettingVPN)) +#define NM_SETTING_VPN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_VPN, NMSettingVPNClass)) +#define NM_IS_SETTING_VPN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_VPN)) +#define NM_IS_SETTING_VPN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_VPN)) +#define NM_SETTING_VPN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_VPN, NMSettingVPNClass)) + +#define NM_SETTING_VPN_SETTING_NAME "vpn" + +typedef enum +{ + NM_SETTING_VPN_ERROR_UNKNOWN = 0, + NM_SETTING_VPN_ERROR_INVALID_PROPERTY, + NM_SETTING_VPN_ERROR_MISSING_PROPERTY, +} NMSettingVpnError; + +#define NM_TYPE_SETTING_VPN_ERROR (nm_setting_vpn_error_get_type ()) +GType nm_setting_vpn_error_get_type (void); + +#define NM_SETTING_VPN_ERROR nm_setting_vpn_error_quark () +GQuark nm_setting_vpn_error_quark (void); + +#define NM_SETTING_VPN_SERVICE_TYPE "service-type" +#define NM_SETTING_VPN_USER_NAME "user-name" +#define NM_SETTING_VPN_DATA "data" +#define NM_SETTING_VPN_SECRETS "secrets" + +typedef struct { + NMSetting parent; +} NMSettingVPN; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingVPNClass; + +typedef void (*VPNIterFunc) (const char *key, const char *value, gpointer user_data); + +GType nm_setting_vpn_get_type (void); + +NMSetting *nm_setting_vpn_new (void); +const char *nm_setting_vpn_get_service_type (NMSettingVPN *setting); +const char *nm_setting_vpn_get_user_name (NMSettingVPN *setting); + +void nm_setting_vpn_add_data_item (NMSettingVPN *setting, + const char *key, + const char *item); +const char * nm_setting_vpn_get_data_item (NMSettingVPN *setting, + const char *key); +void nm_setting_vpn_remove_data_item (NMSettingVPN *setting, + const char *key); +void nm_setting_vpn_foreach_data_item (NMSettingVPN *setting, + VPNIterFunc func, + gpointer user_data); + +void nm_setting_vpn_add_secret (NMSettingVPN *setting, + const char *key, + const char *secret); +const char * nm_setting_vpn_get_secret (NMSettingVPN *setting, + const char *key); +void nm_setting_vpn_remove_secret (NMSettingVPN *setting, + const char *key); +void nm_setting_vpn_foreach_secret (NMSettingVPN *setting, + VPNIterFunc func, + gpointer user_data); + +G_END_DECLS + +#endif /* NM_SETTING_VPN_H */ diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c new file mode 100644 index 00000000..2f252433 --- /dev/null +++ b/libnm-util/nm-setting-wired.c @@ -0,0 +1,384 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include "nm-setting-wired.h" +#include "nm-param-spec-specialized.h" +#include "nm-utils.h" +#include "nm-utils-private.h" + +GQuark +nm_setting_wired_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-wired-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_wired_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_WIRED_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_WIRED_ERROR_MISSING_PROPERTY, "MissingProperty"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingWiredError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING) + +#define NM_SETTING_WIRED_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRED, NMSettingWiredPrivate)) + +typedef struct { + char *port; + guint32 speed; + char *duplex; + gboolean auto_negotiate; + GByteArray *mac_address; + guint32 mtu; +} NMSettingWiredPrivate; + +enum { + PROP_0, + PROP_PORT, + PROP_SPEED, + PROP_DUPLEX, + PROP_AUTO_NEGOTIATE, + PROP_MAC_ADDRESS, + PROP_MTU, + + LAST_PROP +}; + +NMSetting * +nm_setting_wired_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRED, NULL); +} + +const char * +nm_setting_wired_get_port (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->port; +} + +guint32 +nm_setting_wired_get_speed (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), 0); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->speed; +} + +const char * +nm_setting_wired_get_duplex (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->duplex; +} + +gboolean +nm_setting_wired_get_auto_negotiate (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->auto_negotiate; +} + +const GByteArray * +nm_setting_wired_get_mac_address (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->mac_address; +} + +guint32 +nm_setting_wired_get_mtu (NMSettingWired *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), 0); + + return NM_SETTING_WIRED_GET_PRIVATE (setting)->mtu; +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); + const char *valid_ports[] = { "tp", "aui", "bnc", "mii", NULL }; + const char *valid_duplex[] = { "half", "full", NULL }; + + if (priv->port && !_nm_utils_string_in_list (priv->port, valid_ports)) { + g_set_error (error, + NM_SETTING_WIRED_ERROR, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_PORT); + return FALSE; + } + + if (priv->duplex && !_nm_utils_string_in_list (priv->duplex, valid_duplex)) { + g_set_error (error, + NM_SETTING_WIRED_ERROR, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_DUPLEX); + return FALSE; + } + + if (priv->mac_address && priv->mac_address->len != ETH_ALEN) { + g_set_error (error, + NM_SETTING_WIRED_ERROR, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_MAC_ADDRESS); + return FALSE; + } + + return TRUE; +} + +static void +nm_setting_wired_init (NMSettingWired *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_WIRED_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (object); + + g_free (priv->port); + g_free (priv->duplex); + + if (priv->mac_address) + g_byte_array_free (priv->mac_address, TRUE); + + G_OBJECT_CLASS (nm_setting_wired_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PORT: + g_free (priv->port); + priv->port = g_value_dup_string (value); + break; + case PROP_SPEED: + priv->speed = g_value_get_uint (value); + break; + case PROP_DUPLEX: + g_free (priv->duplex); + priv->duplex = g_value_dup_string (value); + break; + case PROP_AUTO_NEGOTIATE: + priv->auto_negotiate = g_value_get_boolean (value); + break; + case PROP_MAC_ADDRESS: + if (priv->mac_address) + g_byte_array_free (priv->mac_address, TRUE); + priv->mac_address = g_value_dup_boxed (value); + break; + case PROP_MTU: + priv->mtu = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingWired *setting = NM_SETTING_WIRED (object); + + switch (prop_id) { + case PROP_PORT: + g_value_set_string (value, nm_setting_wired_get_port (setting)); + break; + case PROP_SPEED: + g_value_set_uint (value, nm_setting_wired_get_speed (setting)); + break; + case PROP_DUPLEX: + g_value_set_string (value, nm_setting_wired_get_duplex (setting)); + break; + case PROP_AUTO_NEGOTIATE: + g_value_set_boolean (value, nm_setting_wired_get_auto_negotiate (setting)); + break; + case PROP_MAC_ADDRESS: + g_value_set_boxed (value, nm_setting_wired_get_mac_address (setting)); + break; + case PROP_MTU: + g_value_set_uint (value, nm_setting_wired_get_mtu (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_wired_class_init (NMSettingWiredClass *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 (NMSettingWiredPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + /** + * NMSettingWired:port: + * + * Specific port type to use if multiple the device supports multiple + * attachment methods. One of 'tp' (Twisted Pair), 'aui' (Attachment Unit + * Interface), 'bnc' (Thin Ethernet) or 'mii' (Media Independent Interface. + * If the device supports only one port type, this setting is ignored. + **/ + g_object_class_install_property + (object_class, PROP_PORT, + g_param_spec_string (NM_SETTING_WIRED_PORT, + "Port", + "Specific port type to use if multiple the device " + "supports multiple attachment methods. One of " + "'tp' (Twisted Pair), 'aui' (Attachment Unit Interface), " + "'bnc' (Thin Ethernet) or 'mii' (Media Independent " + "Interface. If the device supports only one port " + "type, this setting is ignored.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:speed: + * + * If non-zero, request that the device use only the specified speed. + * In Mbit/s, ie 100 == 100Mbit/s. + **/ + g_object_class_install_property + (object_class, PROP_SPEED, + g_param_spec_uint (NM_SETTING_WIRED_SPEED, + "Speed", + "If non-zero, request that the device use only the " + "specified speed. In Mbit/s, ie 100 == 100Mbit/s.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:duplex: + * + * If specified, request that the device only use the specified duplex mode. + * Either 'half' or 'full'. + **/ + g_object_class_install_property + (object_class, PROP_DUPLEX, + g_param_spec_string (NM_SETTING_WIRED_DUPLEX, + "Duplex", + "If specified, request that the device only use the " + "specified duplex mode. Either 'half' or 'full'.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingEthernet:auto-negotiate: + * + * If TRUE, allow auto-negotiation of port speed and duplex mode. If FALSE, + * do not allow auto-negotiation, in which case the 'speed' and 'duplex' + * properties should be set. + **/ + g_object_class_install_property + (object_class, PROP_AUTO_NEGOTIATE, + g_param_spec_boolean (NM_SETTING_WIRED_AUTO_NEGOTIATE, + "AutoNegotiate", + "If TRUE, allow auto-negotiation of port speed and " + "duplex mode. If FALSE, do not allow auto-negotiation," + "in which case the 'speed' and 'duplex' properties " + "should be set.", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:mac-address: + * + * If specified, this connection will only apply to the ethernet device + * whose MAC address matches. This property does not change the MAC address + * of the device (known as MAC spoofing). + **/ + g_object_class_install_property + (object_class, PROP_MAC_ADDRESS, + _nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS, + "MAC Address", + "If specified, this connection will only apply to " + "the ethernet device whose MAC address matches. " + "This property does not change the MAC address " + "of the device (known as MAC spoofing).", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWired:mtu: + * + * If non-zero, only transmit packets of the specified size or smaller, + * breaking larger packets up into multiple Ethernet frames. + **/ + g_object_class_install_property + (object_class, PROP_MTU, + g_param_spec_uint (NM_SETTING_WIRED_MTU, + "MTU", + "If non-zero, only transmit packets of the specified " + "size or smaller, breaking larger packets up into " + "multiple Ethernet frames.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); +} + diff --git a/libnm-util/nm-setting-wired.h b/libnm-util/nm-setting-wired.h new file mode 100644 index 00000000..44127347 --- /dev/null +++ b/libnm-util/nm-setting-wired.h @@ -0,0 +1,88 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_WIRED_H +#define NM_SETTING_WIRED_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_WIRED (nm_setting_wired_get_type ()) +#define NM_SETTING_WIRED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_WIRED, NMSettingWired)) +#define NM_SETTING_WIRED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_WIRED, NMSettingWiredClass)) +#define NM_IS_SETTING_WIRED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_WIRED)) +#define NM_IS_SETTING_WIRED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_WIRED)) +#define NM_SETTING_WIRED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_WIRED, NMSettingWiredClass)) + +#define NM_SETTING_WIRED_SETTING_NAME "802-3-ethernet" + +typedef enum +{ + NM_SETTING_WIRED_ERROR_UNKNOWN = 0, + NM_SETTING_WIRED_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRED_ERROR_MISSING_PROPERTY +} NMSettingWiredError; + +#define NM_TYPE_SETTING_WIRED_ERROR (nm_setting_wired_error_get_type ()) +GType nm_setting_wired_error_get_type (void); + +#define NM_SETTING_WIRED_ERROR nm_setting_wired_error_quark () +GQuark nm_setting_wired_error_quark (void); + +#define NM_SETTING_WIRED_PORT "port" +#define NM_SETTING_WIRED_SPEED "speed" +#define NM_SETTING_WIRED_DUPLEX "duplex" +#define NM_SETTING_WIRED_AUTO_NEGOTIATE "auto-negotiate" +#define NM_SETTING_WIRED_MAC_ADDRESS "mac-address" +#define NM_SETTING_WIRED_MTU "mtu" + +typedef struct { + NMSetting parent; +} NMSettingWired; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingWiredClass; + +GType nm_setting_wired_get_type (void); + +NMSetting *nm_setting_wired_new (void); +const char *nm_setting_wired_get_port (NMSettingWired *setting); +guint32 nm_setting_wired_get_speed (NMSettingWired *setting); +const char *nm_setting_wired_get_duplex (NMSettingWired *setting); +gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting); +const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting); +guint32 nm_setting_wired_get_mtu (NMSettingWired *setting); + +G_END_DECLS + +#endif /* NM_SETTING_WIRED_H */ diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c new file mode 100644 index 00000000..678a6fad --- /dev/null +++ b/libnm-util/nm-setting-wireless-security.c @@ -0,0 +1,1208 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include "nm-setting-wireless-security.h" +#include "nm-setting-8021x.h" +#include "nm-param-spec-specialized.h" +#include "nm-utils.h" +#include "nm-dbus-glib-types.h" +#include "nm-utils-private.h" + +GQuark +nm_setting_wireless_security_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-wireless-security-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_wireless_security_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The required 802.1x setting is missing */ + ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING, "Missing8021xSetting"), + /* The LEAP authentication algorithm requires use of 802.1x key management. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X, "LEAPRequires8021x"), + /* The LEAP authentication algorithm requires a username. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME, "LEAPRequiresUsername"), + /* Shared Key authentication can only be used with WEP encryption. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP, "SharedKeyRequiresWEP"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingWirelessSecurityError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING) + +#define NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS_SECURITY, NMSettingWirelessSecurityPrivate)) + +typedef struct { + char *key_mgmt; + guint32 wep_tx_keyidx; + char *auth_alg; + GSList *proto; /* GSList of strings */ + GSList *pairwise; /* GSList of strings */ + GSList *group; /* GSList of strings */ + char *leap_username; + char *wep_key0; + char *wep_key1; + char *wep_key2; + char *wep_key3; + char *psk; + char *leap_password; + NMWepKeyType wep_key_type; +} NMSettingWirelessSecurityPrivate; + +enum { + PROP_0, + PROP_KEY_MGMT, + PROP_WEP_TX_KEYIDX, + PROP_AUTH_ALG, + PROP_PROTO, + PROP_PAIRWISE, + PROP_GROUP, + PROP_LEAP_USERNAME, + PROP_WEP_KEY0, + PROP_WEP_KEY1, + PROP_WEP_KEY2, + PROP_WEP_KEY3, + PROP_PSK, + PROP_LEAP_PASSWORD, + PROP_WEP_KEY_TYPE, + + LAST_PROP +}; + +NMSetting * +nm_setting_wireless_security_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRELESS_SECURITY, NULL); +} + +const char * +nm_setting_wireless_security_get_key_mgmt (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + + return NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->key_mgmt; +} + +guint32 +nm_setting_wireless_security_get_num_protos (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), 0); + + return g_slist_length (NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->proto); +} + +const char * +nm_setting_wireless_security_get_proto (NMSettingWirelessSecurity *setting, guint32 i) +{ + NMSettingWirelessSecurityPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + g_return_val_if_fail (i <= g_slist_length (priv->proto), NULL); + + return (const char *) g_slist_nth_data (priv->proto, i); +} + +gboolean +nm_setting_wireless_security_add_proto (NMSettingWirelessSecurity *setting, const char *proto) +{ + NMSettingWirelessSecurityPrivate *priv; + GSList *iter; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE); + g_return_val_if_fail (proto != NULL, FALSE); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + for (iter = priv->proto; iter; iter = g_slist_next (iter)) { + if (!strcmp (proto, (char *) iter->data)) + return FALSE; + } + + priv->proto = g_slist_append (priv->proto, g_ascii_strdown (proto, -1)); + return TRUE; +} + +void +nm_setting_wireless_security_remove_proto (NMSettingWirelessSecurity *setting, guint32 i) +{ + NMSettingWirelessSecurityPrivate *priv; + GSList *elt; + + g_return_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting)); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + elt = g_slist_nth (priv->proto, i); + g_return_if_fail (elt != NULL); + + g_free (elt->data); + priv->proto = g_slist_delete_link (priv->proto, elt); +} + +void +nm_setting_wireless_security_clear_protos (NMSettingWirelessSecurity *setting) +{ + NMSettingWirelessSecurityPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting)); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + nm_utils_slist_free (priv->proto, g_free); + priv->proto = NULL; +} + +guint32 +nm_setting_wireless_security_get_num_pairwise (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), 0); + + return g_slist_length (NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->pairwise); +} + +const char * +nm_setting_wireless_security_get_pairwise (NMSettingWirelessSecurity *setting, guint32 i) +{ + NMSettingWirelessSecurityPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + g_return_val_if_fail (i <= g_slist_length (priv->pairwise), NULL); + + return (const char *) g_slist_nth_data (priv->pairwise, i); +} + +gboolean +nm_setting_wireless_security_add_pairwise (NMSettingWirelessSecurity *setting, const char *pairwise) +{ + NMSettingWirelessSecurityPrivate *priv; + GSList *iter; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE); + g_return_val_if_fail (pairwise != NULL, FALSE); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + for (iter = priv->pairwise; iter; iter = g_slist_next (iter)) { + if (!strcmp (pairwise, (char *) iter->data)) + return FALSE; + } + + priv->pairwise = g_slist_append (priv->pairwise, g_ascii_strdown (pairwise, -1)); + return TRUE; +} + +void +nm_setting_wireless_security_remove_pairwise (NMSettingWirelessSecurity *setting, guint32 i) +{ + NMSettingWirelessSecurityPrivate *priv; + GSList *elt; + + g_return_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting)); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + elt = g_slist_nth (priv->pairwise, i); + g_return_if_fail (elt != NULL); + + g_free (elt->data); + priv->pairwise = g_slist_delete_link (priv->pairwise, elt); +} + +void +nm_setting_wireless_security_clear_pairwise (NMSettingWirelessSecurity *setting) +{ + NMSettingWirelessSecurityPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting)); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + nm_utils_slist_free (priv->pairwise, g_free); + priv->pairwise = NULL; +} + +guint32 +nm_setting_wireless_security_get_num_groups (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), 0); + + return g_slist_length (NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->group); +} + +const char * +nm_setting_wireless_security_get_group (NMSettingWirelessSecurity *setting, guint32 i) +{ + NMSettingWirelessSecurityPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + g_return_val_if_fail (i <= g_slist_length (priv->group), NULL); + + return (const char *) g_slist_nth_data (priv->group, i); +} + +gboolean +nm_setting_wireless_security_add_group (NMSettingWirelessSecurity *setting, const char *group) +{ + NMSettingWirelessSecurityPrivate *priv; + GSList *iter; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE); + g_return_val_if_fail (group != NULL, FALSE); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + for (iter = priv->group; iter; iter = g_slist_next (iter)) { + if (!strcmp (group, (char *) iter->data)) + return FALSE; + } + + priv->group = g_slist_append (priv->group, g_ascii_strdown (group, -1)); + return TRUE; +} + +void +nm_setting_wireless_security_remove_group (NMSettingWirelessSecurity *setting, guint32 i) +{ + NMSettingWirelessSecurityPrivate *priv; + GSList *elt; + + g_return_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting)); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + elt = g_slist_nth (priv->group, i); + g_return_if_fail (elt != NULL); + + g_free (elt->data); + priv->group = g_slist_delete_link (priv->group, elt); +} + +void +nm_setting_wireless_security_clear_groups (NMSettingWirelessSecurity *setting) +{ + NMSettingWirelessSecurityPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting)); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + nm_utils_slist_free (priv->group, g_free); + priv->group = NULL; +} + +const char * +nm_setting_wireless_security_get_psk (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + + return NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->psk; +} + +const char * +nm_setting_wireless_security_get_leap_username (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + + return NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->leap_username; +} + +const char * +nm_setting_wireless_security_get_leap_password (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + + return NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->leap_password; +} + +const char * +nm_setting_wireless_security_get_wep_key (NMSettingWirelessSecurity *setting, guint32 idx) +{ + NMSettingWirelessSecurityPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + g_return_val_if_fail (idx < 4, NULL); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + if (idx == 0) + return priv->wep_key0; + else if (idx == 1) + return priv->wep_key1; + else if (idx == 2) + return priv->wep_key2; + else if (idx == 3) + return priv->wep_key3; + + g_assert_not_reached (); + return NULL; +} + +void +nm_setting_wireless_security_set_wep_key (NMSettingWirelessSecurity *setting, guint32 idx, const char *key) +{ + NMSettingWirelessSecurityPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting)); + g_return_if_fail (idx < 4); + + priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + switch (idx) { + case 0: + g_free (priv->wep_key0); + priv->wep_key0 = g_strdup (key); + break; + case 1: + g_free (priv->wep_key1); + priv->wep_key1 = g_strdup (key); + break; + case 2: + g_free (priv->wep_key2); + priv->wep_key2 = g_strdup (key); + break; + case 3: + g_free (priv->wep_key3); + priv->wep_key3 = g_strdup (key); + break; + default: + g_assert_not_reached (); + } +} + +guint32 +nm_setting_wireless_security_get_wep_tx_keyidx (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), 0); + + return NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->wep_tx_keyidx; +} + +const char * +nm_setting_wireless_security_get_auth_alg (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), NULL); + + return NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->auth_alg; +} + +NMWepKeyType +nm_setting_wireless_security_get_wep_key_type (NMSettingWirelessSecurity *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), 0); + + return NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting)->wep_key_type; +} + +static gboolean +verify_wep_key (const char *key, NMWepKeyType wep_type) +{ + int keylen, i; + + if (!key) + return FALSE; + + keylen = strlen (key); + if (wep_type == NM_WEP_KEY_TYPE_KEY || NM_WEP_KEY_TYPE_UNKNOWN) { + if (keylen == 10 || keylen == 26) { + /* Hex key */ + for (i = 0; i < keylen; i++) { + if (!isxdigit (key[i])) + return FALSE; + } + } else if (keylen == 5 || keylen == 13) { + /* ASCII key */ + for (i = 0; i < keylen; i++) { + if (!isascii (key[i])) + return FALSE; + } + } else + return FALSE; + + } else if (wep_type == NM_WEP_KEY_TYPE_PASSPHRASE) { + if (!keylen || keylen > 64) + return FALSE; + } + + return TRUE; +} + +static gboolean +verify_wpa_psk (const char *psk) +{ + int psklen, i; + + if (!psk) + return FALSE; + + psklen = strlen (psk); + if (psklen < 8 || psklen > 64) + return FALSE; + + if (psklen == 64) { + /* Hex PSK */ + for (i = 0; i < psklen; i++) { + if (!isxdigit (psk[i])) + return FALSE; + } + } + + return TRUE; +} + + +static GPtrArray * +need_secrets (NMSetting *setting) +{ + NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY (setting); + NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (self); + GPtrArray *secrets; + + secrets = g_ptr_array_sized_new (4); + if (!secrets) { + g_warning ("Not enough memory to create required secrets array."); + return NULL; + } + + g_assert (priv->key_mgmt); + + /* Static WEP */ + if (strcmp (priv->key_mgmt, "none") == 0) { + if ((priv->wep_tx_keyidx == 0) && !verify_wep_key (priv->wep_key0, priv->wep_key_type)) { + g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + return secrets; + } + if ((priv->wep_tx_keyidx == 1) && !verify_wep_key (priv->wep_key1, priv->wep_key_type)) { + g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + return secrets; + } + if ((priv->wep_tx_keyidx == 2) && !verify_wep_key (priv->wep_key2, priv->wep_key_type)) { + g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + return secrets; + } + if ((priv->wep_tx_keyidx == 3) && !verify_wep_key (priv->wep_key3, priv->wep_key_type)) { + g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + return secrets; + } + goto no_secrets; + } + + /* WPA-PSK infrastructure and adhoc */ + if ( (strcmp (priv->key_mgmt, "wpa-none") == 0) + || (strcmp (priv->key_mgmt, "wpa-psk") == 0)) { + if (!verify_wpa_psk (priv->psk)) { + g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_PSK); + return secrets; + } + goto no_secrets; + } + + /* LEAP */ + if ( priv->auth_alg + && !strcmp (priv->auth_alg, "leap") + && !strcmp (priv->key_mgmt, "ieee8021x")) { + if (!priv->leap_password || !strlen (priv->leap_password)) { + g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD); + return secrets; + } + goto no_secrets; + } + + if ( (strcmp (priv->key_mgmt, "ieee8021x") == 0) + || (strcmp (priv->key_mgmt, "wpa-eap") == 0)) { + /* Let caller check the 802.1x setting for secrets */ + goto no_secrets; + } + + g_assert_not_reached (); + return secrets; + +no_secrets: + if (secrets) + g_ptr_array_free (secrets, TRUE); + return NULL; +} + +static gint +find_setting_by_name (gconstpointer a, gconstpointer b) +{ + NMSetting *setting = NM_SETTING (a); + const char *str = (const char *) b; + + return strcmp (nm_setting_get_name (setting), str); +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY (setting); + NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (self); + const char *valid_key_mgmt[] = { "none", "ieee8021x", "wpa-none", "wpa-psk", "wpa-eap", NULL }; + const char *valid_auth_algs[] = { "open", "shared", "leap", NULL }; + const char *valid_protos[] = { "wpa", "rsn", NULL }; + const char *valid_pairwise[] = { "wep40", "wep104", "tkip", "ccmp", NULL }; + const char *valid_groups[] = { "wep40", "wep104", "tkip", "ccmp", NULL }; + + if (!priv->key_mgmt) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + return FALSE; + } + + if (!_nm_utils_string_in_list (priv->key_mgmt, valid_key_mgmt)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + return FALSE; + } + + if (priv->auth_alg && !strcmp (priv->auth_alg, "leap")) { + /* LEAP must use ieee8021x key management */ + if (strcmp (priv->key_mgmt, "ieee8021x")) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + return FALSE; + } + if (!priv->leap_username) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME, + NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME); + return FALSE; + } + if (priv->leap_password && !strlen (priv->leap_password)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD); + return FALSE; + } + } else { + if ( (strcmp (priv->key_mgmt, "ieee8021x") == 0) + || (strcmp (priv->key_mgmt, "wpa-eap") == 0)) { + /* Need an 802.1x setting too */ + if (!g_slist_find_custom (all_settings, NM_SETTING_802_1X_SETTING_NAME, find_setting_by_name)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING, + NULL); + return FALSE; + } + } + } + + if (priv->leap_username && !strlen (priv->leap_username)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME); + return FALSE; + } + + if (priv->wep_tx_keyidx > 3) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + return FALSE; + } + + if (priv->wep_key_type > NM_WEP_KEY_TYPE_LAST) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE); + return FALSE; + } + + if (priv->wep_key0 && !verify_wep_key (priv->wep_key0, priv->wep_key_type)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + return FALSE; + } + if (priv->wep_key1 && !verify_wep_key (priv->wep_key1, priv->wep_key_type)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + return FALSE; + } + if (priv->wep_key2 && !verify_wep_key (priv->wep_key2, priv->wep_key_type)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + return FALSE; + } + if (priv->wep_key3 && !verify_wep_key (priv->wep_key3, priv->wep_key_type)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + 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 (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + return FALSE; + } + + if (priv->psk && !verify_wpa_psk (priv->psk)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_PSK); + return FALSE; + } + + if (priv->proto && !_nm_utils_string_slist_validate (priv->proto, valid_protos)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_PROTO); + return FALSE; + } + + if (priv->pairwise) { + const char *wpa_none[] = { "wpa-none", NULL }; + + /* For ad-hoc connections, pairwise must be "none" */ + if (_nm_utils_string_in_list (priv->key_mgmt, wpa_none)) { + GSList *iter; + gboolean found = FALSE; + + for (iter = priv->pairwise; iter; iter = g_slist_next (iter)) { + if (!strcmp ((char *) iter->data, "none")) { + found = TRUE; + break; + } + } + + /* pairwise cipher list didn't contain "none", which is invalid + * for WPA adhoc connections. + */ + if (!found) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_PAIRWISE); + return FALSE; + } + } else if (!_nm_utils_string_slist_validate (priv->pairwise, valid_pairwise)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_PAIRWISE); + return FALSE; + } + } + + if (priv->group && !_nm_utils_string_slist_validate (priv->group, valid_groups)) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_GROUP); + return FALSE; + } + + /* Shared Key auth can only be used with WEP */ + if (priv->auth_alg && !strcmp (priv->auth_alg, "shared")) { + if (priv->key_mgmt && strcmp (priv->key_mgmt, "none")) { + g_set_error (error, + NM_SETTING_WIRELESS_SECURITY_ERROR, + NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + return FALSE; + } + } + + return TRUE; +} + +static void +nm_setting_wireless_security_init (NMSettingWirelessSecurity *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY (object); + NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (self); + + /* Strings first. g_free() already checks for NULLs so we don't have to */ + + g_free (priv->key_mgmt); + g_free (priv->auth_alg); + g_free (priv->leap_username); + g_free (priv->wep_key0); + g_free (priv->wep_key1); + g_free (priv->wep_key2); + g_free (priv->wep_key3); + g_free (priv->psk); + g_free (priv->leap_password); + + nm_utils_slist_free (priv->proto, g_free); + nm_utils_slist_free (priv->pairwise, g_free); + nm_utils_slist_free (priv->group, g_free); + + G_OBJECT_CLASS (nm_setting_wireless_security_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingWirelessSecurity *setting = NM_SETTING_WIRELESS_SECURITY (object); + NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + const char *str; + + switch (prop_id) { + case PROP_KEY_MGMT: + g_free (priv->key_mgmt); + str = g_value_get_string (value); + priv->key_mgmt = str ? g_ascii_strdown (str, -1) : NULL; + break; + case PROP_WEP_TX_KEYIDX: + priv->wep_tx_keyidx = g_value_get_uint (value); + break; + case PROP_AUTH_ALG: + g_free (priv->auth_alg); + str = g_value_get_string (value); + priv->auth_alg = str ? g_ascii_strdown (str, -1) : NULL; + break; + case PROP_PROTO: + nm_utils_slist_free (priv->proto, g_free); + priv->proto = g_value_dup_boxed (value); + break; + case PROP_PAIRWISE: + nm_utils_slist_free (priv->pairwise, g_free); + priv->pairwise = g_value_dup_boxed (value); + break; + case PROP_GROUP: + nm_utils_slist_free (priv->group, g_free); + priv->group = g_value_dup_boxed (value); + break; + case PROP_LEAP_USERNAME: + g_free (priv->leap_username); + priv->leap_username = g_value_dup_string (value); + break; + case PROP_WEP_KEY0: + nm_setting_wireless_security_set_wep_key (setting, 0, g_value_get_string (value)); + break; + case PROP_WEP_KEY1: + nm_setting_wireless_security_set_wep_key (setting, 1, g_value_get_string (value)); + break; + case PROP_WEP_KEY2: + nm_setting_wireless_security_set_wep_key (setting, 2, g_value_get_string (value)); + break; + case PROP_WEP_KEY3: + nm_setting_wireless_security_set_wep_key (setting, 3, g_value_get_string (value)); + break; + case PROP_PSK: + g_free (priv->psk); + priv->psk = g_value_dup_string (value); + break; + case PROP_LEAP_PASSWORD: + g_free (priv->leap_password); + priv->leap_password = g_value_dup_string (value); + break; + case PROP_WEP_KEY_TYPE: + priv->wep_key_type = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingWirelessSecurity *setting = NM_SETTING_WIRELESS_SECURITY (object); + NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_KEY_MGMT: + g_value_set_string (value, priv->key_mgmt); + break; + case PROP_WEP_TX_KEYIDX: + g_value_set_uint (value, priv->wep_tx_keyidx); + break; + case PROP_AUTH_ALG: + g_value_set_string (value, priv->auth_alg); + break; + case PROP_PROTO: + g_value_set_boxed (value, priv->proto); + break; + case PROP_PAIRWISE: + g_value_set_boxed (value, priv->pairwise); + break; + case PROP_GROUP: + g_value_set_boxed (value, priv->group); + break; + case PROP_LEAP_USERNAME: + g_value_set_string (value, priv->leap_username); + break; + case PROP_WEP_KEY0: + g_value_set_string (value, priv->wep_key0); + break; + case PROP_WEP_KEY1: + g_value_set_string (value, priv->wep_key1); + break; + case PROP_WEP_KEY2: + g_value_set_string (value, priv->wep_key2); + break; + case PROP_WEP_KEY3: + g_value_set_string (value, priv->wep_key3); + break; + case PROP_PSK: + g_value_set_string (value, priv->psk); + break; + case PROP_LEAP_PASSWORD: + g_value_set_string (value, priv->leap_password); + break; + case PROP_WEP_KEY_TYPE: + g_value_set_uint (value, priv->wep_key_type); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *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 (NMSettingWirelessSecurityPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + parent_class->verify = verify; + parent_class->need_secrets = need_secrets; + + /* Properties */ + /** + * NMSettingWirelessSecurity:key-mgmt: + * + * Key management used for the connection. One of 'none' (WEP), 'ieee8021x' + * (Dynamic WEP), 'wpa-none' (Ad-Hoc WPA-PSK), 'wpa-psk' (infrastructure + * WPA-PSK), or 'wpa-eap' (WPA-Enterprise). This property must be set for + * any WiFi connection that uses security. + **/ + g_object_class_install_property + (object_class, PROP_KEY_MGMT, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, + "Key management", + "Key management used for the connection. One of " + "'none' (WEP), 'ieee8021x' (Dynamic WEP), 'wpa-none' " + "(WPA-PSK Ad-Hoc), 'wpa-psk' (infrastructure WPA-PSK), " + "or 'wpa-eap' (WPA-Enterprise). This property must " + "be set for any WiFi connection that uses security.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_REQUIRED)); + + /** + * NMSettingWirelessSecurity:wep-tx-keyidx: + * + * When static WEP is used (ie, key-mgmt = 'none') and a non-default WEP key + * index is used by the AP, put that WEP key index here. Valid values are 0 + * (default key) through 3. Note that some consumer access points (like the + * Linksys WRT54G) number the keys 1 - 4. + **/ + g_object_class_install_property + (object_class, PROP_WEP_TX_KEYIDX, + g_param_spec_uint (NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, + "WEP TX key index", + "When static WEP is used (ie, key-mgmt = 'none') and a " + "non-default WEP key index is used by the AP, put that " + "WEP key index here. Valid values are 0 (default key) " + "through 3. Note that some consumer access points " + "(like the Linksys WRT54G) number the keys 1 - 4.", + 0, 3, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWirelessSecurity:auth-alg: + * + * When WEP is used (ie, key-mgmt = 'none' or 'ieee8021x') indicate the + * 802.11 authentication algorithm required by the AP here. One of 'open' + * for Open System, 'shared' for Shared Key, or 'leap' for Cisco LEAP. + * When using Cisco LEAP (ie, key-mgmt = 'ieee8021x' and auth-alg = 'leap') + * the 'leap-username' and 'leap-password' properties must be specified. + **/ + g_object_class_install_property + (object_class, PROP_AUTH_ALG, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, + "AuthAlg", + "When WEP is used (ie, key-mgmt = 'none' or " + "'ieee8021x') indicate the 802.11 authentication " + "algorithm required by the AP here. One of 'open' for " + "Open System, 'shared' for Shared Key, or 'leap' for " + "Cisco LEAP. When using Cisco LEAP (ie, key-mgmt = " + "'ieee8021x' and auth-alg = 'leap') the 'leap-username' " + "and 'leap-password' properties must be specified.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWirelessSecurity:proto: + * + * List of strings specifying the allowed WPA protocol versions to use. + * Each element may be one 'wpa' (allow WPA) or 'rsn' (allow WPA2/RSN). If + * not specified, both WPA and RSN connections are allowed. + **/ + g_object_class_install_property + (object_class, PROP_PROTO, + _nm_param_spec_specialized (NM_SETTING_WIRELESS_SECURITY_PROTO, + "Proto", + "List of strings specifying the allowed WPA " + "protocol versions to use. Each element may be " + "one 'wpa' (allow WPA) or 'rsn' (allow " + "WPA2/RSN). If not specified, both WPA and RSN " + "connections are allowed.", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWirelessSecurity:pairwise: + * + * If specified, will only connect to WPA networks that provide the + * specified pairwise encryption capabilities. Each element may be one of + * 'wep40', 'wep104', 'tkip', or 'ccmp'. + **/ + g_object_class_install_property + (object_class, PROP_PAIRWISE, + _nm_param_spec_specialized (NM_SETTING_WIRELESS_SECURITY_PAIRWISE, + "Pairwise", + "If specified, will only connect to WPA networks " + "that provide the specified pairwise encryption " + "capabilities. Each element may be one of 'wep40', " + "'wep104', 'tkip', or 'ccmp'.", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWirelessSecurity:group: + * + * If specified, will only connect to WPA networks that provide the + * specified group/multicast encryption capabilities. Each element may be + * one of 'wep40', 'wep104', 'tkip', or 'ccmp'. + **/ + g_object_class_install_property + (object_class, PROP_GROUP, + _nm_param_spec_specialized (NM_SETTING_WIRELESS_SECURITY_GROUP, + "Group", + "If specified, will only connect to WPA networks " + "that provide the specified group/multicast " + "encryption capabilities. Each element may be " + "one of 'wep40', 'wep104', 'tkip', or 'ccmp'.", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWirelessSecurity:leap-username: + * + * The login username for legacy LEAP connections (ie, key-mgmt = + * 'ieee8021x' and auth-alg = 'leap'). + **/ + g_object_class_install_property + (object_class, PROP_LEAP_USERNAME, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, + "LEAP Username", + "The login username for legacy LEAP connections " + "(ie, key-mgmt = 'ieee8021x' and auth-alg = 'leap').", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWirelessSecurity:wep-key0: + * + * 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. + **/ + g_object_class_install_property + (object_class, PROP_WEP_KEY0, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, + "WEP key0", + "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.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingWirelessSecurity:wep-key1: + * + * 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. + **/ + g_object_class_install_property + (object_class, PROP_WEP_KEY1, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, + "WEP key1", + "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.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingWirelessSecurity:wep-key2: + * + * 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. + **/ + g_object_class_install_property + (object_class, PROP_WEP_KEY2, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, + "WEP key2", + "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.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingWirelessSecurity:wep-key3: + * + * 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. + **/ + g_object_class_install_property + (object_class, PROP_WEP_KEY3, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, + "WEP key3", + "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.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingWirelessSecurity:psk: + * + * Pre-Shared-Key for WPA networks. If the key is 64-characters long, it + * must contain only hexadecimal characters and is interpreted as a + * hexadecimal WPA key. Otherwise, the key must be between 8 and 63 ASCII + * characters (as specified in the 802.11i standard) and is interpreted as + * a WPA passphrase, and is hashed to derive the actual WPA-PSK used when + * connecting to the WiFi network. + **/ + g_object_class_install_property + (object_class, PROP_PSK, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_PSK, + "PSK", + "Pre-Shared-Key for WPA networks. If the key is " + "64-characters long, it must contain only hexadecimal " + "characters and is interpreted as a hexadecimal WPA " + "key. Otherwise, the key must be between 8 and 63 " + "ASCII characters (as specified in the 802.11i standard) " + "and is interpreted as a WPA passphrase, and is hashed " + "to derive the actual WPA-PSK used when connecting to " + "the WiFi network.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingWirelessSecurity:leap-password: + * + * The login password for legacy LEAP connections (ie, key-mgmt = + * 'ieee8021x' and auth-alg = 'leap'). + **/ + g_object_class_install_property + (object_class, PROP_LEAP_PASSWORD, + g_param_spec_string (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, + "LEAP Password", + "The login password for legacy LEAP connections " + "(ie, key-mgmt = 'ieee8021x' and auth-alg = 'leap').", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_SECRET)); + + /** + * NMSettingWirelessSecurity:wep-key-type: + * + * Controls the interpretation of WEP keys. Allowed values are 1 (interpret + * WEP keys as hexadecimal or ASCII keys) or 2 (interpret WEP keys as WEP + * Passphrases). If set to 1 and the keys are hexadecimal, they must be + * either 10 or 26 characters in length. If set to 1 and the keys are + * ASCII keys, they must be either 5 or 13 characters in length. If set to + * 2, the passphrase is hashed using the de-facto MD5 method to derive the + * actual WEP key. + **/ + g_object_class_install_property + (object_class, PROP_WEP_KEY_TYPE, + g_param_spec_uint (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, + "WEP Key Type", + "Controls the interpretation of WEP keys. Allowed values " + "are 1 (interpret WEP keys as hexadecimal or ASCII keys) " + "or 2 (interpret WEP keys as WEP Passphrases). If set to " + "1 and the keys are hexadecimal, they must be either 10 or " + "26 characters in length. If set to 1 and the keys are " + "ASCII keys, they must be either 5 or 13 characters in " + "length. If set to 2, the passphrase is hashed using " + " the de-facto MD5 method to derive the actual WEP key.", + NM_WEP_KEY_TYPE_UNKNOWN, + NM_WEP_KEY_TYPE_LAST, + NM_WEP_KEY_TYPE_UNKNOWN, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); +} diff --git a/libnm-util/nm-setting-wireless-security.h b/libnm-util/nm-setting-wireless-security.h new file mode 100644 index 00000000..90d971b2 --- /dev/null +++ b/libnm-util/nm-setting-wireless-security.h @@ -0,0 +1,133 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_WIRELESS_SECURITY_H +#define NM_SETTING_WIRELESS_SECURITY_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_get_type ()) +#define NM_SETTING_WIRELESS_SECURITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_WIRELESS_SECURITY, NMSettingWirelessSecurity)) +#define NM_SETTING_WIRELESS_SECURITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_WIRELESS_SECURITY, NMSettingWirelessSecurityClass)) +#define NM_IS_SETTING_WIRELESS_SECURITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_WIRELESS_SECURITY)) +#define NM_IS_SETTING_WIRELESS_SECURITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_WIRELESS_SECURITY)) +#define NM_SETTING_WIRELESS_SECURITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_WIRELESS_SECURITY, NMSettingWirelessSecurityClass)) + +#define NM_SETTING_WIRELESS_SECURITY_SETTING_NAME "802-11-wireless-security" + +typedef enum +{ + NM_SETTING_WIRELESS_SECURITY_ERROR_UNKNOWN = 0, + NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_PROPERTY, + NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING, + NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X, + NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME, + NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP +} NMSettingWirelessSecurityError; + +#define NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR (nm_setting_wireless_security_error_get_type ()) +GType nm_setting_wireless_security_error_get_type (void); + +#define NM_SETTING_WIRELESS_SECURITY_ERROR nm_setting_wireless_security_error_quark () +GQuark nm_setting_wireless_security_error_quark (void); + +typedef enum { + NM_WEP_KEY_TYPE_UNKNOWN = 0, + NM_WEP_KEY_TYPE_KEY = 1, /* Hex or ASCII */ + NM_WEP_KEY_TYPE_PASSPHRASE = 2, /* 104/128-bit Passphrase */ + + NM_WEP_KEY_TYPE_LAST = NM_WEP_KEY_TYPE_PASSPHRASE +} NMWepKeyType; + +#define NM_SETTING_WIRELESS_SECURITY_KEY_MGMT "key-mgmt" +#define NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX "wep-tx-keyidx" +#define NM_SETTING_WIRELESS_SECURITY_AUTH_ALG "auth-alg" +#define NM_SETTING_WIRELESS_SECURITY_PROTO "proto" +#define NM_SETTING_WIRELESS_SECURITY_PAIRWISE "pairwise" +#define NM_SETTING_WIRELESS_SECURITY_GROUP "group" +#define NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME "leap-username" +#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY0 "wep-key0" +#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY1 "wep-key1" +#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY2 "wep-key2" +#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY3 "wep-key3" +#define NM_SETTING_WIRELESS_SECURITY_PSK "psk" +#define NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD "leap-password" +#define NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE "wep-key-type" + +typedef struct { + NMSetting parent; +} NMSettingWirelessSecurity; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingWirelessSecurityClass; + +GType nm_setting_wireless_security_get_type (void); + +NMSetting * nm_setting_wireless_security_new (void); + +const char *nm_setting_wireless_security_get_key_mgmt (NMSettingWirelessSecurity *setting); + +guint32 nm_setting_wireless_security_get_num_protos (NMSettingWirelessSecurity *setting); +const char *nm_setting_wireless_security_get_proto (NMSettingWirelessSecurity *setting, guint32 i); +gboolean nm_setting_wireless_security_add_proto (NMSettingWirelessSecurity *setting, const char *proto); +void nm_setting_wireless_security_remove_proto (NMSettingWirelessSecurity *setting, guint32 i); +void nm_setting_wireless_security_clear_protos (NMSettingWirelessSecurity *setting); + +guint32 nm_setting_wireless_security_get_num_pairwise (NMSettingWirelessSecurity *setting); +const char *nm_setting_wireless_security_get_pairwise (NMSettingWirelessSecurity *setting, guint32 i); +gboolean nm_setting_wireless_security_add_pairwise (NMSettingWirelessSecurity *setting, const char *pairwise); +void nm_setting_wireless_security_remove_pairwise (NMSettingWirelessSecurity *setting, guint32 i); +void nm_setting_wireless_security_clear_pairwise (NMSettingWirelessSecurity *setting); + +guint32 nm_setting_wireless_security_get_num_groups (NMSettingWirelessSecurity *setting); +const char *nm_setting_wireless_security_get_group (NMSettingWirelessSecurity *setting, guint32 i); +gboolean nm_setting_wireless_security_add_group (NMSettingWirelessSecurity *setting, const char *group); +void nm_setting_wireless_security_remove_group (NMSettingWirelessSecurity *setting, guint32 i); +void nm_setting_wireless_security_clear_groups (NMSettingWirelessSecurity *setting); + +const char *nm_setting_wireless_security_get_psk (NMSettingWirelessSecurity *setting); + +const char *nm_setting_wireless_security_get_leap_username (NMSettingWirelessSecurity *setting); +const char *nm_setting_wireless_security_get_leap_password (NMSettingWirelessSecurity *setting); + +const char *nm_setting_wireless_security_get_wep_key (NMSettingWirelessSecurity *setting, guint32 idx); +void nm_setting_wireless_security_set_wep_key (NMSettingWirelessSecurity *setting, guint32 idx, const char *key); +guint32 nm_setting_wireless_security_get_wep_tx_keyidx (NMSettingWirelessSecurity *setting); +const char *nm_setting_wireless_security_get_auth_alg (NMSettingWirelessSecurity *setting); +NMWepKeyType nm_setting_wireless_security_get_wep_key_type (NMSettingWirelessSecurity *setting); + +G_END_DECLS + +#endif /* NM_SETTING_WIRELESS_SECURITY_H */ diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c new file mode 100644 index 00000000..9213429c --- /dev/null +++ b/libnm-util/nm-setting-wireless.c @@ -0,0 +1,909 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include + +#include "wireless-helper.h" + +#include "NetworkManager.h" +#include "nm-setting-wireless.h" +#include "nm-param-spec-specialized.h" +#include "nm-utils.h" +#include "nm-dbus-glib-types.h" +#include "nm-utils-private.h" + +GQuark +nm_setting_wireless_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-wireless-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_wireless_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Unknown error. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_UNKNOWN, "UnknownError"), + /* The specified property was invalid. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, "InvalidProperty"), + /* The specified property was missing and is required. */ + ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_MISSING_PROPERTY, "MissingProperty"), + /* The required security setting is missing */ + ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING, "MissingSecuritySetting"), + /* The 'channel' property requires a valid 'band' */ + ENUM_ENTRY (NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND, "ChannelRequiresBand"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingWirelessError", values); + } + return etype; +} + + +G_DEFINE_TYPE (NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING) + +#define NM_SETTING_WIRELESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS, NMSettingWirelessPrivate)) + +typedef struct { + GByteArray *ssid; + char *mode; + char *band; + guint32 channel; + GByteArray *bssid; + guint32 rate; + guint32 tx_power; + GByteArray *mac_address; + guint32 mtu; + GSList *seen_bssids; + char *security; +} NMSettingWirelessPrivate; + +enum { + PROP_0, + PROP_SSID, + PROP_MODE, + PROP_BAND, + PROP_CHANNEL, + PROP_BSSID, + PROP_RATE, + PROP_TX_POWER, + PROP_MAC_ADDRESS, + PROP_MTU, + PROP_SEEN_BSSIDS, + PROP_SEC, + + LAST_PROP +}; + +static gboolean +match_cipher (const char *cipher, + const char *expected, + guint32 wpa_flags, + guint32 rsn_flags, + guint32 flag) +{ + if (strcmp (cipher, expected) != 0) + return FALSE; + + if (!(wpa_flags & flag) && !(rsn_flags & flag)) + return FALSE; + + return TRUE; +} + +gboolean +nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless, + NMSettingWirelessSecurity *s_wireless_sec, + guint32 ap_flags, + guint32 ap_wpa, + guint32 ap_rsn, + guint32 ap_mode) +{ + NMSettingWirelessPrivate *priv; + const char *key_mgmt = NULL, *cipher; + guint32 num, i; + gboolean found = FALSE; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (s_wireless), FALSE); + + priv = NM_SETTING_WIRELESS_GET_PRIVATE (s_wireless); + + if (!priv->security) { + if ( (ap_flags & NM_802_11_AP_FLAGS_PRIVACY) + || (ap_wpa != NM_802_11_AP_SEC_NONE) + || (ap_rsn != NM_802_11_AP_SEC_NONE)) + return FALSE; + return TRUE; + } + + if (strcmp (priv->security, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) != 0) + return FALSE; + + if (s_wireless_sec) + key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wireless_sec); + + if (s_wireless_sec == NULL || !key_mgmt) + return FALSE; + + /* Static WEP */ + if (!strcmp (key_mgmt, "none")) { + if ( !(ap_flags & NM_802_11_AP_FLAGS_PRIVACY) + || (ap_wpa != NM_802_11_AP_SEC_NONE) + || (ap_rsn != NM_802_11_AP_SEC_NONE)) + return FALSE; + return TRUE; + } + + /* Adhoc WPA */ + if (!strcmp (key_mgmt, "wpa-none")) { + if (ap_mode != NM_802_11_MODE_ADHOC) + return FALSE; + // FIXME: validate ciphers if the BSSID actually puts WPA/RSN IE in + // it's beacon + return TRUE; + } + + /* Stuff after this point requires infrastructure */ + if (ap_mode != NM_802_11_MODE_INFRA) + return FALSE; + + /* Dynamic WEP or LEAP */ + if (!strcmp (key_mgmt, "ieee8021x")) { + if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY)) + return FALSE; + + /* If the AP is advertising a WPA IE, make sure it supports WEP ciphers */ + if (ap_wpa != NM_802_11_AP_SEC_NONE) { + if (!(ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + return FALSE; + + /* quick check; can't use AP if it doesn't support at least one + * WEP cipher in both pairwise and group suites. + */ + if ( !(ap_wpa & (NM_802_11_AP_SEC_PAIR_WEP40 | NM_802_11_AP_SEC_PAIR_WEP104)) + || !(ap_wpa & (NM_802_11_AP_SEC_GROUP_WEP40 | NM_802_11_AP_SEC_GROUP_WEP104))) + return FALSE; + + /* Match at least one pairwise cipher with AP's capability if the + * wireless-security setting explicitly lists pairwise ciphers + */ + num = nm_setting_wireless_security_get_num_pairwise (s_wireless_sec); + for (i = 0, found = FALSE; i < num; i++) { + cipher = nm_setting_wireless_security_get_pairwise (s_wireless_sec, i); + if ((found = match_cipher (cipher, "wep40", ap_wpa, ap_wpa, NM_802_11_AP_SEC_PAIR_WEP40))) + break; + if ((found = match_cipher (cipher, "wep104", ap_wpa, ap_wpa, NM_802_11_AP_SEC_PAIR_WEP104))) + break; + } + if (!found && num) + return FALSE; + + /* Match at least one group cipher with AP's capability if the + * wireless-security setting explicitly lists group ciphers + */ + num = nm_setting_wireless_security_get_num_groups (s_wireless_sec); + for (i = 0, found = FALSE; i < num; i++) { + cipher = nm_setting_wireless_security_get_group (s_wireless_sec, i); + if ((found = match_cipher (cipher, "wep40", ap_wpa, ap_wpa, NM_802_11_AP_SEC_GROUP_WEP40))) + break; + if ((found = match_cipher (cipher, "wep104", ap_wpa, ap_wpa, NM_802_11_AP_SEC_GROUP_WEP104))) + break; + } + if (!found && num) + return FALSE; + } + return TRUE; + } + + /* WPA[2]-PSK and WPA[2] Enterprise */ + if ( !strcmp (key_mgmt, "wpa-psk") + || !strcmp (key_mgmt, "wpa-eap")) { + + if (!strcmp (key_mgmt, "wpa-psk")) { + if ( !(ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_PSK) + && !(ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_PSK)) + return FALSE; + } else if (!strcmp (key_mgmt, "wpa-eap")) { + if ( !(ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_802_1X) + && !(ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + return FALSE; + } + + // FIXME: should handle WPA and RSN separately here to ensure that + // if the Connection only uses WPA we don't match a cipher against + // the AP's RSN IE instead + + /* Match at least one pairwise cipher with AP's capability if the + * wireless-security setting explicitly lists pairwise ciphers + */ + num = nm_setting_wireless_security_get_num_pairwise (s_wireless_sec); + for (i = 0, found = FALSE; i < num; i++) { + cipher = nm_setting_wireless_security_get_pairwise (s_wireless_sec, i); + if ((found = match_cipher (cipher, "tkip", ap_wpa, ap_rsn, NM_802_11_AP_SEC_PAIR_TKIP))) + break; + if ((found = match_cipher (cipher, "ccmp", ap_wpa, ap_rsn, NM_802_11_AP_SEC_PAIR_CCMP))) + break; + } + if (!found && num) + return FALSE; + + /* Match at least one group cipher with AP's capability if the + * wireless-security setting explicitly lists group ciphers + */ + num = nm_setting_wireless_security_get_num_groups (s_wireless_sec); + for (i = 0, found = FALSE; i < num; i++) { + cipher = nm_setting_wireless_security_get_group (s_wireless_sec, i); + + if ((found = match_cipher (cipher, "wep40", ap_wpa, ap_rsn, NM_802_11_AP_SEC_GROUP_WEP40))) + break; + if ((found = match_cipher (cipher, "wep104", ap_wpa, ap_rsn, NM_802_11_AP_SEC_GROUP_WEP104))) + break; + if ((found = match_cipher (cipher, "tkip", ap_wpa, ap_rsn, NM_802_11_AP_SEC_GROUP_TKIP))) + break; + if ((found = match_cipher (cipher, "ccmp", ap_wpa, ap_rsn, NM_802_11_AP_SEC_GROUP_CCMP))) + break; + } + if (!found && num) + return FALSE; + + return TRUE; + } + + return FALSE; +} + +NMSetting * +nm_setting_wireless_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRELESS, NULL); +} + +const GByteArray * +nm_setting_wireless_get_ssid (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->ssid; +} + +const char * +nm_setting_wireless_get_mode (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mode; +} + +const char * +nm_setting_wireless_get_band (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->band; +} + +guint32 +nm_setting_wireless_get_channel (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->channel; +} + +const GByteArray * +nm_setting_wireless_get_bssid (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->bssid; +} + +guint32 +nm_setting_wireless_get_rate (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->rate; +} + +guint32 +nm_setting_wireless_get_tx_power (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->tx_power; +} + +const GByteArray * +nm_setting_wireless_get_mac_address (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address; +} + +guint32 +nm_setting_wireless_get_mtu (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mtu; +} + +const char * +nm_setting_wireless_get_security (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->security; +} + +gboolean +nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting, + const char *bssid) +{ + NMSettingWirelessPrivate *priv; + char *lower_bssid; + GSList *iter; + gboolean found = FALSE; + + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE); + g_return_val_if_fail (bssid != NULL, FALSE); + + lower_bssid = g_ascii_strdown (bssid, -1); + if (!lower_bssid) + return FALSE; + + priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting); + + for (iter = priv->seen_bssids; iter; iter = iter->next) { + if (!strcmp ((char *) iter->data, lower_bssid)) { + found = TRUE; + break; + } + } + + if (!found) + priv->seen_bssids = g_slist_prepend (priv->seen_bssids, lower_bssid); + else + g_free (lower_bssid); + + return !found; +} + +guint32 +nm_setting_wireless_get_num_seen_bssids (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); + + return g_slist_length (NM_SETTING_WIRELESS_GET_PRIVATE (setting)->seen_bssids); +} + +const char * +nm_setting_wireless_get_seen_bssid (NMSettingWireless *setting, + guint32 i) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL); + + return (const char *) g_slist_nth_data (NM_SETTING_WIRELESS_GET_PRIVATE (setting)->seen_bssids, i); +} + +static gint +find_setting_by_name (gconstpointer a, gconstpointer b) +{ + NMSetting *setting = NM_SETTING (a); + const char *str = (const char *) b; + + return strcmp (nm_setting_get_name (setting), str); +} + +static gboolean +verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting); + const char *valid_modes[] = { "infrastructure", "adhoc", NULL }; + const char *valid_bands[] = { "a", "bg", NULL }; + GSList *iter; + + if (!priv->ssid) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_MISSING_PROPERTY, + NM_SETTING_WIRELESS_SSID); + return FALSE; + } + + if (!priv->ssid->len || priv->ssid->len > 32) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SSID); + return FALSE; + } + + if (priv->mode && !_nm_utils_string_in_list (priv->mode, valid_modes)) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_MODE); + return FALSE; + } + + if (priv->band && !_nm_utils_string_in_list (priv->band, valid_bands)) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_BAND); + return FALSE; + } + + if (priv->channel && !priv->band) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND, + NM_SETTING_WIRELESS_BAND); + return FALSE; + } + + if (priv->channel) { + if (!strcmp (priv->band, "a")) { + int i; + int valid_channels[] = { 7, 8, 9, 11, 12, 16, 34, 36, 40, 44, 48, + 52, 56, 60, 64, 100, 104, 108, 112, 116, + 120, 124, 128, 132, 136, 140, 149, 153, + 157, 161, 165, 183, 184, 185, 187, 188, + 192, 196, 0 }; + + for (i = 0; valid_channels[i]; i++) { + if (priv->channel == valid_channels[i]) + break; + } + + if (valid_channels[i] == 0) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_CHANNEL); + return FALSE; + } + } else if (!strcmp (priv->band, "bg") && priv->channel > 14) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_CHANNEL); + return FALSE; + } + } + + if (priv->bssid && priv->bssid->len != ETH_ALEN) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_BSSID); + return FALSE; + } + + if (priv->mac_address && priv->mac_address->len != ETH_ALEN) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_MAC_ADDRESS); + return FALSE; + } + + for (iter = priv->seen_bssids; iter; iter = iter->next) { + struct ether_addr addr; + + if (!ether_aton_r (iter->data, &addr)) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_SEEN_BSSIDS); + return FALSE; + } + } + + if ( priv->security + && !g_slist_find_custom (all_settings, priv->security, find_setting_by_name)) { + g_set_error (error, + NM_SETTING_WIRELESS_ERROR, + NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING, + NULL); + return FALSE; + } + + return TRUE; +} + +static void +nm_setting_wireless_init (NMSettingWireless *setting) +{ + g_object_set (setting, NM_SETTING_NAME, NM_SETTING_WIRELESS_SETTING_NAME, NULL); +} + +static void +finalize (GObject *object) +{ + NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object); + + g_free (priv->mode); + g_free (priv->band); + g_free (priv->security); + + if (priv->ssid) + g_byte_array_free (priv->ssid, TRUE); + if (priv->bssid) + g_byte_array_free (priv->bssid, TRUE); + if (priv->mac_address) + g_byte_array_free (priv->mac_address, TRUE); + + nm_utils_slist_free (priv->seen_bssids, g_free); + + G_OBJECT_CLASS (nm_setting_wireless_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_SSID: + if (priv->ssid) + g_byte_array_free (priv->ssid, TRUE); + priv->ssid = g_value_dup_boxed (value); + break; + case PROP_MODE: + g_free (priv->mode); + priv->mode = g_value_dup_string (value); + break; + case PROP_BAND: + g_free (priv->band); + priv->band = g_value_dup_string (value); + break; + case PROP_CHANNEL: + priv->channel = g_value_get_uint (value); + break; + case PROP_BSSID: + if (priv->bssid) + g_byte_array_free (priv->bssid, TRUE); + priv->bssid = g_value_dup_boxed (value); + break; + case PROP_RATE: + priv->rate = g_value_get_uint (value); + break; + case PROP_TX_POWER: + priv->tx_power = g_value_get_uint (value); + break; + case PROP_MAC_ADDRESS: + if (priv->mac_address) + g_byte_array_free (priv->mac_address, TRUE); + priv->mac_address = g_value_dup_boxed (value); + break; + case PROP_MTU: + priv->mtu = g_value_get_uint (value); + break; + case PROP_SEEN_BSSIDS: + nm_utils_slist_free (priv->seen_bssids, g_free); + priv->seen_bssids = g_value_dup_boxed (value); + break; + case PROP_SEC: + g_free (priv->security); + priv->security = g_value_dup_string (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) +{ + NMSettingWireless *setting = NM_SETTING_WIRELESS (object); + + switch (prop_id) { + case PROP_SSID: + g_value_set_boxed (value, nm_setting_wireless_get_ssid (setting)); + break; + case PROP_MODE: + g_value_set_string (value, nm_setting_wireless_get_mode (setting)); + break; + case PROP_BAND: + g_value_set_string (value, nm_setting_wireless_get_band (setting)); + break; + case PROP_CHANNEL: + g_value_set_uint (value, nm_setting_wireless_get_channel (setting)); + break; + case PROP_BSSID: + g_value_set_boxed (value, nm_setting_wireless_get_bssid (setting)); + break; + case PROP_RATE: + g_value_set_uint (value, nm_setting_wireless_get_rate (setting)); + break; + case PROP_TX_POWER: + g_value_set_uint (value, nm_setting_wireless_get_tx_power (setting)); + break; + case PROP_MAC_ADDRESS: + g_value_set_boxed (value, nm_setting_wireless_get_mac_address (setting)); + break; + case PROP_MTU: + g_value_set_uint (value, nm_setting_wireless_get_mtu (setting)); + break; + case PROP_SEEN_BSSIDS: + g_value_set_boxed (value, NM_SETTING_WIRELESS_GET_PRIVATE (setting)->seen_bssids); + break; + case PROP_SEC: + g_value_set_string (value, nm_setting_wireless_get_security (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_wireless_class_init (NMSettingWirelessClass *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 (NMSettingWirelessPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + /** + * NMSettingWireless:ssid: + * + * SSID of the WiFi network. + **/ + g_object_class_install_property + (object_class, PROP_SSID, + _nm_param_spec_specialized (NM_SETTING_WIRELESS_SSID, + "SSID", + "SSID of the WiFi network. Must be specified.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWireless:mode: + * + * WiFi network mode; one of 'infrastructure' or 'adhoc'. If blank, + * infrastructure is assumed. + **/ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_string (NM_SETTING_WIRELESS_MODE, + "Mode", + "WiFi network mode; one of 'infrastructure' or " + "'adhoc'. If blank, infrastructure is assumed.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWireless:band: + * + * 802.11 frequency band of the network. One of 'a' for 5GHz 802.11a or + * 'bg' for 2.4GHz 802.11. This will lock associations to the WiFi network + * to the specific band, i.e. if 'a' is specified, the device will not + * associate with the same network in the 2.4GHz band even if the network's + * settings are compatible. This setting depends on specific driver + * capability and may not work with all drivers. + **/ + g_object_class_install_property + (object_class, PROP_BAND, + g_param_spec_string (NM_SETTING_WIRELESS_BAND, + "Band", + "802.11 frequency band of the network. One of 'a' " + "for 5GHz 802.11a or 'bg' for 2.4GHz 802.11. This " + "will lock associations to the WiFi network to the " + "specific band, i.e. if 'a' is specified, the device " + "will not associate with the same network in the " + "2.4GHz band even if the network's settings are " + "compatible. This setting depends on specific driver " + "capability and may not work with all drivers.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWireless:channel: + * + * Wireless channel to use for the WiFi connection. The device will only + * join (or create for Ad-Hoc networks) a WiFi network on the specified + * channel. Because channel numbers overlap between bands, this property + * also requires the 'band' property to be set. + **/ + g_object_class_install_property + (object_class, PROP_CHANNEL, + g_param_spec_uint (NM_SETTING_WIRELESS_CHANNEL, + "Channel", + "Wireless channel to use for the WiFi connection. The " + "device will only join (or create for Ad-Hoc networks) " + "a WiFi network on the specified channel. Because " + "channel numbers overlap between bands, this property " + "also requires the 'band' property to be set.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWireless:bssid: + * + * If specified, directs the device to only associate with the given access + * point. This capability is highly driver dependent and not supported by + * all devices. Note: this property does not control the BSSID used when + * creating an Ad-Hoc network and is unlikely to in the future. + **/ + g_object_class_install_property + (object_class, PROP_BSSID, + _nm_param_spec_specialized (NM_SETTING_WIRELESS_BSSID, + "BSSID", + "If specified, directs the device to only associate " + "with the given access point. This capability is " + "highly driver dependent and not supported by all " + "devices. Note: this property does not control " + "the BSSID used when creating an Ad-Hoc network " + "and is unlikely to in the future.", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWireless:rate: + * + * If non-zero, directs the device to only use the specified bitrate for + * communication with the access point. Units are in Kb/s, ie 5500 = 5.5 + * Mbit/s. This property is highly driver dependent and not all devices + * support setting a static bitrate. + **/ + g_object_class_install_property + (object_class, PROP_RATE, + g_param_spec_uint (NM_SETTING_WIRELESS_RATE, + "Rate", + "If non-zero, directs the device to only use the " + "specified bitrate for communication with the access " + "point. Units are in Kb/s, ie 5500 = 5.5 Mbit/s. This " + "property is highly driver dependent and not all devices " + "support setting a static bitrate.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingWireless:tx-power: + * + * If non-zero, directs the device to use the specified transmit power. + * Units are dBm. This property is highly driver dependent and not all + * devices support setting a static transmit power. + **/ + g_object_class_install_property + (object_class, PROP_TX_POWER, + g_param_spec_uint (NM_SETTING_WIRELESS_TX_POWER, + "TX Power", + "If non-zero, directs the device to use the specified " + "transmit power. Units are dBm. This property is highly " + "driver dependent and not all devices support setting a " + "static transmit power.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingWireless:mac-address: + * + * If specified, this connection will only apply to the WiFi device + * whose MAC address matches. This property does not change the MAC address + * of the device (known as MAC spoofing). + **/ + g_object_class_install_property + (object_class, PROP_MAC_ADDRESS, + _nm_param_spec_specialized (NM_SETTING_WIRELESS_MAC_ADDRESS, + "MAC Address", + "If specified, this connection will only apply to " + "the WiFi device whose MAC address matches. " + "This property does not change the MAC address " + "of the device (known as MAC spoofing).", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); + + /** + * NMSettingWireless:seen-bssids: + * + * A list of BSSIDs (each BSSID formatted as a MAC address like + * '00:11:22:33:44:55') that have been detected as part of the WiFI network. + * The settings service will usually populate this property by periodically + * asking NetworkManager what the device's current AP is while connected + * to the network (or monitoring the device's 'active-ap' property) and + * adding the current AP'sBSSID to this list. This list helps NetworkManager + * find hidden APs by matching up scan results with the BSSIDs in this list. + **/ + g_object_class_install_property + (object_class, PROP_SEEN_BSSIDS, + _nm_param_spec_specialized (NM_SETTING_WIRELESS_SEEN_BSSIDS, + "Seen BSSIDS", + "A list of BSSIDs (each BSSID formatted as a MAC " + "address like '00:11:22:33:44:55') that have been " + "detected as part of the WiFI network. The " + "settings service will usually populate this " + "property by periodically asking NetworkManager " + "what the device's current AP is while connected " + "to the network (or monitoring the device's " + "'active-ap' property) and adding the current AP's " + "BSSID to this list. This list helps NetworkManager " + "find hidden APs by matching up scan results with " + "the BSSIDs in this list.", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingWireless:mtu: + * + * If non-zero, only transmit packets of the specified size or smaller, + * breaking larger packets up into multiple Ethernet frames. + **/ + g_object_class_install_property + (object_class, PROP_MTU, + g_param_spec_uint (NM_SETTING_WIRELESS_MTU, + "MTU", + "If non-zero, only transmit packets of the specified " + "size or smaller, breaking larger packets up into " + "multiple Ethernet frames.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE)); + + /** + * NMSettingWireless:security: + * + * If the wireless connection has any security restrictions, like 802.1x, + * WEP, or WPA, set this property to '802-11-wireless-security' and ensure + * the connection contains a valid 802-11-wireless-security setting. + **/ + g_object_class_install_property + (object_class, PROP_SEC, + g_param_spec_string (NM_SETTING_WIRELESS_SEC, + "Security", + "If the wireless connection has any security " + "restrictions, like 802.1x, WEP, or WPA, set this " + "property to '" NM_SETTING_WIRELESS_SECURITY_SETTING_NAME "' " + "and ensure the connection contains a valid " + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME " setting.", + NULL, + G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE)); +} diff --git a/libnm-util/nm-setting-wireless.h b/libnm-util/nm-setting-wireless.h new file mode 100644 index 00000000..da2ea5b6 --- /dev/null +++ b/libnm-util/nm-setting-wireless.h @@ -0,0 +1,115 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_WIRELESS_H +#define NM_SETTING_WIRELESS_H + +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_WIRELESS (nm_setting_wireless_get_type ()) +#define NM_SETTING_WIRELESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_WIRELESS, NMSettingWireless)) +#define NM_SETTING_WIRELESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_WIRELESS, NMSettingWirelessClass)) +#define NM_IS_SETTING_WIRELESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_WIRELESS)) +#define NM_IS_SETTING_WIRELESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING_WIRELESS)) +#define NM_SETTING_WIRELESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_WIRELESS, NMSettingWirelessClass)) + +#define NM_SETTING_WIRELESS_SETTING_NAME "802-11-wireless" + +typedef enum +{ + NM_SETTING_WIRELESS_ERROR_UNKNOWN = 0, + NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY, + NM_SETTING_WIRELESS_ERROR_MISSING_PROPERTY, + NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING, + NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND +} NMSettingWirelessError; + +#define NM_TYPE_SETTING_WIRELESS_ERROR (nm_setting_wireless_error_get_type ()) +GType nm_setting_wireless_error_get_type (void); + +#define NM_SETTING_WIRELESS_ERROR nm_setting_wireless_error_quark () +GQuark nm_setting_wireless_error_quark (void); + +#define NM_SETTING_WIRELESS_SSID "ssid" +#define NM_SETTING_WIRELESS_MODE "mode" +#define NM_SETTING_WIRELESS_BAND "band" +#define NM_SETTING_WIRELESS_CHANNEL "channel" +#define NM_SETTING_WIRELESS_BSSID "bssid" +#define NM_SETTING_WIRELESS_RATE "rate" +#define NM_SETTING_WIRELESS_TX_POWER "tx-power" +#define NM_SETTING_WIRELESS_MAC_ADDRESS "mac-address" +#define NM_SETTING_WIRELESS_MTU "mtu" +#define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids" +#define NM_SETTING_WIRELESS_SEC "security" + +typedef struct { + NMSetting parent; +} NMSettingWireless; + +typedef struct { + NMSettingClass parent; + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingWirelessClass; + +GType nm_setting_wireless_get_type (void); + +NMSetting *nm_setting_wireless_new (void); + +const GByteArray *nm_setting_wireless_get_ssid (NMSettingWireless *setting); +const char *nm_setting_wireless_get_mode (NMSettingWireless *setting); +const char *nm_setting_wireless_get_band (NMSettingWireless *setting); +guint32 nm_setting_wireless_get_channel (NMSettingWireless *setting); +const GByteArray *nm_setting_wireless_get_bssid (NMSettingWireless *setting); +guint32 nm_setting_wireless_get_rate (NMSettingWireless *setting); +guint32 nm_setting_wireless_get_tx_power (NMSettingWireless *setting); +const GByteArray *nm_setting_wireless_get_mac_address (NMSettingWireless *setting); +guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting); +const char *nm_setting_wireless_get_security (NMSettingWireless *setting); + +gboolean nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting, + const char *bssid); + +guint32 nm_setting_wireless_get_num_seen_bssids (NMSettingWireless *setting); +const char *nm_setting_wireless_get_seen_bssid (NMSettingWireless *setting, + guint32 i); + +gboolean nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless, + NMSettingWirelessSecurity *s_wireless_sec, + guint32 ap_flags, + guint32 ap_wpa, + guint32 ap_rsn, + guint32 ap_mode); + +G_END_DECLS + +#endif /* NM_SETTING_WIRELESS_H */ diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c new file mode 100644 index 00000000..06994c73 --- /dev/null +++ b/libnm-util/nm-setting.c @@ -0,0 +1,752 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include + +#include "nm-setting.h" +#include "nm-setting-connection.h" +#include "nm-utils.h" + +/** + * SECTION:nm-setting + * @short_description: Describes related configuration information + * @include: nm-setting.h + * + * Each #NMSetting contains properties that describe configuration that applies + * to a specific network layer (like IPv4 or IPv6 configuration) or device type + * (like Ethernet, or WiFi). A collection of individual settings together + * make up an #NMConnection. Each property is strongly typed and usually has + * a number of allowed values. See each #NMSetting subclass for a description + * of properties and allowed values. + */ + +/** + * nm_setting_error_quark: + * + * Registers an error quark for #NMSetting if necessary. + * + * Returns: the error quark used for NMSetting errors. + **/ +GQuark +nm_setting_error_quark (void) +{ + static GQuark quark; + + if (G_UNLIKELY (!quark)) + quark = g_quark_from_static_string ("nm-setting-error-quark"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_setting_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_SETTING_ERROR_UNKNOWN, "UnknownError"), + ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_NOT_FOUND, "PropertyNotFound"), + ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_NOT_SECRET, "PropertyNotSecret"), + ENUM_ENTRY (NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH, "PropertyTypeMismatch"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMSettingError", values); + } + return etype; +} + +G_DEFINE_ABSTRACT_TYPE (NMSetting, nm_setting, G_TYPE_OBJECT) + +#define NM_SETTING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING, NMSettingPrivate)) + +typedef struct { + char *name; +} NMSettingPrivate; + +enum { + PROP_0, + PROP_NAME, + + PROP_LAST +}; + +static void +destroy_gvalue (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +/** + * nm_setting_to_hash: + * @setting: the #NMSetting + * + * Converts the #NMSetting into a #GHashTable mapping each setting property + * name to a GValue describing that property, suitable for marshalling over + * D-Bus or serializing. The mapping is string:GValue. + * + * Returns: a new #GHashTable describing the setting's properties + **/ +GHashTable * +nm_setting_to_hash (NMSetting *setting) +{ + GHashTable *hash; + GParamSpec **property_specs; + guint n_property_specs; + guint i; + + g_return_val_if_fail (NM_IS_SETTING (setting), NULL); + + property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs); + if (!property_specs) { + g_warning ("%s: couldn't find property specs for object of type '%s'", + __func__, g_type_name (G_OBJECT_TYPE (setting))); + return NULL; + } + + hash = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + destroy_gvalue); + + for (i = 0; i < n_property_specs; i++) { + GParamSpec *prop_spec = property_specs[i]; + + if (prop_spec->flags & NM_SETTING_PARAM_SERIALIZE) { + GValue *value; + + value = g_slice_new0 (GValue); + g_value_init (value, prop_spec->value_type); + g_object_get_property (G_OBJECT (setting), prop_spec->name, value); + + /* Don't serialize values with default values */ + if (!g_param_value_defaults (prop_spec, value)) + g_hash_table_insert (hash, g_strdup (prop_spec->name), value); + else + destroy_gvalue (value); + } + } + + g_free (property_specs); + + return hash; +} + +typedef struct { + GObjectClass *class; + guint n_params; + GParameter *params; +} NMSettingFromHashInfo; + +static void +one_property_cb (gpointer key, gpointer val, gpointer user_data) +{ + const char *prop_name = (char *) key; + GValue *src_value = (GValue *) val; + NMSettingFromHashInfo *info = (NMSettingFromHashInfo *) user_data; + GValue *dst_value = &info->params[info->n_params].value; + GParamSpec *param_spec; + + param_spec = g_object_class_find_property (info->class, prop_name); + if (!param_spec || !(param_spec->flags & NM_SETTING_PARAM_SERIALIZE)) { + /* Oh, we're so nice and only warn, maybe it should be a fatal error? */ + nm_warning ("Ignoring invalid property '%s'", prop_name); + return; + } + + g_value_init (dst_value, G_VALUE_TYPE (src_value)); + if (g_value_transform (src_value, dst_value)) { + info->params[info->n_params].name = prop_name; + info->n_params++; + } else { + nm_warning ("Ignoring property '%s' with invalid type (%s)", + prop_name, G_VALUE_TYPE_NAME (src_value)); + g_value_unset (dst_value); + } +} + +/** + * nm_setting_new_from_hash: + * @setting_type: the #NMSetting type which the hash contains properties for + * @hash: the #GHashTable containing a string:GValue mapping of properties + * that apply to the setting + * + * Creates a new #NMSetting object and populates that object with the properties + * contained in the hash table, using each hash key as the property to set, + * and each hash value as the value to set that property to. Setting properties + * are strongly typed, thus the GValue type of the hash value must be correct. + * See the documentation on each #NMSetting object subclass for the correct + * property names and value types. + * + * Returns: a new #NMSetting object populated with the properties from the + * hash table, or NULL on failure + **/ +NMSetting * +nm_setting_new_from_hash (GType setting_type, + GHashTable *hash) +{ + NMSetting *setting; + NMSettingFromHashInfo info; + int i; + + g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (setting_type), NULL); + g_return_val_if_fail (hash != NULL, NULL); + + info.class = g_type_class_ref (setting_type); + info.n_params = 0; + info.params = g_new0 (GParameter, g_hash_table_size (hash)); + + g_hash_table_foreach (hash, one_property_cb, &info); + + setting = (NMSetting *) g_object_newv (setting_type, info.n_params, info.params); + + for (i = 0; i < info.n_params; i++) { + GValue *v = &info.params[i].value; + g_value_unset (v); + } + + g_free (info.params); + g_type_class_unref (info.class); + + return setting; +} + +static void +duplicate_setting (NMSetting *setting, + const char *name, + const GValue *value, + GParamFlags flags, + gpointer user_data) +{ + if (flags & G_PARAM_WRITABLE) + g_object_set_property (G_OBJECT (user_data), name, value); +} + +/** + * nm_setting_duplicate: + * @setting: the #NMSetting to duplicate + * + * Duplicates a #NMSetting. + * + * Returns: a new #NMSetting containing the same properties and values as the + * source #NMSetting + **/ +NMSetting * +nm_setting_duplicate (NMSetting *setting) +{ + GObject *dup; + + g_return_val_if_fail (NM_IS_SETTING (setting), NULL); + + dup = g_object_new (G_OBJECT_TYPE (setting), NULL); + + g_object_freeze_notify (dup); + nm_setting_enumerate_values (setting, duplicate_setting, dup); + g_object_thaw_notify (dup); + + return NM_SETTING (dup); +} + +/** + * nm_setting_get_name: + * @setting: the #NMSetting + * + * Returns the type name of the #NMSetting object + * + * Returns: a string containing the type name of the #NMSetting object, + * like 'ppp' or 'wireless' or 'wired'. + **/ +const char * +nm_setting_get_name (NMSetting *setting) +{ + g_return_val_if_fail (NM_IS_SETTING (setting), NULL); + + return NM_SETTING_GET_PRIVATE (setting)->name; +} + +/** + * nm_setting_verify: + * @setting: the #NMSetting to verify + * @all_settings: a #GSList of all settings in the connection from which @setting + * came + * @error: location to store error, or %NULL + * + * Validates the setting. Each setting's properties have allowed values, and + * some are dependent on other values (hence the need for @all_settings). The + * returned #GError contains information about which property of the setting + * failed validation, and in what way that property failed validation. + * + * Returns: %TRUE if the setting is valid, %FALSE if it is not + **/ +gboolean +nm_setting_verify (NMSetting *setting, GSList *all_settings, GError **error) +{ + g_return_val_if_fail (NM_IS_SETTING (setting), FALSE); + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + if (NM_SETTING_GET_CLASS (setting)->verify) + return NM_SETTING_GET_CLASS (setting)->verify (setting, all_settings, error); + + return TRUE; +} + +/** + * nm_setting_compare: + * @a: a #NMSetting + * @b: a second #NMSetting to compare with the first + * @flags: compare flags, e.g. %NM_SETTING_COMPARE_FLAG_EXACT + * + * Compares two #NMSetting objects for similarity, with comparison behavior + * modified by a set of flags. See the documentation for #NMSettingCompareFlags + * for a description of each flag's behavior. + * + * Returns: %TRUE if the comparison succeeds, %FALSE if it does not + **/ +gboolean +nm_setting_compare (NMSetting *a, + NMSetting *b, + NMSettingCompareFlags flags) +{ + GParamSpec **property_specs; + guint n_property_specs; + gint different; + guint i; + + g_return_val_if_fail (NM_IS_SETTING (a), FALSE); + g_return_val_if_fail (NM_IS_SETTING (b), FALSE); + + /* First check that both have the same type */ + if (G_OBJECT_TYPE (a) != G_OBJECT_TYPE (b)) + return FALSE; + + /* And now all properties */ + property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (a), &n_property_specs); + different = FALSE; + + for (i = 0; i < n_property_specs && !different; i++) { + GParamSpec *prop_spec = property_specs[i]; + GValue value1 = { 0 }; + GValue value2 = { 0 }; + + /* Fuzzy compare ignores secrets and properties defined with the + * FUZZY_IGNORE flag + */ + if ( (flags & NM_SETTING_COMPARE_FLAG_FUZZY) + && (prop_spec->flags & (NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_SECRET))) + continue; + + if ((flags & NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS) && (prop_spec->flags & NM_SETTING_PARAM_SECRET)) + continue; + + if ( (flags & NM_SETTING_COMPARE_FLAG_IGNORE_ID) + && !strcmp (nm_setting_get_name (a), NM_SETTING_CONNECTION_SETTING_NAME) + && !strcmp (prop_spec->name, NM_SETTING_CONNECTION_ID)) + continue; + + g_value_init (&value1, prop_spec->value_type); + g_object_get_property (G_OBJECT (a), prop_spec->name, &value1); + + g_value_init (&value2, prop_spec->value_type); + g_object_get_property (G_OBJECT (b), prop_spec->name, &value2); + + different = g_param_values_cmp (prop_spec, &value1, &value2); + + g_value_unset (&value1); + g_value_unset (&value2); + } + + g_free (property_specs); + + return different == 0 ? TRUE : FALSE; +} + +/** + * nm_setting_enumerate_values: + * @setting: the #NMSetting + * @func: user-supplied function called for each property of the setting + * @user_data: user data passed to @func at each invocation + * + * Iterates over each property of the #NMSetting object, calling the supplied + * user function for each property. + **/ +void +nm_setting_enumerate_values (NMSetting *setting, + NMSettingValueIterFn func, + gpointer user_data) +{ + GParamSpec **property_specs; + guint n_property_specs; + int i; + + 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); + for (i = 0; i < n_property_specs; i++) { + GParamSpec *prop_spec = property_specs[i]; + GValue value = { 0 }; + + g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop_spec)); + g_object_get_property (G_OBJECT (setting), prop_spec->name, &value); + func (setting, prop_spec->name, &value, prop_spec->flags, user_data); + g_value_unset (&value); + } + + g_free (property_specs); +} + +/** + * nm_setting_clear_secrets: + * @setting: the #NMSetting + * + * Resets and clears any secrets in the setting. Secrets should be added to the + * setting only when needed, and cleared immediately after use to prevent + * leakage of information. + **/ +void +nm_setting_clear_secrets (NMSetting *setting) +{ + GParamSpec **property_specs; + guint n_property_specs; + guint i; + + g_return_if_fail (NM_IS_SETTING (setting)); + + property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs); + + for (i = 0; i < n_property_specs; i++) { + GParamSpec *prop_spec = property_specs[i]; + GValue value = { 0 }; + + if (prop_spec->flags & NM_SETTING_PARAM_SECRET) { + g_value_init (&value, prop_spec->value_type); + g_param_value_set_default (prop_spec, &value); + g_object_set_property (G_OBJECT (setting), prop_spec->name, &value); + g_value_unset (&value); + } + } + + g_free (property_specs); +} + +/** + * nm_setting_need_secrets: + * @setting: the #NMSetting + * + * Returns an array of property names for each secret which may be required + * to make a successful connection. The returned hints are only intended as a + * guide to what secrets may be required, because in some circumstances, there + * is no way to conclusively determine exactly which secrets are needed. + * + * Returns: a #GPtrArray containing the property names of secrets of the + * #NMSetting which may be required; the caller owns the array + * and must free the each array element with g_free(), as well as the array + * itself with g_ptr_array_free() + **/ +GPtrArray * +nm_setting_need_secrets (NMSetting *setting) +{ + GPtrArray *secrets = NULL; + + g_return_val_if_fail (NM_IS_SETTING (setting), NULL); + + if (NM_SETTING_GET_CLASS (setting)->need_secrets) + secrets = NM_SETTING_GET_CLASS (setting)->need_secrets (setting); + + return secrets; +} + +typedef struct { + NMSetting *setting; + GError **error; +} UpdateSecretsInfo; + +static gboolean +update_one_secret (NMSetting *setting, const char *key, GValue *value, GError **error) +{ + GParamSpec *prop_spec; + GValue transformed_value = { 0 }; + gboolean success = FALSE; + + prop_spec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key); + if (!prop_spec) { + g_set_error (error, + NM_SETTING_ERROR, + NM_SETTING_ERROR_PROPERTY_NOT_FOUND, + "%s", key); + return FALSE; + } + + if (!(prop_spec->flags & NM_SETTING_PARAM_SECRET)) { + g_set_error (error, + NM_SETTING_ERROR, + NM_SETTING_ERROR_PROPERTY_NOT_SECRET, + "%s", key); + return FALSE; + } + + if (g_value_type_compatible (G_VALUE_TYPE (value), G_PARAM_SPEC_VALUE_TYPE (prop_spec))) { + g_object_set_property (G_OBJECT (setting), prop_spec->name, value); + success = TRUE; + } else if (g_value_transform (value, &transformed_value)) { + g_object_set_property (G_OBJECT (setting), prop_spec->name, &transformed_value); + g_value_unset (&transformed_value); + success = TRUE; + } else { + g_set_error (error, + NM_SETTING_ERROR, + NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH, + "%s", key); + } + return success; +} + +static void +update_one_cb (gpointer key, gpointer val, gpointer user_data) +{ + UpdateSecretsInfo *info = user_data; + const char *secret_key = (const char *) key; + GValue *secret_value = (GValue *) val; + + if (*(info->error) == NULL) + NM_SETTING_GET_CLASS (info->setting)->update_one_secret (info->setting, secret_key, secret_value, info->error); +} + +/** + * nm_setting_update_secrets: + * @setting: the #NMSetting + * @secrets: a #GHashTable mapping string:#GValue of setting property names and + * secrets + * @error: location to store error, or %NULL + * + * Update the setting's secrets, given a hash table of secrets intended for that + * setting (deserialized from D-Bus for example). + * + * Returns: %TRUE if the secrets were successfully updated and the connection + * is valid, %FALSE on failure or if the setting was never added to the connection + **/ +gboolean +nm_setting_update_secrets (NMSetting *setting, GHashTable *secrets, GError **error) +{ + UpdateSecretsInfo *info; + gboolean success; + + g_return_val_if_fail (setting != NULL, FALSE); + g_return_val_if_fail (NM_IS_SETTING (setting), FALSE); + g_return_val_if_fail (secrets != NULL, FALSE); + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + info = g_malloc0 (sizeof (UpdateSecretsInfo)); + info->setting = setting; + info->error = error; + g_hash_table_foreach (secrets, update_one_cb, info); + success = *(info->error) ? FALSE : TRUE; + g_free (info); + + return success; +} + +/** + * nm_setting_to_string: + * @setting: the #NMSetting + * + * Convert the setting into a string. For debugging purposes ONLY, should NOT + * be used for serialization of the setting, or machine-parsed in any way. The + * output format is not guaranteed to be stable and may change at any time. + * + * Returns: an allocated string containing a textual representation of the + * setting's properties and values (including secrets!), which the caller should + * free with g_free() + **/ +char * +nm_setting_to_string (NMSetting *setting) +{ + GString *string; + GParamSpec **property_specs; + guint n_property_specs; + guint i; + + g_return_val_if_fail (NM_IS_SETTING (setting), NULL); + + property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs); + if (!property_specs) + return NULL; + + string = g_string_new (nm_setting_get_name (setting)); + g_string_append_c (string, '\n'); + + for (i = 0; i < n_property_specs; i++) { + GParamSpec *prop_spec = property_specs[i]; + GValue value = { 0 }; + char *value_str; + gboolean is_serializable; + gboolean is_default; + + g_value_init (&value, prop_spec->value_type); + g_object_get_property (G_OBJECT (setting), prop_spec->name, &value); + + value_str = g_strdup_value_contents (&value); + g_string_append_printf (string, "\t%s : %s", prop_spec->name, value_str); + g_free (value_str); + + is_serializable = prop_spec->flags & NM_SETTING_PARAM_SERIALIZE; + is_default = g_param_value_defaults (prop_spec, &value); + + if (is_serializable || is_default) { + g_string_append (string, " ("); + + if (is_serializable) + g_string_append_c (string, 's'); + if (is_default) + g_string_append_c (string, 'd'); + + g_string_append_c (string, ')'); + } + + g_string_append_c (string, '\n'); + } + + g_free (property_specs); + g_string_append_c (string, '\n'); + + return g_string_free (string, FALSE); +} + +/*****************************************************************************/ + +static void +nm_setting_init (NMSetting *setting) +{ +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMSettingPrivate *priv; + + object = G_OBJECT_CLASS (nm_setting_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_SETTING_GET_PRIVATE (object); + if (!priv->name) { + nm_warning ("Setting name is not set."); + g_object_unref (object); + object = NULL; + } + + return object; +} + +static void +finalize (GObject *object) +{ + NMSettingPrivate *priv = NM_SETTING_GET_PRIVATE (object); + + g_free (priv->name); + + G_OBJECT_CLASS (nm_setting_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingPrivate *priv = NM_SETTING_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_NAME: + g_free (priv->name); + priv->name = g_value_dup_string (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) +{ + NMSetting *setting = NM_SETTING (object); + + switch (prop_id) { + case PROP_NAME: + g_value_set_string (value, nm_setting_get_name (setting)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_setting_class_init (NMSettingClass *setting_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (setting_class); + + g_type_class_add_private (setting_class, sizeof (NMSettingPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + setting_class->update_one_secret = update_one_secret; + + /* Properties */ + + /** + * NMSetting:name: + * + * The setting's name, which uniquely identifies the setting within the + * connection. Each setting type has a name unique to that type, for + * example 'ppp' or 'wireless' or 'wired'. + **/ + g_object_class_install_property + (object_class, PROP_NAME, + g_param_spec_string (NM_SETTING_NAME, + "Name", + "The setting's name; these names are defined by the " + "specification and cannot be changed after the object " + "has been created. Each setting class has a name, and " + "all objects of that class share the same name.", + NULL, + G_PARAM_READWRITE)); +} + diff --git a/libnm-util/nm-setting.h b/libnm-util/nm-setting.h new file mode 100644 index 00000000..de5657ee --- /dev/null +++ b/libnm-util/nm-setting.h @@ -0,0 +1,179 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2008 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SETTING_H +#define NM_SETTING_H + +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING (nm_setting_get_type ()) +#define NM_SETTING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING, NMSetting)) +#define NM_SETTING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING, NMSettingClass)) +#define NM_IS_SETTING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING)) +#define NM_IS_SETTING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTING)) +#define NM_SETTING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING, NMSettingClass)) + +/** + * NMSettingError: + * @NM_SETTING_ERROR_UNKNOWN: unknown or unclassified error + * @NM_SETTING_ERROR_PROPERTY_NOT_FOUND: a property required by the operation + * was not found; for example, an attempt to update an invalid secret + * @NM_SETTING_ERROR_PROPERTY_NOT_SECRET: an operation which requires a secret + * was attempted on a non-secret property + * @NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH: the operation requires a property + * of a specific type, or the value couldn't be transformed to the same type + * as the property being acted upon + * + * Describes errors that may result from operations involving a #NMSetting. + * + **/ +typedef enum +{ + NM_SETTING_ERROR_UNKNOWN = 0, + NM_SETTING_ERROR_PROPERTY_NOT_FOUND, + NM_SETTING_ERROR_PROPERTY_NOT_SECRET, + NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH +} NMSettingError; + +#define NM_TYPE_SETTING_ERROR (nm_setting_error_get_type ()) +GType nm_setting_error_get_type (void); + +#define NM_SETTING_ERROR nm_setting_error_quark () +GQuark nm_setting_error_quark (void); + + +/* The property of the #NMSetting should be serialized */ +#define NM_SETTING_PARAM_SERIALIZE (1 << (0 + G_PARAM_USER_SHIFT)) + +/* The property of the #NMSetting is required for the setting to be valid */ +#define NM_SETTING_PARAM_REQUIRED (1 << (1 + G_PARAM_USER_SHIFT)) + +/* The property of the #NMSetting is a secret */ +#define NM_SETTING_PARAM_SECRET (1 << (2 + G_PARAM_USER_SHIFT)) + +/* The property of the #NMSetting should be ignored during comparisons that + * use the %NM_SETTING_COMPARE_FLAG_FUZZY flag. + */ +#define NM_SETTING_PARAM_FUZZY_IGNORE (1 << (3 + G_PARAM_USER_SHIFT)) + +#define NM_SETTING_NAME "name" + +/** + * NMSetting: + * + * The NMSetting struct contains only private data. + * It should only be accessed through the functions described below. + */ +typedef struct { + GObject parent; +} NMSetting; + +typedef struct { + GObjectClass parent; + + /* Virtual functions */ + gboolean (*verify) (NMSetting *setting, + GSList *all_settings, + GError **error); + + GPtrArray *(*need_secrets) (NMSetting *setting); + + gboolean (*update_one_secret) (NMSetting *setting, + const char *key, + GValue *value, + GError **error); + + /* Padding for future expansion */ + void (*_reserved1) (void); + void (*_reserved2) (void); + void (*_reserved3) (void); + void (*_reserved4) (void); +} NMSettingClass; + +typedef void (*NMSettingValueIterFn) (NMSetting *setting, + const char *key, + const GValue *value, + GParamFlags flags, + gpointer user_data); + + +GType nm_setting_get_type (void); + +GHashTable *nm_setting_to_hash (NMSetting *setting); +NMSetting *nm_setting_new_from_hash (GType setting_type, + GHashTable *hash); + +NMSetting *nm_setting_duplicate (NMSetting *setting); + +const char *nm_setting_get_name (NMSetting *setting); + +gboolean nm_setting_verify (NMSetting *setting, + GSList *all_settings, + GError **error); + +/** + * NMSettingCompareFlags: + * @NM_SETTING_COMPARE_FLAG_EXACT: match all properties exactly + * @NM_SETTING_COMPARE_FLAG_FUZZY: match only important attributes, like SSID, + * type, security settings, etc. Does not match, for example, connection ID + * or UUID. + * @NM_SETTING_COMPARE_FLAG_IGNORE_ID: ignore the connection's ID + * @NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS: ignore secrets + * + * These flags modify the comparison behavior when comparing two settings or + * two connections. + * + **/ +typedef enum { + NM_SETTING_COMPARE_FLAG_EXACT = 0x00000000, + NM_SETTING_COMPARE_FLAG_FUZZY = 0x00000001, + NM_SETTING_COMPARE_FLAG_IGNORE_ID = 0x00000002, + NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS = 0x00000004 +} NMSettingCompareFlags; + +gboolean nm_setting_compare (NMSetting *a, + NMSetting *b, + NMSettingCompareFlags flags); + +void nm_setting_enumerate_values (NMSetting *setting, + NMSettingValueIterFn func, + gpointer user_data); + +char *nm_setting_to_string (NMSetting *setting); + +/* Secrets */ +void nm_setting_clear_secrets (NMSetting *setting); +GPtrArray *nm_setting_need_secrets (NMSetting *setting); +gboolean nm_setting_update_secrets (NMSetting *setting, + GHashTable *secrets, + GError **error); + +G_END_DECLS + +#endif /* NM_SETTING_H */ + diff --git a/libnm-util/nm-utils-private.h b/libnm-util/nm-utils-private.h new file mode 100644 index 00000000..fa1e3a01 --- /dev/null +++ b/libnm-util/nm-utils-private.h @@ -0,0 +1,37 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * Ray Strode + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2005 - 2008 Red Hat, Inc. + */ + +#ifndef __NM_UTILS_PRIVATE_H__ +#define __NM_UTILS_PRIVATE_H__ + +gboolean _nm_utils_string_in_list (const char *str, + const char **valid_strings); + +gboolean _nm_utils_string_slist_validate (GSList *list, + const char **valid_values); + +void _nm_utils_register_value_transformations (void); + +#endif diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c new file mode 100644 index 00000000..ddb02a22 --- /dev/null +++ b/libnm-util/nm-utils.c @@ -0,0 +1,2104 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* NetworkManager -- Network link manager + * + * Ray Strode + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2005 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include + +#include "wireless-helper.h" + +#include +#include +#include +#include +#include + +#include "nm-utils.h" +#include "nm-utils-private.h" +#include "NetworkManager.h" +#include "nm-dbus-glib-types.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-ip6-config.h" +#include "crypto.h" + +/** + * SECTION:nm-utils + * @short_description: Utility functions + * @include: nm-utils.h + * + * A collection of utility functions for working SSIDs, IP addresses, WiFi + * access points and devices, among other things. + */ + +struct EncodingTriplet +{ + const char *encoding1; + const char *encoding2; + const char *encoding3; +}; + +struct IsoLangToEncodings +{ + const char * lang; + struct EncodingTriplet encodings; +}; + +/* 5-letter language codes */ +static const struct IsoLangToEncodings isoLangEntries5[] = +{ + /* Simplified Chinese */ + { "zh_cn", {"euc-cn", "gb2312", "gb18030"} }, /* PRC */ + { "zh_sg", {"euc-cn", "gb2312", "gb18030"} }, /* Singapore */ + + /* Traditional Chinese */ + { "zh_tw", {"big5", "euc-tw", NULL} }, /* Taiwan */ + { "zh_hk", {"big5", "euc-tw", "big5-hkcs"} },/* Hong Kong */ + { "zh_mo", {"big5", "euc-tw", NULL} }, /* Macau */ + + /* Table end */ + { NULL, {NULL, NULL, NULL} } +}; + +/* 2-letter language codes; we don't care about the other 3 in this table */ +static const struct IsoLangToEncodings isoLangEntries2[] = +{ + /* Japanese */ + { "ja", {"euc-jp", "shift_jis", "iso-2022-jp"} }, + + /* Korean */ + { "ko", {"euc-kr", "iso-2022-kr", "johab"} }, + + /* Thai */ + { "th", {"iso-8859-11","windows-874", NULL} }, + + /* Central European */ + { "hu", {"iso-8859-2", "windows-1250", NULL} }, /* Hungarian */ + { "cs", {"iso-8859-2", "windows-1250", NULL} }, /* Czech */ + { "hr", {"iso-8859-2", "windows-1250", NULL} }, /* Croatian */ + { "pl", {"iso-8859-2", "windows-1250", NULL} }, /* Polish */ + { "ro", {"iso-8859-2", "windows-1250", NULL} }, /* Romanian */ + { "sk", {"iso-8859-2", "windows-1250", NULL} }, /* Slovakian */ + { "sl", {"iso-8859-2", "windows-1250", NULL} }, /* Slovenian */ + { "sh", {"iso-8859-2", "windows-1250", NULL} }, /* Serbo-Croatian */ + + /* Cyrillic */ + { "ru", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Russian */ + { "be", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Belorussian */ + { "bg", {"windows-1251","koi8-r", "iso-8859-5"} }, /* Bulgarian */ + { "mk", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Macedonian */ + { "sr", {"koi8-r", "windows-1251", "iso-8859-5"} }, /* Serbian */ + { "uk", {"koi8-u", "koi8-r", "windows-1251"} }, /* Ukranian */ + + /* Arabic */ + { "ar", {"iso-8859-6", "windows-1256", NULL} }, + + /* Balitc */ + { "et", {"iso-8859-4", "windows-1257", NULL} }, /* Estonian */ + { "lt", {"iso-8859-4", "windows-1257", NULL} }, /* Lithuanian */ + { "lv", {"iso-8859-4", "windows-1257", NULL} }, /* Latvian */ + + /* Greek */ + { "el", {"iso-8859-7", "windows-1253", NULL} }, + + /* Hebrew */ + { "he", {"iso-8859-8", "windows-1255", NULL} }, + { "iw", {"iso-8859-8", "windows-1255", NULL} }, + + /* Turkish */ + { "tr", {"iso-8859-9", "windows-1254", NULL} }, + + /* Table end */ + { NULL, {NULL, NULL, NULL} } +}; + + +static GHashTable * langToEncodings5 = NULL; +static GHashTable * langToEncodings2 = NULL; + +static void +init_lang_to_encodings_hash (void) +{ + struct IsoLangToEncodings *enc; + + if (G_UNLIKELY (langToEncodings5 == NULL)) { + /* Five-letter codes */ + enc = (struct IsoLangToEncodings *) &isoLangEntries5[0]; + langToEncodings5 = g_hash_table_new (g_str_hash, g_str_equal); + while (enc->lang) { + g_hash_table_insert (langToEncodings5, (gpointer) enc->lang, + (gpointer) &enc->encodings); + enc++; + } + } + + if (G_UNLIKELY (langToEncodings2 == NULL)) { + /* Two-letter codes */ + enc = (struct IsoLangToEncodings *) &isoLangEntries2[0]; + langToEncodings2 = g_hash_table_new (g_str_hash, g_str_equal); + while (enc->lang) { + g_hash_table_insert (langToEncodings2, (gpointer) enc->lang, + (gpointer) &enc->encodings); + enc++; + } + } +} + + +static gboolean +get_encodings_for_lang (const char *lang, + char **encoding1, + char **encoding2, + char **encoding3) +{ + struct EncodingTriplet * encodings; + gboolean success = FALSE; + char * tmp_lang; + + g_return_val_if_fail (lang != NULL, FALSE); + g_return_val_if_fail (encoding1 != NULL, FALSE); + g_return_val_if_fail (encoding2 != NULL, FALSE); + g_return_val_if_fail (encoding3 != NULL, FALSE); + + *encoding1 = "iso-8859-1"; + *encoding2 = "windows-1251"; + *encoding3 = NULL; + + init_lang_to_encodings_hash (); + + tmp_lang = g_strdup (lang); + if ((encodings = g_hash_table_lookup (langToEncodings5, tmp_lang))) + { + *encoding1 = (char *) encodings->encoding1; + *encoding2 = (char *) encodings->encoding2; + *encoding3 = (char *) encodings->encoding3; + success = TRUE; + } + + /* Truncate tmp_lang to length of 2 */ + if (strlen (tmp_lang) > 2) + tmp_lang[2] = '\0'; + if (!success && (encodings = g_hash_table_lookup (langToEncodings2, tmp_lang))) + { + *encoding1 = (char *) encodings->encoding1; + *encoding2 = (char *) encodings->encoding2; + *encoding3 = (char *) encodings->encoding3; + success = TRUE; + } + + g_free (tmp_lang); + return success; +} + +static char * +string_to_utf8 (const char *str, gsize len) +{ + char *converted = NULL; + char *lang, *e1 = NULL, *e2 = NULL, *e3 = NULL; + + g_return_val_if_fail (str != NULL, NULL); + + if (g_utf8_validate (str, len, NULL)) + return g_strdup (str); + + /* LANG may be a good encoding hint */ + g_get_charset ((const char **)(&e1)); + if ((lang = getenv ("LANG"))) { + char * dot; + + lang = g_ascii_strdown (lang, -1); + if ((dot = strchr (lang, '.'))) + *dot = '\0'; + + get_encodings_for_lang (lang, &e1, &e2, &e3); + g_free (lang); + } + + converted = g_convert (str, len, "UTF-8", e1, NULL, NULL, NULL); + if (!converted && e2) + converted = g_convert (str, len, "UTF-8", e2, NULL, NULL, NULL); + + if (!converted && e3) + converted = g_convert (str, len, "UTF-8", e3, NULL, NULL, NULL); + + if (!converted) { + converted = g_convert_with_fallback (str, len, "UTF-8", e1, + "?", NULL, NULL, NULL); + } + + return converted; +} + +/* init, deinit for libnm_util */ + +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. + * + * Returns: TRUE if the initialization was successful, FALSE on failure. + **/ +gboolean +nm_utils_init (GError **error) +{ + if (!initialized) { + if (!crypto_init (error)) + return FALSE; + + _nm_utils_register_value_transformations (); + + atexit (nm_utils_deinit); + initialized = TRUE; + } + return TRUE; +} + +/** + * 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. + **/ +void +nm_utils_deinit (void) +{ + if (initialized) { + crypto_deinit (); + initialized = FALSE; + } +} + +/* ssid helpers */ + +/** + * nm_utils_ssid_to_utf8: + * @ssid: pointer to a buffer containing the SSID data + * @len: length of the SSID data in @ssid + * + * WiFi SSIDs are byte arrays, they are _not_ strings. Thus, an SSID may + * contain embedded NULLs and other unprintable characters. Often it is + * useful to print the SSID out for debugging purposes, but that should be the + * _only_ use of this function. Do not use this function for any persistent + * storage of the SSID, since the printable SSID returned from this function + * cannot be converted back into the real SSID of the access point. + * + * This function does almost everything humanly possible to convert the input + * into a printable UTF-8 string, using roughly the following procedure: + * + * 1) if the input data is already UTF-8 safe, no conversion is performed + * 2) attempts to get the current system language from the LANG environment + * variable, and depending on the language, uses a table of alternative + * encodings to try. For example, if LANG=hu_HU, the table may first try + * the ISO-8859-2 encoding, and if that fails, try the Windows-1250 encoding. + * If all fallback encodings fail, replaces non-UTF-8 characters with '?'. + * 3) If the system language was unable to be determined, falls back to the + * ISO-8859-1 encoding, then to the Windows-1251 encoding. + * 4) If step 3 fails, replaces non-UTF-8 characters with '?'. + * + * Again, this function should be used for debugging and display purposes + * _only_. + * + * Returns: an allocated string containing a UTF-8 representation of the + * SSID, which must be freed by the caller using g_free(). Returns NULL + * on errors. + **/ +char * +nm_utils_ssid_to_utf8 (const char *ssid, guint32 len) +{ + char *converted = NULL, *buf; + gsize buflen = MIN (IW_ESSID_MAX_SIZE, (gsize) len); + + g_return_val_if_fail (ssid != NULL, NULL); + + /* New buffer to ensure NULL-termination of SSID */ + buf = g_malloc0 (IW_ESSID_MAX_SIZE + 1); + memcpy (buf, ssid, buflen); + converted = string_to_utf8 (buf, buflen); + g_free (buf); + return converted; +} + +/* Shamelessly ripped from the Linux kernel ieee80211 stack */ +/** + * nm_utils_is_empty_ssid: + * @ssid: 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 + * AP's SSID. This function attempts to detect blank/empty SSIDs using a + * number of known SSID-cloaking methods. + * + * Returns: TRUE if the SSID is "empty", FALSE if it is not + **/ +gboolean +nm_utils_is_empty_ssid (const guint8 * ssid, int len) +{ + /* Single white space is for Linksys APs */ + if (len == 1 && ssid[0] == ' ') + return TRUE; + + /* Otherwise, if the entire ssid is 0, we assume it is hidden */ + while (len--) { + if (ssid[len] != '\0') + return FALSE; + } + return TRUE; +} + +/** + * nm_utils_escape_ssid: + * @ssid: 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 + * replacing embedded NULLs and non-printable characters with the hexadecimal + * representation of that character. Intended for debugging only, should not + * be used for display of SSIDs. + * + * Returns: pointer to the escaped SSID, which uses an internal static buffer + * and will be overwritten by subsequent calls to this function + **/ +const char * +nm_utils_escape_ssid (const guint8 * ssid, guint32 len) +{ + static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; + const guint8 *s = ssid; + char *d = escaped; + + if (nm_utils_is_empty_ssid (ssid, len)) { + memcpy (escaped, "", sizeof ("")); + return escaped; + } + + len = MIN (len, (guint32) IW_ESSID_MAX_SIZE); + while (len--) { + if (*s == '\0') { + *d++ = '\\'; + *d++ = '0'; + s++; + } else { + *d++ = *s++; + } + } + *d = '\0'; + return escaped; +} + +/** + * nm_utils_same_ssid: + * @ssid1: first SSID data to compare + * @ssid2: second SSID data to compare + * @ignore_trailing_null: TRUE to ignore one trailing NULL byte + * + * Earlier versions of the Linux kernel added a NULL byte to the end of the + * SSID to enable easy printing of the SSID on the console or in a terminal, + * but this behavior was problematic (SSIDs are simply byte arrays, not strings) + * and thus was changed. This function compensates for that behavior at the + * cost of some compatibility with odd SSIDs that may legitimately have trailing + * NULLs, even though that is functionally pointless. + * + * Returns: TRUE if the SSIDs are the same, FALSE if they are not + **/ +gboolean +nm_utils_same_ssid (const GByteArray * ssid1, + const GByteArray * ssid2, + gboolean ignore_trailing_null) +{ + guint32 ssid1_len, ssid2_len; + + if (ssid1 == ssid2) + return TRUE; + if ((ssid1 && !ssid2) || (!ssid1 && ssid2)) + return FALSE; + + ssid1_len = ssid1->len; + ssid2_len = ssid2->len; + if (ssid1_len && ssid2_len && ignore_trailing_null) { + if (ssid1->data[ssid1_len - 1] == '\0') + ssid1_len--; + if (ssid2->data[ssid2_len - 1] == '\0') + ssid2_len--; + } + + if (ssid1_len != ssid2_len) + return FALSE; + + return memcmp (ssid1->data, ssid2->data, ssid1_len) == 0 ? TRUE : FALSE; +} + +static void +value_destroy (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static void +value_dup (gpointer key, gpointer val, gpointer user_data) +{ + GHashTable *table = (GHashTable *) user_data; + GValue *value = (GValue *) val; + GValue *dup_value; + + dup_value = g_slice_new0 (GValue); + g_value_init (dup_value, G_VALUE_TYPE (val)); + g_value_copy (value, dup_value); + + g_hash_table_insert (table, g_strdup ((char *) key), dup_value); +} + +/** + * nm_utils_gvalue_hash_dup: + * @hash: a #GHashTable mapping string:GValue + * + * Utility function to duplicate a hash table of GValues. + * + * Returns: a newly allocated duplicated #GHashTable, caller must free the + * returned hash with g_hash_table_unref() or g_hash_table_destroy() + **/ +GHashTable * +nm_utils_gvalue_hash_dup (GHashTable *hash) +{ + GHashTable *table; + + g_return_val_if_fail (hash != NULL, NULL); + + table = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + value_destroy); + + g_hash_table_foreach (hash, value_dup, table); + + return table; +} + +/** + * nm_utils_slist_free: + * @list: a #GSList + * @elem_destroy_fn: user function called for each element in @list + * + * Utility function to free a #GSList. + **/ +void +nm_utils_slist_free (GSList *list, GDestroyNotify elem_destroy_fn) +{ + if (!list) + return; + + if (elem_destroy_fn) + g_slist_foreach (list, (GFunc) elem_destroy_fn, NULL); + + g_slist_free (list); +} + +gboolean +_nm_utils_string_in_list (const char *str, const char **valid_strings) +{ + int i; + + for (i = 0; valid_strings[i]; i++) + if (strcmp (str, valid_strings[i]) == 0) + break; + + return valid_strings[i] != NULL; +} + +gboolean +_nm_utils_string_slist_validate (GSList *list, const char **valid_values) +{ + GSList *iter; + + for (iter = list; iter; iter = iter->next) { + if (!_nm_utils_string_in_list ((char *) iter->data, valid_values)) + return FALSE; + } + + return TRUE; +} + +static void +nm_utils_convert_strv_to_slist (const GValue *src_value, GValue *dest_value) +{ + char **str; + GSList *list = NULL; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), G_TYPE_STRV)); + + str = (char **) g_value_get_boxed (src_value); + + while (str && str[i]) + list = g_slist_prepend (list, g_strdup (str[i++])); + + g_value_take_boxed (dest_value, g_slist_reverse (list)); +} + +static void +nm_utils_convert_strv_to_string (const GValue *src_value, GValue *dest_value) +{ + GSList *strings; + GString *printable; + GSList *iter; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_LIST_OF_STRING)); + + strings = (GSList *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + for (iter = strings; iter; iter = g_slist_next (iter)) { + if (iter != strings) + g_string_append (printable, ", '"); + else + g_string_append_c (printable, '\''); + g_string_append (printable, iter->data); + g_string_append_c (printable, '\''); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +nm_utils_convert_uint_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GArray *array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_UINT_ARRAY)); + + array = (GArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + while (array && (i < array->len)) { + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + + if (i > 0) + g_string_append (printable, ", "); + + memset (buf, 0, sizeof (buf)); + addr.s_addr = g_array_index (array, guint32, i++); + if (!inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN)) + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (addr.s_addr)); + g_string_append_printf (printable, "%u (%s)", addr.s_addr, buf); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +nm_utils_convert_ip4_addr_route_struct_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GPtrArray *ptr_array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT)); + + ptr_array = (GPtrArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + while (ptr_array && (i < ptr_array->len)) { + GArray *array; + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + gboolean is_addr; /* array contains address x route */ + + if (i > 0) + g_string_append (printable, ", "); + + g_string_append (printable, "{ "); + array = (GArray *) g_ptr_array_index (ptr_array, i++); + if (array->len < 2) { + g_string_append (printable, "invalid"); + continue; + } + is_addr = (array->len < 4); + + memset (buf, 0, sizeof (buf)); + addr.s_addr = g_array_index (array, guint32, 0); + if (!inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN)) + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (addr.s_addr)); + if (is_addr) + g_string_append_printf (printable, "ip = %s", buf); + else + g_string_append_printf (printable, "dst = %s", buf); + g_string_append (printable, ", "); + + memset (buf, 0, sizeof (buf)); + g_string_append_printf (printable, "px = %u", + g_array_index (array, guint32, 1)); + + if (array->len > 2) { + g_string_append (printable, ", "); + + memset (buf, 0, sizeof (buf)); + addr.s_addr = g_array_index (array, guint32, 2); + if (!inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN)) + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (addr.s_addr)); + if (is_addr) + g_string_append_printf (printable, "gw = %s", buf); + else + g_string_append_printf (printable, "nh = %s", buf); + } + + if (array->len > 3) { + g_string_append (printable, ", "); + + memset (buf, 0, sizeof (buf)); + g_string_append_printf (printable, "mt = %u", + g_array_index (array, guint32, 3)); + } + + g_string_append (printable, " }"); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +convert_one_gvalue_hash_entry (gpointer key, gpointer value, gpointer user_data) +{ + GString *printable = (GString *) user_data; + char *value_as_string; + + value_as_string = g_strdup_value_contents ((GValue *) value); + g_string_append_printf (printable, " { '%s': %s },", (const char *) key, value_as_string); + g_free (value_as_string); +} + +static void +nm_utils_convert_gvalue_hash_to_string (const GValue *src_value, GValue *dest_value) +{ + GHashTable *hash; + GString *printable; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_MAP_OF_VARIANT)); + + hash = (GHashTable *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + g_hash_table_foreach (hash, convert_one_gvalue_hash_entry, printable); + g_string_append (printable, " ]"); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +convert_one_string_hash_entry (gpointer key, gpointer value, gpointer user_data) +{ + GString *printable = (GString *) user_data; + + g_string_append_printf (printable, " { '%s': %s },", (const char *) key, (const char *) value); +} + +static void +nm_utils_convert_string_hash_to_string (const GValue *src_value, GValue *dest_value) +{ + GHashTable *hash; + GString *printable; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_MAP_OF_STRING)); + + hash = (GHashTable *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + if (hash) + g_hash_table_foreach (hash, convert_one_string_hash_entry, printable); + g_string_append (printable, " ]"); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +nm_utils_convert_byte_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GArray *array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_UCHAR_ARRAY)); + + array = (GArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + if (array) { + while (i < MIN (array->len, 35)) { + if (i > 0) + g_string_append_c (printable, ' '); + g_string_append_printf (printable, "0x%02X", + g_array_index (array, unsigned char, i++)); + } + if (i < array->len) + g_string_append (printable, " ... "); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static gboolean +nm_utils_inet6_ntop (struct in6_addr *addr, char *buf) +{ + if (!inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN)) { + int i; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", addr->s6_addr[0]); + for (i = 1; i < 16; i++) + g_string_append_printf (ip6_str, " %02X", addr->s6_addr[i]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + return FALSE; + } + return TRUE; +} + +static void +nm_utils_convert_ip6_dns_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GPtrArray *ptr_array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR)); + + ptr_array = (GPtrArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + while (ptr_array && (i < ptr_array->len)) { + GByteArray *bytearray; + char buf[INET6_ADDRSTRLEN]; + struct in6_addr *addr; + + if (i > 0) + g_string_append (printable, ", "); + + bytearray = (GByteArray *) g_ptr_array_index (ptr_array, i++); + if (bytearray->len != 16) { + g_string_append (printable, "invalid"); + continue; + } + addr = (struct in6_addr *) bytearray->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "%s", buf); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +nm_utils_convert_ip6_addr_struct_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GPtrArray *ptr_array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS)); + + ptr_array = (GPtrArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + while (ptr_array && (i < ptr_array->len)) { + GValueArray *elements; + GValue *tmp; + GByteArray *ba_addr; + char buf[INET6_ADDRSTRLEN]; + struct in6_addr *addr; + guint32 prefix; + + if (i > 0) + g_string_append (printable, ", "); + + g_string_append (printable, "{ "); + elements = (GValueArray *) g_ptr_array_index (ptr_array, i++); + if ( (elements->n_values != 3) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 1)) != G_TYPE_UINT) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 2)) != DBUS_TYPE_G_UCHAR_ARRAY)) { + g_string_append (printable, "invalid }"); + continue; + } + + /* IPv6 address */ + tmp = g_value_array_get_nth (elements, 0); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + g_string_append (printable, "invalid }"); + continue; + } + addr = (struct in6_addr *) ba_addr->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "ip = %s", buf); + g_string_append (printable, ", "); + + /* Prefix */ + tmp = g_value_array_get_nth (elements, 1); + prefix = g_value_get_uint (tmp); + if (prefix > 128) { + g_string_append (printable, "invalid }"); + continue; + } + g_string_append_printf (printable, "px = %u", prefix); + g_string_append (printable, ", "); + + /* IPv6 Gateway */ + tmp = g_value_array_get_nth (elements, 2); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + g_string_append (printable, "invalid }"); + continue; + } + addr = (struct in6_addr *) ba_addr->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "gw = %s", buf); + g_string_append (printable, " }"); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +static void +nm_utils_convert_ip6_route_struct_array_to_string (const GValue *src_value, GValue *dest_value) +{ + GPtrArray *ptr_array; + GString *printable; + guint i = 0; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE)); + + ptr_array = (GPtrArray *) g_value_get_boxed (src_value); + + printable = g_string_new ("["); + while (ptr_array && (i < ptr_array->len)) { + GValueArray *elements; + GValue *tmp; + GByteArray *ba_addr; + char buf[INET6_ADDRSTRLEN]; + struct in6_addr *addr; + guint32 prefix, metric; + + if (i > 0) + g_string_append (printable, ", "); + + g_string_append (printable, "{ "); + elements = (GValueArray *) g_ptr_array_index (ptr_array, i++); + if ( (elements->n_values != 4) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 1)) != G_TYPE_UINT) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 2)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 3)) != G_TYPE_UINT)) { + g_string_append (printable, "invalid"); + continue; + } + + /* Destination address */ + tmp = g_value_array_get_nth (elements, 0); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + g_string_append (printable, "invalid"); + continue; + } + addr = (struct in6_addr *) ba_addr->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "dst = %s", buf); + g_string_append (printable, ", "); + + /* Prefix */ + tmp = g_value_array_get_nth (elements, 1); + prefix = g_value_get_uint (tmp); + if (prefix > 128) { + g_string_append (printable, "invalid"); + continue; + } + g_string_append_printf (printable, "px = %u", prefix); + g_string_append (printable, ", "); + + /* Next hop addresses */ + tmp = g_value_array_get_nth (elements, 2); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + g_string_append (printable, "invalid"); + continue; + } + addr = (struct in6_addr *) ba_addr->data; + memset (buf, 0, sizeof (buf)); + nm_utils_inet6_ntop (addr, buf); + g_string_append_printf (printable, "nh = %s", buf); + g_string_append (printable, ", "); + + /* Metric */ + tmp = g_value_array_get_nth (elements, 3); + metric = g_value_get_uint (tmp); + g_string_append_printf (printable, "mt = %u", metric); + + g_string_append (printable, " }"); + } + g_string_append_c (printable, ']'); + + g_value_take_string (dest_value, printable->str); + g_string_free (printable, FALSE); +} + +#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)) + +static void +nm_utils_convert_old_ip6_addr_array (const GValue *src_value, GValue *dst_value) +{ + GPtrArray *src_outer_array; + GPtrArray *dst_outer_array; + guint i; + + g_return_if_fail (g_type_is_a (G_VALUE_TYPE (src_value), OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS)); + + src_outer_array = (GPtrArray *) g_value_get_boxed (src_value); + dst_outer_array = g_ptr_array_new (); + + for (i = 0; src_outer_array && (i < src_outer_array->len); i++) { + GValueArray *src_addr_array; + GValueArray *dst_addr_array; + GValue element = {0, }; + GValue *src_addr, *src_prefix; + GByteArray *ba; + + src_addr_array = (GValueArray *) g_ptr_array_index (src_outer_array, i); + + if ( (src_addr_array->n_values != 2) + || (G_VALUE_TYPE (g_value_array_get_nth (src_addr_array, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (src_addr_array, 1)) != G_TYPE_UINT)) { + g_warning ("%s: invalid old IPv6 address type", __func__); + return; + } + + dst_addr_array = g_value_array_new (3); + + src_addr = g_value_array_get_nth (src_addr_array, 0); + g_value_array_append (dst_addr_array, src_addr); + src_prefix = g_value_array_get_nth (src_addr_array, 1); + g_value_array_append (dst_addr_array, src_prefix); + + /* Blank Gateway */ + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + ba = g_byte_array_new (); + g_byte_array_append (ba, (guint8 *) "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16); + g_value_take_boxed (&element, ba); + g_value_array_append (dst_addr_array, &element); + g_value_unset (&element); + + g_ptr_array_add (dst_outer_array, dst_addr_array); + } + + g_value_take_boxed (dst_value, dst_outer_array); +} + +void +_nm_utils_register_value_transformations (void) +{ + static gboolean registered = FALSE; + + if (G_UNLIKELY (!registered)) { + g_value_register_transform_func (G_TYPE_STRV, + DBUS_TYPE_G_LIST_OF_STRING, + nm_utils_convert_strv_to_slist); + g_value_register_transform_func (DBUS_TYPE_G_LIST_OF_STRING, + G_TYPE_STRING, + nm_utils_convert_strv_to_string); + g_value_register_transform_func (DBUS_TYPE_G_UINT_ARRAY, + G_TYPE_STRING, + nm_utils_convert_uint_array_to_string); + g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, + G_TYPE_STRING, + nm_utils_convert_ip4_addr_route_struct_array_to_string); + g_value_register_transform_func (DBUS_TYPE_G_MAP_OF_VARIANT, + G_TYPE_STRING, + nm_utils_convert_gvalue_hash_to_string); + g_value_register_transform_func (DBUS_TYPE_G_MAP_OF_STRING, + G_TYPE_STRING, + nm_utils_convert_string_hash_to_string); + g_value_register_transform_func (DBUS_TYPE_G_UCHAR_ARRAY, + G_TYPE_STRING, + nm_utils_convert_byte_array_to_string); + g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR, + G_TYPE_STRING, + nm_utils_convert_ip6_dns_array_to_string); + g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + G_TYPE_STRING, + nm_utils_convert_ip6_addr_struct_array_to_string); + g_value_register_transform_func (DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE, + G_TYPE_STRING, + nm_utils_convert_ip6_route_struct_array_to_string); + g_value_register_transform_func (OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + nm_utils_convert_old_ip6_addr_array); + registered = TRUE; + } +} + +static gboolean +device_supports_ap_ciphers (guint32 dev_caps, + guint32 ap_flags, + gboolean static_wep) +{ + gboolean have_pair = FALSE; + gboolean have_group = FALSE; + /* Device needs to support at least one pairwise and one group cipher */ + + /* Pairwise */ + if (static_wep) { + /* Static WEP only uses group ciphers */ + have_pair = TRUE; + } else { + if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_WEP40) + if (ap_flags & NM_802_11_AP_SEC_PAIR_WEP40) + have_pair = TRUE; + if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_WEP104) + if (ap_flags & NM_802_11_AP_SEC_PAIR_WEP104) + have_pair = TRUE; + if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) + if (ap_flags & NM_802_11_AP_SEC_PAIR_TKIP) + have_pair = TRUE; + if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) + if (ap_flags & NM_802_11_AP_SEC_PAIR_CCMP) + have_pair = TRUE; + } + + /* Group */ + if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_WEP40) + if (ap_flags & NM_802_11_AP_SEC_GROUP_WEP40) + have_group = TRUE; + if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_WEP104) + if (ap_flags & NM_802_11_AP_SEC_GROUP_WEP104) + have_group = TRUE; + if (!static_wep) { + if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP) + if (ap_flags & NM_802_11_AP_SEC_GROUP_TKIP) + have_group = TRUE; + if (dev_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP) + if (ap_flags & NM_802_11_AP_SEC_GROUP_CCMP) + have_group = TRUE; + } + + return (have_pair && have_group); +} + +/** + * nm_utils_security_valid: + * @type: the security type to check AP flags and device capabilties against, + * e.g. #NMU_SEC_STATIC_WEP + * @wifi_caps: bitfield of the capabilities of the specific WiFi device, e.g. + * #NM_WIFI_DEVICE_CAP_CIPHER_WEP40 + * @have_ap: whether the @ap_flags, @ap_wpa, and @ap_rsn arguments are valid + * @adhoc: whether the capabilities being tested are from an Ad-Hoc AP (IBSS) + * @ap_flags: bitfield of AP capabilities, e.g. #NM_802_11_AP_FLAGS_PRIVACY + * @ap_wpa: bitfield of AP capabilties derived from the AP's WPA beacon, + * e.g. (#NM_802_11_AP_SEC_PAIR_TKIP | #NM_802_11_AP_SEC_KEY_MGMT_PSK) + * @ap_rsn: bitfield of AP capabilties derived from the AP's RSN/WPA2 beacon, + * e.g. (#NM_802_11_AP_SEC_PAIR_CCMP | #NM_802_11_AP_SEC_PAIR_TKIP) + * + * Given a set of device capabilities, and a desired security type to check + * against, determines whether the combination of device, desired security + * type, and AP capabilities intersect. + * + * Returns: TRUE if the device capabilities and AP capabilties intersect and are + * compatible with the desired @type, FALSE if they are not + **/ +gboolean +nm_utils_security_valid (NMUtilsSecurityType type, + guint32 wifi_caps, + gboolean have_ap, + gboolean adhoc, + guint32 ap_flags, + guint32 ap_wpa, + guint32 ap_rsn) +{ + gboolean good = TRUE; + + if (!have_ap) { + if (type == NMU_SEC_NONE) + return TRUE; + if ( (type == NMU_SEC_STATIC_WEP) + || ((type == NMU_SEC_DYNAMIC_WEP) && !adhoc) + || ((type == NMU_SEC_LEAP) && !adhoc)) { + if (wifi_caps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104)) + return TRUE; + } + } + + switch (type) { + case NMU_SEC_NONE: + g_assert (have_ap); + if (ap_flags & NM_802_11_AP_FLAGS_PRIVACY) + return FALSE; + if (ap_wpa || ap_rsn) + return FALSE; + break; + case NMU_SEC_LEAP: /* require PRIVACY bit for LEAP? */ + if (adhoc) + return FALSE; + /* Fall through */ + case NMU_SEC_STATIC_WEP: + g_assert (have_ap); + if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY)) + return FALSE; + if (ap_wpa || ap_rsn) { + if (!device_supports_ap_ciphers (wifi_caps, ap_wpa, TRUE)) + if (!device_supports_ap_ciphers (wifi_caps, ap_rsn, TRUE)) + return FALSE; + } + break; + case NMU_SEC_DYNAMIC_WEP: + if (adhoc) + return FALSE; + g_assert (have_ap); + if (ap_rsn || !(ap_flags & NM_802_11_AP_FLAGS_PRIVACY)) + return FALSE; + /* Some APs broadcast minimal WPA-enabled beacons that must be handled */ + if (ap_wpa) { + if (!(ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + return FALSE; + if (!device_supports_ap_ciphers (wifi_caps, ap_wpa, FALSE)) + return FALSE; + } + break; + case NMU_SEC_WPA_PSK: + if (!(wifi_caps & NM_WIFI_DEVICE_CAP_WPA)) + return FALSE; + if (have_ap) { + /* Ad-Hoc WPA APs won't necessarily have the PSK flag set */ + if ((ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_PSK) || adhoc) { + if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_TKIP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)) + return TRUE; + if ( (ap_wpa & NM_802_11_AP_SEC_PAIR_CCMP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) + return TRUE; + } + return FALSE; + } + break; + case NMU_SEC_WPA2_PSK: + if (!(wifi_caps & NM_WIFI_DEVICE_CAP_RSN)) + return FALSE; + if (have_ap) { + /* Ad-Hoc WPA APs won't necessarily have the PSK flag set */ + if ((ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_PSK) || adhoc) { + if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_TKIP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_TKIP)) + return TRUE; + if ( (ap_rsn & NM_802_11_AP_SEC_PAIR_CCMP) + && (wifi_caps & NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) + return TRUE; + } + return FALSE; + } + break; + case NMU_SEC_WPA_ENTERPRISE: + if (adhoc) + return FALSE; + if (!(wifi_caps & NM_WIFI_DEVICE_CAP_WPA)) + return FALSE; + if (have_ap) { + if (!(ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + return FALSE; + /* Ensure at least one WPA cipher is supported */ + if (!device_supports_ap_ciphers (wifi_caps, ap_wpa, FALSE)) + return FALSE; + } + break; + case NMU_SEC_WPA2_ENTERPRISE: + if (adhoc) + return FALSE; + if (!(wifi_caps & NM_WIFI_DEVICE_CAP_RSN)) + return FALSE; + if (have_ap) { + if (!(ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + return FALSE; + /* Ensure at least one WPA cipher is supported */ + if (!device_supports_ap_ciphers (wifi_caps, ap_rsn, FALSE)) + return FALSE; + } + break; + default: + good = FALSE; + break; + } + + return good; +} + +/** + * nm_utils_ip4_addresses_from_gvalue: + * @value: gvalue containing a GPtrArray of GArrays of guint32s + * + * Utility function to convert a #GPtrArray of #GArrays of guint32s representing + * a list of NetworkManager IPv4 addresses (which is a tuple of address, gateway, + * and prefix) into a GSList of #NMIP4Address objects. The specific format of + * this serialization is not guaranteed to be stable and the #GArray may be + * extended in the future. + * + * Returns: a newly allocated #GSList of #NMIP4Address objects + **/ +GSList * +nm_utils_ip4_addresses_from_gvalue (const GValue *value) +{ + GPtrArray *addresses; + int i; + GSList *list = NULL; + + addresses = (GPtrArray *) g_value_get_boxed (value); + for (i = 0; addresses && (i < addresses->len); i++) { + GArray *array = (GArray *) g_ptr_array_index (addresses, i); + NMIP4Address *addr; + + if (array->len < 3) { + nm_warning ("Ignoring invalid IP4 address"); + continue; + } + + addr = nm_ip4_address_new (); + nm_ip4_address_set_address (addr, g_array_index (array, guint32, 0)); + nm_ip4_address_set_prefix (addr, g_array_index (array, guint32, 1)); + nm_ip4_address_set_gateway (addr, g_array_index (array, guint32, 2)); + list = g_slist_prepend (list, addr); + } + + return g_slist_reverse (list); +} + +/** + * nm_utils_ip4_addresses_to_gvalue: + * @list: a list of #NMIP4Address objects + * @value: a pointer to a #GValue into which to place the converted addresses, + * which should be unset by the caller (when no longer needed) with + * g_value_unset(). + * + * Utility function to convert a #GSList of #NMIP4Address objects into a + * GPtrArray of GArrays of guint32s representing a list of NetworkManager IPv4 + * addresses (which is a tuple of address, gateway, and prefix). The specific + * format of this serialization is not guaranteed to be stable and may be + * extended in the future. + **/ +void +nm_utils_ip4_addresses_to_gvalue (GSList *list, GValue *value) +{ + GPtrArray *addresses; + GSList *iter; + + addresses = g_ptr_array_new (); + + for (iter = list; iter; iter = iter->next) { + NMIP4Address *addr = (NMIP4Address *) iter->data; + GArray *array; + guint32 tmp; + + array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); + + tmp = nm_ip4_address_get_address (addr); + g_array_append_val (array, tmp); + + tmp = nm_ip4_address_get_prefix (addr); + g_array_append_val (array, tmp); + + tmp = nm_ip4_address_get_gateway (addr); + g_array_append_val (array, tmp); + + g_ptr_array_add (addresses, array); + } + + g_value_take_boxed (value, addresses); +} + +/** + * nm_utils_ip4_routes_from_gvalue: + * @value: gvalue containing a GPtrArray of GArrays of guint32s + * + * Utility function to convert a GPtrArray of GArrays of guint32s representing + * a list of NetworkManager IPv4 routes (which is a tuple of route, next hop, + * prefix, and metric) into a GSList of #NMIP4Route objects. The specific + * format of this serialization is not guaranteed to be stable and may be + * extended in the future. + * + * Returns: a newly allocated #GSList of #NMIP4Route objects + **/ +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) { + nm_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); +} + +/** + * nm_utils_ip4_routes_to_gvalue: + * @list: a list of #NMIP4Route objects + * @value: a pointer to a #GValue into which to place the converted routes, + * which should be unset by the caller (when no longer needed) with + * g_value_unset(). + * + * Utility function to convert a #GSList of #NMIP4Route objects into a + * GPtrArray of GArrays of guint32s representing a list of NetworkManager IPv4 + * routes (which is a tuple of route, next hop, prefix, and metric). The + * specific format of this serialization is not guaranteed to be stable and may + * be extended in the future. + **/ +void +nm_utils_ip4_routes_to_gvalue (GSList *list, GValue *value) +{ + GPtrArray *routes; + GSList *iter; + + routes = g_ptr_array_new (); + + for (iter = list; iter; iter = iter->next) { + NMIP4Route *route = (NMIP4Route *) iter->data; + GArray *array; + guint32 tmp; + + array = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); + + tmp = nm_ip4_route_get_dest (route); + g_array_append_val (array, tmp); + + tmp = nm_ip4_route_get_prefix (route); + g_array_append_val (array, tmp); + + tmp = nm_ip4_route_get_next_hop (route); + g_array_append_val (array, tmp); + + tmp = nm_ip4_route_get_metric (route); + g_array_append_val (array, tmp); + + g_ptr_array_add (routes, array); + } + + g_value_take_boxed (value, routes); +} + +/** + * nm_utils_ip4_netmask_to_prefix: + * @netmask: an IPv4 netmask in network byte order + * + * Returns: the CIDR prefix represented by the netmask + **/ +guint32 +nm_utils_ip4_netmask_to_prefix (guint32 netmask) +{ + guchar *p, *end; + guint32 prefix = 0; + + p = (guchar *) &netmask; + end = p + sizeof (guint32); + + while ((*p == 0xFF) && p < end) { + prefix += 8; + p++; + } + + if (p < end) { + guchar v = *p; + + while (v) { + prefix++; + v <<= 1; + } + } + + return prefix; +} + +/** + * nm_utils_ip4_prefix_to_netmask: + * @prefix: a CIDR prefix + * + * Returns: the netmask represented by the prefix + **/ +guint32 +nm_utils_ip4_prefix_to_netmask (guint32 prefix) +{ + guint32 msk = 0x80000000; + guint32 netmask = 0; + + while (prefix > 0) { + netmask |= msk; + msk >>= 1; + prefix--; + } + + return (guint32) htonl (netmask); +} + + +/** + * nm_utils_ip4_get_default_prefix: + * @ip: an IPv4 address (in network byte order) + * + * When the Internet was originally set up, various ranges of IP addresses were + * segmented into three network classes: A, B, and C. This function will return + * a prefix that is associated with the IP address specified defining where it + * falls in the predefined classes. + * + * Returns: the default class prefix for the given IP + **/ +/* The function is originally from ipcalc.c of Red Hat's initscripts. */ +guint32 +nm_utils_ip4_get_default_prefix (guint32 ip) +{ + if (((ntohl (ip) & 0xFF000000) >> 24) <= 127) + return 8; /* Class A - 255.0.0.0 */ + else if (((ntohl (ip) & 0xFF000000) >> 24) <= 191) + return 16; /* Class B - 255.255.0.0 */ + + return 24; /* Class C - 255.255.255.0 */ +} + +/** + * nm_utils_ip6_addresses_from_gvalue: + * @value: gvalue containing a GPtrArray of GValueArrays of (GArray of guchars) and guint32 + * + * Utility function to convert a #GPtrArray of #GValueArrays of (#GArray of guchars) and guint32 + * representing a list of NetworkManager IPv6 addresses (which is a tuple of address, + * prefix, and gateway), into a GSList of #NMIP6Address objects. The specific format of + * this serialization is not guaranteed to be stable and the #GValueArray may be + * extended in the future. + * + * Returns: a newly allocated #GSList of #NMIP6Address objects + **/ +GSList * +nm_utils_ip6_addresses_from_gvalue (const GValue *value) +{ + GPtrArray *addresses; + int i; + GSList *list = NULL; + + addresses = (GPtrArray *) g_value_get_boxed (value); + + for (i = 0; addresses && (i < addresses->len); i++) { + GValueArray *elements = (GValueArray *) g_ptr_array_index (addresses, i); + GValue *tmp; + GByteArray *ba_addr; + GByteArray *ba_gw = NULL; + NMIP6Address *addr; + guint32 prefix; + + if (elements->n_values < 2 || elements->n_values > 3) { + nm_warning ("%s: ignoring invalid IP6 address structure", __func__); + continue; + } + + if ( (G_VALUE_TYPE (g_value_array_get_nth (elements, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (elements, 1)) != G_TYPE_UINT)) { + nm_warning ("%s: ignoring invalid IP6 address structure", __func__); + continue; + } + + /* Check optional 3rd element (gateway) */ + if ( elements->n_values == 3 + && (G_VALUE_TYPE (g_value_array_get_nth (elements, 2)) != DBUS_TYPE_G_UCHAR_ARRAY)) { + nm_warning ("%s: ignoring invalid IP6 address structure", __func__); + continue; + } + + tmp = g_value_array_get_nth (elements, 0); + ba_addr = g_value_get_boxed (tmp); + if (ba_addr->len != 16) { + nm_warning ("%s: ignoring invalid IP6 address of length %d", + __func__, ba_addr->len); + continue; + } + + tmp = g_value_array_get_nth (elements, 1); + prefix = g_value_get_uint (tmp); + if (prefix > 128) { + nm_warning ("%s: ignoring invalid IP6 prefix %d", + __func__, prefix); + continue; + } + + if (elements->n_values == 3) { + tmp = g_value_array_get_nth (elements, 2); + ba_gw = g_value_get_boxed (tmp); + if (ba_gw->len != 16) { + nm_warning ("%s: ignoring invalid IP6 gateway address of length %d", + __func__, ba_gw->len); + continue; + } + } + + addr = nm_ip6_address_new (); + nm_ip6_address_set_prefix (addr, prefix); + nm_ip6_address_set_address (addr, (const struct in6_addr *) ba_addr->data); + if (ba_gw) + nm_ip6_address_set_gateway (addr, (const struct in6_addr *) ba_gw->data); + + list = g_slist_prepend (list, addr); + } + + return g_slist_reverse (list); +} + +/** + * nm_utils_ip6_addresses_to_gvalue: + * @list: a list of #NMIP6Address objects + * @value: a pointer to a #GValue into which to place the converted addresses, + * which should be unset by the caller (when no longer needed) with + * g_value_unset(). + * + * Utility function to convert a #GSList of #NMIP6Address objects into a + * GPtrArray of GValueArrays representing a list of NetworkManager IPv6 addresses + * (which is a tuple of address, prefix, and gateway). The specific format of + * this serialization is not guaranteed to be stable and may be extended in the + * future. + **/ +void +nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value) +{ + GPtrArray *addresses; + GSList *iter; + + addresses = g_ptr_array_new (); + + for (iter = list; iter; iter = iter->next) { + NMIP6Address *addr = (NMIP6Address *) iter->data; + GValueArray *array; + GValue element = {0, }; + GByteArray *ba; + + array = g_value_array_new (3); + + /* IP address */ + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + ba = g_byte_array_new (); + g_byte_array_append (ba, (guint8 *) nm_ip6_address_get_address (addr), 16); + g_value_take_boxed (&element, ba); + g_value_array_append (array, &element); + g_value_unset (&element); + + /* Prefix */ + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, nm_ip6_address_get_prefix (addr)); + g_value_array_append (array, &element); + g_value_unset (&element); + + /* Gateway */ + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + ba = g_byte_array_new (); + g_byte_array_append (ba, (guint8 *) nm_ip6_address_get_gateway (addr), 16); + g_value_take_boxed (&element, ba); + g_value_array_append (array, &element); + g_value_unset (&element); + + g_ptr_array_add (addresses, array); + } + + g_value_take_boxed (value, addresses); +} + +/** + * nm_utils_ip6_routes_from_gvalue: + * @value: gvalue containing a GPtrArray of GValueArrays of (GArray or guchars), guint32, + * (GArray of guchars), and guint32 + * + * Utility function GPtrArray of GValueArrays of (GArray or guchars), guint32, + * (GArray of guchars), and guint32 representing a list of NetworkManager IPv6 + * routes (which is a tuple of destination, prefix, next hop, and metric) + * into a GSList of #NMIP6Route objects. The specific format of this serialization + * is not guaranteed to be stable and may be extended in the future. + * + * Returns: a newly allocated #GSList of #NMIP6Route objects + **/ +GSList * +nm_utils_ip6_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++) { + GValueArray *route_values = (GValueArray *) g_ptr_array_index (routes, i); + GByteArray *dest, *next_hop; + guint prefix, metric; + NMIP6Route *route; + + if ( (route_values->n_values != 4) + || (G_VALUE_TYPE (g_value_array_get_nth (route_values, 0)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (route_values, 1)) != G_TYPE_UINT) + || (G_VALUE_TYPE (g_value_array_get_nth (route_values, 2)) != DBUS_TYPE_G_UCHAR_ARRAY) + || (G_VALUE_TYPE (g_value_array_get_nth (route_values, 3)) != G_TYPE_UINT)) { + nm_warning ("Ignoring invalid IP6 route"); + continue; + } + + dest = g_value_get_boxed (g_value_array_get_nth (route_values, 0)); + if (dest->len != 16) { + nm_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) { + nm_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); + } + + return g_slist_reverse (list); +} + +/** + * nm_utils_ip6_routes_to_gvalue: + * @list: a list of #NMIP6Route objects + * @value: a pointer to a #GValue into which to place the converted routes, + * which should be unset by the caller (when no longer needed) with + * g_value_unset(). + * + * Utility function to convert a #GSList of #NMIP6Route objects into a GPtrArray of + * GValueArrays of (GArray or guchars), guint32, (GArray of guchars), and guint32 + * representing a list of NetworkManager IPv6 routes (which is a tuple of destination, + * prefix, next hop, and metric). The specific format of this serialization is not + * guaranteed to be stable and may be extended in the future. + **/ +void +nm_utils_ip6_routes_to_gvalue (GSList *list, GValue *value) +{ + GPtrArray *routes; + GSList *iter; + + routes = g_ptr_array_new (); + + for (iter = list; iter; iter = iter->next) { + NMIP6Route *route = (NMIP6Route *) iter->data; + GValueArray *array; + const struct in6_addr *addr; + GByteArray *ba; + GValue element = {0, }; + + array = g_value_array_new (4); + + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + addr = nm_ip6_route_get_dest (route); + ba = g_byte_array_new (); + g_byte_array_append (ba, (guchar *)addr, sizeof (*addr)); + g_value_take_boxed (&element, ba); + g_value_array_append (array, &element); + g_value_unset (&element); + + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, nm_ip6_route_get_prefix (route)); + g_value_array_append (array, &element); + g_value_unset (&element); + + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + addr = nm_ip6_route_get_next_hop (route); + ba = g_byte_array_new (); + g_byte_array_append (ba, (guchar *)addr, sizeof (*addr)); + g_value_take_boxed (&element, ba); + g_value_array_append (array, &element); + g_value_unset (&element); + + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, nm_ip6_route_get_metric (route)); + g_value_array_append (array, &element); + g_value_unset (&element); + + g_ptr_array_add (routes, array); + } + + g_value_take_boxed (value, routes); +} + +GSList * +nm_utils_ip6_dns_from_gvalue (const GValue *value) +{ + GPtrArray *dns; + int i; + GSList *list = NULL; + + dns = (GPtrArray *) g_value_get_boxed (value); + for (i = 0; dns && (i < dns->len); i++) { + GByteArray *bytearray = (GByteArray *) g_ptr_array_index (dns, i); + struct in6_addr *addr; + + if (bytearray->len != 16) { + nm_warning ("%s: ignoring invalid IP6 address of length %d", + __func__, bytearray->len); + continue; + } + + addr = g_malloc0 (sizeof (struct in6_addr)); + memcpy (addr->s6_addr, bytearray->data, bytearray->len); + list = g_slist_prepend (list, addr); + } + + return g_slist_reverse (list); +} + +void +nm_utils_ip6_dns_to_gvalue (GSList *list, GValue *value) +{ + GPtrArray *dns; + GSList *iter; + + dns = g_ptr_array_new (); + + for (iter = list; iter; iter = iter->next) { + struct in6_addr *addr = (struct in6_addr *) iter->data; + GByteArray *bytearray; + + bytearray = g_byte_array_sized_new (16); + g_byte_array_append (bytearray, (guint8 *) addr->s6_addr, 16); + g_ptr_array_add (dns, bytearray); + } + + g_value_take_boxed (value, dns); +} + +/** + * nm_utils_uuid_generate: + * + * Returns: a newly allocated UUID suitable for use as the #NMSettingConnection + * object's #NMSettingConnection:id: property. Should be freed with g_free() + **/ +char * +nm_utils_uuid_generate (void) +{ + uuid_t uuid; + char *buf; + + buf = g_malloc0 (37); + uuid_generate_random (uuid); + uuid_unparse_lower (uuid, &buf[0]); + return buf; +} + +/** + * nm_utils_uuid_generate_from_string: + * @s: a string to use as the seed for the UUID + * + * For a given @s, this function will always return the same UUID. + * + * Returns: a newly allocated UUID suitable for use as the #NMSettingConnection + * object's #NMSettingConnection:id: property + **/ +char * +nm_utils_uuid_generate_from_string (const char *s) +{ + GError *error = NULL; + uuid_t *uuid; + char *buf = NULL; + + if (!nm_utils_init (&error)) { + nm_warning ("error initializing crypto: (%d) %s", + error ? error->code : 0, + error ? error->message : "unknown"); + if (error) + g_error_free (error); + return NULL; + } + + uuid = g_malloc0 (sizeof (*uuid)); + if (!crypto_md5_hash (NULL, 0, s, strlen (s), (char *) uuid, sizeof (*uuid), &error)) { + nm_warning ("error generating UUID: (%d) %s", + error ? error->code : 0, + error ? error->message : "unknown"); + if (error) + g_error_free (error); + goto out; + } + + buf = g_malloc0 (37); + uuid_unparse_lower (*uuid, &buf[0]); + +out: + g_free (uuid); + return buf; +} + +static char * +make_key (const char *salt, + const gsize salt_len, + const char *password, + gsize *out_len, + GError **error) +{ + char *key; + guint32 digest_len = 24; /* DES-EDE3-CBC */ + + 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); + + key = g_malloc0 (digest_len + 1); + if (!key) { + g_set_error (error, + NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Not enough memory to make encryption key.")); + return NULL; + } + + 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; + + return key; +} + +/* + * utils_bin2hexstr + * + * Convert a byte-array into a hexadecimal string. + * + * Code originally by Alex Larsson and + * copyright Red Hat, Inc. under terms of the LGPL. + * + */ +static char * +utils_bin2hexstr (const char *bytes, int len, int final_len) +{ + static char hex_digits[] = "0123456789abcdef"; + char *result; + int i; + gsize buflen = (len * 2) + 1; + + g_return_val_if_fail (bytes != NULL, NULL); + g_return_val_if_fail (len > 0, NULL); + g_return_val_if_fail (len < 4096, NULL); /* Arbitrary limit */ + if (final_len > -1) + g_return_val_if_fail (final_len < buflen, NULL); + + result = g_malloc0 (buflen); + for (i = 0; i < len; i++) + { + result[2*i] = hex_digits[(bytes[i] >> 4) & 0xf]; + result[2*i+1] = hex_digits[bytes[i] & 0xf]; + } + /* Cut converted key off at the correct length for this cipher type */ + if (final_len > -1) + result[final_len] = '\0'; + else + result[buflen - 1] = '\0'; + + return result; +} + +/** + * nm_utils_rsa_key_encrypt: + * @data: RSA private key data to be encrypted + * @in_password: existing password to use, if any + * @out_password: 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. + * + * Returns: on success, PEM-formatted data suitable for writing to a PEM-formatted + * certificate/private key file. + **/ +GByteArray * +nm_utils_rsa_key_encrypt (const GByteArray *data, + const char *in_password, + char **out_password, + GError **error) +{ + char salt[8]; + char *key = NULL, *enc = NULL, *pw_buf[32]; + gsize key_len = 0, enc_len = 0; + GString *pem = NULL; + char *tmp, *tmp_password = NULL; + int left; + const char *p; + GByteArray *ret = NULL; + + g_return_val_if_fail (data != NULL, NULL); + g_return_val_if_fail (data->len > 0, NULL); + if (out_password) + g_return_val_if_fail (*out_password == NULL, NULL); + + /* Make the password if needed */ + if (!in_password) { + if (!crypto_randomize (pw_buf, sizeof (pw_buf), error)) + return NULL; + in_password = tmp_password = utils_bin2hexstr ((const char *) pw_buf, sizeof (pw_buf), -1); + } + + if (!crypto_randomize (salt, sizeof (salt), error)) + goto out; + + key = make_key (&salt[0], sizeof (salt), in_password, &key_len, error); + if (!key) + goto out; + + enc = crypto_encrypt (CIPHER_DES_EDE3_CBC, data, salt, sizeof (salt), key, key_len, &enc_len, error); + if (!enc) + goto out; + + pem = g_string_sized_new (enc_len * 2 + 100); + if (!pem) { + g_set_error_literal (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Could not allocate memory for PEM file creation.")); + goto out; + } + + g_string_append (pem, "-----BEGIN RSA PRIVATE KEY-----\n"); + g_string_append (pem, "Proc-Type: 4,ENCRYPTED\n"); + + /* Convert the salt to a hex string */ + tmp = utils_bin2hexstr ((const char *) salt, sizeof (salt), 16); + if (!tmp) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Could not allocate memory for writing IV to PEM file.")); + goto out; + } + + g_string_append_printf (pem, "DEK-Info: DES-EDE3-CBC,%s\n\n", tmp); + g_free (tmp); + + /* Convert the encrypted key to a base64 string */ + p = tmp = g_base64_encode ((const guchar *) enc, enc_len); + if (!tmp) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Could not allocate memory for writing encrypted key to PEM file.")); + goto out; + } + + left = strlen (tmp); + while (left > 0) { + g_string_append_len (pem, p, (left < 64) ? left : 64); + g_string_append_c (pem, '\n'); + left -= 64; + p += 64; + } + g_free (tmp); + + g_string_append (pem, "-----END RSA PRIVATE KEY-----\n"); + + ret = g_byte_array_sized_new (pem->len); + if (!ret) { + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_OUT_OF_MEMORY, + _("Could not allocate memory for PEM file data.")); + goto out; + } + g_byte_array_append (ret, (const unsigned char *) pem->str, pem->len); + if (tmp_password && out_password) + *out_password = g_strdup (tmp_password); + +out: + if (key) { + memset (key, 0, key_len); + g_free (key); + } + if (enc) { + memset (enc, 0, enc_len); + g_free (enc); + } + if (pem) + g_string_free (pem, TRUE); + + if (tmp_password) { + memset (tmp_password, 0, strlen (tmp_password)); + g_free (tmp_password); + } + + return ret; +} + diff --git a/libnm-util/nm-utils.h b/libnm-util/nm-utils.h new file mode 100644 index 00000000..68501d53 --- /dev/null +++ b/libnm-util/nm-utils.h @@ -0,0 +1,218 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * Ray Strode + * Dan Williams + * Tambet Ingo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2005 - 2010 Red Hat, Inc. + */ + +#ifndef NM_UTILS_H +#define NM_UTILS_H + +#include +#include + +#include "nm-connection.h" + +G_BEGIN_DECLS + +/*********************************************************/ +/* The API defined here is _NOT_ guaranteed in any way!! */ +/*********************************************************/ + +/** + * nm_print_backtrace: + * + * Prints a backtrace of the calling process to the logging location. + */ +#define nm_print_backtrace() \ +G_STMT_START \ +{ \ + void *_call_stack[512]; \ + int _call_stack_size; \ + char **_symbols; \ + _call_stack_size = backtrace (_call_stack, \ + G_N_ELEMENTS (_call_stack)); \ + _symbols = backtrace_symbols (_call_stack, _call_stack_size); \ + if (_symbols != NULL) \ + { \ + int _i; \ + _i = 0; \ + g_critical ("traceback:\n"); \ + while (_i < _call_stack_size) \ + { \ + g_critical ("\t%s\n", _symbols[_i]); \ + _i++; \ + } \ + free (_symbols); \ + } \ +} \ +G_STMT_END + +/** + * nm_get_timestamp: + * @timestamp: location in which to place the current timestamp + * + * For debugging only. + */ +#define nm_get_timestamp(timestamp) \ +G_STMT_START \ +{ \ + GTimeVal _tv; \ + g_get_current_time (&_tv); \ + *timestamp = (_tv.tv_sec * (1.0 * G_USEC_PER_SEC) + \ + _tv.tv_usec) / G_USEC_PER_SEC; \ +} \ +G_STMT_END + +#define nm_info(fmt, args...) \ +G_STMT_START \ +{ \ + g_message (" " fmt "\n", ##args); \ +} G_STMT_END + +#define nm_info_str(fmt_str, args...) \ +G_STMT_START \ +{ \ + g_message (" %s\n", fmt_str, ##args); \ +} G_STMT_END + +#define nm_debug(fmt, args...) \ +G_STMT_START \ +{ \ + gdouble _timestamp; \ + nm_get_timestamp (&_timestamp); \ + g_debug (" [%f] %s(): " fmt "\n", _timestamp, \ + G_STRFUNC, ##args); \ +} G_STMT_END + +#define nm_debug_str(fmt_str, args...) \ +G_STMT_START \ +{ \ + gdouble _timestamp; \ + nm_get_timestamp (&_timestamp); \ + g_debug (" [%f] %s(): %s\n", _timestamp, \ + G_STRFUNC, fmt_str, ##args); \ +} G_STMT_END + +#define nm_warning(fmt, args...) \ +G_STMT_START \ +{ \ + g_warning (" %s(): " fmt "\n", \ + G_STRFUNC, ##args); \ +} G_STMT_END + +#define nm_warning_str(fmt_str, args...) \ +G_STMT_START \ +{ \ + g_warning (" %s(): %s\n", \ + G_STRFUNC, fmt_str, ##args); \ +} G_STMT_END + +#define nm_error(fmt, args...) \ +G_STMT_START \ +{ \ + gdouble _timestamp; \ + nm_get_timestamp (&_timestamp); \ + g_critical ("\t[%f] %s (): " fmt "\n", _timestamp, \ + G_STRFUNC, ##args); \ + nm_print_backtrace (); \ + G_BREAKPOINT (); \ +} G_STMT_END + +#define nm_error_str(fmt_str, args...) \ +G_STMT_START \ +{ \ + gdouble _timestamp; \ + nm_get_timestamp (&_timestamp); \ + g_critical ("\t[%f] %s (): %s\n", _timestamp, \ + G_STRFUNC, fmt_str, ##args); \ + nm_print_backtrace (); \ + G_BREAKPOINT (); \ +} G_STMT_END + +/* 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, int len); +const char *nm_utils_escape_ssid (const guint8 *ssid, guint32 len); +gboolean nm_utils_same_ssid (const GByteArray * ssid1, + const GByteArray * ssid2, + gboolean ignore_trailing_null); + +char *nm_utils_ssid_to_utf8 (const char *ssid, guint32 len); + +GHashTable *nm_utils_gvalue_hash_dup (GHashTable *hash); + +void nm_utils_slist_free (GSList *list, + GDestroyNotify elem_destroy_fn); + +typedef enum { + NMU_SEC_INVALID = 0, + NMU_SEC_NONE, + NMU_SEC_STATIC_WEP, + NMU_SEC_LEAP, + NMU_SEC_DYNAMIC_WEP, + NMU_SEC_WPA_PSK, + NMU_SEC_WPA_ENTERPRISE, + NMU_SEC_WPA2_PSK, + NMU_SEC_WPA2_ENTERPRISE +} NMUtilsSecurityType; + +gboolean nm_utils_security_valid (NMUtilsSecurityType type, + guint32 wifi_caps, + gboolean have_ap, + gboolean adhoc, + guint32 ap_flags, + guint32 ap_wpa, + guint32 ap_rsn); + +GSList *nm_utils_ip4_addresses_from_gvalue (const GValue *value); +void nm_utils_ip4_addresses_to_gvalue (GSList *list, GValue *value); + +GSList *nm_utils_ip4_routes_from_gvalue (const GValue *value); +void nm_utils_ip4_routes_to_gvalue (GSList *list, GValue *value); + +guint32 nm_utils_ip4_netmask_to_prefix (guint32 netmask); +guint32 nm_utils_ip4_prefix_to_netmask (guint32 prefix); +guint32 nm_utils_ip4_get_default_prefix (guint32 ip); + +GSList *nm_utils_ip6_addresses_from_gvalue (const GValue *value); +void nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value); + +GSList *nm_utils_ip6_routes_from_gvalue (const GValue *value); +void nm_utils_ip6_routes_to_gvalue (GSList *list, GValue *value); + +GSList *nm_utils_ip6_dns_from_gvalue (const GValue *value); +void nm_utils_ip6_dns_to_gvalue (GSList *list, GValue *value); + +char *nm_utils_uuid_generate (void); +char *nm_utils_uuid_generate_from_string (const char *s); + +GByteArray *nm_utils_rsa_key_encrypt (const GByteArray *data, + const char *in_password, + char **out_password, + GError **error); + +G_END_DECLS + +#endif /* NM_UTILS_H */ diff --git a/libnm-util/tests/Makefile.am b/libnm-util/tests/Makefile.am new file mode 100644 index 00000000..378a7388 --- /dev/null +++ b/libnm-util/tests/Makefile.am @@ -0,0 +1,139 @@ +SUBDIRS=certs + +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util + +noinst_PROGRAMS = \ + test-settings-defaults \ + test-crypto \ + test-need-secrets \ + test-general \ + test-setting-8021x + +test_settings_defaults_SOURCES = \ + test-settings-defaults.c + +test_settings_defaults_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_settings_defaults_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +test_crypto_SOURCES = \ + test-crypto.c + +test_crypto_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_crypto_LDADD = \ + $(top_builddir)/libnm-util/libtest-crypto.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) + +test_need_secrets_SOURCES = \ + test-need-secrets.c + +test_need_secrets_CPPFLAGS = \ + -DTEST_CERT_DIR=\"$(top_srcdir)/libnm-util/tests/certs/\" \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_need_secrets_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +test_general_SOURCES = \ + test-general.c + +test_general_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_general_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +test_setting_8021x_SOURCES = \ + test-setting-8021x.c + +test_setting_8021x_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_setting_8021x_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +if WITH_TESTS + +check-local: test-settings-defaults test-crypto test-need-secrets + $(abs_builddir)/test-settings-defaults + $(abs_builddir)/test-need-secrets + $(abs_builddir)/test-general + +# Private key and CA certificate in the same file (PEM) + $(abs_builddir)/test-setting-8021x \ + $(top_srcdir)/libnm-util/tests/certs/test_key_and_cert.pem \ + "test" \ + $(top_srcdir)/libnm-util/tests/certs/test-key-only-decrypted.der + +# Private key by itself (PEM) + $(abs_builddir)/test-setting-8021x \ + $(top_srcdir)/libnm-util/tests/certs/test-key-only.pem \ + "test" \ + $(top_srcdir)/libnm-util/tests/certs/test-key-only-decrypted.der + +# Private key and CA certificate in the same file (pkcs12) + $(abs_builddir)/test-setting-8021x \ + $(top_srcdir)/libnm-util/tests/certs/test-cert.p12 \ + "test" + +# Normal CA certificate + $(abs_builddir)/test-crypto --cert \ + $(top_srcdir)/libnm-util/tests/certs/test_ca_cert.pem + +# Another CA certificate + $(abs_builddir)/test-crypto --cert \ + $(top_srcdir)/libnm-util/tests/certs/test2_ca_cert.pem + +# CA certificate without an ending newline + $(abs_builddir)/test-crypto --cert \ + $(top_srcdir)/libnm-util/tests/certs/ca-no-ending-newline.pem + +# Combined user cert and private key + $(abs_builddir)/test-crypto --cert \ + $(top_srcdir)/libnm-util/tests/certs/test_key_and_cert.pem + +# Another combined user cert and private key + $(abs_builddir)/test-crypto --cert \ + $(top_srcdir)/libnm-util/tests/certs/test2_key_and_cert.pem + +# Private key with 8 bytes of tail padding + $(abs_builddir)/test-crypto --key \ + $(top_srcdir)/libnm-util/tests/certs/test_key_and_cert.pem \ + "test" + +# Private key with 6 bytes of tail padding + $(abs_builddir)/test-crypto --key \ + $(top_srcdir)/libnm-util/tests/certs/test2_key_and_cert.pem \ + "12345testing" + +# PKCS#12 file + $(abs_builddir)/test-crypto --p12 \ + $(top_srcdir)/libnm-util/tests/certs/test-cert.p12 \ + "test" + +# Another PKCS#12 file + $(abs_builddir)/test-crypto --p12 \ + $(top_srcdir)/libnm-util/tests/certs/test2-cert.p12 \ + "12345testing" + +endif + diff --git a/libnm-util/tests/Makefile.in b/libnm-util/tests/Makefile.in new file mode 100644 index 00000000..9654a565 --- /dev/null +++ b/libnm-util/tests/Makefile.in @@ -0,0 +1,935 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = test-settings-defaults$(EXEEXT) test-crypto$(EXEEXT) \ + test-need-secrets$(EXEEXT) test-general$(EXEEXT) \ + test-setting-8021x$(EXEEXT) +subdir = libnm-util/tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_test_crypto_OBJECTS = test_crypto-test-crypto.$(OBJEXT) +test_crypto_OBJECTS = $(am_test_crypto_OBJECTS) +am__DEPENDENCIES_1 = +test_crypto_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libtest-crypto.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) +am_test_general_OBJECTS = test_general-test-general.$(OBJEXT) +test_general_OBJECTS = $(am_test_general_OBJECTS) +test_general_DEPENDENCIES = $(top_builddir)/libnm-util/libnm-util.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_test_need_secrets_OBJECTS = \ + test_need_secrets-test-need-secrets.$(OBJEXT) +test_need_secrets_OBJECTS = $(am_test_need_secrets_OBJECTS) +test_need_secrets_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_test_setting_8021x_OBJECTS = \ + test_setting_8021x-test-setting-8021x.$(OBJEXT) +test_setting_8021x_OBJECTS = $(am_test_setting_8021x_OBJECTS) +test_setting_8021x_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_test_settings_defaults_OBJECTS = \ + test_settings_defaults-test-settings-defaults.$(OBJEXT) +test_settings_defaults_OBJECTS = $(am_test_settings_defaults_OBJECTS) +test_settings_defaults_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_crypto_SOURCES) $(test_general_SOURCES) \ + $(test_need_secrets_SOURCES) $(test_setting_8021x_SOURCES) \ + $(test_settings_defaults_SOURCES) +DIST_SOURCES = $(test_crypto_SOURCES) $(test_general_SOURCES) \ + $(test_need_secrets_SOURCES) $(test_setting_8021x_SOURCES) \ + $(test_settings_defaults_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = certs +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util + +test_settings_defaults_SOURCES = \ + test-settings-defaults.c + +test_settings_defaults_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_settings_defaults_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +test_crypto_SOURCES = \ + test-crypto.c + +test_crypto_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_crypto_LDADD = \ + $(top_builddir)/libnm-util/libtest-crypto.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) + +test_need_secrets_SOURCES = \ + test-need-secrets.c + +test_need_secrets_CPPFLAGS = \ + -DTEST_CERT_DIR=\"$(top_srcdir)/libnm-util/tests/certs/\" \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_need_secrets_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +test_general_SOURCES = \ + test-general.c + +test_general_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_general_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +test_setting_8021x_SOURCES = \ + test-setting-8021x.c + +test_setting_8021x_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_setting_8021x_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libnm-util/tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libnm-util/tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +test-crypto$(EXEEXT): $(test_crypto_OBJECTS) $(test_crypto_DEPENDENCIES) + @rm -f test-crypto$(EXEEXT) + $(LINK) $(test_crypto_OBJECTS) $(test_crypto_LDADD) $(LIBS) +test-general$(EXEEXT): $(test_general_OBJECTS) $(test_general_DEPENDENCIES) + @rm -f test-general$(EXEEXT) + $(LINK) $(test_general_OBJECTS) $(test_general_LDADD) $(LIBS) +test-need-secrets$(EXEEXT): $(test_need_secrets_OBJECTS) $(test_need_secrets_DEPENDENCIES) + @rm -f test-need-secrets$(EXEEXT) + $(LINK) $(test_need_secrets_OBJECTS) $(test_need_secrets_LDADD) $(LIBS) +test-setting-8021x$(EXEEXT): $(test_setting_8021x_OBJECTS) $(test_setting_8021x_DEPENDENCIES) + @rm -f test-setting-8021x$(EXEEXT) + $(LINK) $(test_setting_8021x_OBJECTS) $(test_setting_8021x_LDADD) $(LIBS) +test-settings-defaults$(EXEEXT): $(test_settings_defaults_OBJECTS) $(test_settings_defaults_DEPENDENCIES) + @rm -f test-settings-defaults$(EXEEXT) + $(LINK) $(test_settings_defaults_OBJECTS) $(test_settings_defaults_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_crypto-test-crypto.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_general-test-general.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_need_secrets-test-need-secrets.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_setting_8021x-test-setting-8021x.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_settings_defaults-test-settings-defaults.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +test_crypto-test-crypto.o: test-crypto.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_crypto_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_crypto-test-crypto.o -MD -MP -MF $(DEPDIR)/test_crypto-test-crypto.Tpo -c -o test_crypto-test-crypto.o `test -f 'test-crypto.c' || echo '$(srcdir)/'`test-crypto.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_crypto-test-crypto.Tpo $(DEPDIR)/test_crypto-test-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-crypto.c' object='test_crypto-test-crypto.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_crypto_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_crypto-test-crypto.o `test -f 'test-crypto.c' || echo '$(srcdir)/'`test-crypto.c + +test_crypto-test-crypto.obj: test-crypto.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_crypto_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_crypto-test-crypto.obj -MD -MP -MF $(DEPDIR)/test_crypto-test-crypto.Tpo -c -o test_crypto-test-crypto.obj `if test -f 'test-crypto.c'; then $(CYGPATH_W) 'test-crypto.c'; else $(CYGPATH_W) '$(srcdir)/test-crypto.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_crypto-test-crypto.Tpo $(DEPDIR)/test_crypto-test-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-crypto.c' object='test_crypto-test-crypto.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_crypto_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_crypto-test-crypto.obj `if test -f 'test-crypto.c'; then $(CYGPATH_W) 'test-crypto.c'; else $(CYGPATH_W) '$(srcdir)/test-crypto.c'; fi` + +test_general-test-general.o: test-general.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_general_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_general-test-general.o -MD -MP -MF $(DEPDIR)/test_general-test-general.Tpo -c -o test_general-test-general.o `test -f 'test-general.c' || echo '$(srcdir)/'`test-general.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_general-test-general.Tpo $(DEPDIR)/test_general-test-general.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-general.c' object='test_general-test-general.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_general_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_general-test-general.o `test -f 'test-general.c' || echo '$(srcdir)/'`test-general.c + +test_general-test-general.obj: test-general.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_general_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_general-test-general.obj -MD -MP -MF $(DEPDIR)/test_general-test-general.Tpo -c -o test_general-test-general.obj `if test -f 'test-general.c'; then $(CYGPATH_W) 'test-general.c'; else $(CYGPATH_W) '$(srcdir)/test-general.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_general-test-general.Tpo $(DEPDIR)/test_general-test-general.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-general.c' object='test_general-test-general.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_general_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_general-test-general.obj `if test -f 'test-general.c'; then $(CYGPATH_W) 'test-general.c'; else $(CYGPATH_W) '$(srcdir)/test-general.c'; fi` + +test_need_secrets-test-need-secrets.o: test-need-secrets.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_need_secrets_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_need_secrets-test-need-secrets.o -MD -MP -MF $(DEPDIR)/test_need_secrets-test-need-secrets.Tpo -c -o test_need_secrets-test-need-secrets.o `test -f 'test-need-secrets.c' || echo '$(srcdir)/'`test-need-secrets.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_need_secrets-test-need-secrets.Tpo $(DEPDIR)/test_need_secrets-test-need-secrets.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-need-secrets.c' object='test_need_secrets-test-need-secrets.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_need_secrets_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_need_secrets-test-need-secrets.o `test -f 'test-need-secrets.c' || echo '$(srcdir)/'`test-need-secrets.c + +test_need_secrets-test-need-secrets.obj: test-need-secrets.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_need_secrets_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_need_secrets-test-need-secrets.obj -MD -MP -MF $(DEPDIR)/test_need_secrets-test-need-secrets.Tpo -c -o test_need_secrets-test-need-secrets.obj `if test -f 'test-need-secrets.c'; then $(CYGPATH_W) 'test-need-secrets.c'; else $(CYGPATH_W) '$(srcdir)/test-need-secrets.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_need_secrets-test-need-secrets.Tpo $(DEPDIR)/test_need_secrets-test-need-secrets.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-need-secrets.c' object='test_need_secrets-test-need-secrets.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_need_secrets_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_need_secrets-test-need-secrets.obj `if test -f 'test-need-secrets.c'; then $(CYGPATH_W) 'test-need-secrets.c'; else $(CYGPATH_W) '$(srcdir)/test-need-secrets.c'; fi` + +test_setting_8021x-test-setting-8021x.o: test-setting-8021x.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_setting_8021x_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_setting_8021x-test-setting-8021x.o -MD -MP -MF $(DEPDIR)/test_setting_8021x-test-setting-8021x.Tpo -c -o test_setting_8021x-test-setting-8021x.o `test -f 'test-setting-8021x.c' || echo '$(srcdir)/'`test-setting-8021x.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_setting_8021x-test-setting-8021x.Tpo $(DEPDIR)/test_setting_8021x-test-setting-8021x.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-setting-8021x.c' object='test_setting_8021x-test-setting-8021x.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_setting_8021x_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_setting_8021x-test-setting-8021x.o `test -f 'test-setting-8021x.c' || echo '$(srcdir)/'`test-setting-8021x.c + +test_setting_8021x-test-setting-8021x.obj: test-setting-8021x.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_setting_8021x_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_setting_8021x-test-setting-8021x.obj -MD -MP -MF $(DEPDIR)/test_setting_8021x-test-setting-8021x.Tpo -c -o test_setting_8021x-test-setting-8021x.obj `if test -f 'test-setting-8021x.c'; then $(CYGPATH_W) 'test-setting-8021x.c'; else $(CYGPATH_W) '$(srcdir)/test-setting-8021x.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_setting_8021x-test-setting-8021x.Tpo $(DEPDIR)/test_setting_8021x-test-setting-8021x.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-setting-8021x.c' object='test_setting_8021x-test-setting-8021x.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_setting_8021x_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_setting_8021x-test-setting-8021x.obj `if test -f 'test-setting-8021x.c'; then $(CYGPATH_W) 'test-setting-8021x.c'; else $(CYGPATH_W) '$(srcdir)/test-setting-8021x.c'; fi` + +test_settings_defaults-test-settings-defaults.o: test-settings-defaults.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_settings_defaults_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_settings_defaults-test-settings-defaults.o -MD -MP -MF $(DEPDIR)/test_settings_defaults-test-settings-defaults.Tpo -c -o test_settings_defaults-test-settings-defaults.o `test -f 'test-settings-defaults.c' || echo '$(srcdir)/'`test-settings-defaults.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_settings_defaults-test-settings-defaults.Tpo $(DEPDIR)/test_settings_defaults-test-settings-defaults.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-settings-defaults.c' object='test_settings_defaults-test-settings-defaults.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_settings_defaults_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_settings_defaults-test-settings-defaults.o `test -f 'test-settings-defaults.c' || echo '$(srcdir)/'`test-settings-defaults.c + +test_settings_defaults-test-settings-defaults.obj: test-settings-defaults.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_settings_defaults_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_settings_defaults-test-settings-defaults.obj -MD -MP -MF $(DEPDIR)/test_settings_defaults-test-settings-defaults.Tpo -c -o test_settings_defaults-test-settings-defaults.obj `if test -f 'test-settings-defaults.c'; then $(CYGPATH_W) 'test-settings-defaults.c'; else $(CYGPATH_W) '$(srcdir)/test-settings-defaults.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_settings_defaults-test-settings-defaults.Tpo $(DEPDIR)/test_settings_defaults-test-settings-defaults.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-settings-defaults.c' object='test_settings_defaults-test-settings-defaults.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_settings_defaults_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_settings_defaults-test-settings-defaults.obj `if test -f 'test-settings-defaults.c'; then $(CYGPATH_W) 'test-settings-defaults.c'; else $(CYGPATH_W) '$(srcdir)/test-settings-defaults.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +@WITH_TESTS_FALSE@check-local: +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-recursive +all-am: Makefile $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +@WITH_TESTS_TRUE@check-local: test-settings-defaults test-crypto test-need-secrets +@WITH_TESTS_TRUE@ $(abs_builddir)/test-settings-defaults +@WITH_TESTS_TRUE@ $(abs_builddir)/test-need-secrets +@WITH_TESTS_TRUE@ $(abs_builddir)/test-general + +# Private key and CA certificate in the same file (PEM) +@WITH_TESTS_TRUE@ $(abs_builddir)/test-setting-8021x \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test_key_and_cert.pem \ +@WITH_TESTS_TRUE@ "test" \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test-key-only-decrypted.der + +# Private key by itself (PEM) +@WITH_TESTS_TRUE@ $(abs_builddir)/test-setting-8021x \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test-key-only.pem \ +@WITH_TESTS_TRUE@ "test" \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test-key-only-decrypted.der + +# Private key and CA certificate in the same file (pkcs12) +@WITH_TESTS_TRUE@ $(abs_builddir)/test-setting-8021x \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test-cert.p12 \ +@WITH_TESTS_TRUE@ "test" + +# Normal CA certificate +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --cert \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test_ca_cert.pem + +# Another CA certificate +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --cert \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test2_ca_cert.pem + +# CA certificate without an ending newline +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --cert \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/ca-no-ending-newline.pem + +# Combined user cert and private key +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --cert \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test_key_and_cert.pem + +# Another combined user cert and private key +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --cert \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test2_key_and_cert.pem + +# Private key with 8 bytes of tail padding +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --key \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test_key_and_cert.pem \ +@WITH_TESTS_TRUE@ "test" + +# Private key with 6 bytes of tail padding +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --key \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test2_key_and_cert.pem \ +@WITH_TESTS_TRUE@ "12345testing" + +# PKCS#12 file +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --p12 \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test-cert.p12 \ +@WITH_TESTS_TRUE@ "test" + +# Another PKCS#12 file +@WITH_TESTS_TRUE@ $(abs_builddir)/test-crypto --p12 \ +@WITH_TESTS_TRUE@ $(top_srcdir)/libnm-util/tests/certs/test2-cert.p12 \ +@WITH_TESTS_TRUE@ "12345testing" + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libnm-util/tests/certs/Makefile.am b/libnm-util/tests/certs/Makefile.am new file mode 100644 index 00000000..4cd8a24b --- /dev/null +++ b/libnm-util/tests/certs/Makefile.am @@ -0,0 +1,20 @@ +# 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_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 + diff --git a/libnm-util/tests/certs/Makefile.in b/libnm-util/tests/certs/Makefile.in new file mode 100644 index 00000000..18e4af87 --- /dev/null +++ b/libnm-util/tests/certs/Makefile.in @@ -0,0 +1,437 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# 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 +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = libnm-util/tests/certs +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + test_ca_cert.pem \ + 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 + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libnm-util/tests/certs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libnm-util/tests/certs/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libnm-util/tests/certs/ca-no-ending-newline.pem b/libnm-util/tests/certs/ca-no-ending-newline.pem new file mode 100644 index 00000000..664e299a --- /dev/null +++ b/libnm-util/tests/certs/ca-no-ending-newline.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD +VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv +bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv +b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV +UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU +cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds +b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH +iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS +r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4 +04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r +GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9 +3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P +lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ +-----END CERTIFICATE----- \ No newline at end of file diff --git a/libnm-util/tests/certs/test-cert.p12 b/libnm-util/tests/certs/test-cert.p12 new file mode 100644 index 00000000..ae4a6830 Binary files /dev/null and b/libnm-util/tests/certs/test-cert.p12 differ diff --git a/libnm-util/tests/certs/test-key-only-decrypted.der b/libnm-util/tests/certs/test-key-only-decrypted.der new file mode 100644 index 00000000..c8652537 Binary files /dev/null and b/libnm-util/tests/certs/test-key-only-decrypted.der differ diff --git a/libnm-util/tests/certs/test-key-only.pem b/libnm-util/tests/certs/test-key-only.pem new file mode 100644 index 00000000..5ef530e9 --- /dev/null +++ b/libnm-util/tests/certs/test-key-only.pem @@ -0,0 +1,92 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,B29FCA6ECB7C0C48 + +KuRV4sEVQkY0r0E+E81Se2qpm54HeboUMIJcMVqAt/HIeYwpjEzmXHUywXgayA5k +r5Uvru95vymFz80q/rl6i4Mt3ckEQ3/VHmBI4pPj/JeRbiDhqTyLqpB5zMgbuti+ +PsEemlbiaCMZFdJk8rJBWADTkirGbXs5ciLwTJyrJXhkBVTqoHtphSWMELxcrnQj +5bAXZ+rnApWA7LR3yCY1UE0Nj39Yu8lkzDJtbsSXPJVO//OQiGuQRcY6roAUzeS/ +amLdIYqoZm3OF83Ro88XZCIDCG6XjgKoqojtekClVIytB6mHWk+IHhI7DgU/pDBj +yOskzVRMja9ECnqaVX+bmlmJGZBgcd7+XiebCXNY9IAx/ZQDMbDJDoJusvH6npJR +PBgag8QBSzwpFyEP/1LrlyVyggZcGuXDWfUiM2rt2UvLm8QYeT5WGfUI+QwW6JRV +xEz2QwRiPsmj0uK2fXLKHbY0Pv79IMLqgesCAUbndWsi94kjAhpJGa/WfKVb8Dpg +T+mVa2OT0pgewPWJ3h5f47ag27WDJthsIUHAvNZ03uM23DIqDh6o03/B3/4r1Uab +HzsLWhUOzbLihO08qcPk/JqtDVCv579mpgvy7bL2ZsZUzefnmg+ah+1bhLguryZu +Zrt1hTu5WTz27UbYwWNtkxWnWcM9sSF9y+KVwumYhIUGTvg3Jds/jmp/Z5ad8tev +0RQuWmqnXVD51Y92tOXobJH7JwGbQ4GeRNG/UX7DS9Lvb6rPgmmxvGbXMcjEMapB +m5DLjCD7Lz4++sfzhCic3/nL8e8fjoYZmCbL/SpYjGjTrfoNaGYaT0De8MxCSjPf +rNT+ldWFD0oAOTmT0uqOFkeIx3vxczSQUyRfzGOLqtb9mAXk8lvdb8Myb5atfe8f +FNBL5ocz6Szv2AmKmjZE5P6NKSllyryCYl+H2QU0e3OyY8S9aG2aG8fqeVKaA01S +uOOjsK6IKMpkit+VFDP7RWvS8p1FTwTVRdbMZzASW8+D98OHsTlOENtQuuFyvNaN +vPHrbHltTkwDlYVab9UpFr/ZRW3cNJrmcl0hyeCJxk5u8B9UwW6yZmd24hxda2xt +1QjnxfWlX0i5KTmfWFyPmRYt1WH9rdVaH6wqRbGNbMRT7Lez0E/2+LXjFiiEe0Vh +ZuryhyhUXpHY8yyHxFY92XT504Z3wPUaJ1tQxGhdziZ7HcqFT8f4oTNJdBNtzqNw +l63gSTaKUkSB14CBOyR84cqpgSMwZvWZb3RQFYY4GSALWwhnn6PWeRhjWAXPms2v +tRmfEyDUCyPxDarezvS9kUir3XbvnCkoJOrK/lw4a8ygGBCBqRKOdI0SRUf1Nnjm +aZBrKrXHv5vP66fyC7cGMTq35+iiHbE//rRDGPrf9vpmw3ki3FlDMyAXOC5yWDco +0n+cNDyHJDdIW3+3nfZvSgPPMwmTdfNO90X3YczSmMTGjnIuhQMf7FMFmMZOSrqD +u234vYCjIIlph3aVpbzjOqKg3d4nuP9oouyAgRAr+vShgHRmq0jvsAiGH3Q6RqEj +DvkM1NgoloMy5RhKF4hIeaQM/UlgoXrcEx0RGCJHykQcQmVa5cf5EwjrO7b+w2Lg +-----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=test, CN=test/emailAddress=test@test.com + Validity + Not Before: Feb 2 02:22:25 2009 GMT + Not After : Jan 31 02:22:25 2019 GMT + Subject: C=US, ST=Berkshire, O=My Company Ltd, OU=test-client, CN=test-client/emailAddress=test-client@test.com + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (2048 bit) + Modulus (2048 bit): + 00:ce:d2:e9:fb:f4:a4:ce:66:87:cc:8b:2d:d2:c3: + b8:fa:be:ea:53:08:95:9e:27:4a:04:78:31:a1:36: + d2:e5:42:f5:76:f7:24:71:b8:d3:10:fd:b7:57:86: + 68:29:02:1b:e9:93:2b:af:c0:7e:3d:58:16:34:10: + 25:85:7e:28:2d:42:fc:34:7f:d6:4f:0a:e7:b6:b9: + 40:51:c8:e5:89:60:cd:73:51:63:67:e1:59:36:31: + 5e:d0:87:4b:5d:97:8a:42:22:d3:42:f2:83:62:79: + 84:45:5b:d8:20:97:e2:d1:34:23:5e:ec:bf:8a:41: + 7c:ad:80:50:f3:9b:1c:51:5d:e4:29:1c:c1:c6:7c: + a1:00:70:0f:f6:79:77:03:22:f5:4b:ab:76:ca:20: + ab:e1:4e:53:6c:86:68:e9:d6:0f:6e:95:4b:b5:b5: + cf:d3:6c:d4:73:db:c0:3d:1d:20:20:72:ab:3e:25: + bb:3f:cd:5f:2d:77:fd:d7:0b:a8:eb:0c:73:c0:3f: + 74:27:17:56:cf:31:9a:a9:ed:c1:39:27:c7:aa:e9: + 77:48:f4:6d:56:89:35:5c:79:5b:f6:2f:8c:9f:93: + bc:13:1c:d0:74:5f:30:1b:15:43:71:8e:ff:1a:df: + 65:65:69:c2:8a:5a:ab:04:4a:80:de:20:29:8d:48: + 1c:83 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 34:E9:5C:D8:FC:C7:AF:F7:5D:F4:13:D3:82:1A:CD:52:0F:4A:BB:0B + X509v3 Authority Key Identifier: + keyid:52:33:2E:22:66:79:82:E5:41:2E:8D:3B:B2:E5:CC:FA:BE:99:33:8E + DirName:/C=US/ST=Berkshire/L=Newbury/O=My Company Ltd/OU=test/CN=test/emailAddress=test@test.com + serial:E6:4C:5C:96:26:5E:D6:D0 + + Signature Algorithm: md5WithRSAEncryption + 88:c4:dd:c5:4a:a6:8e:1f:36:62:80:31:6b:2b:85:34:0d:6c: + a7:dc:e1:5a:3c:dd:74:57:db:59:be:8b:f2:79:40:2d:bd:9b: + e1:ab:0e:03:75:20:75:2f:ea:97:f9:d4:7e:15:75:c2:82:f5: + b1:37:e4:8b:24:d4:ef:02:3b:19:6a:56:bb:9f:c3:a5:b4:c4: + 39:a0:64:96:5b:c3:a8:19:74:ec:0b:cf:33:df:f3:12:f3:e2: + ab:1d:7d:de:21:64:cd:b1:a0:6f:7a:77:84:d4:62:8a:50:e6: + 76:5d:af:3a:ef:1a:87:0e:1a:38:c4:f9:0d:2f:14:e0:20:32: + 4c:2e:70:d2:71:82:d5:e5:c9:13:2c:4e:b4:c8:63:65:1d:48: + e8:c3:56:6d:88:84:57:65:13:1e:42:48:b4:03:25:71:4e:12: + 9d:1a:88:65:d5:71:21:3b:0e:be:37:1c:f0:88:6b:45:0c:0e: + 6c:e5:60:cb:86:bf:bf:40:30:c4:cf:94:f8:1c:60:d4:1b:df: + 88:02:7a:45:7e:d1:c6:f3:07:b9:b1:8f:2a:55:2f:be:77:9f: + d1:46:64:05:b7:67:c5:b2:ac:8c:42:8f:6a:51:a4:0d:2b:16: + a4:d6:39:a5:f8:25:ed:68:25:13:b5:19:ac:6c:e9:ec:ee:03: + 6b:80:38:6e + diff --git a/libnm-util/tests/certs/test2-cert.p12 b/libnm-util/tests/certs/test2-cert.p12 new file mode 100644 index 00000000..9d5732b0 Binary files /dev/null and b/libnm-util/tests/certs/test2-cert.p12 differ diff --git a/libnm-util/tests/certs/test2_ca_cert.pem b/libnm-util/tests/certs/test2_ca_cert.pem new file mode 100644 index 00000000..9a487ca4 --- /dev/null +++ b/libnm-util/tests/certs/test2_ca_cert.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEpDCCA4ygAwIBAgIJANDnVhixAO1GMA0GCSqGSIb3DQEBBQUAMIGSMQswCQYD +VQQGEwJVUzEWMBQGA1UECBMNTWFzc2FjaHVzZXR0czERMA8GA1UEBxMIV2VzdGZv +cmQxFjAUBgNVBAoTDVJlZCBIYXQsIEluYy4xFDASBgNVBAsTC0VuZ2luZWVyaW5n +MRAwDgYDVQQDEwdlYXB0ZXN0MRgwFgYJKoZIhvcNAQkBFglpdEBpdC5jb20wHhcN +MDcxMTA5MTU0ODI1WhcNMTcxMTA2MTU0ODI1WjCBkjELMAkGA1UEBhMCVVMxFjAU +BgNVBAgTDU1hc3NhY2h1c2V0dHMxETAPBgNVBAcTCFdlc3Rmb3JkMRYwFAYDVQQK +Ew1SZWQgSGF0LCBJbmMuMRQwEgYDVQQLEwtFbmdpbmVlcmluZzEQMA4GA1UEAxMH +ZWFwdGVzdDEYMBYGCSqGSIb3DQEJARYJaXRAaXQuY29tMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAz9zRLSiQyQangDgEliEP8xSpnPJS7GjXzrkZS3sk +gZLuVuwoFeZRq3Hsrq/wGd/vM0KUFNmEaMc+47jnuv0UHQcQ45ZACO7s4/Aflhzj +lkmud/z06hVknIzjXmvS6q2ttCviHsXnfokl+wAxuUhsd+le0xjP9H1jXny4YBuS +jP+yGUz7PL4w1sFFghKIPrlB7m4GkFbQRqvH7FSJg86GWopPwJvNvIzhOZiO1a1D +CAAL4Ru3jxtNFxqWT87C/qUEe/2Qb7jtNyqFcKfwZyZh4u1bo0c8bjErlUZERbWz +zM3hTFypuw+i2v+0h3A8/Xb0hTjcHkUoJgfSdbsOLC5TOwIDAQABo4H6MIH3MB0G +A1UdDgQWBBR+UOaH4e8nrEuMcEXJl7UN5r/wDTCBxwYDVR0jBIG/MIG8gBR+UOaH +4e8nrEuMcEXJl7UN5r/wDaGBmKSBlTCBkjELMAkGA1UEBhMCVVMxFjAUBgNVBAgT +DU1hc3NhY2h1c2V0dHMxETAPBgNVBAcTCFdlc3Rmb3JkMRYwFAYDVQQKEw1SZWQg +SGF0LCBJbmMuMRQwEgYDVQQLEwtFbmdpbmVlcmluZzEQMA4GA1UEAxMHZWFwdGVz +dDEYMBYGCSqGSIb3DQEJARYJaXRAaXQuY29tggkA0OdWGLEA7UYwDAYDVR0TBAUw +AwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAmE2jqUymfxN2Vv7bPafoK/EpZwGPxu+z +phRFsgUgWVzidc/GtOxN81LduJ+ow8MEbQIabo4JV/MdKzuPuhAHToAQdeb0LIWa +p59vTIZiVhUt0cMAbQwKcTnfmDnXw9wytvtKgeAXJq0Jd6F+uNXTiR1btlYLZqmF +oSu54cHQlXpUT9z0BnQ8eXd7m0TwfzGQkTHQI7xBa87lZDAkJaTlhv7fR5vPmJYY +0LiXii71ce+4hxdlp7hQfwQ2sb8FPY3RlVboTRD0CvGaWypWhdSZnS790dBXgZOs +NCge6NGuHzW5LtiZE9ppuv8qJysVcIFdAqt8dkx58ksOqFcARCerXw== +-----END CERTIFICATE----- diff --git a/libnm-util/tests/certs/test2_key_and_cert.pem b/libnm-util/tests/certs/test2_key_and_cert.pem new file mode 100644 index 00000000..a668596e --- /dev/null +++ b/libnm-util/tests/certs/test2_key_and_cert.pem @@ -0,0 +1,119 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,5FA2D6D6242C26D0 + +dyNdbh115sczbUEhiaGYJ6fazyvJss5thPFEmkP6aftYlvXY6vPtc++xFCCktiSd +qFVEyi6oDyV4iGPmX7pCJ0e+pSI6uFNXKFtxh5/+/wXZcOEMCvfu7w2IrvYF2LHY +qJDljcISSRxeINuYO7TETD5fLLRKj2X9vwwkwVN02b2N5jsrm6Bt//WbatqSB3ln +FHyQhVKkvdl9Hr1XNmEfgGfZSxxDoPu1DjhtZ5ja2LZj64C2CXdI0oq2wcAVvQNn +rZeeg9sinQJkz9rwsNaWqlYw4X+YD2JRSwZuvwkWRydYMwgb1XS/jCxtuFF8NXWP +RBAOAZZUy7onzohsJHVVa05wCKQ4klo+PEfI3vn7BeuHyciCc0eFqGRvz8eFDybH +ZdPbU/3vGp+mOB7gd27TptttTCQQy9uM5CIyovNSYsAIw1Z583Ea4q8eXgzkgD6D +isCqkGXMfPbNXU3myQGDnQwWRi2CqX+rXM8PJUhdewLAlmHRz/aYSuql2BRixJKx +eASzmFBYdAjrvafda5D+xTyJwXEwdq/HlqMK9cY28ZbNrzA2Kor2X23EKC1+VG8k +B67OsfUhW27j4u6aV5JdLf87OtF3mHFRR+Lzs7i7LYvJ8ACE+jiIi7PboZjK5Oiv +JqTK0BwDaeNYjkd6jiJh8It/ReMbLk65J3eldOklN0VMPYiqcQnHvSPC2DD1YAy+ +Rv/JVj6TvzvgEAj+hgH6MAAF6u3ARj6+10DlvhUubkOC5RztLKReu8B+427TuuDb +T03gFpHD6X9IqSiq/QfYFyHFojCVSrv6wDZOcHc1s71kpJ8R14YIVe+DrrZN/0D4 +M631jdNg3JARMZXcXTHrghGIdPmOtrsRyTTRZuGoVup/DW9MRzOzCTMSNCX8T+eq +13HMSNQEO9lMwy0sYeO5c7sjHY4K1ubZuVE1mvXq4JLz3YxXJIvgp8TUvqDnAsK+ +Fv63bDoTg5Tq63XvnaKc7Lawneyg5ZAMzPN3nM0/1EZcn/2ICI5c4Yepc5t63EI5 +KytuXx86Mcx234enj3uMeuM22POQ1SnKOef6dFzK/CE8J8eUEY/aDhX4eBl/s3nd +U4+aaFKYz3HTazePayt2SC6rP/KKMmS14q59bOQA1DiWxCvmA2ypRyP87fV5DstH +I53RD5xp1P38iaO8U/divD0W2dkv748s9DQqYrHPtWALT9esxNU07CgB8Zt070si +7pzjQ8FDCZ8ygDmwWGNSBz1nA90Cpd6gAFDrep7HAtDE4qgNfokycpaJZkXBei/U +tC4tWYRbqDEsEbeBHvQRJzzqWzk9e/P4fQoelM3aryKzKLG5z7KvywVifKMLECQ+ +tIpzoRp06nuTA/O+iLFdkCy3JEWszfvvOwTwtIIV6+3s8TU0k9MmzEe3rGL+QqT/ +Tf+9/dN5LK+LWyc99BfmCOrBuFtQmHyEXkfe6EuFYEwj0B2ZfnLCon6cdRujjK7H +IJslC1B/cBVqG3KCrbBzjeygKfJ5Ijo72oXZJOCFTLeJefZKGGWJCp9nG9h9Wrcf +fEN/mj3wBvTa90/PYFj9NuaBtrvMF8Rn9XDeYPq2JGL8YkNdPuO8A+2Yko8wcvST +-----END RSA PRIVATE KEY----- +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 2 (0x2) + Signature Algorithm: md5WithRSAEncryption + Issuer: C=US, ST=Massachusetts, L=Westford, O=Red Hat, Inc., OU=Engineering, CN=eaptest/emailAddress=it@it.com + Validity + Not Before: Nov 9 15:50:14 2007 GMT + Not After : Nov 6 15:50:14 2017 GMT + Subject: C=US, ST=Massachusetts, O=Red Hat, Inc., OU=Engineering, CN=client/emailAddress=it@it.com + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (2048 bit) + Modulus (2048 bit): + 00:b0:8f:4f:1c:93:d4:43:e7:87:b7:22:33:55:a8: + 35:a1:c4:01:b0:f1:ed:26:23:96:ab:65:c2:c2:54: + db:79:22:03:ad:3f:6f:22:e3:63:3f:f4:21:6d:fa: + 88:c8:8f:1a:ce:55:49:7c:98:33:6a:67:8a:8d:d9: + 34:b0:c3:42:f4:72:a4:45:43:05:72:5d:0c:d3:42: + f8:9c:66:3b:b8:f8:77:ea:f6:b6:94:d7:cc:5d:62: + 34:2a:14:48:0a:bc:65:94:f5:7a:63:98:6c:88:4c: + 25:d8:95:f1:40:3d:00:d2:fb:43:28:fa:02:fb:2c: + 80:b3:e1:33:e7:8c:ce:8a:a0:1b:3d:04:4d:bc:a1: + b6:a2:42:8b:8e:f3:5b:4a:72:34:7d:8d:ba:d8:46: + 22:35:da:5c:f8:dd:fc:6d:9e:59:22:b7:6b:e7:78: + 56:54:9f:4c:d1:e2:4a:23:a3:bc:04:ea:46:6b:70: + 8a:fb:fe:8a:73:ca:36:d5:f3:e9:17:e3:22:d5:b3: + 70:05:e7:f7:37:b7:21:b5:90:53:27:27:ea:36:9b: + 00:ff:35:b0:66:3d:dc:a9:2f:95:d2:21:18:98:4f: + 28:07:09:70:20:a8:b1:82:aa:a5:df:ae:0f:e3:36: + be:68:8c:9e:80:d3:33:d0:f5:84:17:d9:0f:eb:9d: + af:0b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 71:AB:BB:91:B7:04:DE:43:35:36:07:8A:35:CA:BE:5C:3E:EB:B1:09 + X509v3 Authority Key Identifier: + keyid:7E:50:E6:87:E1:EF:27:AC:4B:8C:70:45:C9:97:B5:0D:E6:BF:F0:0D + DirName:/C=US/ST=Massachusetts/L=Westford/O=Red Hat, Inc./OU=Engineering/CN=eaptest/emailAddress=it@it.com + serial:D0:E7:56:18:B1:00:ED:46 + + Signature Algorithm: md5WithRSAEncryption + ce:43:6d:f7:f8:4a:66:fd:8a:2c:41:a6:e0:03:0e:60:30:d4: + 41:01:ba:46:ba:81:97:64:68:83:25:9c:e1:2c:03:8b:2d:ca: + 85:cf:bc:fa:ca:22:c4:59:28:23:8f:ff:50:94:60:1c:90:dd: + 75:f4:d4:ea:8c:fa:61:61:08:35:4a:8f:aa:a7:e9:3d:76:e9: + 08:28:55:01:c4:03:42:c7:ad:58:bb:ee:94:f7:09:b3:9a:9b: + 8b:d0:25:95:18:a6:22:d5:2c:fc:b7:bb:91:0c:7c:03:7f:9b: + 85:de:b0:e4:95:a8:73:94:27:0a:11:4e:e3:67:ae:2b:cc:e7: + 51:29:10:23:57:5c:3e:e7:ea:47:e0:f0:8f:5b:a2:9f:26:cf: + 7f:b5:7c:44:b1:7b:83:67:3c:41:ae:c6:66:64:e0:d2:ef:57: + a4:5c:1b:94:11:ce:28:e5:91:51:ef:e1:98:b7:3b:9a:cc:f7: + b9:85:76:eb:a8:2b:15:4a:cc:1a:a3:42:fa:be:1c:ce:b8:eb: + ee:12:d7:2f:e4:a8:cf:eb:2a:8f:78:e8:91:88:fa:c2:98:75: + 6a:4c:92:3f:2e:0d:e1:20:39:36:c6:2c:be:67:30:c3:f3:c3: + 65:81:ac:e3:3c:19:6a:21:ee:ea:f5:22:66:74:b2:07:53:7c: + 9a:0c:24:a6 +-----BEGIN CERTIFICATE----- +MIIEtDCCA5ygAwIBAgIBAjANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCVVMx +FjAUBgNVBAgTDU1hc3NhY2h1c2V0dHMxETAPBgNVBAcTCFdlc3Rmb3JkMRYwFAYD +VQQKEw1SZWQgSGF0LCBJbmMuMRQwEgYDVQQLEwtFbmdpbmVlcmluZzEQMA4GA1UE +AxMHZWFwdGVzdDEYMBYGCSqGSIb3DQEJARYJaXRAaXQuY29tMB4XDTA3MTEwOTE1 +NTAxNFoXDTE3MTEwNjE1NTAxNFowfjELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDU1h +c3NhY2h1c2V0dHMxFjAUBgNVBAoTDVJlZCBIYXQsIEluYy4xFDASBgNVBAsTC0Vu +Z2luZWVyaW5nMQ8wDQYDVQQDEwZjbGllbnQxGDAWBgkqhkiG9w0BCQEWCWl0QGl0 +LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALCPTxyT1EPnh7ci +M1WoNaHEAbDx7SYjlqtlwsJU23kiA60/byLjYz/0IW36iMiPGs5VSXyYM2pnio3Z +NLDDQvRypEVDBXJdDNNC+JxmO7j4d+r2tpTXzF1iNCoUSAq8ZZT1emOYbIhMJdiV +8UA9ANL7Qyj6AvssgLPhM+eMzoqgGz0ETbyhtqJCi47zW0pyNH2NuthGIjXaXPjd +/G2eWSK3a+d4VlSfTNHiSiOjvATqRmtwivv+inPKNtXz6RfjItWzcAXn9ze3IbWQ +Uycn6jabAP81sGY93KkvldIhGJhPKAcJcCCosYKqpd+uD+M2vmiMnoDTM9D1hBfZ +D+udrwsCAwEAAaOCASYwggEiMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9w +ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRxq7uRtwTeQzU2 +B4o1yr5cPuuxCTCBxwYDVR0jBIG/MIG8gBR+UOaH4e8nrEuMcEXJl7UN5r/wDaGB +mKSBlTCBkjELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDU1hc3NhY2h1c2V0dHMxETAP +BgNVBAcTCFdlc3Rmb3JkMRYwFAYDVQQKEw1SZWQgSGF0LCBJbmMuMRQwEgYDVQQL +EwtFbmdpbmVlcmluZzEQMA4GA1UEAxMHZWFwdGVzdDEYMBYGCSqGSIb3DQEJARYJ +aXRAaXQuY29tggkA0OdWGLEA7UYwDQYJKoZIhvcNAQEEBQADggEBAM5Dbff4Smb9 +iixBpuADDmAw1EEBuka6gZdkaIMlnOEsA4styoXPvPrKIsRZKCOP/1CUYByQ3XX0 +1OqM+mFhCDVKj6qn6T126QgoVQHEA0LHrVi77pT3CbOam4vQJZUYpiLVLPy3u5EM +fAN/m4XesOSVqHOUJwoRTuNnrivM51EpECNXXD7n6kfg8I9bop8mz3+1fESxe4Nn +PEGuxmZk4NLvV6RcG5QRzijlkVHv4Zi3O5rM97mFduuoKxVKzBqjQvq+HM646+4S +1y/kqM/rKo946JGI+sKYdWpMkj8uDeEgOTbGLL5nMMPzw2WBrOM8GWoh7ur1ImZ0 +sgdTfJoMJKY= +-----END CERTIFICATE----- diff --git a/libnm-util/tests/certs/test_ca_cert.pem b/libnm-util/tests/certs/test_ca_cert.pem new file mode 100644 index 00000000..faa3fc29 --- /dev/null +++ b/libnm-util/tests/certs/test_ca_cert.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEhjCCA26gAwIBAgIJAOZMXJYmXtbQMA0GCSqGSIb3DQEBBQUAMIGIMQswCQYD +VQQGEwJVUzESMBAGA1UECBMJQmVya3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcw +FQYDVQQKEw5NeSBDb21wYW55IEx0ZDENMAsGA1UECxMEdGVzdDENMAsGA1UEAxME +dGVzdDEcMBoGCSqGSIb3DQEJARYNdGVzdEB0ZXN0LmNvbTAeFw0wOTAyMDIwMjIx +NTJaFw0xOTAxMzEwMjIxNTJaMIGIMQswCQYDVQQGEwJVUzESMBAGA1UECBMJQmVy +a3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcwFQYDVQQKEw5NeSBDb21wYW55IEx0 +ZDENMAsGA1UECxMEdGVzdDENMAsGA1UEAxMEdGVzdDEcMBoGCSqGSIb3DQEJARYN +dGVzdEB0ZXN0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANZz +iHfFR6Gqdz5Gq1elSaf7J2tznfialPyMkRoqngSItrM3JWlkfBu3ZIpGSYG8+Z8H +JjaKh/zkCCH73HcjADCocm/XtgxlOlccDtBvfDqifb2dBikcmcfh0tX0o4JU9L+z +WP7sVcUkJG7C5811lA5pAsLVooJxrZnrta6XstGvFgTSxI2Y4Jowf0syM5b/AHIQ ++htsVhSyj1DWM9day3QsEMZl55SCxCLTB6ZIJLF6NmTYwdnzWWTQf4k7kcptZJU8 +Fqv60b/ATvvUf7S+ZMGLopFIIlmc1Kkn7VTseIKy4ycYuDpyimQy3Yw4flC00vhl +hTijH+5dlVOUFrRh0bsCAwEAAaOB8DCB7TAdBgNVHQ4EFgQUUjMuImZ5guVBLo07 +suXM+r6ZM44wgb0GA1UdIwSBtTCBsoAUUjMuImZ5guVBLo07suXM+r6ZM46hgY6k +gYswgYgxCzAJBgNVBAYTAlVTMRIwEAYDVQQIEwlCZXJrc2hpcmUxEDAOBgNVBAcT +B05ld2J1cnkxFzAVBgNVBAoTDk15IENvbXBhbnkgTHRkMQ0wCwYDVQQLEwR0ZXN0 +MQ0wCwYDVQQDEwR0ZXN0MRwwGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29tggkA +5kxcliZe1tAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAZsWzGp9D +10NWf8ts3A9mhcEb8oDgKNpCOZF9gqr2usZygJjY9MX2n0n81T8XaWDk1wZLlcDW +hzIalCY8rpE57Dj3MEmdCmYr3BrAy6GVlc/MO7ffTHxogl9ouScSYo8ETTtNMKCg +zwkDnXjGzmb1e59DIXMVHBBbTmJXJbM8XP9A2azJkVUyE2fSdWksXMP0XklGbW2p +DksJ+8G1IWkyRhnINV5GZLLNAT5gBA6sUv/iqQKwk8r2dsweMPtLoLWZPAaZErYh +sthGy00Q0GJkmkJpQl8QIlPq5vylNcMUhvc8tmzwk+rDVUj3jTJWqFwMtnHAaNyC +FXl9ynWpe5J28w== +-----END CERTIFICATE----- diff --git a/libnm-util/tests/certs/test_key_and_cert.pem b/libnm-util/tests/certs/test_key_and_cert.pem new file mode 100644 index 00000000..c00495d0 --- /dev/null +++ b/libnm-util/tests/certs/test_key_and_cert.pem @@ -0,0 +1,119 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,B29FCA6ECB7C0C48 + +KuRV4sEVQkY0r0E+E81Se2qpm54HeboUMIJcMVqAt/HIeYwpjEzmXHUywXgayA5k +r5Uvru95vymFz80q/rl6i4Mt3ckEQ3/VHmBI4pPj/JeRbiDhqTyLqpB5zMgbuti+ +PsEemlbiaCMZFdJk8rJBWADTkirGbXs5ciLwTJyrJXhkBVTqoHtphSWMELxcrnQj +5bAXZ+rnApWA7LR3yCY1UE0Nj39Yu8lkzDJtbsSXPJVO//OQiGuQRcY6roAUzeS/ +amLdIYqoZm3OF83Ro88XZCIDCG6XjgKoqojtekClVIytB6mHWk+IHhI7DgU/pDBj +yOskzVRMja9ECnqaVX+bmlmJGZBgcd7+XiebCXNY9IAx/ZQDMbDJDoJusvH6npJR +PBgag8QBSzwpFyEP/1LrlyVyggZcGuXDWfUiM2rt2UvLm8QYeT5WGfUI+QwW6JRV +xEz2QwRiPsmj0uK2fXLKHbY0Pv79IMLqgesCAUbndWsi94kjAhpJGa/WfKVb8Dpg +T+mVa2OT0pgewPWJ3h5f47ag27WDJthsIUHAvNZ03uM23DIqDh6o03/B3/4r1Uab +HzsLWhUOzbLihO08qcPk/JqtDVCv579mpgvy7bL2ZsZUzefnmg+ah+1bhLguryZu +Zrt1hTu5WTz27UbYwWNtkxWnWcM9sSF9y+KVwumYhIUGTvg3Jds/jmp/Z5ad8tev +0RQuWmqnXVD51Y92tOXobJH7JwGbQ4GeRNG/UX7DS9Lvb6rPgmmxvGbXMcjEMapB +m5DLjCD7Lz4++sfzhCic3/nL8e8fjoYZmCbL/SpYjGjTrfoNaGYaT0De8MxCSjPf +rNT+ldWFD0oAOTmT0uqOFkeIx3vxczSQUyRfzGOLqtb9mAXk8lvdb8Myb5atfe8f +FNBL5ocz6Szv2AmKmjZE5P6NKSllyryCYl+H2QU0e3OyY8S9aG2aG8fqeVKaA01S +uOOjsK6IKMpkit+VFDP7RWvS8p1FTwTVRdbMZzASW8+D98OHsTlOENtQuuFyvNaN +vPHrbHltTkwDlYVab9UpFr/ZRW3cNJrmcl0hyeCJxk5u8B9UwW6yZmd24hxda2xt +1QjnxfWlX0i5KTmfWFyPmRYt1WH9rdVaH6wqRbGNbMRT7Lez0E/2+LXjFiiEe0Vh +ZuryhyhUXpHY8yyHxFY92XT504Z3wPUaJ1tQxGhdziZ7HcqFT8f4oTNJdBNtzqNw +l63gSTaKUkSB14CBOyR84cqpgSMwZvWZb3RQFYY4GSALWwhnn6PWeRhjWAXPms2v +tRmfEyDUCyPxDarezvS9kUir3XbvnCkoJOrK/lw4a8ygGBCBqRKOdI0SRUf1Nnjm +aZBrKrXHv5vP66fyC7cGMTq35+iiHbE//rRDGPrf9vpmw3ki3FlDMyAXOC5yWDco +0n+cNDyHJDdIW3+3nfZvSgPPMwmTdfNO90X3YczSmMTGjnIuhQMf7FMFmMZOSrqD +u234vYCjIIlph3aVpbzjOqKg3d4nuP9oouyAgRAr+vShgHRmq0jvsAiGH3Q6RqEj +DvkM1NgoloMy5RhKF4hIeaQM/UlgoXrcEx0RGCJHykQcQmVa5cf5EwjrO7b+w2Lg +-----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=test, CN=test/emailAddress=test@test.com + Validity + Not Before: Feb 2 02:22:25 2009 GMT + Not After : Jan 31 02:22:25 2019 GMT + Subject: C=US, ST=Berkshire, O=My Company Ltd, OU=test-client, CN=test-client/emailAddress=test-client@test.com + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (2048 bit) + Modulus (2048 bit): + 00:ce:d2:e9:fb:f4:a4:ce:66:87:cc:8b:2d:d2:c3: + b8:fa:be:ea:53:08:95:9e:27:4a:04:78:31:a1:36: + d2:e5:42:f5:76:f7:24:71:b8:d3:10:fd:b7:57:86: + 68:29:02:1b:e9:93:2b:af:c0:7e:3d:58:16:34:10: + 25:85:7e:28:2d:42:fc:34:7f:d6:4f:0a:e7:b6:b9: + 40:51:c8:e5:89:60:cd:73:51:63:67:e1:59:36:31: + 5e:d0:87:4b:5d:97:8a:42:22:d3:42:f2:83:62:79: + 84:45:5b:d8:20:97:e2:d1:34:23:5e:ec:bf:8a:41: + 7c:ad:80:50:f3:9b:1c:51:5d:e4:29:1c:c1:c6:7c: + a1:00:70:0f:f6:79:77:03:22:f5:4b:ab:76:ca:20: + ab:e1:4e:53:6c:86:68:e9:d6:0f:6e:95:4b:b5:b5: + cf:d3:6c:d4:73:db:c0:3d:1d:20:20:72:ab:3e:25: + bb:3f:cd:5f:2d:77:fd:d7:0b:a8:eb:0c:73:c0:3f: + 74:27:17:56:cf:31:9a:a9:ed:c1:39:27:c7:aa:e9: + 77:48:f4:6d:56:89:35:5c:79:5b:f6:2f:8c:9f:93: + bc:13:1c:d0:74:5f:30:1b:15:43:71:8e:ff:1a:df: + 65:65:69:c2:8a:5a:ab:04:4a:80:de:20:29:8d:48: + 1c:83 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 34:E9:5C:D8:FC:C7:AF:F7:5D:F4:13:D3:82:1A:CD:52:0F:4A:BB:0B + X509v3 Authority Key Identifier: + keyid:52:33:2E:22:66:79:82:E5:41:2E:8D:3B:B2:E5:CC:FA:BE:99:33:8E + DirName:/C=US/ST=Berkshire/L=Newbury/O=My Company Ltd/OU=test/CN=test/emailAddress=test@test.com + serial:E6:4C:5C:96:26:5E:D6:D0 + + Signature Algorithm: md5WithRSAEncryption + 88:c4:dd:c5:4a:a6:8e:1f:36:62:80:31:6b:2b:85:34:0d:6c: + a7:dc:e1:5a:3c:dd:74:57:db:59:be:8b:f2:79:40:2d:bd:9b: + e1:ab:0e:03:75:20:75:2f:ea:97:f9:d4:7e:15:75:c2:82:f5: + b1:37:e4:8b:24:d4:ef:02:3b:19:6a:56:bb:9f:c3:a5:b4:c4: + 39:a0:64:96:5b:c3:a8:19:74:ec:0b:cf:33:df:f3:12:f3:e2: + ab:1d:7d:de:21:64:cd:b1:a0:6f:7a:77:84:d4:62:8a:50:e6: + 76:5d:af:3a:ef:1a:87:0e:1a:38:c4:f9:0d:2f:14:e0:20:32: + 4c:2e:70:d2:71:82:d5:e5:c9:13:2c:4e:b4:c8:63:65:1d:48: + e8:c3:56:6d:88:84:57:65:13:1e:42:48:b4:03:25:71:4e:12: + 9d:1a:88:65:d5:71:21:3b:0e:be:37:1c:f0:88:6b:45:0c:0e: + 6c:e5:60:cb:86:bf:bf:40:30:c4:cf:94:f8:1c:60:d4:1b:df: + 88:02:7a:45:7e:d1:c6:f3:07:b9:b1:8f:2a:55:2f:be:77:9f: + d1:46:64:05:b7:67:c5:b2:ac:8c:42:8f:6a:51:a4:0d:2b:16: + a4:d6:39:a5:f8:25:ed:68:25:13:b5:19:ac:6c:e9:ec:ee:03: + 6b:80:38:6e +-----BEGIN CERTIFICATE----- +MIIErjCCA5agAwIBAgIBATANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCVVMx +EjAQBgNVBAgTCUJlcmtzaGlyZTEQMA4GA1UEBxMHTmV3YnVyeTEXMBUGA1UEChMO +TXkgQ29tcGFueSBMdGQxDTALBgNVBAsTBHRlc3QxDTALBgNVBAMTBHRlc3QxHDAa +BgkqhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wHhcNMDkwMjAyMDIyMjI1WhcNMTkw +MTMxMDIyMjI1WjCBizELMAkGA1UEBhMCVVMxEjAQBgNVBAgTCUJlcmtzaGlyZTEX +MBUGA1UEChMOTXkgQ29tcGFueSBMdGQxFDASBgNVBAsTC3Rlc3QtY2xpZW50MRQw +EgYDVQQDEwt0ZXN0LWNsaWVudDEjMCEGCSqGSIb3DQEJARYUdGVzdC1jbGllbnRA +dGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDO0un79KTO +ZofMiy3Sw7j6vupTCJWeJ0oEeDGhNtLlQvV29yRxuNMQ/bdXhmgpAhvpkyuvwH49 +WBY0ECWFfigtQvw0f9ZPCue2uUBRyOWJYM1zUWNn4Vk2MV7Qh0tdl4pCItNC8oNi +eYRFW9ggl+LRNCNe7L+KQXytgFDzmxxRXeQpHMHGfKEAcA/2eXcDIvVLq3bKIKvh +TlNshmjp1g9ulUu1tc/TbNRz28A9HSAgcqs+Jbs/zV8td/3XC6jrDHPAP3QnF1bP +MZqp7cE5J8eq6XdI9G1WiTVceVv2L4yfk7wTHNB0XzAbFUNxjv8a32VlacKKWqsE +SoDeICmNSByDAgMBAAGjggEcMIIBGDAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQf +Fh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUNOlc2PzH +r/dd9BPTghrNUg9Kuwswgb0GA1UdIwSBtTCBsoAUUjMuImZ5guVBLo07suXM+r6Z +M46hgY6kgYswgYgxCzAJBgNVBAYTAlVTMRIwEAYDVQQIEwlCZXJrc2hpcmUxEDAO +BgNVBAcTB05ld2J1cnkxFzAVBgNVBAoTDk15IENvbXBhbnkgTHRkMQ0wCwYDVQQL +EwR0ZXN0MQ0wCwYDVQQDEwR0ZXN0MRwwGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3Qu +Y29tggkA5kxcliZe1tAwDQYJKoZIhvcNAQEEBQADggEBAIjE3cVKpo4fNmKAMWsr +hTQNbKfc4Vo83XRX21m+i/J5QC29m+GrDgN1IHUv6pf51H4VdcKC9bE35Isk1O8C +OxlqVrufw6W0xDmgZJZbw6gZdOwLzzPf8xLz4qsdfd4hZM2xoG96d4TUYopQ5nZd +rzrvGocOGjjE+Q0vFOAgMkwucNJxgtXlyRMsTrTIY2UdSOjDVm2IhFdlEx5CSLQD +JXFOEp0aiGXVcSE7Dr43HPCIa0UMDmzlYMuGv79AMMTPlPgcYNQb34gCekV+0cbz +B7mxjypVL753n9FGZAW3Z8WyrIxCj2pRpA0rFqTWOaX4Je1oJRO1Gaxs6ezuA2uA +OG4= +-----END CERTIFICATE----- diff --git a/libnm-util/tests/test-crypto.c b/libnm-util/tests/test-crypto.c new file mode 100644 index 00000000..a5466bc8 --- /dev/null +++ b/libnm-util/tests/test-crypto.c @@ -0,0 +1,317 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * Dan Williams + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2007 - 2009 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include + +#include "nm-test-helpers.h" +#include "crypto.h" +#include "nm-utils.h" + +#if 0 +static const char *pem_rsa_key_begin = "-----BEGIN RSA PRIVATE KEY-----"; +static const char *pem_rsa_key_end = "-----END RSA PRIVATE KEY-----"; + +static const char *pem_dsa_key_begin = "-----BEGIN DSA PRIVATE KEY-----"; +static const char *pem_dsa_key_end = "-----END DSA PRIVATE KEY-----"; + +static void +dump_key_to_pem (const char *key, gsize key_len, int key_type) +{ + char *b64 = NULL; + GString *str = NULL; + const char *start_tag; + const char *end_tag; + char *p; + + switch (key_type) { + case NM_CRYPTO_KEY_TYPE_RSA: + start_tag = pem_rsa_key_begin; + end_tag = pem_rsa_key_end; + break; + case NM_CRYPTO_KEY_TYPE_DSA: + start_tag = pem_dsa_key_begin; + end_tag = pem_dsa_key_end; + break; + default: + g_warning ("Unknown key type %d", key_type); + return; + } + + b64 = g_base64_encode ((const unsigned char *) key, key_len); + if (!b64) { + g_warning ("Couldn't base64 encode the key."); + goto out; + } + + str = g_string_new (NULL); + if (!str) { + g_warning ("Couldn't allocate buffer to write out key."); + goto out; + } + + g_string_append (str, start_tag); + g_string_append_c (str, '\n'); + + for (p = b64; p < (b64 + strlen (b64)); p += 64) { + g_string_append_len (str, p, strnlen (p, 64)); + g_string_append_c (str, '\n'); + } + + g_string_append (str, end_tag); + g_string_append_c (str, '\n'); + + g_message ("Decrypted private key:\n\n%s", str->str); + +out: + g_free (b64); + if (str) + g_string_free (str, TRUE); +} +#endif + +static void +test_load_cert (const char *path, const char *desc) +{ + GByteArray *array; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + GError *error = NULL; + + array = crypto_load_and_verify_certificate (path, &format, &error); + ASSERT (array != NULL, desc, + "couldn't read certificate file '%s': %d %s", + path, error->code, error->message); + + ASSERT (format == NM_CRYPTO_FILE_FORMAT_X509, desc, + "%s: unexpected certificate format (expected %d, got %d)", + path, NM_CRYPTO_FILE_FORMAT_X509, format); + + g_byte_array_free (array, TRUE); +} + +static void +test_load_private_key (const char *path, + const char *password, + gboolean expect_fail, + const char *desc) +{ + NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + GByteArray *array; + GError *error = NULL; + + array = crypto_get_private_key (path, password, &key_type, &format, &error); + if (expect_fail) { + ASSERT (array == NULL, desc, + "unexpected success reading private key file '%s' with " + "invalid password", + path); + + ASSERT (format == NM_CRYPTO_FILE_FORMAT_UNKNOWN, desc, + "unexpected success determining private key file '%s' " + "format with invalid password (expected %d, got %d)", + path, NM_CRYPTO_FILE_FORMAT_UNKNOWN, format); + return; + } + + ASSERT (array != NULL, desc, + "couldn't read private key file '%s': %d %s", + path, error->code, error->message); + + ASSERT (format == NM_CRYPTO_FILE_FORMAT_RAW_KEY, desc, + "%s: unexpected private key file format (expected %d, got %d)", + path, NM_CRYPTO_FILE_FORMAT_RAW_KEY, format); + + ASSERT (key_type == NM_CRYPTO_KEY_TYPE_RSA, desc, + "%s: unexpected private key type (expected %d, got %d)", + path, NM_CRYPTO_KEY_TYPE_RSA, format); + + g_byte_array_free (array, TRUE); +} + +static void +test_load_pkcs12 (const char *path, + const char *password, + gboolean expect_fail, + const char *desc) +{ + NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + GByteArray *array; + GError *error = NULL; + + array = crypto_get_private_key (path, password, &key_type, &format, &error); + if (expect_fail) { + ASSERT (array == NULL, desc, + "unexpected success reading PKCS#12 private key file " + "'%s' with invalid password", + path); + + /* PKCS#12 file format can be determined even if the password + * is wrong; check that. + */ + ASSERT (format == NM_CRYPTO_FILE_FORMAT_UNKNOWN, desc, + "unexpected success determining PKCS#12 private key " + "'%s' file format with invalid password (expected %d, " + "got %d)", + path, NM_CRYPTO_FILE_FORMAT_UNKNOWN, format); + ASSERT (key_type == NM_CRYPTO_KEY_TYPE_UNKNOWN, desc, + "unexpected success determining PKCS#12 private key " + "'%s' type with invalid password (expected %d, got %d)", + path, NM_CRYPTO_KEY_TYPE_UNKNOWN, key_type); + return; + } + + ASSERT (array != NULL, desc, + "couldn't read PKCS#12 private key file '%s': %d %s", + path, error->code, error->message); + + ASSERT (format == NM_CRYPTO_FILE_FORMAT_PKCS12, desc, + "%s: unexpected PKCS#12 private key file format (expected %d, got %d)", + path, NM_CRYPTO_FILE_FORMAT_RAW_KEY, format); + + ASSERT (key_type == NM_CRYPTO_KEY_TYPE_ENCRYPTED, desc, + "%s: unexpected PKCS#12 private key type (expected %d, got %d)", + path, NM_CRYPTO_KEY_TYPE_ENCRYPTED, format); + + g_byte_array_free (array, TRUE); +} + +static void +test_is_pkcs12 (const char *path, gboolean expect_fail, const char *desc) +{ + gboolean is_pkcs12; + + 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); + return; + } + + ASSERT (is_pkcs12 == TRUE, desc, "couldn't read PKCS#12 file '%s'", path); +} + +static void +test_encrypt_private_key (const char *path, + const char *password, + const char *desc) +{ + NMCryptoKeyType key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN; + NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + GByteArray *array, *encrypted, *re_decrypted; + GError *error = NULL; + + array = crypto_get_private_key (path, password, &key_type, &format, &error); + + ASSERT (array != NULL, desc, + "couldn't read private key file '%s': %d %s", + path, error->code, error->message); + + ASSERT (format == NM_CRYPTO_FILE_FORMAT_RAW_KEY, desc, + "%s: unexpected private key file format (expected %d, got %d)", + path, NM_CRYPTO_FILE_FORMAT_RAW_KEY, format); + + ASSERT (key_type == NM_CRYPTO_KEY_TYPE_RSA, desc, + "%s: unexpected private key type (expected %d, got %d)", + path, NM_CRYPTO_KEY_TYPE_RSA, format); + + /* Now re-encrypt the private key */ + encrypted = nm_utils_rsa_key_encrypt (array, password, NULL, &error); + ASSERT (encrypted != NULL, desc, + "couldn't re-encrypt private key file '%s': %d %s", + path, error->code, error->message); + + /* Then re-decrypt the private key */ + key_type = NM_CRYPTO_KEY_TYPE_UNKNOWN; + format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; + re_decrypted = crypto_get_private_key_data (encrypted, password, &key_type, &format, &error); + + ASSERT (re_decrypted != NULL, desc, + "couldn't read private key file '%s': %d %s", + path, error->code, error->message); + + ASSERT (format == NM_CRYPTO_FILE_FORMAT_RAW_KEY, desc, + "%s: unexpected private key file format (expected %d, got %d)", + path, NM_CRYPTO_FILE_FORMAT_RAW_KEY, format); + + ASSERT (key_type == NM_CRYPTO_KEY_TYPE_RSA, desc, + "%s: unexpected private key type (expected %d, got %d)", + path, NM_CRYPTO_KEY_TYPE_RSA, format); + + /* 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_byte_array_free (re_decrypted, TRUE); + g_byte_array_free (encrypted, TRUE); + g_byte_array_free (array, TRUE); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + char *progname; + + ASSERT (argc > 2, "test-crypto", + "wrong number of arguments (expected at least an operation and an object)"); + + if (!crypto_init (&error)) + FAIL ("crypto-init", "failed to initialize crypto: %s", error->message); + + if (!strcmp (argv[1], "--cert")) + test_load_cert (argv[2], "cert"); + else if (!strcmp (argv[1], "--key")) { + ASSERT (argc == 4, "test-crypto", + "wrong number of arguments (--key )"); + + test_load_private_key (argv[2], argv[3], FALSE, "private-key"); + test_load_private_key (argv[2], "blahblahblah", TRUE, "private-key-bad-password"); + test_encrypt_private_key (argv[2], argv[3], "private-key-rencrypt"); + test_is_pkcs12 (argv[2], TRUE, "is-pkcs12-not-pkcs12"); + } else if (!strcmp (argv[1], "--p12")) { + test_is_pkcs12 (argv[2], FALSE, "is-pkcs12"); + test_load_pkcs12 (argv[2], argv[3], FALSE, "pkcs12-private-key"); + test_load_pkcs12 (argv[2], "blahblahblah", TRUE, "pkcs12-private-key-bad-password"); + } else { + ASSERT (argc > 2, "test-crypto", "unknown test type (not --cert, --key, or --p12)"); + } + + crypto_deinit (); + + progname = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", progname); + g_free (progname); + return 0; +} + diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c new file mode 100644 index 00000000..95304459 --- /dev/null +++ b/libnm-util/tests/test-general.c @@ -0,0 +1,246 @@ +/* -*- 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) 2008 - 2010 Red Hat, Inc. + * + */ + +#include +#include +#include + +#include "nm-test-helpers.h" +#include + +#include "nm-setting-connection.h" +#include "nm-setting-vpn.h" +#include "nm-setting-ip6-config.h" +#include "nm-dbus-glib-types.h" + +static void +vpn_check_func (const char *key, const char *value, gpointer user_data) +{ + const char *test = user_data; + + if (!strcmp (key, "foobar1")) { + ASSERT (strcmp (value, "blahblah1") == 0, + test, "unexpected vpn item '%s' / '%s'", key, value); + return; + } + + if (!strcmp (key, "foobar2")) { + ASSERT (strcmp (value, "blahblah2") == 0, + test, "unexpected vpn item '%s' / '%s'", key, value); + return; + } + + if (!strcmp (key, "foobar3")) { + ASSERT (strcmp (value, "blahblah3") == 0, + test, "unexpected vpn item '%s' / '%s'", key, value); + return; + } + + if (!strcmp (key, "foobar4")) { + ASSERT (strcmp (value, "blahblah4") == 0, + test, "unexpected vpn item '%s' / '%s'", key, value); + return; + } + + ASSERT (FALSE, test, "unexpected vpn item '%s'", key); +} + +static void +vpn_check_empty_func (const char *key, const char *value, gpointer user_data) +{ + const char *test = user_data; + + /* We don't expect any values */ + ASSERT (FALSE, test, "unexpected vpn item '%s'", key); +} + +static void +test_setting_vpn_items (void) +{ + NMSettingVPN *s_vpn; + + s_vpn = (NMSettingVPN *) nm_setting_vpn_new (); + ASSERT (s_vpn != NULL, + "vpn-items", + "error creating vpn setting"); + + nm_setting_vpn_add_data_item (s_vpn, "foobar1", "blahblah1"); + nm_setting_vpn_add_data_item (s_vpn, "foobar2", "blahblah2"); + nm_setting_vpn_add_data_item (s_vpn, "foobar3", "blahblah3"); + nm_setting_vpn_add_data_item (s_vpn, "foobar4", "blahblah4"); + + /* Ensure that added values are all present */ + nm_setting_vpn_foreach_data_item (s_vpn, vpn_check_func, "vpn-data"); + nm_setting_vpn_remove_data_item (s_vpn, "foobar1"); + nm_setting_vpn_remove_data_item (s_vpn, "foobar2"); + nm_setting_vpn_remove_data_item (s_vpn, "foobar3"); + nm_setting_vpn_remove_data_item (s_vpn, "foobar4"); + + nm_setting_vpn_add_secret (s_vpn, "foobar1", "blahblah1"); + nm_setting_vpn_add_secret (s_vpn, "foobar2", "blahblah2"); + nm_setting_vpn_add_secret (s_vpn, "foobar3", "blahblah3"); + nm_setting_vpn_add_secret (s_vpn, "foobar4", "blahblah4"); + + /* Ensure that added values are all present */ + nm_setting_vpn_foreach_secret (s_vpn, vpn_check_func, "vpn-secrets"); + nm_setting_vpn_remove_secret (s_vpn, "foobar1"); + nm_setting_vpn_remove_secret (s_vpn, "foobar2"); + nm_setting_vpn_remove_secret (s_vpn, "foobar3"); + nm_setting_vpn_remove_secret (s_vpn, "foobar4"); + + /* Try to add some blank values and make sure they are rejected */ + nm_setting_vpn_add_data_item (s_vpn, NULL, NULL); + nm_setting_vpn_add_data_item (s_vpn, "", ""); + nm_setting_vpn_add_data_item (s_vpn, "foobar1", NULL); + nm_setting_vpn_add_data_item (s_vpn, "foobar1", ""); + nm_setting_vpn_add_data_item (s_vpn, NULL, "blahblah1"); + nm_setting_vpn_add_data_item (s_vpn, "", "blahblah1"); + + nm_setting_vpn_foreach_data_item (s_vpn, vpn_check_empty_func, "vpn-data-empty"); + + /* Try to add some blank secrets and make sure they are rejected */ + nm_setting_vpn_add_secret (s_vpn, NULL, NULL); + nm_setting_vpn_add_secret (s_vpn, "", ""); + nm_setting_vpn_add_secret (s_vpn, "foobar1", NULL); + nm_setting_vpn_add_secret (s_vpn, "foobar1", ""); + nm_setting_vpn_add_secret (s_vpn, NULL, "blahblah1"); + nm_setting_vpn_add_secret (s_vpn, "", "blahblah1"); + + nm_setting_vpn_foreach_secret (s_vpn, vpn_check_empty_func, "vpn-secrets-empty"); + + g_object_unref (s_vpn); +} + +#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)) + +/* Test that setting the IPv6 setting's 'addresses' property using the old + * IPv6 address format still works, i.e. that the GValue transformation function + * from old->new is working correctly. + */ +static void +test_setting_ip6_config_old_address_array (void) +{ + NMSettingIP6Config *s_ip6; + GPtrArray *addresses, *read_addresses; + GValueArray *array, *read_array; + GValue element = {0, }, written_value = {0, }, read_value = {0, }; + GByteArray *ba; + const guint8 addr[16] = { 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, + 0x11, 0x22, 0x33, 0x44, 0x66, 0x77, 0x88, 0x99 }; + const guint8 gw[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + guint32 prefix = 56; + GValue *read_addr, *read_prefix, *read_gw; + + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "ip6-old-addr", "error creating IP6 setting"); + + g_value_init (&written_value, OLD_DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS); + + addresses = g_ptr_array_new (); + array = g_value_array_new (3); + + /* IP address */ + g_value_init (&element, DBUS_TYPE_G_UCHAR_ARRAY); + ba = g_byte_array_new (); + g_byte_array_append (ba, &addr[0], sizeof (addr)); + g_value_take_boxed (&element, ba); + g_value_array_append (array, &element); + g_value_unset (&element); + + /* Prefix */ + g_value_init (&element, G_TYPE_UINT); + g_value_set_uint (&element, prefix); + g_value_array_append (array, &element); + g_value_unset (&element); + + g_ptr_array_add (addresses, array); + g_value_set_boxed (&written_value, addresses); + + /* Set the address array on the object */ + g_object_set_property (G_OBJECT (s_ip6), NM_SETTING_IP6_CONFIG_ADDRESSES, &written_value); + + /* Get it back so we can compare it */ + g_value_init (&read_value, DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS); + g_object_get_property (G_OBJECT (s_ip6), NM_SETTING_IP6_CONFIG_ADDRESSES, &read_value); + + ASSERT (G_VALUE_HOLDS (&read_value, DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS), + "ip6-old-addr", "wrong addresses property value type '%s'", + G_VALUE_TYPE_NAME (&read_value)); + + read_addresses = (GPtrArray *) g_value_get_boxed (&read_value); + ASSERT (read_addresses != NULL, + "ip6-old-addr", "missing addresses on readback"); + ASSERT (read_addresses->len == 1, + "ip6-old-addr", "expected one address on readback"); + + read_array = (GValueArray *) g_ptr_array_index (read_addresses, 0); + + read_addr = g_value_array_get_nth (read_array, 0); + ba = g_value_get_boxed (read_addr); + ASSERT (ba->len == sizeof (addr), + "ip6-old-addr", "unexpected address item length %d", ba->len); + ASSERT (memcmp (ba->data, &addr[0], sizeof (addr)) == 0, + "ip6-old-addr", "unexpected failure comparing addresses"); + + read_prefix = g_value_array_get_nth (read_array, 1); + ASSERT (g_value_get_uint (read_prefix) == prefix, + "ip6-old-addr", "unexpected failure comparing prefix"); + + /* Ensure the gateway is all zeros, which is how the 2-item to 3-item + * conversion happens. + */ + read_gw = g_value_array_get_nth (read_array, 2); + ba = g_value_get_boxed (read_gw); + ASSERT (ba->len == sizeof (gw), + "ip6-old-addr", "unexpected gateway item length %d", ba->len); + ASSERT (memcmp (ba->data, &gw[0], sizeof (gw)) == 0, + "ip6-old-addr", "unexpected failure comparing gateways"); + + g_value_unset (&written_value); + g_value_unset (&read_value); + g_object_unref (s_ip6); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + DBusGConnection *bus; + char *base; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + if (!nm_utils_init (&error)) + FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + + /* The tests */ + test_setting_vpn_items (); + test_setting_ip6_config_old_address_array (); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + diff --git a/libnm-util/tests/test-need-secrets.c b/libnm-util/tests/test-need-secrets.c new file mode 100644 index 00000000..517e2e01 --- /dev/null +++ b/libnm-util/tests/test-need-secrets.c @@ -0,0 +1,566 @@ +/* -*- 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) 2008 - 2009 Red Hat, Inc. + * + */ + +#include +#include +#include + +#include "nm-test-helpers.h" +#include + +#include "nm-setting-connection.h" +#include "nm-setting-wired.h" +#include "nm-setting-8021x.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-wireless-security.h" +#include "nm-setting-cdma.h" +#include "nm-setting-gsm.h" +#include "nm-setting-ppp.h" +#include "nm-setting-pppoe.h" +#include "nm-setting-vpn.h" + + +#define TEST_NEED_SECRETS_EAP_TLS_CA_CERT TEST_CERT_DIR "/test_ca_cert.pem" +#define TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT TEST_CERT_DIR "/test_key_and_cert.pem" +#define TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY TEST_CERT_DIR "/test_key_and_cert.pem" + +static gboolean +find_hints_item (GPtrArray *hints, const char *item) +{ + int i; + + for (i = 0; i < hints->len; i++) { + if (!strcmp (item, (const char *) g_ptr_array_index (hints, i))) + return TRUE; + } + return FALSE; +} + +static NMConnection * +make_tls_connection (const char *detail, NMSetting8021xCKScheme scheme) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSetting8021x *s_8021x; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + char *uuid; + gboolean success; + GError *error = NULL; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + detail, "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Need TLS Secrets", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + /* Wireless security setting */ + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_802_1X_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_8021x)); + + g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, "Bill Smith", NULL); + + nm_setting_802_1x_add_eap_method (s_8021x, "tls"); + + success = nm_setting_802_1x_set_ca_cert (s_8021x, + TEST_NEED_SECRETS_EAP_TLS_CA_CERT, + scheme, + NULL, + &error); + ASSERT (success == TRUE, + detail, "failed to set CA certificate '%s': %s", + TEST_NEED_SECRETS_EAP_TLS_CA_CERT, error->message); + + success = nm_setting_802_1x_set_client_cert (s_8021x, + TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT, + scheme, + NULL, + &error); + ASSERT (success == TRUE, + detail, "failed to set client certificate '%s': %s", + TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT, error->message); + + success = nm_setting_802_1x_set_private_key (s_8021x, + TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY, + "test", + scheme, + NULL, + &error); + ASSERT (success == TRUE, + detail, "failed to set private key '%s': %s", + TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY, error->message); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + detail, "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_AUTO, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + detail, "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + return connection; +} + +static void +test_need_tls_secrets_path (void) +{ + NMConnection *connection; + const char *setting_name; + GPtrArray *hints = NULL; + NMSetting8021x *s_8021x; + + connection = make_tls_connection ("need-tls-secrets-path-key", NM_SETTING_802_1X_CK_SCHEME_PATH); + ASSERT (connection != NULL, + "need-tls-secrets-path-key", + "error creating test connection"); + + /* Ensure we don't need any secrets since we just set up the connection */ + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name == NULL, + "need-tls-secrets-path-key", + "secrets are unexpectedly required"); + ASSERT (hints == NULL, + "need-tls-secrets-path-key", + "hints should be NULL since no secrets were required"); + + /* Connection is good; clear secrets and ensure private key is then required */ + nm_connection_clear_secrets (connection); + + hints = NULL; + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name != NULL, + "need-tls-secrets-path-key", + "unexpected secrets success"); + ASSERT (strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME) == 0, + "need-tls-secrets-path-key", + "unexpected setting secrets required"); + + ASSERT (hints != NULL, + "need-tls-secrets-path-key", + "expected returned secrets hints"); + ASSERT (find_hints_item (hints, NM_SETTING_802_1X_PRIVATE_KEY), + "need-tls-secrets-path-key", + "expected to require private key, but it wasn't"); + + g_object_unref (connection); + + /*** Just clear the private key this time ***/ + + connection = make_tls_connection ("need-tls-secrets-path-key-password", NM_SETTING_802_1X_CK_SCHEME_PATH); + ASSERT (connection != NULL, + "need-tls-secrets-path-key-password", + "error creating test connection"); + + s_8021x = (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + ASSERT (s_8021x != NULL, + "need-tls-secrets-path-key-password", + "error getting test 802.1x setting"); + + g_object_set (G_OBJECT (s_8021x), NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, NULL, NULL); + + hints = NULL; + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name != NULL, + "need-tls-secrets-path-key-password", + "unexpected secrets success"); + ASSERT (strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME) == 0, + "need-tls-secrets-path-key-password", + "unexpected setting secrets required"); + + ASSERT (hints != NULL, + "need-tls-secrets-path-key-password", + "expected returned secrets hints"); + ASSERT (find_hints_item (hints, NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD), + "need-tls-secrets-path-key-password", + "expected to require private key password, but it wasn't"); + + g_object_unref (connection); +} + +static void +test_need_tls_secrets_blob (void) +{ + NMConnection *connection; + const char *setting_name; + GPtrArray *hints = NULL; + NMSetting8021x *s_8021x; + + connection = make_tls_connection ("need-tls-secrets-blob-key", NM_SETTING_802_1X_CK_SCHEME_BLOB); + ASSERT (connection != NULL, + "need-tls-secrets-blob-key", + "error creating test connection"); + + /* Ensure we don't need any secrets since we just set up the connection */ + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name == NULL, + "need-tls-secrets-blob-key", + "secrets are unexpectedly required"); + ASSERT (hints == NULL, + "need-tls-secrets-blob-key", + "hints should be NULL since no secrets were required"); + + /* Connection is good; clear secrets and ensure private key is then required */ + nm_connection_clear_secrets (connection); + + hints = NULL; + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name != NULL, + "need-tls-secrets-blob-key", + "unexpected secrets success"); + ASSERT (strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME) == 0, + "need-tls-secrets-blob-key", + "unexpected setting secrets required"); + + ASSERT (hints != NULL, + "need-tls-secrets-blob-key", + "expected returned secrets hints"); + ASSERT (find_hints_item (hints, NM_SETTING_802_1X_PRIVATE_KEY), + "need-tls-secrets-blob-key", + "expected to require private key, but it wasn't"); + + g_object_unref (connection); + + /*** Just clear the private key this time ***/ + + connection = make_tls_connection ("need-tls-secrets-blob-key-password", NM_SETTING_802_1X_CK_SCHEME_BLOB); + ASSERT (connection != NULL, + "need-tls-secrets-blob-key-password", + "error creating test connection"); + + s_8021x = (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + ASSERT (s_8021x != NULL, + "need-tls-secrets-blob-key-password", + "error getting test 802.1x setting"); + + g_object_set (G_OBJECT (s_8021x), NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, NULL, NULL); + + /* Blobs are already decrypted and don't need a password */ + hints = NULL; + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name == NULL, + "need-tls-secrets-blob-key-password", + "unexpected secrets failure"); + ASSERT (hints == NULL, + "need-tls-secrets-blob-key-password", + "hints should be NULL since no secrets were required"); + + g_object_unref (connection); +} + +static NMConnection * +make_tls_phase2_connection (const char *detail, NMSetting8021xCKScheme scheme) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSetting8021x *s_8021x; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + char *uuid; + gboolean success; + GError *error = NULL; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + detail, "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Need TLS Secrets", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + /* Wireless security setting */ + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_802_1X_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_8021x)); + + g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, "blahblah", NULL); + g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, "Bill Smith", NULL); + + nm_setting_802_1x_add_eap_method (s_8021x, "ttls"); + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "tls", NULL); + + success = nm_setting_802_1x_set_phase2_ca_cert (s_8021x, + TEST_NEED_SECRETS_EAP_TLS_CA_CERT, + scheme, + NULL, + &error); + ASSERT (success == TRUE, + detail, "failed to set phase2 CA certificate '%s': %s", + TEST_NEED_SECRETS_EAP_TLS_CA_CERT, error->message); + + success = nm_setting_802_1x_set_phase2_client_cert (s_8021x, + TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT, + scheme, + NULL, + &error); + ASSERT (success == TRUE, + detail, "failed to set phase2 client certificate '%s': %s", + TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT, error->message); + + success = nm_setting_802_1x_set_phase2_private_key (s_8021x, + TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY, + "test", + scheme, + NULL, + &error); + ASSERT (success == TRUE, + detail, "failed to set phase2 private key '%s': %s", + TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY, error->message); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + detail, "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_AUTO, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + detail, "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + return connection; +} + +static void +test_need_tls_phase2_secrets_path (void) +{ + NMConnection *connection; + const char *setting_name; + GPtrArray *hints = NULL; + NMSetting8021x *s_8021x; + + connection = make_tls_phase2_connection ("need-tls-phase2-secrets-path-key", + NM_SETTING_802_1X_CK_SCHEME_PATH); + ASSERT (connection != NULL, + "need-tls-phase2-secrets-path-key", + "error creating test connection"); + + /* Ensure we don't need any secrets since we just set up the connection */ + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name == NULL, + "need-tls-phase2-secrets-path-key", + "secrets are unexpectedly required"); + ASSERT (hints == NULL, + "need-tls-phase2-secrets-path-key", + "hints should be NULL since no secrets were required"); + + /* Connection is good; clear secrets and ensure private key is then required */ + nm_connection_clear_secrets (connection); + + hints = NULL; + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name != NULL, + "need-tls-phase2-secrets-path-key", + "unexpected secrets success"); + ASSERT (strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME) == 0, + "need-tls-phase2-secrets-path-key", + "unexpected setting secrets required"); + + ASSERT (hints != NULL, + "need-tls-phase2-secrets-path-key", + "expected returned secrets hints"); + ASSERT (find_hints_item (hints, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY), + "need-tls-phase2-secrets-path-key", + "expected to require private key, but it wasn't"); + + g_object_unref (connection); + + /*** Just clear the private key this time ***/ + + connection = make_tls_phase2_connection ("need-tls-phase2-secrets-path-key-password", + NM_SETTING_802_1X_CK_SCHEME_PATH); + ASSERT (connection != NULL, + "need-tls-phase2-secrets-path-key-password", + "error creating test connection"); + + s_8021x = (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + ASSERT (s_8021x != NULL, + "need-tls-phase2-secrets-path-key-password", + "error getting test 802.1x setting"); + + g_object_set (G_OBJECT (s_8021x), NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, NULL, NULL); + + hints = NULL; + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name != NULL, + "need-tls-phase2-secrets-path-key-password", + "unexpected secrets success"); + ASSERT (strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME) == 0, + "need-tls-phase2-secrets-path-key-password", + "unexpected setting secrets required"); + + ASSERT (hints != NULL, + "need-tls-phase2-secrets-path-key-password", + "expected returned secrets hints"); + ASSERT (find_hints_item (hints, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD), + "need-tls-phase2-secrets-path-key-password", + "expected to require private key password, but it wasn't"); + + g_object_unref (connection); +} + +static void +test_need_tls_phase2_secrets_blob (void) +{ + NMConnection *connection; + const char *setting_name; + GPtrArray *hints = NULL; + NMSetting8021x *s_8021x; + + connection = make_tls_phase2_connection ("need-tls-phase2-secrets-blob-key", + NM_SETTING_802_1X_CK_SCHEME_BLOB); + ASSERT (connection != NULL, + "need-tls-phase2-secrets-blob-key", + "error creating test connection"); + + /* Ensure we don't need any secrets since we just set up the connection */ + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name == NULL, + "need-tls-phase2-secrets-blob-key", + "secrets are unexpectedly required"); + ASSERT (hints == NULL, + "need-tls-phase2-secrets-blob-key", + "hints should be NULL since no secrets were required"); + + /* Connection is good; clear secrets and ensure private key is then required */ + nm_connection_clear_secrets (connection); + + hints = NULL; + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name != NULL, + "need-tls-phase2-secrets-blob-key", + "unexpected secrets success"); + ASSERT (strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME) == 0, + "need-tls-phase2-secrets-blob-key", + "unexpected setting secrets required"); + + ASSERT (hints != NULL, + "need-tls-phase2-secrets-blob-key", + "expected returned secrets hints"); + ASSERT (find_hints_item (hints, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY), + "need-tls-phase2-secrets-blob-key", + "expected to require private key, but it wasn't"); + + g_object_unref (connection); + + /*** Just clear the private key this time ***/ + + connection = make_tls_phase2_connection ("need-tls-phase2-secrets-blob-key-password", + NM_SETTING_802_1X_CK_SCHEME_BLOB); + ASSERT (connection != NULL, + "need-tls-phase2-secrets-blob-key-password", + "error creating test connection"); + + s_8021x = (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + ASSERT (s_8021x != NULL, + "need-tls-phase2-secrets-blob-key-password", + "error getting test 802.1x setting"); + + g_object_set (G_OBJECT (s_8021x), NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, NULL, NULL); + + /* Blobs are already decrypted and don't need a password */ + hints = NULL; + setting_name = nm_connection_need_secrets (connection, &hints); + ASSERT (setting_name == NULL, + "need-tls-phase2-secrets-blob-key-password", + "unexpected secrets failure"); + ASSERT (hints == NULL, + "need-tls-phase2-secrets-blob-key-password", + "hints should be NULL since no secrets were required"); + + g_object_unref (connection); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + DBusGConnection *bus; + char *base; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + if (!nm_utils_init (&error)) + FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + + /* The tests */ + test_need_tls_secrets_path (); + test_need_tls_secrets_blob (); + test_need_tls_phase2_secrets_path (); + test_need_tls_phase2_secrets_blob (); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + diff --git a/libnm-util/tests/test-setting-8021x.c b/libnm-util/tests/test-setting-8021x.c new file mode 100644 index 00000000..6202a142 --- /dev/null +++ b/libnm-util/tests/test-setting-8021x.c @@ -0,0 +1,163 @@ +/* -*- 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) 2008 - 2009 Red Hat, Inc. + * + */ + +#include +#include +#include + +#include "nm-test-helpers.h" +#include + +#include "nm-setting-connection.h" +#include "nm-setting-8021x.h" + +static void +compare_decrypted (const char *test, + const char *decrypted_path, + const GByteArray *key) +{ + char *contents = NULL; + gsize len = 0; + GError *error = NULL; + gboolean success; + + success = g_file_get_contents (decrypted_path, &contents, &len, &error); + ASSERT (success == TRUE, + test, "failed to read decrypted key file: %s", error->message); + + ASSERT (len > 0, test, "decrypted key file invalid (size 0)"); + + ASSERT (len == key->len, + test, "decrypted key file (%d) and decrypted key data (%d) lengths don't match", + len, key->len); + + ASSERT (memcmp (contents, key->data, len) == 0, + test, "decrypted key file and decrypted key data don't match"); + + g_free (contents); +} + +static void +test_private_key_import (const char *path, + const char *password, + const char *decrypted_path, + NMSetting8021xCKScheme scheme) +{ + NMSetting8021x *s_8021x; + gboolean success; + NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + GError *error = NULL; + + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, "private-key-import", "setting was NULL"); + + success = nm_setting_802_1x_set_private_key (s_8021x, + path, + password, + scheme, + &format, + &error); + ASSERT (success == TRUE, + "private-key-import", "error reading private key: %s", error->message); + + if ( scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB + && format != NM_SETTING_802_1X_CK_FORMAT_PKCS12) { + const GByteArray *key; + + ASSERT (decrypted_path != NULL, "private-key-import", "missing decrypted key file"); + + key = nm_setting_802_1x_get_private_key_blob (s_8021x); + ASSERT (key != NULL, "private-key-import", "missing private key blob"); + compare_decrypted ("private-key-import", decrypted_path, key); + } + + g_object_unref (s_8021x); +} + +static void +test_phase2_private_key_import (const char *path, + const char *password, + const char *decrypted_path, + NMSetting8021xCKScheme scheme) +{ + NMSetting8021x *s_8021x; + gboolean success; + NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + GError *error = NULL; + + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, "phase2-private-key-import", "setting was NULL"); + + success = nm_setting_802_1x_set_phase2_private_key (s_8021x, + path, + password, + scheme, + &format, + &error); + ASSERT (success == TRUE, + "phase2-private-key-import", "error reading private key: %s", error->message); + + if ( scheme == NM_SETTING_802_1X_CK_SCHEME_BLOB + && format != NM_SETTING_802_1X_CK_FORMAT_PKCS12) { + const GByteArray *key; + + ASSERT (decrypted_path != NULL, "phase2-private-key-import", "missing decrypted key file"); + + key = nm_setting_802_1x_get_phase2_private_key_blob (s_8021x); + ASSERT (key != NULL, "phase2-private-key-import", "missing private key blob"); + compare_decrypted ("phase2-private-key-import", decrypted_path, key); + } + + g_object_unref (s_8021x); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + DBusGConnection *bus; + char *base; + const char *decrypted = NULL; + + if (argc < 3) + FAIL ("init", "need at least two arguments: [decrypted private key]"); + + if (argc == 4) + decrypted = argv[3]; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + if (!nm_utils_init (&error)) + FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + + /* The tests */ + test_private_key_import (argv[1], argv[2], NULL, NM_SETTING_802_1X_CK_SCHEME_PATH); + test_phase2_private_key_import (argv[1], argv[2], NULL, NM_SETTING_802_1X_CK_SCHEME_PATH); + + test_private_key_import (argv[1], argv[2], decrypted, NM_SETTING_802_1X_CK_SCHEME_BLOB); + test_phase2_private_key_import (argv[1], argv[2], decrypted, NM_SETTING_802_1X_CK_SCHEME_BLOB); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + diff --git a/libnm-util/tests/test-settings-defaults.c b/libnm-util/tests/test-settings-defaults.c new file mode 100644 index 00000000..9f38a145 --- /dev/null +++ b/libnm-util/tests/test-settings-defaults.c @@ -0,0 +1,135 @@ +/* -*- 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) 2008 Red Hat, Inc. + * + */ + +#include +#include +#include + +#include "nm-test-helpers.h" +#include + +#include "nm-setting-8021x.h" +#include "nm-setting-cdma.h" +#include "nm-setting-connection.h" +#include "nm-setting-gsm.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-ip6-config.h" +#include "nm-setting-ppp.h" +#include "nm-setting-pppoe.h" +#include "nm-setting-serial.h" +#include "nm-setting-vpn.h" +#include "nm-setting-wired.h" +#include "nm-setting-wireless.h" +#include "nm-setting-wireless-security.h" + + +static void +test_defaults (GType type, const char *name) +{ + GParamSpec **property_specs; + guint n_property_specs; + GObject *setting; + int i; + + setting = g_object_new (type, NULL); + + property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs); + ASSERT (property_specs != NULL, + name, "couldn't find property specs for object of type '%s'", + g_type_name (G_OBJECT_TYPE (setting))); + + for (i = 0; i < n_property_specs; i++) { + GParamSpec *prop_spec = property_specs[i]; + GValue value = { 0, }; + GValue defvalue = { 0, }; + char *actual, *expected; + gboolean ok = FALSE; + + /* Ignore non-fundamental types since they won't really have + * defaults. + */ + if (!G_TYPE_IS_FUNDAMENTAL (prop_spec->value_type)) + continue; + + g_value_init (&value, prop_spec->value_type); + g_object_get_property (G_OBJECT (setting), prop_spec->name, &value); + + g_value_init (&defvalue, prop_spec->value_type); + g_param_value_set_default (prop_spec, &defvalue); + + actual = g_strdup_value_contents (&value); + expected = g_strdup_value_contents (&defvalue); + + if (!strcmp (prop_spec->name, NM_SETTING_NAME)) { + /* 'name' is always the setting name, not the default value */ + ok = !strcmp (nm_setting_get_name (NM_SETTING (setting)), name); + g_free (expected); + expected = g_strdup (name); + } else + ok = g_param_value_defaults (prop_spec, &value); + + ASSERT (ok, + name, "property '%s' value '%s' not the expected default value '%s'", + prop_spec->name, actual, expected); + + g_free (actual); + g_free (expected); + g_value_unset (&value); + g_value_unset (&defvalue); + } + + g_free (property_specs); + g_object_unref (setting); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + DBusGConnection *bus; + char *base; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + if (!nm_utils_init (&error)) + FAIL ("nm-utils-init", "failed to initialize libnm-util: %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); + test_defaults (NM_TYPE_SETTING_CDMA, NM_SETTING_CDMA_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_GSM, NM_SETTING_GSM_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_IP4_CONFIG, NM_SETTING_IP4_CONFIG_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_IP6_CONFIG, NM_SETTING_IP6_CONFIG_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_PPP, NM_SETTING_PPP_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_PPPOE, NM_SETTING_PPPOE_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_SERIAL, NM_SETTING_SERIAL_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_VPN, NM_SETTING_VPN_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_WIRED, NM_SETTING_WIRED_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_WIRELESS, NM_SETTING_WIRELESS_SETTING_NAME); + test_defaults (NM_TYPE_SETTING_WIRELESS_SECURITY, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + diff --git a/ltmain.sh b/ltmain.sh new file mode 100755 index 00000000..a72f2fd7 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,8406 @@ +# Generated from ltmain.m4sh. + +# ltmain.sh (GNU libtool) 2.2.6b +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print informational messages (default) +# --version print version information +# -h, --help print short or long help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.6b +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=2.2.6b +TIMESTAMP="" +package_revision=1.3017 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# NLS nuisances: We save the old values to restore during execute mode. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done + +$lt_unset CDPATH + + + + + +: ${CP="cp -f"} +: ${ECHO="echo"} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# Generated shell functions inserted here. + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +# In the unlikely event $progname began with a '-', it would play havoc with +# func_echo (imagine progname=-n), so we prepend ./ in that case: +func_dirname_and_basename "$progpath" +progname=$func_basename_result +case $progname in + -*) progname=./$progname ;; +esac + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$mode: $*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + done + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "X$my_tmpdir" | $Xsed +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "X$1" | $Xsed \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + + + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/# -h/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + $ECHO + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help +# Echo long help message to standard output and exit. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + exit $? +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1" + exit_cmd=exit +} + +exit_cmd=: + + + + + +# Check that we have a working $ECHO. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell, and then maybe $ECHO will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac + + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +## ----------- ## +## Main. ## +## ----------- ## + +$opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." +} + + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case "$@ " in + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + removelist="$removelist $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + removelist="$removelist $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command="$command -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { +test "$mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + $ECHO + $ECHO "Try \`$progname --help' for more information about other modes." + + exit $? +} + + # Now that we've collected a possible --mode arg, show help if necessary + $opt_help && func_mode_help + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + $ECHO "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + $ECHO "X----------------------------------------------------------------------" | $Xsed + $ECHO "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + $ECHO + $ECHO "If you ever happen to want to link against installed libraries" + $ECHO "in a given directory, LIBDIR, you must either use libtool, and" + $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" + $ECHO "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" + $ECHO " during execution" + fi + if test -n "$runpath_var"; then + $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" + $ECHO " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $ECHO + + $ECHO "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" + $ECHO "pages." + ;; + *) + $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + $ECHO "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS +} + +test "$mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + $ECHO >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +" + case $host in + *cygwin* | *mingw* | *cegcc* ) + $ECHO >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + $ECHO >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +$lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + $ECHO >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) symtab_cflags="$symtab_cflags $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + + +# func_emit_wrapper_part1 [arg=no] +# +# Emit the first part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part1 () +{ + func_emit_wrapper_part1_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part1_arg1=$1 + fi + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + ECHO=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$ECHO works! + : + else + # Restart under the correct shell, and then maybe \$ECHO will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $ECHO "\ + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done +" +} +# end: func_emit_wrapper_part1 + +# func_emit_wrapper_part2 [arg=no] +# +# Emit the second part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part2 () +{ + func_emit_wrapper_part2_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part2_arg1=$1 + fi + + $ECHO "\ + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} +# end: func_emit_wrapper_part2 + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=no + if test -n "$1" ; then + func_emit_wrapper_arg1=$1 + fi + + # split this up so that func_emit_cwrapperexe_src + # can call each part independently. + func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" + func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" +} + + +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_path_tmp1=`( cmd //c echo "$1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_tmp1=`cygpath -w "$1"` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result="" + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_to_host_pathlist_tmp2="$1" + # Once set for this call, this variable should not be + # reassigned. It is used in tha fallback case. + func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e 's|^:*||' -e 's|:*$||'` + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" + fi + fi + fi + IFS=: + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result" ; then + func_error "Could not determine the host path(s) corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +# define setmode _setmode +#else +# include +# include +# ifdef __CYGWIN__ +# include +# define HAVE_SETENV +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +#ifdef _MSC_VER +# define S_IXUSR _S_IEXEC +# define stat _stat +# ifndef _INTPTR_T_DEFINED +# define intptr_t int +# endif +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifdef __CYGWIN__ +# define FOPEN_WB "wb" +#endif + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#undef LTWRAPPER_DEBUGPRINTF +#if defined DEBUGWRAPPER +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +static void +ltwrapper_debugprintf (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); +} +#else +# define LTWRAPPER_DEBUGPRINTF(args) +#endif + +const char *program_name = NULL; + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_fatal (const char *message, ...); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_opt_process_env_set (const char *arg); +void lt_opt_process_env_prepend (const char *arg); +void lt_opt_process_env_append (const char *arg); +int lt_split_name_value (const char *arg, char** name, char** value); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); + +static const char *script_text_part1 = +EOF + + func_emit_wrapper_part1 yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ "/' -e 's/$/\\n"/' + echo ";" + cat <"))); + for (i = 0; i < newargc; i++) + { + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + } + +EOF + + case $host_os in + mingw*) + cat <<"EOF" + /* execv doesn't actually work on mingw as expected on unix */ + rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); + if (rval == -1) + { + /* failed to start process */ + LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + return 127; + } + return rval; +EOF + ;; + *) + cat <<"EOF" + execv (lt_argv_zero, newargz); + return rval; /* =127, but avoids unused variable warning */ +EOF + ;; + esac + + cat <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void *p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), + string) : NULL; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char) name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable (const char *path) +{ + struct stat st; + + LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", + tmp_pathspec)); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal ("Could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} + +void +lt_setenv (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", + (name ? name : ""), + (value ? value : ""))); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +int +lt_split_name_value (const char *arg, char** name, char** value) +{ + const char *p; + int len; + if (!arg || !*arg) + return 1; + + p = strchr (arg, (int)'='); + + if (!p) + return 1; + + *value = xstrdup (++p); + + len = strlen (arg) - strlen (*value); + *name = XMALLOC (char, len); + strncpy (*name, arg, len-1); + (*name)[len - 1] = '\0'; + + return 0; +} + +void +lt_opt_process_env_set (const char *arg) +{ + char *name = NULL; + char *value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); + } + + lt_setenv (name, value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_prepend (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_append (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 1); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + + +EOF +} +# end: func_emit_cwrapperexe_src + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs="$weak_libs $arg" + prev= + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_duplicate_deps ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + case $lib in + *.la) func_source "$lib" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs="$deplibs $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + dir=$func_stripname_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $ECHO + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because the file extensions .$libext of this argument makes me believe" + $ECHO "*** that it is just a static archive that I should not use here." + else + $ECHO + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) temp_rpath="$temp_rpath$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + $ECHO + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $ECHO + $ECHO "*** And there doesn't seem to be a static archive available" + $ECHO "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $ECHO + $ECHO "*** Warning: This system can not link to static lib archive $lib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $ECHO "*** But as you try to build a module library, libtool will still create " + $ECHO "*** a static module, that should work as long as the dlopening application" + $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_dirname "$deplib" "" "." + dir="$func_dirname_result" + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + $ECHO + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` + # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` + # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + done + fi + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | + $GREP . >/dev/null; then + $ECHO + if test "X$deplibs_check_method" = "Xnone"; then + $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + else + $ECHO "*** Warning: inter-library dependencies are not known to be supported." + fi + $ECHO "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $ECHO + $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + $ECHO "*** a static module, that should work as long as the dlopening" + $ECHO "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $ECHO "*** The inter-library dependencies that have been dropped here will be" + $ECHO "*** automatically added whenever a program is linked with this library" + $ECHO "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $ECHO + $ECHO "*** Since this library must not contain undefined symbols," + $ECHO "*** because either the platform does not support them or" + $ECHO "*** it was explicitly requested with -no-undefined," + $ECHO "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + delfiles="$delfiles $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + $ECHO 'INPUT (' > $output + for obj in $save_libobjs + do + $ECHO "$obj" >> $output + done + $ECHO ')' >> $output + delfiles="$delfiles $output" + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + $ECHO "$obj" >> $output + done + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles="$delfiles $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *cegcc) + # Disable wrappers for cegcc, we are cross compiling anyway. + wrappers_required=no + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $ECHO for shipping. + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs="$oldobjs $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $ECHO "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles="$newdlfiles $libdir/$name" + ;; + *) newdlfiles="$newdlfiles $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles="$newdlprefiles $libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$mode" = link || test "$mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4 new file mode 100644 index 00000000..6cea2f74 --- /dev/null +++ b/m4/compiler_warnings.m4 @@ -0,0 +1,31 @@ +AC_DEFUN([NM_COMPILER_WARNINGS], +[AC_ARG_ENABLE(more-warnings, + AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), + set_more_warnings="$enableval",set_more_warnings=yes) +AC_MSG_CHECKING(for more warnings, including -Werror) +if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then + AC_MSG_RESULT(yes) + CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS" + + for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \ + -Wdeclaration-after-statement -Wstrict-prototypes \ + -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \ + -fno-strict-aliasing; do + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $option" + AC_MSG_CHECKING([whether gcc understands $option]) + AC_TRY_COMPILE([], [], + has_option=yes, + has_option=no,) + if test $has_option = no; then + CFLAGS="$SAVE_CFLAGS" + fi + AC_MSG_RESULT($has_option) + unset has_option + unset SAVE_CFLAGS + done + unset option +else + AC_MSG_RESULT(no) +fi +]) diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4 new file mode 100644 index 00000000..2cfa1e71 --- /dev/null +++ b/m4/gtk-doc.m4 @@ -0,0 +1,61 @@ +dnl -*- mode: autoconf -*- + +# serial 1 + +dnl Usage: +dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + + dnl check for tools we added during development + AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) + AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) + AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) + + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + if test x$enable_gtk_doc = xyes; then + ifelse([$1],[], + [PKG_CHECK_EXISTS([gtk-doc],, + AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], + [PKG_CHECK_EXISTS([gtk-doc >= $1],, + AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) + fi + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + dnl enable/disable output formats + AC_ARG_ENABLE([gtk-doc-html], + AS_HELP_STRING([--enable-gtk-doc-html], + [build documentation in html format [[default=yes]]]),, + [enable_gtk_doc_html=yes]) + AC_ARG_ENABLE([gtk-doc-pdf], + AS_HELP_STRING([--enable-gtk-doc-pdf], + [build documentation in pdf format [[default=no]]]),, + [enable_gtk_doc_pdf=no]) + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) + AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) +]) diff --git a/m4/intltool.m4 b/m4/intltool.m4 new file mode 100644 index 00000000..839e8553 --- /dev/null +++ b/m4/intltool.m4 @@ -0,0 +1,216 @@ +## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*- +## Copyright (C) 2001 Eazel, Inc. +## Author: Maciej Stachowiak +## Kenneth Christiansen +## +## 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) +# serial 40 IT_PROG_INTLTOOL +AC_DEFUN([IT_PROG_INTLTOOL], [ +AC_PREREQ([2.50])dnl +AC_REQUIRE([AM_NLS])dnl + +case "$am__api_version" in + 1.[01234]) + AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) + ;; + *) + ;; +esac + +if test -n "$1"; then + AC_MSG_CHECKING([for intltool >= $1]) + + INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` + ] + AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) + test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || + AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) +fi + +AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) +AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) +AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) +fi + + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' +INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@' + INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' +INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' + INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' + +_IT_SUBST(INTLTOOL_DESKTOP_RULE) +_IT_SUBST(INTLTOOL_DIRECTORY_RULE) +_IT_SUBST(INTLTOOL_KEYS_RULE) +_IT_SUBST(INTLTOOL_PROP_RULE) +_IT_SUBST(INTLTOOL_OAF_RULE) +_IT_SUBST(INTLTOOL_PONG_RULE) +_IT_SUBST(INTLTOOL_SERVER_RULE) +_IT_SUBST(INTLTOOL_SHEET_RULE) +_IT_SUBST(INTLTOOL_SOUNDLIST_RULE) +_IT_SUBST(INTLTOOL_UI_RULE) +_IT_SUBST(INTLTOOL_XAM_RULE) +_IT_SUBST(INTLTOOL_KBD_RULE) +_IT_SUBST(INTLTOOL_XML_RULE) +_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) +_IT_SUBST(INTLTOOL_CAVES_RULE) +_IT_SUBST(INTLTOOL_SCHEMAS_RULE) +_IT_SUBST(INTLTOOL_THEME_RULE) +_IT_SUBST(INTLTOOL_SERVICE_RULE) +_IT_SUBST(INTLTOOL_POLICY_RULE) + +# Check the gettext tools to make sure they are GNU +AC_PATH_PROG(XGETTEXT, xgettext) +AC_PATH_PROG(MSGMERGE, msgmerge) +AC_PATH_PROG(MSGFMT, msgfmt) +AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) +if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then + AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) +fi +xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" +mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" +mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" +if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then + AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) +fi + +AC_PATH_PROG(INTLTOOL_PERL, perl) +if test -z "$INTLTOOL_PERL"; then + AC_MSG_ERROR([perl not found]) +fi +AC_MSG_CHECKING([for perl >= 5.8.1]) +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + AC_MSG_ERROR([perl 5.8.1 is required for intltool]) +else + IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" + AC_MSG_RESULT([$IT_PERL_VERSION]) +fi +if test "x$2" != "xno-xml"; then + AC_MSG_CHECKING([for XML::Parser]) + if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then + AC_MSG_RESULT([ok]) + else + AC_MSG_ERROR([XML::Parser perl module is required for intltool]) + fi +fi + +# Substitute ALL_LINGUAS so we can use it in po/Makefile +AC_SUBST(ALL_LINGUAS) + +# Set DATADIRNAME correctly if it is not set yet +# (copied from glib-gettext.m4) +if test -z "$DATADIRNAME"; then + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], + [[extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr]])], + [DATADIRNAME=share], + [case $host in + *-*-solaris*) + dnl On Solaris, if bind_textdomain_codeset is in libc, + dnl GNU format message catalog is always supported, + dnl since both are added to the libc all together. + dnl Hence, we'd like to go with DATADIRNAME=share + dnl in this case. + AC_CHECK_FUNC(bind_textdomain_codeset, + [DATADIRNAME=share], [DATADIRNAME=lib]) + ;; + *) + [DATADIRNAME=lib] + ;; + esac]) +fi +AC_SUBST(DATADIRNAME) + +IT_PO_SUBDIR([po]) + +]) + + +# IT_PO_SUBDIR(DIRNAME) +# --------------------- +# All po subdirs have to be declared with this macro; the subdir "po" is +# declared by IT_PROG_INTLTOOL. +# +AC_DEFUN([IT_PO_SUBDIR], +[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. +dnl +dnl The following CONFIG_COMMANDS should be executed at the very end +dnl of config.status. +AC_CONFIG_COMMANDS_PRE([ + AC_CONFIG_COMMANDS([$1/stamp-it], [ + if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then + AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) + fi + rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" + >"$1/stamp-it.tmp" + [sed '/^#/d + s/^[[].*] *// + /^[ ]*$/d + '"s|^| $ac_top_srcdir/|" \ + "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" + ] + [sed '/^POTFILES =/,/[^\\]$/ { + /^POTFILES =/!d + r $1/POTFILES + } + ' "$1/Makefile.in" >"$1/Makefile"] + rm -f "$1/Makefile.tmp" + mv "$1/stamp-it.tmp" "$1/stamp-it" + ]) +])dnl +]) + +# _IT_SUBST(VARIABLE) +# ------------------- +# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST +# +AC_DEFUN([_IT_SUBST], +[ +AC_SUBST([$1]) +m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) +] +) + +# deprecated macros +AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) +# A hint is needed for aclocal from Automake <= 1.9.4: +# AC_DEFUN([AC_PROG_INTLTOOL], ...) + diff --git a/m4/libnl-check.m4 b/m4/libnl-check.m4 new file mode 100644 index 00000000..f7d6d707 --- /dev/null +++ b/m4/libnl-check.m4 @@ -0,0 +1,65 @@ +AC_DEFUN([NM_LIBNL_CHECK], [ + AC_MSG_CHECKING([for libnl address caching bug]) + save_CFLAGS="$CFLAGS" + save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS $LIBNL_CFLAGS" + LDFLAGS="$LDFLAGS $LIBNL_LIBS" + AC_RUN_IFELSE([ +#include +#include +#include + +int +main (int argc, char **argv) +{ + struct nl_handle *nlh; + struct nl_cache *cache; + struct nl_object *obj; + + nlh = nl_handle_alloc (); + if (nl_connect (nlh, NETLINK_ROUTE) < 0) { + fprintf (stderr, "couldn't connect to netlink: %s", nl_geterror ()); + return 3; + } + + cache = rtnl_addr_alloc_cache (nlh); + if (!cache || nl_cache_nitems (cache) == 0) { + fprintf (stderr, "couldn't fill address cache: %s", nl_geterror ()); + return 3; + } + + obj = nl_cache_get_first (cache); + if (nl_object_identical (obj, obj)) + return 0; + + nl_cache_get_ops (cache)->co_obj_ops->oo_id_attrs &= ~0x80; + if (nl_object_identical (obj, obj)) + return 1; + else + return 2; +} +], libnl_bug=$?, libnl_bug=$?, libnl_bug=cross) + + CFLAGS="$save_CFLAGS" + LDFLAGS="$save_LDFLAGS" + + case $libnl_bug in + 0) AC_MSG_RESULT([no]) + ;; + + 1) AC_MSG_RESULT([yes, using workaround]) + AC_DEFINE(LIBNL_NEEDS_ADDR_CACHING_WORKAROUND, 1, [Define this to hack around buggy libnl rtnl_addr caching]) + ;; + + 2) AC_MSG_RESULT([yes, and workaround doesn't work]) + AC_MSG_ERROR([Installed libnl has broken address caching; please patch or upgrade]) + ;; + + cross) AC_MSG_RESULT([cross-compiling... assuming it works!]) + ;; + + *) AC_MSG_RESULT([?]) + AC_MSG_ERROR([libnl test program failed]) + ;; +esac +]) diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 100644 index 00000000..671cde11 --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1,7360 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 new file mode 100644 index 00000000..34151a3b --- /dev/null +++ b/m4/ltoptions.m4 @@ -0,0 +1,368 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 new file mode 100644 index 00000000..9000a057 --- /dev/null +++ b/m4/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 new file mode 100644 index 00000000..f3c53098 --- /dev/null +++ b/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3017 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6b' +macro_revision='1.3017' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 new file mode 100644 index 00000000..637bb206 --- /dev/null +++ b/m4/lt~obsolete.m4 @@ -0,0 +1,92 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 4 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 00000000..097fdc6b --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,17 @@ +man_MANS = \ + NetworkManager.8 \ + NetworkManager.conf.5 \ + nm-system-settings.conf.5 \ + nm-tool.1 \ + nmcli.1 + +EXTRA_DIST = \ + $(man_MANS) \ + NetworkManager.8.in \ + NetworkManager.conf.5.in \ + nm-system-settings.conf.5.in \ + nm-tool.1.in \ + nmcli.1.in + +CLEANFILES = $(man_MANS) + diff --git a/man/Makefile.in b/man/Makefile.in new file mode 100644 index 00000000..6f300937 --- /dev/null +++ b/man/Makefile.in @@ -0,0 +1,611 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = man +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/NetworkManager.8.in \ + $(srcdir)/NetworkManager.conf.5.in \ + $(srcdir)/nm-system-settings.conf.5.in $(srcdir)/nm-tool.1.in \ + $(srcdir)/nmcli.1.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = NetworkManager.8 NetworkManager.conf.5 \ + nm-system-settings.conf.5 nm-tool.1 nmcli.1 +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ + "$(DESTDIR)$(man8dir)" +man5dir = $(mandir)/man5 +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +man_MANS = \ + NetworkManager.8 \ + NetworkManager.conf.5 \ + nm-system-settings.conf.5 \ + nm-tool.1 \ + nmcli.1 + +EXTRA_DIST = \ + $(man_MANS) \ + NetworkManager.8.in \ + NetworkManager.conf.5.in \ + nm-system-settings.conf.5.in \ + nm-tool.1.in \ + nmcli.1.in + +CLEANFILES = $(man_MANS) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu man/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +NetworkManager.8: $(top_builddir)/config.status $(srcdir)/NetworkManager.8.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +NetworkManager.conf.5: $(top_builddir)/config.status $(srcdir)/NetworkManager.conf.5.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +nm-system-settings.conf.5: $(top_builddir)/config.status $(srcdir)/nm-system-settings.conf.5.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +nm-tool.1: $(top_builddir)/config.status $(srcdir)/nm-tool.1.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +nmcli.1: $(top_builddir)/config.status $(srcdir)/nmcli.1.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list=''; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } +install-man5: $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" + @list=''; test -n "$(man5dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.5[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ + done; } + +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man5dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.5[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man5dir)" && rm -f $$files; } +install-man8: $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" + @list=''; test -n "$(man8dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ + done; } + +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man8dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 install-man5 install-man8 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-man5 install-man8 install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-man uninstall-man1 uninstall-man5 uninstall-man8 + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/man/NetworkManager.8 b/man/NetworkManager.8 new file mode 100644 index 00000000..a6be0731 --- /dev/null +++ b/man/NetworkManager.8 @@ -0,0 +1,108 @@ +.\" NetworkManager(8) manual page +.\" +.\" Copyright (C) 2005 - 2010 Red Hat, Inc. +.\" Copyright (C) 2005 - 2009 Novell, Inc. +.\" Copyright (C) 2005 Robert Love +.\" +.TH NETWORKMANAGER "8" "January 29, 2010" +.SH NAME +NetworkManager \- network management daemon +.SH SYNOPSIS +.B NetworkManager [\-\-no\-daemon] [\-\-pid\-file=] [\-\-state\-file=] [\-\-config=] [\-\-plugins=,plugin2>,...] [\-\-log\-level=] [\-\-log\-domains=,,...] +.SH DESCRIPTION +The \fINetworkManager\fP daemon attempts to make networking configuration and +operation as painless and automatic as possible by managing the primary network +connection and other network interfaces, like Ethernet, WiFi, and Mobile +Broadband devices. NetworkManager will connect any network device when a +connection for that device becomes available, unless that behavior is disabled. +Information about networking is exported via a D-Bus interface to any interested +application, providing a rich API with which to inspect and control network +settings and operation. +.P +NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher.d +directory in alphabetical order in response to network events. Each script +should be (a) a regular file, (b) owned by root, (c) not writable by group or +other, (d) not set-uid, (e) and executable by the owner. Each script receives +two arguments, the first being the interface name of the device just activated, +and second an action. +.TP +.I "up" +The interface has been activated. The environment contains more information +about the interface; CONNECTION_UUID contains the UUID of the connection. Other +variables are IP4_ADDRESS_N where N is a number from 0 to (# IPv4 addresses \- 1), +in the format "address/prefix gateway". IP4_NUM_ADDRESSES contains the number +addresses the script may expect. IP4_NAMESERVERS contains a space-separated +list of the DNS servers, and IP4_DOMAINS contains a space-separated list of the +search domains. Routes use the format IP4_ROUTE_N where N is a number from 0 +to (# IPv4 routes \- 1), in the format "address/prefix next-hop metric", and +IP4_NUM_ROUTES contains the number of routes to expect. If the connection used +DHCP for address configuration, the received DHCP configuration is passed in the +environment using standard DHCP option names, prefixed with "DHCP4_", like +"DHCP4_HOST_NAME=foobar". +.TP +.I "down" +The interface has been deactivated. +.TP +.I "vpn\-up" +A VPN connection has been activated. The environment contains the connection +UUID in the variable CONNECTION_UUID. +.TP +.I "vpn\-down" +A VPN connection has been deactivated. +.TP +.I "hostname" +The system hostname has been updated. Use gethostname(2) to retrieve it. +.SH OPTIONS +The following options are supported: +.TP +.I "\-\-no\-daemon" +Do not daemonize. This is useful for debugging, and directs log output to the +controlling terminal in addition to syslog. +.TP +.I "\-\-pid\-file=" +Specify location of a PID file. The PID file is used for storing PID of the +running proccess and prevents running multiple instances. +.TP +.I "\-\-state\-file=" +Specify file for storing state of the NetworkManager persistently. If not specified, +the default value of '/lib/NetworkManager/NetworkManager.state' is +used; where is dependent on your distribution (usually it's /var). +.TP +.I "\-\-config=" +Specify configuration file to set up various settings for NetworkManager. If not +specified, the default value of '/NetworkManager/NetworkManager.conf' +is used with a fallback to the older 'nm\-system\-settings.conf' if located in +the same directory; where is dependent on your distribution (usually +it's /etc). See \fBNetworkManager.conf\fP(5) for more information on configuration +file. +.TP +.I "\-\-plugins=,, ... +List plugins used to manage system-wide connection settings. This list has +preference over plugins specified in the configuration file. Currently supported +plugins are: keyfile, ifcfg\-rh, ifcfg\-suse, ifupdown. +See \fBNetworkManager.conf\fP(5) for more information on the plugins. +.TP +.I "\-\-log\-level= +Sets how much information NetworkManager sends to the log destination (usually +syslog's "daemon" facility). By default, only informational, warning, and error +messages are logged. See \fBNetworkManager.conf\fP(5) for more information on +log levels and domains. +.TP +.I "\-\-log\-domains=,, ... +Sets which operations are logged to the log destination (usually syslog). By +default, most domains are logging-enabled. See \fBNetworkManager.conf\fP(5) for +more information on log levels and domains. +.SH DEBUGGING +The following environment variables are supported to help debugging. When used +in conjunction with the "\-\-no\-daemon" option (thus echoing PPP and DHCP helper +output to stdout) these can quickly help pinpoint the source of connection +issues. Also see the \-\-log\-level and \-\-log\-domains to enable debug logging inside +NetworkManager itself. +.TP +.I "NM_PPP_DEBUG" +When set to anything, causes NetworkManager to turn on PPP debugging in pppd, +which logs all PPP and PPTP frames and client/server exchanges. +.SH SEE ALSO +.BR nm\-tool (1), +.BR NetworkManager.conf (5). + diff --git a/man/NetworkManager.8.in b/man/NetworkManager.8.in new file mode 100644 index 00000000..a6be0731 --- /dev/null +++ b/man/NetworkManager.8.in @@ -0,0 +1,108 @@ +.\" NetworkManager(8) manual page +.\" +.\" Copyright (C) 2005 - 2010 Red Hat, Inc. +.\" Copyright (C) 2005 - 2009 Novell, Inc. +.\" Copyright (C) 2005 Robert Love +.\" +.TH NETWORKMANAGER "8" "January 29, 2010" +.SH NAME +NetworkManager \- network management daemon +.SH SYNOPSIS +.B NetworkManager [\-\-no\-daemon] [\-\-pid\-file=] [\-\-state\-file=] [\-\-config=] [\-\-plugins=,plugin2>,...] [\-\-log\-level=] [\-\-log\-domains=,,...] +.SH DESCRIPTION +The \fINetworkManager\fP daemon attempts to make networking configuration and +operation as painless and automatic as possible by managing the primary network +connection and other network interfaces, like Ethernet, WiFi, and Mobile +Broadband devices. NetworkManager will connect any network device when a +connection for that device becomes available, unless that behavior is disabled. +Information about networking is exported via a D-Bus interface to any interested +application, providing a rich API with which to inspect and control network +settings and operation. +.P +NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher.d +directory in alphabetical order in response to network events. Each script +should be (a) a regular file, (b) owned by root, (c) not writable by group or +other, (d) not set-uid, (e) and executable by the owner. Each script receives +two arguments, the first being the interface name of the device just activated, +and second an action. +.TP +.I "up" +The interface has been activated. The environment contains more information +about the interface; CONNECTION_UUID contains the UUID of the connection. Other +variables are IP4_ADDRESS_N where N is a number from 0 to (# IPv4 addresses \- 1), +in the format "address/prefix gateway". IP4_NUM_ADDRESSES contains the number +addresses the script may expect. IP4_NAMESERVERS contains a space-separated +list of the DNS servers, and IP4_DOMAINS contains a space-separated list of the +search domains. Routes use the format IP4_ROUTE_N where N is a number from 0 +to (# IPv4 routes \- 1), in the format "address/prefix next-hop metric", and +IP4_NUM_ROUTES contains the number of routes to expect. If the connection used +DHCP for address configuration, the received DHCP configuration is passed in the +environment using standard DHCP option names, prefixed with "DHCP4_", like +"DHCP4_HOST_NAME=foobar". +.TP +.I "down" +The interface has been deactivated. +.TP +.I "vpn\-up" +A VPN connection has been activated. The environment contains the connection +UUID in the variable CONNECTION_UUID. +.TP +.I "vpn\-down" +A VPN connection has been deactivated. +.TP +.I "hostname" +The system hostname has been updated. Use gethostname(2) to retrieve it. +.SH OPTIONS +The following options are supported: +.TP +.I "\-\-no\-daemon" +Do not daemonize. This is useful for debugging, and directs log output to the +controlling terminal in addition to syslog. +.TP +.I "\-\-pid\-file=" +Specify location of a PID file. The PID file is used for storing PID of the +running proccess and prevents running multiple instances. +.TP +.I "\-\-state\-file=" +Specify file for storing state of the NetworkManager persistently. If not specified, +the default value of '/lib/NetworkManager/NetworkManager.state' is +used; where is dependent on your distribution (usually it's /var). +.TP +.I "\-\-config=" +Specify configuration file to set up various settings for NetworkManager. If not +specified, the default value of '/NetworkManager/NetworkManager.conf' +is used with a fallback to the older 'nm\-system\-settings.conf' if located in +the same directory; where is dependent on your distribution (usually +it's /etc). See \fBNetworkManager.conf\fP(5) for more information on configuration +file. +.TP +.I "\-\-plugins=,, ... +List plugins used to manage system-wide connection settings. This list has +preference over plugins specified in the configuration file. Currently supported +plugins are: keyfile, ifcfg\-rh, ifcfg\-suse, ifupdown. +See \fBNetworkManager.conf\fP(5) for more information on the plugins. +.TP +.I "\-\-log\-level= +Sets how much information NetworkManager sends to the log destination (usually +syslog's "daemon" facility). By default, only informational, warning, and error +messages are logged. See \fBNetworkManager.conf\fP(5) for more information on +log levels and domains. +.TP +.I "\-\-log\-domains=,, ... +Sets which operations are logged to the log destination (usually syslog). By +default, most domains are logging-enabled. See \fBNetworkManager.conf\fP(5) for +more information on log levels and domains. +.SH DEBUGGING +The following environment variables are supported to help debugging. When used +in conjunction with the "\-\-no\-daemon" option (thus echoing PPP and DHCP helper +output to stdout) these can quickly help pinpoint the source of connection +issues. Also see the \-\-log\-level and \-\-log\-domains to enable debug logging inside +NetworkManager itself. +.TP +.I "NM_PPP_DEBUG" +When set to anything, causes NetworkManager to turn on PPP debugging in pppd, +which logs all PPP and PPTP frames and client/server exchanges. +.SH SEE ALSO +.BR nm\-tool (1), +.BR NetworkManager.conf (5). + diff --git a/man/NetworkManager.conf.5 b/man/NetworkManager.conf.5 new file mode 100644 index 00000000..c3af6116 --- /dev/null +++ b/man/NetworkManager.conf.5 @@ -0,0 +1,139 @@ +.\" NetworkManager.conf(5) manual page +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH "NetworkManager.conf" "5" "1 February 2010" "" +.SH NAME +NetworkManager.conf \- NetworkManager configuration file +.SH SYNOPSIS +/etc/NetworkManager/NetworkManager.conf +.br +or +.br +\fI\fP/NetworkManager/NetworkManager.conf +.br +where depends on your distribution or build. +.SH DESCRIPTION +.P +.I NetworkManager.conf +is a configuration file for NetworkManager. It is used to set up various +aspects of NetworkManager's behavior. The location of +the file may be changed through use of the "\-\-config=" argument for +\fBNetworkManager\fP (8). + +It is not necessary to restart NetworkManager when making changes, as the +configuration file is watched for changes and reloaded automatically when necessary. +.SH "FILE FORMAT" +.P +The configuration file format is so-called key file (sort of ini-style format). +It consists of sections (groups) of key-value pairs. Lines beginning with a '#' and blank +lines are considered comments. Sections are started by a header line containing +the section enclosed in '[' and ']', and ended implicitly by the start of +the next section or the end of the file. Each key-value pair must be contained +in a section. +.br +Minimal system settings configuration file looks like this: +.P +.nf +[main] +plugins=keyfile +.fi +.P +Description of sections and available keys follows: +.SS [main] +This section is the only mandatory section of the configuration file. +.TP +.B plugins=\fIplugin1\fP,\fIplugin2\fP, ... +List plugin names separated by ','. Plugins are used to read/write system-wide +connection. When more plugins are specified, the connections are read from all +listed plugins. When writing connections, the plugins will be asked to save the +connection in the order listed here. If the first plugin cannot write out that +connection type, or can't write out any connections, the next plugin is tried. +If none of the plugins can save the connection, the error is returned to the user. +.P +.RS +.B "Available plugins:" +.br +.TP +.I keyfile +plugin is the generic plugin that supports all the connection types and +capabilities that NetworkManager has. It writes files out in a .ini-style format in +/etc/NetworkManager/system-connections. For security, it will ignore files +that are readable or writeable by any user or group other than +.I root +since private keys and passphrases may be stored in plaintext inside the file. +.TP +.I ifcfg\-rh +plugin is used on the Fedora and Red Hat Enterprise Linux distributions +to read and write configuration from the standard /etc/sysconfig/network-scripts/ifcfg-* files. +It currently supports reading wired, WiFi, and 802.1x connections, but does not yet support reading +or writing mobile broadband, PPPoE, or VPN connections. To allow reading and writing of these +add \fIkeyfile\fP plugin to your configuration as well. +.TP +.I ifupdown +plugin is used on the Debian and Ubuntu distributions, and reads connections from +/etc/network/interfaces. Since it cannot write connections out (that support isn't planned), +it is usually paired with the \fIkeyfile\fP plugin to enable saving and editing of new connections. +The \fIifupdown\fP plugin supports basic wired and WiFi connections, including WPA-PSK. +.TP +.I ifcfg\-suse +plugin is only provided for simple backward compatibility with SUSE and OpenSUSE configuration. +Most setups should be using the \fIkeyfile\fP plugin instead. The \fIifcfg\-suse\fP plugin supports +reading wired and WiFi connections, but does not support saving any connection types. +.RE +.TP +.B dhcp=\fIdhclient\fP | \fIdhcpcd\fP +This key sets up what DHCP client NetworkManager will use. Presently +\fIdhclient\fP and \fIdhcpcd\fP 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. +.SS [keyfile] +This section contains keyfile-specific options and thus only has effect when using \fIkeyfile\fP plugin. +.TP +.B hostname=\fI\fP +Set a persistent hostname when using the \fIkeyfile\fP plugin. +.TP +.B unmanaged-devices=\fImac:\fP;\fImac:\fP;... +Set devices that should be ignored by NetworkManager when using the \fIkeyfile\fP +plugin. Devices are specified in the following format: "mac:", where + is MAC address of the device to be ignored, in lowercase. Multiple +entries are separated by a semicolon. Example: +.nf +unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1e:65:30:d1:c4 +.fi +.SS [ifupdown] +This section contains ifupdown-specific options and thus only has effect when using \fIifupdown\fP plugin. +.TP +.B managed=\fIfalse\fP | \fItrue\fP +Controls whether interfaces listed in the 'interfaces' file are managed by NetworkManager. +If set to \fItrue\fP, then interfaces listed in /etc/network/interfaces are managed by NetworkManager. +If set to \fIfalse\fP, then any interface listed in /etc/network/interfaces will be +ignored by NetworkManager. Remember that NetworkManager controls the default route, +so because the interface is ignored, NetworkManager may assign the default route to +some other interface. +When the option is missing, \fIfalse\fP value is taken as default. +.SS [logging] +This section controls NetworkManager's logging. Any settings here are +overridden by the \-\-log\-level and \-\-log\-domains command-line options. +.TP +.B level=\fI\fP +One of [ERR, WARN, INFO, DEBUG]. The ERR level logs only critical errors. WARN +logs warnings that may reflect operation. INFO logs various informational +messages that are useful for tracking state and operations. DEBUG enables +verbose logging for debugging purposes. Subsequent levels also log all messages +from earlier levels; thus setting the log level to INFO also logs error and +warning messages. +.TP +.B domains=\fI,, ...\fP +The following log domains are available: [NONE, HW, RKILL, ETHER, WIFI, BT, MB, +DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT, +USER_SET, SYS_SET, SUSPEND, CORE, DEVICE, OLPC]. When "NONE" is given by itself, +logging is disabled. MB = Mobile Broadband, USER_SET = user settings operations +and communication, SYS_SET = system settings service operations, OLPC = OLPC +Mesh device operations, CORE = core daemon operations, DEVICE = activation and +general interface operations. +.SH "SEE ALSO" +.BR http://live.gnome.org/NetworkManager/SystemSettings +.sp +.BR NetworkManager (8), +.BR nm\-tool (1). diff --git a/man/NetworkManager.conf.5.in b/man/NetworkManager.conf.5.in new file mode 100644 index 00000000..c3af6116 --- /dev/null +++ b/man/NetworkManager.conf.5.in @@ -0,0 +1,139 @@ +.\" NetworkManager.conf(5) manual page +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH "NetworkManager.conf" "5" "1 February 2010" "" +.SH NAME +NetworkManager.conf \- NetworkManager configuration file +.SH SYNOPSIS +/etc/NetworkManager/NetworkManager.conf +.br +or +.br +\fI\fP/NetworkManager/NetworkManager.conf +.br +where depends on your distribution or build. +.SH DESCRIPTION +.P +.I NetworkManager.conf +is a configuration file for NetworkManager. It is used to set up various +aspects of NetworkManager's behavior. The location of +the file may be changed through use of the "\-\-config=" argument for +\fBNetworkManager\fP (8). + +It is not necessary to restart NetworkManager when making changes, as the +configuration file is watched for changes and reloaded automatically when necessary. +.SH "FILE FORMAT" +.P +The configuration file format is so-called key file (sort of ini-style format). +It consists of sections (groups) of key-value pairs. Lines beginning with a '#' and blank +lines are considered comments. Sections are started by a header line containing +the section enclosed in '[' and ']', and ended implicitly by the start of +the next section or the end of the file. Each key-value pair must be contained +in a section. +.br +Minimal system settings configuration file looks like this: +.P +.nf +[main] +plugins=keyfile +.fi +.P +Description of sections and available keys follows: +.SS [main] +This section is the only mandatory section of the configuration file. +.TP +.B plugins=\fIplugin1\fP,\fIplugin2\fP, ... +List plugin names separated by ','. Plugins are used to read/write system-wide +connection. When more plugins are specified, the connections are read from all +listed plugins. When writing connections, the plugins will be asked to save the +connection in the order listed here. If the first plugin cannot write out that +connection type, or can't write out any connections, the next plugin is tried. +If none of the plugins can save the connection, the error is returned to the user. +.P +.RS +.B "Available plugins:" +.br +.TP +.I keyfile +plugin is the generic plugin that supports all the connection types and +capabilities that NetworkManager has. It writes files out in a .ini-style format in +/etc/NetworkManager/system-connections. For security, it will ignore files +that are readable or writeable by any user or group other than +.I root +since private keys and passphrases may be stored in plaintext inside the file. +.TP +.I ifcfg\-rh +plugin is used on the Fedora and Red Hat Enterprise Linux distributions +to read and write configuration from the standard /etc/sysconfig/network-scripts/ifcfg-* files. +It currently supports reading wired, WiFi, and 802.1x connections, but does not yet support reading +or writing mobile broadband, PPPoE, or VPN connections. To allow reading and writing of these +add \fIkeyfile\fP plugin to your configuration as well. +.TP +.I ifupdown +plugin is used on the Debian and Ubuntu distributions, and reads connections from +/etc/network/interfaces. Since it cannot write connections out (that support isn't planned), +it is usually paired with the \fIkeyfile\fP plugin to enable saving and editing of new connections. +The \fIifupdown\fP plugin supports basic wired and WiFi connections, including WPA-PSK. +.TP +.I ifcfg\-suse +plugin is only provided for simple backward compatibility with SUSE and OpenSUSE configuration. +Most setups should be using the \fIkeyfile\fP plugin instead. The \fIifcfg\-suse\fP plugin supports +reading wired and WiFi connections, but does not support saving any connection types. +.RE +.TP +.B dhcp=\fIdhclient\fP | \fIdhcpcd\fP +This key sets up what DHCP client NetworkManager will use. Presently +\fIdhclient\fP and \fIdhcpcd\fP 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. +.SS [keyfile] +This section contains keyfile-specific options and thus only has effect when using \fIkeyfile\fP plugin. +.TP +.B hostname=\fI\fP +Set a persistent hostname when using the \fIkeyfile\fP plugin. +.TP +.B unmanaged-devices=\fImac:\fP;\fImac:\fP;... +Set devices that should be ignored by NetworkManager when using the \fIkeyfile\fP +plugin. Devices are specified in the following format: "mac:", where + is MAC address of the device to be ignored, in lowercase. Multiple +entries are separated by a semicolon. Example: +.nf +unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1e:65:30:d1:c4 +.fi +.SS [ifupdown] +This section contains ifupdown-specific options and thus only has effect when using \fIifupdown\fP plugin. +.TP +.B managed=\fIfalse\fP | \fItrue\fP +Controls whether interfaces listed in the 'interfaces' file are managed by NetworkManager. +If set to \fItrue\fP, then interfaces listed in /etc/network/interfaces are managed by NetworkManager. +If set to \fIfalse\fP, then any interface listed in /etc/network/interfaces will be +ignored by NetworkManager. Remember that NetworkManager controls the default route, +so because the interface is ignored, NetworkManager may assign the default route to +some other interface. +When the option is missing, \fIfalse\fP value is taken as default. +.SS [logging] +This section controls NetworkManager's logging. Any settings here are +overridden by the \-\-log\-level and \-\-log\-domains command-line options. +.TP +.B level=\fI\fP +One of [ERR, WARN, INFO, DEBUG]. The ERR level logs only critical errors. WARN +logs warnings that may reflect operation. INFO logs various informational +messages that are useful for tracking state and operations. DEBUG enables +verbose logging for debugging purposes. Subsequent levels also log all messages +from earlier levels; thus setting the log level to INFO also logs error and +warning messages. +.TP +.B domains=\fI,, ...\fP +The following log domains are available: [NONE, HW, RKILL, ETHER, WIFI, BT, MB, +DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT, +USER_SET, SYS_SET, SUSPEND, CORE, DEVICE, OLPC]. When "NONE" is given by itself, +logging is disabled. MB = Mobile Broadband, USER_SET = user settings operations +and communication, SYS_SET = system settings service operations, OLPC = OLPC +Mesh device operations, CORE = core daemon operations, DEVICE = activation and +general interface operations. +.SH "SEE ALSO" +.BR http://live.gnome.org/NetworkManager/SystemSettings +.sp +.BR NetworkManager (8), +.BR nm\-tool (1). diff --git a/man/nm-system-settings.conf.5 b/man/nm-system-settings.conf.5 new file mode 100644 index 00000000..e48d0c8e --- /dev/null +++ b/man/nm-system-settings.conf.5 @@ -0,0 +1,26 @@ +.\" nm-system-settings.conf(5) manual page +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH "nm-system-settings.conf" "5" "1 February 2010" "" +.SH NAME +nm\-system\-settings.conf \- Deprecated NetworkManager configuration file +.SH SYNOPSIS +/etc/NetworkManager/nm\-system\-settings.conf +.br +or +.br +\fI\fP/NetworkManager/nm\-system\-settings.conf +.br +where depends on your distribution or build. +.SH DESCRIPTION +.P +.I nm\-system\-settings.conf +is a deprecated configuration file for \fBNetworkManager\fP (5). While this +file can still be used, NetworkManager now defaults to reading the config +file \fP/NetworkManager/NetworkManager.conf\fP instead, falling back +to nm\-system\-settings.conf if NetworkManager.conf does not exist. +.SH "SEE ALSO" +.BR NetworkManager (8), +.BR NetworkManager.conf (5), +.BR nm\-tool (1). diff --git a/man/nm-system-settings.conf.5.in b/man/nm-system-settings.conf.5.in new file mode 100644 index 00000000..e48d0c8e --- /dev/null +++ b/man/nm-system-settings.conf.5.in @@ -0,0 +1,26 @@ +.\" nm-system-settings.conf(5) manual page +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH "nm-system-settings.conf" "5" "1 February 2010" "" +.SH NAME +nm\-system\-settings.conf \- Deprecated NetworkManager configuration file +.SH SYNOPSIS +/etc/NetworkManager/nm\-system\-settings.conf +.br +or +.br +\fI\fP/NetworkManager/nm\-system\-settings.conf +.br +where depends on your distribution or build. +.SH DESCRIPTION +.P +.I nm\-system\-settings.conf +is a deprecated configuration file for \fBNetworkManager\fP (5). While this +file can still be used, NetworkManager now defaults to reading the config +file \fP/NetworkManager/NetworkManager.conf\fP instead, falling back +to nm\-system\-settings.conf if NetworkManager.conf does not exist. +.SH "SEE ALSO" +.BR NetworkManager (8), +.BR NetworkManager.conf (5), +.BR nm\-tool (1). diff --git a/man/nm-tool.1 b/man/nm-tool.1 new file mode 100644 index 00000000..168a5dc5 --- /dev/null +++ b/man/nm-tool.1 @@ -0,0 +1,17 @@ +.\" nm-tool(1) manual page +.\" +.\" Copyright (C) 2005 - 2009 Red Hat, Inc. +.\" Copyright (C) 2005 - 2009 Novell, Inc. +.\" Copyright (C) 2005 Robert Love +.\" +.TH NM-TOOL "1" +.SH NAME +nm-tool \- utility to report NetworkManager state and devices +.SH SYNOPSIS +.B nm-tool +.SH DESCRIPTION +The \fInm-tool\fP utility provides information about NetworkManager, device, +and wireless networks. +.SH SEE ALSO +.BR NetworkManager (8), + diff --git a/man/nm-tool.1.in b/man/nm-tool.1.in new file mode 100644 index 00000000..168a5dc5 --- /dev/null +++ b/man/nm-tool.1.in @@ -0,0 +1,17 @@ +.\" nm-tool(1) manual page +.\" +.\" Copyright (C) 2005 - 2009 Red Hat, Inc. +.\" Copyright (C) 2005 - 2009 Novell, Inc. +.\" Copyright (C) 2005 Robert Love +.\" +.TH NM-TOOL "1" +.SH NAME +nm-tool \- utility to report NetworkManager state and devices +.SH SYNOPSIS +.B nm-tool +.SH DESCRIPTION +The \fInm-tool\fP utility provides information about NetworkManager, device, +and wireless networks. +.SH SEE ALSO +.BR NetworkManager (8), + diff --git a/man/nmcli.1 b/man/nmcli.1 new file mode 100644 index 00000000..056b5bdd --- /dev/null +++ b/man/nmcli.1 @@ -0,0 +1,321 @@ +.\" nmcli (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 +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH NMCLI "1" "14 April 2010" + +.SH NAME +nmcli \- command-line tool for controlling NetworkManager +.SH SYNOPSIS +.ad l +.B nmcli +.RI " [ " OPTIONS " ] " OBJECT " { " COMMAND " | " +.BR help " } " +.sp + +.IR OBJECT " := { " +.BR nm " | " con " | " dev " } " +.sp + +.IR OPTIONS " := { " +.br +\fB\-t\fR[\fIerse\fR] +.br +\fB\-p\fR[\fIretty\fR] +.br +\fB\-m\fR[\fImode\fR] tabular | multiline +.br +\fB\-f\fR[\fIields\fR] | all | common +.br +\fB\-e\fR[\fIscape\fR] yes | no +.br +\fB\-v\fR[\fIersion\fR] +.br +\fB\-h\fR[\fIelp\fR] +.br +.RI "}" + +.SH DESCRIPTION +.B nmcli +is a command-line tool for controlling NetworkManager and getting its status. +It is not meant as a replacement of \fInm-applet\fP or other similar clients. +Rather it's a complementary utility to these programs. +The main \fInmcli\fP's usage is on servers, headless machines or just for +power users who prefer the command line. +.P +The use cases comprise: +.IP \(em 4 +Initscripts: ifup/ifdown can utilize NetworkManager via \fInmcli\fP instead of +having to manage connections itself and possible interfere with NetworkManager. +.IP \(em 4 +Servers, headless machines: No GUI is available; then \fInmcli\fP is used to +talk directly to NetworkManager and control only system-wide connections. +.IP \(em 4 +User sessions: For this case, \fInmcli\fP can talk to \fInm-applet\fP to find +user connections. It can still talk directly to NetworkManager for manipulating +these connections. As \fInmcli\fP doesn't have direct access to user +configuration data in GConf, \fInm-applet\fP handles that itself. That may, +for example, cause the applet to pop up keyring dialogs when secrets are needed. +.SS \fIOPTIONS\fP +.TP +.B \-t, \-\-terse +Output is terse. This mode is designed and suitable for computer (script) +processing. +.TP +.B \-p, \-\-pretty +Output is pretty. This causes \fInmcli\fP to produce easy readable outputs +for humans, i.e. values are aligned, headers are printed, etc. +.TP +.B \-m, \-\-mode tabular | multiline +Switch between \fItabular\fP and \fImultiline\fP output. +If omitted, default is \fItabular\fP for most commands. For the commands +producing more structured information, that cannot be displayed on a single +line, default is \fImultiline\fP. Currenly, they are: +.br +.nf + 'nmcli con list id|uuid ' + 'nmcli dev list' +.fi +\fItabular\fP - Output is a table where each line describes a single entry. +Columns define particular properties of the entry. +.br +\fImultiline\fP - Each entry comprises more lines, each property on its own line. +The values are prefixed with the property name. +.TP +.B \-f, \-\-fields | all | common +This option is used to specify what fields (column names) should be printed. +Valid field names differ for specific commands. List available fields by +providing an invalid value to the \fI--fields\fP option. +.br +\fIall\fP is used to print all valid field values of the command. +\fIcommon\fP is used to print common field values of the command. +If omitted, default is \fIcommon\fP. +The option is mandatory when \fI--terse\fP is used. In this case, generic +values \fIall\fP and \fIcommon\fP cannot be used. (This is to maintain +compatibility when new fields are added in the future). +.TP +.B \-e, \-\-escape yes | no +Whether to escape ':' and '\\' characters in terse tabular mode. The escape +character is '\\'. +If omitted, default is \fIyes\fP. +.TP +.B \-v, \-\-version +Show \fInmcli\fP version. +.TP +.B \-h, \-\-help +Print help information. +.SS \fIOBJECT\fP +.TP +.B nm +NetworkManager +.br +Use this object to inquire and change state of NetworkManager. +.TP +.SS \fICOMMAND\fP := { status | sleep | wakeup | wifi | wwan } +.sp +.RS +.TP +.B status +.br +Show overall status of NetworkManager. This is the default action, when no +command is provided to \fInm\fP object. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B sleep +.br +Put NetworkManager to sleeping mode. Thus all interfaces that NetworkManager +manages are deactivated. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: Sleep +arguments: TRUE +.fi +.TP +.B wakeup +.br +Awake NetworkManager from sleep. When NetworkManager is awaken, devices are +available to be activated. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: Sleep +arguments: FALSE +.fi +.TP +.B wifi [on|off] +.br +Inquire or set status of WiFi in NetworkManager. Without any further argument, +WiFi status is printed; \fIon\fP enables WiFi; \fIoff\fP disables WiFi. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B wwan [on|off] +.br +Inquire or set status of WWAN in NetworkManager. Without any further argument, +WWAN status is printed; \fIon\fP enables WWAN; \fIoff\fP disables WWAN. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.RE + +.TP +.B con +Connections +.br +Get information about NetworkManager's connections. +.TP +.SS \fICOMMAND\fP := { list | status | up | down } +.sp +.RS +.TP +.B list [id | uuid | system | user] +.br +List configured connections. Without a parameter, configured connection from +both system and user settings services are listed. \fIsystem\fP argument filters +only system-wide connections, \fIuser\fP prints user connections only. +In order to get connection details, \fIid\fP with connection's name or \fIuuid\fP +with connection's UUID shall be specified. +When no command is given to \fIcon\fP object, the default action is 'nmcli con list'. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B status +.br +Print status of active connections. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B up id | uuid [iface ] [ap ] [\-\-nowait] [\-\-timeout ] +.br +Activate a connection. The connection is identified by its name using \fIid\fP +or UUID using \fIuuid\fP. For requiring particular device to activate +the connection on, \fIiface\fP option with interface name should be given. +\fIap\fP option can further concretize what AP should be used in case of WiFi +connection. \fI\-\-nowait\fP option causes \fInmcli\fP to exit immediately and +not to wait for command completion. \fI\-\-timeout\fP option provides a means +to specify how long to wait for operation completion. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: ActivateConnection +arguments: according to arguments +.fi +.TP +.B down id | uuid +.br +Deactivate a connection. +The connection is identified by its name using \fIid\fP +or UUID using \fIuuid\fP. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: DeactivateConnection +arguments: according to arguments +.fi +.RE + +.TP +.B dev +Devices +.br +Get information about devices. +.TP +.SS \fICOMMAND\fP := { status | list | disconnect | wifi } +.sp +.RS +.TP +.B status +.br +Print status of devices. This is the default action, when no command +is specified to \fIdev\fP object. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B list [iface ] +.br +Get detailed information about devices. Without an argument, all devices are +examined. To get information for a specific device, \fIiface\fP argument +with the interface name should be provided. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B disconnect iface [\-\-nowait] [\-\-timeout ] +.br +Disconnect a device and prevent the device from automatically activating further +connections without user/manual intervention. \fI\-\-nowait\fP option causes +\fInmcli\fP to exit immediately and not to wait for command completion. +\fI\-\-timeout\fP option provides a means to specify how long to wait for +operation completion. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager.Device +method: Disconnect +arguments: none +.fi +.TP +.B wifi [list [iface ] [hwaddr ]] +.br +List available WiFi access points. \fIiface\fP and \fIhwaddr\fP options +can be used to get just APs for particular interface or specific AP, +respectively. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.RE + +.SH BUGS +There are probably some. If you find a bug, please report to +https://bugzilla.gnome.org/ \- product \fINetworkManager\fP. + +.SH SEE ALSO +.BR nm\-tool (1), +.BR NetworkManager(8). diff --git a/man/nmcli.1.in b/man/nmcli.1.in new file mode 100644 index 00000000..056b5bdd --- /dev/null +++ b/man/nmcli.1.in @@ -0,0 +1,321 @@ +.\" nmcli (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 +.\" License along with this manual; if not, write to the Free +.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, +.\" USA. +.\" +.\" Copyright (C) 2010 Red Hat, Inc. +.\" +.TH NMCLI "1" "14 April 2010" + +.SH NAME +nmcli \- command-line tool for controlling NetworkManager +.SH SYNOPSIS +.ad l +.B nmcli +.RI " [ " OPTIONS " ] " OBJECT " { " COMMAND " | " +.BR help " } " +.sp + +.IR OBJECT " := { " +.BR nm " | " con " | " dev " } " +.sp + +.IR OPTIONS " := { " +.br +\fB\-t\fR[\fIerse\fR] +.br +\fB\-p\fR[\fIretty\fR] +.br +\fB\-m\fR[\fImode\fR] tabular | multiline +.br +\fB\-f\fR[\fIields\fR] | all | common +.br +\fB\-e\fR[\fIscape\fR] yes | no +.br +\fB\-v\fR[\fIersion\fR] +.br +\fB\-h\fR[\fIelp\fR] +.br +.RI "}" + +.SH DESCRIPTION +.B nmcli +is a command-line tool for controlling NetworkManager and getting its status. +It is not meant as a replacement of \fInm-applet\fP or other similar clients. +Rather it's a complementary utility to these programs. +The main \fInmcli\fP's usage is on servers, headless machines or just for +power users who prefer the command line. +.P +The use cases comprise: +.IP \(em 4 +Initscripts: ifup/ifdown can utilize NetworkManager via \fInmcli\fP instead of +having to manage connections itself and possible interfere with NetworkManager. +.IP \(em 4 +Servers, headless machines: No GUI is available; then \fInmcli\fP is used to +talk directly to NetworkManager and control only system-wide connections. +.IP \(em 4 +User sessions: For this case, \fInmcli\fP can talk to \fInm-applet\fP to find +user connections. It can still talk directly to NetworkManager for manipulating +these connections. As \fInmcli\fP doesn't have direct access to user +configuration data in GConf, \fInm-applet\fP handles that itself. That may, +for example, cause the applet to pop up keyring dialogs when secrets are needed. +.SS \fIOPTIONS\fP +.TP +.B \-t, \-\-terse +Output is terse. This mode is designed and suitable for computer (script) +processing. +.TP +.B \-p, \-\-pretty +Output is pretty. This causes \fInmcli\fP to produce easy readable outputs +for humans, i.e. values are aligned, headers are printed, etc. +.TP +.B \-m, \-\-mode tabular | multiline +Switch between \fItabular\fP and \fImultiline\fP output. +If omitted, default is \fItabular\fP for most commands. For the commands +producing more structured information, that cannot be displayed on a single +line, default is \fImultiline\fP. Currenly, they are: +.br +.nf + 'nmcli con list id|uuid ' + 'nmcli dev list' +.fi +\fItabular\fP - Output is a table where each line describes a single entry. +Columns define particular properties of the entry. +.br +\fImultiline\fP - Each entry comprises more lines, each property on its own line. +The values are prefixed with the property name. +.TP +.B \-f, \-\-fields | all | common +This option is used to specify what fields (column names) should be printed. +Valid field names differ for specific commands. List available fields by +providing an invalid value to the \fI--fields\fP option. +.br +\fIall\fP is used to print all valid field values of the command. +\fIcommon\fP is used to print common field values of the command. +If omitted, default is \fIcommon\fP. +The option is mandatory when \fI--terse\fP is used. In this case, generic +values \fIall\fP and \fIcommon\fP cannot be used. (This is to maintain +compatibility when new fields are added in the future). +.TP +.B \-e, \-\-escape yes | no +Whether to escape ':' and '\\' characters in terse tabular mode. The escape +character is '\\'. +If omitted, default is \fIyes\fP. +.TP +.B \-v, \-\-version +Show \fInmcli\fP version. +.TP +.B \-h, \-\-help +Print help information. +.SS \fIOBJECT\fP +.TP +.B nm +NetworkManager +.br +Use this object to inquire and change state of NetworkManager. +.TP +.SS \fICOMMAND\fP := { status | sleep | wakeup | wifi | wwan } +.sp +.RS +.TP +.B status +.br +Show overall status of NetworkManager. This is the default action, when no +command is provided to \fInm\fP object. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B sleep +.br +Put NetworkManager to sleeping mode. Thus all interfaces that NetworkManager +manages are deactivated. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: Sleep +arguments: TRUE +.fi +.TP +.B wakeup +.br +Awake NetworkManager from sleep. When NetworkManager is awaken, devices are +available to be activated. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: Sleep +arguments: FALSE +.fi +.TP +.B wifi [on|off] +.br +Inquire or set status of WiFi in NetworkManager. Without any further argument, +WiFi status is printed; \fIon\fP enables WiFi; \fIoff\fP disables WiFi. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B wwan [on|off] +.br +Inquire or set status of WWAN in NetworkManager. Without any further argument, +WWAN status is printed; \fIon\fP enables WWAN; \fIoff\fP disables WWAN. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.RE + +.TP +.B con +Connections +.br +Get information about NetworkManager's connections. +.TP +.SS \fICOMMAND\fP := { list | status | up | down } +.sp +.RS +.TP +.B list [id | uuid | system | user] +.br +List configured connections. Without a parameter, configured connection from +both system and user settings services are listed. \fIsystem\fP argument filters +only system-wide connections, \fIuser\fP prints user connections only. +In order to get connection details, \fIid\fP with connection's name or \fIuuid\fP +with connection's UUID shall be specified. +When no command is given to \fIcon\fP object, the default action is 'nmcli con list'. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B status +.br +Print status of active connections. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B up id | uuid [iface ] [ap ] [\-\-nowait] [\-\-timeout ] +.br +Activate a connection. The connection is identified by its name using \fIid\fP +or UUID using \fIuuid\fP. For requiring particular device to activate +the connection on, \fIiface\fP option with interface name should be given. +\fIap\fP option can further concretize what AP should be used in case of WiFi +connection. \fI\-\-nowait\fP option causes \fInmcli\fP to exit immediately and +not to wait for command completion. \fI\-\-timeout\fP option provides a means +to specify how long to wait for operation completion. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: ActivateConnection +arguments: according to arguments +.fi +.TP +.B down id | uuid +.br +Deactivate a connection. +The connection is identified by its name using \fIid\fP +or UUID using \fIuuid\fP. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager +method: DeactivateConnection +arguments: according to arguments +.fi +.RE + +.TP +.B dev +Devices +.br +Get information about devices. +.TP +.SS \fICOMMAND\fP := { status | list | disconnect | wifi } +.sp +.RS +.TP +.B status +.br +Print status of devices. This is the default action, when no command +is specified to \fIdev\fP object. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B list [iface ] +.br +Get detailed information about devices. Without an argument, all devices are +examined. To get information for a specific device, \fIiface\fP argument +with the interface name should be provided. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.TP +.B disconnect iface [\-\-nowait] [\-\-timeout ] +.br +Disconnect a device and prevent the device from automatically activating further +connections without user/manual intervention. \fI\-\-nowait\fP option causes +\fInmcli\fP to exit immediately and not to wait for command completion. +\fI\-\-timeout\fP option provides a means to specify how long to wait for +operation completion. +.br +.nf +\fBReference to D-Bus:\fP +interface: org.freedesktop.NetworkManager.Device +method: Disconnect +arguments: none +.fi +.TP +.B wifi [list [iface ] [hwaddr ]] +.br +List available WiFi access points. \fIiface\fP and \fIhwaddr\fP options +can be used to get just APs for particular interface or specific AP, +respectively. +.br +.nf +\fBReference to D-Bus:\fP +No simple reference. +.fi +.RE + +.SH BUGS +There are probably some. If you find a bug, please report to +https://bugzilla.gnome.org/ \- product \fINetworkManager\fP. + +.SH SEE ALSO +.BR nm\-tool (1), +.BR NetworkManager(8). diff --git a/marshallers/Makefile.am b/marshallers/Makefile.am new file mode 100644 index 00000000..357029dd --- /dev/null +++ b/marshallers/Makefile.am @@ -0,0 +1,27 @@ +noinst_LTLIBRARIES = libmarshallers.la + +BUILT_SOURCES = \ + nm-marshal.h \ + nm-marshal.c + +libmarshallers_la_SOURCES = \ + nm-marshal-main.c + +libmarshallers_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED + + +libmarshallers_la_LIBADD = $(GLIB_LIBS) + +EXTRA_DIST = nm-marshal.list +CLEANFILES = $(BUILT_SOURCES) + +nm-marshal.h: nm-marshal.list + $(GLIB_GENMARSHAL) $< --prefix=_nm_marshal --header > $@ + +nm-marshal.c: nm-marshal.list + $(GLIB_GENMARSHAL) $< --prefix=_nm_marshal --body > $@ + +nm-marshal-main.c: nm-marshal.c nm-marshal.h + diff --git a/marshallers/Makefile.in b/marshallers/Makefile.in new file mode 100644 index 00000000..4f05cda9 --- /dev/null +++ b/marshallers/Makefile.in @@ -0,0 +1,570 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = marshallers +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libmarshallers_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libmarshallers_la_OBJECTS = libmarshallers_la-nm-marshal-main.lo +libmarshallers_la_OBJECTS = $(am_libmarshallers_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libmarshallers_la_SOURCES) +DIST_SOURCES = $(libmarshallers_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libmarshallers.la +BUILT_SOURCES = \ + nm-marshal.h \ + nm-marshal.c + +libmarshallers_la_SOURCES = \ + nm-marshal-main.c + +libmarshallers_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED + +libmarshallers_la_LIBADD = $(GLIB_LIBS) +EXTRA_DIST = nm-marshal.list +CLEANFILES = $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu marshallers/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu marshallers/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmarshallers.la: $(libmarshallers_la_OBJECTS) $(libmarshallers_la_DEPENDENCIES) + $(LINK) $(libmarshallers_la_OBJECTS) $(libmarshallers_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmarshallers_la-nm-marshal-main.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libmarshallers_la-nm-marshal-main.lo: nm-marshal-main.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmarshallers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmarshallers_la-nm-marshal-main.lo -MD -MP -MF $(DEPDIR)/libmarshallers_la-nm-marshal-main.Tpo -c -o libmarshallers_la-nm-marshal-main.lo `test -f 'nm-marshal-main.c' || echo '$(srcdir)/'`nm-marshal-main.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmarshallers_la-nm-marshal-main.Tpo $(DEPDIR)/libmarshallers_la-nm-marshal-main.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-marshal-main.c' object='libmarshallers_la-nm-marshal-main.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmarshallers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmarshallers_la-nm-marshal-main.lo `test -f 'nm-marshal-main.c' || echo '$(srcdir)/'`nm-marshal-main.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +nm-marshal.h: nm-marshal.list + $(GLIB_GENMARSHAL) $< --prefix=_nm_marshal --header > $@ + +nm-marshal.c: nm-marshal.list + $(GLIB_GENMARSHAL) $< --prefix=_nm_marshal --body > $@ + +nm-marshal-main.c: nm-marshal.c nm-marshal.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/marshallers/nm-marshal-main.c b/marshallers/nm-marshal-main.c new file mode 100644 index 00000000..7c209139 --- /dev/null +++ b/marshallers/nm-marshal-main.c @@ -0,0 +1,2 @@ +#include "nm-marshal.h" +#include "nm-marshal.c" diff --git a/marshallers/nm-marshal.list b/marshallers/nm-marshal.list new file mode 100644 index 00000000..359fbed2 --- /dev/null +++ b/marshallers/nm-marshal.list @@ -0,0 +1,29 @@ +VOID:OBJECT +VOID:OBJECT,STRING +VOID:OBJECT,STRING,UINT +VOID:OBJECT,UINT +VOID:OBJECT,POINTER +VOID:OBJECT,POINTER,UINT +VOID:POINTER +VOID:STRING,STRING,STRING +VOID:UINT,UINT +VOID:UINT,UINT,UINT +VOID:STRING,STRING +VOID:STRING,UCHAR +VOID:STRING,OBJECT +VOID:POINTER,POINTER +VOID:STRING,STRING,STRING,UINT +VOID:OBJECT,UINT,UINT +VOID:STRING,INT +VOID:INT,UINT +VOID:INT,UINT,BOOLEAN +VOID:OBJECT,OBJECT,ENUM +VOID:POINTER,STRING +VOID:STRING,BOXED +BOOLEAN:POINTER,STRING,BOOLEAN,UINT,STRING,STRING +VOID:STRING,BOOLEAN,UINT,STRING,STRING +BOOLEAN:VOID +VOID:STRING,BOOLEAN +VOID:STRING,OBJECT,POINTER +VOID:BOOLEAN,UINT + diff --git a/missing b/missing new file mode 100755 index 00000000..28055d2a --- /dev/null +++ b/missing @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/po/ChangeLog b/po/ChangeLog new file mode 100644 index 00000000..ab722de8 --- /dev/null +++ b/po/ChangeLog @@ -0,0 +1,2146 @@ +2009-03-12 Gintautas Miliauskas + + * lt.po: Updated Lithuanian translation. + +2008-12-07 Simos Xenitellis + + * el.po: Updated Greek translation by Evgenia Petoumenou. + +2008-11-29 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2008-11-27 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2008-11-26 Manoj Kumar Giri + + * or.po: Updated Oriya Translation + +2008-11-26 Manoj Kumar Giri + + * or.po: Updated Oriya Translation + +2008-11-22 Mario Blättermann + + * de.po: Updated German translation by Hauke Mehrtens. + +2008-11-19 Tomasz Dominikowski + + * pl.po: Updated Polish translation + +2008-10-14 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-11-01 Dan Williams + + * de.po: Updated German translation (Hauke Mehrtens, bgo #557458) + +2008-10-22 Og Maciel + + * pt_BR.po: Updated Brazilian Portuguese translation by + Fabricio Godoy and Vladimir Melo. + +2008-10-18 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2008-10-11 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-10-07 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2008-10-06 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2008-10-01 Priit Laes + + * et.po: Translation updated by Mattias Põldaru + +2008-09-25 Claude Paroz + + * fr.po: Updated French translation. + +2008-09-25 Gabor Kelemen + + * hu.po: Translation updated. + +2008-09-25 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2008-09-21 Leonardo Ferreira Fontenelle + + * pt_BR.po: Updated Brazilian Portuguese translation by Henrique P. + Machado. + +2008-09-20 Luca Ferretti + + * it.po: Updated Italian translation by Francesco Marletta. + +2008-09-17 Petr Kovar + + * cs.po: Updated Czech translation by Jiri Eischmann. + +2008-09-15 Wouter Bolsterlee + + * nl.po: Updated Dutch translation by Tino Meinen. + +2008-09-12 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2008-09-10 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-09-09 Inaki Larranaga Murgoitio + + * eu.po: Updated Basque translation. + +2008-09-08 Tomasz Dominikowski + + * pl.po: Updated Polish translation + +2008-08-22 Chao-Hsiung Liao + + * zh_HK.po: Updated Traditional Chinese translation(Hong Kong). + * zh_TW.po: Updated Traditional Chinese translation(Taiwan). + +2008-08-19 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-08-19 Tomasz Dominikowski + + * pl.po: Updated Polish translation + +2008-08-14 Claude Paroz + + * fr.po: Updated French translation by Robert-André Mauchin. + +2008-08-14 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2008-08-09 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2008-08-02 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Alexander Shopov + +2008-08-01 Og Maciel + + * pt_BR.po: Updated Brazilian Portuguese translation by + Henrique P Machado + +2008-07-31 Djihed Afifi + + * ar.po: Updated Arabic Translation by Djihed Afifi. + +2008-07-31 Djihed Afifi + + * ar.po: Updated Arabic Translation by Djihed Afifi. + +2008-07-27 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Alexander Shopov + +2008-07-25 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2008-07-25 Gil Forcada + + * POTFILES.skip: Added some files here. + +2008-07-10 Kjartan Maraas + + * POTFILES.in: Move file from here to + * POTFILES.skip: here. + +2008-07-10 Kjartan Maraas + + * POTFILES.in: Added missing file. + * nb.po: Updated Norwegian bokmål translation. + +2008-07-05 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-07-02 Yannig Marchegay + + * oc.po: Updated Occitan translation. + +2008-07-01 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2008-06-24 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2008-06-14 Yannig Marchegay + + * oc.po: Updated Occitan translation. + +2008-06-06 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2008-05-29 Jonh Wendell + + * pt_BR.po: Brazilian Portuguese translation updated by Og Maciel. + +2008-05-27 Jonh Wendell + + * pt_BR.po: Brazilian Portuguese translation updated by Henrique Machado. + +2008-05-25 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-05-14 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2008-04-26 Gabor Kelemen + + * hu.po: Translation updated. + +2008-04-13 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-03-29 Ihar Hrachyshka + + * be@latin.po: Updated Belarusian Latin translation by Ihar Hrachyshka. + +2008-03-19 Gabor Kelemen + + * hu.po: Translation updated + +2008-03-14 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-03-14 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2008-03-13 Inaki Larranaga Murgoitio + + * eu.po: Updated Basque translation. + +2008-03-12 Dan Williams + + * POTFILES.in: add missing translatables + +2008-03-10 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2008-03-09 Ihar Hrachyshka + + * be@latin.po: Updated Belarusian Latin translation. + +2008-03-09 Philip Withnall + + * en_GB.po: Updated British English translation. + +2008-03-09 Stéphane Raimbault + + * fr.po: Updated French translation by Robert-André Mauchin. + +2008-03-09 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2008-03-08 Inaki Larranaga Murgoitio + + * eu.po: Updated Basque translation. + +2008-03-07 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2008-02-28 Arangel Angov + + * mk.po: Updated Macedonian translation. + +2008-02-28 Gil Forcada + + * ca.po: Updated Catalan translation. + +2008-02-24 Wadim Dziedzic + + * pl.po: Updated polish translation + +2008-02-20 Inaki Larranaga Murgoitio + + * LINGUAS: Added 'eu' (Basque) entry. + * eu.po: Added Basque translation. + +2008-02-19 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2007-02-17 Yair Hershkovitz + + * he.po, LINGUAS: Added Hebrew translation. + +2008-02-14 Pawan Chitrakar + + * ne.po: Updated Nepali Translation. + +2008-02-13 Ignacio Casal Quinteiro + + * gl.po: Updated Galician Translation. + +2008-01-30 Jonh Wendell + + * pt_BR.po: Brazilian Portuguese translation updated by Luiz Armesto. + +2008-01-19 Stéphane Raimbault + + * fr.po: Updated French translation by Robert André-Mauchin and + Stéphane Raimbault. + +2007-12-29 Changwoo Ryu + + * ko.po: Updated Korean translation by Namhyung Kim. + +2007-12-28 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2007-12-26 Djihed Afifi + + * ar.po: Updated Arabic Translation by Djihed Afifi. + +2007-12-19 Ihar Hrachyshka + + * be@latin.po: Updated Belarusian Latin translation. + +2007-12-19 Jorge Gonzalez + + * es.po: Updated Spanish translation + +2007-12-11 Andre Klapper + + * de.po: Updated German translation + +2007-12-08 Ihar Hrachyshka + + * be@latin.po: Updated Belarusian Latin translation. + +2007-12-06 Jorge Gonzalez + + * es.po: Updated Spanish translation. + +2007-11-02 Priit Laes + + * et.po: Translation updated by Mattias Põldaru. + +2007-10-28 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2007-10-28 Priit Laes + + * et.po: Translation updated by Mattias Põldaru. + +2007-10-06 Funda Wang + + * POTFILES.in: Removed non-exist files. + +2007-07-23 Satoru SATOH + + * ja.po: Updated Japanese translation. + +2007-07-16 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2007-05-01 Mohammad DAMT + + * id.po: Added Indonesian language by Andika Triwidada + + * LINGUAS: Added id. + +2007-04-16 Ihar Hrachyshka + + * be@latin.po: Added Belarusian Latin translation. + * LINGUAS: Added be@latin. + +2007-03-10 Hendrik Richter + + * de.po: Updated German translation, by + Thomas Gier + +2007-03-07 Vladimer Sichinava + + * ka.po: Updated Georgian translation by + Malkhaz Barkalaya + +2007-03-02 Leonardo Ferreira Fontenelle + + * pt_BR.po: Fixed typo in Brazilian Portuguese translation by Og + Maciel . + +2007-02-27 Abel Cheung + + * LINGUAS: Added zh_HK. + +2007-02-25 Priit Laes + + * et.po: Updated Estonian translation by Ivar Smolin . + +2007-02-25 Gabor Kelemen + + * hu.po: Translation updated. + +2007-02-23 Gintautas Miliauskas + + * lt.po: Updated Lithuanian translation. + +2007-02-20 Artur Flinta + + * pl.po: Updated Polish translation by GNOME PL Team. + +2007-02-18 Artur Flinta + + * pl.po: Updated Polish translation by GNOME PL Team. + +2007-02-16 Maxim Dziumanenko + + * uk.po: Updated Ukrainian translation. + +2007-02-13 Lasse Bang Mikkelsen + + * da.po: Updated Danish translation. + +2007-02-12 Ignacio Casal Quinteiro + + * gl.po: Added Galician Translation. + * LINGUAS: Added 'gl' + +2007-02-11 Stéphane Raimbault + + * fr.po: Updated French translation by Jonathan Ernst. + +2007-02-9 Djihed Afifi + + * ar.po: Updated Arabic Translation by Khaled Hosny. + +2007-02-8 Djihed Afifi + + * ar.po: Updated Arabic Translation by Djihed Afifi. + +2007-02-08 Duarte Loreto + + * pt.po: Added Portuguese translation. + * LINGUAS: Added Portuguese (pt). + +2007-02-04 Changwoo Ryu + + * ko.po: Updated Korean translation by Young-Ho Cha. + +2007-02-02 Chao-Hsiung Liao + + * zh_HK.po: Added Traditional Chinese translation(Hong Kong). + * zh_TW.po: Updated Traditional Chinese translation(Taiwan). + +2007-02-02 Alexander Shopov + + * bg.po: Updated Bulgarian translation by + Alexander Shopov + +2007-01-31 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2007-01-23 Theppitak Karoonboonyanan + + * th.po: Updated Thai translation. + +2007-01-13 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2007-01-13 Kostas Papadimas + + * el.po: Updated Greek Translation + +2007-01-13 Djihed Afifi + + * ar.po: Updated Arabic Translation by Djihed Afifi. + +2007-01-09 Matic Zgur + + * sl.po: Added Slovenian translation. + * LINGUAS: Added sl to the list of languages. + +2007-01-05 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2007-01-03 Erdal Ronahi + + * LINGUAS: Added Kurdish (ku) + * ku.po: Added initial Kurdish translations + +2006-12-28 David Lodge + + * LINGUAS: Added English (British) + +2006-12-28 David Lodge + + * en_GB.po: Updated English (British) translation + +2006-12-28 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-12-16 Theppitak Karoonboonyanan + + * th.po: Added Thai translation by + Isriya Paireepairit and me. + * LINGUAS: Added th. + +2006-12-13 Gabor Kelemen + + * hu.po: Translation updated. + +2006-12-10 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2006-12-10 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation and + fixed an error thanks to Terje J. Hansen. + +2006-12-04 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2006-12-03 Josep Puigdemont i Casamajó + + * ca.po: Updated Catalan translation. + +2006-12-02 Dan Williams + + * POTFILES.in: add missing translatables + +2006-11-18 Djihed Afifi + + * ar.po: Added Arabic Translation. + * LINGUAS: Added ar. + +2006-11-02 Pema Geyleg + + * dz.po: Added Dzongkha Translation. + * LINGUAS: Added "dz". + +2006-11-01 Satoru SATOH + + * ja.po: Fixed wrong plural forms. + +2006-10-30 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2006-10-21 Gabor Kelemen + + * hu.po: Translation updated. + +2006-10-21 Josep Puigdemont i Casamajó + + * ca.po: Updated Catalan translation. + +2006-10-17 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-10-16 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2006-10-15 Marcel Telka + + * sk.po: Updated Slovak translation. + +2006-10-15 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-10-12 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-10-08 Hendrik Richter + + * de.po: Updated German translation, by + Tobias Wolf + +2006-10-08 Priit Laes + + * et.po: Translation updated by Ivar Smolin. + +2006-10-02 Priit Laes + + * et.po: Translation updated. + +2006-09-30 Alessio Frusciante + + * it.po: Updated Italian translation by + Francesco Marletta . + +2006-09-27 Priit Laes + + * et.po: Translation added. + * LINGUAS: Added et. + +2006-09-25 Pawan Chitrakar + + * ne.po: Updated Nepali Translation + +2006-09-13 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2006-09-12 Kostas Papadimas + + * el.po: Fixed typos by Dimitris Glezos + +2006-09-12 David Lodge + + * en_GB.po: British (English) translation updated. + +2006-09-03 Josep Puigdemont i Casamajó + + * ca.po: Updated Catalan translation. + +2006-08-30 Leonid Kanter + + * LINGUAS: added "ru" + +2006-08-24 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2006-08-17 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-08-16 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-08-16 Gabor Kelemen + + * hu.po: Translation updated. + +2006-08-06 Dan Williams + + Patch from Michael Biebl + * de.po: Fix issues for German translation + +2006-07-29 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2006-07-28 Christophe Merlet + + * fr.po: Updated French translation from + Stéphane Raimbault . + +2006-07-27 Marcel Telka + + * sk.po: Updated Slovak translation. + +2006-07-18 Satoru SATOH + + * ja.po: Updated Japanese translation. + +2006-07-16 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2006-07-14 Jakub Friedl + + * cs.po: Added Czech translation + +2006-07-12 Leonid Kanter + + * ru.po: Added Russian translation + +2006-07-04 Simos Xenitellis + + * el.po: Added updated Greek translation by Dimitris Glezos. + +2006-07-03 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-07-01 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2006-06-28 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + +2006-06-26 Daniel Nylander + + * sv.po: Updated Swedish translation. + +2006-06-21 Raivis Dejus + + * lv.po: Added Latvian translation. + +2006-06-17 Marcel Telka + + * sk.po: Updated Slovak translation. + +2006-06-15 Hendrik Richter + + * de.po: Updated German translation. + +2006-06-15 Hendrik Richter + + * de.po: Updated German translation. + +2006-06-15 Hendrik Richter + + * de.po: Updated German translation. + +2006-06-13 Wouter Bolsterlee + + * nl.po: Translation updated by Tino Meinen. + +2006-06-09 Jakub Friedl + + * cs.po: Updated Czech translation. + +2006-06-06 Jakub Friedl + + * cs.po: Updated Czech translation. + +2006-06-02 Danilo Šegan + + Fixed bug #343274. + + * sr.po, sr@Latn.po: Fixed a translation on + Filip Miletic's suggestion. + +2006-05-27 Funda Wang + + * zh_CN.po: Updated Simplified Chinese translation. + +2006-05-01 Josep Puigdemont Casamajó + + * ca.po: Updated Catalan translation. + +2006-04-17 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + * no.po: Remove obsolete duplicate. + +2006-04-14 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-04-11 Alessio Frusciante + + * it.po: Updated Italian translation by + Francesco Marletta . + +2006-04-01 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-03-31 Miloslav Trmac + + * cs.po: Updated Czech translation by Jakub Friedl. + +2006-03-30 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2006-03-26 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + * no.po: Same. + +2006-03-25 Christian Rose + + * sv.po: Updated Swedish translation. + +2006-03-23 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2006-03-21 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2006-03-19 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-03-17 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2006-03-15 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2006-03-13 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-03-10 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2006-03-09 Øivind Hoel + + * nb.po: Updated Norwegian bokmål translation. + +2006-03-08 Jakub Friedl + + * cs.po: Translation updated. + +2006-03-06 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-03-04 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2006-03-02 Kjartan Maraas + + * POTFILES.in: Add two missing files. + * nb.po: Updated Norwegian bokmål translation. + * no.po: Same. + +2006-03-02 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2006-02-28 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2006-02-28 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-02-28 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2006-02-26 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2006-02-25 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2006-02-24 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2006-02-24 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-02-16 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2006-02-14 Vincent van Adrighem + + * nl.po: Translation updated by Reinout en Tino. + +2006-02-13 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2006-02-11 Kang Jeong-Hee + + * ko.po: Added Korean translation. + +2006-02-10 Øivind Hoel + + * nb.po: Updated Norwegian Bokmål translation + +2006-02-05 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-02-01 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-01-31 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2006-01-31 Clytie Siddall + + * vi.po: Updated Vietnamese translation. + +2006-01-29 Josep Puigdemont i Casamajó + + * ca.po: Updated Catalan translation. + +2006-01-28 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2006-01-28 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-01-27 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2006-01-27 Clytie Siddall + + * vi.po: Added Vietnamese translation. + +2006-01-26 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2006-01-26 Lasse Bang Mikkelsen + + * da.po: Updated Danish translation. + +2006-01-23 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-01-21 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-01-20 Lasse Bang Mikkelsen + + * da.po: Updated Danish translation. + +2006-01-18 Marcel Telka + + * sk.po: Updated Slovak translation. + +2006-01-18 Lasse Bang Mikkelsen + + * da.po: Updated Danish translation. + +2006-01-17 Adam Weinberger + + * POTFILES.in: Added missing file. + * en_CA.po: Updated Canadian English translation. + +2006-01-15 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2006-01-14 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2006-01-13 Lasse Bang Mikkelsen + + * da.po: Updated Danish translation. + +2006-01-12 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2006-01-11 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2006-01-09 Adam Weinberger + + * POTFILES.in: Added missing file. + * en_CA.po: Updated Canadian English translation. + +2006-01-07 Josep Puigdemont i Casamajó + + * ca.po: Updated Catalan translation. + +2006-01-07 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2006-01-07 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2006-01-06 Ilkka Tuohela + + * fi.po: Updated Finnish translation. + +2006-01-04 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-12-25 Žygimantas Beručka + + * lt.po: Updated Lithuanian translation. + +2005-12-25 Lasse Bang Mikkelsen + + * da.po: Updated Danish translation. + +2005-12-25 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2005-12-23 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-12-23 Adam Weinberger + + * POTFILES.in: Added missing files. + * en_CA.po: Updated Canadian English translation. + +2005-12-21 Žygimantas Beručka + + * lt.po: Added Lithuanian translation. + +2005-12-20 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-12-19 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-12-16 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-12-16 Lasse Bang Mikkelsen + + * da.po: Updated Danish translation. + +2005-12-15 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-12-15 Alexander Shopov + + * bg.po: Added Bulgarian translation by + Alexander Shopov + +2005-12-11 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-12-11 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2005-12-05 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + * no.po: Same + +2005-11-21 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-11-20 Ilkka Tuohela + + * fi.po: Added Finish translation + +2005-11-13 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2005-11-06 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-11-04 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-11-03 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-11-01 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-10-31 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-10-28 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-10-27 Christopher Aillon + + * POTFILES.in: NetworkManager is now encoded in UTF-8 + +2005-10-25 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-10-19 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-10-19 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-10-16 Funda Wang + + * zh_CN.po: Updated Simplified Chinese translation. + +2005-10-15 James Ogley + + * en_GB.po: Updated British English translation + +2005-10-12 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation by Lucas Vieites Fariña. + +2005-10-10 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-10-06 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-10-05 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + * no.po: Same. + +2005-10-05 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-10-04 Funda Wang + + * zh_CN.po: Updated Simplified Chinese translation. + +2005-09-27 Hendrik Brandt + + * de.po: Updated German translation. + +2005-09-26 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-09-23 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-09-22 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-09-21 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-09-18 Christian Rose + + * sv.po: Updated Swedish translation. + +2005-09-06 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-09-06 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + * no.po: Same + +2005-09-05 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-09-04 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-09-01 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-09-01 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2005-08-31 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-08-29 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-08-27 Josep Puigdemont + + * ca.po: Added Catalan translation. + +2005-08-27 Kostas Papadimas + + * el.po: Updated Greek Translation + +2005-08-21 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-08-21 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-08-19 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-08-19 Kjartan Maraas + + * nb.po: Updated Norwegian Bokmål translation. + * no.po: Same. + +2005-08-19 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-08-19 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-08-18 Hendrik Brandt + + * de.po: Updated German translation. + +2005-08-17 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-08-16 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-08-16 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-08-15 Hendrik Brandt + + * de.po: Updated German translation. + +2005-08-13 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-08-13 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-08-12 Robert Love + + * sv.po: move NetworkManager-vpn translations to their po/ + * POTFILES.skip: add another vpn-daemons/ file + +2005-08-10 Maxim Dziumanenko + + * uk.po: Updated Ukrainian translation. + +2005-08-06 Adam Weinberger + + * POTFILES.skip: Add with obsoleted files. + * en_CA.po: Updated Canadian English translation. + +2005-08-06 Hendrik Brandt + + * de.po: Updated German translation. + +2005-08-06 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-08-06 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-08-04 Kjartan Maraas + + * nb.po: Updated Norwegian bokmål translation. + * no.po: Same + +2005-07-30 Francisco Javier F. Serrador + + * es.po: UPdated Spanish translation. + +2005-07-26 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-07-23 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-07-23 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-07-21 Francisco Javier F. Serrador + + es.po: Updated Spanish translation. + +2005-07-21 Chao-Hsiung Liao + + * zh_TW.po: Updated Traditional Chinese translation. + +2005-07-20 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-07-18 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-07-10 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-07-06 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-07-05 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-07-04 Terance Sola + + * nb.po: Updated Norwegian bokmål translation. + * no.po: + +2005-07-03 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-07-02 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-07-01 Hendrik Brandt + + * de.po: Updated German translation. + +2005-06-30 Robert Love + + * POTFILES.in: remove examples/ translatable files as they are not + part of the official dist and thus break "make distcheck". Also + remove vpn-daemons/ translatable files as they are included in that + directories own po/POTFILES.in file (and it breaks "make distcheck"). + +2005-06-28 Kjartan Maraas + + * nb.po: Updated Norwegian bokmÃ¥l translation. + * no.po: Same + +2005-06-26 Hendrik Brandt + + * de.po: Updated German translation. + +2005-06-26 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-06-26 Christian Rose + + * sv.po: Updated Swedish translation. + +2005-06-25 Christian Rose + + * POTFILES.in: Added missing file entries. + +2005-06-25 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-06-24 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-06-23 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-06-21 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-06-21 Hendrik Brandt + + * de.po: Updated German translation. + +2005-06-20 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-06-20 Kjartan Maraas + + * nb.po: Update Norwegian BokmÃ¥l translation. + * no.po: Same + +2005-06-17 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-06-17 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-06-17 Hendrik Brandt + + * de.po: Updated German translation. + +2005-06-17 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-06-14 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2005-06-14 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-06-12 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-06-12 David Zeuthen + + * POTFILES.in: Added gnome/vpn-properties/nm-vpn-properties.c and + gnome/vpn-properties/nm-vpn-properties.glade + +2005-06-10 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-06-06 Maxim Dziumanenko + + * uk.po: Updated Ukrainian translation. + +2005-06-01 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-06-01 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-05-29 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-05-24 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-05-24 Frank Arnold + + * de.po: Updated German translation. + +2005-05-23 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-05-20 Frank Arnold + + * de.po: Updated German translation. + +2005-05-19 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-05-15 Dan Williams + + From Filip Miletic: + * po/sr.po + po/sr@Latn.po + configure.in + - Serbian translation added + +2005-05-15 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-05-15 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-05-15 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-05-14 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-05-14 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-05-14 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-05-14 Pawan Chitrakar + + * ne.po: Upadated Nepali translation + +2005-05-13 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-05-12 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-05-12 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-05-06 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-05-04 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-05-02 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2005-05-01 Kjartan Maraas + + * nb.po: Update + * no.po: Update + +2005-04-30 Christian Rose + + * POTFILES.in: Removed nonexisting files and added + missing ones. + * sv.po: Updated Swedish translation. + +2005-04-24 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-04-22 Pawan Chitrakar + + * ne.po: Added Nepali translation + +2005-04-21 Gabor Kelemen + + * hu.po: Hungarian translation updated. + +2005-04-19 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-04-19 David Lodge + + * en_GB.po: Updated British English translation. + +2005-04-19 Frank Arnold + + * de.po: Updated German translation. + +2005-04-19 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-04-16 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-04-15 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-04-14 Jorge Bernal 'Koke' + + * es.po: Updated Spanish translation. + +2005-04-09 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-04-07 Kjartan Maraas + + * nb.po: Update + +2005-04-06 Gabor Kelemen + + * hu.po: Hungarian translation added. + +2005-04-04 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-04-04 Nikos Charonitakis + + * el.po: Updated Greek translation. + +2005-04-03 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-04-02 Frank Arnold + + * de.po: Updated German translation. + +2005-04-01 Steve Murphy + + * rw.po: Added Kinyarwanda translation. + +2005-04-01 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-04-01 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-03-26 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2005-03-16 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-03-04 Kjartan Maraas + + * no.po: Update + * nb.po: Update + +2005-03-02 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-02-28 Maxim Dziumanenko + + * uk.po: Added Ukrainian translation. + +2005-02-27 Jim Huang + + * zh_TW.po: Added "zh_TW" (Traditional Chinese). + +2005-02-27 Alessio Frusciante + + * it.po: Added Italian translation by + Francesco Marletta . + +2005-02-22 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-02-20 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-02-20 Hendrik Brandt + + * de.po: Updated German translation. + +2005-02-19 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-02-18 Dan Williams + + * Correct spelling of "adaptor"->"adapter" + +2005-02-18 Kjartan Maraas + + * nb.po: Update + * no.po: Update + +2005-02-17 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-02-16 Christophe Merlet + + * fr.po: Added French translation from + Raphael Tournoy . + +2005-02-14 Tomislav Vujec + + * configure.in + po/hr.po + - Add the Croatian locale. + +2005-02-14 Kjartan Maraas + + * nb.po: Update + * no.po: Update + +2005-02-13 David Lodge + + * en_GB.po: Updated British translation. + +2005-02-13 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-02-12 Nikos Charonitakis + + * el.po: Updated Greek translation. + +2005-02-11 Marcel Telka + + * sk.po: Updated Slovak translation. + +2005-02-11 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-02-11 Frank Arnold + + * de.po: Updated German translation. + +2005-02-10 Dan Williams + + * POTFILES.in + - Revert the Encoding change since it doesn't seem to work + on FC4 or FC3 at the moment. + +2005-02-09 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-02-09 Frank Arnold + + * de.po: Updated German translation. + +2005-02-08 Kjartan Maraas + + * POTFILES.in: Add encoding foo + * nb.po: Update + * no.po: Update + +2005-02-04 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2005-02-03 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2005-02-03 Frank Arnold + + * de.po: Updated German translation. + +2005-01-19 Kjartan Maraas + + * nb.po: Update + * no.po: Update + +2005-01-10 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2005-01-07 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2005-01-01 Satoru SATOH + + * ja.po: Added Japanese translation + +2004-12-25 Kjartan Maraas + + * nb.po: Update. + +2004-12-20 Hendrik Brandt + + * de.po: Updated German translation. + +2004-12-19 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-12-18 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-12-18 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-12-17 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-12-07 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-12-05 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-12-05 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-12-04 Kjartan Maraas + + * POTFILES.in: Add missing file. + * nb.po: Update + +2004-11-29 Funda Wang + + * zh_CN.po: Updated Simplified Chinese translation. + +2004-11-14 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-11-09 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-11-09 Kjartan Maraas + + * POTFILES.in: Add panel-applet/NWManagerOtherNetworkDialog.c + * nb.po: Update + +2004-11-04 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-11-04 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-11-04 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-11-03 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-11-01 Kjartan Maraas + + * nb.po: Updated Norwegian bokmal translation. + +2004-10-31 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-10-30 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-10-30 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-10-25 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-10-24 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation. + +2004-10-24 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-10-23 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-10-22 Hendrik Brandt + + * de.po: Updated German translation. + +2004-10-20 Kjartan Maraas + + * nb.po: Update. + * no.po: Update + +2004-10-18 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-10-17 David Lodge + + * en_GB.po: Updated British English translation. + +2004-10-17 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-10-17 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2004-10-15 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-10-15 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-10-15 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-10-14 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-10-14 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-10-13 David Lodge + + * en_GB.po: Updated British English translation. + +2004-10-10 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-10-10 Marcel Telka + + * sk.po: Updated Slovak translation. + +2004-10-10 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2004-10-10 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-10-09 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-10-08 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-10-08 Hendrik Brandt + + * de.po: Added German translation. + +2004-10-08 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-10-08 Kjartan Maraas + + * POTFILES.in: Add missing file. + * nb.po: Update + * no.po: Update + +2004-10-05 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2004-10-03 David Lodge + + * en_GB.po: Added British translation. + +2004-10-03 Marcel Telka + + * sk.po: Added Slovak translation. + +2004-10-03 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-10-02 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-09-29 Kjartan Maraas + + * nb.po: Update + * no.po: Update + +2004-09-27 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-09-23 Vincent van Adrighem + + * nl.po: Translation updated by Daniel van Eeden. + +2004-09-23 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-09-23 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-09-22 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2004-09-21 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-09-21 Miloslav Trmac + + * cs.po: Updated Czech translation. + +Mon Sep 20 11:22:16 2004 Jonathan Blandford + + * POTFILES.in: add panel-applet/menu-info.c + +2004-09-15 Laurent Dhima + + * sq.po: Updated Albanian translation. + +2004-09-13 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-09-12 Vincent van Adrighem + + * nl.po: Translation updated by Tino Meinen. + +2004-09-12 Kjartan Maraas + + * nb.po: Updated + +2004-09-11 Martin Willemoes Hansen + + * da.po: Updated Danish translation. + +2004-09-10 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-09-10 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-09-09 Francisco Javier F. Serrador + + * es.po: Updated Spanish translation by Antonio Ognio. + +2004-09-09 Raphael Higino + + * pt_BR.po: Updated Brazilian Portuguese translation. + +2004-09-09 Ankit Patel + + * gu.po: Added Gujarati Translation. + +2004-09-09 Pablo Saratxaga + + * wa.po: Added Walloon file. + +2004-09-08 Miloslav Trmac + + * cs.po: Updated Czech translation. + +2004-09-08 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-09-07 David Lodge + + * en_GB.po: Added British translation. + +2004-09-04 Laurent Dhima + + * sq.po: Added Albanian translation. + +2004-09-03 Raphael Higino + + * pt_BR.po: Added Brazilian Portuguese translation. + +2004-09-03 Akagic Amila + + * bs.po: Added Bosnian translation. + +2004-09-02 Vincent van Adrighem + + * nl.po: Translation added by Tino Meinen. + +2004-08-28 Kjartan Maraas + + * nb.po: Add Norwegian translation. + * no.po: Same. + +2004-08-28 Miloslav Trmac + + * cs.po: Added Czech translation. + +2004-08-28 Adam Weinberger + + * en_CA.po: Updated Canadian English translation. + +2004-08-27 Adam Weinberger + + * en_CA.po: Added Canadian English translation. + +2004-08-27 Funda Wang + + * zh_CN.po: Added Simplified Chinese translation. + +2004-08-27 Christian Rose + + * sv.po: Added Swedish translation. + +2004-08-27 Christian Rose + + * .cvsignore: Sorted and added entries. + * POTFILES.in: Added missing entries. + * NetworkManager.pot: Removed. This is a generated file. + diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 00000000..24285986 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,66 @@ +# please keep this list sorted alphabetically +# +ar +as +be@latin +bg +bn_IN +bs +ca +cs +da +de +dz +el +en_CA +en_GB +es +et +eu +fi +fr +gl +gu +he +hi +hr +hu +id +it +ja +ka +kn +ko +ku +lt +lv +mk +ml +mr +nb +ne +nl +oc +or +pa +pl +pt +pt_BR +ru +rw +sk +sl +sq +sr +sr@latin +sv +ta +te +th +uk +vi +wa +zh_CN +zh_HK +zh_TW + diff --git a/po/Makefile.in.in b/po/Makefile.in.in new file mode 100644 index 00000000..cc8a2227 --- /dev/null +++ b/po/Makefile.in.in @@ -0,0 +1,217 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# Copyright (C) 2004-2008 Rodney Dawes +# +# This file may be copied and used freely without restrictions. It may +# be used in projects which are not available under a GNU Public License, +# but which still want to provide support for the GNU gettext functionality. +# +# - Modified by Owen Taylor to use GETTEXT_PACKAGE +# instead of PACKAGE and to look for po2tbl in ./ not in intl/ +# +# - Modified by jacob berkman to install +# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize +# +# - Modified by Rodney Dawes for use with intltool +# +# We have the following line for use by intltoolize: +# INTLTOOL_MAKEFILE + +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = @datadir@ +datarootdir = @datarootdir@ +libdir = @libdir@ +DATADIRNAME = @DATADIRNAME@ +itlocaledir = $(prefix)/$(DATADIRNAME)/locale +subdir = po +install_sh = @install_sh@ +# Automake >= 1.8 provides @mkdir_p@. +# Until it can be supposed, use the safe fallback: +mkdir_p = $(install_sh) -d + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +GMSGFMT = @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = @XGETTEXT@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist +GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot + +ALL_LINGUAS = @ALL_LINGUAS@ + +PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) + +USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) + +USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) + +POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) + +DISTFILES = Makefile.in.in POTFILES.in $(POFILES) +EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS + +POTFILES = \ +# This comment gets stripped out + +CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) + +.SUFFIXES: +.SUFFIXES: .po .pox .gmo .mo .msg .cat + +.po.pox: + $(MAKE) $(GETTEXT_PACKAGE).pot + $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && gencat $@ $*.msg + + +all: all-@USE_NLS@ + +all-yes: $(CATALOGS) +all-no: + +$(GETTEXT_PACKAGE).pot: $(POTFILES) + $(GENPOT) + +install: install-data +install-data: install-data-@USE_NLS@ +install-data-no: all +install-data-yes: all + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $$dir; \ + if test -r $$lang.gmo; then \ + $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ + echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ + echo "installing $(srcdir)/$$lang.gmo as" \ + "$$dir/$(GETTEXT_PACKAGE).mo"; \ + fi; \ + if test -r $$lang.gmo.m; then \ + $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ + echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ + else \ + if test -r $(srcdir)/$$lang.gmo.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ + $$dir/$(GETTEXT_PACKAGE).mo.m; \ + echo "installing $(srcdir)/$$lang.gmo.m as" \ + "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ + else \ + true; \ + fi; \ + fi; \ + done + +# Empty stubs to satisfy archaic automake needs +dvi info ctags tags CTAGS TAGS ID: + +# Define this as empty until I found a useful application. +install-exec installcheck: + +uninstall: + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ + rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ + done + +check: all $(GETTEXT_PACKAGE).pot + rm -f missing notexist + srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m + if [ -r missing -o -r notexist ]; then \ + exit 1; \ + fi + +mostlyclean: + rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp + rm -f .intltool-merge-cache + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES stamp-it + rm -f *.mo *.msg *.cat *.cat.m *.gmo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f Makefile.in.in + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: $(DISTFILES) + dists="$(DISTFILES)"; \ + extra_dists="$(EXTRA_DISTFILES)"; \ + for file in $$extra_dists; do \ + test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ + done; \ + for file in $$dists; do \ + test -f $$file || file="$(srcdir)/$$file"; \ + ln $$file $(distdir) 2> /dev/null \ + || cp -p $$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(GETTEXT_PACKAGE).pot + tmpdir=`pwd`; \ + linguas="$(USE_LINGUAS)"; \ + for lang in $$linguas; do \ + echo "$$lang:"; \ + result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ + if $$result; then \ + if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.gmo failed!"; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi; \ + done + +Makefile POTFILES: stamp-it + @if test ! -f $@; then \ + rm -f stamp-it; \ + $(MAKE) stamp-it; \ + fi + +stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 00000000..4d7faa58 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,23 @@ +[encoding: UTF-8] +# List of source files containing translatable strings. +# Please keep this file sorted alphabetically. +cli/src/connections.c +cli/src/devices.c +cli/src/network-manager.c +cli/src/nmcli.c +cli/src/settings.c +cli/src/utils.c +libnm-util/crypto.c +libnm-util/crypto_gnutls.c +libnm-util/crypto_nss.c +libnm-util/nm-utils.c +src/nm-netlink-monitor.c +src/main.c +src/dhcp-manager/nm-dhcp-dhclient.c +src/dhcp-manager/nm-dhcp-manager.c +src/logging/nm-logging.c +src/named-manager/nm-named-manager.c +src/system-settings/nm-default-wired-connection.c +system-settings/plugins/ifcfg-rh/reader.c +policy/org.freedesktop.network-manager-settings.system.policy.in + diff --git a/po/POTFILES.skip b/po/POTFILES.skip new file mode 100644 index 00000000..e57048b3 --- /dev/null +++ b/po/POTFILES.skip @@ -0,0 +1,5 @@ +examples/python/NetworkManager.py +examples/python/systray/eggtrayicon.c +vpn-daemons/openvpn +vpn-daemons/pptp +vpn-daemons/vpnc diff --git a/po/ar.po b/po/ar.po new file mode 100644 index 00000000..5796a044 --- /dev/null +++ b/po/ar.po @@ -0,0 +1,379 @@ +# translation of NetworkManager.HEAD.ar.po to Arabic +# Arabic translations for PACKAGE package. +# Copyright (C) 2006 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Automatically generated, 2006. +# Khaled Hosny , 2007. +msgid "" +msgstr "" +"Project-Id-Version: Project\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-07-31 10:41+0100\n" +"PO-Revision-Date: 2007-12-26 09:20+0100\n" +"Last-Translator: Djihed Afifi \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: Plural-Forms: nplurals=4; plural=n==1 ? 0 : n==2 ? 1 : n>=3 && " +"n<=10 ? 2 : 3\n" +"X-Poedit-Language: Arabic\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:471 +#, c-format +msgid "error processing netlink message: %s" +msgstr "خطأ في قراءة رسالة نتلينك: %s" + +#: ../src/nm-netlink-monitor.c:250 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "لم أتمكن من إنشاء مقبس نتلنك netlink لمراقبة حالة الوصلة: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "لم أتمكن من الإتصال بنتلنك netlink لمراقبة حالة الوصلة: %s" + +#: ../src/nm-netlink-monitor.c:268 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "لم أتمكن من الإنضمام لمجموعة نتلنك netlink لمراقبة حالة الوصلة: %s" + +#: ../src/nm-netlink-monitor.c:276 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "لم أتمكن من تخصيص مخزن وصلة نتلنك netlink لمراقبة حالة الوصلة: %s" + +#: ../src/nm-netlink-monitor.c:494 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "حدث خطأ بينما ننتظر البيانات على المقبس" + +#: ../src/NetworkManager.c:250 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "خيار غير صحيح. استعمل --help لعرض قائمة الخيارات الممكنة.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 +msgid "# Created by NetworkManager\n" +msgstr "" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" + +#: ../src/named-manager/nm-named-manager.c:117 +msgid "NOTE: the glibc resolver does not support more than 3 nameservers." +msgstr "" + +#: ../src/named-manager/nm-named-manager.c:119 +msgid "The nameservers listed below may not be recognized." +msgstr "" + +#: ../system-settings/src/main.c:365 +#, c-format +msgid "Auto %s" +msgstr "" + +#: ../libnm-util/crypto.c:125 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:135 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "" + +#: ../libnm-util/crypto.c:143 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "" + +#: ../libnm-util/crypto.c:159 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "" + +#: ../libnm-util/crypto.c:167 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:177 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "" + +#: ../libnm-util/crypto.c:188 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "" + +#: ../libnm-util/crypto.c:195 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" + +#: ../libnm-util/crypto.c:208 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:227 +#, c-format +msgid "Could not decode private key." +msgstr "" + +#: ../libnm-util/crypto.c:271 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:281 +#, c-format +msgid "Failed to decode certificate." +msgstr "" + +#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "" + +#: ../libnm-util/crypto.c:328 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "" + +#: ../libnm-util/crypto.c:337 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "" + +#: ../libnm-util/crypto.c:348 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "" + +#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:126 +#: ../libnm-util/crypto_nss.c:136 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "" + +#: ../libnm-util/crypto.c:395 +#, c-format +msgid "Not enough memory to create private key decryption key." +msgstr "" + +#: ../libnm-util/crypto.c:513 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:73 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:135 ../libnm-util/crypto_nss.c:145 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:143 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:152 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:161 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:170 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:208 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:220 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "" + +#: ../libnm-util/crypto_nss.c:78 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:153 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "" + +#: ../libnm-util/crypto_nss.c:163 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "" + +#: ../libnm-util/crypto_nss.c:173 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "" + +#: ../libnm-util/crypto_nss.c:181 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "" + +#: ../libnm-util/crypto_nss.c:194 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:250 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "" + +#~ msgid "Cannot add VPN connection" +#~ msgstr "لا يمكن إضافة اتصال VPN" + +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "لم يُعثر على برمجيات VPN مناسبة على نظامك. اتصل بمدير نظامك." + +#~ msgid "Cannot import VPN connection" +#~ msgstr "لا يمكن استيراد اتصال VPN" + +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "لم أجد برمجيات مناسبة لاتصال VPN من نوع '%s' لاستيرادها للملف '%s'. اتصل " +#~ "بمدير نظامك." + +#~ msgid "Error retrieving VPN connection '%s'" +#~ msgstr "خطأ أثناء فتح اتصال VPN '%s'" + +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "" +#~ "لم أعثر على ملفات واجهة المستخدم لاتصال VPN من نوع '%s'. اتصل بمدير نظامك." + +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "حذف اتصال VPN \"%s\"؟" + +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "ستُفقد كل معلومات اتصال VPN \"%s\" و قد تحتاج أن يعطيك مدير نظامك معلومات " +#~ "لإنشاء اتصال جديد." + +#~ msgid "Unable to load" +#~ msgstr "تعذّر التحميل" + +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "لم أعثر على بعض الموارد المطلوبة (ملف glade)!" + +#~ msgid "Create VPN Connection" +#~ msgstr "انشيء اتصال VPN" + +#~ msgid "Edit VPN Connection" +#~ msgstr "حرر اتصال VPN" + +#~ msgid "Add a new VPN connection" +#~ msgstr "أضف اتصال VPN جديد" + +#~ msgid "Delete the selected VPN connection" +#~ msgstr "احذف اتصال VPN المُنتقى" + +#~ msgid "E_xport" +#~ msgstr "_صدِّر" + +#~ msgid "Edit the selected VPN connection" +#~ msgstr "حرر اتصال VPN المُنتقى" + +#~ msgid "Export the VPN settings to a file" +#~ msgstr "صِّر اعدادات VPN إلى ملف" + +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "صدِّر اعدادات VPN المنتقاة إلى ملف" + +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "أدر اتصالات الشبكة الخاصة التخيّليّة" + +#~ msgid "VPN Connections" +#~ msgstr "إتّصالات VPN" + +#~ msgid "40-bit WEP" +#~ msgstr "40-bit WEP" + +#~ msgid "104-bit WEP" +#~ msgstr "104-bit WEP" + +#~ msgid "WPA TKIP" +#~ msgstr "WPA TKIP" + +#~ msgid "WPA CCMP" +#~ msgstr "WPA CCMP" + +#~ msgid "WPA Automatic" +#~ msgstr "WPA آلي" + +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" + +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" + +#~ msgid "WPA2 Automatic" +#~ msgstr "WPA2 آلي" + +#~ msgid "none" +#~ msgstr "بلا" + +#~ msgid "operation took too long" +#~ msgstr "استغرقت العملية زمنا طويلا" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "تلقيت بيانات من نوع خطأ من المرسلين" + +#~ msgid "received data from unexpected sender" +#~ msgstr "تلقيت بيانات من مرسل غير متوقّع" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "أرسل الكثير جدا من البيانات عبر المقبس وفُقِد بعضها" + +#~ msgid "WPA2 Enterprise" +#~ msgstr "WPA2 مشروعات" + +#~ msgid "WPA Enterprise" +#~ msgstr "WPA مشروعات" + +#~ msgid "LEAP" +#~ msgstr "LEAP" diff --git a/po/as.po b/po/as.po new file mode 100644 index 00000000..2f79166f --- /dev/null +++ b/po/as.po @@ -0,0 +1,1809 @@ +# translation of NetworkManager.po.master.as.po to Assamese +# Assamese translation of NetworkManager. +# Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the NetworkManager package. +# +# Amitakhya Phukan , 2009, 2010. +# Amitakhya Phukan , 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.po.master.as\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 16:47+0530\n" +"Last-Translator: Amitakhya Phukan \n" +"Language-Team: American English \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "নাম" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "যন্ত্ৰ" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "স্ক'প" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "অবিকল্পিত" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS সেৱা" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "ধৰণ" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "সময়ৰ চাপ" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "সময়ৰ চাপ - ৰিয়েল" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "স্বয়ংক্ৰিয় সংযোগ" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "অকল পঢ়িব পৰা" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ব্যৱহাৰপ্ৰণালী: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "ভুল: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ভুল: 'con list': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "সংযোগৰ বিৱণ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "প্ৰণালী" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ব্যৱহাৰকৰ্তা" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "কেতিয়াও নহয়" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "হয়" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "নহয়" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "প্ৰণালীৰ সংযোগ" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ব্যৱহাৰকৰ্তাৰ সংযোগ" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ত্ৰুটি: %s তৰ্ক অনুপস্থিত ।" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ত্ৰুটি: %s - এই ধৰণৰ কোনো সংযোগ নাই ।" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "অজ্ঞাত স্থিতিমাপ: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ত্ৰুটি: বৈধ স্থিতিমাপ উল্লেখ কৰা নাযায় ।" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ভুল: %s ।" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ভুল: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ভুল: 'con status': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "সক্ৰিয় সংযোগ" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "'%s' যন্ত্ৰত কোনো সক্ৰিয় সংযোগ নাই" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "কোনো সক্ৰিয় সংযোগ বা যন্ত্ৰ নাই" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "যন্ত্ৰ '%s' সংযোগ '%s' ৰ সৈতে সুসঙ্গত নহয়" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "'%s' সংযোগৰ কাৰণে কোনো যন্ত্ৰ নাই" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "সক্ৰিয় কৰা হৈছে" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "সক্ৰিয় কৰা হৈছে" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "অজ্ঞাত" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে (প্ৰস্তুতি)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে (অনুমোদন প্ৰয়োজন)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে (IP বিন্যাস প্ৰাপ্ত কৰা হৈছে)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN সংযোগ স্থাপন কৰা হৈছে" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN সংযোগ বিফল হৈছে" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN সংযোগ বিচ্ছিন্ন কৰা হৈছে" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "অজ্ঞাত কাৰণ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "শূণ্য" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ব্যৱহাৰকৰ্তাৰ সৈতে সংযোগ বিচ্ছিন্ন কৰা হৈছে" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "মূল নে'টৱৰ্ক সংযোগ বিঘ্নিত হৈছে" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "অপ্ৰত্যাশিতভাবে VPN সেৱা বন্ধ কৰা হৈছে" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN সেৱাৰ পৰা অবৈধ বিন্যাস পোৱা গৈছে" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "সংযোগৰ প্ৰয়াসত সময়সীমা উত্তীৰ্ণ হৈছে" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "যথাযত সময়ত VPN সেৱা আৰম্ভ কৰা নহয়" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN সেৱা আৰম্ভ কৰা নাযায়" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "VPN ৰ বৈধ গোপন তথ্য নাই" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "VPN ৰ অবৈধ গোপন তথ্য" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "সংযোগ আঁতৰুৱা হৈছে" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "অৱস্থা: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "সংযোগ সক্ৰিয় কৰা হৈছে\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ত্ৰুটি: সংযোগ সক্ৰিয় কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "অৱস্থা: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ত্ৰুটি: সংযোগ সক্ৰিয় কৰিবলৈ ব্যৰ্থ: %s ।" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ত্ৰুটি: %d চেকেন্ডৰ সময়সীমা উত্তীৰ্ণ হৈছে ।" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ত্ৰুটি: সংযোগ সক্ৰিয় কৰিবলৈ ব্যৰ্থ: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ত্ৰুটি: '%s' ৰ বাবে সক্ৰিয় সংযোগ প্ৰাপ্ত কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "সক্ৰিয় সংযোগৰ অৱস্থা: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "সক্ৰিয় সংযোগৰ পথ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ত্ৰুটি: অজ্ঞাত সংযোগ: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ত্ৰুটি: '%s' সময়সীমাৰ মান বৈধ নহয় ।" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ত্ৰুটি: id বা uuid নিৰ্ধাৰণ কৰা আৱশ্যক ।" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ত্ৰুটি: প্ৰযোজ্য কোনো যন্ত্ৰ পোৱা নাযায়: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ত্ৰুটি: কোনো প্ৰযোজ্য যন্ত্ৰ পোৱা নাযায় ।" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "সতৰ্কবাৰ্তা: সংযোগ সক্ৰিয় নহয়\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ত্ৰুটি: 'con' আদেশ '%s', বৈধ নহয় ।" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ত্ৰুটি: D-Bus ৰ সৈতে সংযোগ কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ত্ৰুটি: প্ৰণালীৰ বৈশিষ্ট্য প্ৰাপ্ত কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ত্ৰুটি: ব্যৱহাৰকৰ্তাৰ বৈশিষ্ট্য প্ৰাপ্ত কৰিবলৈ ব্যৰ্থ" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ত্ৰুটি: সংযোগ প্ৰাপ্ত কৰিবলৈ ব্যৰ্থ: বৈশিষ্ট্যৰ সেৱা বৰ্তমানে নাই চলা ।" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "যন্ত্ৰ" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "অৱস্থা" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "সাধাৰণ" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "কৰ্মক্ষমতা" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "ৱাইফাই গুণ" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "তাঁৰযুক্ত সংযোগৰ বৈশিষ্ট্য" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4 পছন্দসমূহ" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "চালক" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "পৰিবহণকৰ্তা চিনাক্তকৰণ" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "গতি" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "পৰিবহণকৰ্তা" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ঠিকনা" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "উপসৰ্গ" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "গে'টৱে" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "মোড" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "হাৰ" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "চিগ্নেল" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "সুৰক্ষা" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "সক্ৰিয়" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"ব্যৱহাৰপ্ৰণালী: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "পৰিচালিত নহয়" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "উপলব্ধ নহয়" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "বিচ্ছিন্ন" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "সংযোগ কৰা হৈছে (প্ৰস্তুতি)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "সংযোগ কৰা হৈছে (বিন্যাস কৰা হৈছে)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "সংযোগ কৰা হৈছে (অনুমোদন প্ৰয়োজন)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "সংযোগ কৰা হৈছে (IP বিন্যাস প্ৰাপ্ত কৰা হৈছে)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "সংযোগ স্থাপিত" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "সংযোগ বিফল" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "অজ্ঞাত" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(শূণ্য)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ঠিকনা 0x%X ৰূপান্তৰ কৰিবলৈ ত্ৰুটি" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "এনক্ৰিপ্ট কৰা:" + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "এন্টাৰপ্ৰাইজ" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "এড-হক" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "অৱগাঁথনি" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ভুল: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ভুল: 'dev list': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "যন্ত্ৰৰ বিৱৰণ" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(অজ্ঞাত)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "অজ্ঞাত)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "চলি আছে" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "বন্ধ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ভুল: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ভুল: 'dev status': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "যন্ত্ৰৰ অৱস্থা" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ত্ৰুটি: '%s' তৰ্ক অনুপস্থিত ।" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ত্ৰুটি: '%s' যন্ত্ৰ পোৱা নাযায় ।" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "সফলতা: '%s' যন্ত্ৰ সফলতাৰে সংযোগ বিচ্ছিন্ন কৰা হৈছে ।" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ত্ৰুটি: '%s' (%s) যন্ত্ৰৰ সৈতে সংযোগ বিচ্ছিন্ন কৰিবলৈ ব্যৰ্থ: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "যন্ত্ৰৰ অৱস্থা: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ত্ৰুটি: iface নিৰ্ধাৰণ কৰা আৱশ্যক ।" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ভুল: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ভুল: 'dev wifi': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "ৱাই-ফাই স্কেনৰ তালিকা" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ত্ৰুটি: hwaddr '%s' সহ এক্সেচ পইন্ট পোৱা নাযায় ।" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ত্ৰুটি: '%s' যন্ত্ৰ ৱাই-ফাই যন্ত্ৰ নহয় ।" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ত্ৰুটি: 'dev wifi' আদেশ '%s' বৈধ নহয় ।" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ত্ৰুটি: 'dev' আদেশ '%s' বৈধ নহয় ।" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "চলমান" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "ৱাইফাই যান্ত্ৰিক সামগ্ৰী" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "ৱাইফাই" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN যান্ত্ৰিক সামগ্ৰী" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ব্যৱহাৰপ্ৰণালী: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "নিদ্ৰিত" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "সংযোগ কৰা হৈছে" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ভুল: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ভুল: 'nm status': %s; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager ৰ অৱস্থা" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "সক্ৰিয়" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "নিষ্ক্ৰিয়" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "চলি আছে" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "চলা নাই" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ভুল : '--fields' ৰ মান '%s' ইয়াত বৈধ নহয়; অনুমতি থকা ক্ষেত্ৰ: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "ৱাইফাই সক্ৰিয়" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ত্ৰুটিৰ: অবৈধ 'wifi' স্থিতিমাপ: '%s' ।" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN সক্ৰিয়" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ত্ৰুটি: অবৈধ 'wwan' স্থিতিমাপ: '%s' ।" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ত্ৰুটি: 'nm' আদেশ '%s' বৈধ নহয় ।" + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"ব্যৱহাৰপদ্ধতি: %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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ভুল: '%s' অব্জেক্ট অজ্ঞাত, 'nmcli help' ব্যৱহাৰৰ প্ৰচেষ্টা কৰক ।" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ভুল: '--terse' বিকল্পক দ্বিতীয় বাৰৰ বাবে নিৰ্ধাৰিত কৰা হৈছে ।" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ভুল: '--terse' বিকল্প '--pretty' ৰ সৈতে আছুতীয়া ।" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ভুল: '--pretty' বিকল্পক দ্বিতীয় বাৰৰ বাবে নিৰ্ধাৰিত কৰা হৈছে ।" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ভুল: '--pretty' বিকল্প '--terse' ৰ সৈতে আছুতীয়া ।" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ত্ৰুটি: '%s' বিকল্পৰ বাবে তৰ্ক নাই ।" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ত্ৰুটি: '%s' বিকল্প '%s' ৰ কাৰণে বৈধ তৰ্ক নহয় ।" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ত্ৰুটি: '%s' বিকল্পমূহৰ কাৰণে ক্ষেত্ৰ নাই ।" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli সৰঞ্জাম, সংস্কৰণ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ভুল: '%s' বিকল্প অজ্ঞাত, 'nmcli -help' ব্যৱহাৰৰ প্ৰয়োগ কৰক ।" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d সংকেত প্ৰাপ্ত হৈছে, বন্ধ কৰা হৈছে..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ত্ৰুটি: NetworkManager ৰ সৈতে সংযোগ স্থাপন কৰিবলৈ ব্যৰ্থ ।" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "সফল" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (১০৪/১২৮-বিট গুপ্তশব্দ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (অজ্ঞাত)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (অজ্ঞাত)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "যি কোনো, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "স্বয়ংক্ৰিয়" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "নিৰ্ধাৰত কৰা হোৱা নাই" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "'%s' ক্ষেত্ৰ অকলে থাকিব লাগিব" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "অবৈধ ক্ষেত্ৰ '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "'--terse' বিকল্পক '--fields' নিৰ্ধাৰণ কৰাৰ প্ৰয়োজন" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "'--terse' বিকল্পক নিৰ্দিষ্ট '--fields' বিকল্পৰ মানৰ প্ৰয়োজন, '%s' নহয়" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM চাবি নথিপত্ৰৰ কোনো সমাপ্তিৰ টেগ নাই '%s' ।" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "এটা PEM গোপনীয় চাবি নথিপত্ৰ নহয় ।" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM নথিপত্ৰৰ তথ্যে সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "ভুল PEM নথিপত্ৰ: প্ৰথম টেগ ৰূপে Proc-Type ব্যৱহাৰ কৰা নহয় ।" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "ভুল PEM নথিপত্ৰ: অজ্ঞাত Proc-Type টেগ '%s' ।" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "ভুল PEM নথিপত্ৰ: দ্বিতীয় টেগ ৰূপে DEK-Info ধাৰ্য কৰা নহয় ।" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "ভুল PEM নথিপত্ৰ: DEK-Info টেগত কোনো IV পোৱা নাযায় ।" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "ভুল PEM নথিপত্ৰ: DEK-Info টেগত IV ৰ বিন্যাস বৈধ নহয় ।" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "ভুল PEM নথিপত্ৰ: ব্যক্তিগত-চাবিৰ অজ্ঞাত ছাইফাৰ '%s' ।" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "ব্যক্তিগত চাবি ডিকোড কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "'%s' PEM প্ৰমাণপত্ৰত সমাপ্তিৰ টেগ '%s' নাই ।" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "প্ৰমাণপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "প্ৰমাণপত্ৰৰ তথ্য সংৰক্ষণৰ উদ্দেশ্যে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "নথিপত্ৰৰ তথ্য সংৰক্ষণৰ উদ্দেশ্যে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ৰ দৈৰ্ঘ্যৰ পৰিমাণ যুগ্ম সংখ্যক বাইটৰ হোৱা আৱশ্যক ।" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV-ত hexadecimal-নোহোৱা অন্য সংখ্যা উপস্থিত ।" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "ব্যক্তিগত চাবিৰ ছাইফাৰ '%s' অজ্ঞাত ।" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰাৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "ব্যক্তিগত চাবিৰ ধৰণ নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ডিক্ৰিপ্ট কৰা ব্যক্তিগত চাবি সংৰক্ষণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "ক্ৰিপ্টো কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "IV ৰ অবৈধ দৈৰ্ঘ্য (অন্তত %zd হোৱা আৱশ্যক) ।" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "ডিক্ৰিপ্ট কৰা চাবিৰ বাফাৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ডিক্ৰিপছন ছাইফাৰৰ সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ডিক্ৰিপছনৰ বাবে চিমেট্ৰিক চাবি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: পেডিংৰ দৈৰ্ঘ্য বৈধ নহয় ।" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "এনক্ৰিপ্ট কৰাৰ বাবে স্মৃতিশক্তি বিতৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "এনক্ৰিপশন চাইফাৰৰ সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "এনক্ৰিপশনৰ বাবে চিমেট্ৰিক-কি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "এনক্ৰিপশনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "তথ্য এনক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %s / %s ।" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "প্ৰমাণপত্ৰৰ তথ্য আৰম্ভ কৰিবলৈ সমস্যা: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "প্ৰমাণপত্ৰ ডি-কোড কৰিবলৈ ব্যৰ্থ: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ডিকোডাৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 নথিপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 নথিপত্ৰ প্ৰমাণিত কৰিবলৈ ব্যৰ্থ: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "ক্ৰিপ্টো কলঘৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %d ।" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %d ।" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "IV ৰ অবৈধ দৈৰ্ঘ্য (অন্তত %d হোৱা আৱশ্যক) ।" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ডিক্ৰিপছন ছাইফাৰ স্লট আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে চিমেট্ৰিক চাবি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ডিক্ৰিপছনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ডিক্ৰিপছন সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %d ।" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "ব্যক্তিগত চাবি ডিক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: ডিক্ৰিপ্ট কৰা তথ্য অত্যাধিক ডাঙৰ ।" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "ব্যক্তিগত চাবিৰ ডিক্ৰিপছন সমাপ্ত কৰিবলৈ ব্যৰ্থ: %d ।" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "এনক্ৰিপশন চাইফাৰ স্লট আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "এনক্ৰিপশনৰ উদ্দেশ্যে চিমেট্ৰিক-কি নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "এনক্ৰিপশনৰ উদ্দেশ্যে IV নিৰ্ধাৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "এনক্ৰিপশন সন্দৰ্ভ আৰম্ভ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "এনক্ৰিপ্ট কৰিবলৈ ব্যৰ্থ: %d ।" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "এনক্ৰিপ্ট কৰাৰ পিছত অপ্ৰত্যাশিত পৰিমাণ তথ্য উপলব্ধ হৈছে ।" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "প্ৰমাণপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "গুপ্তশব্দক UCS2 লৈ ৰূপান্তৰ কৰিবলৈ ব্যৰ্থ: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ডিকোডাৰ আৰম্ভ কৰিবলৈ ব্যৰ্থ: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 নথিপত্ৰ ডিকোড কৰিবলৈ ব্যৰ্থ: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 নথিপত্ৰ প্ৰমাণিত কৰিবলৈ ব্যৰ্থ: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "বিশৃঙ্খল তথ্য নিৰ্মাণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "এনক্ৰিপশন-কি নিৰ্মাণৰ বাবে পৰ্যাপ্ত স্মৃতিশক্তি অনুপস্থিত ।" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM নথিপত্ৰ নিৰ্মাণৰ বাবে স্মৃতিশক্তি বিতৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM নথিপত্ৰত IV লিখাৰ বাবে স্মৃতিশক্তি বিতৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM নথিপত্ৰত এনক্ৰিপ্ট কৰা চাবি লিখাৰ বাবে স্মৃতিশক্তি বিতৰণ কৰা নাযায় ।" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM নথিপত্ৰৰ তথ্যে সংৰক্ষণৰ বাবে স্মৃতিশক্তি বিতৰণ কৰিবলৈ ব্যৰ্থ ।" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink বাৰ্তা প্ৰক্ৰিয়াকৰণত ভুল: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "তথ্যৰ বাবে ছকেটত অপেক্ষা কৰোঁতে সমস্যা" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink ৰ সৈতে সংযোগ কৰিবলৈ ব্যৰ্থ: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink handle credential passing সক্ৰিয় কৰিবলৈ ব্যৰ্থ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink হেন্ডেল বিতৰণ কৰিবলৈ ব্যৰ্থ: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink লিংক কেশ্বে বিতৰণ কৰিবলৈ ব্যৰ্থ: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink দলে যোগ কৰিবলৈ ব্যৰ্থ: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "লিংক কোশ্বে উন্নত কৰিবলৈ সমস্যা: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"অবৈধ বিকল্প । বৈধ বিকল্পসমূহৰ তালিকা চোৱাৰ বাবে অনুগ্ৰহ কৰি --help প্ৰয়োগ কৰক " +"।\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s । বৈধ বিকল্পসমূহৰ তালিকা চোৱাৰ বাবে অনুগ্ৰহ কৰি --help প্ৰয়োগ কৰক ।\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager দ্বাৰা নিৰ্মিত\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s ৰ পৰা একত্ৰিত কৰা হৈছে\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ব্যৱহাৰযোগ্য DHCP ক্লায়েন্ট পোৱা নাযায় ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' পোৱা নাযায় ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' পোৱা নাযায় ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "অসমৰ্থিত DHCP ক্লায়েন্ট '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "অজ্ঞাত লগ স্তৰ '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "অজ্ঞাত লগ ডোমেইন '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "মন কৰিব: libc resolver ৰ দ্বাৰা ৩ তকৈ অধিক নামৰ সেৱক সমৰ্থিত ন'হ'বও পাৰে ।" + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "নিম্নলিখিত নাম-সেৱকসমূহ চিনাক্ত ন'হ'বও পাৰে ।" + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "স্বয়ংক্ৰিয় %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "প্ৰণালী" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "নিৰাপদ ৱাই-ফাইলৈ নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "উন্মুক্ত ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "প্ৰণালীৰ স্থায়ী গৃহস্থৰ নাম পৰিবৰ্তন কৰক" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "প্ৰণালীৰ সংযোগ পৰিবৰ্তন কৰক" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"প্ৰণালীত ব্যৱহৃত নিয়ম-নীতিৰ বিধিনিষেধৰ কাৰণে প্ৰণালীৰ বৈশিষ্ট্য পৰিবৰ্তন কৰা সম্ভৱ " +"নহয়" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"প্ৰণালীত ব্যৱহৃত নিয়ম-নীতিৰ বিধি নিষেধৰ কাৰণে প্ৰণালীৰ স্থায়ী গৃহস্থৰ নাম পৰিবৰ্তন " +"কৰা সম্ভৱ নহয়" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"প্ৰণালীৰ নিয়মনীতিয়ে নিৰাপদ ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ প্ৰতিৰোধ " +"কৰিছে" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"প্ৰণালীৰ নিয়মনীতিয়ে উন্মুক্ত ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ প্ৰতিৰোধ " +"কৰিছে" + +#~ msgid "Type" +#~ msgstr "ধৰণ" + +#~ msgid "Name" +#~ msgstr "নাম" + +#~ msgid "User connections:\n" +#~ msgstr "ব্যৱহাৰকৰ্তাৰ সংযোগ:\n" + +#~ msgid "System-wide connections" +#~ msgstr "প্ৰণালী ব্যাপী সংযোগ" + +#~ msgid "Default" +#~ msgstr "অবিকল্পিত" + +#~ msgid "Service" +#~ msgstr "সেৱা" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, ফ্ৰিকোৱেন্সি %d MHz, হাৰ %d Mb/s, ক্ষমতা %d" + +#~ msgid "Device" +#~ msgstr "যন্ত্ৰ" + +#~ msgid "Driver" +#~ msgstr "চালক" + +#~ msgid "State" +#~ msgstr "অৱস্থা" + +#~ msgid "HW Address" +#~ msgstr "HW ঠিকনা" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " কৰ্মক্ষমতা:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "পৰিবহণকৰ্তা চিনাক্তকৰণ" + +#~ msgid "Speed" +#~ msgstr "গতি" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " বেতাঁৰ সংযোগৰ বৈশিষ্ট্য\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP এনক্ৰিপশন" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA এনক্ৰিপশন" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 এনক্ৰিপশন" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP চাইফাৰ" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP চাইফাৰ" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " বেতাঁৰ এক্সেচ পইন্ট %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = বৰ্তমান AP)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " তাঁৰযুক্ত সংযোগৰ বৈশিষ্ট্য\n" + +#~ msgid "Carrier" +#~ msgstr "পৰিবহণকৰ্তা" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4 ৰ বৈশিষ্ট্য:\n" + +#~ msgid "Address" +#~ msgstr "ঠিকনা" + +#~ msgid "Prefix" +#~ msgstr "উপসৰ্গ" + +#~ msgid "Gateway" +#~ msgstr "গে'টৱে" + +#~ msgid "Device:" +#~ msgstr "যন্ত্ৰ:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "ত্ৰুটি: hwaddr উল্লেখ কৰা আৱশ্যক ।" + +#~ msgid "AP parameters" +#~ msgstr "AP ৰ স্থিতিমাপ" + +#~ msgid "Frequency:" +#~ msgstr "ফ্ৰিকোৱেন্সি:" + +#~ msgid "Mode:" +#~ msgstr "মোড:" + +#~ msgid "Ad-hoc" +#~ msgstr "এড-হক" + +#~ msgid "Maximal bitrate:" +#~ msgstr "সৰ্বাধিক বিট ৰেট:" + +#~ msgid "Strength:" +#~ msgstr "ক্ষমতা:" + +#~ msgid "Flags:" +#~ msgstr "ফ্লেগ:" + +#~ msgid "privacy" +#~ msgstr "গোপনীয়" + +#~ msgid "WPA flags:" +#~ msgstr "WPA ফ্লেগ:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN ফ্লেগ:" + +#~ msgid "NM running:" +#~ msgstr "NM চলি আছে:" + +#~ msgid "NM state:" +#~ msgstr "NM ৰ অৱস্থা:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM বেতাঁৰ যান্ত্ৰিক সামগ্ৰী:" + +#~ msgid "NM wireless:" +#~ msgstr "NM বেতাঁৰ:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN যান্ত্ৰিক সামগ্ৰী:" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "লিংকৰ অৱস্থা নিৰীক্ষণৰ উদ্দেশ্যে netlink দলত যোগ কৰিবলৈ ব্যৰ্থ: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "netlink ৰ সৈতে সংযোগ কৰিবলৈ ব্যৰ্থ: %s" diff --git a/po/be@latin.po b/po/be@latin.po new file mode 100644 index 00000000..ab4d7705 --- /dev/null +++ b/po/be@latin.po @@ -0,0 +1,68 @@ +msgid "" +msgstr "" +"Project-Id-Version: network-manager-ui\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-03-29 21:42+0200\n" +"PO-Revision-Date: 2008-03-29 21:43+0200\n" +"Last-Translator: Ihar Hrachyshka \n" +"Language-Team: Belarusian Latin \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\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" +"X-Poedit-Language: Belarusian\n" +"X-Poedit-Country: BELARUS\n" + +#: ../src/nm-netlink-monitor.c:188 ../src/nm-netlink-monitor.c:448 +#, c-format +msgid "error processing netlink message: %s" +msgstr "pamyłka pry apracoŭvańni paviedamleńnia ad sietkavaha linka: %s" + +#: ../src/nm-netlink-monitor.c:245 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"niemahčyma vydzielić handle dla sietkavaha linka, kab nazirać za jaho " +"stanam: %s" + +#: ../src/nm-netlink-monitor.c:255 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"niemahčyma spałučycca z sietkavym linkam, kab nazirać za jaho stanam: %s" + +#: ../src/nm-netlink-monitor.c:263 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"niemahčyma ŭvajści ŭ hrupu sietkavaha linka, kab nazirać za jaho stanam: %s" + +#: ../src/nm-netlink-monitor.c:271 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"niemahčyma vydzielić keš dla sietkavaha linka, kab nazirać za jaho stanam: %s" + +#: ../src/nm-netlink-monitor.c:471 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "pry čakańni źviestak na sokiecie adbyłasia pamyłka" + +#: ../src/NetworkManager.c:256 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Niapravilnaja opcyja. Kab pahladzieć śpis mahčymych opcyj, užyj --help.\n" + +#: ../src/named-manager/nm-named-manager.c:218 +msgid "NOTE: the glibc resolver does not support more than 3 nameservers." +msgstr "UVAHA: resolver glibc nie padtrymlivaje bolš za 3 servery nazvaŭ." + +#: ../src/named-manager/nm-named-manager.c:220 +msgid "The nameservers listed below may not be recognized." +msgstr "Niemahčyma paznać nastupnyja servery nazvaŭ." + +#: ../system-settings/plugins/ifcfg-fedora/plugin.c:76 +msgid "Auto Wired" +msgstr "Aŭtamatyčna źviazany" diff --git a/po/bg.po b/po/bg.po new file mode 100644 index 00000000..a423af31 --- /dev/null +++ b/po/bg.po @@ -0,0 +1,962 @@ +# Bulgarian translation of NetworkManager po-file +# Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. +# This file is distributed under the same license as the NetworkManager package. +# Alexander Shopov , 2005, 2007, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager trunk\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-02 08:52+0300\n" +"PO-Revision-Date: 2008-08-01 07:30+0300\n" +"Last-Translator: Alexander Shopov \n" +"Language-Team: Bulgarian \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" + +#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:471 +#, c-format +msgid "error processing netlink message: %s" +msgstr "грешка при обработката на следното съобщение от мрежовия слой: %s" + +#: ../src/nm-netlink-monitor.c:250 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"не може да се зададе модул в мрежовия слой за наблюдение на състоянието на " +"връзката — %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"не може да се осъществи връзка с мрежовия слой за наблюдение на състоянието " +"на връзката — %s" + +#: ../src/nm-netlink-monitor.c:268 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"не може да се осъществи присъединяване към групата на мрежовия слой за " +"наблюдение на състоянието на връзката — %s" + +#: ../src/nm-netlink-monitor.c:276 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"не може да се зададе временна памет в мрежовия слой за наблюдение на " +"състоянието на връзката — %s" + +#: ../src/nm-netlink-monitor.c:494 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "грешка при изчакване за данни през гнездо" + +#: ../src/NetworkManager.c:250 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Неправилна опция. Ползвайте --help, за да видите списъка с опции.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 +msgid "# Created by NetworkManager\n" +msgstr "# Създаден от NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Слят от %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:117 +msgid "NOTE: the glibc resolver does not support more than 3 nameservers." +msgstr "БЕЛЕЖКА: стандартно glibc поддържа максимум 3 сървъра за имена." + +#: ../src/named-manager/nm-named-manager.c:119 +msgid "The nameservers listed below may not be recognized." +msgstr "Сървърите за имена отдолу могат да не бъдат разпознати." + +#: ../system-settings/src/main.c:365 +#, c-format +msgid "Auto %s" +msgstr "Автоматично %s" + +#: ../libnm-util/crypto.c:125 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Крайният етикет „%s“ липсва в сертификат във формат PEM." + +#: ../libnm-util/crypto.c:135 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Това не изглежда да е сертификат във формат PEM с частен ключ." + +#: ../libnm-util/crypto.c:143 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "" +"Няма достатъчно памет за запазването на данните от сертификата във формат " +"PEM." + +#: ../libnm-util/crypto.c:159 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "" +"Неправилен сертификат във формат PEM: първият етикет не беше „Proc-Type“." + +#: ../libnm-util/crypto.c:167 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "" +"Неправилен сертификат във формат PEM: непознат етикет „Proc-Type“ — „%s“." + +#: ../libnm-util/crypto.c:177 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "" +"Неправилен сертификат във формат PEM: вторият етикет не беше „DEK-Info“." + +#: ../libnm-util/crypto.c:188 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "" +"Неправилен сертификат във формат PEM: липсва първоначален вектор в етикета " +"„DEK-Info“." + +#: ../libnm-util/crypto.c:195 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" +"Неправилен сертификат във формат PEM: неправилен първоначален вектор в " +"етикета „DEK-Info“." + +#: ../libnm-util/crypto.c:208 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "" +"Неправилен сертификат във формат PEM: непознат шифър за частен ключ „%s“." + +#: ../libnm-util/crypto.c:227 +#, c-format +msgid "Could not decode private key." +msgstr "Частният ключ не може да бъде декодиран." + +#: ../libnm-util/crypto.c:271 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Крайният етикет „1$%s“ липсва в сертификата във формат PEM — „2$%s“." + +#: ../libnm-util/crypto.c:281 +#, c-format +msgid "Failed to decode certificate." +msgstr "Сертификатът не може да бъде декодиран." + +#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Няма памет за запазването на данните от сертификат." + +#: ../libnm-util/crypto.c:328 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "Началният вектор трябва да е четен брой байта на дължина." + +#: ../libnm-util/crypto.c:337 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Няма достатъчно памет за запазването на началния вектор." + +#: ../libnm-util/crypto.c:348 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "Началният вектор съдържа низ, който не е шестнайсетично число." + +#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:126 +#: ../libnm-util/crypto_nss.c:136 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Шифърът за частен ключ „%s“ е непознат." + +#: ../libnm-util/crypto.c:395 +#, c-format +msgid "Not enough memory to create private key decryption key." +msgstr "Няма достатъчно памет за създаването на частен ключ за дешифриране." + +#: ../libnm-util/crypto.c:513 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Няма достатъчно памет за запазването на частен ключ за дешифриране." + +#: ../libnm-util/crypto_gnutls.c:73 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Модулът за MD5 не може да бъде инициализиран: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:135 ../libnm-util/crypto_nss.c:145 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Няма достатъчно памет за буфера за дешифриране." + +#: ../libnm-util/crypto_gnutls.c:143 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Контекстът за дешифриране не може да бъде инициализиран: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:152 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Симетричният ключ за дешифриране не може да бъде зададен: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:161 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Началният вектор за дешифриране не може да бъде зададен: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:170 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Частният ключ не може да бъде дешифриран: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:208 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Грешка при инициализиране на данните от сертификата: %s" + +#: ../libnm-util/crypto_gnutls.c:220 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Сертификатът не може да бъде декодиран: %s" + +#: ../libnm-util/crypto_nss.c:78 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Контекстът за MD5 не може да бъде инициализиран: %d." + +#: ../libnm-util/crypto_nss.c:153 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Буферът за шифъра за дешифриране не може да бъде инициализиран." + +#: ../libnm-util/crypto_nss.c:163 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Симетричният ключ за дешифриране не може да бъде зададен." + +#: ../libnm-util/crypto_nss.c:173 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Началният вектор за дешифриране не може да бъде зададен." + +#: ../libnm-util/crypto_nss.c:181 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Контекстът за дешифриране не може да бъде инициализиран." + +#: ../libnm-util/crypto_nss.c:194 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Частният ключ не може да бъде дешифриран: %d." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Дешифрирането на частния ключ не може да приключи: %d." + +#: ../libnm-util/crypto_nss.c:250 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Сертификатът не може да бъде дешифриран: %d" + +#~ msgid "Passphrase for wireless network %s" +#~ msgstr "Парола за безжичната мрежа %s" + +#~ msgid "Connection to the wireless network '%s' failed." +#~ msgstr "Неуспешно свързване към безжичната мрежа „%s“." + +#~ msgid "Connection to the wired network failed." +#~ msgstr "Неуспешно свързване към кабелната мрежа." + +#~ msgid "Error displaying connection information:" +#~ msgstr "Грешка при показване на информацията за връзката:" + +#~ msgid "Could not find some required resources (the glade file)!" +#~ msgstr "Някои ресурси не бяха открити (файлът на glade)!" + +#~ msgid "No active connections!" +#~ msgstr "Няма действащи връзки!" + +#~ msgid "%d Mb/s" +#~ msgstr "%d Mb/s" + +#~ msgid "Wired Ethernet (%s)" +#~ msgstr "Кабелен Етернет (%s)" + +#~ msgid "Wireless Ethernet (%s)" +#~ msgstr "Безжичен Етернет (%s)" + +#~ msgid "Unknown" +#~ msgstr "неопределима" + +#~ msgid "NetworkManager Applet" +#~ msgstr "Аплетът NetworkManager" + +#~ msgid "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Авторски права © 2004—2006 Red Hat, Inc.\n" +#~ "Авторски права © 2004—2006 Novell, Inc." + +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "" +#~ "Аплет за областта за уведомяване за управление на мрежовите устройства и " +#~ "връзки." + +#~ msgid "translator-credits" +#~ msgstr "" +#~ "Александър Шопов \n" +#~ "\n" +#~ "Проектът за превод на GNOME има нужда от подкрепа.\n" +#~ "Научете повече за нас на http://gnome.cult.bg\n" +#~ "Докладвайте за грешки на http://gnome.cult.bg/bugs<" + +#~ msgid "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Авторски права © 2004—2005 Red Hat, Inc.\n" +#~ "Авторски права © 2005—2006 Novell, Inc." + +#~ msgid "VPN Login Failure" +#~ msgstr "Грешка при идентификация пред ВЧМ" + +#~ msgid "Could not start the VPN connection '%s' due to a login failure." +#~ msgstr "" +#~ "Неуспех при осъществяването на връзката към ВЧМ „%s“ поради грешка в " +#~ "идентификацията." + +#~ msgid "VPN Start Failure" +#~ msgstr "Грешка при стартиране на ВЧМ" + +#~ msgid "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." +#~ msgstr "" +#~ "Връзката към ВЧМ „%s“ се провали поради грешка при стартиране на " +#~ "програмата за ВЧМ." + +#~ msgid "VPN Connect Failure" +#~ msgstr "Грешка при свързване към ВЧМ" + +#~ msgid "Could not start the VPN connection '%s' due to a connection error." +#~ msgstr "Връзката към ВЧМ „%s“ се провали поради грешка при свързването." + +#~ msgid "VPN Configuration Error" +#~ msgstr "Грешка в настройките на ВЧМ" + +#~ msgid "The VPN connection '%s' was not correctly configured." +#~ msgstr "Връзката към ВЧМ „%s“ е с неправилни настройки." + +#~ msgid "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." +#~ msgstr "" +#~ "Връзката към ВЧМ „%s“ се провали, защото настройките на мрежата върнати " +#~ "от сървъра за ВЧМ бяха неправилни." + +#~ msgid "VPN Login Message" +#~ msgstr "Съобщение при идентификация пред ВЧМ" + +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "Аплетът NetworkManager не можа да открие някои задължителни ресурси " +#~ "(файлът на glade)." + +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "Мрежовото устройство „%s (%s)“ не поддържа безжично претърсване." + +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "Мрежовото устройство „%s (%s)“ не поддържа засичане на връзка." + +#~ msgid "(unknown)" +#~ msgstr "(не се знае)" + +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "Подготвяне на устройството „%s“ за кабелната мрежа…" + +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "Подготвяне на устройството „%s“ за безжичната мрежа „%s“…" + +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "Настройване на устройството „%s“ за кабелната мрежа…" + +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "Опит за свързване към безжичната мрежа „%s“…" + +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "Изчакване за мрежовия ключ за безжичната мрежа „%s“…" + +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "Запитване на кабелната мрежа за адрес…" + +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "Запитване на безжичната мрежа „%s“ за адрес…" + +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "Завършване на връзката към кабелната мрежа…" + +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "Завършване на връзката към безжичната мрежа „%s“…" + +#~ msgid "NetworkManager is not running" +#~ msgstr "NetworkManager не е включен" + +#~ msgid "Networking disabled" +#~ msgstr "Мрежата е изключена" + +#~ msgid "No network connection" +#~ msgstr "Няма връзка към мрежа" + +#~ msgid "Wired network connection" +#~ msgstr "Връзка към кабелна мрежа" + +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Връзка към инцидентна, безжична мрежа" + +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Безжична връзка към „%s“ (%d%%)" + +#~ msgid "VPN connection to '%s'" +#~ msgstr "Връзка по ВЧМ към „%s“" + +#~ msgid "VPN connecting to '%s'" +#~ msgstr "Свързване по ВЧМ към „%s“" + +#~ msgid "_Connect to Other Wireless Network..." +#~ msgstr "_Свързване към други безжични мрежи…" + +#~ msgid "Create _New Wireless Network..." +#~ msgstr "Създаване на _нова безжична мрежа…" + +#~ msgid "_VPN Connections" +#~ msgstr "_Връзки по ВЧМ" + +#~ msgid "_Configure VPN..." +#~ msgstr "_Настройване на ВЧМ…" + +#~ msgid "_Disconnect VPN..." +#~ msgstr "_Прекъсване на ВЧМ…" + +#~ msgid "_Dial Up Connections" +#~ msgstr "_Връзки по телефонна линия" + +#~ msgid "Connect to %s..." +#~ msgstr "Свързване към %s…" + +#~ msgid "Disconnect from %s..." +#~ msgstr "Прекъсване на връзката към %s…" + +#~ msgid "No network devices have been found" +#~ msgstr "Не са открити мрежови устройства" + +#~ msgid "NetworkManager is not running..." +#~ msgstr "NetworkManager не е включен…" + +#~ msgid "Enable _Networking" +#~ msgstr "_Включване на мрежата" + +#~ msgid "Enable _Wireless" +#~ msgstr "Включване на _безжичната мрежа" + +#~ msgid "Connection _Information" +#~ msgstr "_Информация за връзката" + +#~ msgid "_Help" +#~ msgstr "_Помощ" + +#~ msgid "_About" +#~ msgstr "_Относно" + +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "Аплетът NetworkManager не може да открие необходим ресурс. Програмата не " +#~ "може да продължи работа.\n" + +#~ msgid "Open System" +#~ msgstr "Открита система" + +#~ msgid "Shared Key" +#~ msgstr "Споделен ключ" + +#~ msgid "Automatic (Default)" +#~ msgstr "Автоматично (по подразбиране)" + +#~ msgid "AES-CCMP" +#~ msgstr "AES-CCMP" + +#~ msgid "TKIP" +#~ msgstr "TKIP" + +#~ msgid "Dynamic WEP" +#~ msgstr "Динамичен WEP" + +#~ msgid "None" +#~ msgstr "Без" + +#~ msgid "WEP 64/128-bit ASCII" +#~ msgstr "40/128-битов ключ за WEP в ASCII" + +#~ msgid "WEP 64/128-bit Hex" +#~ msgstr "40/128-битов шестнадесетичен ключ за WEP" + +#~ msgid "WEP 128-bit Passphrase" +#~ msgstr "128 битова парола WEP" + +#~ msgid "PEAP" +#~ msgstr "PEAP" + +#~ msgid "TLS" +#~ msgstr "TLS" + +#~ msgid "TTLS" +#~ msgstr "TTLS" + +#~ msgid "WPA2 Enterprise" +#~ msgstr "WPA2 Enterprise" + +#~ msgid "WPA Enterprise" +#~ msgstr "WPA Enterprise" + +#~ msgid "WPA2 Personal" +#~ msgstr "WPA2 Personal" + +#~ msgid "WPA Personal" +#~ msgstr "WPA Personal" + +#~ msgid "Orientation" +#~ msgstr "Ориентация" + +#~ msgid "The orientation of the tray." +#~ msgstr "Ориентацията на тавата" + +#~ msgid "Wired Network (%s)" +#~ msgstr "Кабелна мрежа (%s)" + +#~ msgid "_Wired Network" +#~ msgstr "_Кабелна мрежа" + +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "Безжична мрежа (%s)" +#~ msgstr[1] "Безжични мрежи (%s)" + +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "Безжична мрежа" +#~ msgstr[1] "Безжични мрежи" + +#~ msgid " (invalid Unicode)" +#~ msgstr " (невалиден Уникод)" + +#~ msgid "" +#~ "By default, the wireless network's name is set to your computer's name, %" +#~ "s, with no encryption enabled" +#~ msgstr "" +#~ "По подразбиране името на безжичната мрежа е името на компютъра ви, „%s“, " +#~ "без шифриране" + +#~ msgid "Create new wireless network" +#~ msgstr "Създаване на нова безжична мрежа" + +#~ msgid "" +#~ "Enter the name and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "" +#~ "Въведете името и настройките на сигурността на безжичната мрежа, която " +#~ "искате да създадете." + +#~ msgid "Create New Wireless Network" +#~ msgstr "Създаване на нова безжична мрежа" + +#~ msgid "Existing wireless network" +#~ msgstr "Съществуваща безжична мрежа" + +#~ msgid "Enter the name of the wireless network to which you wish to connect." +#~ msgstr "" +#~ "Въведете името на безжичната мрежа, към която искате да се свържете." + +#~ msgid "Connect to Other Wireless Network" +#~ msgstr "Свързване към друга безжична мрежа" + +#~ msgid "Error connecting to wireless network" +#~ msgstr "Грешка при свързване към друга безжична мрежа" + +#~ msgid "" +#~ "The requested wireless network requires security capabilities unsupported " +#~ "by your hardware." +#~ msgstr "Хардуерът ви не поддържа изискванията на поисканата безжична мрежа." + +#~ msgid "Cannot start VPN connection '%s'" +#~ msgstr "Връзката към ВЧМ „%s“ не може да бъде стартирана" + +#~ msgid "" +#~ "Could not find the authentication dialog for VPN connection type '%s'. " +#~ "Contact your system administrator." +#~ msgstr "" +#~ "Диалоговата кутия за идентификация пред ВЧМ „%s“ не може да бъде открита. " +#~ "Свържете се със системния администратор." + +#~ msgid "" +#~ "There was a problem launching the authentication dialog for VPN " +#~ "connection type '%s'. Contact your system administrator." +#~ msgstr "" +#~ "Имаше проблем с показването на диалоговата кутия за идентификация пред " +#~ "ВЧМ „%s“. Свържете се със системния администратор." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "" +#~ "Active Connection Information" +#~ msgstr "" +#~ "Информация за действащата връзка" + +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "Безжичната мрежа изисква парола\n" +#~ "\n" +#~ "Необходима е парола или ключ за шифриране, за да се свържете с безжичната " +#~ "мрежа „%s“." + +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "Ограничена функционалност на " +#~ "мрежата\n" +#~ "\n" +#~ "%s няма да функционира изцяло." + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen to log in to the wireless network '%s'. If you are sure " +#~ "that this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will not require confirmation on subsequent log ins." +#~ msgstr "" +#~ "Потвърждение за свързване към " +#~ "безжична мрежа\n" +#~ "\n" +#~ "Избрали сте да се свържете към безжичната мрежа „%s“. Ако сте уверени, че " +#~ "тя е сигурна и можете да ѝ се доверите, задайте настройката отдолу и " +#~ "NetworkManager няма да ви иска потвърждения при следващи влизания." + +#~ msgid "Anonymous Identity:" +#~ msgstr "Анонимна идентичност:" + +#~ msgid "Authentication:" +#~ msgstr "Идентификация:" + +#~ msgid "Broadcast Address:" +#~ msgstr "Адрес за разпръскване:" + +#~ msgid "CA Certificate File:" +#~ msgstr "Файл със сертификатите на сертифициращите организации:" + +#~ msgid "C_onnect" +#~ msgstr "_Свързване" + +#~ msgid "Client Certificate File:" +#~ msgstr "Файл с клиентските сертификати:" + +#~ msgid "Connection Information" +#~ msgstr "Информация за връзката" + +#~ msgid "Default Route:" +#~ msgstr "Маршрут по подразбиране:" + +#~ msgid "Destination Address:" +#~ msgstr "Целеви адрес:" + +#~ msgid "Driver:" +#~ msgstr "Драйвер:" + +#~ msgid "EAP Method:" +#~ msgstr "Метод за EAP:" + +#~ msgid "Hardware Address:" +#~ msgstr "Хардуерен адрес:" + +#~ msgid "IP Address:" +#~ msgstr "IP адрес:" + +#~ msgid "Identity:" +#~ msgstr "Идентичност:" + +#~ msgid "Interface:" +#~ msgstr "Интерфейс:" + +#~ msgid "Key Type:" +#~ msgstr "Вид ключ:" + +#~ msgid "Key management:" +#~ msgstr "Управление на ключове:" + +#~ msgid "Key:" +#~ msgstr "Ключ:" + +#~ msgid "" +#~ "None\n" +#~ "WEP 128-bit Passphrase\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" +#~ msgstr "" +#~ "Няма\n" +#~ "128 битова парола WEP\n" +#~ "40/128-битов шестнадесетичен ключ за WEP\n" +#~ "40/128-битов ключ за WEP в ASCII\n" + +#~ msgid "" +#~ "Open System\n" +#~ "Shared Key" +#~ msgstr "" +#~ "Открита система\n" +#~ "Споделен ключ" + +#~ msgid "Other Wireless Network..." +#~ msgstr "Друга безжична мрежа…" + +#~ msgid "Passphrase:" +#~ msgstr "Парола:" + +#~ msgid "Password:" +#~ msgstr "Парола:" + +#~ msgid "Primary DNS:" +#~ msgstr "Основен сървър за DNS:" + +#~ msgid "Private Key File:" +#~ msgstr "Файл с частните ключове:" + +#~ msgid "Private Key Password:" +#~ msgstr "Парола за частния ключ:" + +#~ msgid "Secondary DNS:" +#~ msgstr "Допълнителен сървър за DNS:" + +#~ msgid "Select the CA Certificate File" +#~ msgstr "Избор на файла със сертификатите на сертифициращите организации" + +#~ msgid "Select the Client Certificate File" +#~ msgstr "Избор на файла с клиентските сертификати" + +#~ msgid "Select the Private Key File" +#~ msgstr "Избор на файла с частните ключове" + +#~ msgid "Show key" +#~ msgstr "Показване на ключа" + +#~ msgid "Show passphrase" +#~ msgstr "Показване на паролата" + +#~ msgid "Show password" +#~ msgstr "Показване на паролата" + +#~ msgid "Show passwords" +#~ msgstr "Показване на паролите" + +#~ msgid "Speed:" +#~ msgstr "Скорост:" + +#~ msgid "Subnet Mask:" +#~ msgstr "Маска на подмрежата:" + +#~ msgid "Type:" +#~ msgstr "Вид:" + +#~ msgid "User Name:" +#~ msgstr "Потребителско име:" + +#~ msgid "Wireless Network Key Required" +#~ msgstr "Необходим е ключ за безжична мрежа" + +#~ msgid "Wireless _adapter:" +#~ msgstr "Безжичен _адаптер:" + +#~ msgid "_Always Trust this Wireless Network" +#~ msgstr "_Постоянно доверие на тази безжична мрежа" + +#~ msgid "_Don't remind me again" +#~ msgstr "_Да няма нови напомняния" + +#~ msgid "_Fallback on this Network" +#~ msgstr "Тази мрежа да е и _резервна" + +#~ msgid "_Login to Network" +#~ msgstr "_Свързване към мрежа" + +#~ msgid "_Network Name:" +#~ msgstr "_Име на мрежа:" + +#~ msgid "_Wireless Security:" +#~ msgstr "_Безжична сигурност:" + +#~ msgid "Cannot add VPN connection" +#~ msgstr "Не може да се добави връзка към ВЧМ" + +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "" +#~ "Не е открит подходящ софтуер за ВЧМ. Свържете се със системния " +#~ "администратор." + +#~ msgid "Cannot import VPN connection" +#~ msgstr "Връзката към ВЧМ не може да се внесе" + +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "Файлът „%2$s“ не може да се внесе, защото не може да се открие подходящ " +#~ "софтуер за връзка към ВЧМ от вида „%1$s“. Свържете се със системния " +#~ "администратор." + +#~ msgid "Error retrieving VPN connection '%s'" +#~ msgstr "Грешка при получаване на информация за връзката към ВЧМ „%s“" + +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "" +#~ "Файловете с описание на графичния интерфейс за връзки към ВЧМ от вида „%" +#~ "s“ не могат да бъдат открити. Свържете се със системния администратор." + +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "Да се изтрие ли връзката към ВЧМ „%s“?" + +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "Цялата информация за връзката към ВЧМ „%s“ ще бъде изтрита и може да се " +#~ "наложи да я искате наново от системния администратор, ако искате да я " +#~ "създадете наново." + +#~ msgid "Unable to load" +#~ msgstr "Неуспех при зареждане" + +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "Някои ресурси не бяха открити (файлът на glade)!" + +#~ msgid "Create VPN Connection" +#~ msgstr "Създаване на връзка към ВЧМ" + +#~ msgid "Edit VPN Connection" +#~ msgstr "Редактиране на връзка към ВЧМ" + +#~ msgid "Add a new VPN connection" +#~ msgstr "Добавяне на нова връзка към ВЧМ" + +#~ msgid "Delete the selected VPN connection" +#~ msgstr "Изтриване на избраната връзка към ВЧМ" + +#~ msgid "E_xport" +#~ msgstr "_Изнасяне" + +#~ msgid "Edit the selected VPN connection" +#~ msgstr "Редактиране на избраната връзка към ВЧМ" + +#~ msgid "Export the VPN settings to a file" +#~ msgstr "Изнасяне на настройките за ВЧМ във файл" + +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "Изнасяне на избраната връзка към ВЧМ във файл" + +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "Управление на връзките към ВЧМ" + +#~ msgid "VPN Connections" +#~ msgstr "Връзки към ВЧМ" + +#~ msgid "40-bit WEP" +#~ msgstr "40-битов WEP" + +#~ msgid "104-bit WEP" +#~ msgstr "104-битов WEP" + +#~ msgid "WPA TKIP" +#~ msgstr "WPA TKIP" + +#~ msgid "WPA CCMP" +#~ msgstr "WPA CCMP" + +#~ msgid "WPA Automatic" +#~ msgstr "Автоматичен WPA" + +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" + +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" + +#~ msgid "WPA2 Automatic" +#~ msgstr "Автоматичен WPA2" + +#~ msgid "none" +#~ msgstr "липсва" + +#~ msgid "operation took too long" +#~ msgstr "операцията продължи прекалено дълго" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "получени са данни от неправилен вид изпращач" + +#~ msgid "received data from unexpected sender" +#~ msgstr "получени са данни от неочакван изпращач" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "" +#~ "през гнездото са получени прекалено много данни и някои от тях са загубени" + +#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." +#~ msgstr "Свързали сте се към инцидентната, безжична мрежа „%s“." + +#~ msgid "You are now connected to the wireless network '%s'." +#~ msgstr "Свързани сте към безжичната мрежа „%s“." + +#~ msgid "You are now connected to the wired network." +#~ msgstr "Свързани сте към кабелната мрежа." + +#~ msgid "Connection Established" +#~ msgstr "Връзката е осъществена" + +#~ msgid "Disconnected" +#~ msgstr "Без връзка" + +#~ msgid "The network connection has been disconnected." +#~ msgstr "Връзката към мрежата е прекъсната." + +#~ msgid "LEAP" +#~ msgstr "LEAP" diff --git a/po/bn_IN.po b/po/bn_IN.po new file mode 100644 index 00000000..f6c295c9 --- /dev/null +++ b/po/bn_IN.po @@ -0,0 +1,1648 @@ +# translation of bn_IN.po to Bengali INDIA +# Bengali (India) translation of NetworkManager. +# Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the NetworkManager package. +# +# Runa Bhattacharjee , 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: bn_IN\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:43+0530\n" +"Last-Translator: Runa Bhattacharjee \n" +"Language-Team: Bengali INDIA \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ব্যবহারপ্রণালী: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "ত্রুটি: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ত্রুটি: 'con list': %s; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "সংযোগ সংক্রান্ত বিবরণ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "সিস্টেম" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ব্যবহারকারী" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "কখনো নয়" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "হ্যাঁ" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "না" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "সিস্টেমের সংযোগ" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ব্যবহারকারীর সংযোগ" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ত্রুটি: %s আর্গুমেন্ট অনুপস্থিত।" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ত্রুটি: %s - এই ধরনের কোনো সংযোগ উপস্থিত নেই।" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "অজানা পরামিতি: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ত্রুটি: বৈধ পরামিতি উল্লেখ করা যায়নি।" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ত্রুটি: %s।" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ত্রুটি: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ত্রুটি: 'con status': %s; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "সক্রিয় সংযোগ" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "'%s' ডিভাইসের মধ্যে কোনো সক্রিয় সংযোগ উপস্থিত নেই" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "কোনো সক্রিয় সংযোগ অথবা ডিভাইস উপস্থিত নেই" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "'%s' ডিভাইসের সাথে '%s' সংযোগটি সুসংগত নয়" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "'%s' সংযোগের জন্য কোনো ডিভাইস পাওয়া যায়নি" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "সক্রিয় করা হচ্ছে" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "সক্রিয় করা হয়েছে" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "অজানা" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (প্রস্তুতি)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (অনুমোদন প্রয়োজন)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN সংযোগ স্থাপন করা হচ্ছে" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN সংযোগ স্থাপন করা হচ্ছে (IP কনফিগারেশন প্রাপ্ত করা হচ্ছে)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN সংযোগ স্থাপন করা হয়েছে" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN সংযোগ বিফল হয়েছে" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN সংযোগ বিচ্ছিন্ন করা হয়েছে" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "অজানা কারণ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "শূণ্য" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ব্যবহারকারীর সাথে সংযোগ বিচ্ছিন্ন করা হয়েছে" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "মূল নেটওয়ার্ক সংযোগ বিঘ্নিত হয়েছে" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "অপ্রত্যাশিতভাবে VPN পরিসেবা বন্ধ করা হয়েছে" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN পরিসেবা থেকে অবৈধ কনফিগারেশন পাওয়া গিয়েছে" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "সংযোগের প্রয়াসকালে সময়সীমা উত্তীর্ণ হয়েছে" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "যথাযত সময়ে VPN পরিসেবা আরম্ভ করা হয়নি" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN পরিসেবা আরম্ভ করা যায়নি" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "VPN-র বৈধ গোপন তথ্য উপস্থিত নেই" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "VPN-র অবৈধ গোপন তথ্য" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "সংযোগ মুছে ফেলা হয়েছে" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "অবস্থা: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "সংযোগ সক্রিয় করা হয়েছে\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ।" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "অবস্থা: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ: %s।" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ত্রুটি: %d সেকেন্ডের সময়সীমা উত্তীর্ণ হয়েছে।" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ত্রুটি: সংযোগ সক্রিয় করতে ব্যর্থ: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ত্রুটি: '%s'-র জন্য সক্রিয় সংযোগ প্রাপ্ত করতে ব্যর্থ।" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "সক্রিয় সংযোগের অবস্থা: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "সক্রিয় সংযোগের পাথ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ত্রুটি: অজানা সংযোগ: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ত্রুটি: '%s' সময়সীমার মান বৈধ নয়।" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ত্রুটি: id অথবা uuid নির্ধারণ করা আবশ্যক।" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ত্রুটি: প্রযোজ্য কোনো ডিভাইস পাওয়া যায়নি: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ত্রুটি: কোনো প্রযোজ্য ডিভাইস পাওয়া যায়নি।" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "সতর্কবার্তা: সংযোগ সক্রিয় নয়\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ত্রুটি: 'con' কমান্ড '%s', বৈধ নয়।" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ত্রুটি: D-Bus-র সাথে সংযোগ করতে ব্যর্থ।" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ত্রুটি: সিস্টেমের বৈশিষ্ট্য প্রাপ্ত করতে ব্যর্থ।" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ত্রুটি: ব্যবহারকারীর বৈশিষ্ট্য প্রাপ্ত করতে ব্যর্থ" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ত্রুটি: সংযোগ প্রাপ্ত করতে ব্যর্থ: বৈশিষ্ট্যের পরিসেবা বর্তমানে চলছে না।" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"ব্যবহারপ্রণালী: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "পরিচালিত নয়" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "উপলব্ধ নয়" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "বিচ্ছিন্ন" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "সংযোগ করা হচ্ছে (প্রস্তুতি)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "সংযোগ করা হচ্ছে (কনফিগার করা হচ্ছে)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "সংযোগ করা হচ্ছে (অনুমোদন প্রয়োজন)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "সংযোগ করা হচ্ছে (IP কনফিগারেশন প্রাপ্ত করা হচ্ছে)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "সংযোগ স্থাপিত" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "সংযোগ বিফল" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "অজানা" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(শূণ্য)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ঠিকানা 0x%X রূপান্তর করতে ত্রুটি" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u মেগাবাইট/সেকেন্ড" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "এনক্রিপশন সহ: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "এন্টারপ্রাইজ " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "অ্যাড-হক" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "পরিকাঠামো" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ত্রুটি: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ত্রুটি: 'dev list': %s; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ডিভাইসের বিবরণ" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(অজানা)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "অজানা)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u মেগাবাইট/সেকেন্ড" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "চালু" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "বন্ধ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ত্রুটি: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ত্রুটি: 'dev status': %s; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ডিভাইসের অবস্থা" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ত্রুটি: '%s' আর্গুমেন্ট অনুপস্থিত।" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ত্রুটি: '%s' ডিভাইস পাওয়া যায়নি।" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "সাফল্য: '%s' ডিভাইস সাফল্যের সাথে সংযোগ বিচ্ছিন্ন করা হয়েছে।" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ত্রুটি: '%s' (%s) ডিভাইসের সাথে সংযোগ বিচ্ছিন্ন করতে ব্যর্থ: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ডিভাইসের অবস্থা: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ত্রুটি: iface নির্ধারণ করা আবশ্যক।" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ত্রুটি: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ত্রুটি: 'dev wifi': %s; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "ওয়াই-ফাই স্ক্যানের তালিকা" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ত্রুটি: hwaddr '%s' সহ অ্যাকসেস পয়েন্ট পাওয়া যায়নি।" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ত্রুটি: '%s' ডিভাইসটি ওয়াই-ফাই ডিভাইস নয়।" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ত্রুটি: 'dev wifi' কমান্ড '%s' বৈধ নয়।" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ত্রুটি: 'dev' কমান্ড '%s' বৈধ নয়।" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ব্যবহারপ্রণালী: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "নিদ্রিত" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "সংযোগ করা হচ্ছে" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ত্রুটি: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ত্রুটি: 'nm status': %s; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager-র অবস্থা" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "সক্রিয়" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "নিষ্ক্রিয়" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "চলমান" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "চলমান নয়" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ত্রুটি: '--fields' মান '%s' এইখানে বৈধ নয়; অনুমোদিত ক্ষেত্র: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi সক্রিয়" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ত্রুটর: অবৈধ 'wifi' পরামিতি: '%s'।" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN সক্রিয়" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ত্রুটি: অবৈধ 'wwan' পরামিতি: '%s'।" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ত্রুটি: 'nm' কমান্ড '%s' বৈধ নয়।" + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"ব্যবহারপ্রণালী: %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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ত্রুটি: '%s' অবজেক্ট অজানা, 'nmcli help' ব্যবহারের প্রচেষ্টা করুন।" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ত্রুটি: '--terse' বিকল্পটি দুইবার উল্লিখিত হয়েছে।" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ত্রুটি: '--terse' ও '--pretty' বিকল্প দুটি এক অপরের উপর নির্ভরশীল নয়।" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ত্রুটি: '--pretty' বিকল্পটি দুইবার উল্লিখিত হয়েছে।" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ত্রুটি: '--pretty' ও '--terse' বিকল্প দুটি এক অপরের উপর নির্ভরশীল নয়।" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ত্রুটি: '%s' বিকল্পের ক্ষেত্রে আর্গুমেন্ট অনুপস্থিত।" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ত্রুটি: '%s' আর্গুমেন্টটি '%s' বিকল্পের জন্য বৈধ নয়।" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ত্রুটি: '%s' বিকল্পের ক্ষেত্র অনুপস্থিত।" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli সরঞ্জাম, সংস্করণ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ত্রুটি: '%s' বিকল্পটি অজানা, 'nmcli -help' ব্যবহারের প্রয়োগ করুন।" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d সংকেত প্রাপ্ত হয়েছে, বন্ধ করা হচ্ছে..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ত্রুটি: NetworkManager-র সাথে সংযোগ স্থাপন করতে ব্যর্থ।" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "সফল" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (১০৪/১২৮-বিট পরিচয়পংক্তি)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (অজানা)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "০ (অজানা)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "যে কোনো, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "৯০০ MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "১৮০০ MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "১৯০০ MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "৮৫০ MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS ২১০০ MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS ১৮০০ MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS ১৭০০/২১০০ MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS ৮০০ MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS ৮৫০ MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS ৯০০ MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS ১৭০০ MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "স্বয়ংক্রিয়" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "নির্ধারিত হয়নি" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "'%s' ক্ষেত্রটি পৃথক থাকা আবশ্যক" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "অবৈধ ক্ষেত্র '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "'--terse' বিকল্পের ক্ষেত্রে '--fields' নির্ধারণ করা আবশ্যক" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "'--terse' বিকল্পের ক্ষেত্রে '--fields' বিকল্পের সুনির্দিষ্ট মান উল্লেখ করা আবশ্যক, '%s' ব্যবহার করা যাবে না" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM কি ফাইলের কোনো সমাপ্তির ট্যাগ উপস্থিত নেই '%s'।" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "সম্ভব PEM-র গোপনীয় কি ফাইল নয়।" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ফাইলের তথ্যে সংরক্ষণের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "ত্রুটিপূর্ণ PEM ফাইল: প্রথম ট্যাগ রূপে Proc-Type ব্যবহার করা হয়নি।" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "ত্রুটিপূর্ণ PEM ফাইল: অজানা Proc-Type ট্যাগ '%s'।" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "ত্রুটিপূর্ণ PEM ফাইল: দ্বিতীয় ট্যাগ রূপে DEK-Info ধার্য করা হয়নি।" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "ত্রুটিপূর্ণ PEM ফাইল: DEK-Info ট্যাগের মধ্যে কোনো IV পাওয়া যায়নি।" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "ত্রুটিপূর্ণ PEM ফাইল: DEK-Info ট্যাগের মধ্যে IV-র বিন্যাস বৈধ নয়।" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "ত্রুটিপূর্ণ PEM ফাইল: ব্যক্তিগত-কি'র অজানা সাইফার '%s'।" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "ব্যক্তিগত-কি ডিকোডর করতে ব্যর্থ।" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "'%s' PEM সার্টিফিকেটের মধ্যে সমাপ্তির ট্যাগ '%s' উপস্থিত নেই।" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "সার্টিফিকেট ডি-কোড করতে ব্যর্থ।" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "সার্টিফিকেটের তথ্য সংরক্ষণের উদ্দেশ্যে পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ফাইলের তথ্য সংরক্ষণের উদ্দেশ্যে পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV-র দৈঘ্যের পরিমাণ জোড় সংখ্যক বাইটের হওয়া আবশ্যক।" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV সংরক্ষণের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV-র মধ্যে হেক্সাডেসিম্যাল-ভিন্ন অন্যান্য সংখ্যা উপস্থিত রয়েছে।" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "ব্যক্তিগত-কি'র সাইফার '%s' অজানা।" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করার জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "ব্যক্তিগত-কি'র ধরন নির্ধারণ করতে ব্যর্থ।" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ডিক্রিপ্ট করা ব্যক্তিগত-কি সংরক্ষণের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "ক্রিপ্টো ইঞ্জিন আরম্ভ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 ইঞ্জিন আরম্ভ করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "IV-র অবৈধ দৈর্ঘ্য (অন্তত %zd হওয়া আবশ্যক)।" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "ডিক্রিপ্ট করা কি-বাফারের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ডিক্রিপশন সাইফারের কনটেক্সট আরম্ভ করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ডিক্রিপশনের জন্য সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "ডিক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: প্যাডিংয়ের দৈর্ঘ্য বৈধ নয়।" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ।" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "এনক্রিপ্ট করার জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "এনক্রিপশন সাইফারের কনটেক্সট আরম্ভ করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "এনক্রিপশনের জন্য সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "এনক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "তথ্য এনক্রিপ্ট করতে ব্যর্থ: %s / %s।" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "সার্টিফিকেটের তথ্য আরম্ভ করতে সমস্যা: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "সার্টিফিকেট ডি-কোড করতে ব্যর্থ: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ডিকোডার আরম্ভ করতে ব্যর্থ: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ফাইল ডিকোড করতে ব্যর্থ: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ফাইল যাচাই করতে ব্যর্থ: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "ক্রিপ্টো ইঞ্জিন আরম্ভ করতে ব্যর্থ: %d।" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 কনটেক্সট আরম্ভ করতে ব্যর্থ: %d।" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "IV-র অবৈধ দৈর্ঘ্য (অন্তত %d হওয়া আবশ্যক)।" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ডিক্রিপশন সাইফার স্লট আরম্ভ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ডিক্রিপশনের উদ্দেশ্যে সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ডিক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ডিক্রিপশন কনটেক্সট আরম্ভ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: %d।" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "ব্যক্তিগত-কি ডিক্রিপ্ট করতে ব্যর্থ: ডিক্রিপ্ট করা তথ্য অত্যাধিক বড়।" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "ব্যক্তিগত-কি'র ডিক্রিপশন সমাপ্ত করতে ব্যর্থ: %d।" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "এনক্রিপশন সাইফার স্লট আরম্ভ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "এনক্রিপশনের উদ্দেশ্যে সিমেট্রিক-কি নির্ধারণ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "এনক্রিপশনের উদ্দেশ্যে IV নির্ধারণ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "এনক্রিপশন কনটেক্সট আরম্ভ করতে ব্যর্থ।" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "এনক্রিপ্ট করতে ব্যর্থ: %d।" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "এনক্রিপ্ট করার পরে অপ্রত্যাশিত পরিমাণ তথ্য উপলব্ধ হয়েছে।" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "সার্টিফিকেট ডিকোড করতে ব্যর্থ: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "পাসওয়ার্ডকে UCS2-তে রূপান্তর করতে ব্যর্থ: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ডিকোডার আরম্ভ করতে ব্যর্থ: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ফাইল ডিকোড করতে ব্যর্থ: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ফাইল যাচাই করতে ব্যর্থ: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "র‍্যান্ড তথ্য নির্মাণ করতে ব্যর্থ।" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "এনক্রিপশন-কি নির্মাণের জন্য পর্যাপ্ত মেমরি অনুপস্থিত।" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ফাইল নির্মাণের জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ফাইলের মধ্যে IV লেখার জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ফাইলের মধ্যে এনক্রিপ্ট করা কি লেখার জন্য মেমরি বরাদ্দ করা যায়নি।" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ফাইলের তথ্যে সংরক্ষণের জন্য মেমরি বরাদ্দ করতে ব্যর্থ।" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink বার্তা প্রক্রিয়াকরণে ত্রুটি: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "তথ্যের জন্য সকেটে অপেক্ষাকালে সমস্যা" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink-র সাথে সংযোগ করতে ব্যর্থ: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink হ্যান্ডেলের পরিচয়ের তথ্য পরিবহণের ব্যবস্থা সক্রিয় করতে ব্যর্থ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink হ্যান্ডেল বরাদ্দ করতে ব্যর্থ: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "লিংকের অবস্থা নিরীক্ষণের উদ্দেশ্যে netlink লিংক ক্যাশে বরাদ্দ করতে ব্যর্থ: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink দলে যোগ করতে ব্যর্থ: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "লিংক ক্যাশে আপডেট করতে সমস্যা: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "অবৈধ বিকল্প। বৈধ বিকল্পগুলির তালিকা দেখার জন্য অনুগ্রহ করে --help প্রয়োগ করুন।\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s। বৈধ বিকল্পগুলির তালিকা দেখার জন্য অনুগ্রহ করে --help প্রয়োগ করুন।\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager দ্বারা নির্মিত\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s থেকে মার্জ করা হয়েছে\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ব্যবহারযোগ্য DHCP ক্লায়েন্ট পাওয়া যায়নি।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' পাওয়া যায়নি।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' পাওয়া যায়নি।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "অসমর্থিত DHCP ক্লায়েন্ট '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "লগের অজানা স্তর '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "অজানা লগ ডোমেইন '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"উল্লেখ্য: libc resolver দ্বারা ৩-টির বেশি নেম-সার্ভার সমর্থিত না হওয়ার সম্ভাবনা " +"রয়েছে।" + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "নিম্নলিখিত নেম-সার্ভারগুলি সনাক্ত না হওয়ার সম্ভাবনা রয়েছে।" + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "স্বয়ংক্রিয় %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "সিস্টেম" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "নিরাপদ ওয়াই-ফাইল নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "উন্মুক্ত ওয়াই-ফাইল নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "সিস্টেমের স্থায়ী হোস্ট-নেম পরিবর্তন করুন" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "সিস্টেমের সংযোগ পরিবর্তন করুন" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের বৈশিষ্ট্য পরিবর্তন করা সম্ভব " +"নয়" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের স্থায়ী হোস্ট-নেম পরিবর্তন " +"করা সম্ভব নয়" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"সিস্টেমের নিয়মনীতির কারণে, নিরাপদ ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ " +"ব্যবহার প্রতিরোধ করা হয়েছে" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"সিস্টেমের নিয়মনীতির কারণে, উন্মুক্ত ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ " +"ব্যবহার প্রতিরোধ করা হয়েছে" + diff --git a/po/bs.po b/po/bs.po new file mode 100644 index 00000000..5e971391 --- /dev/null +++ b/po/bs.po @@ -0,0 +1,193 @@ +# translation of NetworkManager.HEAD.po to Bosnian +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# Kemal Šanjta , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-10-19 13:38-0400\n" +"PO-Revision-Date: 2004-09-01 04:10+0200\n" +"Last-Translator: Kemal Šanjta \n" +"Language-Team: Bosnian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.3\n" + +#: info-daemon/networks.glade:11 +msgid "Modify Wireless Networks" +msgstr "Izmjeni Wireless mreže" + +#: info-daemon/networks.glade:92 +msgid "Wireless Networks:" +msgstr "Wireless Mreže:" + +#: info-daemon/passphrase.glade:9 +#, fuzzy +msgid "Wireless Network Key Required" +msgstr "Wireless Mreže" + +#: info-daemon/passphrase.glade:52 +msgid "_Login to Network" +msgstr "_Prijava na mrežu" + +#: info-daemon/passphrase.glade:100 +#, fuzzy +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Passphrase je potreban od Wirelles " +"mreže\n" +"\n" +"Passphrase ili WEP key je potreba za pristup Wireless mreži '%s'." + +#: info-daemon/passphrase.glade:129 +msgid "Key Type:" +msgstr "" + +#: info-daemon/passphrase.glade:150 +msgid "" +"128-bit Passphrase\n" +"128-bit Raw Hex Key" +msgstr "" + +#: info-daemon/passphrase.glade:180 +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:101 +msgid "Passphrase:" +msgstr "Passphrase:" + +#: info-daemon/passphrase.glade:208 panel-applet/essid.glade:162 +msgid "*" +msgstr "*" + +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:104 +msgid "Key:" +msgstr "" + +#. Reuse the above string to make the translators less angry. +#: panel-applet/NMWirelessApplet.c:691 panel-applet/NMWirelessApplet.c:701 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"NetworkManager Aplet nije pronašao neke potrebne resurse (glade nije " +"pronađen)." + +#: panel-applet/NMWirelessApplet.c:716 +#, fuzzy +msgid "Custom wireless network" +msgstr "Wireless Mreže" + +#: panel-applet/NMWirelessApplet.c:717 +msgid "Enter the ESSID of the wireless network to which you wish to connect." +msgstr "" + +#: panel-applet/NMWirelessApplet.c:800 +#, fuzzy +msgid "Other Wireless Networks..." +msgstr "Wireless Mreže" + +#: panel-applet/NMWirelessApplet.c:911 +msgid "No network devices have been found" +msgstr "" + +#: panel-applet/NMWirelessApplet.c:1028 +msgid "NetworkManager is not running..." +msgstr "NetworkManager nije pokrenut..." + +#: panel-applet/essid.glade:52 +msgid "C_onnect" +msgstr "" + +#: panel-applet/essid.glade:131 +#, fuzzy +msgid "Wireless _Network:" +msgstr "Wireless Mreže" + +#: panel-applet/essid.glade:177 +#, fuzzy +msgid "Wireless _adapter:" +msgstr "Wireless Mreže" + +#: panel-applet/menu-info.c:101 +#, fuzzy, c-format +msgid "Wired Network (%s)" +msgstr "Wireless Mreže" + +#: panel-applet/menu-info.c:103 +#, fuzzy +msgid "Wired Network" +msgstr "Wireless Mreže" + +#: panel-applet/menu-info.c:168 +#, fuzzy, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Wireless Mreže" +msgstr[1] "Wireless Mreže" + +#: panel-applet/menu-info.c:170 +#, fuzzy +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Wireless Mreže" +msgstr[1] "Wireless Mreže" + +#: panel-applet/menu-info.c:307 +msgid " (invalid Unicode)" +msgstr "" + +#: examples/python/systray/eggtrayicon.c:111 +msgid "Orientation" +msgstr "" + +#: examples/python/systray/eggtrayicon.c:112 +msgid "The orientation of the tray." +msgstr "" + +#~ msgid " " +#~ msgstr " " + +#~ msgid "There are no network devices..." +#~ msgstr "Nema mrežnih uređaja..." + +#~ msgid "There are no wireless networks..." +#~ msgstr "Nema wireless mreža..." + +#~ msgid "Network Connections" +#~ msgstr "Mrežne konekcije" + +#~ msgid "No network connection is currently active..." +#~ msgstr "Nijedna mrežna konekcija trenutno nije aktivna..." + +#~ msgid "A wired network connection is currently active..." +#~ msgstr "Žičana mrežna konekcija je trenutno aktivna..." + +#~ msgid "_About..." +#~ msgstr "_O..." + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen log in to the wireless network '%s'. If you are sure " +#~ "this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will no longer pester you with stupid questions when you " +#~ "connect to it." +#~ msgstr "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen log in to the wireless network '%s'. If you are sure " +#~ "this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will no longer pester you with stupid questions when you " +#~ "connect to it." + +#~ msgid "Always Trust this Wireless Network" +#~ msgstr "Uvijek vjeruj ovoj wireless mreži" diff --git a/po/ca.po b/po/ca.po new file mode 100644 index 00000000..d3d9053d --- /dev/null +++ b/po/ca.po @@ -0,0 +1,1209 @@ +# Catalan translation for NetworkManager +# Copyright © 2005, 2006, The Free Software Foundation, Inc. +# This file is distributed under the same license as the +# NetworkManager package. +# Josep Puigdemont Casamajó , 2005, 2006. +# David Planella , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-01-10 17:02+0000\n" +"PO-Revision-Date: 2009-01-21 17:51+0100\n" +"Last-Translator: David Planella \n" +"Language-Team: Catalan \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" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "El fitxer de clau PEM no té l'etiqueta de final «%s»." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Aquest no sembla que sigui un fitxer de clau privada PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "No hi ha prou memòria per a emmagatzemar les dades del fitxer PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "" +"El format del fitxer PEM és incorrecte: la primera etiqueta no és la de Proc-" +"Type." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "" +"El format del fitxer PEM és incorrecte: l'etiqueta de Proc-Type «%s» és " +"desconeguda." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "" +"El format del fitxer PEM és incorrecte: la segona etiqueta no és la de DEK-" +"Info." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "" +"El format del fitxer PEM és incorrecte: no s'ha trobat cap vector " +"d'inicialització a l'etiqueta de DEK-Info." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" +"El format del fitxer PEM és incorrecte: el format del vector " +"d'inicialització a l'etiqueta DEK-Info no és vàlid." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "" +"El format del fitxer PEM és incorrecte: el criptògraf «%s» de clau privada és " +"desconegut." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "No s'ha pogut descodificar la clau privada." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "No s'ha trobat l'etiqueta de tancament «%s» al certificat PEM «%s»." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "No s'ha pogut descodificar el certificat." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "No hi ha prou memòria per a emmagatzemar les dades del certificat." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "No hi ha prou memòria per a emmagatzemar les dades del fitxer." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "" +"La llargada del vector d'inicialització ha de ser un nombre parell de bytes." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "No hi ha prou memòria per a emmagatzemar el vector d'inicialització." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "El vector d'inicialització conté dígits que no són hexadecimals." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 +#: ../libnm-util/crypto_nss.c:169 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Es desconeix el criptògraf «%s» de la clau privada." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "No hi ha prou memòria per a desencriptar a la clau privada." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "No s'ha pogut determinar el tipus de la clau privada." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "" +"No hi ha prou memòria per a emmagatzemar la clau privada desencriptada." + +#: ../libnm-util/crypto_gnutls.c:46 +msgid "Failed to initialize the crypto engine." +msgstr "No s'ha pogut inicialitzar el motor criptogràfic." + +#: ../libnm-util/crypto_gnutls.c:90 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "No s'ha pogut inicialitzar el motor MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "No hi ha prou memòria per al búfer de la clau desencriptada." + +#: ../libnm-util/crypto_gnutls.c:160 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "" +"No s'ha pogut inicialitzar el context del criptògraf de desencriptació: %s / " +"%s." + +#: ../libnm-util/crypto_gnutls.c:169 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "" +"No s'ha pogut definir la clau simètrica per a la desencriptació: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:178 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "" +"No s'ha pogut definir el vector d'inicialització per a la desencriptació: %" +"s / %s." + +#: ../libnm-util/crypto_gnutls.c:187 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "No s'ha pogut desencriptar la clau privada: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "No s'ha pogut desencriptar la clau privada." + +#: ../libnm-util/crypto_gnutls.c:235 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "S'ha produït un error en inicialitzar les dades del certificat: %s" + +#: ../libnm-util/crypto_gnutls.c:257 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "No s'ha pogut descodificar el certificat: %s" + +#: ../libnm-util/crypto_gnutls.c:281 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "No s'ha pogut inicialitzar el descodificador PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "No s'ha pogut descodificar el fitxer PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:306 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "No s'ha pogut verificar el fitxer PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:57 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "No s'ha pogut inicialitzar el motor criptogràfic: %d" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "No s'ha pogut inicialitzar el context MD5: %d." + +#: ../libnm-util/crypto_nss.c:186 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "No s'ha pogut inicialitzar la ranura del criptògraf de desencriptació." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "No s'ha pogut definir la clau simètrica per a la desencriptació." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "" +"No s'ha pogut definir el vector d'inicialització per a la desencriptació." + +#: ../libnm-util/crypto_nss.c:214 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "No s'ha pogut inicialitzar el context de desxifratge." + +#: ../libnm-util/crypto_nss.c:227 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "No s'ha pogut desxifrar la clau privada: %d." + +#: ../libnm-util/crypto_nss.c:239 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "No s'ha pogut finalitzar la desencriptació de la clau privada: %d." + +#: ../libnm-util/crypto_nss.c:284 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "No s'ha pogut descodificar el certificat: %d" + +#: ../libnm-util/crypto_nss.c:319 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "No s'ha pogut convertir la contrasenya a UCS2: %d" + +#: ../libnm-util/crypto_nss.c:347 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "No s'ha pogut inicialitzar el descodificador PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "No s'ha pogut descodificar el fitxer PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:365 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "No s'ha pogut verificar el fitxer PKCS#12: %d" + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:454 +#, c-format +msgid "error processing netlink message: %s" +msgstr "s'ha produït un error en processar el missatge netlink: %s" + +#: ../src/nm-netlink-monitor.c:251 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"no s'ha pogut assignar el gestor del netlink per a fer un seguiment de " +"l'estat de l'enllaç: %s" + +#: ../src/nm-netlink-monitor.c:261 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"no s'ha pogut connectar amb el netlink per a fer un seguiment de l'estat de " +"l'enllaç: %s" + +#: ../src/nm-netlink-monitor.c:269 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"no s'ha pogut unir el grup del netlink per a fer un seguiment de l'estat de " +"l'enllaç: %s" + +#: ../src/nm-netlink-monitor.c:277 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"no s'ha pogut assignar la memòria cau de l'enllaç del netlink per a fer un " +"seguiment de l'estat de l'enllaç: %s" + +#: ../src/nm-netlink-monitor.c:418 +#, c-format +msgid "error updating link cache: %s" +msgstr "s'ha produït un error en actualitzar la memòria cau de l'enllaç: %s" + +#: ../src/nm-netlink-monitor.c:484 +msgid "error occurred while waiting for data on socket" +msgstr "s'ha produït un error en esperar dades del sòcol" + +#: ../src/NetworkManager.c:293 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Opció no vàlida. Utilitzeu --help per a veure la llista d'opcions vàlides.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:92 +msgid "# Created by NetworkManager\n" +msgstr "# Creat pel NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:98 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Fusionat des de %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:256 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"NOTA: pot ser que el sistema de resolució de la libc no funcioni amb més de " +"3 servidors de noms." + +#: ../src/named-manager/nm-named-manager.c:258 +msgid "The nameservers listed below may not be recognized." +msgstr "Pot ser que no es reconeguin els servidors de noms llistats més avall." + +#: ../system-settings/src/main.c:381 +#, c-format +msgid "Auto %s" +msgstr "%s automàtic" + +#~ msgid "Passphrase for wireless network %s" +#~ msgstr "Contrasenya per a la xarxa sense fil %s" + +#~ msgid "Connection to the wireless network '%s' failed." +#~ msgstr "Ha fallat la connexió a la xarxa sense fil «%s»." + +#~ msgid "Connection to the wired network failed." +#~ msgstr "Ha fallat la connexió a la xarxa amb fil." + +#~ msgid "Error displaying connection information:" +#~ msgstr "S'ha produït un error en mostrar la informació de la connexió:" + +#~ msgid "Could not find some required resources (the glade file)!" +#~ msgstr "" +#~ "Alguns dels recursos requerits no s'han pogut trobar (el fitxer glade)!" + +#~ msgid "No active connections!" +#~ msgstr "No hi ha cap connexió activa." + +#~ msgid "%d Mb/s" +#~ msgstr "%d Mb/s" + +#~ msgid "Wired Ethernet (%s)" +#~ msgstr "Xarxa amb fil (%s)" + +#~ msgid "Wireless Ethernet (%s)" +#~ msgstr "Xarxa sense fil (%s)" + +#~ msgid "Unknown" +#~ msgstr "Desconegut" + +#~ msgid "NetworkManager Applet" +#~ msgstr "Miniaplicació NetworkManager" + +#~ msgid "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." + +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "" +#~ "Miniaplicació per a l'àrea de notificació per a gestionar els vostres " +#~ "dispositius de xarxa i connexions." + +#~ msgid "translator-credits" +#~ msgstr "Josep Puigdemont i Casamajó " + +#~ msgid "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." + +#~ msgid "VPN Login Failure" +#~ msgstr "S'ha produït un error en l'entrada VPN" + +#~ msgid "Could not start the VPN connection '%s' due to a login failure." +#~ msgstr "" +#~ "Atès que s'ha produït un error en l'entrada, no s'ha pogut iniciar la " +#~ "connexió VPN «%s»." + +#~ msgid "VPN Start Failure" +#~ msgstr "No s'ha pogut iniciar la VPN" + +#~ msgid "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." +#~ msgstr "" +#~ "No s'ha pogut iniciar la connexió VPN «%s» perquè s'ha produït un error en " +#~ "llançar la VPN." + +#~ msgid "VPN Connect Failure" +#~ msgstr "S'ha produït un error en la connexió VPN" + +#~ msgid "Could not start the VPN connection '%s' due to a connection error." +#~ msgstr "" +#~ "No s'ha pogut iniciar la connexió VPN «%s» ja que s'ha produït un error de " +#~ "connexió." + +#~ msgid "VPN Configuration Error" +#~ msgstr "S'ha produït un error de configuració de la VPN" + +#~ msgid "The VPN connection '%s' was not correctly configured." +#~ msgstr "La connexió VPN «%s» no està correctament configurada." + +#~ msgid "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." +#~ msgstr "" +#~ "No s'ha pogut iniciar la connexió VPN «%s» perquè el servidor VPN no ha " +#~ "retornat cap configuració de xarxa adequada." + +#~ msgid "VPN Login Message" +#~ msgstr "Missatge d'entrada de la VPN" + +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "La miniaplicació NetworkManager no ha pogut trobar alguns dels recursos " +#~ "requerits (no s'ha trobat el fitxer glade)." + +# FIXME +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "El dispositiu de xarxa «%s (%s)» no permet l'escaneig sense fil." + +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "El dispositiu de xarxa «%s (%s)» no permet la detecció de l'enllaç." + +#~ msgid "(unknown)" +#~ msgstr "(desconegut)" + +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "S'està preparant el dispositiu %s per a la xarxa amb fil..." + +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "S'està preparant el dispositiu %s per a la xarxa sense fil «%s»..." + +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "S'està configurant el dispositiu %s per a la xarxa amb fil..." + +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "S'està intentant entrar a la xarxa sense fil «%s»..." + +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "S'està esperant per a la clau de xarxa de la xarxa sense fil «%s»..." + +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "S'està sol·licitant una adreça de xarxa per a la xarxa amb fil..." + +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "" +#~ "S'està sol·licitant una adreça de xarxa per a la xarxa sense fil «%s»..." + +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "S'està finalitzant la connexió a la xarxa amb fil..." + +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "S'està finalizant la connexió a la xarxa sense fil «%s»..." + +#~ msgid "NetworkManager is not running" +#~ msgstr "No s'està executant el NetworkManager" + +#~ msgid "Networking disabled" +#~ msgstr "S'ha inhabilitat la xarxa" + +#~ msgid "No network connection" +#~ msgstr "No hi ha cap connexió de xarxa" + +#~ msgid "Wired network connection" +#~ msgstr "Connexió de xarxa amb fil" + +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Connectat a una xarxa Ad-Hoc sense fil" + +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Connexió de xarxa sense fil a «%s» (%d%%)" + +#~ msgid "VPN connection to '%s'" +#~ msgstr "Connexió VPN a «%s»" + +#~ msgid "VPN connecting to '%s'" +#~ msgstr "S'està connectant amb VPN a «%s»" + +#~ msgid "_Connect to Other Wireless Network..." +#~ msgstr "_Connecta a d'altres xarxes sense fil..." + +#~ msgid "Create _New Wireless Network..." +#~ msgstr "Crea una xarxa sense fil _nova..." + +#~ msgid "_VPN Connections" +#~ msgstr "Connexions _VPN" + +#~ msgid "_Configure VPN..." +#~ msgstr "_Configura la VPN..." + +#~ msgid "_Disconnect VPN..." +#~ msgstr "_Desconnecta la VPN..." + +#~ msgid "_Dial Up Connections" +#~ msgstr "Connexions de _marcatge" + +#~ msgid "Connect to %s..." +#~ msgstr "Connecta a %s..." + +#~ msgid "Disconnect from %s..." +#~ msgstr "Desconnecta de %s..." + +#~ msgid "No network devices have been found" +#~ msgstr "No s'ha trobat cap dispositiu de xarxa" + +#~ msgid "NetworkManager is not running..." +#~ msgstr "No s'està executant el NetworkManager..." + +#~ msgid "Enable _Networking" +#~ msgstr "Habilita la _xarxa" + +#~ msgid "Enable _Wireless" +#~ msgstr "Habilita la xarxa _sense fil" + +#~ msgid "Connection _Information" +#~ msgstr "_Informació de la connexió" + +#~ msgid "_Help" +#~ msgstr "A_juda" + +#~ msgid "_About" +#~ msgstr "_Quant a" + +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "La miniaplicació NetworkManager no ha pogut trobar alguns dels recursos " +#~ "requerits. No pot continuar.\n" + +#~ msgid "Open System" +#~ msgstr "Sistema obert" + +#~ msgid "Shared Key" +#~ msgstr "Clau compartida" + +#~ msgid "Automatic (Default)" +#~ msgstr "Automàtic (Predeterminat)" + +#~ msgid "AES-CCMP" +#~ msgstr "AES-CCMP" + +#~ msgid "TKIP" +#~ msgstr "TKIP" + +#~ msgid "Dynamic WEP" +#~ msgstr "WEP dinàmic" + +#~ msgid "None" +#~ msgstr "Cap" + +#~ msgid "WEP 64/128-bit ASCII" +#~ msgstr "WEP 64/128-bit ASCII" + +#~ msgid "WEP 64/128-bit Hex" +#~ msgstr "WEP 64/128-bit Hex" + +#~ msgid "WEP 128-bit Passphrase" +#~ msgstr "WEP contrasenya de 128-bits" + +#~ msgid "PEAP" +#~ msgstr "PEAP" + +#~ msgid "TLS" +#~ msgstr "TLS" + +#~ msgid "TTLS" +#~ msgstr "TTLS" + +#~ msgid "WPA2 Enterprise" +#~ msgstr "WPA2 Enterprise" + +#~ msgid "WPA Enterprise" +#~ msgstr "WPA Enterprise" + +#~ msgid "WPA2 Personal" +#~ msgstr "WPA2 personal" + +#~ msgid "WPA Personal" +#~ msgstr "WPA personal" + +#~ msgid "Orientation" +#~ msgstr "Orientació" + +#~ msgid "The orientation of the tray." +#~ msgstr "La orientació de l'àrea de notificació." + +#~ msgid "Wired Network (%s)" +#~ msgstr "Xarxa amb fil (%s)" + +#~ msgid "_Wired Network" +#~ msgstr "Xarxa amb _fil" + +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "Xarxa sense fil (%s)" +#~ msgstr[1] "Xarxes sense fil (%s)" + +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "Xarxa sense fil" +#~ msgstr[1] "Xarxes sense fil" + +#~ msgid " (invalid Unicode)" +#~ msgstr " (Unicode invàlid)" + +#~ msgid "" +#~ "By default, the wireless network's name is set to your computer's name, %" +#~ "s, with no encryption enabled" +#~ msgstr "" +#~ "Per defecte, el nom de la xarxa sense fil s'estableix al nom de " +#~ "l'ordinador, %s, sense habilitar el xifratge" + +#~ msgid "Create new wireless network" +#~ msgstr "Crea una nova xarxa sense fil" + +#~ msgid "" +#~ "Enter the name and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "" +#~ "Entreu el nom els paràmetres de seguretat per a la xarxa sense fil que " +#~ "vulgueu crear." + +#~ msgid "Create New Wireless Network" +#~ msgstr "Crea una xarxa sense fil nova" + +#~ msgid "Existing wireless network" +#~ msgstr "Xarxa sense fil existent" + +#~ msgid "Enter the name of the wireless network to which you wish to connect." +#~ msgstr "Entreu el nom de la xarxa sense fil a la que vulgueu connectar-vos." + +#~ msgid "Connect to Other Wireless Network" +#~ msgstr "Connecta a d'altres xarxes sense fil" + +#~ msgid "Error connecting to wireless network" +#~ msgstr "S'ha produït un error en connectar a la xarxa sense fil..." + +#~ msgid "" +#~ "The requested wireless network requires security capabilities unsupported " +#~ "by your hardware." +#~ msgstr "" +#~ "La xarxa sense fil seleccionada requereix certes característiques de " +#~ "seguretat que no estan implementades en el aquest maquinari." + +#~ msgid "Cannot start VPN connection '%s'" +#~ msgstr "No s'ha pogut iniciar la connexió VPN «%s»" + +#~ msgid "" +#~ "Could not find the authentication dialog for VPN connection type '%s'. " +#~ "Contact your system administrator." +#~ msgstr "" +#~ "No s'ha pogut trobar el diàleg d'autenticació per al tipus de connexió " +#~ "VPN «%s». Contacteu el vostre administrador de sistemes." + +#~ msgid "" +#~ "There was a problem launching the authentication dialog for VPN " +#~ "connection type '%s'. Contact your system administrator." +#~ msgstr "" +#~ "S'ha produït un error en llançar el diàleg d'autenticació per al tipus de " +#~ "connexió VPN «%s». Contacteu el vostre administrador de sistemes." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "" +#~ "Active Connection Information" +#~ msgstr "" +#~ "Informació de la connexió activa" + +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "Contrasenya necessària per a la " +#~ "xarxa sense fil\n" +#~ "\n" +#~ "Es requereix una contrasenya o clau de xifratge per a la xarxa sense fil «%" +#~ "s»." + +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "Funcionalitat de xarxa reduïda\n" +#~ "\n" +#~ "%s No serà del tot funcional." + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen to log in to the wireless network '%s'. If you are sure " +#~ "that this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will not require confirmation on subsequent log ins." +#~ msgstr "" +#~ "Confirmació de l'entrada a la xarxa " +#~ "sense fil\n" +#~ "\n" +#~ "Heu escollit entrar a la xarxa sense fil «%s». Si esteu segur que la xarxa " +#~ "sense fil és segura, feu clic al quadre de comprovació de sota i el " +#~ "NetworkManager no us tornarà a demanarà cap més confirmació per entrar a " +#~ "aquesta xarxa en el futur." + +#~ msgid "Anonymous Identity:" +#~ msgstr "Identitat anònima:" + +#~ msgid "Authentication:" +#~ msgstr "Autenticació:" + +#~ msgid "Broadcast Address:" +#~ msgstr "Adreça de multidifusió:" + +#~ msgid "CA Certificate File:" +#~ msgstr "Fitxer del certificat CA:" + +#~ msgid "C_onnect" +#~ msgstr "C_onnecta" + +#~ msgid "Client Certificate File:" +#~ msgstr "Fitxer del certificat del client:" + +#~ msgid "Connection Information" +#~ msgstr "Informació de la connexió" + +#~ msgid "Default Route:" +#~ msgstr "Ruta predeterminada:" + +#~ msgid "Destination Address:" +#~ msgstr "Adreça de destí:" + +#~ msgid "Driver:" +#~ msgstr "Connector:" + +#~ msgid "EAP Method:" +#~ msgstr "Mètode EAP:" + +#~ msgid "Hardware Address:" +#~ msgstr "Adreça del maquinari:" + +#~ msgid "IP Address:" +#~ msgstr "Adreça IP:" + +#~ msgid "Identity:" +#~ msgstr "Identitat:" + +#~ msgid "Interface:" +#~ msgstr "Interfície:" + +#~ msgid "Key Type:" +#~ msgstr "Tipus de clau:" + +#~ msgid "Key management:" +#~ msgstr "Gestió de claus:" + +#~ msgid "Key:" +#~ msgstr "Clau:" + +#~ msgid "" +#~ "None\n" +#~ "WEP 128-bit Passphrase\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" +#~ msgstr "" +#~ "Cap\n" +#~ "WEP contrasenya de 128 bits\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" + +#~ msgid "" +#~ "Open System\n" +#~ "Shared Key" +#~ msgstr "" +#~ "Sistema obert\n" +#~ "Clau compartida" + +#~ msgid "Other Wireless Network..." +#~ msgstr "Altres xarxes sense fil..." + +#~ msgid "Passphrase:" +#~ msgstr "Contrasenya:" + +#~ msgid "Password:" +#~ msgstr "Contrasenya:" + +#~ msgid "Primary DNS:" +#~ msgstr "DNS primari:" + +#~ msgid "Private Key File:" +#~ msgstr "Fitxer de la clau privada:" + +#~ msgid "Private Key Password:" +#~ msgstr "Contrasenya de la clau privada:" + +#~ msgid "Secondary DNS:" +#~ msgstr "DNS secundari:" + +#~ msgid "Select the CA Certificate File" +#~ msgstr "Seleccioneu el fitxer del certificat de la CA" + +#~ msgid "Select the Client Certificate File" +#~ msgstr "Seleccioneu el fitxer del certificat del client" + +#~ msgid "Select the Private Key File" +#~ msgstr "Seleccioneu el fitxer de la clau privada" + +#~ msgid "Show key" +#~ msgstr "Mostra la clau" + +#~ msgid "Show passphrase" +#~ msgstr "Mostra la contrasenya:" + +#~ msgid "Show password" +#~ msgstr "Mostra la contrasenya:" + +#~ msgid "Show passwords" +#~ msgstr "Mostra les contrasenyes" + +#~ msgid "Speed:" +#~ msgstr "Velocitat:" + +#~ msgid "Subnet Mask:" +#~ msgstr "Màscara de subxarxa:" + +#~ msgid "Type:" +#~ msgstr "Tipus:" + +#~ msgid "User Name:" +#~ msgstr "Nom d'usuari:" + +#~ msgid "Wireless Network Key Required" +#~ msgstr "Es requereix una clau per a la xarxa sense fil" + +#~ msgid "Wireless _adapter:" +#~ msgstr "_Adaptador sense fil:" + +#~ msgid "_Always Trust this Wireless Network" +#~ msgstr "Confia sempre en _aquesta xarxa sense fil" + +#~ msgid "_Don't remind me again" +#~ msgstr "_No m'ho tornis a recordar" + +#~ msgid "_Fallback on this Network" +#~ msgstr "Utilitza aquesta _xarxa com a alternativa" + +#~ msgid "_Login to Network" +#~ msgstr "_Entra a la xarxa" + +#~ msgid "_Network Name:" +#~ msgstr "Nom de _xarxa:" + +#~ msgid "_Wireless Security:" +#~ msgstr "Seguretat de la _xarxa sense fil:" + +#~ msgid "Cannot add VPN connection" +#~ msgstr "No s'ha pogut afegir la connexions VPN" + +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "" +#~ "No s'ha pogut trobar el programari VPN adequat en aquest ordinador. " +#~ "Contacteu el vostre administrador." + +#~ msgid "Cannot import VPN connection" +#~ msgstr "No s'ha pogut importar la connexió VPN" + +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "No s'ha pogut trobar el programari adequat per al tipus de connexió VPN «%" +#~ "s» per a importar el fitxer «%s». Contacteu el vostre administrador de " +#~ "sistemes." + +#~ msgid "Error retrieving VPN connection '%s'" +#~ msgstr "S'ha produït un error en recuperar la connexió VPN «%s»" + +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "" +#~ "No s'han pogut trobar els fitxers d'UI per al tipus de connexió VPN «%s». " +#~ "Contacteu el vostre administrador de sistemes." + +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "Voleu suprimir la connexió VPN «%s»?" + +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "Tota la informació sobre la connexió VPN «%s» es perdrà, i segurament " +#~ "necessitareu que el vostre administrador us proporcioni informació per a " +#~ "crear una connexió nova." + +#~ msgid "Unable to load" +#~ msgstr "No es pot carregar" + +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "" +#~ "No s'han pogut trobar alguns dels recursos requerits el fitxer glade)." + +#~ msgid "Create VPN Connection" +#~ msgstr "Crea una connexió VPN" + +#~ msgid "Edit VPN Connection" +#~ msgstr "Edita la connexió VPN" + +#~ msgid "Add a new VPN connection" +#~ msgstr "Afegeix una connexions VPN nova" + +#~ msgid "Delete the selected VPN connection" +#~ msgstr "Suprimeix la connexió VPN seleccionada" + +#~ msgid "E_xport" +#~ msgstr "E_xporta" + +#~ msgid "Edit the selected VPN connection" +#~ msgstr "Edita la connexió VPN seleccionada" + +#~ msgid "Export the VPN settings to a file" +#~ msgstr "Exporta els paràmetres VPN al fitxer" + +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "Exporta la connexió VPN a un fitxer" + +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "Gestioneu connexions a xarxes privades virtuals" + +#~ msgid "VPN Connections" +#~ msgstr "Connexions VPN" + +#~ msgid "40-bit WEP" +#~ msgstr "40-bit WEP" + +#~ msgid "104-bit WEP" +#~ msgstr "104-bit WEP" + +#~ msgid "WPA TKIP" +#~ msgstr "WPA TKIP" + +#~ msgid "WPA CCMP" +#~ msgstr "WPA CCMP" + +#~ msgid "WPA Automatic" +#~ msgstr "WPA automàtic" + +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" + +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" + +#~ msgid "WPA2 Automatic" +#~ msgstr "WPA2 automàtic" + +#~ msgid "none" +#~ msgstr "cap" + +#~ msgid "operation took too long" +#~ msgstr "l'operació ha trigat massa" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "s'han rebut dades d'un tipus de remitent equivocat" + +#~ msgid "received data from unexpected sender" +#~ msgstr "s'han rebut dades d'un remitent que no s'esperava" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "" +#~ "s'han enviat massa dades a través del sòcol, i se n'han perdut algunes" + +#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." +#~ msgstr "Ara esteu connectat a la xarxa Ad-Hoc sense fil «%s»." + +#~ msgid "You are now connected to the wireless network '%s'." +#~ msgstr "Ara esteu connectat a la xarxa sense fil «%s»." + +#~ msgid "You are now connected to the wired network." +#~ msgstr "Ara esteu connectat a la xarxa amb fil." + +#~ msgid "Connection Established" +#~ msgstr "S'ha establert la connexió" + +#~ msgid "Disconnected" +#~ msgstr "Desconnectat" + +#~ msgid "The network connection has been disconnected." +#~ msgstr "S'ha desconnectat la connexió de xarxa." + +#~ msgid "LEAP" +#~ msgstr "LEAP" + +#~ msgid "Choose which type of VPN connection you wish to create." +#~ msgstr "Escolliu el tipus de connexió VPN que vulgueu crear." + +#~ msgid "Connect to:" +#~ msgstr "Connecta a:" + +#~ msgid "Create VPN Connection - 1 of 2" +#~ msgstr "Creació d'una connexió VPN - 1 de 2" + +#~ msgid "Create VPN Connection - 2 of 2" +#~ msgstr "Creació d'una connexió VPN - 2 de 2" + +#~ msgid "Finish Creating VPN Connection" +#~ msgstr "Finalitza la creació de la connexió VPN" + +#~ msgid "" +#~ "This assistant will guide you through the creation of a connection to a " +#~ "Virtual Private Network (VPN).\n" +#~ "\n" +#~ "It will require some information, such as IP addresses and secrets. " +#~ "Please see your system administrator to obtain this information." +#~ msgstr "" +#~ "Aquest auxiliar us guiarà a través de la creació d'una nova connexió VPN " +#~ "a una xarxa privada (VPN).\n" +#~ "\n" +#~ "Cal certa informació, com ara l'adreça IP i secrets, que us hauria de " +#~ "proporcionar el vostre administrador." + +#~ msgid "VPN Error" +#~ msgstr "Error VPN" + +#~ msgid "The VPN service said: \"%s\"" +#~ msgstr "El servei VPN digué: «%s»" + +#~ msgid "VPN connection '%s' said:" +#~ msgstr "La connexió VPN «%s» digué:" + +#~ msgid "leap_subwindow" +#~ msgstr "leap_subwindow" + +#~ msgid "wep_key_subwindow" +#~ msgstr "wep_key_subwindow" + +#~ msgid "wep_passphrase_subwindow" +#~ msgstr "wep_passphrase_subwindow" + +#~ msgid "wpa_psk_subwindow" +#~ msgstr "wpa_psk_subwindow" + +#~ msgid "" +#~ "The requested wireless network '%s' does not appear to be in range. A " +#~ "different wireless network will be used if any are available." +#~ msgstr "" +#~ "La xarxa sense fil sol·licitada «%s», sembla que no està dins del rang. " +#~ "Se'n farà servir una altra si n'hi ha cap de disponible." + +#~ msgid "Failed to get information about the interface!" +#~ msgstr "No s'ha pogut obtenir informació quant a la interfície." + +#~ msgid "_Stop All Wireless Devices" +#~ msgstr "Atura tots els dispositius _sense fil" + +#~ msgid "_Start All Wireless Devices" +#~ msgstr "Inicia tots els dispositius _sense fil" + +#~ msgid "_Wireless Network Discovery" +#~ msgstr "Descobriment de _xarxes sense fil" + +#~ msgid "Always Search" +#~ msgstr "Cerca sempre" + +#~ msgid "Search Only When Disconnected" +#~ msgstr "Cerca només en estar desconnectat" + +#~ msgid "Never Search" +#~ msgstr "No cerquis mai" + +#~ msgid "Stop All Wireless Devices" +#~ msgstr "Atura tots els dispositius sense fil" + +#~ msgid "_Passphrase:" +#~ msgstr "_Contrasenya:" + +#~ msgid "_ASCII Key:" +#~ msgstr "Klau _ASCII:" + +#~ msgid "_Hex Key:" +#~ msgstr "Clau _hexadecimal:" + +#~ msgid ", with no encryption enabled." +#~ msgstr ", amb el xifratge habilitat." + +#~ msgid "ASCII Key:" +#~ msgstr "Clau ASCII:" + +#~ msgid "" +#~ "128-bit Passphrase (WEP)\n" +#~ "ASCII Key (WEP)\n" +#~ "Hex Key (WEP)" +#~ msgstr "" +#~ "Contrasenya de 128-bit (WEP)\n" +#~ "Clau ASCII (WEP)\n" +#~ "Clau Hexadecimal (WEP)" + +#~ msgid "" +#~ "128-bit passphrase (WEP)\n" +#~ "ASCII key (WEP)\n" +#~ "Hex key (WEP)" +#~ msgstr "" +#~ "Contrasenya de 128-bit (WEP)\n" +#~ "Clau ASCII (WEP)\n" +#~ "Clau hexadecimal (WEP)" + +#~ msgid "Connect with _encryption enabled" +#~ msgstr "Connecta amb el _xifratge habilitat" + +#~ msgid "Wireless _network:" +#~ msgstr "_Xarxa sense fil:" + +#~ msgid "" +#~ "Dependent on the private network you want to connect to, you need to " +#~ "select what type of connection you want to create." +#~ msgstr "" +#~ "Depenent del tipus de xarxa privada a la que us vulgueu connectar, heu " +#~ "d'escollir el tipus de connexió que vulgueu crear." + +#~ msgid "Other Wireless Networks..." +#~ msgstr "Altres xarxes sense fil..." + +# FIXME +#~ msgid "Pause Wireless Scanning" +#~ msgstr "Atura l'escaneig sense fil" + +# FIXME +#~ msgid "Resume Wireless Scanning" +#~ msgstr "Reprèn l'escaneig sense fil" + +#~ msgid "progress bar label|%d %%" +#~ msgstr "Etiqueta de la barra de progrés|%d %%" + +# FIXME? +#~ msgid "You must log in to access the Virtual Private Network '%s'." +#~ msgstr "Heu d'autenticar-vos per accedir a la xarxa privada virtual «%s»." + +#~ msgid "_OK" +#~ msgstr "_D'acord" + +#~ msgid "%s" +#~ msgstr "%s" + +#~ msgid "Wireless Networks:" +#~ msgstr "Xarxes sense fil:" + +#~ msgid "Modify Wireless Networks" +#~ msgstr "Modifica xarxes sense fil" + +#~ msgid "*" +#~ msgstr "*" + +#~ msgid "You must log in to access the private network %s" +#~ msgstr "Heu d'autenticar-vos per accedir a la xarxa privada %s" + +#~ msgid "_About..." +#~ msgstr "_Quant a..." diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 00000000..1be6b82e --- /dev/null +++ b/po/cs.po @@ -0,0 +1,1386 @@ +# Czech translation of NetworkManager. +# Copyright (C) 2004, 2005, 2006, 2008 the author(s) of NetworkManager. +# Copyright (C) 2004, 2005, 2006 Miloslav Trmac . +# This file is distributed under the same license as the NetworkManager package. +# Miloslav Trmac , 2004 - 2006. +# Jakub Friedl , 2006. +# Jiří Eischmann , 2008. +# Marek Černocký , 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-09 03:24+0000\n" +"PO-Revision-Date: 2010-04-23 13:02+0200\n" +"Last-Translator: Marek Černocký \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Použití: nmcli con {PŘÍKAZ | help}\n" +" PŘÍKAZ := {list | status | up | down}\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--" +"timeout <časový_limit>]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Připojení" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Typ" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Název" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Systémová připojení:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Uživatelská připojení:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Chyba: schází argument %s." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Chyba: %s - takové připojení neexistuje." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Připojení v rámci systému" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Uživatelská připojení" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Neznámý parametr: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Chyba: nezadán žádný platný parametr." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "ano" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "ne" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Aktivní připojení" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Výchozí" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Služba" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Zařízení" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "žádné aktivní připojení nebo zařízení „%s“" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "žádné aktivní připojení nebo zařízení" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktivuje se" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktivováno" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "neznámo" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN se připojuje (příprava)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN se připojuje (požaduje ověření)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN se připojuje" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN se připojuje (získává se nastavení IP)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN připojena" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN se nezdařilo připojit" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN odpojena" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "neznámý důvod" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "žádný" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "uživatel byl odpojen" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "základní síťové připojení bylo přerušeno" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "služba VPN neočekávaně zastavena" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "služba VPN vrátila neplatné nastavení" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "pokusu o připojení vypršel časový limit" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "služba VPN se nespustila v časovém limitu" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "službu VPN se nezdařilo spustit" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "žádná platná utajení VPN" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "neplatná utajení VPN" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "připojení odstraněno" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "stav: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Připojení aktivováno\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Chyba: Selhala aktivace připojení." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stav: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Chyba: Selhala aktivace připojení: %s" + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Chyba: Časový limit %d sekund vypršel." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Chyba: Selhala aktivace připojení: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Chyba: Získání aktivního připojení pro „%s“ selhalo." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stav aktivního připojení: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Cesta aktivního připojení: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Chyba: Neznámé připojení: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Chyba: hodnota časového limitu „%s“ není platná." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Chyba: nebylo určeno id nebo uuid." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Chyba: Nenalezeno vhodné zařízení: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Chyba: Nenalezeno vhodné zařízení." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Varování: Připojení není aktivní\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „con“ platný." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Chyba: nelze se připojit ke sběrnici D-Bus." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Chyba: Nelze získat systémová nastavení." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Chyba: Nelze získat uživatelská nastavení." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Chyba: Nelze získat připojení: služba správy nastavení neběží." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Použití: nmcli dev {PŘÍKAZ | help}\n" +"\n" +" PŘÍKAZ := {status | list | disconnect | wifi}\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout <časový_limit>]\n" +" wifi [list [iface ] | apinfo iface hwaddr " +"]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "není pod správou" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "nedostupné" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "odpojeno" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "připojuje se (příprava)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "připojuje se (nastavování)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "připojuje se (požadováno ověření)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "připojuje se (získává se nastavení IP)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "připojeno" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "připojení se nezdařilo" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Neznámý" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(nic)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: chyba převodu adresy IP4 0x%X" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Frekv %d MHz, Rychlost %d Mb/s, Síla sig %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", Šifrováno: " + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Podnikové" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Zařízení" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Ovladač" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(neznámo)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Stav" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW adresa" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Schopnosti:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Detekce nosného signálu" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Rychlost" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Vlastnosti bezdrátové části\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "Šifrování WEP" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "Šifrování WPA" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "Šifrování WPA2" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "Šifra TKIP" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "Šifra CCMP" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Bezdrátový přístupový bod %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = aktuální přístupový bod)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Vlastnosti drátové části\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Nosný signál" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "zapnut" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "vypnut" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" Nastavení IPv4:\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adresa" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Předčíslí" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Brána" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Stav zařízení" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Chyba: schází argument „%s“." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Chyba: Zařízení „%s“ nenalezeno." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Úspěch: Zařízení „%s“ úspěšně odpojeno." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Chyba: Odpojení zařízení „%s“ (%s) selhalo: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stav zařízení: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Chyba: nebylo určeno rozhraní." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Seznam prohledání WiFi" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Chyba: Zařízení „%s“ není zařízení WiFi." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Zařízení:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Chyba: musí být určena hardwarová adresa." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Chyba: Přístupový bod s hardwarovou adresou „%s“ nenalezen." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Parametry přístupového bodu" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Kmitočet:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Režim:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastruktura" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Max. přenosová rychlost:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Síla signálu:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Příznaky:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "soukromé" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "Příznaky WPA:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "Příznaky RSN:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „dev wifi“ platný." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „dev“ platný." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Použití: nmcli nm {PŘÍKAZ | help}\n" +"\n" +" PŘÍKAZ := {status | sleep | wakeup | wifi | wwan}\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "uspán" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "připojuje se" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "povoleno" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "zakázáno" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "Stav správce sítě NetworkManager" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "Běh NM:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "běží" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "neběží" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "Stav NM:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "Bezdrátový hardware NM:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "Bezdrátové sítě NM:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "Hardware WWAN NM" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "Sítě WWAN NM:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Chyba: neplatný parametr pro „wifi“: „%s“" + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Chyba: neplatný parametr pro „wwan“: „%s“" + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Chyba: příkaz „%s“ není pro „nm“ platný." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Použití: %s [PŘEPÍNAČE] OBJEKT {PŘÍKAZ | help}\n" +"\n" +"PŘEPÍNAČE\n" +" -t[erse] stručný výpis\n" +" -p[retty] hezký výpis\n" +" -v[ersion] zobrazit verzi programu\n" +" -h[elp] zobrazit tuto nápovědu\n" +"\n" +"OBJEKT\n" +" nm stav NetworkManageru\n" +" con připojení v NetworkManageru\n" +" dev zařízení spravovaná NetworkManagerem\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Objekt „%s“ je neznámý, zkuste „nmcli help“." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nástroj nmcli, verze %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Přepínač „%s“ je neznámý, zkuste „nmcli -help“." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Zachycen signál %d, vypíná se…" + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Chyba: Nelze se připojit ke správci sítě NetworkManager." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Úspěch" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Soubor klíče PEM neměl koncovou značku „%s“." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Nevypadá jako soubor soukromého klíče PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Není dostatek paměti pro uložení dat souboru PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Vadný soubor PEM: značka Proc-Type nebyla první značkou." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Vadný soubor PEM: neznámá značka Proc-Type „%s“." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Vadný soubor PEM: značka DEK-Info nebyla druhou značkou." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Vadný soubor PEM: nebyl nalezen IV ve značce DEK-Info." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Vadný soubor PEM: neplatný formát IV ve značce DEK-Info." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Vadný soubor PEM: neznámá šifra soukromého klíče „%s“." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Nelze dekódovat soukromý klíč." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Certifikát PEM „%s“ nemá koncovou značku „%s“." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Selhalo dekódování certifikátu." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Nedostatek paměti pro uložení dat certifikátu." + +#: ../libnm-util/crypto.c:294 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Not enough memory to store file data." +msgstr "Nedostatek paměti na uložení dat souboru." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV musí mít na délku sudý počet bajtů." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Nedostatek paměti pro uložení IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV obsahuje jiné než šestnáctkové číslice." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Šifra soukromého klíče „%s“ je neznámá." + +#: ../libnm-util/crypto.c:391 +#, c-format +#| msgid "Not enough memory to store decrypted private key." +msgid "Not enough memory to decrypt private key." +msgstr "Nedostatek paměti pro dešifrování soukromého klíče." + +#: ../libnm-util/crypto.c:511 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Unable to determine private key type." +msgstr "Nelze určit typ soukromého klíče." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Nedostatek paměti pro uložení dešifrovaného soukromého klíče." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Selhala inicializace šifrovacího programu." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Selhala inicializace programu pro MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Neplatná délka IV (musí být nejméně %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Nedostatek paměti pro vyrovnávací paměť dešifrovaného klíče." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Selhala inicializace kontextu dešifrovací šifry: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Selhalo nastavení symetrického klíče pro dešifrování: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Selhalo nastavení IV pro dekódování: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Selhalo dekódování soukromého klíče: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Selhalo dešifrování soukromého klíče: neočekávané zarovnání délky." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key." +msgstr "Selhalo dešifrování soukromého klíče." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Nelze alokovat paměť pro šifrování." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Selhala inicializace kontextu šifrovací šifry: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +#| msgid "Failed to set symmetric key for decryption: %s / %s." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Selhalo nastavení symetrického klíče pro šifrování: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Selhalo nastavení IV pro šifrování: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Selhalo šifrování dat: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Chyba při inicializaci dat certifikátu: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Nelze dekódovat certifikát: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Nelze inicializovat dekodér PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Nelze dekódovat soubor PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Nelze ověřit soubor PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Selhala inicializace šifrovacího programu: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Selhala inicializace kontextu MD5: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Neplatná délka IV (musí být nejméně %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Selhala inicializace slotu dešifrovací šifry." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Selhalo nastavení symetrického klíče pro dešifrování." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Selhalo nastavení IV pro dešifrování." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Selhala inicializace dešifrovacího kontextu." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Selhalo dešifrování soukromého klíče: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Selhalo dešifrování soukromého klíče: dešifrovaná data jsou příliš velká." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Selhalo dokončení dešifrování soukromého klíče: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "Selhala inicializace slotu šifrovací šifry." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "Selhalo nastavení symetrického klíče pro šifrování." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Selhalo nastavení IV pro šifrování." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Selhala inicializace kontextu šifrování." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Selhalo šifrování: %d" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Neočekávané množství dat po zašifrování." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Nelze dekódovat certifikát: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Nelze převést heslo na UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Nelze inicializovat dekodér PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Nelze dekódovat soubor PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Nelze ověřit soubor PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "Nelze vygenerovat náhodná data." + +#: ../libnm-util/nm-utils.c:1818 +#, c-format +#| msgid "Not enough memory to create private key decryption key." +msgid "Not enough memory to make encryption key." +msgstr "Nedostatek paměti pro vytvoření šifrovacího klíče." + +#: ../libnm-util/nm-utils.c:1928 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "Nelze alokovat paměť pro vytvoření souboru PEM." + +#: ../libnm-util/nm-utils.c:1940 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Nelze alokovat paměť pro zápis IV do souboru PEM." + +#: ../libnm-util/nm-utils.c:1952 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Nelze alokovat paměť pro zápis šifrovaného klíče do souboru PEM." + +#: ../libnm-util/nm-utils.c:1971 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "Nelze alokovat paměť pro data souboru PEM." + +#: ../src/nm-netlink-monitor.c:195 ../src/nm-netlink-monitor.c:463 +#: ../src/nm-netlink-monitor.c:581 +#: ../src/ip6-manager/nm-netlink-listener.c:351 +#, c-format +msgid "error processing netlink message: %s" +msgstr "chyba při zpracování zprávy netlink: %s" + +#: ../src/nm-netlink-monitor.c:259 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "nelze alokovat ovládání netlinku pro sledování stavu spojení: %s" + +#: ../src/nm-netlink-monitor.c:269 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "nelze se připojit k netlinku pro sledování stavu spojení: %s" + +#: ../src/nm-netlink-monitor.c:277 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "nelze se připojit ke skupině netlink pro sledování stavu spojení: %s" + +#: ../src/nm-netlink-monitor.c:285 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "nelze alokovat mezipaměť netlinku pro sledování stavu spojení: %s" + +#: ../src/nm-netlink-monitor.c:493 +#: ../src/ip6-manager/nm-netlink-listener.c:381 +msgid "error occurred while waiting for data on socket" +msgstr "vyskytla se chyba při čekání na data ze soketu" + +#: ../src/nm-netlink-monitor.c:557 ../src/nm-netlink-monitor.c:570 +#, c-format +msgid "error updating link cache: %s" +msgstr "chyba při aktualizaci mezipaměti spojení: %s" + +#: ../src/main.c:498 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Neplatný přepínač. Platné přepínače si můžete zobrazit pomocí --help.\n" + +#: ../src/main.c:558 +#, 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 "%s. Pomocí --help si prosím zobrazte seznam platných přepínačů.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Vytvořeno NetworkManagerem\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Sloučeno z %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "nebyl nalezen žádný použitelný klient DHCP." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "„dhclient“ byl nalezen." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "„dhcpcd“ byl nalezen." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "nepodporovaný klient DHCP „%s“" + +#: ../src/ip6-manager/nm-netlink-listener.c:199 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "nelze alokovat ovládání netlinku: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:209 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "nelze se připojit k netlinku: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:306 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "nelze se připojit ke skupině netlink: %s" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Neznámá úroveň evidence „%s“" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Neznámá doména evidence „%s“" + +#: ../src/named-manager/nm-named-manager.c:314 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"Poznámka: překladač adres z libc nemůže podporovat více než 3 jmenné servery." + +#: ../src/named-manager/nm-named-manager.c:316 +msgid "The nameservers listed below may not be recognized." +msgstr "Jmenné servery uvedené v následujícím seznamu nelze rozpoznat." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "%s (automaticky)" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "Systém" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Sdílení připojení přes chráněnou síť WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Sdílení připojení přes otevřenou síť WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Měnit trvalý systémový název počítače" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Měnit systémová připojení" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Systémová politika zabránila změně systémového nastavení." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Systémová politika zabránila změně trvalého systémového názvu počítače" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Systémová politika zabránila sdílení připojení přes chráněnou síť WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Systémová politika zabránila sdílení připojení přes otevřenou síť WiFi" diff --git a/po/da.po b/po/da.po new file mode 100644 index 00000000..cbdb2115 --- /dev/null +++ b/po/da.po @@ -0,0 +1,717 @@ +# Danish translation of NetworkManager. +# Copyright (C) 2004-2007 +# This file is distributed under the same license as the NetworkManager package. +# David Nielsen , 2004. +# Martin Willemoes Hansen , 2004. +# Lasse Bang Mikkelsen , 2005, 06, 07. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-02-13 20:50+0100\n" +"PO-Revision-Date: 2007-02-13 20:50+0100\n" +"Last-Translator: Lasse Bang Mikkelsen \n" +"Language-Team: Danish \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" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:417 +msgid "Cannot add VPN connection" +msgstr "Kan ikke tilføje VPN-forbindelse" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:419 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"Ingen passende VPN-programmel blev fundet på dit system. Kontakt din system-" +"administrator." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:461 +msgid "Cannot import VPN connection" +msgstr "Kan ikke importere VPN-forbindelse" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" +"Kan ikke finde passende programmel til VPN-forbindelsestypen '%s', til " +"import af filen '%s'. Kontakt din system-administrator." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:580 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "Fejl ved hentning af VPN-forbindelsen '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:583 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "" +"Kunne ikke finde brugergrænseflade-filerne til VPN-forbindelsestypen '%s'. " +"Kontakt din system-administrator." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:727 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "Slet VPN-forbindelsen \"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:730 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"Al information omkring VPN-forbindelsen \"%s\" vil gå tabt og du får " +"muligvis brug for din system-administrator, som kan give dig de nødvendige " +"informationer til oprettelse af en ny forbindelse." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:924 +msgid "Unable to load" +msgstr "Kan ikke indlæse" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:926 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "Kan ikke finde nogle krævede ressourcer (glade-filen)!" + +#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), +#. NULL, +#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, +#. GTK_STOCK_CANCEL, +#. GTK_RESPONSE_REJECT, +#. GTK_STOCK_APPLY, +#. GTK_RESPONSE_ACCEPT, +#. NULL)); +#: ../gnome/vpn-properties/nm-vpn-properties.c:1081 +msgid "Create VPN Connection" +msgstr "Opret VPN-forbindelse" + +#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); +#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); +#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); +#. make the druid window modal wrt. our main window +#. gtk_window_set_modal (druid_window, TRUE); +#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1099 +msgid "Edit VPN Connection" +msgstr "Redigér VPN-forbindelse" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "Tilføj ny VPN-forbindelse" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Delete the selected VPN connection" +msgstr "Slet den valgte VPN-forbindelse" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "E_xport" +msgstr "E_ksportér" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Edit the selected VPN connection" +msgstr "Redigér den valgte VPN-forbindelse" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Export the VPN settings to a file" +msgstr "Eksportér VPN-opsætningen til en fil" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Export the selected VPN connection to a file" +msgstr "Eksportér den valgte VPN-forbindelse til en fil" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Manage Virtual Private Network Connections" +msgstr "Håndtér virtuelle private netværks-forbindelser (VPN)" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "VPN Connections" +msgstr "VPN-forbindelser" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "40-bit WEP" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "104-bit WEP" + +#: ../src/nm-ap-security-wpa-psk.c:51 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:53 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:55 +msgid "WPA Automatic" +msgstr "WPA automatisk" + +#: ../src/nm-ap-security-wpa-psk.c:60 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:62 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:64 +msgid "WPA2 Automatic" +msgstr "WPA2 automatisk" + +#: ../src/nm-ap-security.c:334 +msgid "none" +msgstr "ingen" + +#: ../src/nm-netlink-monitor.c:174 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"kan ikke oprette netlink sokkel til overvågning af kablede ethernet enheder " +"- %s" + +#: ../src/nm-netlink-monitor.c:192 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"kan ikke tilslutte netlink sokkel til overvågning af kablede ethernet " +"enheder - %s" + +#: ../src/nm-netlink-monitor.c:427 +msgid "operation took too long" +msgstr "handlingen overskred tidsgrænsen" + +#: ../src/nm-netlink-monitor.c:524 +msgid "received data from wrong type of sender" +msgstr "modtog data fra forkert type afsender" + +#: ../src/nm-netlink-monitor.c:537 +msgid "received data from unexpected sender" +msgstr "modtog data fra uventet afsender" + +#: ../src/nm-netlink-monitor.c:666 +msgid "too much data was sent over socket and some of it was lost" +msgstr "for meget data var sendt over sokkelen og noget gik tabt" + +#: ../src/nm-netlink-monitor.c:774 +msgid "error occurred while waiting for data on socket" +msgstr "der opstod en fejl mens der blev ventet på data på sokkelen" + +#: ../src/nm-ap-security-wpa-eap.c:93 ../src/nm-ap-security-wpa-eap.c:117 +msgid "WPA2 Enterprise" +msgstr "WPA2 i virksomhed" + +#: ../src/nm-ap-security-wpa-eap.c:95 ../src/nm-ap-security-wpa-eap.c:122 +msgid "WPA Enterprise" +msgstr "WPA i virksomhed" + +#: ../src/nm-ap-security-leap.c:66 ../src/nm-ap-security-leap.c:82 +msgid "LEAP" +msgstr "LEAP" + +#~ msgid "Passphrase for wireless network %s" +#~ msgstr "Adgangskode til trådløst netværk %s" + +#~ msgid "Connection to the wireless network '%s' failed." +#~ msgstr "Tilslutning til det trådløse netværk '%s' mislykkedes." + +#~ msgid "Connection to the wired network failed." +#~ msgstr "Tilslutning til det kablede netværk mislykkedes." + +#~ msgid "Error displaying connection information: " +#~ msgstr "Fejl ved visning af forbindelses-information: " + +#~ msgid "Could not find some required resources (the glade file)!" +#~ msgstr "Kunne ikke finde nogle krævede ressourcer (glade-filen)!" + +#~ msgid "No active connections!" +#~ msgstr "Ingen aktive forbindelser!" + +#~ msgid "Wired Ethernet (%s)" +#~ msgstr "Kablet Ethernet (%s)" + +#~ msgid "Wireless Ethernet (%s)" +#~ msgstr "Trådløst Ethernet (%s)" + +#~ msgid "NetworkManager Applet" +#~ msgstr "NetworkManager-panelprogram" + +#~ msgid "Copyright © 2004-2005 Red Hat, Inc." +#~ msgstr "Copyright © 2004-2005 Red Hat, Inc." + +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "" +#~ "Statusfelt-panelprogram til håndtering af dine netværks-enheder og -" +#~ "forbindelser." + +#~ msgid "translator-credits" +#~ msgstr "" +#~ "David Nielsen\n" +#~ "Martin Willemoes Hansen\n" +#~ "Lasse Bang Mikkelsen\n" +#~ "\n" +#~ "Dansk-gruppen \n" +#~ "Mere info: http://www.dansk-gruppen.dk" + +#~ msgid "VPN Error" +#~ msgstr "VPN fejl" + +#~ msgid "VPN Login Failure" +#~ msgstr "VPN logind-fejl" + +#~ msgid "Could not start the VPN connection '%s' due to a login failure." +#~ msgstr "" +#~ "Kunne ikke etablere VPN-forbindelsen '%s' pågrund af en logind-fejl." + +#~ msgid "VPN Start Failure" +#~ msgstr "VPN etablerings-fejl" + +#~ msgid "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." +#~ msgstr "" +#~ "Kunne ikke etablere VPN-forbindelsen '%s' pågrund af fejl ved start af " +#~ "VPN-program." + +#~ msgid "VPN Connect Failure" +#~ msgstr "VPN tilslutnings-fejl" + +#~ msgid "Could not start the VPN connection '%s' due to a connection error." +#~ msgstr "" +#~ "Kunne ikke etablere VPN-forbindelsen '%s' pågrund af en forbindelses-fejl." + +#~ msgid "VPN Configuration Error" +#~ msgstr "VPN konfigurations-fejl" + +#~ msgid "The VPN connection '%s' was not correctly configured." +#~ msgstr "VPN-forbindelsen '%s' er ikke konfigureret korrekt." + +#~ msgid "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." +#~ msgstr "" +#~ "Kunne ikke etablere VPN-forbindelsen '%s' fordi VPN-serveren ikke " +#~ "returnerede en passende netværks-konfiguration." + +#~ msgid "The VPN service said: \"%s\"" +#~ msgstr "VPN-tjenesten sagde: \"%s\"" + +#~ msgid "VPN connection '%s' said:" +#~ msgstr "VPN-forbindelsen '%s' sagde:" + +#~ msgid "VPN Login Message" +#~ msgstr "VPN logind-meddelelse" + +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "NetworkManager panelprogrammet kunne ikke finde nogle krævede ressourcer " +#~ "(glade-filen blev ikke fundet)." + +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "Netværks-enheden \"%s (%s)\" understøtter ikke trådløs scanning." + +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "Netværks-enheden \"%s (%s)\" understøtter ikke link-detektering." + +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "Klargører enheden %s til det kablede netværk..." + +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "Klargører enheden %s til det trådløse netværk '%s'..." + +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "Konfigurerer enheden %s til det kablede netværk..." + +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "Forsøger at tilslutte til det trådløse netværk '%s'..." + +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "Venter på netværksnøglen til det trådløse netværk '%s'..." + +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "Forespørger en netværks-adresse fra det kablede netværk..." + +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "Forespørger en netværks-adresse fra det trådløse netværk '%s'..." + +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "Færdiggører tilslutning til det kablede netværk..." + +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "Færdiggører tilslutning til det trådløse netværk '%s'..." + +#~ msgid "NetworkManager is not running" +#~ msgstr "NetworkManager kører ikke" + +#~ msgid "Networking disabled" +#~ msgstr "Netværks-understøttelse deaktiveret" + +#~ msgid "No network connection" +#~ msgstr "Ingen netværks-forbindelse" + +#~ msgid "Wired network connection" +#~ msgstr "Kablet netværks-forbindelse" + +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Tilsluttet til et trådløst ad hoc netværk" + +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Trådløs netværks-forbindelse til '%s' (%d%%)" + +#~ msgid "VPN connection to '%s'" +#~ msgstr "VPN-forbindelse til '%s'" + +#~ msgid "VPN connecting to '%s'" +#~ msgstr "VPN tilslutter til '%s'" + +#~ msgid "_Connect to Other Wireless Network..." +#~ msgstr "_Tilslut til andet trådløst netværk..." + +#~ msgid "Create _New Wireless Network..." +#~ msgstr "Opret _nyt trådløst netværk..." + +#~ msgid "_VPN Connections" +#~ msgstr "_VPN-forbindelser" + +#~ msgid "_Configure VPN..." +#~ msgstr "_Konfigurér VPN..." + +#~ msgid "_Disconnect VPN..." +#~ msgstr "_Afbryd VPN..." + +#~ msgid "_Dial Up Connections" +#~ msgstr "_Opkalds-forbindelser" + +#~ msgid "Connect to %s..." +#~ msgstr "Tilslut til %s..." + +#~ msgid "Disconnect from %s..." +#~ msgstr "Afbryd fra %s..." + +#~ msgid "No network devices have been found" +#~ msgstr "Ingen netværks-enheder blev fundet" + +#~ msgid "NetworkManager is not running..." +#~ msgstr "NetworkManager kører ikke..." + +#~ msgid "Enable _Networking" +#~ msgstr "Aktivér _netværks-understøttelse" + +#~ msgid "Enable _Wireless" +#~ msgstr "Aktivér _trådløst netværk" + +#~ msgid "Connection _Information" +#~ msgstr "Forbindelses-_information" + +#~ msgid "_Help" +#~ msgstr "_Hjælp" + +#~ msgid "_About" +#~ msgstr "_Om" + +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "NetworkManager panelprogrammet kunne ikke finde nogle krævede ressourcer " +#~ "- kan ikke fortsætte.\n" + +#~ msgid "Open System" +#~ msgstr "Åbent system" + +#~ msgid "Shared Key" +#~ msgstr "Delt nøgle" + +#~ msgid "TKIP (Default)" +#~ msgstr "TKIP (forvalgt)" + +#~ msgid "AES-CCMP" +#~ msgstr "AES-CCMP" + +#~ msgid "None" +#~ msgstr "Ingen" + +#~ msgid "WEP 40/128-bit ASCII" +#~ msgstr "WEP 40/128-bit ASCII" + +#~ msgid "WEP 40/128-bit hex" +#~ msgstr "WEP 40/128-bit hex" + +#~ msgid "WEP Passphrase" +#~ msgstr "WEP-adgangskode:" + +#~ msgid "Orientation" +#~ msgstr "Retning" + +#~ msgid "The orientation of the tray." +#~ msgstr "Retningen på statusikonet." + +#~ msgid "Wired Network (%s)" +#~ msgstr "Kablet netværk (%s)" + +#~ msgid "_Wired Network" +#~ msgstr "_Kablet netværk" + +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "Trådløst netværk (%s)" +#~ msgstr[1] "Trådløse netværk (%s)" + +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "Trådløst netværk" +#~ msgstr[1] "Trådløse netværk" + +#~ msgid " (invalid Unicode)" +#~ msgstr " (ugyldig Unicode)" + +#~ msgid "" +#~ "By default, the wireless network's name is set to your computer's name, %" +#~ "s, with no encryption enabled" +#~ msgstr "" +#~ "Som standard navngives det trådløse netværk til din maskines navn, %s, " +#~ "uden nogen kryptering slået til" + +#~ msgid "Create new wireless network" +#~ msgstr "Opret nyt trådløst netværk" + +#~ msgid "" +#~ "Enter the name and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "" +#~ "Indtast navn- og sikkerhedsopsætning på det trådløse netværk du ønsker at " +#~ "oprette." + +#~ msgid "Create New Wireless Network" +#~ msgstr "Opret nyt trådløst netværk" + +#~ msgid "Existing wireless network" +#~ msgstr "Eksisterende trådløst netværk" + +#~ msgid "Enter the name of the wireless network to which you wish to connect." +#~ msgstr "Indtast navnet på det trådløse netværk du ønsker at tilslutte dig." + +#~ msgid "Connect to Other Wireless Network" +#~ msgstr "Tilslut til andet trådløst netværk" + +#~ msgid "Cannot start VPN connection '%s'" +#~ msgstr "Kan ikke etablere VPN-forbindelsen '%s'" + +#~ msgid "" +#~ "Could not find the authentication dialog for VPN connection type '%s'. " +#~ "Contact your system administrator." +#~ msgstr "" +#~ "Kunne ikke finde godkendelses-vinduet til VPN-forbindelsestypen '%s'. " +#~ "Kontakt din system-administrator." + +#~ msgid "" +#~ "There was a problem launching the authentication dialog for VPN " +#~ "connection type '%s'. Contact your system administrator." +#~ msgstr "" +#~ "Der opstod en fejl ved start af godkendelses-vinduet til VPN-" +#~ "forbindelsestypen '%s'. Kontakt din system-administrator." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "" +#~ "Active Connection Information" +#~ msgstr "" +#~ "Information om aktiv forbindelse" + +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "Adgangskode påkrævet af trådløst " +#~ "netværk\n" +#~ "\n" +#~ "En adgangskode eller krypteringsnøgle er påkrævet, for at opnå adgang til " +#~ "det trådløse netværk '%s'." + +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "Reduceret netværks-funktionalitet\n" +#~ "\n" +#~ "%s Den vil ikke være fuldstændig funktionsdygtig." + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen to log in to the wireless network '%s'. If you are sure " +#~ "that this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will not require confirmation on subsequent log ins." +#~ msgstr "" +#~ "Bekræftelse af logind på trådløst " +#~ "netværk\n" +#~ "\n" +#~ "Du har valgt at logge på det trådløse netværk '%s'. Hvis du er sikker på " +#~ "at dette trådløse netværk er sikkert, afkryds nedenstående " +#~ "afkrydsningsfelt og NetworkManager vil ikke spørge i fremtiden." + +#~ msgid "Authentication:" +#~ msgstr "Godkendelse:" + +#~ msgid "Broadcast Address:" +#~ msgstr "Rundsendings-adresse:" + +#~ msgid "C_onnect" +#~ msgstr "T_ilslut" + +#~ msgid "Connection Information" +#~ msgstr "Forbindelses-information" + +#~ msgid "Default Route:" +#~ msgstr "Standard rute:" + +#~ msgid "Destination Address:" +#~ msgstr "Destinations-adresse:" + +#~ msgid "Hardware Address:" +#~ msgstr "Hardware-adresse:" + +#~ msgid "IP Address:" +#~ msgstr "IP-adresse:" + +#~ msgid "Interface:" +#~ msgstr "Enhed:" + +#~ msgid "Key:" +#~ msgstr "Nøgle:" + +#~ msgid "" +#~ "None\n" +#~ "WEP Passphrase\n" +#~ "WEP 40/128-bit hex\n" +#~ "WEP 40/128-bit ASCII\n" +#~ msgstr "" +#~ "Ingen\n" +#~ "WEP-adgangskode\n" +#~ "WEP 40/128-bit hex\n" +#~ "WEP 40/128-bit ASCII\n" + +#~ msgid "" +#~ "Open System\n" +#~ "Shared Key" +#~ msgstr "" +#~ "Åbent system\n" +#~ "Delt nøgle" + +#~ msgid "Other Wireless Network..." +#~ msgstr "Andet trådløst netværk..." + +#~ msgid "Passphrase:" +#~ msgstr "Adgangskode:" + +#~ msgid "Password:" +#~ msgstr "Adgangskode:" + +#~ msgid "Primary DNS:" +#~ msgstr "Primær DNS:" + +#~ msgid "Secondary DNS:" +#~ msgstr "Sekundær DNS:" + +#~ msgid "Subnet Mask:" +#~ msgstr "Undernet-maske:" + +#~ msgid "Type:" +#~ msgstr "Type:" + +#~ msgid "User Name:" +#~ msgstr "Brugernavn:" + +#~ msgid "Wireless Network Key Required" +#~ msgstr "Nøgle til trådløst netværk påkrævet" + +#~ msgid "Wireless _adapter:" +#~ msgstr "Trådløs _adapter:" + +#~ msgid "_Always Trust this Wireless Network" +#~ msgstr "_Stol altid på dette trådløse netværk" + +#~ msgid "_Don't remind me again" +#~ msgstr "_Påmind mig ikke igen" + +#~ msgid "_Login to Network" +#~ msgstr "_Log på netværk" + +#~ msgid "_Network Name:" +#~ msgstr "_Netværksnavn:" + +#~ msgid "_Wireless Security:" +#~ msgstr "Trådløs sikkerhed:" + +#~ msgid "leap_subwindow" +#~ msgstr "leap_subwindow" + +#~ msgid "wep_key_subwindow" +#~ msgstr "wep_key_subwindow" + +#~ msgid "wep_passphrase_subwindow" +#~ msgstr "wep_passphrase_subwindow" + +#~ msgid "wpa_psk_subwindow" +#~ msgstr "wpa_psk_subwindow" + +#~ msgid "WPA2 Personal" +#~ msgstr "Personlig WPA2" + +#~ msgid "WPA Personal" +#~ msgstr "Personlig WPA" + +#~ msgid "Choose which type of VPN connection you wish to create." +#~ msgstr "Vælg hvilken type VPN-forbindelse du ønsker at oprette." + +#~ msgid "Connect to:" +#~ msgstr "Tilslut til:" + +#~ msgid "Create VPN Connection - 1 of 2" +#~ msgstr "Opret VPN-forbindelse - 1 af 2" + +#~ msgid "Create VPN Connection - 2 of 2" +#~ msgstr "Opret VPN-forbindelse - 2 af 2" + +#~ msgid "Finish Creating VPN Connection" +#~ msgstr "Færdiggør oprettelse af VPN-forbindelse" + +#~ msgid "" +#~ "This assistant will guide you through the creation of a connection to a " +#~ "Virtual Private Network (VPN).\n" +#~ "\n" +#~ "It will require some information, such as IP addresses and secrets. " +#~ "Please see your system administrator to obtain this information." +#~ msgstr "" +#~ "Denne vil guide dig gennem oprettelsen af en forbindelse til et virtuelt " +#~ "privat netværk (VPN).\n" +#~ "\n" +#~ "Denne guide vil kræve nogle informationer, såsom IP-adresser og " +#~ "adgangskode. Henvend dig venligst til din system-administrator for at få " +#~ "disse informationer." diff --git a/po/de.po b/po/de.po new file mode 100644 index 00000000..ad8f810f --- /dev/null +++ b/po/de.po @@ -0,0 +1,1678 @@ +# translation of de.po to +# Hendrik Brandt , 2004, 2005. +# Frank Arnold , 2005. +# Hendrik Richter , 2006. +# Thomas Gier , 2007. +# Andre Klapper , 2007. +# Hauke Mehrtens , 2008. +# Christian Kirbach , 2009, 2010. +# Timo Trinks , 2010. +# German translation of NetworkManager. +# Copyright (C) 2005 Dan Williams +# This file is distributed under the same license as the NetworkManager package. +msgid "" +msgstr "" +"Project-Id-Version: de\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:49+1000\n" +"Last-Translator: Timo Trinks \n" +"Language-Team: \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: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "GERÄTE" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "BANDBREITE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "VORGABE" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-DIENST" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJEKT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYP" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "ZEITSTEMPEL" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "ZEITSTEMPEL-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "NURLESEN" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Aufruf: nmcli con { BEFEHL | help }\n" +" BEFEHL := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Fehler: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Fehler: 'con list': %s; erlaubte Felder: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Verbindungsdetails" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "System" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "Benutzer" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "nie" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ja" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "nein" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "System-Verbindungen" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Benutzer-Verbindungen" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Fehler: %s Argument fehlt." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Fehler: %s - keine solche Verbindung." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Unbekannter Parameter: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Fehler: Kein gültiger Parameter angegeben." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Fehler: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Fehler: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Fehler: 'con status': %s; erlaubte Felder: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Aktive Verbindungen" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "keine aktive Verbindung auf Gerät '%s'" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "keine aktive Verbindung auf Gerät" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "Gerät '%s' nicht mit Verbindung '%s' kompatibel" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "kein Gerät für Verbindung '%s' gefunden" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "wird aktiviert" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "aktiviert" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "unbekannt" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN wird verbunden (vorbereiten)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN wird verbunden (Authentifizierung erforderlich)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN wird verbunden" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN wird verbunden (IP-Konfiguration wird ermittelt)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN verbunden" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN-Verbindung fehlgeschlagen" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN getrennt" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "unbekannter Grund" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "kein" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "der Benutzer wurde getrennt" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "die Basisverbindung wurde unterbrochen" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "der VPN-Dienst brach unerwartet ab" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "der VPN-Dienst gab eine ungültige Konfiguration zurück" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "Der Verbindungsversuch ist zeitlich abgelaufen" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "der VPN-Dienst ist nicht rechtzeitig gestartet" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "der VPN-Dienst konnte nicht starten" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "keine gültigen VPN-Geheimnisse" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "ungültige VPN-Geheimnisse" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "Die Verbindung wurde entfernt" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "Status: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Verbindung aktiviert\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "Status: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Fehler: Zeitbeschränkung von %d Sekunden abgelaufen." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Fehler: Aktivierung der Verbindung fehlgeschlagen: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Fehler: Erlangen der Verbindung für '%s' ist fehlgeschlagen." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Status der aktiven Verbindung: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Pfad der aktiven Verbindung: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Fehler: Unbekannte Verbindung: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Fehler: Der Wert '%s' für den Zeitablauf ist nicht gültig." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Fehler: id oder uuid muss angegeben werden." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Fehler: Kein passendes Gerät gefunden: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Fehler: Kein passendes Gerät gefunden." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Warnung: Verbindung ist derzeit nicht aktiv\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Fehler: Der Befehl '%s' für 'con' ist nicht gültig." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Fehler: Es konnte nicht mit D-Bus verbunden werden." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Fehler: Systemeinstellungen konnten nicht ermittelt werden" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Fehler: Benutzereinstellungen konnten nicht ermittelt werden." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Fehler: Verbindungen können nicht erlangt werden: Die Einstellungsdienste " +"werden nicht ausgeführt." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "GERÄT" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATUS" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "ALLGEMEIN" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "FÄHIGKEITEN" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-EIGENSCHAFTEN" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "KABEL-EIGENSCHAFTEN" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-EINSTELLUNGEN" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "TREIBER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "ANBIETER-SUCHE" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "GESCHWINDIGKEIT" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "ANBIETER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADRESSE" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PRÄFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODUS" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SICHERHEIT" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "AKTIV" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Aufruf: nmcli dev { BEFEHL | help }\n" +"\n" +" BEFEHL := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "nicht verwaltet" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "nicht verfügbar" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "getrennt" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "wird verbunden (vorbereiten)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "wird verbunden (konfigurieren)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "wird verbunden (Authentifizierung erforderlich)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "wird verbunden (IP-Konfiguration wird ermittelt)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "verbunden" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "Verbindung fehlgeschlagen" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "Unbekannt" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(keine)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: Fehler bei Umwandlung der IPv4-Addresse 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Verschlüsselt: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +# Das ergibt z.B. WPA-Enterprise, klingt komisch mit »Unternehmen« +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infrastuktur" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Fehler: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Fehler: 'dev list': %s; erlaubte Felder: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Gerätedetails" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(unbekannt)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "unbekannt)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "an" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "aus" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Fehler: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Fehler: 'dev status': %s; erlaubte Felder: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Status von Geräten" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Fehler: Argument '%s' fehlt." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Fehler: Gerät '%s' wurde nicht gefunden" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Erfolg: Gerät '%s' wurde erfolgreich getrennt." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Fehler: Trennung des Gerätes '%s' (%s) ist fehlgeschlagen: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Gerätezustand: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Fehler: Schnittstelle muss angegeben werden." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Fehler: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Fehler: 'dev wifi': %s; erlaubte Felder: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Suchliste für WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Fehler: Der Zugangspunkt mit Hardware-Adresse '%s' wurde nicht gefunden." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fehler: Gerät '%s' ist kein WiFi-Gerät." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Fehler: Der Befehl '%s' für 'dev wifi' ist nicht gültig." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Fehler: Der Befehl '%s' für 'dev' ist nicht gültig." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "WIRD AUSGEFÜHRT" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Aufruf: nmcli nm { BEFEHL | help }\n" +"\n" +" BEFEHL := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "schlafend" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "wird verbunden" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Fehler: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Fehler: 'nm status': %s; erlaubte Felder: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Status von NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "aktiviert" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "deaktiviert" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "wird ausgeführt" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "wird nicht ausgeführt" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Fehler: '--fields' Wert '%s' hier nicht gültig; erlaubte Felder: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi aktiviert" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Fehler: Ungültiger 'wifi'-Parameter: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN aktiviert" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Fehler: Ungültiger 'wwan'-Parameter: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Fehler: Der Befehl '%s' für 'nm' ist nicht gültig." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Aufruf: %s [OPTIONEN] OBJEKT { BEFEHL | help }\n" +"\n" +"OPTIONEN\n" +" -t[erse] knappe Ausgabe\n" +" -p[retty] hübsche Ausgabe\n" +" -m[ode] tabular|multiline Ausgabemodus\n" +" -f[ields] |all|common Ausgabefelder angeben\n" +" -e[scape] yes|no Spaltentrenner in den Werten mit Maskierungszeichen versehen\n" +" -v[ersion] Programm-Version anzeigen\n" +" -h[elp] dies Hilfe ausgeben\n" +"\n" +"OBJEKT\n" +" nm Status von NetworkManager\n" +" con Verbindungen von NetworkManager\n" +" dev von NetworkManager verwaltete Verbindungen\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Fehler: Objekt '%s' ist unbekannt, versuchen Sie 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Fehler: Option '--terse' wird als zweite Option angegeben." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Fehler: Option '--terse' und '--pretty' schließen sich gegenseitig aus." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Fehler: Option '--pretty' wird als zweite Option angegeben." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Fehler: Option '--pretty' und '--terse' schließen sich gegenseitig aus." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Fehler: Fehlendes Argument für die Option '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Fehler: '%s' kein gültiges Argument für die Option '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Fehler: Felder für die Optionen '%s' fehlen." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli, Version %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Fehler: Option '%s' ist unbekannt, versuchen Sie 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Signal %d wurde empfangen, wird beendet …" + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Fehler: Verbindung mit NetworkManager konnte nicht hergestellt werden." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Erfolg" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-Bit Passphrase)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (unbekannt)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (unbekannt)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "beliebig, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nicht gesetzt" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "Feld '%s' muss isoliert sein" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ungültiges Feld '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Option '--terse' erfordert die Angabe von '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Option '--terse' erfordert spezielle '--fields' Optionswerte , nicht '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM-Schlüssel Datei hat kein abschließendes Tag '%s'." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Dies scheint kein privater PEM-Schlüssel zu sein." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Es steht nicht genug Speicher zum Speichern der PEM-Datei zur Verfügung." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Fehlerhafte PEM-Datei: Proc-Type ist nicht der erste Tag." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Fehlerhafte PEM-Datei: unbekannter Proc-Type Tag '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Fehlerhafte PEM-Datei: DEK-Info ist nicht der zweite Tag." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Fehlerhafte PEM-Datei: kein IV im DEK-Info Tag gefunden." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Fehlerhafte PEM-Datei: falsches Format des IV in DEK-Info Tag." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "" +"Fehlerhafte PEM-Datei: Unbekannte Verschlüsselung '%s' des privaten " +"Schlüssels." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Der private Schlüssel konnte nicht dekodiert werden." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM-Zertifikat '%s' hat kein abschließendes Tag '%s'." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Das Dekodieren des Zertifikats ist fehlgeschlagen." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Nicht genug Speicher zum Abspeichern des Zertifikates." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Nicht genug Speicher zum Abspeichern der Datei." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV muss eine gerade Anzahl an Zeichen lang sein." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Nicht genug Speicher zum Sichern des IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV enthält nicht hexadezimale Zeichen." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Unbekannte Verschlüsselung '%s' des privaten Schlüssels." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Nicht genug Speicher zum Entschlüsseln des privaten Schlüssels." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Die Art des privaten Schlüssels kann nicht bestimmt werden." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Nicht genug Speicher zum Speichern des entschlüsselten privaten Schlüssels." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Fehler beim Initialisieren der Verschlüsselung." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Fehler beim Initialisieren von MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Ungültige Länge des IV (muss zumindest %zd sein)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Nicht genug Speicher für den Puffer zur Entschlüsselung." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Fehler beim Initialisieren des Entschlüsselungs-Kontextes: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "" +"Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung: %" +"s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Fehler beim Festlegen des IV für die Verschlüsselung: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: Unerwartete Fülllänge." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Fehler beim Entschlüsseln des privaten Schlüssels." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Es konnte kein Arbeitsspeicher zur Verschlüsselung angefordert werden." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Fehler beim Initialisieren des Verschlüsselungs-Kontextes: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "" +"Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung: %" +"s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Fehler beim Festlegen des IV für die Verschlüsselung: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Fehler beim Verschlüsseln der Daten: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Fehler beim Initialisieren des Zertifikats: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Zertifikat konnte nicht dekodiert werden: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12-Decoder konnte nicht initialisiert werden: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 konnte nicht decodiert werden: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12-Datei konnte nicht überprüft werden: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Fehler beim Initialisieren der Verschlüsselung: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Fehler beim Initialisieren des MD5-Kontextes: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Ungültige Länge des IV (muss zumindest %d sein)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Fehler beim Festlegen des symmetrischen Schlüssels für die Entschlüsselung." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Fehler beim Festlegen des IV für die Entschlüsselung." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Fehler beim Einrichten des Entschlüsselungs-Kontextes." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Fehler beim Entschlüsseln des privaten Schlüssels: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Fehler beim Entschlüsseln des privaten Schlüssels: Die entschlüsselten Daten " +"sind zu groß." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Fehler beim Abschließen der Entschlüsselung des privaten Schlüssels: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Fehler beim Einrichten des Verschlüsselungs-Slots." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Fehler beim Festlegen des symmetrischen Schlüssels für die Verschlüsselung." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Fehler beim Festlegen des IV für die Verschlüsselung." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Fehler beim Initialisieren des Verschlüsselungs-Kontextes." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Fehler beim Verschlüsseln: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Unerwartete Datenmenge nach der Verschlüsselung." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Zertifikat konnte nicht dekodiert werden: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Passwort konnte nicht zu UCS2 konvertiert werden: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12-Decoder konnte nicht initialisiert werden: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12-Datei konnte nicht decodiert werden: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12-Datei konnte nicht überprüft werden: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Zufällige Daten konnten nicht erstellt werden." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Nicht genug Speicher zum Erstellen eines Schlüssels." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Es konnte kein Speicher zum Erstellen der PEM-Datei angefordert werden." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "" +"Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " +"werden." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Es konnte kein Speicher zum Schreiben des IV in die PEM-Datei angefordert " +"werden." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Es konnte kein Speicher für die Daten der PEM-Datei angefordert werden." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "Fehler beim Verarbeiten der netlink-Nachricht: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "Während des Wartens auf Daten am Socket ist ein Fehler aufgetreten" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"Es kann nicht mit netlink zur Überwachung der Netzwerkverbindung verbunden " +"werden: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "Kann Weitergabe von Berechtigungen des netlink-Handle nicht aktivieren: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"Es kann kein netlink-Handle zur Überwachung der Netzwerkverbindung " +"angefordert werden: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"Es kann kein netlink-Cache zur Überwachung der Netzwerkverbindung belegt " +"werden: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "Der netlink-Gruppe kann nicht beigetreten werden: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "Fehler beim Aktualisieren des Verbindungs-Cache: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Ungültige Option. Verwenden Sie bitte '--help', um eine Liste der gültigen " +"Optionen zu erhalten.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "" +"%s Verwenden Sie bitte '--help', um eine Liste der gültigen Optionen zu " +"erhalten.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Erstellt von NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Zusammengefügt aus %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "Kein brauchbarer DHCP-Client gefunden." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' wurde gefunden." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' wurde gefunden." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "Nicht unterstützter DHCP-Client '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Unbekanntes Log-Level '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Unbekannte Log-Domain '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"HINWEIS: Der libc-Auflöser unterstützt eventuell nicht mehr als 3 Server zur " +"Namensauflösung." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "" +"Die nachfolgend aufgelisteten Server zur Namensauflösung werden eventuell " +"nicht erkannt." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "System" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Verbindungsfreigabe über ein geschütztes WiFi-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Verbindungsfreigabe über ein offenes WiFi-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Den ständigen Rechnernamen des Systems bearbeiten" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "System-Verbindungen bearbeiten" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Die Systemrichtlinien verhindern das Bearbeiten des ständigen Rechnernamens " +"des Systems" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein geschütztes " +"WiFi-Netzwerk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WiFi-" +"Netzwerk" + diff --git a/po/dz.po b/po/dz.po new file mode 100644 index 00000000..4227867b --- /dev/null +++ b/po/dz.po @@ -0,0 +1,218 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: networkmanager.networkmanager-0-6-0-release.pot\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-19 15:44+0000\n" +"PO-Revision-Date: 2007-03-20 10:17+0530\n" +"Last-Translator: sonam pelden \n" +"Language-Team: Dzongkha \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-Poedit-Language: Dzongkha\n" +"X-Poedit-Country: Bhutan\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:405 +msgid "Cannot add VPN connection" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་འདི་ཁ་སྐོང་བརྐྱབ་མ་ཚུགས་" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:407 +msgid "No suitable VPN software was found on your system. Contact your system administrator." +msgstr "ཁྱོད་ཀྱི་རིམ་ལུགས་གུ་འོས་འབབ་ལྡན་པའི་ཝི་པི་ཨེན་མཉེན་ཆས་ཐོབ་མ་ཚུགས། ཁྱོད་རའི་རིམ་ལུགས་བདག་སྐྱོང་པ་ལུ་འབྲེལ་བ་འཐབ།" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:457 +msgid "Cannot import VPN connection" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་ནང་འདྲེན་འབད་མ་ཚུགས་" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:459 +#, c-format +msgid "Cannot find suitable software for VPN connection type '%s' to import the file '%s'. Contact your system administrator." +msgstr "ཡིག་སྣོད་'%s'ནང་འདྲེན་འབད་ནི་ལུ་ ཝི་པི་ཨེན་མཐུད་ལམ་དབྱེ་བ་ '%s'གི་དོན་ལུ་མཉེན་ཆས་འོས་འབབ་ལྡན་པ་འདི་ཐོབ་མ་ཚུགས། ཁྱོད་རའི་རིམ་ལུགས་བདག་སྐྱོང་པ་ལུ་འབྲེལ་བ་འཐབ།" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:596 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་'%s'སླར་འདྲེན་འབདཝ་ད་འཛོལ་བ་" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:599 +#, c-format +msgid "Could not find the UI files for VPN connection type '%s'. Contact your system administrator." +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་དབྱེ་བ་'%s'གི་དོན་ལུ་ ཡུ་ཨའི་ཡིག་སྣོད་ཚུ་ཐོབ་མ་ཚུགས། ཁྱོད་རའི་རིམ་ལུགས་བདག་སྐྱོང་པ་འདི་ལུ་འབྲེལ་བ་འཐབ།" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:746 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་བཏོན་གཏང་ག\"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:749 +#, c-format +msgid "All information about the VPN connection \"%s\" will be lost and you may need your system administrator to provide information to create a new connection." +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་\"%s\" གི་སྐོར་ལས་བརྡ་དོན་ཆ་མཉམ་བརླག་སྟོར་ཞུགས་ནི་དང་ མཐུད་ལམ་གསརཔ་ཅིག་གསར་བསྐྲུན་འབད་ནི་ལུ་ བརྡ་དོན་བྱིན་མི་ཁྱོད་རའི་རིམ་ལུགས་བདག་སྐྱོང་པ་འདི་དགོཔ་ཨིན།" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:963 +msgid "Unable to load" +msgstr "མངོན་གསལ་འབད་མ་ཚུགས་" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:965 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "དགོ་པའི་བྱུང་ཁུངས་ (གེལེཌི་ཡིག་སྣོད་) ལ་ལོ་ཅིག་ཐོབ་མི་ཚུགས!" + +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1084 +msgid "Edit VPN Connection" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་ཞུན་དག་འབད་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་གསརཔ་ཅིག་ཁ་སྐོང་བརྐྱབ་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Choose which type of VPN connection you wish to create." +msgstr "ཁྱོད་ཀྱིས་ཝི་པི་ཨེན་མཐེད་ལམ་ག་བཟུམ་གསར་བསྐྲུན་འབད་ནི་ཨིན་ན་གདམ་ཁ་བརྐྱབ།" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "Connect to:" +msgstr "མཐུད:" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Create VPN Connection" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་གསར་བསྐྲུན་འབད་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Create VPN Connection - 1 of 2" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་ ༢་ཀྱི་ - ༡་གསར་བསྐྲུན་འབད་ " + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Create VPN Connection - 2 of 2" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་ ༢་ཀྱི་ -༢་གསར་བསྐྲུན་འབད་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Delete the selected VPN connection" +msgstr "སེལ་འཐུ་འབད་དེ་ཡོད་པའི་ཝི་པི་ཨེན་མཐུད་ལམ་འདི་བཏོན་གཏང་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "E_xport" +msgstr "ཕྱིར་འདྲེན་འབད། (_x)" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:9 +msgid "Edit the selected VPN connection" +msgstr "སེལ་འཐུ་འབད་དེ་ཡོད་པའི་ཝི་པི་ཨེན་མཐུད་ལམ་འདི་ཞུན་དག་འབད་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:10 +msgid "Export the VPN settings to a file" +msgstr "ཝི་པི་ཨེན་སྒྲིག་སྟངས་ཚུ་ཡིག་སྣོད་གཅིག་ལུ་ཕྱིར་འདྲེན་འབད་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:11 +msgid "Export the selected VPN connection to a file" +msgstr "སེལ་འཐུ་འབད་དེ་ཡོད་པའི་ཝི་པི་ཨེན་མཐུད་ལམ་འདི་ཡིག་སྣོད་གཅིག་ལུ་ཕྱིར་འདྲེན་འབད་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:12 +msgid "Finish Creating VPN Connection" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་གསར་བསྐྲུན་འབད་ཚར་ནུག་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:13 +msgid "Manage Virtual Private Network Connections" +msgstr "བར་ཅུ་ཡལ་སྒེར་སྡེ་ཡོངས་འབྲེལ་མཐུད་ལམ་ཚུ་འཛིན་སྐྱོང་འཐབ་" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:14 +msgid "" +"This assistant will guide you through the creation of a connection to a Virtual Private Network (VPN).\n" +"\n" +"It will require some information, such as IP addresses and secrets. Please see your system administrator to obtain this information." +msgstr "" +"ལས་རོགས་འདི་གིས་ མཐུད་ལམ་གསར་བསྐྲུན་འབད་ནི་ལས་རྒྱུད་དེ་ བར་ཅུ་ཡལ་སྒེར་སྡེའི་ཡོངས་འབྲེལ་(ཝི་པི་ཨེན་)ཅིག་ལུ་ཁྱོད་འཁྱིདཔ་ཨིན།\n" +"\n" +"དེ་ལུ་བརྡ་དོན་ལ་ལོ་ཅིག་དགོཔ་ཨིན་ དེ་ཡང་ ཨའི་པི་ཁ་བྱང་དང་གསང་བ་བཟུམ་ཨིན། བརྡ་དོན་འདི་ཐོབ་ནི་ལུ་ཁྱོད་རའི་རིམ་ལུགས་བདག་སྐྱོང་པ་འདི་ལྟ་གནང་།" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:17 +msgid "VPN Connections" +msgstr "ཝི་པི་ཨེན་མཐུད་ལམ་ཚུ་" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "༤༠་-བིཊི་ཌབ་ལུ་ཨི་པི་" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "༡༠༤-བིཊི་ཌབ་ལུ་ཨི་པི་" + +#: ../src/nm-ap-security-wpa-psk.c:50 +msgid "WPA TKIP" +msgstr "ཌབ་ལུ་པི་ཨེ་ཊི་ཀེ་ཨའི་པི་" + +#: ../src/nm-ap-security-wpa-psk.c:52 +msgid "WPA CCMP" +msgstr "ཌབ་ལུ་པི་ཨེ་ སི་སི་ཨེམ་པི་" + +#: ../src/nm-ap-security-wpa-psk.c:54 +msgid "WPA Automatic" +msgstr "ཌབ་ལུ་པི་ཨེ་རང་བཞིན་" + +#: ../src/nm-ap-security-wpa-psk.c:59 +msgid "WPA2 TKIP" +msgstr "ཌབ་ལུ་པི་ཨེ་༢་ ཊི་ཀེ་ཨའི་པི་" + +#: ../src/nm-ap-security-wpa-psk.c:61 +msgid "WPA2 CCMP" +msgstr "ཌབ་ལུ་པི་ཨེ་༢་ སི་སི་ཨེམ་པི་" + +#: ../src/nm-ap-security-wpa-psk.c:63 +msgid "WPA2 Automatic" +msgstr "ཌབ་ལུ་པི་ཨེ་༢་ རང་བཞིན་" + +#: ../src/nm-ap-security.c:338 +msgid "none" +msgstr "ཅི་མེད་" + +#: ../src/nm-netlink-monitor.c:170 +#, c-format +msgid "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "ཝིརཌ་ཨི་ཐར་ནེཊི་ཐབས་འཕྲུལ་-%sལྟ་རྟོག་འབད་ནིའི་དོན་ལུ་ ནེཊི་འབྲེལ་ལམ་སོ་ཀེཊི་གསར་བསྐྲུན་འབད་མ་ཚུགས།" + +#: ../src/nm-netlink-monitor.c:188 +#, c-format +msgid "unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "ཝིརཌི་ཨི་ཐར་ནེཊེ་ཐབས་འཕྲུལ་ཚུ་-%sལྟ་རྟོག་འབད་ནིའི་དོན་ལུ་ ནེཊི་འབྲེལ་ལམ་སོ་ཀེཊི་ལུ་བསྡམ་མ་ཚུགས།" + +#: ../src/nm-netlink-monitor.c:426 +msgid "operation took too long" +msgstr "བཀོལ་སྤྱོད་འདི་གནམ་མེད་ས་མེད་རིངམ་འགོརཝ་ཨིན་" + +#: ../src/nm-netlink-monitor.c:523 +msgid "received data from wrong type of sender" +msgstr "གནས་སྡུད་འདི་གཏང་མི་དབྱེ་བ་ཕྱི་འགྱུར་ལས་ཐོབ་ནུག་" + +#: ../src/nm-netlink-monitor.c:536 +msgid "received data from unexpected sender" +msgstr "གནས་སྡུད་འདི་རེ་བ་མེད་པའི་གཏང་མི་ལས་ཐོབ་ནུག་" + +#: ../src/nm-netlink-monitor.c:665 +msgid "too much data was sent over socket and some of it was lost" +msgstr "སོ་ཀེཊི་ལུ་གནས་སྡུད་འདི་གནམ་མེད་ས་མེད་གཏང་ཡོདཔ་དང་ ལ་ལོ་ཅིག་བརླག་སྟོར་ཞུགས་ནུག་" + +#: ../src/nm-netlink-monitor.c:775 +msgid "error occurred while waiting for data on socket" +msgstr "སོ་ཀེཊི་གུ་གནས་སྡུད་ཀྱི་དོན་ལུ་བསྒུགཔ་ད་འཛོལ་བ་བྱུང་ཡོདཔ་" + +#: ../src/nm-ap-security-wpa-eap.c:96 +#: ../src/nm-ap-security-wpa-eap.c:120 +msgid "WPA2 Enterprise" +msgstr "ཌབ་ལུ་པི་ཨེ་༢་ ཚོང་ལས་" + +#: ../src/nm-ap-security-wpa-eap.c:98 +#: ../src/nm-ap-security-wpa-eap.c:125 +msgid "WPA Enterprise" +msgstr "ཌབ་ལུ་པི་ཨེ་ཚོང་ལས་" + +#: ../src/nm-ap-security-leap.c:66 +#: ../src/nm-ap-security-leap.c:82 +msgid "LEAP" +msgstr "ཨེལ་ཨི་ཨེ་པི་" + diff --git a/po/el.po b/po/el.po new file mode 100644 index 00000000..7890d9b9 --- /dev/null +++ b/po/el.po @@ -0,0 +1,385 @@ +# translation of NetworkManager.HEAD.po to +# NetworkManager translation to Greek +# +# Nikos Charonitakis , 2005. +# Kostas Papadimas , 2005-2007. +# Dimitris Glezos , 2006. +# Jennie Petoumenou , 2008, 2009. +# Tournaris Pavlos , 2009. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-08-27 03:24+0000\n" +"PO-Revision-Date: 2009-09-10 11:08+0200\n" +"Last-Translator: Tournaris Pavlos \n" +"Language-Team: Greek \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: Lokalize 0.3\n" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Το αρχείο κλειδιού PEM δεν είχε ετικέτα τέλους '%s'." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Δε μοιάζει με αρχείο ιδιωτικού κλειδιού PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Δεν επαρκεί η μνήμη για την αποθήκευση των δεδομένων του αρχείου PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Κακοσχηματισμένο αρχείο PEM: Η πρώτη ετικέτα δεν ήταν η Proc-Type." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Κακοσχηματισμένο αρχείο PEM: Άγνωστη η ετικέτα Proc-Type '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Κακοσχηματισμένο αρχείο PEM: Η δεύτερη ετικέτα δεν ήταν η DEK-Info." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Κακοσχηματισμένο αρχείο PEM: Δεν βρέθηκε IV στην ετικέτα DEK-Info." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Κακοσχηματισμένο αρχείο PEM: Άκυρη μορφή του IV στην ετικέτα DEK-Info." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "" +"Κακοσχηματισμένο αρχείο PEM: Άγνωστος ο κρυπτογραφικός αλγόριθμος '%s' του " +"ιδιωτικού κλειδιού." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Αδύνατη η αποκωδικοποίηση του ιδιωτικού κλειδιού." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Το πιστοποιητικό PEM '%s' δε διέθετε ετικέτα τέλους '%s'." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Απέτυχε η αποκωδικοποίηση του πιστοποιητικού." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "" +"Δεν επαρκεί η μνήμη για την αποθήκευση των δεδομένων του πιστοποιητικού." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Δεν επαρκεί η μνήμη για την αποθήκευση των δεδομένων του αρχείου." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "Το μήκος του IV πρέπει να αντιστοιχεί σε άρτιο αριθμό byte." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Δεν επαρκεί η μνήμη για την αποθήκευση του IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "Το IV περιέχει μη δεκαεξαδικά ψηφία." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 +#: ../libnm-util/crypto_nss.c:169 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Άγνωστος ο κρυπτογραφικός αλγόριθμος '%s' του ιδιωτικού κλειδιού." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Δεν επαρκεί η μνήμη για την αποκρυπτογράφηση του ιδιωτικού κλειδιού." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Αδύνατος ο προσδιορισμός του τύπου του ιδιωτικού κλειδιού." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "" +"Δεν επαρκεί η μνήμη για την αποθήκευση του αποκρυπτογραφημένου ιδιωτικού " +"κλειδιού." + +#: ../libnm-util/crypto_gnutls.c:46 +msgid "Failed to initialize the crypto engine." +msgstr "Απέτυχε η αρχικοποίηση της μηχανής κρυπτογραφίας." + +#: ../libnm-util/crypto_gnutls.c:90 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Απέτυχε η αρχικοποίηση της μηχανής MD5 : %s / %s." + +#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "" +"Η μνήμη δεν επαρκεί για τις ανάγκες της ενδιάμεσης μνήμης του " +"αποκρυπτογραφημένου κλειδιού." + +#: ../libnm-util/crypto_gnutls.c:160 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Απέτυχε η αρχικοποίηση του αλγορίθμου αποκρυπτογράφησης: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:169 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "" +"Απέτυχε ο ορισμός συμμετρικού κλειδιού για την αποκρυπτογράφηση: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:178 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Απέτυχε ο ορισμός IV για την αποκρυπτογράφηση: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:187 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Απέτυχε η αποκρυπτογράφηση του ιδιωτικού κλειδιού: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Απέτυχε η αποκρυπτογράφηση του ιδιωτικού κλειδιού." + +#: ../libnm-util/crypto_gnutls.c:235 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Σφάλμα κατά την αρχικοποίηση των δεδομένων του πιστοποιητικού: %s" + +#: ../libnm-util/crypto_gnutls.c:257 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Αδύνατη η αποκωδικοποίηση του πιστοποιητικού: %s" + +#: ../libnm-util/crypto_gnutls.c:281 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Αδύνατη η αρχικοποίηση του αποκωδικοποιητή PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Αδύνατη η αποκωδικοποίηση του αρχείου PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:306 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Αδύνατη η διαπίστωση του αρχείου PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:57 +#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Απέτυχε η αρχικοποίηση της μηχανής κρυπτογραφίας: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Απέτυχε η αρχικοποίηση του MD5 : %d." + +#: ../libnm-util/crypto_nss.c:186 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Απέτυχε η αρχικοποίηση του αλγορίθμου αποκρυπτογράφησης." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Απέτυχε ο ορισμός συμμετρικού κλειδιού για την αποκρυπτογράφηση." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Απέτυχε ο ορισμός IV για την αποκρυπτογράφηση." + +#: ../libnm-util/crypto_nss.c:214 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Απέτυχε η αρχικοποίηση της αποκρυπτογράφησης." + +#: ../libnm-util/crypto_nss.c:227 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Απέτυχε η αποκρυπτογράφηση του ιδιωτικού κλειδιού: %d." + +#: ../libnm-util/crypto_nss.c:239 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Απέτυχε η ολοκλήρωση της αποκρυπτογράφησης του ιδιωτικού κλειδιού: %d." + +#: ../libnm-util/crypto_nss.c:284 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Αδύνατη η αποκωδικοποίηση του πιστοποιητικού: %d" + +#: ../libnm-util/crypto_nss.c:319 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Αδύνατη η μετατροπή του συνθηματικού σε UCS2: %d" + +#: ../libnm-util/crypto_nss.c:347 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Αδύνατη η αρχικοποίηση του αποκωδικοποιητή PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Αδύνατη η αποκωδικοποίηση του αρχείου PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:365 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Αδύνατη η διαπίστωση του αρχείου PKCS#12: %d" + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#, c-format +msgid "error processing netlink message: %s" +msgstr "σφάλμα κατά την επεξεργασία μηνύματος netlink: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"αδύνατη η δέσμευση χειριστή netlink για την παρακολούθηση της κατάστασης της " +"σύνδεσης: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"αδύνατη η σύνδεση με το netlink για την παρακολούθηση της κατάστασης της " +"σύνδεσης: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"αδύνατη η ένταξη στην ομάδα του netlink για την παρακολούθηση της κατάστασης " +"της σύνδεσης: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"αδύνατη η εκχώρηση λανθάνουσας μνήμης στη σύνδεση netlink για την " +"παρακολούθηση της κατάστασης της σύνδεσης δικτύου: %s" + +#: ../src/nm-netlink-monitor.c:494 +msgid "error occurred while waiting for data on socket" +msgstr "σφάλμα κατά την αναμονή για δεδομένα στην υποδοχή" + +#: ../src/NetworkManager.c:330 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Άκυρη επιλογή. Παρακαλώ χρησιμοποιήστε --help για να δείτε τη λίστα των " +"έγκυρων επιλογών.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "# Δημιουργήθηκε από το NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Συγχωνεύθηκαν από το %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"ΣΗΜΕΙΩΣΗ: Ο libc resolver μπορεί να μην υποστηρίζει περισσότερους από 3 " +"εξυπηρετητές ονομάτων." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Οι κάτωθι εξυπηρετητές ονομάτων ίσως να μην αναγνωρίζονται." + +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "Αυτόματο %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 +msgid "System" +msgstr "Σύστημα" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Κοινή χρήση σύνδεσης μέσω προστατευμένου ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Κοινή χρήση σύνδεσης μέσω ανοιχτού ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Αλλαγή πάγιου ονόματος συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Τροποποίηση συνδέσεων συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει τροποποίηση των ρυθμίσεων συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει τροποποίηση του πάγιου ονόματος " +"συστήματος" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω " +"προστατευμένου ασύρματου δικτύου" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω ανοιχτού " +"ασύρματου δικτύου" + +#~ msgid "error updating link cache: %s" +#~ msgstr "σφάλμα κατά την ενημέρωση της λανθάνουσας μνήμης της σύνδεσης: %s" diff --git a/po/en_CA.po b/po/en_CA.po new file mode 100644 index 00000000..85215f25 --- /dev/null +++ b/po/en_CA.po @@ -0,0 +1,865 @@ +# Canadian English translation for NetworkManager +# Copyright (C) 2004-2006 Adam Weinberger and the GNOME Foundation +# This file is distributed under the same licence as the NetworkManager package. +# Adam Weinberger, , 2004, 2005, 2006. +# +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-01-31 21:00-0500\n" +"PO-Revision-Date: 2005-09-06 14:52-0400\n" +"Last-Translator: Adam Weinberger \n" +"Language-Team: Canadian English \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" + +#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:923 +#, c-format +msgid "Passphrase for wireless network %s" +msgstr "Passphrase for wireless network %s" + +#: ../gnome/applet/applet-dbus.c:244 +#, c-format +msgid "Connection to the wireless network '%s' failed." +msgstr "Connection to the wireless network '%s' failed." + +#: ../gnome/applet/applet-dbus.c:249 +msgid "Connection to the wired network failed." +msgstr "Connection to the wired network failed." + +#: ../gnome/applet/applet.c:179 +msgid "Error displaying connection information:" +msgstr "Error displaying connection information:" + +#: ../gnome/applet/applet.c:196 +msgid "Could not find some required resources (the glade file)!" +msgstr "Could not find some required resources (the glade file)!" + +#: ../gnome/applet/applet.c:207 +msgid "No active connections!" +msgstr "No active connections!" + +#: ../gnome/applet/applet.c:224 +#, c-format +msgid "Wired Ethernet (%s)" +msgstr "Wired Ethernet (%s)" + +#: ../gnome/applet/applet.c:226 +#, c-format +msgid "Wireless Ethernet (%s)" +msgstr "Wireless Ethernet (%s)" + +#: ../gnome/applet/applet.c:323 ../gnome/applet/applet.c:348 +msgid "NetworkManager Applet" +msgstr "NetworkManager Applet" + +#: ../gnome/applet/applet.c:325 ../gnome/applet/applet.c:350 +msgid "Copyright © 2004-2005 Red Hat, Inc." +msgstr "Copyright © 2004-2005 Red Hat, Inc." + +#: ../gnome/applet/applet.c:326 ../gnome/applet/applet.c:351 +msgid "" +"Notification area applet for managing your network devices and connections." +msgstr "" +"Notification area applet for managing your network devices and connections." + +#: ../gnome/applet/applet.c:329 ../gnome/applet/applet.c:356 +msgid "translator-credits" +msgstr "Adam Weinberger " + +#: ../gnome/applet/applet.c:441 +msgid "VPN Error" +msgstr "VPN Error" + +#: ../gnome/applet/applet.c:445 +msgid "VPN Login Failure" +msgstr "VPN Login Failure" + +#: ../gnome/applet/applet.c:446 +#, c-format +msgid "Could not start the VPN connection '%s' due to a login failure." +msgstr "Could not start the VPN connection '%s' due to a login failure." + +#: ../gnome/applet/applet.c:450 +msgid "VPN Start Failure" +msgstr "VPN Start Failure" + +#: ../gnome/applet/applet.c:451 +#, c-format +msgid "" +"Could not start the VPN connection '%s' due to a failure launching the VPN " +"program." +msgstr "" +"Could not start the VPN connection '%s' due to a failure launching the VPN " +"program." + +#: ../gnome/applet/applet.c:455 ../gnome/applet/applet.c:465 +msgid "VPN Connect Failure" +msgstr "VPN Connect Failure" + +#: ../gnome/applet/applet.c:456 +#, c-format +msgid "Could not start the VPN connection '%s' due to a connection error." +msgstr "Could not start the VPN connection '%s' due to a connection error." + +#: ../gnome/applet/applet.c:460 +msgid "VPN Configuration Error" +msgstr "VPN Configuration Error" + +#: ../gnome/applet/applet.c:461 +#, c-format +msgid "The VPN connection '%s' was not correctly configured." +msgstr "The VPN connection '%s' was not correctly configured." + +#: ../gnome/applet/applet.c:466 +#, c-format +msgid "" +"Could not start the VPN connection '%s' because the VPN server did not " +"return an adequate network configuration." +msgstr "" +"Could not start the VPN connection '%s' because the VPN server did not " +"return an adequate network configuration." + +#: ../gnome/applet/applet.c:474 +#, c-format +msgid "The VPN service said: \"%s\"" +msgstr "The VPN service said: \"%s\"" + +#: ../gnome/applet/applet.c:543 +#, c-format +msgid "VPN connection '%s' said:" +msgstr "VPN connection '%s' said:" + +#: ../gnome/applet/applet.c:545 +msgid "VPN Login Message" +msgstr "VPN Login Message" + +#: ../gnome/applet/applet.c:762 ../gnome/applet/applet.c:2516 +#: ../gnome/applet/other-network-dialog.c:453 +#: ../gnome/applet/passphrase-dialog.c:227 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." + +#: ../gnome/applet/applet.c:774 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "The network device \"%s (%s)\" does not support wireless scanning." + +#: ../gnome/applet/applet.c:782 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "The network device \"%s (%s)\" does not support link detection." + +#: ../gnome/applet/applet.c:929 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "Preparing device %s for the wired network..." + +#: ../gnome/applet/applet.c:931 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "Preparing device %s for the wireless network '%s'..." + +#: ../gnome/applet/applet.c:939 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "Configuring device %s for the wired network..." + +#: ../gnome/applet/applet.c:941 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "Attempting to join the wireless network '%s'..." + +#: ../gnome/applet/applet.c:949 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "Waiting for Network Key for the wireless network '%s'..." + +#: ../gnome/applet/applet.c:957 ../gnome/applet/applet.c:967 +msgid "Requesting a network address from the wired network..." +msgstr "Requesting a network address from the wired network..." + +#: ../gnome/applet/applet.c:959 ../gnome/applet/applet.c:969 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "Requesting a network address from the wireless network '%s'..." + +#: ../gnome/applet/applet.c:977 +msgid "Finishing connection to the wired network..." +msgstr "Finishing connection to the wired network..." + +#: ../gnome/applet/applet.c:979 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "Finishing connection to the wireless network '%s'..." + +#: ../gnome/applet/applet.c:1096 +msgid "NetworkManager is not running" +msgstr "NetworkManager is not running" + +#: ../gnome/applet/applet.c:1109 ../gnome/applet/applet.c:1843 +msgid "Networking disabled" +msgstr "Networking disabled" + +#: ../gnome/applet/applet.c:1114 +msgid "No network connection" +msgstr "No network connection" + +#: ../gnome/applet/applet.c:1119 +msgid "Wired network connection" +msgstr "Wired network connection" + +#: ../gnome/applet/applet.c:1123 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "Connected to an Ad-Hoc wireless network" + +#: ../gnome/applet/applet.c:1125 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "Wireless network connection to '%s' (%d%%)" + +#: ../gnome/applet/applet.c:1147 +#, c-format +msgid "VPN connection to '%s'" +msgstr "VPN connection to '%s'" + +#: ../gnome/applet/applet.c:1155 +#, c-format +msgid "VPN connecting to '%s'" +msgstr "VPN connecting to '%s'" + +#: ../gnome/applet/applet.c:1568 +msgid "_Connect to Other Wireless Network..." +msgstr "_Connect to Other Wireless Network..." + +#: ../gnome/applet/applet.c:1589 +msgid "Create _New Wireless Network..." +msgstr "Create _New Wireless Network..." + +#: ../gnome/applet/applet.c:1710 +msgid "_VPN Connections" +msgstr "_VPN Connections" + +#: ../gnome/applet/applet.c:1745 +msgid "_Configure VPN..." +msgstr "_Configure VPN..." + +#: ../gnome/applet/applet.c:1749 +msgid "_Disconnect VPN..." +msgstr "_Disconnect VPN..." + +#: ../gnome/applet/applet.c:1771 +msgid "_Dial Up Connections" +msgstr "_Dial-Up Connections" + +#. FIXME: We should save and then check the state of the devices and show Connect _or_ Disconnect for each item +#: ../gnome/applet/applet.c:1782 +#, c-format +msgid "Connect to %s..." +msgstr "Connect to %s..." + +#: ../gnome/applet/applet.c:1788 +#, c-format +msgid "Disconnect from %s..." +msgstr "Disconnect from %s..." + +#: ../gnome/applet/applet.c:1837 +msgid "No network devices have been found" +msgstr "No network devices have been found" + +#: ../gnome/applet/applet.c:2029 +msgid "NetworkManager is not running..." +msgstr "NetworkManager is not running..." + +#. 'Enable Networking' item +#: ../gnome/applet/applet.c:2185 +msgid "Enable _Networking" +msgstr "Enable _Networking" + +#. 'Enable Wireless' item +#: ../gnome/applet/applet.c:2191 +msgid "Enable _Wireless" +msgstr "Enable _Wireless" + +#. 'Connection Information' item +#: ../gnome/applet/applet.c:2197 +msgid "Connection _Information" +msgstr "Connection _Information" + +#. Help item +#: ../gnome/applet/applet.c:2208 +msgid "_Help" +msgstr "_Help" + +#. About item +#: ../gnome/applet/applet.c:2217 +msgid "_About" +msgstr "_About" + +#: ../gnome/applet/applet.c:2635 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" + +#: ../gnome/applet/wireless-security-option.c:157 +msgid "Open System" +msgstr "Open System" + +#: ../gnome/applet/wireless-security-option.c:160 +msgid "Shared Key" +msgstr "Shared Key" + +#: ../gnome/applet/wireless-security-option.c:209 +msgid "Automatic (Default)" +msgstr "Automatic (Default)" + +#: ../gnome/applet/wireless-security-option.c:217 +msgid "TKIP" +msgstr "TKIP" + +#: ../gnome/applet/wireless-security-option.c:225 +msgid "AES-CCMP" +msgstr "AES-CCMP" + +#: ../gnome/applet/wso-none.c:53 +msgid "None" +msgstr "None" + +#: ../gnome/applet/wso-wep-ascii.c:127 +msgid "WEP 40/128-bit ASCII" +msgstr "WEP 40/128-bit ASCII" + +#: ../gnome/applet/wso-wep-hex.c:124 +msgid "WEP 40/128-bit hex" +msgstr "WEP 40/128-bit hex" + +#: ../gnome/applet/wso-wep-passphrase.c:124 +msgid "WEP Passphrase" +msgstr "WEP Passphrase" + +#: ../gnome/applet/eggtrayicon.c:128 +msgid "Orientation" +msgstr "Orientation" + +#: ../gnome/applet/eggtrayicon.c:129 +msgid "The orientation of the tray." +msgstr "The orientation of the tray." + +#: ../gnome/applet/menu-items.c:87 +#, c-format +msgid "Wired Network (%s)" +msgstr "Wired Network (%s)" + +#: ../gnome/applet/menu-items.c:90 +msgid "_Wired Network" +msgstr "_Wired Network" + +#: ../gnome/applet/menu-items.c:161 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Wireless Network (%s)" +msgstr[1] "Wireless Networks (%s)" + +#: ../gnome/applet/menu-items.c:163 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Wireless Network" +msgstr[1] "Wireless Networks" + +#: ../gnome/applet/menu-items.c:330 +msgid " (invalid Unicode)" +msgstr " (invalid Unicode)" + +#: ../gnome/applet/other-network-dialog.c:352 +#, c-format +msgid "" +"By default, the wireless network's name is set to your computer's name, %s, " +"with no encryption enabled" +msgstr "" +"By default, the wireless network's name is set to your computer's name, %s, " +"with no encryption enabled" + +#: ../gnome/applet/other-network-dialog.c:358 +msgid "Create new wireless network" +msgstr "Create new wireless network" + +#: ../gnome/applet/other-network-dialog.c:359 +msgid "" +"Enter the name and security settings of the wireless network you wish to " +"create." +msgstr "" +"Enter the name and security settings of the wireless network you wish to " +"create." + +#: ../gnome/applet/other-network-dialog.c:363 +msgid "Create New Wireless Network" +msgstr "Create New Wireless Network" + +#: ../gnome/applet/other-network-dialog.c:368 +msgid "Existing wireless network" +msgstr "Existing wireless network" + +#: ../gnome/applet/other-network-dialog.c:369 +msgid "Enter the name of the wireless network to which you wish to connect." +msgstr "Enter the name of the wireless network to which you wish to connect." + +#: ../gnome/applet/other-network-dialog.c:371 +msgid "Connect to Other Wireless Network" +msgstr "Connect to Other Wireless Network" + +#: ../gnome/applet/passphrase-dialog.c:214 +msgid "Error connecting to wireless network" +msgstr "Error connecting to wireless network" + +#: ../gnome/applet/passphrase-dialog.c:215 +msgid "" +"The requested wireless network requires security capabilities unsupported by " +"your hardware." +msgstr "" +"The requested wireless network requires security capabilities unsupported by " +"your hardware." + +#: ../gnome/applet/vpn-password-dialog.c:152 +#: ../gnome/applet/vpn-password-dialog.c:189 +#, c-format +msgid "Cannot start VPN connection '%s'" +msgstr "Cannot start VPN connection '%s'" + +#: ../gnome/applet/vpn-password-dialog.c:155 +#, c-format +msgid "" +"Could not find the authentication dialog for VPN connection type '%s'. " +"Contact your system administrator." +msgstr "" +"Could not find the authentication dialogue for VPN connection type '%s'. " +"Contact your system administrator." + +#: ../gnome/applet/vpn-password-dialog.c:192 +#, c-format +msgid "" +"There was a problem launching the authentication dialog for VPN connection " +"type '%s'. Contact your system administrator." +msgstr "" +"There was a problem launching the authentication dialogue for VPN connection " +"type '%s'. Contact your system administrator." + +#: ../gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: ../gnome/applet/applet.glade.h:2 +msgid "" +"Active Connection Information" +msgstr "" +"Active Connection Information" + +#: ../gnome/applet/applet.glade.h:4 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." + +#: ../gnome/applet/applet.glade.h:8 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." + +#: ../gnome/applet/applet.glade.h:12 +#, no-c-format +msgid "" +"Wireless Network Login Confirmation\n" +"\n" +"You have chosen to log in to the wireless network '%s'. If you are sure " +"that this wireless network is secure, click the checkbox below and " +"NetworkManager will not require confirmation on subsequent log ins." +msgstr "" +"Wireless Network Login Confirmation\n" +"\n" +"You have chosen to log in to the wireless network '%s'. If you are sure " +"that this wireless network is secure, click the checkbox below and " +"NetworkManager will not require confirmation on subsequent logins." + +#: ../gnome/applet/applet.glade.h:15 +msgid "Authentication:" +msgstr "Authentication:" + +#: ../gnome/applet/applet.glade.h:16 +msgid "Broadcast Address:" +msgstr "Broadcast Address:" + +#: ../gnome/applet/applet.glade.h:17 +msgid "C_onnect" +msgstr "C_onnect" + +#: ../gnome/applet/applet.glade.h:18 +msgid "Connection Information" +msgstr "Connection Information" + +#: ../gnome/applet/applet.glade.h:19 +msgid "Default Route:" +msgstr "Default Route:" + +#: ../gnome/applet/applet.glade.h:20 +msgid "Destination Address:" +msgstr "Destination Address:" + +#: ../gnome/applet/applet.glade.h:21 +msgid "Driver:" +msgstr "Driver:" + +#: ../gnome/applet/applet.glade.h:22 +msgid "Hardware Address:" +msgstr "Hardware Address:" + +#: ../gnome/applet/applet.glade.h:23 +msgid "IP Address:" +msgstr "IP Address:" + +#: ../gnome/applet/applet.glade.h:24 +msgid "Interface:" +msgstr "Interface:" + +#: ../gnome/applet/applet.glade.h:25 +msgid "Key:" +msgstr "Key:" + +#: ../gnome/applet/applet.glade.h:26 +msgid "" +"None\n" +"WEP Passphrase\n" +"WEP 40/128-bit hex\n" +"WEP 40/128-bit ASCII\n" +msgstr "" +"None\n" +"WEP Passphrase\n" +"WEP 40/128-bit hex\n" +"WEP 40/128-bit ASCII\n" + +#: ../gnome/applet/applet.glade.h:31 +msgid "" +"Open System\n" +"Shared Key" +msgstr "" +"Open System\n" +"Shared Key" + +#: ../gnome/applet/applet.glade.h:33 +msgid "Other Wireless Network..." +msgstr "Other Wireless Network..." + +#: ../gnome/applet/applet.glade.h:34 +msgid "Passphrase:" +msgstr "Passphrase:" + +#: ../gnome/applet/applet.glade.h:35 +msgid "Password:" +msgstr "Password:" + +#: ../gnome/applet/applet.glade.h:36 +msgid "Primary DNS:" +msgstr "Primary DNS:" + +#: ../gnome/applet/applet.glade.h:37 +msgid "Secondary DNS:" +msgstr "Secondary DNS:" + +#: ../gnome/applet/applet.glade.h:38 +msgid "Subnet Mask:" +msgstr "Subnet Mask:" + +#: ../gnome/applet/applet.glade.h:39 +msgid "Type:" +msgstr "Type:" + +#: ../gnome/applet/applet.glade.h:40 +msgid "User Name:" +msgstr "User Name:" + +#: ../gnome/applet/applet.glade.h:41 +msgid "Wireless Network Key Required" +msgstr "Wireless Network Key Required" + +#: ../gnome/applet/applet.glade.h:42 +msgid "Wireless _adapter:" +msgstr "Wireless _adapter:" + +#: ../gnome/applet/applet.glade.h:43 +msgid "_Always Trust this Wireless Network" +msgstr "_Always Trust this Wireless Network" + +#: ../gnome/applet/applet.glade.h:44 +msgid "_Don't remind me again" +msgstr "_Do not remind me again" + +#: ../gnome/applet/applet.glade.h:45 +msgid "_Login to Network" +msgstr "_Login to Network" + +#: ../gnome/applet/applet.glade.h:46 +msgid "_Network Name:" +msgstr "_Network Name:" + +#: ../gnome/applet/applet.glade.h:47 +msgid "_Wireless Security:" +msgstr "_Wireless Security:" + +#: ../gnome/applet/applet.glade.h:48 +msgid "leap_subwindow" +msgstr "leap_subwindow" + +#: ../gnome/applet/applet.glade.h:49 +msgid "wep_key_subwindow" +msgstr "wep_key_subwindow" + +#: ../gnome/applet/applet.glade.h:50 +msgid "wep_passphrase_subwindow" +msgstr "wep_passphrase_subwindow" + +#: ../gnome/applet/applet.glade.h:51 +msgid "wpa_psk_subwindow" +msgstr "wpa_psk_subwindow" + +#: ../gnome/applet/wso-wpa-psk.c:168 +msgid "WPA2 Personal" +msgstr "WPA2 Personal" + +#: ../gnome/applet/wso-wpa-psk.c:170 +msgid "WPA Personal" +msgstr "WPA Personal" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:358 +msgid "Cannot add VPN connection" +msgstr "Cannot add VPN connection" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:360 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:412 +msgid "Cannot import VPN connection" +msgstr "Cannot import VPN connection" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:414 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:554 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "Error retrieving VPN connection '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:557 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:717 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "Delete VPN connection \"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:720 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:926 +msgid "Unable to load" +msgstr "Unable to load" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:928 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "Cannot find some needed resources (the glade file)!" + +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1043 +msgid "Edit VPN Connection" +msgstr "Edit VPN Connection" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "Add a new VPN connection" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Choose which type of VPN connection you wish to create." +msgstr "Choose the type of VPN connection you wish to create." + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "Connect to:" +msgstr "Connect to:" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Create VPN Connection" +msgstr "Create VPN Connection" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Create VPN Connection - 1 of 2" +msgstr "Create VPN Connection - 1 of 2" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Create VPN Connection - 2 of 2" +msgstr "Create VPN Connection - 2 of 2" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Delete the selected VPN connection" +msgstr "Delete the selected VPN connection" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "E_xport" +msgstr "E_xport" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:9 +msgid "Edit the selected VPN connection" +msgstr "Edit the selected VPN connection" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:10 +msgid "Export the VPN settings to a file" +msgstr "Export the VPN settings to a file" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:11 +msgid "Export the selected VPN connection to a file" +msgstr "Export the selected VPN connection to a file" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:12 +msgid "Finish Creating VPN Connection" +msgstr "Finish Creating VPN Connection" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:13 +msgid "Manage Virtual Private Network Connections" +msgstr "Manage Virtual Private Network Connections" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:14 +msgid "" +"This assistant will guide you through the creation of a connection to a " +"Virtual Private Network (VPN).\n" +"\n" +"It will require some information, such as IP addresses and secrets. Please " +"see your system administrator to obtain this information." +msgstr "" +"This assistant will guide you through creating a connection to a Virtual " +"Private Network (VPN).\n" +"\n" +"It will require some information, such as IP addresses and secrets. Please " +"see your system administrator to obtain this information." + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:17 +msgid "VPN Connections" +msgstr "VPN Connections" + +#: ../src/nm-ap-security-wep.c:47 +msgid "40-bit WEP" +msgstr "40-bit WEP" + +#: ../src/nm-ap-security-wep.c:49 +msgid "104-bit WEP" +msgstr "104-bit WEP" + +#: ../src/nm-ap-security-wpa-psk.c:50 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:52 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:54 +msgid "WPA Automatic" +msgstr "WPA Automatic" + +#: ../src/nm-ap-security-wpa-psk.c:59 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:61 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:63 +msgid "WPA2 Automatic" +msgstr "WPA2 Automatic" + +#: ../src/nm-ap-security.c:310 +msgid "none" +msgstr "none" + +#: ../src/nm-netlink-monitor.c:154 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"Unable to create netlink socket for monitoring wired ethernet devices - %s" + +#: ../src/nm-netlink-monitor.c:172 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"Unable to bind to netlink socket for monitoring wired ethernet devices - %s" + +#: ../src/nm-netlink-monitor.c:405 +msgid "operation took too long" +msgstr "Operation took too long" + +#: ../src/nm-netlink-monitor.c:502 +msgid "received data from wrong type of sender" +msgstr "Received data from wrong type of sender" + +#: ../src/nm-netlink-monitor.c:515 +msgid "received data from unexpected sender" +msgstr "Received data from unexpected sender" + +#: ../src/nm-netlink-monitor.c:646 +msgid "too much data was sent over socket and some of it was lost" +msgstr "Too much data was sent over socket and some of it was lost" + +#: ../src/nm-netlink-monitor.c:735 +msgid "error occurred while waiting for data on socket" +msgstr "error occurred while waiting for data on socket" diff --git a/po/en_GB.po b/po/en_GB.po new file mode 100644 index 00000000..1e57470a --- /dev/null +++ b/po/en_GB.po @@ -0,0 +1,1077 @@ +# NetworkManager +# Copyright (C) 2004 The GNOME Foundation. +# This file is distributed under the same license as the NetworkManager package. +# David Lodge , 2004. +# Philip Withnall , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-09-11 15:24+0000\n" +"PO-Revision-Date: 2006-12-28 18:52-0000\n" +"Last-Translator: Philip Withnall \n" +"Language-Team: British English \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" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM key file had no end tag '%s'." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Doesn't look like a PEM private key file." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Not enough memory to store PEM file data." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Malformed PEM file: Proc-Type was not first tag." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Malformed PEM file: unknown Proc-Type tag '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Malformed PEM file: DEK-Info was not the second tag." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Malformed PEM file: no IV found in DEK-Info tag." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Malformed PEM file: invalid format of IV in DEK-Info tag." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Malformed PEM file: unknown private key cipher '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Could not decode private key." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM certificate '%s' had no end tag '%s'." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Failed to decode certificate." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Not enough memory to store certificate data." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Not enough memory to store file data." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV must be an even number of bytes in length." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Not enough memory to store the IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV contains non-hexadecimal digits." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 +#: ../libnm-util/crypto_nss.c:169 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Private key cipher '%s' was unknown." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Not enough memory to decrypt private key." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Unable to determine private key type." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Not enough memory to store decrypted private key." + +#: ../libnm-util/crypto_gnutls.c:46 +msgid "Failed to initialize the crypto engine." +msgstr "Failed to initialise the crypto engine." + +#: ../libnm-util/crypto_gnutls.c:90 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Failed to initialise the MD5 engine: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Not enough memory for decrypted key buffer." + +#: ../libnm-util/crypto_gnutls.c:160 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Failed to initialise the decryption cipher context: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:169 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Failed to set symmetric key for decryption: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:178 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Failed to set IV for decryption: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:187 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Failed to decrypt the private key: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Failed to decrypt the private key." + +#: ../libnm-util/crypto_gnutls.c:235 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Error initialising certificate data: %s" + +#: ../libnm-util/crypto_gnutls.c:257 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Couldn't decode certificate: %s" + +#: ../libnm-util/crypto_gnutls.c:281 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Couldn't initialise PKCS#12 decoder: %s" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Couldn't decode PKCS#12 file: %s" + +#: ../libnm-util/crypto_gnutls.c:306 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Couldn't verify PKCS#12 file: %s" + +#: ../libnm-util/crypto_nss.c:57 +#: ../system-settings/plugins/ifcfg-rh/crypto.c:52 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Failed to initialise the crypto engine: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Failed to initialise the MD5 context: %d." + +#: ../libnm-util/crypto_nss.c:186 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Failed to initialise the decryption cipher slot." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Failed to set symmetric key for decryption." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Failed to set IV for decryption." + +#: ../libnm-util/crypto_nss.c:214 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Failed to initialise the decryption context." + +#: ../libnm-util/crypto_nss.c:227 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Failed to decrypt the private key: %d." + +#: ../libnm-util/crypto_nss.c:239 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Failed to finalise decryption of the private key: %d." + +#: ../libnm-util/crypto_nss.c:284 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Couldn't decode certificate: %d" + +#: ../libnm-util/crypto_nss.c:319 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Couldn't convert password to UCS2: %d" + +#: ../libnm-util/crypto_nss.c:347 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Couldn't initialise PKCS#12 decoder: %d" + +#: ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Couldn't decode PKCS#12 file: %d" + +#: ../libnm-util/crypto_nss.c:365 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Couldn't verify PKCS#12 file: %d" + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "error processing netlink message: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "unable to allocate netlink handle for monitoring link status: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "unable to connect to netlink for monitoring link status: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "unable to join netlink group for monitoring link status: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "unable to allocate netlink link cache for monitoring link status: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "error occurred while waiting for data on socket" + +#: ../src/NetworkManager.c:330 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Invalid option. Please use --help to see a list of valid options.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "# Created by NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Merged from %s\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "unable to allocate netlink handle: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "unable to connect to netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "unable to join netlink group: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "NOTE: the libc resolver may not support more than 3 nameservers." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "The nameservers listed below may not be recognised." + +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2446 +msgid "System" +msgstr "System" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Connection sharing via a protected Wi-Fi network" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Connection sharing via an open Wi-Fi network" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modify persistent system hostname" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modify system connections" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "System policy prevents modification of system settings" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "System policy prevents modification of the persistent system hostname" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "System policy prevents sharing connections via a protected Wi-Fi network" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "System policy prevents sharing connections via an open Wi-Fi network" + +# +#~ msgid "Passphrase for wireless network %s" +#~ msgstr "Passphrase for wireless network %s" + +# +#~ msgid "Connection to the wireless network '%s' failed." +#~ msgstr "Connection to the wireless network '%s' failed." + +#~ msgid "Connection to the wired network failed." +#~ msgstr "Connection to the wired network failed." + +#~ msgid "Error displaying connection information:" +#~ msgstr "Error displaying connection information:" + +#~ msgid "Could not find some required resources (the glade file)!" +#~ msgstr "Could not find some required resources (the glade file)!" + +#~ msgid "%d Mb/s" +#~ msgstr "%d Mb/s" + +#~ msgid "Wired Ethernet (%s)" +#~ msgstr "Wired Ethernet (%s)" + +#~ msgid "Wireless Ethernet (%s)" +#~ msgstr "Wireless Ethernet (%s)" + +#~ msgid "Unknown" +#~ msgstr "Unknown" + +#~ msgid "NetworkManager Applet" +#~ msgstr "NetworkManager Applet" + +#~ msgid "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." + +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." + +#~ msgid "translator-credits" +#~ msgstr "David Lodge James Ogley " + +#~ msgid "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." + +#~ msgid "VPN Login Failure" +#~ msgstr "VPN Login Failure" + +#~ msgid "Could not start the VPN connection '%s' due to a login failure." +#~ msgstr "Could not start the VPN connection '%s' due to a login failure." + +#~ msgid "VPN Start Failure" +#~ msgstr "VPN Start Failure" + +#~ msgid "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." +#~ msgstr "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." + +#~ msgid "VPN Connect Failure" +#~ msgstr "VPN Connect Failure" + +#~ msgid "Could not start the VPN connection '%s' due to a connection error." +#~ msgstr "Could not start the VPN connection '%s' due to a connection error." + +#~ msgid "VPN Configuration Error" +#~ msgstr "VPN Configuration Error" + +#~ msgid "The VPN connection '%s' was not correctly configured." +#~ msgstr "The VPN connection '%s' was not correctly configured." + +#~ msgid "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." +#~ msgstr "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." + +#~ msgid "VPN Login Message" +#~ msgstr "VPN Login Message" + +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." + +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "The network device \"%s (%s)\" does not support wireless scanning." + +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "The network device \"%s (%s)\" does not support link detection." + +#~ msgid "(unknown)" +#~ msgstr "(unknown)" + +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "Preparing device %s for the wired network..." + +# +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "Preparing device %s for the wireless network '%s'..." + +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "Configuring device %s for the wired network..." + +# +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "Attempting to join the wireless network '%s'..." + +# +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "Waiting for Network Key for the wireless network '%s'..." + +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "Requesting a network address from the wired network..." + +# +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "Requesting a network address from the wireless network '%s'..." + +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "Finishing connection to the wired network..." + +# +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "Finishing connection to the wireless network '%s'..." + +#~ msgid "NetworkManager is not running" +#~ msgstr "NetworkManager is not running" + +#~ msgid "Networking disabled" +#~ msgstr "Networking disabled" + +#~ msgid "No network connection" +#~ msgstr "No network connection" + +#~ msgid "Wired network connection" +#~ msgstr "Wired network connection" + +# +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Connected to an Ad-Hoc wireless network" + +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Wireless network connection to '%s' (%d%%)" + +#~ msgid "VPN connection to '%s'" +#~ msgstr "VPN connection to '%s'" + +#~ msgid "VPN connecting to '%s'" +#~ msgstr "VPN connecting to '%s'" + +#~ msgid "_Connect to Other Wireless Network..." +#~ msgstr "_Connect to Other Wireless Network..." + +#~ msgid "Create _New Wireless Network..." +#~ msgstr "Create _New Wireless Network..." + +#~ msgid "_VPN Connections" +#~ msgstr "_VPN Connections" + +#~ msgid "_Configure VPN..." +#~ msgstr "_Configure VPN..." + +#~ msgid "_Disconnect VPN..." +#~ msgstr "_Disconnect VPN..." + +#~ msgid "_Dial Up Connections" +#~ msgstr "_Dial Up Connections" + +#~ msgid "Connect to %s..." +#~ msgstr "Connect to %s..." + +#~ msgid "Disconnect from %s..." +#~ msgstr "Disconnect from %s..." + +#~ msgid "No network devices have been found" +#~ msgstr "No network devices have been found" + +#~ msgid "NetworkManager is not running..." +#~ msgstr "NetworkManager is not running..." + +#~ msgid "Enable _Networking" +#~ msgstr "Enable _Networking" + +#~ msgid "Enable _Wireless" +#~ msgstr "Enable _Wireless" + +#~ msgid "Connection _Information" +#~ msgstr "Connection _Information" + +#~ msgid "_Help" +#~ msgstr "_Help" + +#~ msgid "_About" +#~ msgstr "_About" + +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "The NetworkManager Applet could not find some required resources. It " +#~ "cannot continue.\n" + +#~ msgid "Shared Key" +#~ msgstr "Shared Key" + +#~ msgid "Automatic (Default)" +#~ msgstr "Automatic (Default)" + +#~ msgid "AES-CCMP" +#~ msgstr "AES-CCMP" + +#~ msgid "TKIP" +#~ msgstr "TKIP" + +#~ msgid "Dynamic WEP" +#~ msgstr "Dynamic WEP" + +#~ msgid "None" +#~ msgstr "None" + +#~ msgid "WEP 64/128-bit ASCII" +#~ msgstr "WEP 64/128-bit ASCII" + +#~ msgid "WEP 64/128-bit Hex" +#~ msgstr "WEP 64/128-bit Hex" + +#~ msgid "WEP 128-bit Passphrase" +#~ msgstr "WEP 128-bit Passphrase" + +#~ msgid "PEAP" +#~ msgstr "PEAP" + +#~ msgid "TLS" +#~ msgstr "TLS" + +#~ msgid "TTLS" +#~ msgstr "TTLS" + +#~ msgid "WPA2 Enterprise" +#~ msgstr "WPA2 Enterprise" + +#~ msgid "WPA Enterprise" +#~ msgstr "WPA Enterprise" + +#~ msgid "WPA2 Personal" +#~ msgstr "WPA2 Personal" + +#~ msgid "WPA Personal" +#~ msgstr "WPA Personal" + +#~ msgid "Orientation" +#~ msgstr "Orientation" + +#~ msgid "The orientation of the tray." +#~ msgstr "The orientation of the tray." + +#~ msgid "Wired Network (%s)" +#~ msgstr "Wired Network (%s)" + +#~ msgid "_Wired Network" +#~ msgstr "_Wired Network" + +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "Wireless Network (%s)" +#~ msgstr[1] "Wireless Networks (%s)" + +# +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "Wireless Network" +#~ msgstr[1] "Wireless Networks" + +#~ msgid " (invalid Unicode)" +#~ msgstr " (invalid Unicode)" + +#~ msgid "" +#~ "By default, the wireless network's name is set to your computer's name, %" +#~ "s, with no encryption enabled" +#~ msgstr "" +#~ "By default, the wireless network's name is set to your computer's name, %" +#~ "s, with no encryption enabled" + +# +#~ msgid "Create new wireless network" +#~ msgstr "Create new wireless network" + +#~ msgid "" +#~ "Enter the name and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "" +#~ "Enter the name and security settings of the wireless network you wish to " +#~ "create." + +#~ msgid "Create New Wireless Network" +#~ msgstr "Create New Wireless Network..." + +# +#~ msgid "Existing wireless network" +#~ msgstr "Existing wireless network" + +#~ msgid "Enter the name of the wireless network to which you wish to connect." +#~ msgstr "" +#~ "Enter the name of the wireless network to which you wish to connect." + +#~ msgid "Connect to Other Wireless Network" +#~ msgstr "Connect to Other Wireless Network" + +#~ msgid "Error connecting to wireless network" +#~ msgstr "Error connecting to wireless network" + +#~ msgid "" +#~ "The requested wireless network requires security capabilities unsupported " +#~ "by your hardware." +#~ msgstr "" +#~ "The requested wireless network requires security capabilities unsupported " +#~ "by your hardware." + +#~ msgid "Cannot start VPN connection '%s'" +#~ msgstr "Cannot start VPN connection '%s'" + +#~ msgid "" +#~ "Could not find the authentication dialog for VPN connection type '%s'. " +#~ "Contact your system administrator." +#~ msgstr "" +#~ "Could not find the authentication dialog for VPN connection type '%s'. " +#~ "Contact your system administrator." + +#~ msgid "" +#~ "There was a problem launching the authentication dialog for VPN " +#~ "connection type '%s'. Contact your system administrator." +#~ msgstr "" +#~ "There was a problem launching the authentication dialog for VPN " +#~ "connection type '%s'. Contact your system administrator." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "" +#~ "Active Connection Information" +#~ msgstr "" +#~ "Active Connection Information" + +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." + +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen to log in to the wireless network '%s'. If you are sure " +#~ "that this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will not require confirmation on subsequent log ins." +#~ msgstr "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen to log in to the wireless network '%s'. If you are sure " +#~ "that this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will not require confirmation on subsequent log ins." + +#~ msgid "Anonymous Identity:" +#~ msgstr "Anonymous Identity:" + +#~ msgid "Authentication:" +#~ msgstr "Authentication:" + +#~ msgid "Broadcast Address:" +#~ msgstr "Broadcast Address:" + +#~ msgid "CA Certificate File:" +#~ msgstr "CA Certificate File:" + +#~ msgid "C_onnect" +#~ msgstr "C_onnect" + +#~ msgid "Client Certificate File:" +#~ msgstr "Client Certificate File:" + +#~ msgid "Connection Information" +#~ msgstr "Connection Information" + +#~ msgid "Default Route:" +#~ msgstr "Default Route:" + +#~ msgid "Destination Address:" +#~ msgstr "Destination Address:" + +#~ msgid "Driver:" +#~ msgstr "Driver:" + +#~ msgid "EAP Method:" +#~ msgstr "EAP Method:" + +#~ msgid "Hardware Address:" +#~ msgstr "Hardware Address:" + +#~ msgid "IP Address:" +#~ msgstr "IP Address:" + +#~ msgid "Identity:" +#~ msgstr "Identity:" + +#~ msgid "Interface:" +#~ msgstr "Interface:" + +#~ msgid "Key Type:" +#~ msgstr "Key Type:" + +#~ msgid "Key management:" +#~ msgstr "Key management:" + +#~ msgid "Key:" +#~ msgstr "Key:" + +#~ msgid "" +#~ "None\n" +#~ "WEP 128-bit Passphrase\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" +#~ msgstr "" +#~ "None\n" +#~ "WEP 128-bit Passphrase\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" + +#~ msgid "" +#~ "Open System\n" +#~ "Shared Key" +#~ msgstr "" +#~ "Open System\n" +#~ "Shared Key" + +#~ msgid "Other Wireless Network..." +#~ msgstr "Other Wireless Networks..." + +#~ msgid "Passphrase:" +#~ msgstr "Passphrase:" + +#~ msgid "Password:" +#~ msgstr "Password:" + +#~ msgid "Primary DNS:" +#~ msgstr "Primary DNS:" + +#~ msgid "Private Key File:" +#~ msgstr "Private Key File:" + +#~ msgid "Private Key Password:" +#~ msgstr "Private Key Password:" + +#~ msgid "Secondary DNS:" +#~ msgstr "Secondary DNS:" + +#~ msgid "Select the CA Certificate File" +#~ msgstr "Select the CA Certificate File" + +#~ msgid "Select the Client Certificate File" +#~ msgstr "Select the Client Certificate File" + +#~ msgid "Select the Private Key File" +#~ msgstr "Select the Private Key File" + +#~ msgid "Show key" +#~ msgstr "Show key" + +#~ msgid "Show passphrase" +#~ msgstr "Show passphrase" + +#~ msgid "Show password" +#~ msgstr "Show password" + +#~ msgid "Show passwords" +#~ msgstr "Show passwords" + +#~ msgid "Speed:" +#~ msgstr "Speed:" + +#~ msgid "Subnet Mask:" +#~ msgstr "Subnet Mask:" + +#~ msgid "Type:" +#~ msgstr "Type:" + +#~ msgid "User Name:" +#~ msgstr "User Name:" + +#~ msgid "Wireless Network Key Required" +#~ msgstr "Wireless Network Key Required" + +# +#~ msgid "Wireless _adapter:" +#~ msgstr "Wireless _adapter:" + +# +#~ msgid "_Always Trust this Wireless Network" +#~ msgstr "_Always Trust this Wireless Network" + +#~ msgid "_Don't remind me again" +#~ msgstr "_Don't remind me again" + +#~ msgid "_Fallback on this Network" +#~ msgstr "_Fallback on this Network" + +#~ msgid "_Login to Network" +#~ msgstr "_Login to Network" + +#~ msgid "_Network Name:" +#~ msgstr "_Network Name:" + +# +#~ msgid "_Wireless Security:" +#~ msgstr "_Wireless Security:" + +#~ msgid "Cannot add VPN connection" +#~ msgstr "Cannot add VPN connection" + +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." + +#~ msgid "Cannot import VPN connection" +#~ msgstr "Cannot import VPN connection" + +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." + +#~ msgid "Error retrieving VPN connection '%s'" +#~ msgstr "Error retrieving VPN connection '%s'" + +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." + +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "Delete VPN connection \"%s\"?" + +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." + +#~ msgid "Unable to load" +#~ msgstr "Unable to load" + +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "Cannot find some needed resources (the glade file)!" + +#~ msgid "Create VPN Connection" +#~ msgstr "Create VPN Connection" + +#~ msgid "Edit VPN Connection" +#~ msgstr "Edit VPN Connection" + +#~ msgid "Add a new VPN connection" +#~ msgstr "Add a new VPN connection" + +#~ msgid "Delete the selected VPN connection" +#~ msgstr "Delete the selected VPN connection" + +#~ msgid "E_xport" +#~ msgstr "E_xport" + +#~ msgid "Edit the selected VPN connection" +#~ msgstr "Edit the selected VPN connection" + +#~ msgid "Export the VPN settings to a file" +#~ msgstr "Export the VPN settings to a file" + +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "Export the selected VPN connection to a file" + +# +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "Manage Virtual Private Network Connections" + +#~ msgid "VPN Connections" +#~ msgstr "VPN Connections" + +#~ msgid "40-bit WEP" +#~ msgstr "40-bit WEP" + +#~ msgid "104-bit WEP" +#~ msgstr "104-bit WEP" + +#~ msgid "WPA TKIP" +#~ msgstr "WPA TKIP" + +#~ msgid "WPA CCMP" +#~ msgstr "WPA CCMP" + +#~ msgid "WPA Automatic" +#~ msgstr "WPA Automatic" + +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" + +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" + +#~ msgid "WPA2 Automatic" +#~ msgstr "WPA2 Automatic" + +#~ msgid "none" +#~ msgstr "none" + +#~ msgid "operation took too long" +#~ msgstr "operation took too long" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "received data from wrong type of sender" + +#~ msgid "received data from unexpected sender" +#~ msgstr "received data from unexpected sender" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "too much data was sent over socket and some of it was lost" + +# +#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." +#~ msgstr "You are now connected to the Ad-Hoc wireless network '%s'." + +# +#~ msgid "You are now connected to the wireless network '%s'." +#~ msgstr "You are now connected to the wireless network '%s'." + +#~ msgid "You are now connected to the wired network." +#~ msgstr "You are now connected to the wired network." + +#~ msgid "Connection Established" +#~ msgstr "Connection Established" + +#~ msgid "Disconnected" +#~ msgstr "Disconnected" + +#~ msgid "The network connection has been disconnected." +#~ msgstr "The network connection has been disconnected." + +#~ msgid "LEAP" +#~ msgstr "LEAP" + +#~ msgid "" +#~ "The requested wireless network '%s' does not appear to be in range. A " +#~ "different wireless network will be used if any are available." +#~ msgstr "" +#~ "The requested wireless network '%s' does not appear to be in range. A " +#~ "different wireless network will be used if any are available." + +#~ msgid "VPN Error" +#~ msgstr "VPN Error" + +#~ msgid "The VPN service said: \"%s\"" +#~ msgstr "The VPN service said: \"%s\"" + +#~ msgid "VPN connection '%s' said:" +#~ msgstr "VPN connection '%s' said:" diff --git a/po/es.po b/po/es.po new file mode 100644 index 00000000..313d2a0b --- /dev/null +++ b/po/es.po @@ -0,0 +1,1723 @@ +# translation of es.po to Spanish +# translation of NetworkManager.HEAD.po to +# Traducción de NetworkManager al español. +# Copyright (C) Spanish translation for NetworkManager +# This file is distributed under the same license as the NetworkManager package. +# +# Antonio Ognio , 2004. +# Francisco Javier F. Serrador , 2004, 2005, 2006. +# Lucas Vieites Fariña , 2005, 2006. +# Gladys Guerrero , 2010. +# Jorge González , 2007, 2008, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-07-11 10:42+0200\n" +"Last-Translator: Jorge González \n" +"Language-Team: Español \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NOMBRE" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DISPOSITIVOS" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "ALCANCE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "PREDETERMINADO" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "SERVICIO DBUS" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "OBJETO SPEC" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TIPO" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "MARCA DE TIEMPO" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "MARCA DE TIEMPO-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONECTAR" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "SÓLOLECTURA" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Uso: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Error: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Error: 'con list': %s; campos permitidos: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Detalles de conexiones" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "sistema" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "usuario" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "nunca" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "sí" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "no" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Conexiones de sistema" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Conexiones de usuario" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Error: falta el argumento %s." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Error: %s - no hay tal conexión." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parámetro desconocido: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Error: no se especificó un parámetro válido." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Error: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Error: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Error: 'con status': %s; campos permitidos: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Conexiones activas" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "conexión no activa en dispositivo '%s'" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "conexión o dispositivo no activos" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "dispositivo '%s' incompatible con conexión '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "no se encontró dispositivo para conexión '%s'" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "activando" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "activada" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "desconocido" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "Conectando VPN (preparar)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "Conectando VPN (necesita autenticación)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "Conectando VPN" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "Conectando VPN (Obteniendo configuración IP)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN conectada" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "Conexión VPN falló" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN desconectada" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "razón desconocida" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "ninguna" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "el usuario estaba desconectado" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "la conexión de red de base fue interrumpida" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "El servicio VPN se detuvo inesperadamente" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "El servicio VPN retornó configuración inválida" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "El intento de conexión se agotó" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "el servicio VPN no inició a tiempo" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "el servicio VPN falló en el inicio" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "secretos VPN inválidos" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "secretos VPN válidos" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "la conexión fue eliminada" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "estado: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Conexión activada\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Error: Activación de conexión falló." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "estado: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Error: Activación de conexión falló: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Error: Pausa de %d segundos expiró." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Error: Activación de conexión falló: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Error: Obtención de conexión activa para '%s' falló." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Estado de conexión activa: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Ruta de conexión activa: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Error: Conexión desconocida: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Error: valor de pausa '%s' inválido." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Error: id o uuid ha sido especificado." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Error: Dispositivo inapropiado: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Error: Dispositivo no apropiado." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Advertencia: Conexión inactiva\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Error: comando 'con' '%s' es inválido." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Error: no se pudo conectar a D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Error: no se pudo obtener configuración de sistema." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Error: No se pudo obtener configuración de usuario." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Error: No se pudieron obtener conexiones: servicios de configuración no se " +"están ejecutando." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DISPOSITIVO" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ESTADO" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "FUNCIONALIDADES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "PROPIEDADES-WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "PROPIEDADES ALÁMBRICAS" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "CONFIGURACIONES IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "DNS IP4" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "CONTROLADOR" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "DETECTAR-PORTADOR" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "VELOCIDAD" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "PORTADOR" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "DIRECCIÓN" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIJO" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "PUERTA DE ENLACE" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODO" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREC" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "TASA" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SEÑAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SEGURIDAD" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "INDICADORES-WPA" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "INDICADORES-RSN" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVO" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Uso: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "sin gestión" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "no disponible" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "desconectado" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "conectando (preparar)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "conectando (configurando)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "conectando (necesita autenticación)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "conectando (obteniendo configuración IP)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "conectado" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "conexión falló" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "desconocido" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(ninguno)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: error convirtiendo dirección IP4 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Encriptado: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP" + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA" + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2" + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Empresa" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infraestructura" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Error: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Error: 'dev list': %s; campos permitidos: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Detalles de dispositivos" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(desconocido)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "desconocido" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "encendido" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "apagado" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Error: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Error: 'dev status': %s; campos permitidos: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Estado de dispositivos" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Error: '%s' falta argumento." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Error: Dispositivo '%s' no encontrado." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Éxito: Dispositivo '%s' desconectado correctamente." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Error: Desconexión de dispositivo '%s' (%s) falló: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Estado de dispositivo: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Error: iface tiene que especificarse." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Error: 'dev wifi' '%s'" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Error: 'dev wifi': %s; campos permitidos: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "lista de scan WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Error: Punto de acceso con hwaddr '%s' no se encontró." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Error: Dispositivo '%s' no es un dispositivo WiFi." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Error: comando 'dev wifi' '%s' inválido." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Error: comando 'dev' '%s' inválido." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "EJECUTANDO" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "HARDWARE-WIFI" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "HARDWARE-WWAN" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Uso: nmcli nm { COMANDO | ayuda }\n" +"\n" +" COMANDO := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" estatus\n" +" dormir\n" +" despertar\n" +" wifi [encendido|apagado]\n" +" wwan [encendido|apagado]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "dormido" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "conectando" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Error: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Error: 'nm status': %s; campos permitidos: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Estado de NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "habilitado" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "inhabilitado" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "ejecutando" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "no ejecutando" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Error: '--fields' valor '%s' no es válido aquí; campos permitidos: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi habilitado" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Error: parámetro 'wifi' inválido: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN habilitado" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Error: parámetro 'wwan' inválido: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Error: comando 'nm' command '%s' inválido." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Uso: %s [OPCIONES] OBJETO { COMANDO | ayuda }\n" +"\n" +"OPCIONES\n" +" -t[erse] salida terse \n" +" -p[retty] salida pretty\n" +" -v[ersion] mostrar versión programa\n" +" -h[elp] imprimir esta ayuda\n" +"\n" +"OBJETO\n" +" nm estatus de NetworkManager\n" +" con conexiones de NetworkManager\n" +" dev dispositivos administrados por NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Error: Objeto '%s' desconocido, intente 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Error: Opción '--terse' se especifica la segunda vez." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Error: Opción '--terse' es mutuamente exclusiva con '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Error: Opción '--pretty' se especifica la segunda vez." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Error: Opción '--pretty' es mutuamente exclusiva con '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Error: falta argumento para opción '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Error: '%s' no es válido argumento para opción '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Error: faltan campos para opciones '%s'." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "herramienta nmcli, versión %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Error: Opción '%s' desconocida, intente 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Señal capturada %d, apagando..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Error: No se pudo conectar al NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Éxito" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (clave-hex-ascii)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (frase de acceso 104/128-bits)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (desconocido)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (desconocido)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "cualquiera," + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "no establecido" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "campo '%s' tiene que estar solo" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "campo inválido '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Opción '--terse' requiere especificar '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Opción '--terse' requiere valores de '--fields' específicos, no '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "El archivo de clave PEM no tiene la etiqueta de finalización «%s»." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "No parece ser un archivo de clave privada PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "No hay memoria suficiente para almacenar el archivo de datos PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Archivo PEM mal formado: la primera etiqueta no era Proc-Type." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Archivo PEM mal formado: etiqueta Proc-Type «%s» desconocida." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Archivo PEM mal formado: la segunda etiqueta no era DEK-Info." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Archivo PEM mal formado: no se encontró IV en la etiqueta DEK-Info." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" +"Archivo PEM mal formado: formato de IV no válido en la etiqueta DEK-Info." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Archivo PEM malformado: cifrador de clave privada «%s» desconocido." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "No se pudo decodificar la clave privada." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "El certificado PEM «%s» no tiene etiqueta de finalización «%s»." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "No se pudo decodificar el certificado." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "No hay memoria suficiente para almacenar los datos del certificado." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "No hay memoria suficiente para almacenar el archivo." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV debe ser un número par de bytes de longitud." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "No hay memoria suficiente para almacenar la IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV contiene dígitos no hexadecimales." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Se desconocía el cifrador de clave privada «%s»." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "No hay memoria suficiente para descifrar la clave privada." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "No se pudo determinar el tipo de clave privada." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "No hay memoria suficiente para almacenar la clave privada descifrada." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Falló al inicializar el motor de descifrado." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Falló al inicializar el motor MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Longitud IV inválida (debe ser al menos de %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "No hay memoria suficiente para el búfer de la clave descifrada." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Falló al inicializar el contexto de descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Falló al establecer la clave simétrica para el descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Falló al establecer IV para el descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Falló al descifrar la clave privada: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Falló al descifrar la clave privada: longitud inesperada del relleno." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Falló al descifrar la clave privada." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "No se pudo reservar memoria para el cifrado." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Falló al inicializar el contexto de cifrador: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Falló al establecer la clave simétrica para el cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Falló al establecer IV para el cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Falló al cifrar los datos: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Error al inicializar los datos del certificado: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "No se pudo decodificar el certificado: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "No se pudo inicializar el decodificador PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "No se pudo decodificar el archivo PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "No se pudo verificar el archivo PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Falló al inicializar el motor de cifrado: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Falló al inicializar el contexto MD5: %d" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Longitud IV inválida (debe ser al menos de %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Falló al inicializar la ranura de descifrado." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Falló al establecer la clave simétrica para el descifrado." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Falló al establecer IV para el descifrado." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Falló al inicializar el contexto de descifrado." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Falló al descifrar la clave privada: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Falló al descifrar la clave privada: los datos descifrados son demasiado " +"grandes." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Falló la finalización del descifrado de la clave privada: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Falló al inicializar la ranura de cifrado." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Falló al establecer la clave simétrica para el cifrado." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Falló al establecer IV para el cifrado." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Falló al inicializar el contexto de cifrado." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Falló al cifrar: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Cantidad inesperada de datos después del encriptado." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "No se pudo decodificar el certificado: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "No se pudo convertir la contraseña a UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "No se pudo inicializar el decodificador PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "No se pudo decodificar el archivo PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "No se pudo verificar el archivo PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "No se pudo generar datos aleatorios." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "No hay memoria suficiente para crear la clave privada de cifrado." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "No se pudo reservar memoria para crear el archivo PEM." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "No pudo asignar memoria para escribir IV al archivo PEM." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"No se pudo asignar memoria para escribir llave encriptada al archivo PEM." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "No se pudo reservar memoria para el archivo de datos PEM." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Compartir conexión a través de una red WIFI protegida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Compartir conexión a través de una red WIFI abierta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modificar nombre de host de sistema persistente" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modificar conexiones de sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Política de sistema evita modificación de configuración de sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Política de sistema evita modificación de nombre de host de sistema " +"persistente" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Política de sistema evita compartir conexiones a través de una red WIFI " +"protegida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Política de sistema evita compartir conexiones a través de una red WIFI " +"abierta" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Permitir controlar las conexiones de red" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Permitir el uso de conexiones específicas de usuario" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Activar o desactivar los dispositivos inalámbricos" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Activar o desactivar los dispositivos de banda ancha móvil" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Activar o desactivar la red del sistema" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Poner NetworkManager a dormir o despertarlo (sólo lo debería usar el gestor " +"de energía del sistema)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents control of network connections" +msgstr "La política de sistema evita el control de las conexiones de red" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +#| msgid "System policy prevents sharing connections via an open WiFi network" +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "" +"La política de sistema evita activar o desactivar los dispositivos " +"inalámbricos" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"La política del sistema evita activar o desactivar los dispositivos de banda " +"ancha móvil" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents enabling or disabling system networking" +msgstr "La política del sistema evita activar o desactivar la red del sistema" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "" +"La política del sistema evita poner a NetworkManager a dormir o despertarlo" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +#| msgid "System policy prevents modification of system settings" +msgid "System policy prevents use of user-specific connections" +msgstr "" +"La política del sistema evita el uso de conexiones específicas de usuario" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "error al procesar el mensaje de netlink: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ha ocurrido un error mientras esperaban datos en un socket" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"no se puede conectar con netlink para monitorizar el estado del enlace: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "no se puede habilitar el manejador netlink para pasar credenciales: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"no se puede asignar el manejador netlink para monitorizar el estado del " +"enlace: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"no se puede asignar el enlace a la cache de netlink para monitorizar el " +"estado del enlace: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "no pudo unirse al grupo netlink: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "error al actualizar el enlace caché: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Opción no válida. Use --help para ver una lista de las opciones válidas.\n" + +#: ../src/main.c:568 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Por favor use --help para ver la lista de opciones válidas.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Creado por NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Mezclado de %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "cliente DHCP inútil pudo ser hallado." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' pudo ser hallado." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' pudo ser hallado." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "'%s' Cliente DHCP sin soporte " + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Nivel de registro desconocido '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Dominio de registro desconocido '%s'" + +#: ../src/named-manager/nm-named-manager.c:350 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"NOTA: el 'resolver' de nombres de libc puede que no soporte más de 3 " +"servidores de nombres." + +#: ../src/named-manager/nm-named-manager.c:352 +msgid "The nameservers listed below may not be recognized." +msgstr "Puede que los servidores de nombres listados abajo no se reconozcan." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %ss" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 +msgid "System" +msgstr "Sistema" diff --git a/po/et.po b/po/et.po new file mode 100644 index 00000000..3a57c8d1 --- /dev/null +++ b/po/et.po @@ -0,0 +1,289 @@ +# Networkmanageri tõlge eesti keelde. +# Estonian translation of Networkmanager. +# +# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2007 The GNOME Project +# This file is distributed under the same license as the Networkmanager package. +# +# Priit Laes , 2006, 2007. +# Ivar Smolin 2006, 2007. +# Mattias Põldaru , 2007-2008. +# +msgid "" +msgstr "" +"Project-Id-Version: Networkmanager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-09-05 18:57+0000\n" +"PO-Revision-Date: 2008-09-28 21:10+0300\n" +"Last-Translator: Mattias Põldaru \n" +"Language-Team: Estonian \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" + +#: ../src/nm-netlink-monitor.c:193 +#: ../src/nm-netlink-monitor.c:474 +#, c-format +msgid "error processing netlink message: %s" +msgstr "viga netlink sõnumi töötlemisel: %s" + +#: ../src/nm-netlink-monitor.c:250 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "võrguoleku monitooringu jaoks netlink pideme eraldamine võimatu: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "võrguoleku monitooringu jaoks netlink'iga ühendumine võimatu: %s" + +#: ../src/nm-netlink-monitor.c:268 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "võrguoleku monitooringu jaoks netlink grupiga liitumine võimatu: %s" + +#: ../src/nm-netlink-monitor.c:276 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "võrguoleku monitooringu jaoks netlink lingi puhvri eraldamine võimatu: %s" + +#: ../src/nm-netlink-monitor.c:439 +#, c-format +msgid "error updating link cache: %s" +msgstr "viga lingi puhvri uuendamisel: %s" + +#: ../src/nm-netlink-monitor.c:497 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "soklist andmete ootamisel tekkis viga" + +#: ../src/NetworkManager.c:250 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Vigane valik. Kasuta --help võtit sobivate valikute nimistu nägemiseks.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 +msgid "# Created by NetworkManager\n" +msgstr "# Loodud NetworkManager'i poolt\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Liidetud allikast %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:240 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "MÄRKUS: libc lahendaja ei pruugi toetada rohkem kui 3 nimeserverit." + +#: ../src/named-manager/nm-named-manager.c:242 +msgid "The nameservers listed below may not be recognized." +msgstr "Järgneva nimistu nimeservereid ei tuntud ära." + +#: ../system-settings/src/main.c:366 +#, c-format +msgid "Auto %s" +msgstr "Automaatne %s" + +#: ../libnm-util/crypto.c:125 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM võtmefaili lõpus ei olnud '%s'." + +#: ../libnm-util/crypto.c:135 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Ei paista nagu PEM-eravõtme fail." + +#: ../libnm-util/crypto.c:143 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM faili andmete hoidmiseks pole piisavalt mälu." + +#: ../libnm-util/crypto.c:159 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Vigane PEM fail: Proc-Type ei olnud esimene silt." + +#: ../libnm-util/crypto.c:167 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Vigane PEM fail: tundmatu Proc-Type silt '%s'." + +#: ../libnm-util/crypto.c:177 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Vigane PEM fail: DEK-info ei olnud teine silt." + +#: ../libnm-util/crypto.c:188 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Vigane PEM fail: IV ei leitud DEK-Info sildis." + +#: ../libnm-util/crypto.c:195 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Vigane PEM fail: IV vigane vorming DEK-Info sildis." + +#: ../libnm-util/crypto.c:208 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Vigane PEM fail: tunmatu privaatvõtme šiffer '%s'." + +#: ../libnm-util/crypto.c:227 +#, c-format +msgid "Could not decode private key." +msgstr "Privaatvõtit ei saa dešifreerida." + +#: ../libnm-util/crypto.c:271 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM-sertifikaadil '%s' pole lõpusilti '%s'." + +#: ../libnm-util/crypto.c:281 +#, c-format +msgid "Failed to decode certificate." +msgstr "Sertifikaadi dešifreerimine nurjus." + +#: ../libnm-util/crypto.c:290 +#: ../libnm-util/crypto.c:298 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Sertifikaadi andmete salvestamiseks pole piisavalt mälu." + +#: ../libnm-util/crypto.c:328 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV pikkus baitides peab olema paarisarv." + +#: ../libnm-util/crypto.c:337 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV hoidmiseks pole piisavalt mälu." + +#: ../libnm-util/crypto.c:348 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV sisaldab mitte-oktaalarvu." + +#: ../libnm-util/crypto.c:386 +#: ../libnm-util/crypto_gnutls.c:142 +#: ../libnm-util/crypto_nss.c:155 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Privaatvõtme šiffer '%s' oli tundmatu." + +#: ../libnm-util/crypto.c:395 +#, c-format +msgid "Not enough memory to create private key decryption key." +msgstr "Privaatvõtme dešifreerimise võtme loomiseks pole piisavalt mälu." + +#: ../libnm-util/crypto.c:513 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Dešifreeritud privaatvõtme hoidmiseks pole piisavalt mälu." + +#: ../libnm-util/crypto_gnutls.c:43 +msgid "Failed to initialize the crypto engine." +msgstr "Šifreerimismootori lähtestamine nurjus." + +#: ../libnm-util/crypto_gnutls.c:88 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5-mootori lähtestamine nurjus: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:151 +#: ../libnm-util/crypto_nss.c:164 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Dešifreeritud võtme puhvri jaoks pole piisavalt mälu." + +#: ../libnm-util/crypto_gnutls.c:159 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Dešifreerimise šifri konteksti lähtestamine nurjus: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:168 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Sümmeetrilise võtme määramine dešifreerimiseks nurjus: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:177 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "IV määramine dešifreerimiseks nurjus: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:186 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Privaatvõtme dešifreerimine nurjus: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:224 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Sertifikaadi andmete lähtestamine nurjus: %s" + +#: ../libnm-util/crypto_gnutls.c:236 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Sertifikaati ei saa dešifreerida: %s" + +#: ../libnm-util/crypto_nss.c:49 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Šifrimootori lähtestamine nurjus: %d." + +#: ../libnm-util/crypto_nss.c:96 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 konteksti lähtestamine nurjus: %d." + +#: ../libnm-util/crypto_nss.c:172 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Šifripesa lähtestamine nurjus." + +#: ../libnm-util/crypto_nss.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Sümmeetrilise võtme määramine dešifreerimiseks nurjus." + +#: ../libnm-util/crypto_nss.c:192 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "IV määramine dešifreerimiseks nurjus." + +#: ../libnm-util/crypto_nss.c:200 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Dešifreerimise konteksti lähtestamine nurjus." + +#: ../libnm-util/crypto_nss.c:213 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Privaatvõtme dešifreerimine nurjus: %d." + +#: ../libnm-util/crypto_nss.c:225 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Privaatvõtme dešifreerimise lõpetamine nurjus: %d." + +#: ../libnm-util/crypto_nss.c:269 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Sertifikaati ei suudetud dekodeerida: %d" + +#~ msgid "operation took too long" +#~ msgstr "operatsiooniks kulus liiga palju aega" +#~ msgid "received data from wrong type of sender" +#~ msgstr "vastuvõetud andmed on valet tüüpi saatjalt" +#~ msgid "received data from unexpected sender" +#~ msgstr "vastuvõetud andmed on ootamatult saatjalt" +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "" +#~ "sokli kaudu saadeti liiga palju andmeid ning osa sellest läks kaotsi" + diff --git a/po/eu.po b/po/eu.po new file mode 100644 index 00000000..f2e96a50 --- /dev/null +++ b/po/eu.po @@ -0,0 +1,1351 @@ +# translation of NetworkManager.master.po to Basque +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Iñaki Larrañaga Murgoitio , 2008, 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-02-26 03:24+0000\n" +"PO-Revision-Date: 2010-03-16 17:05+0100\n" +"Last-Translator: Iñaki Larrañaga Murgoitio \n" +"Language-Team: Basque \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: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Erabilera: nmcli con { KOMANDOA| help }\n" +" KOMANDOA := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Konexioak" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Mota" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUIDa" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Izena" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Sistemako konexioak:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Erabiltzailearen konexioak:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Errorea: %s argumentua falta da." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Errorea: %s - ez dago halako konexiorik" + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Sistema osoko konexioak" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Erabiltzailearen konexioak" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parametro ezezagunak: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Errorea: ez da baliozko parametrorik zehaztu." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "bai" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "ez" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Konexio aktiboak" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Lehenetsia" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Zerbitzua" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Gailuak" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ez dago konexio aktiborik '%s' gailuan" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "ez dago konexio edo gailu aktiborik" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktibatzen" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktibatuta" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "ezezaguna" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "VPN konektatzen (prestatzen)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN konektatzen (autentifikazioa behar da)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "VPN konektatzen" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN konektatzen (IP konfigurazioa lortzen)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN konektatuta" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "VPN konexioak huts egin du" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN deskonektatuta" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "arrazoi ezezaguna" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "bat ere ez" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "erabiltzailea deskonektatu egin da" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "oinarriko sarearen konexioa eten egin da" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN zerbitzua ustekabean gelditu da" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN zerbitzuak konfigurazio baliogabea itzuli du" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "konexioaren saiakeraren denbora-muga" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN zerbitzua ez da orduan abiatu" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "huts egin du VPN zerbitzuak abiaraztean" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "VPNren ezkutukoak ez dira baliozkoak" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "VPNren ezkutukoak baliogabeak" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "konexioa kendu egin da" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "egoera: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Konexioa aktibatuta\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Errorea: konexioaren aktibazioak huts egin du" + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "egoera: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Errorea: konexioaren aktibazioak huts egin du: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Errorea: denbora-muga %d segundotan iraungituta." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Errorea: konexioaren aktibazioak huts egin du: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Errorea: hust egin du '%s'(r)en konexio aktiboa lortzean." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Konexio aktiboaren egoera: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Konexio aktiboaren bide-izena: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Errorea: konexio ezezaguna: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Errorea: denbora-mugaren '%s' balioa ez da baliozkoa." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Errorea: IDa edo UUIDa zehaztu behar da." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Errorea: ez da gailu egokirik aurkitu: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Errorea: ez da gailu egokirik aurkitu." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Abisua: konexioa ez dago aktibo\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Errorea: 'con' komandoko '%s' ez da baliozkoa." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Errorea: ezin izan da 'D-Bus'-arekin konektatu." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Errorea: ezin izan da sistemako ezarpenik lortu." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Errorea: ezin izan da erabiltzailearen ezarpenik lortu." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Errorea: ezin da konexiorik lortu. Ezarpenen zerbitzuak ez dira exekutatzen ari." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Erabilera: nmcli dev { KOMANDOA | help }\n" +"\n" +" KOMANDOA := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "kudeatu gabea" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "ez dago erabilgarri" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "deskonektatuta" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "konektatzen (prestatzen)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "konektatzen (konfiguratzen)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "konektatzen (autentifikazioa behar da)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "konektatzen (IParen konfigurazioa lortzen)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "konektatuta" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "konexioak huts egin du" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Ezezaguna" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(bat ere ez)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: errorea 0x%X IP4 helbidea bihurtzean" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Maizt. %d MHz, Emaria: %d Mb/s, Indarra %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", enkriptatuta: " + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " enpresa" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Gailua" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Kontrolatzailea" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(ezezaguna)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Egoera" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "HW helbidea" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Ahalmenak:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Garraiolaria detektatuta" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Abiadura" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Haririk gabekoaren propietateak\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP enkriptatzea" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA enkriptatzea" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2 enkriptatzea" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP zifratua" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP zifratua" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" %s haririk gabeko sarbide-puntua\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = uneko SarPunt)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Haridunaren propietateak\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Garraiolaria" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "piztu" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "itzali" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4 ezarpenak:\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Helbidea" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Aurrizkia" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Atebidea" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Gailuen egoera" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Errorea: '%s' argumentua falta da." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Errorea: '%s' gailua ez da aurkitu." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Ongi burututa: '%s' gailua ongi deskonektatu da." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Errorea: huts egin du '%s' (%s) gailua deskonektatzean: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Gailuaren egoera: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Errorea: interfazea zehaztu behar da." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Wifi-en eskaneatze-zerrenda" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Errorea: '%s' gailua ez da haririk gabeko gailu bat." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Gailua:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Errorea: hardwarearen helbidea zehaztu behar da." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Errorea: ez da '%s' hw helbideko sarbide-punturik aurkitu." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "SPuntuaren parametroak" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSIDa:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSIDa:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Maiztasuna:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Modua:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Azpiegitura" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Gehienezko bit-emaria:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Indarra:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Banderak:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "pribatutasuna" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA banderak:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN banderak:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Errorea: 'dev wifi' komandoko '%s' ez da baliozkoa." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Errorea: 'dev' komandoko '%s' ez da baliozkoa." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Erabilera: nmcli nm { KOMANDOA | help }\n" +"\n" +" KOMANDOA := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "lotan" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "konektatzen" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "gaituta" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "desgaituta" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "NetworkManager-en egoera" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM-ren exekuzioa:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "exekutatzen" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "ez da exekutatzen ari" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM-ren egoera:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM haririk gabeko hardwarea:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM haririk gabekoa:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN hardwarea:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Errorea: baliogabeko 'wifi' parametroa: '%s'." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Errorea: baliogabeko 'wwan' parametroa: '%s'." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Errorea: 'nm' komandoko '%s' ez da baliozkoa." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Erabilera: %s [AUKERAK] OBJEKTUA { KOMANDOA | help }\n" +"\n" +"AUKERAK\n" +" -t[erse] xehetasunezko irteera\n" +" -p[retty] irteera politta\n" +" -v[ersion] erakutsi programaren bertsioa\n" +" -h[elp] erakutsi laguntza hau\n" +"\n" +"OBJEKTUA\n" +" nm NetworkManager-en egoera\n" +" con NetworkManager-en konexioak\n" +" dev NetworkManager-ek kudeatutako gailuak\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "'%s' objektua ezezaguna da. Saiatu honako komandoarekin: nmcli help" + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli tresna, %s bertsioa\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "'%s' aukera ezezaguna da. Saiatu honako komandoarekin: nmcli -help" + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d seinalea jaso da, itzaltzen..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Errorea: ezin izan da NetworkManager-ekin konektatu." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Behar bezala egin da" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM gako-fitxategiak ez du amaierako '%s' etiketa." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Ez dirudi PEM gako pribatuaren fitxategia denik." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Ez dago nahikoa memoria PEM fitxategiko datuak gordetzeko." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Gaizki osatutako PEM fitxategia: Proc-Type ez da aurreneko etiketa." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Gaizki osatutako PEM fitxategia: Proc-Type '%s' etiketa ezezaguna." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Gaizki osatutako PEM fitxategia: DEK-Info ez da bigarren etiketa." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Gaizki osatutako PEM fitxategia: ez da IV aurkitu DEK-Info etiketan." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" +"Gaizki osatutako PEM fitxategia: IV-ek okerreko formatua du DEK-Info " +"etiketan." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Gaizki osatutako PEM fitxategia: gako pribatuaren '%s' zifratua ezezaguna." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Ezin izan da gako pribatua deskodetu." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "'%s' PEM ziurtagiriak ez du amaierako '%s' etiketa." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Huts egin du ziurtagiria deskodetzean." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Ez dago nahikoa memoria ziurtagiriaren datuak gordetzeko." + +#: ../libnm-util/crypto.c:294 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Not enough memory to store file data." +msgstr "Ez dago nahikoa memoria fitxategiko datuak gordetzeko." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV-ek byte-kopuru bikoitia izan behar du luzeran." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Ez dago nahikoa memoria IV gordetzeko." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV-ek hamaseitarrak ez diren digituak ditu." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Gako pribatuaren '%s' zifratua ezezaguna da." + +#: ../libnm-util/crypto.c:391 +#, c-format +#| msgid "Not enough memory to store decrypted private key." +msgid "Not enough memory to decrypt private key." +msgstr "Ez dago nahikoa memoria gako pribatua deszifratzeko." + +#: ../libnm-util/crypto.c:511 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Unable to determine private key type." +msgstr "Huts egin du gako pribatuaren mota zehaztean." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Ez dago nahikoa memoria deszifratutako gako pribatua gordetzeko." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Huts egin du zifratzearen motorra hasieratzean." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Huts egin du MD5 motorra hasieratzean: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Baliogabeko IV luzera (gutxienez %zd izan behar du)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Ez dago nahikoa memoria deszifratutako gako buferrarentzako." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Huts egin du zifratze-testuingurua hasieratzean deszifratzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Huts egin du gako simetrikoa ezartzean deszifratzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Huts egin du IV ezartzean deszifratzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Huts egin du gako pribatua deszifratzean: %s /%s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Huts egin du gako pribatua deszifratzean: ustekabeko betegarriaren luzera." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key." +msgstr "Huts egin du gako pribatua deszifratzean." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Ezin izan da memoria esleitu enkriptatzeko." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Huts egin du zifratze-testuingurua enkriptazioa hasieratzean: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +#| msgid "Failed to set symmetric key for decryption: %s / %s." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Huts egin du gako simetrikoa ezartzean enkriptatzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Huts egin du IV ezartzean enkriptatzeko: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Huts egin du datuak enkriptatzean: %s /%s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Errorea ziurtagiriaren datuak hasieratzean: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Ezin izan da ziurtagiria deskodetu: %s." + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Ezin izan da PKCS#12 deskodetzailea hasieratu: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Ezin izan da PKCS#12 fitxategia deskodetu: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +#| msgid "Couldn't decode certificate: %s" +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Ezin izan da PKCS#12 fitxategia egiaztatu: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Huts egin du zifratzearen motorra hasieratzean: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Huts egin du MD5-en testuingurua hasieratzean: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Baliogabeko IV luzera (gutxienez %d izan behar du)" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Huts egin du zifratuaren erretena hasieratzean deszifratzeko." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Huts egin du gako simetrikoa ezartzean deszifratzeko." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Huts egin du IV ezartzean deszifratzeko." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Huts egin du deszifratzearen testuingurua hasieratzean." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Huts egin du gako pribatua deszifratzean: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Huts egin du gako pribatua deszifratzean: deszifratutako datuak luzeegiak dira." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Huts egin du gako pribatuaren deszifratzea amaitzean: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "Huts egin du zifratuaren erretenaren enkriptazioa hasieratzean." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "Huts egin du gako simetrikoa ezartzean enkriptatzeko." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Huts egin du IV ezartzean enkriptatzeko." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Huts egin du enkriptazioaren testuingurua hasieratzean." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Huts egin du enkriptatzean: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Ustekabeko datu kopurua enkriptatu ostean." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Ezin izan da ziurtagiria dekodetu: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Ezin izan da pasahitza UCS2-ra bihurtu: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Ezin izan da PKCS#12 deskodetzailea hasieratu: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Ezin izan da PKCS#12 fitxategia deskodetu: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +#| msgid "Couldn't decode certificate: %d" +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Ezin izan da PKCS#12 fitxategia egiaztatu: %d" + +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "Ezin izan da ausazko daturik sortu." + +#: ../libnm-util/nm-utils.c:1545 +#, c-format +#| msgid "Not enough memory to create private key decryption key." +msgid "Not enough memory to make encryption key." +msgstr "Ez dago nahikoa memoria gakoa enkriptatzeko." + +#: ../libnm-util/nm-utils.c:1655 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "Ezin izan da memoria esleitu PEM fitxategia sortzeko." + +#: ../libnm-util/nm-utils.c:1667 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Ezin izan da memoria esleitu IV idazteko PEM fitxategian." + +#: ../libnm-util/nm-utils.c:1679 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Ezin izan da memoria esleitu enkriptatutako gakoa idazteko PEM fitxategian." + +#: ../libnm-util/nm-utils.c:1698 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "Ezin izan da memoria esleitu PEM fitxategiko datuentzako." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "errorea netlink-en mezua prozesatzean: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ezin da netlink-ekin konektatu konexioaren egoera monitorizatzeko: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ezin da netlink-ekin konektatu konexioaren egoera monitorizatzeko: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "ezin da netlink taldearekin elkartu konexioaren egoera monitorizatzeko: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"ezin da netlink-en konexio-cachea esleitu konexioaren egoera " +"monitorizatzeko: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "errorea gertatu da socket-eko datuen zai egotean" + +#: ../src/nm-netlink-monitor.c:558 ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "errorea netlink-en konexio-cachea eguneratzean: %s" + +#: ../src/NetworkManager.c:494 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Aukera baliogabea. Erabili '--help' baliozko aukeren zerrenda ikusteko.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager-ek sortuta\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s(e)ndik batuta\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "ezin da netlink-en kudeaketa esleitu: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "ezin da netlink-ekin konektatu: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "ezin da netlink taldearekin elkartu: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "OHARRA: libc-en ebaztaileak ez du 3 izen-zerbitzari baino gehiago onartzen." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Azpian zerrendatutako izen-zenbitzariak ez dira ezagutuko." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "Sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Konexio partekatua babestutako haririk gabeko sarearen bidez" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Konexio partekatua irekitako haririk gabeko sarearen bidez" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Aldatu sistemako ostalari-izen iraunkorra" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Aldatu sistemako konexioak" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistemako arauek sistemako ezarpenak aldatzea saihesten dute" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistemako arauek sistemako ostalari-izen iraunkorra aldatzea saihesten dute" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Sistemako arauek babestutako haririk gabeko sareen bidez konexioak partekatzea saihesten dute" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Sistemako arauek irakitako haririk gabeko sareen bidez konexioak partekatzea saihesten dute" + diff --git a/po/fi.po b/po/fi.po new file mode 100644 index 00000000..43d3524c --- /dev/null +++ b/po/fi.po @@ -0,0 +1,328 @@ +# Finnish messages for NetworkManager +# Copyright (C) 2005-2008 Free Software Foundation Inc. +# This file is distributed under the same license as the NetworkManager package. +# +# Ilkka Tuohela , 2005-2008. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-11-29 20:22+0300\n" +"PO-Revision-Date: 2008-11-29 20:00+0300\n" +"Last-Translator: Ilkka Tuohela \n" +"Language-Team: Finnish \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" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM-avaintiedostossa ei ole loppumerkkiä \"%s\"." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Tämä ei näytä PEM-muotoiselta salaisen avaimen tiedostolta." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Muisti ei riitä PEM-tiedoston sisällön tallentamiseen." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Virheellinen PEM-tiedosto: ensimmäinen merkintä ei ollut Proc-Type." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Virheellinen PEM-tiedosto: tuntematon Proc-Type-merkintä \"%s\"." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Virheellinen PEM-tiedosto: DEK-Info ei ollut toinen merkintä." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Virheellinen PEM-tiedosto: alustusvektoria ei löytynyt DEK-Infosta." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Virheellinen PEM-tiedosto: alustusvektori DEK-Infossa on virheellinen." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Virheellinen PEM-tiedosto: tuntematon salaisen avaimen sifferi \"%s\"." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Salaista avainta ei voitu purkaa." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM-varmenne \"%s\" ei sisällä päätösmerkkiä \"%s\"." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Varmennetta ei voitu purkaa." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Muisti ei riitä varmenteen tietojen tallennukseen." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Muisti ei riitä tiedoston sisällön tallentamiseen." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "Alustusvektorin täytyy olla parillisen tavumäärän pituinen." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Muisti ei riitä alustusvektorin tallennukseen." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "Alustusvektori sisältää muita kuin heksadesimaalisia merkkejä." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:143 +#: ../libnm-util/crypto_nss.c:169 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Salaisen avaimen sifferi \"%s\" oli tuntematon." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Muisti ei riitä salaisen avaimen purkamiseen." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Salaisen avaimen tyyppiä ei voi selvittää." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Muisti ei riitä puretun salaisen avaimen tallennukseen." + +#: ../libnm-util/crypto_gnutls.c:46 +msgid "Failed to initialize the crypto engine." +msgstr "Salausmoottoria ei voitu alustaa." + +#: ../libnm-util/crypto_gnutls.c:90 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5-moottoria ei voitu alustaa: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:178 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Muisti ei riitä puretulle avainpuskurille." + +#: ../libnm-util/crypto_gnutls.c:160 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Virhe alustettaessa purkusifferin kontekstia: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:169 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Virhe asetettaessa symmetristä salausavainta: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:178 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Alustusvektoria purkua varten ei voitu alustaa: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:187 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Salaista avainta ei voitu purkaa: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Salaisen avaimen purku epäonnistui." + +#: ../libnm-util/crypto_gnutls.c:235 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Virhe alustettaessa varmenteen tietoja: %s" + +#: ../libnm-util/crypto_gnutls.c:257 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Varmennetta ei voitu purkaa: %s" + +#: ../libnm-util/crypto_gnutls.c:281 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12-tulkkia ei voitu alustaa: %s" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12-tiedostoa ei voitu purkaa: %s" + +#: ../libnm-util/crypto_gnutls.c:306 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12-tiedostoa ei voitu varmentaa: %s" + +#: ../libnm-util/crypto_nss.c:57 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Salausmoottoria ei voitu alustaa: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5-kontekstia ei voitu alustaa: %d." + +#: ../libnm-util/crypto_nss.c:186 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Salausmenetelmän lohkoa ei voitu alustaa." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Symmetristä salausavainta ei voitu asettaa." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Salauksen purun aloitusvektorin asetus epäonnistui." + +#: ../libnm-util/crypto_nss.c:214 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Salauksen purun kontekstia ei voitu alustaa." + +#: ../libnm-util/crypto_nss.c:227 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Salaista avainta ei voitu purkaa: %d." + +#: ../libnm-util/crypto_nss.c:239 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Salaisen avaimen salauksen purkua ei voitu viimeistellä: %d." + +#: ../libnm-util/crypto_nss.c:284 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Varmennetta ei voitu tulkita: %d" + +#: ../libnm-util/crypto_nss.c:319 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Salasanaa ei voitu muuntaa UCS2-muotoon: %d" + +#: ../libnm-util/crypto_nss.c:347 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12-tulkkia ei voitu alustaa: %d" + +#: ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12-tiedostoa ei voitu tulkita: %d" + +#: ../libnm-util/crypto_nss.c:365 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12-tiedostoa ei voitu varmistaa: %d" + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:454 +#, c-format +msgid "error processing netlink message: %s" +msgstr "virhe käsiteltäessä netlink-viestiä: %s" + +#: ../src/nm-netlink-monitor.c:251 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ei voitu varata netlink-kahvaa linkin tilan tarkkailulle: %s" + +#: ../src/nm-netlink-monitor.c:261 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"ei voitu yhdistää netlink-pistokkeeseen linkin tilan tarkkailua varten: %s" + +#: ../src/nm-netlink-monitor.c:269 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "ei voit liittyä netlink-ryhmään linkin tilan tarkkailua varten: %s" + +#: ../src/nm-netlink-monitor.c:277 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"ei voitu varata netlink-linkin välimuistia inkin tilan tarkkailua varten %s" + +#: ../src/nm-netlink-monitor.c:418 +#, c-format +msgid "error updating link cache: %s" +msgstr "virhe päivitettäessä linkkivälimuistia: %s" + +#: ../src/nm-netlink-monitor.c:484 +msgid "error occurred while waiting for data on socket" +msgstr "virhe odotettaessa tietoja pistokkeesta" + +#: ../src/NetworkManager.c:293 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Virheellinen valitsin: Antamalla --help näet luettelon kelvollisista\n" +"valitsimista.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:88 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManagerin luoma\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:94 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Yhdistetty tiedostosta %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:256 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "HUOMAUTUS: libc-nimenselvennys ei ehkä tue kuin kolmea nimipalvelinta." + +#: ../src/named-manager/nm-named-manager.c:258 +msgid "The nameservers listed below may not be recognized." +msgstr "Alla olevaa nimipalvelinluetteloa ei voitu tunnistaa." + +#: ../system-settings/src/main.c:380 +#, c-format +msgid "Auto %s" +msgstr "Auto-%s" + +#~ msgid "Not enough memory to create private key decryption key." +#~ msgstr "Muisti ei riitä luomaan salaisen avaimen purkuavainta." + +#~ msgid "Auto Wired" +#~ msgstr "Automaattinen kiinteä" diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 00000000..f7cd9a2f --- /dev/null +++ b/po/fr.po @@ -0,0 +1,1670 @@ +# translation of fr.po to French +# French translation of NetworkManager. +# Copyright (C) 2004-2008 The GNOME Foundation. +# This file is distributed under the same license as the NetworkManager package. +# +# +# Raphaël Tournoy , 2004. +# Stéphane Raimbault , 2006-2008. +# Jonathan Ernst , 2007. +# Robert-André Mauchin , 2007-2008. +# Sam Friedmann , 2010. +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 15:23+1000\n" +"Last-Translator: Sam Friedmann \n" +"Language-Team: French \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: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NOM" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "PÉRIPHÉRIQUES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "ÉTENDUE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DÉFAUT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Erreur : 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Erreur : 'con list': %s ; champs autorisés : %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Détails de connexion" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "système" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "utilisateur" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "jamais" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "oui" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "non" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Connexions système" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Connexions utilisateur" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Erreur : l'argument %s est manquant." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Erreur : %s - connexion introuvable." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Paramètre inconnu : %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Erreur : aucun paramètre valide spécifié." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Erreur : %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Erreur : 'con status' : %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Erreur : 'con status' : %s ; champs autorisés : %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Connexions actives" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "aucune connexion active sur le périphérique '%s'" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "aucune connexion active ou périphérique" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "périphérique '%s' incompatible avec la connexion '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "aucun périphérique trouvé pour la connexion '%s'" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "activation" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "activé" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "inconnu" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "Connexion VPN (préparation)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "Connexion VPN (authentification requise)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "Connexion VPN" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "Connexion VPN (obtention de la configuration IP)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN connecté" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "Échec de la connexion VPN" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN déconnecté" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "raison inconnue" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "aucun" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "l'utilisateur a été déconnecté" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "la connexion réseau de base a été interrompue" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "arrêt inattendu du service VPN" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "le service VPN a retourné une configuration invalide" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "le délai d'attente de la tentative de connexion a été dépassé" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "le service VPN n'a pas démarré à temps" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "échec du démarrage du service VPN" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "aucun secret VPN valide" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "secrets VPN invalides" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "la connexion a été supprimée" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "état : %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Connexion activée\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Erreur : Échec de l'activation de la connexion" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "état : %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Erreur : L'activation de la connexion a échoué : %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Erreur : Le délai d'attente de %d sec a expiré." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Erreur : L'activation de la connexion a échoué : %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Erreur : L'obtention d'une connexion active pour '%s' a échoué." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "État de connexion active : %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "État de chemin actif : %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Erreur : Connexion inconnue : %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Erreur : Valeur de délai d'attente '%s' invalide." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Erreur : ID ou UUID doit être spécifié." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Erreur : Aucun périphérique convenable trouvé : %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Erreur : Aucun périphérique convenable trouvé." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Avertissement : Connexion inactive\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Erreur : Commande 'con' '%s' invalide." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Erreur : impossible de connecter à D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Erreur : Paramètres système introuvables." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Erreur : Paramètres utilisteur introuvables." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Erreur : Impossible d'obtenir les connexions : les services des " +"paramètres ne sont pas en cours d'exécution." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "PÉRIPHÉRIQUE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "ÉTAT" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GÉNÉRAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITÉS" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "PROPRIÉTÉS-WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "PA" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "PROPRIÉTÉS-CABLÉES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "PARAMÈTRES-IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "DNS-IP4" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "PILOTE" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "DÉTECTION-OPÉRATEUR" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "VITESSE" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "OPÉRATEUR" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADRESSE" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PRÉFIXE" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "PASSERELLE" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "DÉBIT" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SÉCURITÉ" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "DRAPEAUX-WPA" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "DRAPEAUX-RSN" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIF" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "non-géré" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "indisponible" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "déconnecté" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "connexion (préparer)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "connexion (configuration)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "connexion (authentification requise)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "connexion (obtention de la configuration IP)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "connecté" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "échec de la connexion" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "Inconnu" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(aucun)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s : erreur lors de la conversion de l'adresse IP4 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u Mo/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Chiffré : " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infrastructure" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Erreur : 'dev list' : %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Erreur : 'dev list' : %s ; champs autorisés : %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Détails périphérique" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(inconnu)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "inconnu)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mo/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "marche" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "arrêt" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Erreur : 'dev status' : %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Erreur : 'dev status' : %s ; champs autorisés : %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Statut des périphériques" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Erreur : L'argument '%s' est manquant." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Erreur : Périphérique '%s' introuvable." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Opération réussie : Périphérique '%s' correctement déconnecté." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Erreur : Échec de la déconnexion du périphérique '%s' (%s) : %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "État du périphérique : %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Erreur : iface doit être spécifié." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Erreur : 'dev wifi' : %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Erreur : 'dev wifi' : %s ; champs autorisés : %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Liste du balayage WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Erreur : Point d'accès avec hwaddr '%s' introuvable." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Erreur : Le périphérique '%s' n'est pas un périphérique WiFi." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Erreur : Commande 'dev wifi' '%s' invalide." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Erreur : Commande 'dev' '%s' invalide." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "EN COURS D'EXÉCUTION" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "MATÉRIEL-WIFI" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "MATÉRIEL-WWAN" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "veille" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "connexion" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Erreur : 'nm status' : %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Erreur : 'nm status' : %s ; champs autorisés : %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "État de NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "activé" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "désactivé" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "actif" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "inactif" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Erreur : Valeur '--fields' '%s' est invalide ; champs autorisés : %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi activé" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Erreur : Paramètre 'wifi' invalide : '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN activé" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Erreur : Paramètre 'wwan' invalide : '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Erreur : Commande 'nm' '%s' invalide." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] sortie laconique\n" +" -p[retty] sortie formatée\n" +" -m[ode] tabular|multiline mode de sortie\n" +" -f[ields] |all|common spécifie les champs à sortir\n" +" -e[scape] yes|no échapper les séprateurs de colonnes dans les valeurs\n" +" -v[ersion] afficher la version du programme\n" +" -h[elp] imprimer l'aide\n" +"\n" +"OBJECT\n" +" nm statut de NetworkManager\n" +" con connexions de NetworkManager\n" +" dev périphériques gérés par NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Erreur : Objet '%s' inconnu, essayez 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Erreur : Option '--terse' est spécifiée la seconde fois." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Erreur : Option '--terse' est mutuellement exclusive avec '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Erreur : Option '--pretty' est spécifiée la seconde fois." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Erreur : Option '--pretty' est mutuellement exclusive avec '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Erreur : argument manquant pour l'option '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Erreur : '%s' est un argument invalide pour l'option '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Erreur : Les champs pour les options '%s' sont manquants." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "outil nmcli, version %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Erreur : Option '%s' inconnue, essayez 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Signal %d reçu, arrêt en cours..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Erreur : Impossible de connecter à NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Réussite" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit passphrase)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (inconnu)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (inconnu)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "any, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "non défini" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "champ '%s' doit être seul" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "champ '%s' invalide" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Option '--terse' requiert la spécification de '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Option '--terse' requiert des valeurs d'options '--fields' spécifiques, pas '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Le fichier de clé PEM n'a pas de balise de fin « %s »." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Cela ne semble pas être un fichier de clé privée PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Mémoire insuffisante pour contenir les données du fichier PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Fichier PEM incorrect : Proc-Type n'est pas la première balise." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Fichier PEM incorrect : étiquette Proc-Type « %s » inconnue." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Fichier PEM incorrect : DEK-Info n'est pas la deuxième balise." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Fichier PEM incorrect : aucun IV trouvé dans la balise DEK-Info." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Fichier PEM incorrect : format IV invalide dans la balise DEK-Info." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Fichier PEM incorrect : chiffre de clé privée « %s » inconnu." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Impossible de décoder la clé privée." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Le certificat PEM « %s » n'a pas de balise de fin « %s »." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Impossible de décoder le certificat." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Mémoire insuffisante pour contenir les données du certificat." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Mémoire insuffisante pour contenir les données du fichier." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "La longueur en octets d'IV doit être paire." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Mémoire insuffisante pour contenir l'IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "L'IV contient des chiffres non-hexadécimaux." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Le chiffre « %s » de la clé privée est inconnu." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Mémoire insuffisante pour contenir la clé privée déchiffrée." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Impossible de déterminer le type de la clé privée." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Mémoire insuffisante pour contenir la clé privée déchiffrée." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "L'initialisation du moteur de chiffrement a échoué." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "L'initialisation du moteur MD5 a échoué : %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Longueur IV invalide (minimum %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Mémoire insuffisante pour le tampon de clé déchiffrée." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "L'initialisation du contexte du chiffre de déchiffrement a échoué : %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "La définition de la clé symétrique pour le déchiffrement a échoué : %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "La définition d'IV pour le déchiffrement a échoué : %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Le déchiffrement de la clé privée a échoué : %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "" +"Le déchiffrement de la clé privée a échoué : Longueur de remplissage " +"inattendue." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Le déchiffrement de la clé privée a échoué." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Allocation de mémoire pour chiffrement impossible." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "" +"L'initialisation du contexte du cryptage de chiffrement a échoué : %s / " +"%s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "" +"La définition de la clé symétrique pour le chiffrement a échoué : %s / %" +"s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "La définition d'IV pour le chiffrement a échoué : %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Le chiffrement des données a échoué ; %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Erreur lors de l'initialisation des données du certificat : %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Impossible de décoder le certificat : %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "L'initialisation du décodeur PKCS#12 a échoué : %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Impossible de décoder le fichier PKCS#12 : %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Impossible de vérifier le fichier PKCS#12 : %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "L'initialisation du moteur de chiffrement a échoué : %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "L'initialisation du contexte MD5 a échoué : %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Longueur IV invalide (minimum %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "L'initialisation de l'emplacement du chiffre de déchiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "La définition de la clé symétrique pour le déchiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "La définition d'IV pour le déchiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "L'initialisation du contexte de déchiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Le déchiffrement de la clé privée a échoué : %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Le déchiffrement de la clé privée a échoué : les données déchiffrées " +"sont trop longues." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "La finalisation du déchiffrement de la clé privée a échoué : %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "L'initialisation de l'emplacement du cryptage de chiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "La définition de la clé symétrique pour le chiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "La définition d'IV pour le déchiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "L'initialisation du contexte de chiffrement a échoué." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Le chiffrement a échoué : %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Quantité de données inattendue après chiffrement." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Impossible de décoder le certificat : %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Impossible de convertir le mot de passe en UCS2 : %d." + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Impossible d'initialiser le décodeur PKCS#12 : %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Impossible de décoder le fichier PKCS#12 : %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Impossible de vérifier le fichier PKCS#12 : %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Impossible des données aléatoires." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Mémoire insuffisante pour créer une clé de chiffrement." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Allocation de mémoire pour la création du fichier PEM impossible." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Allocation de mémoire pour l'écriture d'IV sur le fichier PEM impossible." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Allocation de mémoire pour l'écriture de la clé chiffrée sur le fichier PEM " +"impossible." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Allocation de mémoire pour les données du fichier PEM impossible." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "erreur lors du traitement du message netlink : %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "une erreur est survenue pendant l'attente de données sur le connecteur" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"impossible de se connecter à netlink pour surveiller l'état de la " +"connexion : %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "impossible d'activer le passage de crédentiels de gestion netlink : %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"impossible d'allouer un gestionnaire netlink pour surveiller l'état de la " +"connexion : %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"impossible d'allouer un cache de connexion netlink pour surveiller l'état de " +"la connexion : %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "impossible de joindre le groupe netlink : %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "erreur lors de la mise à jour du cache de connexion : %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Option non valide. Utilisez --help pour afficher une liste d'options " +"valides.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Veuillez utiliser --help pour afficher une liste d'options valides.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Créé par NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Fusionné depuis %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "aucun client DHCP utilisable n'a pu être trouvé." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' a été trouvé.be found." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' introuvable." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "client DHCP '%s' non pris en charge" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Niveau de journalisation inconnu '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Domaine de journalisation inconnu '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"NOTE : il se peut que le solveur libc ne prenne pas en charge plus de 3 " +"serveurs de noms." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "Les serveurs de noms listés ci-dessous peuvent ne pas être reconnus." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "Système" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Partage de connexion via un réseau WiFi protégé" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Partage de connexion via un réseau WiFi ouvert" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modifier le nom d'hôte du système persistant" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modifier les connexions système" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "La stratégie du système empêche toute modification des paramètres du système" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"La stratégie du système empêche toute modification du nom d'hôte du système " +"persistant" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"La stratégie du système empêche tout partage des connexions via un réseau " +"WiFi protégé" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"La stratégie du système empêche tout partage des connexions via un réseau " +"WiFi ouvert" + diff --git a/po/gl.po b/po/gl.po new file mode 100644 index 00000000..ca5d3d53 --- /dev/null +++ b/po/gl.po @@ -0,0 +1,488 @@ +# translation of gl.po to Galego +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Ignacio Casal Quinteiro , 2007, 2008. +# Miguel Anxo Bouzada , 2010. +msgid "" +msgstr "" +"Project-Id-Version: gl\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-02-25 11:06+0100\n" +"Last-Translator: Miguel Anxo Bouzada \n" +"Language-Team: Galego \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "O ficheiro de chave PEM non ten a etiqueta de final «%s»." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Non parece un ficheiro de chave privada PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Non hai memoria abondo para almacenar o ficheiro PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Ficheiro PEM malformado: Proc-Type non é a primeira etiqueta." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Ficheiro PEM malformado: a etiqueta Proc-Type «%s »é descoñecida." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Ficheiro PEM malformado: Proc-Type non é a segunda etiqueta." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Ficheiro PEM malformado: non se atopou ningún IV na etiqueta DEK-Info" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Ficheiro PEM malformado: formato de IV incorrecto na etiqueta DEK-Info" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Ficheiro PEM malformado: o cifrado da chave privada «%s» é descoñecido" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Non puido ser decodificada a chave privada." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "O certificado PEM «%s» non ten unha etiqueta de final «%s»." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Fallou ao decodificar o certificado" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Non hai memoria abondo para almacenar os datos do certificado" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Non hai memoriaabondo para almacenar os datos do ficheiro" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV debe ter un número par de bytes en lonxitude." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Non hai memoria abondo para almacenar o IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV contén díxitos non hexadecimais." + +#: ../libnm-util/crypto.c:382 +#: ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 +#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "O cifrado «%s» da chave privada é descoñecido." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Non hai memoria abondo para descifrar esta chave privada." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Non foi posíbel determinar o tipo de chave privada" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Non hai memoria abondo para almacenar a chave privada descifrada." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Produciuse un erro ao iniciar o motor de cifrado" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Produciuse un erro ao iniciar a arquitectura MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Lonxitude de IV incorrecta (debe ser polo menos %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 +#: ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Non hai memoria abondo para o búfer da chave descifrada." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Produciuse un erro ao inicializar o contexto de cifrado para o descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Produciuse un erro ao establecer a chave simétrica para o descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Produciuse un erro ao establecer IV para o descifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Produciuse un erro ao descifrar a chave privada: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 +#: ../libnm-util/crypto_nss.c:266 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Produciuse un fallo ao descifrar a chave privada: lonxitude de desprazamento non esperada." + +#: ../libnm-util/crypto_gnutls.c:221 +#: ../libnm-util/crypto_nss.c:277 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Produciuse un erro ao descifrar a chave privada" + +#: ../libnm-util/crypto_gnutls.c:286 +#: ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Non foi posíbel asignar a memoria para cifrar." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Produciuse un erro ao inicializar o contexto da chave de cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Produciuse un erro ao establecer a chave simétrica para o cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Produciuse un erro ao establecer IV para o cifrado: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Produciuse un erro ao cifrar os datos: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Produciuse un erro ao iniciar a certificación dos datos: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Non se puido decodificar o certificado: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Non foi posíbel iniciar o decodificador PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Non foi posíbel decodificar o ficheiro PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Non foi posíbel verificar o ficheiro PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:57 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Produciuse un erro ao iniciar o motor de cifrado:%d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Produciuse un erro ao iniciar o contexto MD5: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Lonxitude de IV incorrecta (debe ser polo menos %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Produciuse un erro ao iniciar a rañura de cifrado para o descifrado" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Produciuse un erro ao establecer a chave simétrica para o descifrado." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Produciuse un erro ao establecer IV para o descifrado." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Produciuse un erro ao iniciar o contexto de descifrado." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Produciuse un erro ao descifrar a chave privada: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Produciuse un erro ao descifrar a chave privada: os datos descifrados son moi grandes." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Produciuse un erro ao finalizar o descifrado da chave privada: %d." + +#: ../libnm-util/crypto_nss.c:363 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Produciuse un erro ao inicializar a rañura da cifra de cifrado." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Produciuse un erro ao establecer a chave simétrica para o cifrado." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Produciuse un erro ao establecer IV para o cifrado." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Produciuse un erro ao inicializar o contexto de cifrado." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Produciuse un erro ao cifrar: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Tamaño non agardado de datos despois de cifrar." + +#: ../libnm-util/crypto_nss.c:446 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Non foi posíbel decodificar o certificado: %d" + +#: ../libnm-util/crypto_nss.c:481 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Non foi posíbel converter a chave a UCS2: %d" + +#: ../libnm-util/crypto_nss.c:509 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Non foi posíbel iniciar o decodificador PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:518 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Non fo posíbel decodificar o ficheiro PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:527 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Non foi posíbel verficar o ficheiro PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:556 +msgid "Could not generate random data." +msgstr "Non foi posíbel xerar datos aleatorios." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Sen memoria abondo para crear a chave de cifrado." + +#: ../libnm-util/nm-utils.c:1633 +msgid "Could not allocate memory for PEM file creation." +msgstr "Non foi posíbel asignar memoria para a creación do ficheiro PEM," + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Non foi posíbel asignar memoria para escribir IV no ficheiro PEM." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Non foi posíbel asignar memoria para escribir a chave cifrada no ficheiro PEM." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Non foi posíbel asignar memoria para os datos do ficheiro PEM." + +#: ../src/nm-netlink-monitor.c:194 +#: ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "produciuse un erro procesando a mensaxe netlink: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "non é posíbel crear o manexador netlink para monitorizar o estado da ligazón: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "non é posíbel conectar ao netlink para monitorizar o estado da lingazón: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "non é posíbel unir ao grupo netlink para monitorizar o estado da ligazón: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "non é posíbel asignar a ligazón á caché netlink para monitorizar o estado da ligazón: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "producouse un erro agardando por datos nun socket" + +#: ../src/nm-netlink-monitor.c:558 +#, c-format +#| msgid "error processing netlink message: %s" +msgid "error updating link cache: %s" +msgstr "produciuse un erro ao actualizar a caché de ligazóns: %s" + +#: ../src/NetworkManager.c:330 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Opción incorrecta. Use --help para ver a lista de opcións válidas.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "# Creado por NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Fusionado desde %s\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "non é posíbel asignar un manexador para a ligazon de rede: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "non é posíbel conectar coa ligazón de rede: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "non é posíbel unir ao grupo da ligazón de rede: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "NOTE: o importador libc non permite máis de 3 nomes de servidores." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Os nomes de servidores listados a seguir poden non ser recoñecidos" + +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +msgid "System" +msgstr "Sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Conexión compartida a través dunha rede WiFi protexida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Conexión compartida a través dunha rede WiFi aberta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modificar o nome persistente do anfitrión do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modificar as conexións do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "A política do sistema impide a modificación da configuración do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "A política do sistema impide a modificación do nome do anfitrión do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "A política do sistema impide compartir conexións a través dunha rede WiFi protexida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "A política do sistema impide compartir conexións a través dunha rede WiFi aberta" + diff --git a/po/gu.po b/po/gu.po new file mode 100644 index 00000000..83fba507 --- /dev/null +++ b/po/gu.po @@ -0,0 +1,1639 @@ +# translation of gu.po to Gujarati +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Ankit Patel , 2004. +# Sweta Kothari , 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: gu\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 14:38+0530\n" +"Last-Translator: Sweta Kothari \n" +"Language-Team: Gujarati\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"વપરાશ: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "ભૂલ: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ભૂલ: 'con list': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "જોડાણો વિગતો" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "સિસ્ટમ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "વપરાશકર્તા" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "કદી નહિં" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "હાં" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ના" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "સિસ્ટમ જોડાણો" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "વપરાશકર્તા જોડાણો" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ભૂલ: %s દલીલ ગેરહાજર છે." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Error: %s - આવા જોડાણ નથી." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "અજ્ઞાત પરિમાણ: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ભૂલ: યોગ્ય પરિમાણ સ્પષ્ટ થયેલ નથી." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ભૂલ: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ભૂલ: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ભૂલ: 'con status': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "સક્રિય જોડાણો" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ઉપકરણ '%s' પર સક્રિય જોડાણ નથી" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "સક્રિય જોડાણ અથવા ઉપકરણ નથી" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "ઉપકરણ '%s' એ જોડાણ '%s' સાથે સુસંગત નથી" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "જોડાણ '%s' માટે ઉપકરણ મળ્યુ નથી" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "સક્રિય કરી રહ્યા છે" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "સક્રિય થયેલ છે" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "અજ્ઞાત" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN જોડાઇ રહ્યુ છે (તૈયાર કરો)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN જોડાઇ રહ્યુ છે (સત્તાધિકરણની જરૂર છે)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN જોડાઇ રહ્યુ છે" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN જોડાઇ રહ્યુ છે (IP રૂપરેખાંકનને મેળવી રહ્યા છે)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN જોડાયેલ છે" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN જોડાણ નિષ્ફળ" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN જોડાણ તૂટી ગયુ" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "અજ્ઞાત કારણ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "કંઇ નહિં" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "વપરાશકર્તાનું જોડાણ તૂટી ગયુ હતુ" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "આધાર નેટવર્ક જોડાણ અવરોધેલ હતુ" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN સેવા અનિચ્છનિય રીતે બંધ થયેલ છે" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN સેવા એ અયોગ્ય રૂપરેખાંકનને પાછુ મેળવેલ છે" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "જોડાણનો પ્રયત્ન કરવાનો સમય સમાપ્ત થઇ ગયો" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN સેવા એ સમય પર શરૂ થઇ ન હતી" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "શરૂ કરતી વખતે VPN સેવા નિષ્ફળ" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "યોગ્ય VPN ખાનગીઓ નથી" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "અયોગ્ય VPN ખાનગીપણા" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "જોડાણને દૂર કરાયેલ હતુ" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "પરિસ્થિતિ: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "સક્રિય થયેલ જોડાણ\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ભૂલ: જોડાણ સક્રિય કરવાનું નિષ્ફળ." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "પરિસ્થિતિ: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ભૂલ: જોડાણ સક્રિય કરવાનું નિષ્ફળ: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ભૂલ: સમયસમાપ્તિ %d સેકંડ નો સમય સમાપ્ત થઇ ગયો." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ભૂલ: જોડાણ સક્રિય કરવાનું નિષ્ફળ: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ભૂલ: '%s' માટે સક્રિય જોડાણ પ્રાપ્ત કરવામાં નિષ્ફળતા." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "સક્રિય જોડાણ પરિસ્થિતિ: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "સક્રિય જોડાણ પાથ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ભૂલ: અજ્ઞાત જોડાણ: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ભૂલ: સમયસમાપ્તિ કિંમત '%s' યોગ્ય નથી." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ભૂલ: id અથવા uuid ને સ્પષ્ટ કરવુ જ પડશે." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ભૂલ: સુસંગત ઉપકરણ મળ્યુ નથી: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ભૂલ: સુસંગત ઉપકરણ મળ્યુ નથી." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "ચેતવણી: જોડાણ સક્રિય થયેલ નથી\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ભૂલ: 'con' આદેશ '%s' યોગ્ય નથી." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ભૂલ: D-Bus નું જોડાણ કરી શક્યા નહિં." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ભૂલ: સિસ્ટમ સુયોજનોને મેળવી શક્યા નથી." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ભૂલ: વપરાશકર્તા સુયોજનોને મેળવી શક્યા નથી." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ભૂલ: જોડાણોને પ્રાપ્ત કરી શકાતા નથી: સુયોજનો સેવાઓ ચાલી રહી નથી." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"વપરાશ: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "અસંચાલિત થયેલ" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "ઉપલબ્ધ નથી" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "તૂટેલ જોડાણ" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "જોડાઇ રહ્યા છે (તૈયાર કરો)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "જોડાઇ રહ્યા છે (રૂપરેખાંકિત કરી રહ્યા છે)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "જોડાઇ રહ્યા છે (સત્તાધિકરણની જરૂર છે)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "જોડાઇ રહ્યા છે (IP રૂપરેખાંકનને મેળવી રહ્યા છે)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "જોડાયેલ" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "જોડાણ નિષ્ફળ" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "અજ્ઞાત" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(કંઇ નહિં)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: ભૂલ એ IP4 સરનામા 0x%X માં રૂપાંતર થઇ રહી છે" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "એનક્રિપ્ટ થયેલ: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "ઇન્ફ્રાસ્ટ્રક્ચર" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ભૂલ: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ભૂલ: 'dev list': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ઉપકરણ વિગતો" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(અજ્ઞાત)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "અજ્ઞાત)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ચાલુ" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "બંધ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ભૂલ: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ભૂલ: 'dev status': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ઉપકરણોની પરિસ્થિતિ" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ભૂલ: '%s' દલીલ ગેરહાજર છે." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ભૂલ: ઉપકરણ '%s' મળ્યુ નથી." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "સફળ: ઉપકરણ '%s' નું સફળતાપૂર્વક જોડાણ તૂટી ગયુ." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ભૂલ: ઉપકરણ '%s' (%s) નું જોડાણ તૂટવામાં નિષ્ફળતા: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ઉપકરણ પરિસ્થિતિ: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ભૂલ: iface ને સ્પષ્ટ કરવુ જ પડશે." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ભૂલ: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ભૂલ: 'dev wifi': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi સ્કેન યાદી" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ભૂલ: hwaddr '%s' સાથે પ્રવેશ બિંદુ મળ્યુ નથી." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ભૂલ: ઉપકરણ '%s' એ WiFi ઉપકરણ નથી." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ભૂલ: 'dev wifi' આદેશ '%s' યોગ્ય નથી." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ભૂલ: 'dev' આદેશ '%s' યોગ્ય નથી." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"વપરાશ: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "સૂતેલું" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "જોડાઇ રહ્યા છે" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ભૂલ: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ભૂલ: 'nm status': %s; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager પરિસ્થિતિ" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "સક્રિય થયેલ" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "નિષ્ક્રિય થયેલ" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "ચાલી રહ્યુ છે" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "ચાલી રહ્યુ નથી" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ભૂલ: '--fields' કિંમત '%s' એ અહિંયા યોગ્ય નથી; માન્ય થયેલ ક્ષેત્રો: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi સક્રિય થયેલ" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ભૂલ: અયોગ્ય 'wifi' પરિમાણ: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN સક્રિય થયેલ" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ભૂલ: અયોગ્ય 'wwan' પરિમાણ: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ભૂલ: 'nm' આદેશ '%s' યોગ્ય નથી." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"વપરાશ: %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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ભૂલ: ઑબ્જેક્ટ '%s' અજ્ઞાત છે, 'nmcli help' નો પ્રયત્ન કરો." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ભૂલ: વિકલ્પ '--terse' એ બીજી વખત સ્પષ્ટ થયેલ છે." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ભૂલ: વિકલ્પ '--terse' એ '--pretty' સાથે પરસ્પર અનોખું છે." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ભૂલ: વિકલ્પ '--pretty' એ બીજી વખત સ્પષ્ટ થયેલ છે." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ભૂલ: વિકલ્પ '--pretty' એ '--terse' સાથે પરસ્પર અનોખું છે." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ભૂલ: '%s' વિકલ્પ માટે ગેરહાજર દલીલ." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ભૂલ: '%s' એ '%s' વિકલ્પ માટે યોગ્ય દલીલ નથી." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ભૂલ: '%s' વિકલ્પો માટે ક્ષેત્રો ગેરહાજર છે." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli સાધન, આવૃત્તિ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ભૂલ: વિકલ્પ '%s' એ અજ્ઞાત છે, 'nmcli -help' નો પ્રયત્ન કરો." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "સંકેત %d પકડ્યુ, બંધ કરી રહ્યા છે..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ભૂલ: NetworkManager નું જોડાણ કરી શક્યા નહિં." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "સફળ" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit પાસફ્રેઝ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (અજ્ઞાત)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (અજ્ઞાત)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "કોઇપણ, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "સ્વયં" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "સુયોજિત નથી" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "ક્ષેત્ર '%s' એ એકલુ હોવુ જ જોઇએ" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "અયોગ્ય ક્ષેત્ર '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "વિકલ્પ '--terse' ને '--fields' ની જરૂર છે" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "વિકલ્પ '--terse' ને ચોક્કસ '--fields' વિકલ્પ કિંમતોની જરૂર છે, '%s' ની નહિં" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM કી ફાઇલ પાસે છેલ્લો ટેગ '%s' ન હતો." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM ખાનગી કી ફાઇલ જેવી દેખાતી નથી." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ફાઇલ માહિતી ને સંગ્રહ કરવા માટે મેમરી પૂરતી નથી." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "મેલફોર્મ થયેલ PEM ફાઇલ: Proc-Type એ પહેલો ટેગ ન હતો." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "મેલફોર્મ થયેલ PEM ફાઇલ: અજ્ઞાત Proc-Type ટેગ '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "મેલફોર્મ થયેલ PEM ફાઇલ: DEK-Info એ બીજો ટેગ હતો નહિં." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "મેલફોર્મ થયેલ PEM ફાઇલ: IV એ DEK-Info ટેગમાં શોધાયુ નહિં." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "મેલફોર્મ થયેલ PEM ફાઇલ: DEK-Info ટેગમાં IV નું અયોગ્ય બંધારણ." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "મેલફોર્મ થયેલ PEM ફાઇલ: અજ્ઞાત ખાનગી કી સાઇફર '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "ખાનગી કીને ડિકોડ કરી શકાયુ નહિં." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM પ્રમાણપત્ર '%s' પાસે અંત ટેગ '%s' ન હતો." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "પ્રમાણપત્રને ડિકોડ કરવાનું નિષ્ફળ." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "પ્રમાણપત્ર માહિતીને સંગ્રહ કરવા માટે મેમરી પૂરતી નથી." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ફાઇલ માહિતીને સંગ્રહ કરવા માટે મેમરી પૂરતી નથી." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV એ લંબાઇમાં બાઇટોનું બેકી નંબર જ હોવુ જ જોઇએ." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV ને સંગ્રહ કરવા માટે પૂરતી મેમરી નથી." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV એ બિન-હેક્ઝાડેસિમલ આંકડાઓને સમાવે છે." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "ખાનગી કી સાઇફર '%s' એ અજ્ઞાત હતુ." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "ખાનગી કીને ડિક્રિપ્ટ કરવા માટે મેમરી પૂરતી નથી." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "ખાનગી કી પ્રકાર ને નક્કી કરવાનું નિષ્ફળ." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ડિક્રિપ્ટ થયેલ ખાનગી કીને સંગ્રહ કરવા માટે મેમરી પૂરતી નથી." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "ક્રિપ્ટો એંજિન ને પ્રારંભ કરવાનું નિષ્ફળ." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 એંજિનને પ્રારંભ કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "અયોગ્ય IV લંબાઇ (ઓછામાં ઓછી %zd હોવી જ જોઇએ)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "ડિક્રિપ્ટ થયેલ કી બફર માટે પૂરતી મેમરી નથી." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ડિક્રિપ્શન સાઇફર સંદર્ભને પ્રારંભ કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ડિક્રિપ્શન માટે સમપ્રમાણ કીને સુયોજિત કરવામાં નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "ડિક્રિપ્શન માટે IV ને સુયોજિત કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "ખાનગી કીને ડિક્રિપ્ટ કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ખાનગી કી ને ડિક્રિપ્ટ કરવાનું નિષ્ફળ: અનિચ્છનિય પેડિંગ લંબાઇ." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "ખાનગી કીને ડિક્રિપ્ટ કરવાનું નિષ્ફળ." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "એનક્રિપ્ટ કર્યા પછી મેમરીને ફાળવી શક્યા નહિં." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "એનક્રિપ્શન સાઇફર સંદર્ભને પ્રારંભ કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "એનક્રિપ્શન માટે સમપ્રમાણ કીને સુયોજિત કરવામાં નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "એનક્રિપ્શન માટે IV ને સુયોજિત કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "માહિતીને એનક્રિપ્ટ કરવાનું નિષ્ફળ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "પ્રમાણપત્ર માહિતીને પ્રારંભ કરતી વખતે ભૂલ: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "પ્રમાણપત્રને ડિકોડ કરી શકાયુ નહિં: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ડિકોડરને પ્રારંભ કરી શકાયુ નહિં: %s " + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ફાઇલને ડિકોડ કરી શકાયુ નહિં: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ફાઇલને ચકાસી શકાયુ નહિં: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "ક્રિપ્ટો એંજિનને પ્રારંભ કરવાનું નિષ્ફળ: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 સંદર્ભને પ્રારંભ કરવાનું નિષ્ફળ: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "અયોગ્ય IV લંબાઇ (ઓછામાં ઓછી %d હોવી જ જોઇએ)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ડિક્રિપ્શન સાઇફર સ્લોટને પ્રારંભ કરવાનું નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ડિક્રિપ્શન માટે સમપ્રમાણ કીને સુયોજિત કરવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ડિક્રિપ્શન માટે IV ને સુયોજિત કરવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ડિક્રિપ્શન સંદર્ભને આખરી રૂપ આપવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "ખાનગી કી ને ડિક્રિપ્ટ કરવાનું નિષ્ફળ: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "ખાનગી કીને ડિક્રિપ્ટ કરવાનું નિષ્ફળ: ડિક્રિપ્ટ થયેલ માહિતી ઘણી લાંબી છે." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "ખાનગી કીનાં ડિક્રિપ્શનનને આખરી રૂપ આપવાનું નિષ્ફળ: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "એનક્રિપ્શન સાઇફર સ્લોટને પ્રારંભ કરવાનું નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "એનક્રિપ્શન માટે સમપ્રમાણ કીને સુયોજિત કરવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "એનક્રિપ્શન માટે IV ને સુયોજિત કરવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "એનક્રિપ્શન સંદર્ભને પ્રારંભ કરવામાં નિષ્ફળ." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "એનક્રિપ્ટ કરવાનું નિષ્ફળ: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "એનક્રિપ્ટ કર્યા પછી માહિતીની અનિચ્છનિય સંખ્યા." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "પ્રમાણપત્રને ડિકોડ કરી શકાયુ નહિં: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "UCS2 માં પાસવર્ડને રૂપાંતરિત કરી શકાયુ નહિં: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ડિકોડરને પ્રારંભ કરી શકાયુ નહિં: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ફાઇલને ડિકોડ કરી શકાયુ નહિં: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ફાઇલને ચકાસી શકાયુ નહિં: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "રેન્ડમ માહિતી ને ઉત્પન્ન કરી શક્યા નહિં." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "એનક્રિપ્શન કીને બનાવવા માટે મેમરી પૂરતી નથી." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ફાઇલ બનાવવા માટે મેમરી ફાળવી શક્યા નહિંી પૂરતી નથી." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ફાઇલમાં IV ને લખવા માટે મેમરીને ફાળવી શક્યા નહિં." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ફાઇલમાં અનક્રિપ્ટ થયેલ કી ને લખવા માટે મેમરીને ફાળવી શક્યા નહિં." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ફાઇલ માહિતી માટે મેમરી ફાળવી શક્યા નહિં." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "નેટલિંક સંદેશ ને પ્રક્રિયા કરવામાં ભૂલ: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ભૂલ ઉદ્ભવી જ્યારે સોકેટ પર માહિતી માટે રાહ જોઇ રહ્યા હોય" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "કડી સ્થિતિને મોનિટર કરવા માટે નેટલિંકને જોડવામાં અસમર્થ: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "નેટલિંકને સંભાળવાનો શ્રેયને જવાનું સક્રિય કરવા માટે અસમર્થ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "કડી સ્થિતિને મોનિટર કરવા માટે નેટલિંકને સંભાળવાનું ફાળવવામાં અસમર્થ: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "કડી સ્થિતિને મોનિટર કરવા માટે નેટલિંક કડી કેશને ફાળવવામાં અસમર્થ: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "નેટલીંક જૂથ ને જોડાવવાનું અસમર્થ: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "કડી કેશને સુધારો કરતી વખતે ભૂલ: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "અયોગ્ય વિકલ્પ. મહેરબાની કરીને યોગ્ય વિકલ્પોની યાદી ને જોવા માટે --help ને વાપરો.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. મહેરબાની કરીને યોગ્ય વિકલ્પોની યાદીને જોવા માટે --help ને વાપરો.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# ને NetworkManager દ્દારા બનાવેલ છે\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# ને %s માંથી ભેગુ કરેલ છે\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ન વાપરી શકાય તેવુ DHCP ક્લાઇન્ટ મળી શકે છે." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' મળી શકે છે." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' મળી શકે છે." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "બિનઆધારભૂત DHCP ક્લાઇન્ટ '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "અજ્ઞાત લોગ સ્તર '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "અજ્ઞાત લોગ ડોમેઇન '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "નોંધ: libc સુધારનાર એ ૩ નામ સર્વરો કરતા વધારે આધારને સમાવી શકતુ નથી." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "નીચે યાદી થયેલ નામસર્વરો એ ઓળખી શકાતા નથી." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "%s સ્વયં કરો" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "સિસ્ટમ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "સુરક્ષિત થયેલ WiFi નેટવર્ક મારફતે જોડાણ વહેંચણી" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ખુલ્લા WiFi નેટવર્ક મારફતે જોડાણ વહેંચણી" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "નિરંતર સિસ્ટમ યજમાનનામને બદલો" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "સિસ્ટમ જોડાણોને બદલો" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "સિસ્ટમ પોલિસી એ સિસ્ટમ સુયોજનોનાં બદલાવને અટકાવે છે" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "સિસ્ટમ પોલિસી એ નિરંતર સિસ્ટમ યજમાનનામનાં બદલાવને અટકાવે છે" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "સિસ્ટમ પોલિસી એ સુરક્ષિત થયેલ WiFi નેટવર્ક મારફતે વહેંચણી જોડાણોને રોકી રહ્યા છે" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "સિસ્ટમ પોલિસી એ ખુલ્લા WiFi નેટવર્ક મારફતે વહેંચણી જોડાણોને રોકી રહ્યા છે" + diff --git a/po/he.po b/po/he.po new file mode 100644 index 00000000..821eb684 --- /dev/null +++ b/po/he.po @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Yair Hershkovitz, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: 1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-02-17 03:56+0000\n" +"PO-Revision-Date: 2008-02-17 03:56+0000\n" +"Last-Translator: Yair Hershkovitz \n" +"Language-Team: he\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/nm-netlink-monitor.c:188 ../src/nm-netlink-monitor.c:448 +#, c-format +msgid "error processing netlink message: %s" +msgstr "error processing netlink message: %s" + +#: ../src/nm-netlink-monitor.c:245 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "unable to allocate netlink handle for monitoring link status: %s" + +#: ../src/nm-netlink-monitor.c:255 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "unable to connect to netlink for monitoring link status: %s" + +#: ../src/nm-netlink-monitor.c:263 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "unable to join netlink group for monitoring link status: %s" + +#: ../src/nm-netlink-monitor.c:271 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "unable to allocate netlink link cache for monitoring link status: %s" + +#: ../src/nm-netlink-monitor.c:471 +msgid "error occurred while waiting for data on socket" +msgstr "error occurred while waiting for data on socket" + +#: ../src/NetworkManager.c:255 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Invalid option. Please use --help to see a list of valid options.\n" diff --git a/po/hi.po b/po/hi.po new file mode 100644 index 00000000..9b6c3f17 --- /dev/null +++ b/po/hi.po @@ -0,0 +1,1642 @@ +# translation of hi.po to Hindi +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Rajesh Ranjan , 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 15:23+0530\n" +"Last-Translator: Rajesh Ranjan \n" +"Language-Team: Hindi \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"\n" +"\n" +"\n" +"\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"प्रयोग: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "त्रुटि: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "त्रुटि: 'con list': %s; अनुमतिप्राप्त क्षेत्र: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "कनेक्शन्स विवरण" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "तंत्र" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "उपयोक्ता" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "कभी नहीं" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "हाँ" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "नहीं" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "सिस्टम कनेक्शन" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "उपयोक्ता कनेक्शन" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "त्रुटि: %s तर्क अनुपस्थित है." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "त्रुटि: %s - कोई ऐसा कनेक्शन नहीं." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "अज्ञात पैरामीटर: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "त्रुटि: कोई वैध पैरामीटर निर्दिष्ट नहीं." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "त्रुटि: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "त्रुटि: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "त्रुटि: 'con status': %s; अनुमतिप्राप्त क्षेत्र: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "सक्रिय कनेक्शन" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "युक्ति '%s' पर कोई सक्रिय कनेक्शन नहीं" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "कोई सक्रिय कनेक्शन या युक्ति नहीं" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "युक्ति '%s' '%s' के साथ संगत नहीं है" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "'%s' कनेक्शन के लिए कोई युक्ति नहीं मिला" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "सक्रिय कर रहा है" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "सक्रिय किया हुआ" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "अज्ञात" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN कनेक्टिंग (तैयार)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN कनेक्टिंग (सत्यापन जरूरी)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN कनेक्टिंग" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN कनेक्टिंग (IP विन्यास पा रहा है)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN कनेक्टेड" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN कनेक्शन विफल" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN डिसकनेक्टेंड" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "अज्ञात कारण" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "कुछ नहीं" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "उपयोक्ता डिसकनेक्ट किया गया था" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "मौलिक संजाल कनेक्शन में बाधा आई थी" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN सेवा अचानक रुक गई" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN सेवा ने अवैध विन्यास वापस किया" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "कनेक्शन प्रयास का समय समाप्त" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN सेवा समय पर आरंभ नहीं हुआ" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN सेवा आरंभ होने में विफल रहा" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "कोई वैध VPN गुप्त नहीं" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "अवैध VPN गुप्त" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "कनेक्शन हटाया गया था" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "स्थिति: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "कनेक्शन सक्रिय किया गया\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "त्रुटि: कनेक्शन सक्रिय किया जाना विफल." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "स्थिति: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "त्रुटि: कनेक्शन सक्रियकरण विफल: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "त्रुटि: समय समाप्ति %d सेकेंड में समाप्त." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "त्रुटि: कनेक्शन सक्रियकरण विफल: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "त्रुटि: '%s' के लिए सक्रिय कनेक्शन पा रहा है." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "सक्रिय कनेक्शन स्थिति: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "सक्रिय कनेक्शन पथ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "त्रुटि: अज्ञात कनेक्शन: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "त्रुटि: समय समाप्ति मान '%s' वैध नहीं है." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "त्रुटि: id या uuid को निर्दिष्ट किया जाना है." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "त्रुटि: कोई उपयुक्त युक्ति नहीं मिला: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "त्रुटि: कोई उपयुक्त युक्ति नहीं मिला." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "चेतावनी: कनेक्शन सक्रिय नहीं\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "त्रुटि: 'con' कमांड '%s' वैध नहीं है." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "त्रुटि: D-Bus से कनेक्ट नहीं कर पाया." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "त्रुटि: सिस्टम सेटिंग नहीं पा सका." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "त्रुटि: उपयोक्ता सेटिंग नहीं पा सका." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "त्रुटि: कनेक्शन नहीं पा सकता है: सेटिंग सेवा चल नहीं रही है." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"प्रयोग: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "अप्रबंधित" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "अनुपलब्ध" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "डिसकनेक्टेड" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "कनेक्टिंग (तैयार)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "कनेक्टिंग (विन्यस्त कर रहा है)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "कनेक्टिंग (सत्यापन जरूरी)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "कनेक्टिंग (IP विन्यास पा रहा है)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "कनेक्टेड" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "कनेक्शन विफल" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "अज्ञात" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(कोई नहीं)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 पता 0x%X को बदलने में त्रुटि" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "गोपित: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "एंटरप्राइज " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "तदर्थ" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "आधारभूत ढाँचा" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "त्रुटि: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "त्रुटि: 'dev list': %s; अनुमति प्राप्त क्षेत्र: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "युक्ति विवरण" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(अज्ञात)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "अज्ञात)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "चालू" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "बंद" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "त्रुटि: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "त्रुटि: 'dev status': %s; अनुमति प्राप्त क्षेत्र: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "युक्ति की स्थिति" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "त्रुटि: '%s' तर्क अनुपस्थित है." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "त्रुटि: युक्ति '%s' नहीं मिला." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "सफल: युक्ति '%s' सफलतापूर्वक डिसकनेक्डेड." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "त्रुटि: युक्ति '%s' (%s) डिसकनेक्टिंग विफल: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "युक्ति स्थिति: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "त्रुटि: iface को निर्दिष्टि करना है." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "त्रुटि: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "त्रुटि: 'dev wifi': %s; अनुमति प्राप्त क्षेत्र: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi स्कैन सूची" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Error: hwaddr '%s' के साथ पहुँच नहीं मिला." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "त्रुटि: युक्ति '%s' एक WiFi युक्ति नहीं है." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "त्रुटि: 'dev wifi' कमांड '%s' वैध नहीं है." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "त्रुटि: 'dev' कमांड '%s' वैध नहीं है." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"प्रयोग: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "जुड़ रहा है" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "त्रुटि: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "त्रुटि: 'nm status': %s; अनुमति प्राप्त क्षेत्र: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager स्थिति" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "सक्षम" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "अक्षम" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "कार्यशील" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "नहीं चल रहा है" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "त्रुटि: '--fields' मान '%s' यहाँ वैध नहीं है; अनुमति प्राप्त क्षेत्र हैं: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi सक्षम" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "त्रुटि: अवैध 'wifi' पैरामीटर: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN सक्रिय" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "त्रुटि: अवैध 'wwan' पैरामीटर: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "त्रुटि: 'nm' कमांड '%s' वैध नहीं है." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"प्रयोग: %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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "त्रुटि: वस्तु '%s' अज्ञात है, 'nmcli help' आजमाएँ." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "त्रुटि: विकल्प '--terse' ने दूसरी बार निर्दिष्ट किया है." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "त्रुटि: विकल्प '--terse' '--pretty' के साथ परस्पर वहिर्वेषी है." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "त्रुटि: विकल्प '--pretty' दूसरी बार निर्दिष्ट किया है." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "त्रुटि: विकल्प '--pretty' परस्पर वहिर्वेशी है '--terse' के साथ." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "त्रुटि: '%s' विकल्प के लिए अनुपस्थित तर्क." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "त्रुटि: '%s' '%s' विकल्प के लिए वैध तर्क नहीं है." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "त्रुटि: '%s' विकल्प के लिए क्षेत्र अनुपस्थित है." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli टूल, संस्करण %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "त्रुटि: विकल्प '%s' अज्ञात है, 'nmcli -help' आजमाएँ." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "संकेत %d पकड़ा, बंद कर रहा है..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "त्रुटि: NetworkManager से कनेक्ट नहीं कर सका." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "सफल" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-बिट पासफ्रेज)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (अज्ञात)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (अज्ञात)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "कोई, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "सेट नहीं" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "क्षेत्र '%s' को अलग रहना है" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "अवैध क्षेत्र '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "विकल्प '--terse' के लिए '--fields' निर्दिष्ट करना है" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "विकल्प '--terse' के लिए '--fields' विकल्प मान की जरूरत है, न कि '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM कुंजी फाइल के पास कोई अंत टैग '%s' नहीं है." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "एक PEM निजी कुंजी फाइल की तरह का नहीं दिखता है." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM फाइल डेटा जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "विरूपित PEM फाइल: Proc-Type पहला टैग नहीं था." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "विरूपित PEM फाइल: अज्ञात Proc-Type टैग '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "विरूपित PEM फाइल: DEK-Info दूसरा टैग नहीं था." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "विरूपित PEM फाइल: कोई IV DEK-Info टैग में नहीं मिला." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "विरूपित PEM फाइल: IV का अवैध प्रारूप DEK-Info टैग में." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "विरूपित PEM फाइल: अज्ञात निजी कुंजी साइफर '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "निजी कुंजी को विगोपित नहीं कर सका." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM प्रमाणपत्र '%s' के पास कोई अंत टैग '%s' नहीं है." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "प्रमाणपत्र विगोपित करने में विफल." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "प्रमाणपत्र आँकड़ा जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "फाइल आँकड़ा जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV की लंबाई में बाइट संख्या सम संख्या होनी चाहिए." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV गैर हेक्साडेसीमेल अंक समाहित करता है." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "निजी कुंजी साइफर '%s' अज्ञात था." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "निजी कुंजी गोपित करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "निजी कुंजी प्रकार निर्धारित करने में असमर्थ." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "विगोपित निजी कुंजी जमा करने के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "क्रिप्टो ईंजन आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 ईंजन आरंभीकृत करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "अवैध IV लंबाई (कम से कम %zd होना चाहिए)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "विगोपित कुंजी बफर के लिए पर्याप्त स्मृति नहीं." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "विगोपन साइफर संदर्भ को आरंभीकृत करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "गोपन के लिए सममितीय कुंजी सेट करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "IV को गोपन के लिए सेट करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "निजी कुंजी गोपित करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "निजी कुंजी गोपित करने में विफल: अप्रत्याशित पैडिंग लंबाई." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "निजी कुंजी गोपित करने में विफल." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "गोपन के लिए स्मृति आबंटित नहीं कर सका." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "गोपन साइफर संदर्भ को आरंभीकृत करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "गोपन के लिए सममितीय कुंजी सेट करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "IV को गोपन के लिए सेट करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "आँकड़ा गोपित करने में विफल: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "प्रमाणपत्र आँकड़ा आरंभीकृत करने में विफल: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "प्रमाणपत्र विगोपित नहीं कर सका: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 विगोपक आरंभीकृत नहीं कर सका: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 फाइल विगोपित नहीं कर सका: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 फाइल जाँच नहीं सका: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "क्रिप्टो ईंजन आरंभीकृत करने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 संदर्भ आरंभीकृत करने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "अवैध IV लंबाई (जरूर कम से कम %d होना चाहिए)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "विगोपन साइफर स्लॉट को आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "गोपन के लिए सममितीय कुंजी सेट करने में विफल." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "IV को गोपन के लिए सेट करने में विफल." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "गोपन संदर्भ आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "निजी कुंजी गोपित करने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "निजी कुंजी गोपित करने में विफल: विगोपित आँकड़ा काफी बड़ा है." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "निजी कुंजी के विगोपन को अंतिम रूप देने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "गोपन साइफर स्लाट आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "गोपन के लिए सममितीय कुंजी सेट करने में विफल." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "IV को गोपन के लिए सेट करने में विफल." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "गोपन संदर्भ आरंभीकृत करने में विफल." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "गोपित करने में विफल: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "गोपन के बाद आँकड़ा की अप्रत्याशित मात्रा." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "प्रमाणपत्र डिकोड नहीं कर सका: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "कूटशब्द को UCS2 में बदल नहीं सका: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 डिकोडर को आरंभीकृत नहीं कर सका: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 फाइल विगोपित नहीं कर सका: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 फाइल जाँच नहीं सका: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "क्रमहीन आँकड़ा बना नहीं सका." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "गोपन कुंजी बनाने के लिए पर्याप्त मात्रा में स्मृति नहीं." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM फाइल निर्माण के लिए स्मृति नहीं आबंटित कर सका." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IV से PEM फाइल में लिखने के लिए स्मृति नहीं आबंटित कर सका." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "गोपित कुंजी को PEM फाइल में लिखने के लिए स्मृति नहीं आबंटित कर सका." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM फाइल आँकड़ा के लिए स्मृति नहीं आबंटित कर सका." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink संदेश की प्रक्रिया में त्रुटि: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "सॉकेट पर आँकड़ा के लिए प्रतीक्षा करने के दौरान त्रुटि" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "नेटलिंक को मॉनिटरिंग लिंक स्थिति के लिए कनेक्ट करने में असमर्थ: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "नेटलिंक नियंत्रण श्रेय पासिंग सक्रिय करने में असमर्थ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "लिंक स्थिति मॉनिटर करने के लिए नेटलिंक नियंत्रण का आबंटित नहीं कर सका: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "नेटलिंक कैश को मॉनिटरिंग लिंक स्थिति के लिए आबंटित करने में असमर्थ: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "नेटलिंक समूह में शामिल होने में असमर्थ: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "लिंक कैश अद्यतन करने में त्रुटि: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "अवैध विकल्प. कृपया --help का उपयोग वैध विकल्प देने के लिए करें.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. कृपया --help का उपयोग वैध विकल्प देने के लिए करें.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# संजाल प्रबंधक द्वारा निर्मित\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"#%s से मिलाया गया\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "कोई प्रयोज्य DHCP क्लाइंट नहीं मिला." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' नहीं मिल सका." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' नहीं मिल सका." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "असमर्थित DHCP क्लाइंट '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "अज्ञात लॉग स्तर '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "अज्ञात लॉग डोमेन '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "नोट: libc समाधानकर्ता 3 नेमसर्वर से अधिक का समर्थन नहीं कर सकता है." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "नीचे सूची में दिया गया नेमसर्वर पहचाना नहीं जा सकता है." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "स्वतः %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "तंत्र" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "किसी संरक्षित WiFi संजाल के द्वारा कनेक्शन साझा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "किसी खुले WiFi संजाल के द्वारा कनेक्शन साझा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "स्थिर सिस्टम होस्टनेम को सुधारें" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "सिस्टम कनेक्शन सुधारें" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "सिस्टम नीति सिस्टम सेटिंग के रूपांतरण को रोकता है." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "सिस्टम नीति स्थिर सिस्टम होस्टनेम के रूपांतरण को रोकता है." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "किसी संरक्षित WiFi संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "किसी खुले WiFi संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है" + diff --git a/po/hr.po b/po/hr.po new file mode 100644 index 00000000..3ddfd37d --- /dev/null +++ b/po/hr.po @@ -0,0 +1,220 @@ +# NetworkManager +# Copyright (C) Red Hat, Inc. +# This file is distributed under the same license as the NetworkManager package. +# Tomislav Vujec , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-02-04 17:28+0100\n" +"PO-Revision-Date: 2005-02-04 01:08+0100\n" +"Last-Translator: Tomislav Vujec \n" +"Language-Team: Croatian \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" + +#: info-daemon/networks.glade:11 +msgid "Modify Wireless Networks" +msgstr "Postavke bežičnih mreža" + +#: info-daemon/networks.glade:92 +msgid "Wireless Networks:" +msgstr "Bežične mreže:" + +#: info-daemon/passphrase.glade:9 +msgid "Wireless Network Key Required" +msgstr "Potreban je ključ bežične mreže" + +#: info-daemon/passphrase.glade:52 +msgid "_Login to Network" +msgstr "_Prijava na mrežu" + +#: info-daemon/passphrase.glade:100 +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Potrebna je lozinka za bežičnu mrežu\n" +"\n" +"Za pristup mreži '%s', potrebna je lozinka ili ključ." + +#: info-daemon/passphrase.glade:129 panel-applet/essid.glade:246 +msgid "Key Type:" +msgstr "Tip ključa:" + +#: info-daemon/passphrase.glade:150 panel-applet/essid.glade:315 +msgid "" +"128-bit Passphrase (WEP)\n" +"Ascii Key (WEP)\n" +"Hex Key (WEP)" +msgstr "" +"128-bitna lozinka (WEP)\n" +"Slovčani ključ (WEP)\n" +"Heksadecimalni ključ (WEP)" + +#: info-daemon/passphrase.glade:181 +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:139 +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:149 +#: panel-applet/essid.glade:270 +msgid "Passphrase:" +msgstr "Lozinka:" + +#: info-daemon/passphrase.glade:209 panel-applet/essid.glade:203 +#: panel-applet/essid.glade:300 +msgid "*" +msgstr "*" + +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:142 +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:152 +msgid "Ascii Key:" +msgstr "Slovčani ključ" + +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:145 +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:155 +msgid "Hex Key:" +msgstr "Heksadecimalni ključ" + +#: info-daemon/NetworkManagerInfoVPN.c:157 +#, c-format +msgid "You must log in to access the private network %s" +msgstr "Prijava je potrebna za pristup na mrežu %s" + +#: panel-applet/NMWirelessApplet.c:313 +msgid "No network connection" +msgstr "Nema spoja na mrežu" + +#: panel-applet/NMWirelessApplet.c:318 +msgid "Wired network connection" +msgstr "Spoj na žičanu mrežu" + +#: panel-applet/NMWirelessApplet.c:323 +msgid "Connecting to a wired network..." +msgstr "Spajanje na žičanu mrežu..." + +#: panel-applet/NMWirelessApplet.c:332 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "Spoj na Ad-Hoc bežičnu mrežu" + +#: panel-applet/NMWirelessApplet.c:346 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "Spoj na bežičnu mrežu '%s' (%d%%)" + +#: panel-applet/NMWirelessApplet.c:351 +msgid "Wireless network connection" +msgstr "Spoj na bežičnu mrežu" + +#: panel-applet/NMWirelessApplet.c:356 +#, c-format +msgid "Connecting to wireless network '%s'..." +msgstr "Spajanje na bežičnu mrežu '%s'..." + +#: panel-applet/NMWirelessApplet.c:362 +msgid "NetworkManager is not running" +msgstr "NetworkManager nije pokrenut" + +#: panel-applet/NMWirelessApplet.c:367 +msgid "Scanning for wireless networks..." +msgstr "Potraga za bežičnim mrežama..." + +#: panel-applet/NMWirelessApplet.c:690 +msgid "Other Wireless Networks..." +msgstr "Ostale bežične mreže..." + +#: panel-applet/NMWirelessApplet.c:711 +msgid "Create new Wireless Network..." +msgstr "Stvori novu bečičnu mrežu..." + +#: panel-applet/NMWirelessApplet.c:821 +msgid "No network devices have been found" +msgstr "Nema mrežnih uređaja" + +#: panel-applet/NMWirelessApplet.c:939 +msgid "NetworkManager is not running..." +msgstr "NetworkManager nije pokrenut..." + +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:228 +msgid "Create new wireless network" +msgstr "Stvori novu bečičnu mrežu" + +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:229 +msgid "" +"Enter the ESSID and security settings of the wireless network you wish to " +"create." +msgstr "Unesi ESSID i sigurnosne postavke bežične mreže koju treba stvoriti." + +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:234 +msgid "Custom wireless network" +msgstr "Posebna bežična mreža" + +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:235 +msgid "Enter the ESSID of the wireless network to which you wish to connect." +msgstr "" +"Unesi ESSID i sigurnosne postavke bežične mreže na koju se treba spojiti." + +#. Reuse the above string to make the translators less angry. +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:316 +#: panel-applet/NMWirelessAppletOtherNetworkDialog.c:325 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"NetworkManager ne može naći potrebne datoteke (glade datoteka nije " +"pronađena)." + +#: panel-applet/essid.glade:53 +msgid "C_onnect" +msgstr "_Spoji se" + +#: panel-applet/essid.glade:132 +msgid "Wireless _adapter:" +msgstr "Bežični _uređaj:" + +#: panel-applet/essid.glade:172 +msgid "Wireless _Network:" +msgstr "Bežična _mreža:" + +#: panel-applet/essid.glade:337 +msgid "Connect with encryption enabled" +msgstr "Spoji se sa enkripcijom" + +#: panel-applet/menu-info.c:109 +#, c-format +msgid "Wired Network (%s)" +msgstr "Žičana mreža (%s)" + +#: panel-applet/menu-info.c:111 +msgid "Wired Network" +msgstr "Žičana mreža" + +#: panel-applet/menu-info.c:177 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Bežična mreža (%s)" +msgstr[1] "Bežične mreže (%s)" + +#: panel-applet/menu-info.c:179 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Bežična mreža" +msgstr[1] "Bežične mreže" + +#: panel-applet/menu-info.c:316 +msgid " (invalid Unicode)" +msgstr " (greška u unicodu)" + +#: examples/python/systray/eggtrayicon.c:111 +msgid "Orientation" +msgstr "Orjentacija" + +#: examples/python/systray/eggtrayicon.c:112 +msgid "The orientation of the tray." +msgstr "Orjentacija ladice." diff --git a/po/hu.po b/po/hu.po new file mode 100644 index 00000000..742cdb15 --- /dev/null +++ b/po/hu.po @@ -0,0 +1,493 @@ +# Hungarian translation of NetworkManager +# This file is distributed under the same license as the NetworkManager package. +# Copyright (C) 2005, Free Software Foundation. Inc. +# +# Gabor Kelemen , 2005, 2006, 2007, 2008, 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager master\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2010-01-03 14:57+0100\n" +"Last-Translator: Gabor Kelemen \n" +"Language-Team: Hungarian \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: KBabel 1.11.4\n" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "A PEM kulcsfájl nem rendelkezik „%s” zárócímkével." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Nem tűnik PEM személyes kulcs fájlnak." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Nincs elég memória a PEM fájl adatainak tárolásához." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Rosszul formázott PEM fájl: a Proc-Type nem az első címke." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Rosszul formázott PEM fájl: ismeretlen Proc-Type címke („%s”)." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Rosszul formázott PEM fájl: A DEK-Info nem a második címke." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Rosszul formázott PEM fájl: nem található IV a DEK-Info címkében." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Rosszul formázott PEM fájl: az IV formátuma érvénytelen a DEK-Info címkében." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Rosszul formázott PEM fájl: ismeretlen személyes kulcs titkosító: „%s”." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "A személyes kulcs nem fejthető vissza." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "A(z) „%s” PEM tanúsítvány nem tartalmaz záró „%s” címkét." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "A tanúsítvány visszafejtése meghiúsult." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Nincs elég memória a tanúsítvány adatainak tárolásához." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Nincs elég memória a fájl adatainak tárolásához." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "Az IV hosszának páros számú bájtnak kell lennie." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Nincs elég memória az IV tárolásához." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "Az IV nem hexadecimális számjegyeket tartalmaz." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "A(z) „%s” személyeskulcs-titkosító ismeretlen." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Nincs elég memória a személyes kulcs visszafejtéséhez." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "A személyes kulcs típusa nem határozható meg." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Nincs elég memória a visszafejtett személyes kulcs tárolásához." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "A titkosító alrendszer előkészítése meghiúsult." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Az MD5 alrendszer előkészítése meghiúsult: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Érvénytelen IV hossz (legalább %zd hosszúnak kell lennie)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Nincs elég memória a visszafejtett kulcspufferhez." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "A visszafejtési titkosító kontextusának előkészítése meghiúsult: %s /%s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "A szimmetrikus kulcs beállítása meghiúsult a visszafejtéshez: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Az IV beállítása meghiúsult a visszafejtéshez: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "A személyes kulcs visszafejtése meghiúsult: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:266 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "A személyes kulcs visszafejtése meghiúsult: váratlan kitöltéshossz." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:277 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "A személyes kulcs visszafejtése meghiúsult." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Nem sikerült memóriát foglalni a titkosításhoz." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "A titkosító kontextusának előkészítése meghiúsult: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "A szimmetrikus kulcs beállítása meghiúsult a titkosításhoz: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Az IV beállítása meghiúsult a titkosításhoz: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Az adatot nem sikerült titkosítani: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Hiba a tanúsítvány adatainak előkészítésekor: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "A tanúsítvány nem fejthető vissza: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "A PKCS#12 dekódoló nem készíthető elő: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "A PKCS#12 fájl nem fejthető vissza: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "A PKCS#12 fájl nem ellenőrizhető: %s" + +#: ../libnm-util/crypto_nss.c:57 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "A titkosító alrendszer előkészítése meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Az MD5 kontextus előkészítése meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Érvénytelen IV hossz (legalább %d hosszúnak kell lennie)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "A visszafejtési titkosítóhely előkészítése meghiúsult." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "A szimmetrikus kulcs nem állítható be a visszafejtéshez." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Az IV nem állítható be a visszafejtéshez." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "A visszafejtési kontextus előkészítése meghiúsult." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "A személyes kulcs visszafejtése meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "A személyes kulcs visszafejtése meghiúsult: a visszafejtett adatok túl nagyok." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "A személyes kulcs visszafejtésének befejezése meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:363 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "A titkosítóhely előkészítése meghiúsult." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "A szimmetrikus kulcs nem állítható be a titkosításhoz." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Az IV nem állítható be a titkosításhoz." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "A titkosítási kontextus előkészítése meghiúsult." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "A titkosítás meghiúsult: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Váratlan mennyiségű adat a titkosítás után." + +#: ../libnm-util/crypto_nss.c:446 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "A tanúsítvány nem fejthető vissza: %d" + +#: ../libnm-util/crypto_nss.c:481 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "A jelszó nem alakítható UCS2 formátumra: %d" + +#: ../libnm-util/crypto_nss.c:509 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "A PKCS#12 dekódoló nem készíthető elő: %d" + +#: ../libnm-util/crypto_nss.c:518 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "A PKCS#12 fájl nem fejthető vissza: %d" + +#: ../libnm-util/crypto_nss.c:527 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "A PKCS#12 fájl nem ellenőrizhető: %d" + +#: ../libnm-util/crypto_nss.c:556 +msgid "Could not generate random data." +msgstr "Nem sikerült a véletlen adatok előállítása." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Nincs elég memória titkosítási kulcs készítéséhez." + +#: ../libnm-util/nm-utils.c:1633 +msgid "Could not allocate memory for PEM file creation." +msgstr "Nem sikerült memóriát foglalni PEM fájl készítéséhez." + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Nem sikerült memóriát foglalni az IV írásához PEM fájlba." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Nem sikerült memóriát foglalni a titkosított kulcs PEM fájlba írásához." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Nem sikerült memóriát foglalni a PEM fájl adatainak." + +#: ../src/nm-netlink-monitor.c:194 ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "hiba a netlink üzenet feldolgozásakor: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"nem lehet netlink kezelőt lefoglalni a kapcsolat állapotának megfigyelése " +"érdekében: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"nem lehet kapcsolódni a netlinkhez a kapcsolat állapotának megfigyelése " +"érdekében: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"nem lehet csatlakozni a netlink csoporthoz a kapcsolat állapotának " +"megfigyelése érdekében: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"nem lehet netlink kapcsolat-gyorsítótárat lefoglalni a kapcsolat állapotának " +"megfigyelése érdekében: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "hiba lépett fel adatokra várakozás közben a foglalaton" + +#: ../src/nm-netlink-monitor.c:558 +#, c-format +msgid "error updating link cache: %s" +msgstr "hiba a kapcsolat gyorsítótárának frissítésekor: %s" + +#: ../src/NetworkManager.c:330 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Érvénytelen kapcsoló. Az érvényes kapcsolók listájáért használja a --help " +"kapcsolót.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "# Készítette a NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Összefésülve ebből: %s\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "nem lehet netlink kezelőt lefoglalni: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "nem lehet kapcsolódni a netlinkhez: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nem lehet csatlakozni a netlink csoporthoz: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "MEGJEGYZÉS: a libc feloldó nem támogat háromnál több névkiszolgálót." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Az alább felsorolt névkiszolgálók lehet, hogy nem kerülnek felismerésre." + +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "Automatikus %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +msgid "System" +msgstr "Rendszer" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Kapcsolatmegosztás védett WiFi hálózaton" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Kapcsolatmegosztás nyílt WiFi hálózaton" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Állandó rendszergépnév módosítása" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Rendszerkapcsolatok módosítása" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "A rendszer házirendje megakadályozza a rendszerbeállítások módosítását" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"A rendszer házirendje megakadályozza a rendszer állandó gépnevének " +"módosítását" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"A rendszer házirendje megakadályozza a kapcsolatok megosztását védett WiFi " +"hálózaton" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"A rendszer házirendje megakadályozza a kapcsolatok megosztását nyílt WiFi " +"hálózaton" + diff --git a/po/id.po b/po/id.po new file mode 100644 index 00000000..82d1f234 --- /dev/null +++ b/po/id.po @@ -0,0 +1,963 @@ +# Indonesian translation for network-manager +# Copyright (c) 2007 Rosetta Contributors and Canonical Ltd 2007 +# This file is distributed under the same license as the network-manager package. +# Andika Triwidada , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: network-manager\n" +"POT-Creation-Date: 2007-04-13 11:43+0000\n" +"PO-Revision-Date: 2007-04-21 11:10+0000\n" +"Last-Translator: Andika Triwidada \n" +"Language-Team: Indonesian \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-Rosetta-Export-Date: 2007-05-01 15:50:07+0000\n" + +#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:915 +#, c-format +msgid "Passphrase for wireless network %s" +msgstr "Frasa-kunci untuk jaringan nirkabel %s" + +#: ../gnome/applet/applet-dbus.c:265 +#, c-format +msgid "Connection to the wireless network '%s' failed." +msgstr "Koneksi ke jaringan nirkabel '%s' gagal." + +#: ../gnome/applet/applet-dbus.c:270 +msgid "Connection to the wired network failed." +msgstr "Koneksi ke jaringan berkabel gagal." + +#: ../gnome/applet/applet.c:184 +msgid "Error displaying connection information:" +msgstr "Kesalahan menampilkan informasi sambungan:" + +#: ../gnome/applet/applet.c:202 +msgid "Could not find some required resources (the glade file)!" +msgstr "" +"Tidak dapat menemukan beberapa sumberdaya yang diperlukan (berkas glade)!" + +#: ../gnome/applet/applet.c:213 +msgid "No active connections!" +msgstr "Tidak ada koneksi aktif!" + +#: ../gnome/applet/applet.c:234 +#, c-format +msgid "Wired Ethernet (%s)" +msgstr "Ethernet Berkabel (%s)" + +#: ../gnome/applet/applet.c:236 +#, c-format +msgid "Wireless Ethernet (%s)" +msgstr "Ethernet Nirkabel (%s)" + +#: ../gnome/applet/applet.c:332 ../gnome/applet/applet.c:358 +msgid "NetworkManager Applet" +msgstr "Applet NetworkManager" + +#: ../gnome/applet/applet.c:334 +msgid "" +"Copyright © 2004-2006 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"Hak Cipta © 2004-2006 Red Hat, Inc.\n" +"Hak Cipta © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:336 ../gnome/applet/applet.c:362 +msgid "" +"Notification area applet for managing your network devices and connections." +msgstr "" +"Applet wilayah notifikasi untuk mengelola perangkat dan koneksi jaringan." + +#: ../gnome/applet/applet.c:339 ../gnome/applet/applet.c:366 +msgid "translator-credits" +msgstr "Andika Triwidada , 2007." + +#: ../gnome/applet/applet.c:360 +msgid "" +"Copyright © 2004-2005 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"Hak Cipta © 2004-2005 Red Hat, Inc.\n" +"Hak Cipta © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:422 +msgid "VPN Login Failure" +msgstr "Kegagalan Login VPN" + +#: ../gnome/applet/applet.c:423 +#, c-format +msgid "Could not start the VPN connection '%s' due to a login failure." +msgstr "Tidak dapat memulai koneksi VPN '%s' karena sebuah kegagalan login." + +#: ../gnome/applet/applet.c:427 +msgid "VPN Start Failure" +msgstr "Kegagalan Memulai VPN" + +#: ../gnome/applet/applet.c:428 +#, c-format +msgid "" +"Could not start the VPN connection '%s' due to a failure launching the VPN " +"program." +msgstr "" +"Tidak dapat memulai koneksi VPN '%s' karena kegagalan menjalankan program " +"VPN." + +#: ../gnome/applet/applet.c:432 ../gnome/applet/applet.c:442 +msgid "VPN Connect Failure" +msgstr "Kegagalan Koneksi VPN" + +#: ../gnome/applet/applet.c:433 +#, c-format +msgid "Could not start the VPN connection '%s' due to a connection error." +msgstr "Tidak dapat memulai koneksi VPN '%s' karena kesalahan sambungan." + +#: ../gnome/applet/applet.c:437 +msgid "VPN Configuration Error" +msgstr "Kesalahan Konfigurasi VPN" + +#: ../gnome/applet/applet.c:438 +#, c-format +msgid "The VPN connection '%s' was not correctly configured." +msgstr "Koneksi VPN '%s' tidak dikonfigurasi dengan benar." + +#: ../gnome/applet/applet.c:443 +#, c-format +msgid "" +"Could not start the VPN connection '%s' because the VPN server did not " +"return an adequate network configuration." +msgstr "" +"Tidak dapat memulai koneksi VPN '%s' karena server VPN tidak mengembalikan " +"konfigurasi jaringan yang cukup." + +#: ../gnome/applet/applet.c:513 +msgid "VPN Login Message" +msgstr "Pesan Login VPN" + +#: ../gnome/applet/applet.c:737 ../gnome/applet/applet.c:2549 +#: ../gnome/applet/other-network-dialog.c:453 +#: ../gnome/applet/passphrase-dialog.c:228 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"Applet NetworkManager tidak dapat menemukan beberapa sumberdaya yang " +"diperlukan (berkas glade tidak ditemukan)." + +#: ../gnome/applet/applet.c:749 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "Perangkat jaringan \"%s (%s)\" tidak mendukung pelarikan nirkabel." + +#: ../gnome/applet/applet.c:757 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "Perangkat jaringan \"%s (%s)\" tidak mendukung deteksi link." + +#: ../gnome/applet/applet.c:903 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "Sedang menyiapkan perangkat %s untuk jaringan berkabel..." + +#: ../gnome/applet/applet.c:905 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "Menyiapkan perangkat %s untuk jaringan nirkabel '%s'..." + +#: ../gnome/applet/applet.c:913 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "Mengkonfigur perangkat %s untuk jaringan berkabel..." + +#: ../gnome/applet/applet.c:915 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "Sedang berupaya bergabung ke jaringan nirkabel '%s'..." + +#: ../gnome/applet/applet.c:923 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "Menunggu Kunci Jaringan untuk jaringan nirkabel '%s'..." + +#: ../gnome/applet/applet.c:931 ../gnome/applet/applet.c:941 +msgid "Requesting a network address from the wired network..." +msgstr "Meminta alamat jaringan dari jaringan berkabel..." + +#: ../gnome/applet/applet.c:933 ../gnome/applet/applet.c:943 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "Meminta sebuah alamat jaringan dari jaringan nirkabel '%s'..." + +#: ../gnome/applet/applet.c:951 +msgid "Finishing connection to the wired network..." +msgstr "Menyelesaikan koneksi ke jaringan berkabel..." + +#: ../gnome/applet/applet.c:953 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "Mengakhiri koneksi ke jaringan nirkabel '%s'..." + +#: ../gnome/applet/applet.c:1070 +msgid "NetworkManager is not running" +msgstr "NetworkManager tidak sedang jalan" + +#: ../gnome/applet/applet.c:1078 ../gnome/applet/applet.c:1864 +msgid "Networking disabled" +msgstr "Fungsi jaringan dimatikan" + +#: ../gnome/applet/applet.c:1083 +msgid "No network connection" +msgstr "Tidak ada koneksi jaringan" + +#: ../gnome/applet/applet.c:1088 +msgid "Manual network configuration" +msgstr "Konfigurasi jaringan manual" + +#: ../gnome/applet/applet.c:1090 +msgid "Wired network connection" +msgstr "Koneksi jaringan berkabel" + +#: ../gnome/applet/applet.c:1094 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "Telah tersambung ke jaringan nirkabel Ad-Hoc" + +#: ../gnome/applet/applet.c:1096 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "Koneksi jaringan nirkabel ke '%s' (%d%%)" + +#: ../gnome/applet/applet.c:1117 +#, c-format +msgid "VPN connection to '%s'" +msgstr "Koneksi VPN ke '%s'" + +#: ../gnome/applet/applet.c:1125 +#, c-format +msgid "VPN connecting to '%s'" +msgstr "Sedang menyambung VPN ke '%s\"" + +#: ../gnome/applet/applet.c:1555 +msgid "_Connect to Other Wireless Network..." +msgstr "Sambung ke Jaringan Nirkabel Lain..." + +#: ../gnome/applet/applet.c:1576 +msgid "Create _New Wireless Network..." +msgstr "Buat Jaringan Nirkabel Baru" + +#: ../gnome/applet/applet.c:1695 +msgid "_Manual configuration..." +msgstr "Konfigurasi manual..." + +#: ../gnome/applet/applet.c:1718 +msgid "_VPN Connections" +msgstr "Sambungan VPN" + +#: ../gnome/applet/applet.c:1763 +msgid "_Configure VPN..." +msgstr "Mengkonfigur VPN..." + +#: ../gnome/applet/applet.c:1767 +msgid "_Disconnect VPN..." +msgstr "Memutus VPN..." + +#: ../gnome/applet/applet.c:1789 +msgid "_Dial Up Connections" +msgstr "Koneksi Dial Up" + +#: ../gnome/applet/applet.c:1800 +#, c-format +msgid "Connect to %s..." +msgstr "Menyambung ke %s..." + +#: ../gnome/applet/applet.c:1806 +#, c-format +msgid "Disconnect from %s..." +msgstr "Memutus dari %s..." + +#: ../gnome/applet/applet.c:1856 +msgid "No network devices have been found" +msgstr "Tidak menemukan perangkat jaringan" + +#: ../gnome/applet/applet.c:2051 +msgid "NetworkManager is not running..." +msgstr "NetworkManager tidak sedang jalan..." + +#: ../gnome/applet/applet.c:2208 +msgid "Enable _Networking" +msgstr "Fungsikan Jaringan" + +#: ../gnome/applet/applet.c:2214 +msgid "Enable _Wireless" +msgstr "Fungsikan Nirkabel" + +#: ../gnome/applet/applet.c:2220 +msgid "Connection _Information" +msgstr "Informasi Koneksi" + +#: ../gnome/applet/applet.c:2231 +msgid "_Help" +msgstr "Bantuan" + +#: ../gnome/applet/applet.c:2240 +msgid "_About" +msgstr "_Ihwal" + +#: ../gnome/applet/applet.c:2708 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "" +"Applet NetworkManager tidak dapat menemukan beberapa sumberdaya yang " +"diperlukan. Tidak dapat melanjutkan.\n" + +#: ../gnome/applet/wireless-security-option.c:157 +msgid "Open System" +msgstr "Sistem Terbuka" + +#: ../gnome/applet/wireless-security-option.c:160 +msgid "Shared Key" +msgstr "Kunci Bersama" + +#: ../gnome/applet/wireless-security-option.c:208 +msgid "Automatic (Default)" +msgstr "Otomatis (Default)" + +#: ../gnome/applet/wireless-security-option.c:215 +msgid "AES-CCMP" +msgstr "AES-CCMP" + +#: ../gnome/applet/wireless-security-option.c:223 +msgid "TKIP" +msgstr "TKIP" + +#: ../gnome/applet/wireless-security-option.c:231 +msgid "Dynamic WEP" +msgstr "WEP Dinamis" + +#: ../gnome/applet/wso-none.c:53 +msgid "None" +msgstr "Tak Ada" + +#: ../gnome/applet/wso-wep-ascii.c:138 +msgid "WEP 64/128-bit ASCII" +msgstr "WEP ASCII 64/128-bit" + +#: ../gnome/applet/wso-wep-hex.c:135 +msgid "WEP 64/128-bit Hex" +msgstr "WEP Hex 64/128-bit" + +#: ../gnome/applet/wso-wep-passphrase.c:135 +msgid "WEP 128-bit Passphrase" +msgstr "Frasa-kunci WEP 128-bit" + +#: ../gnome/applet/wso-wpa-eap.c:237 +msgid "PEAP" +msgstr "PEAP" + +#: ../gnome/applet/wso-wpa-eap.c:238 +msgid "TLS" +msgstr "TLS" + +#: ../gnome/applet/wso-wpa-eap.c:239 +msgid "TTLS" +msgstr "TTLS" + +#: ../gnome/applet/wso-wpa-eap.c:247 ../src/nm-ap-security-wpa-eap.c:93 +#: ../src/nm-ap-security-wpa-eap.c:117 +msgid "WPA2 Enterprise" +msgstr "WPA2 Enterprise" + +#: ../gnome/applet/wso-wpa-eap.c:249 ../src/nm-ap-security-wpa-eap.c:95 +#: ../src/nm-ap-security-wpa-eap.c:122 +msgid "WPA Enterprise" +msgstr "WPA Enterprise" + +#: ../gnome/applet/wso-wpa-psk.c:178 +msgid "WPA2 Personal" +msgstr "WPA2 Personal" + +#: ../gnome/applet/wso-wpa-psk.c:180 +msgid "WPA Personal" +msgstr "WPA Personal" + +#: ../gnome/applet/eggtrayicon.c:134 +msgid "Orientation" +msgstr "Orientasi" + +#: ../gnome/applet/eggtrayicon.c:135 +msgid "The orientation of the tray." +msgstr "Orientasi dari tray" + +#: ../gnome/applet/menu-items.c:88 +#, c-format +msgid "Wired Network (%s)" +msgstr "Jaringan Berkabel (%s)" + +#: ../gnome/applet/menu-items.c:91 +msgid "_Wired Network" +msgstr "Jaringan Berkabel" + +#: ../gnome/applet/menu-items.c:162 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Jaringan Nirkabel (%s)" + +#: ../gnome/applet/menu-items.c:164 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Jaringan Nirkabel" + +#: ../gnome/applet/menu-items.c:343 +msgid " (invalid Unicode)" +msgstr " (Unicode yang salah)" + +#: ../gnome/applet/other-network-dialog.c:352 +#, c-format +msgid "" +"By default, the wireless network's name is set to your computer's name, %s, " +"with no encryption enabled" +msgstr "" +"Secara default, nama jaringan nirkabel disamakan dengan nama komputer anda, " +"%s, tanpa enkripsi" + +#: ../gnome/applet/other-network-dialog.c:358 +msgid "Create new wireless network" +msgstr "Buat jaringan nirkabel baru" + +#: ../gnome/applet/other-network-dialog.c:359 +msgid "" +"Enter the name and security settings of the wireless network you wish to " +"create." +msgstr "" +"Masukkan nama dan pengaturan keamanan dari jaringan nirkabel yang akan anda " +"buat." + +#: ../gnome/applet/other-network-dialog.c:363 +msgid "Create New Wireless Network" +msgstr "Buat Jaringan Nirkabel Baru" + +#: ../gnome/applet/other-network-dialog.c:368 +msgid "Existing wireless network" +msgstr "Jaringan nirkabel yang telah ada" + +#: ../gnome/applet/other-network-dialog.c:369 +msgid "Enter the name of the wireless network to which you wish to connect." +msgstr "Masukkan nama jaringan nirkabel yang ingin anda hubungi." + +#: ../gnome/applet/other-network-dialog.c:371 +msgid "Connect to Other Wireless Network" +msgstr "Menyambung ke Jaringan Nirkabel Lain" + +#: ../gnome/applet/passphrase-dialog.c:215 +msgid "Error connecting to wireless network" +msgstr "Kesalahan menyambung ke jaringan nirkabel" + +#: ../gnome/applet/passphrase-dialog.c:216 +msgid "" +"The requested wireless network requires security capabilities unsupported by " +"your hardware." +msgstr "" +"Jaringan nirkabel yang diminta memerlukan kapabilitas keamanan yang tidak " +"didukung oleh perangkat keras anda." + +#: ../gnome/applet/vpn-password-dialog.c:151 +#: ../gnome/applet/vpn-password-dialog.c:188 +#, c-format +msgid "Cannot start VPN connection '%s'" +msgstr "Tidak dapat memulai sambungan VPN '%s'" + +#: ../gnome/applet/vpn-password-dialog.c:154 +#, c-format +msgid "" +"Could not find the authentication dialog for VPN connection type '%s'. " +"Contact your system administrator." +msgstr "" +"Tidak dapat menemukan dialog autentikasi untuk koneksi VPN tipe '%s'. " +"Hubungi administrator sistem anda." + +#: ../gnome/applet/vpn-password-dialog.c:191 +#, c-format +msgid "" +"There was a problem launching the authentication dialog for VPN connection " +"type '%s'. Contact your system administrator." +msgstr "" +"Ada masalah ketika menjalankan dialog autentikasi untuk koneksi VPN tipe " +"'%s'. Hubungi administrator sistem anda." + +#: ../gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: ../gnome/applet/applet.glade.h:2 +msgid "" +"Active Connection Information" +msgstr "" +"Informasi Sambungan Aktif" + +#: ../gnome/applet/applet.glade.h:4 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network " +"'%s'." +msgstr "" +"Frasa-kunci Diperlukan oleh Jaringan " +"Nirkabel" + +#: ../gnome/applet/applet.glade.h:8 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" +"Fungsionalitas Jaringan yang " +"Dikurangi\n" +"\n" +"%s Ini tidak akan fungsional secara lengkap." + +#: ../gnome/applet/applet.glade.h:12 +#, no-c-format +msgid "" +"Wireless Network Login " +"Confirmation\n" +"\n" +"You have chosen to log in to the wireless network '%s'. If you are sure " +"that this wireless network is secure, click the checkbox below and " +"NetworkManager will not require confirmation on subsequent log ins." +msgstr "" +"Konfirmasi Login Jaringan " +"Nirkabel\n" +"\n" +"Anda telah memilih untuk login ke jaringan nirkabel '%s'. Bila anda yakin " +"bahwa jaringan nirkabel ini aman, klik checkbox di bawah dan NetworkManager " +"akan tidak meminta konfirmasi pada login berikutnya." + +#: ../gnome/applet/applet.glade.h:15 +msgid "Anonymous Identity:" +msgstr "Identitas Anonim:" + +#: ../gnome/applet/applet.glade.h:16 +msgid "Authentication:" +msgstr "Autentikasi:" + +#: ../gnome/applet/applet.glade.h:17 +msgid "Broadcast Address:" +msgstr "Alamat Broadcast:" + +#: ../gnome/applet/applet.glade.h:18 +msgid "CA Certificate File:" +msgstr "Berkas Sertifikat CA:" + +#: ../gnome/applet/applet.glade.h:19 +msgid "C_onnect" +msgstr "Sambung" + +#: ../gnome/applet/applet.glade.h:20 +msgid "Client Certificate File:" +msgstr "Berkas Sertifikat Klien:" + +#: ../gnome/applet/applet.glade.h:21 +msgid "Connection Information" +msgstr "Informasi Koneksi" + +#: ../gnome/applet/applet.glade.h:22 +msgid "Default Route:" +msgstr "Route Default:" + +#: ../gnome/applet/applet.glade.h:23 +msgid "Destination Address:" +msgstr "Alamat Tujuan:" + +#: ../gnome/applet/applet.glade.h:24 +msgid "Driver:" +msgstr "Driver:" + +#: ../gnome/applet/applet.glade.h:25 +msgid "EAP Method:" +msgstr "Metoda EAP:" + +#: ../gnome/applet/applet.glade.h:26 +msgid "Hardware Address:" +msgstr "Alamat Perangkat Keras:" + +#: ../gnome/applet/applet.glade.h:27 +msgid "IP Address:" +msgstr "Alamat IP:" + +#: ../gnome/applet/applet.glade.h:28 +msgid "Identity:" +msgstr "Identitas:" + +#: ../gnome/applet/applet.glade.h:29 +msgid "Interface:" +msgstr "Antarmuka:" + +#: ../gnome/applet/applet.glade.h:30 +msgid "Key Type:" +msgstr "Tipe Kunci:" + +#: ../gnome/applet/applet.glade.h:31 +msgid "Key:" +msgstr "Kunci:" + +#: ../gnome/applet/applet.glade.h:32 +msgid "" +"None\n" +"WEP 128-bit Passphrase\n" +"WEP 64/128-bit Hex\n" +"WEP 64/128-bit ASCII\n" +msgstr "" +"Tidak ada\n" +"Frasa-kunci WEP 128-bit\n" +"WEP Hex 64/128-bit\n" +"WEP ASCII 64/128-bit\n" + +#: ../gnome/applet/applet.glade.h:37 +msgid "" +"Open System\n" +"Shared Key" +msgstr "" +"Sistem Terbuka\n" +"Kunci Bersama" + +#: ../gnome/applet/applet.glade.h:39 +msgid "Other Wireless Network..." +msgstr "Jaringan Nirkabel Lain..." + +#: ../gnome/applet/applet.glade.h:40 +msgid "Passphrase:" +msgstr "Frasa-kunci:" + +#: ../gnome/applet/applet.glade.h:41 +msgid "Password:" +msgstr "Kata sandi:" + +#: ../gnome/applet/applet.glade.h:42 +msgid "Primary DNS:" +msgstr "DNS Utama:" + +#: ../gnome/applet/applet.glade.h:43 +msgid "Private Key File:" +msgstr "Berkas Kunci Privat:" + +#: ../gnome/applet/applet.glade.h:44 +msgid "Private Key Password:" +msgstr "Kata sandi Kunci Privat:" + +#: ../gnome/applet/applet.glade.h:45 +msgid "Secondary DNS:" +msgstr "DNS Sekunder" + +#: ../gnome/applet/applet.glade.h:46 +msgid "Select the CA Certificate File" +msgstr "Pilih Berkas Sertifikat CA" + +#: ../gnome/applet/applet.glade.h:47 +msgid "Select the Client Certificate File" +msgstr "Pilih Berkas Sertifikat Klien" + +#: ../gnome/applet/applet.glade.h:48 +msgid "Select the Private Key File" +msgstr "Pilih Berkas Kunci Privat" + +#: ../gnome/applet/applet.glade.h:49 +msgid "Show key" +msgstr "Tampilkan Kunci" + +#: ../gnome/applet/applet.glade.h:50 +msgid "Show passphrase" +msgstr "Tampilkan frasa-kunci" + +#: ../gnome/applet/applet.glade.h:51 +msgid "Show password" +msgstr "Tampilkan kata sandi" + +#: ../gnome/applet/applet.glade.h:52 +msgid "Show passwords" +msgstr "Tampilkan kata sandi" + +#: ../gnome/applet/applet.glade.h:53 +msgid "Speed:" +msgstr "Kecepatan:" + +#: ../gnome/applet/applet.glade.h:54 +msgid "Subnet Mask:" +msgstr "Mask Subnet:" + +#: ../gnome/applet/applet.glade.h:55 +msgid "Type:" +msgstr "Tipe:" + +#: ../gnome/applet/applet.glade.h:56 +msgid "User Name:" +msgstr "Nama Pemakai:" + +#: ../gnome/applet/applet.glade.h:57 +msgid "Wireless Network Key Required" +msgstr "Kunci Jaringan Nirkabel Dibutuhkan" + +#: ../gnome/applet/applet.glade.h:58 +msgid "Wireless _adapter:" +msgstr "Adaptor Nirkabel:" + +#: ../gnome/applet/applet.glade.h:59 +msgid "_Always Trust this Wireless Network" +msgstr "Selalu Percayai Jaringan Nirkabel ini" + +#: ../gnome/applet/applet.glade.h:60 +msgid "_Don't remind me again" +msgstr "Jangan mengingatkan saya lagi" + +#: ../gnome/applet/applet.glade.h:61 +msgid "_Login to Network" +msgstr "_Login ke Jaringan" + +#: ../gnome/applet/applet.glade.h:62 +msgid "_Network Name:" +msgstr "_Nama Jarigan:" + +#: ../gnome/applet/applet.glade.h:63 +msgid "_Wireless Security:" +msgstr "Keamanan Nirkabel:" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:383 +msgid "Cannot add VPN connection" +msgstr "Tidak dapat menambah koneksi VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:385 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"Tidak ada perangkat lunak VPN yang sesuai yang dapat ditemukan di sistem " +"anda. Hubungi administrator sistem anda." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:437 +msgid "Cannot import VPN connection" +msgstr "Tidak dapat meng-impor koneksi VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:439 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" +"Tidak dapat menemukan perangkat lunak untuk koneksi VPN tipe '%s' untuk meng-" +"impor berkas '%s'. Hubungi administrator sistem anda." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:579 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "Kesalahan dalam mengambil koneksi VPN '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:582 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "" +"Tidak dapat menemukan berkas UI untuk koneksi VPN tipe '%s'. Hubungi " +"administrator sistem anda." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:739 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "Hapus koneksi VPN \"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:742 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"Semua informasi tentang koneksi VPN \"%s\" akan hilang dan anda mungkin " +"memerlukan administrator sistem anda untuk mendapatkan informasi untuk " +"membuat koneksi baru." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:959 +msgid "Unable to load" +msgstr "Tidak dapat memuat" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:961 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "" +"Tidak dapat menemukan beberapa sumberdaya yang diperlukan (berkas glade)!" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:1071 +msgid "Edit VPN Connection" +msgstr "Sunting Koneksi VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "Tambah koneksi VPN baru" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Choose which type of VPN connection you wish to create." +msgstr "Pilih tipe koneksi VPN yang ingin anda buat" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "Connect to:" +msgstr "Menyambung ke:" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Create VPN Connection" +msgstr "Buat Koneksi VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Create VPN Connection - 1 of 2" +msgstr "Buat Koneksi VPN - 1 dari 2" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Create VPN Connection - 2 of 2" +msgstr "Buat Koneksi VPN - 2 dari 2" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Delete the selected VPN connection" +msgstr "Hapus koneksi VPN yang dipilih" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "E_xport" +msgstr "Ekspor" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:9 +msgid "Edit the selected VPN connection" +msgstr "Sunting koneksi VPN yang dipilih" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:10 +msgid "Export the VPN settings to a file" +msgstr "Ekspor pengaturan VPN ke sebuah berkas" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:11 +msgid "Export the selected VPN connection to a file" +msgstr "Ekspor koneksi VPN yang dipilih ke sebuah berkas" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:12 +msgid "Finish Creating VPN Connection" +msgstr "Mengakhiri Pembuatan Koneksi VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:13 +msgid "Manage Virtual Private Network Connections" +msgstr "Kelola Koneksi Virtual Private Network" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:14 +msgid "" +"This assistant will guide you through the creation of a connection to a " +"Virtual Private Network (VPN).\n" +"\n" +"It will require some information, such as IP addresses and secrets. Please " +"see your system administrator to obtain this information." +msgstr "" +"Pemandu ini akan membantu anda dalam pembuatan koneksi ke sebuah Virtual " +"Private Network (VPN).\n" +"Dia akan memerlukan beberapa informasi, seperti misalnya alamat IP dan " +"rahasia-rahasia. Silahkan menemui administrator sistem untuk memperoleh " +"informasi ini." + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:17 +msgid "VPN Connections" +msgstr "Koneksi VPN" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "WEP 40-bit" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "WEP 104-bit" + +#: ../src/nm-ap-security-wpa-psk.c:50 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:52 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:54 +msgid "WPA Automatic" +msgstr "WPA Otomatis" + +#: ../src/nm-ap-security-wpa-psk.c:59 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:61 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:63 +msgid "WPA2 Automatic" +msgstr "WPA2 Otomatis" + +#: ../src/nm-ap-security.c:321 +msgid "none" +msgstr "tidak ada" + +#: ../src/nm-netlink-monitor.c:163 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"tidak dapat membuat soket netlink untuk mengamati perangkat ethernet - %s" + +#: ../src/nm-netlink-monitor.c:181 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"tidak dapat mem-bind ke soket netlink untuk mengamati perangkat ethernet - %s" + +#: ../src/nm-netlink-monitor.c:414 +msgid "operation took too long" +msgstr "operasi memakan waktu terlalu lama" + +#: ../src/nm-netlink-monitor.c:511 +msgid "received data from wrong type of sender" +msgstr "menerima data dari pengirim bertipe salah" + +#: ../src/nm-netlink-monitor.c:524 +msgid "received data from unexpected sender" +msgstr "menerima data dari pengirim yang tak diharapkan" + +#: ../src/nm-netlink-monitor.c:655 +msgid "too much data was sent over socket and some of it was lost" +msgstr "" +"terlalu banyak data yang telah dikirim lewat soket dan sebagian diantaranya " +"hilang" + +#: ../src/nm-netlink-monitor.c:744 +msgid "error occurred while waiting for data on socket" +msgstr "kesalahan terjadi ketika menunggu data pada soket" + +#: ../gnome/applet/applet-dbus-devices.c:898 +#, c-format +msgid "You are now connected to the Ad-Hoc wireless network '%s'." +msgstr "Anda sekarang terhubung ke jaringan nirkabel Ad-Hoc `%s'." + +#: ../gnome/applet/applet-dbus-devices.c:903 +#, c-format +msgid "You are now connected to the wireless network '%s'." +msgstr "Anda sekarang terhubung ke jaringan nirkabel '%s'." + +#: ../gnome/applet/applet-dbus-devices.c:910 +msgid "You are now connected to the wired network." +msgstr "Anda sekarang tersambung ke jaringan berkabel." + +#: ../gnome/applet/applet-dbus-devices.c:916 +msgid "Connection Established" +msgstr "Sambungan Terjalin" + +#: ../gnome/applet/applet-dbus-devices.c:959 +msgid "Disconnected" +msgstr "Terputus" + +#: ../gnome/applet/applet-dbus-devices.c:960 +msgid "The network connection has been disconnected." +msgstr "Koneksi jaringan telah diputus." diff --git a/po/it.po b/po/it.po new file mode 100644 index 00000000..5c61af0a --- /dev/null +++ b/po/it.po @@ -0,0 +1,1667 @@ +# translation of it.po to +# Italian translation for NetworkManager +# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 THE NetworkManager CopyRight Holder +# This file is distributed under the same license as the NetworkManager package. +# Francesco Marletta , 2004, 2005, 2006, 2007, 2008, 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: it\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:47+1000\n" +"Last-Translator: \n" +"Language-Team: \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: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NOME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DISPOSITIVI" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPO" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "PREDEFINITO" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "SERVIZIO-DBUS" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OGGETTO" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TIPO" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REALE" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNESSIONE" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "SOLO LETTURA" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Utilizzo: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Errore: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Errore: 'con list': %s; campi permessi: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Informazioni sulla connessione" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "sistema" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "utente" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "mai" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "si" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "no" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Connessioni di sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Connessioni utente" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Errore: l'argomento %s è mancante." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Errore: %s - la connessione non esiste." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parametro sconosciuto: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Errore: Non è stato specificato alcun parametro valido." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Errore: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Errore: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Errore: 'con status': %s; campi permessi: %s" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Connessioni attive" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "nessuna connessione attiva sul dispositivo '%s'" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "nessuna connessione attiva o dispositivo" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "dispositivo '%s' non compatibile con la connessione '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "nessun dispositivo trovato per la connessione '%s'" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "attivazione in corso" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "attivato" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "sconosciuto" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "Connessione VPN (preparazione)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "Connessione VPN (autenticazione necessaria)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "connessione VPN" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "Connessione VPN (acquisizione configurazione IP)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "Connesso al VPN" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "Connessione VPN fallita" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN scollegato" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "motivo sconosciuto" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "nessuno" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "l'utente è stato scollegato" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "la connessione di rete di base è stata interrotta" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "il servizio VPN si è arrestato inaspettatamente" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "il servizio VPN ha ritornato una configurazione non valida" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "il tentativo di connessione è scaduto" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "il servizio VPN non si è stato avviato in tempo" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "l'avvio del servizio VPN è fallito" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "nessun segreto VPN valido" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "segreti VPN non validi" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "la connessione è stata rimossa" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "stato: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Connessione attivata\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Errore: Attivazione connessione fallita." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stato: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Errore: Attivazione connessione fallita: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Errore: Timeout, %d sec scaduti." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Errore: Attivazione connessione fallita: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Errore: Ottenimento connessione attiva per '%s' fallita." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stato connessione attiva: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Percorso connessione attiva: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Errore: Connessione sconosciuta: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Errore: il valore di timeout '%s' non è valido." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Errore: specificare id o uuid." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Errore: Nessun dispositivo idoneo trovato: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Errore: Nessun dispositivo idoneo trovato." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Attenzione: Connessione non attiva\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Errore: il comando 'con' '%s' non è valido." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Errore: impossibile collegarsi a D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Errore: Impossibile ottenere le impostazioni del sistema." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Errore: Impossibile ottenere le impostazioni dell'utente." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Errore: Impossibile ottenere le connessioni: i servizi per le impostazioni " +"non sono in esecuzione." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DISPOSITIVO" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATO" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERALE" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPACITÀ" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "PROPRIETÀ-WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "PROPRIETÀ-CABLATO" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IMPOSTAZIONI-IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "RILEVAMENTO-CARRIER" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "VELOCITÀ" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "INDIRIZZO" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFISSO" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODALITÀ" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "TASSO DI TRASFERIMENTO" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SEGNALE" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SICUREZZA" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ATTIVO" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Utilizzo: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "non gestito" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "non disponibile" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "scollegato" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "connessione in corso (preparazione)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "connessione in corso (configurazione)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "connessione in corso (autenticazione necessaria)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "connessione in corso (acquisizione configurazione IP)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "collegato" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "connessione fallita" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "Sconosciuto" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(nessuno)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: errore nella conversione dell'indirizzo IP4 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Cifrato: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infrastruttura" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Errore: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Errore: 'dev list': %s; campi permessi: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Informazioni del dispositivo" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(sconosciuto)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "sconosciuto)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "on" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "off" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Errore: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Errore: 'dev status': %s; campi permessi: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Stato dispositivo" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Errore: L'argomento '%s' è mancante." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Errore: Dispositivo '%s' non trovato." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Successo: Dispositivo '%s' scollegato con successo." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Errore: Scollegamento dispositivo '%s' (%s) fallito: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stato dispositivo: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Errore: specificare iface." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Errore: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Error: 'dev wifi': %s; campi permessi: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Elenco scansione WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Errore: Punto di accesso con hwaddr '%s' non trovato." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Errore: Il dispositivo '%s' non è un dispositivo WiFi." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Errore: il comando 'dev wifi' '%s' non è valido." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Errore: il comando 'dev' '%s' non è valido." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "IN ESECUZIONE" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Utilizzo: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "dormiente" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "connessione" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Errore: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Errore: 'nm status': %s; campi permessi: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Stato NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "abilitato" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "disabilitato" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "in esecuzione" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "non in esecuzione" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Errore: qui il valore '--fields' '%s' non è valido; campi permessi: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi abilitato" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Errore: parametro 'wifi' non valido: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN abilitato" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Errore: parametro 'wwan' non valido: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Errore: comando 'nm' '%s' non valido." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Utilizzo: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] output dettagliato\n" +" -p[retty] output formattato\n" +" -m[ode] tabular|multiline modalità output\n" +" -f[ields] |all|common specifica campi sull'output\n" +" -e[scape] yes|no esegue l'escape dei separatori delle colonne " +"nei valori\n" +" -v[ersion] mostra la versione del programma\n" +" -h[elp] stampa questo aiuto\n" +"\n" +"OBJECT\n" +" nm stato NetworkManager\n" +" con connessioni NetworkManager\n" +" dev dispositivi gestiti da NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Errore: L'oggetto '%s' è sconosciuto, prova 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Errore: L'opzione '--terse' è stata specificata una seconda volta." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Errore: L'opzione '--terse' si esclude con '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Errore: L'opzione '--pretty' è stata specificata una seconda volta." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Errore: L'opzione '--pretty' si esclude con '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Errore: argomento mancante per l'opzione '%s'." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Errore: '%s' non è un argomento valido per l'opzione '%s'." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Errore: i campi per le opzioni '%s' sono mancanti." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "tool nmcli, versione %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Errore: L'opzione '%s' è sconosciuta, prova 'nmcli -help'." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Catturato segnale %d, arresto in corso..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Errore: Impossibile collegarsi al NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Successo" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (frase di accesso a 104/128-bit)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (sconosciuto)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (sconosciuto)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "qualsiasi, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "auto" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "non impostato" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "il campo '%s' deve essere isolato" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "campo '%s' invalido" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Con l'opzione '--terse' è necessario specificare '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "L'opzione '--terse' necessita valori dell'opzione '--fields' specifici, non '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Il file di chiave PEM non ha tag di chiusura \"%s\"" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Non sembra un file di chiave privata PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Memoria non sufficiente per memorizzare i dati del file PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "File PEM malformato: Proc-Type non è il primo tag." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "File PEM malformato: tag Proc-Type \"%s\" sconosciuto." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "File PEM malformato: DEK-Info non è il secondo tag." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "File PEM malformato: IV non trovato nel tag DEK-Info." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "File PEM malformato: formato di IV nel tag DEK-Info non valido." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "File PEM malformato: cifrario chiave privata \"%s\" sconosciuto." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Impossibile decodificare la chiave privata." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Il certificato PEM \"%s\" non ha il tag di chiusura \"%s\"." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Decodifica del certificato fallita." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Memoria non sufficiente per archiviare i dati del certificato." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Memoria non sufficiente per archiviare i dati del file." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV deve essere lungo un numero pari di byte." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Memoria non sufficiente per archiviare l'IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV contiene cifre non esadecimali." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Il cifrario di chiave privata \"%s\" è sconosciuto." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Memoria non sufficiente per decifrare la chiave privata." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Impossibile stabilire il tipo di chiave privata." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Memoria non sufficiente per archiviare la chiave privata decifrata." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Inizializzazione del motore di cifratura fallita." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Inizializzazione del motore MD5 fallita: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Lunghezza IV non valida (deve avere almento %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Memoria non sufficiente per il buffer della chiave decifrata." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Inizializzazione del contesto di decifrazione fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Impostazione della chiave simmetrica per la decifrazione fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Impostazione di IV per la decifrazione fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Decifrazione della chiave privata fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "" +"Impossibile decifrare la chiave privata: lunghezza spazio di riempimento non " +"previsto." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Decifrazione della chiave privata fallita." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Impossibile assegnare memoria per la cifratura." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Inizializzazione contesto del cifratore fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Impostazione della chiave simmetrica per la codifica fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Impostazione di IV per la cifratura fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Cifratura dati fallita: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Errore nell'inizializzare i dati dei certificati: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Impossibile decodificare il certificato: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Impossibile inizializzare il decodificatore PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Impossibile decodificare il file PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Impossibile verificare il file PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Inizializzazione del motore di cifratura fallita: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Inizializzazione del contesto MD5 fallita: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Lunghezza di IV non valida (deve avere almeno %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Inizializzazione dello slot del decifratore fallita." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Impostazione della chiave simmetrica di decifrazione fallita." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Impostazione di IV per la decifrazione fallita." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Inizializzazione del contesto di decifrazione fallita." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Decifrazione della chiave privata fallita: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Decodifica della chiave privata fallita: i dati decifrati sono troppo lunghi." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Finalizzazione della decifrazione della chiave privata fallita: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Inizializzazione dello slot del cifratore fallita." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Impostazione della chiave simmetrica di cifratura fallita." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Impostazione di IV per la cifratura fallita." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Inizializzazione del contesto di cifratura fallita." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Cifratura fallita: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Quantità di dati non prevista dopo la cifratura." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Impossibile decodificare il certificato: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Impossibile convertire la password in UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Impossibile inizializzare il decodificatore PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Impossibile decodificare il file PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Impossibile verificare il file PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Impossibile generare dati randomici." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Memoria non sufficiente per creare la chiave di cifratura." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Impossibile assegnare memoria per la creazione del file PEM." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Impossibile assegnare memoria per la scrittura di IV sul file PEM." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Impossibile assegnare memoria per la scrittura della chiave cifrata sul file " +"PEM." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Impossibile assegnare memoria per i dati del file PEM." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "errore nell'elaborare il messaggio netlink: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "si è verificato un errore durante l'attesa dei dati sul socket" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "impossibile collegarsi a netlink per monitorare lo stato del collegamento: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "impossibile abilitare il passaggio delle credenziali handle netlink: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"impossibile allocare un handle netlink per monitorare lo stato del " +"collegamento: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"impossibile allocare la cache dei collegamenti netlink per monitorare lo " +"stato del collegamento: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "impossibile unirsi a un gruppo netlink: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "errore nell'aggiornare la cache dei link: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Opzione non valida. Usare --help per ottenere un elenco delle opzioni " +"valide.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Usare --help per ottenere un elenco di opzioni valide.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Creato da NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Unito da %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "non è stato trovato alcun client DHCP utilizzabile." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "è stato trovato 'dhclient'" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "è stato trovato 'dhcpcd'" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "client DHCP '%s' non supportato" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Livello log '%s' sconosciuto" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Dominio log '%s' sconosciuto" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "NOTA: il risolutore libc non supporta più di 3 server di nomi." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "I server di nomi elencati sotto non possono essere riconosciuti." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "%s (automatica)" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "Sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Condivide connessione attraverso una rete WiFi protetta" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Condivide connessione attraverso una rete WiFi aperta" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modifica il nome host persistente del sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modifica le connessioni di sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "La politica di sistema impedisce di modificare le impostazioni di sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"La politica di sistema impedisce di modificare il nome host persistente del " +"sistema" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"La politica di sistema impedisce di condividere connessioni attraverso una " +"rete WiFi protetta" + +# [NdT] si tratta di un messaggio che descrive un'azione +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"La politica di sistema impedisce di condividere connessioni attraverso una " +"rete WiFi aperta" + diff --git a/po/ja.po b/po/ja.po new file mode 100644 index 00000000..dad75523 --- /dev/null +++ b/po/ja.po @@ -0,0 +1,1641 @@ +# translation of ja.po to Japanese +# Japanese translation for NetworkManager +# Copyright (C) 2005 Dan Williams +# This file is distributed under the same license as the NetworkManager package. +# +# Satoru SATOH , 2005-2007. +# Kiyoto Hashida , 2010. +msgid "" +msgstr "" +"Project-Id-Version: ja\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 16:04+0900\n" +"Last-Translator: Kiyoto Hashida \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: Plural-Forms: nplurals=1; plural=0;\n\n" +"\n" +"\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "名前" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "デバイス" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "範囲" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "デフォルト" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-サービス" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "スペックオブジェクト" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "タイプ" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "タイムスタンプ" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "タイムスタンプ-リアル" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "自動接続" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "読み込み専用" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"使用法: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "エラー:'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "エラー:'con list': %s ; 許可されるフィールド: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "接続の詳細" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "システム" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ユーザー" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "しない" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "はい" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "いいえ" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "システム接続" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ユーザー接続" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "エラー: %s 引数がありません。" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "エラー: %s - そのような接続はありません。" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "不明なパラメータ: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "エラー: 有効なパラメータが指定されていません。" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "エラー: %s" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "エラー: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "エラー: 'con status': %s ; 許可されるフィールド: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "アクティブな接続" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "デバイス '%s'上にアクティブな接続がありません" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "アクティブな接続、又はデバイスがありません" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "デバイス '%s' は接続 '%s' と互換性がありません" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "接続 '%s'用のデバイスが見付かりません" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "アクティベート中" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "アクティベート済み" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "不明" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN 接続(準備)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN 接続(認証が必要)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN 接続" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN 接続(IP 設定を取得)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN 接続済み" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN 接続失敗" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN 切断済み" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "不明な理由" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "なし" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ユーザーの接続が切断されました。" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "基本ネットワーク接続が妨害されました。" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN サービスが予期しない停止をしました" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN サービスは無効な設定を返しました" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "接続試行は時間切れです" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN サービスは時間内に開始していません" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN サービスの開始は失敗しました" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "有効な VPN シークレットはありません" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "無効な VPN シークレット" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "接続は削除されました" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "状態: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "接続はアクティベート済み\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "エラー: 接続のアクティベーションに失敗" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "状態: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "エラー: 接続のアクティベーションに失敗: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "エラー: 制限時間の %d 秒が経過" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "エラー: 接続のアクティベーションに失敗: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "エラー: '%s'用のアクティブ接続の取得に失敗" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "アクティブ接続の状態: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "アクティブ接続のパス: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "エラー: 不明な接続: %s" + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "エラー: 制限時間値の '%s' は有効でありません" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "エラー: id か又は uuid の指定が必要です" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "エラー: 適切なデバイスが見付かりません: %s" + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "エラー: 適切なデバイスが見付かりません" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "警告: 接続はアクティブでありません\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "エラー: 'con' コマンド '%s' は有効ではありません" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "エラー: D-Bus に接続できませんでした" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "エラー: システム設定を取得できませんでした" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "エラー: ユーザー設定を取得できませんでした" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "エラー: 接続を取得できません: 設定サービスが稼働していません" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "デバイス" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "状態" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "全般" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "能力" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-プロパティ" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "有線接続-プロパティ" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-セッティング" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "ドライバー" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "キャリア検出" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "速度" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "キャリア" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "アドレス" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "接頭辞" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "ゲートウェイ" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "モード" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "周波数" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "レート" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "信号" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "セキュリティ" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-フラグ" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-フラグ" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "アクティブ" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"使用法: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "管理無し" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "利用不可" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "切断済み" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "接続中(準備)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "接続中(設定中)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "接続中(認証が必要)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "接続中(IP 設定を取得中)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "接続済み" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "接続に失敗" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "不明" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(なし)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 アドレス 0x%X を変換中にエラー発生" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "暗号化:" + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "アドホック" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "インフラストラクチャ" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "エラー: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "エラー: 'dev list': %s; 許可されるフィールド: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "デバイスの詳細" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(不明)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "不明)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "オン" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "オフ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "エラー: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "エラー: 'dev status': %s; 許可されるフィールド: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "デバイスのステータス" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "エラー: '%s' 引数がありません。" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "エラー: デバイス'%s' が見付かりません" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "成功: デバイス '%s' は正常に切断されました。" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "エラー: デバイス '%s' (%s) の切断に失敗しました: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "デバイスの状態: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "エラー: iface を指定する必要があります。" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "エラー: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "エラー: 'dev wifi': %s; 許可されるフィールド: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi スキャン一覧" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "エラー: hwaddr '%s' のアクセスポイントが見付かりません" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "エラー: デバイス '%s' は WiFi デバイスではありません。" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "エラー: 'dev wifi' コマンド '%s' は無効です。" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "エラー: 'dev' コマンド '%s' は無効です。" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "実行中" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI ハードウェア" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN ハードウェア" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"使用法: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "休止中" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "接続中" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "エラー: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "エラー: 'nm status': %s; 許可されるフィールド: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager のステータス" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "有効" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "無効" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "実行中" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "実行していません" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "エラー: '--fields' の値 '%s' はここでは有効ではありません; 許可されるフィールド: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi は有効です" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "エラー: 無効な'wifi' パラメータ: '%s'" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN は有効です" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "エラー: 無効な'wwan' パラメータ: '%s'" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "エラー: 'nm' コマンド '%s' は無効です。" + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"使用法: %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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "エラー: オブジェクト '%s' は不明です。'nmcli help' を試して下さい。" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "エラー: オプション '--terse' は2回目の指定です。" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "エラー: オプション '--terse' は '--pretty' と相互に独占的です。" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "エラー: オプション '--pretty' は2回目の指定です。" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "エラー: オプション '--pretty' は '--terse' と相互に独占的です。" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "エラー: %s オプション用の引数がありません。" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "エラー: '%s' は '%s' オプション用の有効な引数ではありません。" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "エラー: '%s' オプション用のフィールドがありません。" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli ツール、バージョン %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "エラー: オプション '%s' は不明です、'nmcli -help' を試して下さい。" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "シグナル %d が出ました、シャットダウンします..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "エラー: NetworkManager へ接続出来ませんでした。" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "成功" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit パスフレーズ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (不明)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (不明)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "いずれでも、" + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "自動" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "セットされていません" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "フィールド '%s' は孤立する必要があります" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "無効なフィールド '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "オプション '--terse' には '--fields' の指定が必要です" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "オプション'--terse' には特定の '--fields' オプションの値が必要で、 '%s' ではありません" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM キーファイルは終了タグ '%s' を持ちません。" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM プライベートキーファイルではないようです。" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ファイルデータの保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "不正形式の PEM ファイル: Proc-Type は最初のタグではありません。" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "不正形式の PEM ファイル: 不明な Proc-Type タグ '%s' です。" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "不正形式の PEM ファイル: DEK-Info は2つ目のタグではありません。" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "不正形式の PEM ファイル: DEK-Info タグ内に IV が見付かりません。" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "不正形式の PEM ファイル: DEK-Info タグ内に無効な形式の IV" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "不正形式の PEM ファイル: 不明なプライベートキー暗号文 '%s'。" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "プライベートキーを復号できませんでした。" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM 証明書 '%s' は終了タグ '%s'持ちません。" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "証明書の復号に失敗しました。" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "証明書データの保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ファイルデータの保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV はその長さで偶数のバイト数でなければなりません。" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV の保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV は 16進法でない数字を含んでいます。" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "プライベートキー暗号文 '%s' は不明です。" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "プライベートキーの解読に十分なメモリーがありません。" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "プライベートキーのタイプを判定できません。" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "復号したプライベートキーの保存に十分なメモリーがありません。" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "暗号化エンジンの初期化に失敗しました。" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 エンジンの初期化に失敗しました: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "IV の長さが無効です (最低 %zd の長さが必要)。" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "復号したキーバッファ用に十分なメモリーがありません。" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "復号化暗号文コンテキストの初期化に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "復号用のシンメトリックキーの設定に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "復号用の IV の設定に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "プライベートキーの復号に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "プライベートキーの復号に失敗しました: 予想外の不要語句の長さです。" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "プライベートキーの復号に失敗しました。" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "暗号化用のメモリー割り当てが出来ませんでした。" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "暗号化暗号文コンテキストの初期化に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "暗号化用のシンメトリックキーの設定に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "暗号化用の IV の設定に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "データの暗号化に失敗しました: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "証明書データの初期化にエラー発生: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "証明書をデコードできませんでした: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 デコーダを初期化できません: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ファイルをデコードできません: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ファイルを確証できません: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "暗号化エンジンの初期化に失敗しました: %d。" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 コンテキストの初期化に失敗しました: %d。" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "IV の長さが無効です (最低でも %d は必要)。" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "復号化暗号文スロットの初期化に失敗しました。" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "復号化用シンメトリックキーの設定に失敗しました。" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "復号化用 IV の設定に失敗しました。" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "復号化コンテキストの初期化に失敗しました。" + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "プライベートキーの復号に失敗しました: %d" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "プライベートキーの復号に失敗しました: 復号したデータが大きすぎます。" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "プライベートキー復号化の完了に失敗しました: %d" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "暗号化暗号文スロットの初期化に失敗しました。" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "暗号化用のシンメトリックキーの設定に失敗しました。" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "暗号化用の IV の設定に失敗しました。" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "暗号化コンテキストの初期化に失敗しました。" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "暗号化に失敗しました: %d" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "暗号化の後に予期しないデータの量があります。" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "証明書のデコードが出来ません: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "パスワードを UCS2 に変換できません: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 デコーダを初期化出来ません: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ファイルをデコード出来ません: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ファイルを確証出来ません: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "ランダムデータを生成できません。" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "暗号化キーを作成するのに十分なメモリーがありません。" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ファイル作成用にメモリーを割り当て出来ません。" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ファイルへの IV の書き込み用にメモリーを割り当て出来ません。" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ファイルへの暗号化キーの書き込み用にメモリーを割り当て出来ません。" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ファイルデータ用にメモリーを割り当て出来ません。" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink メッセージのプロセス中にエラー発生: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ソケット上でデータを待っている際にエラーが発生しました" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "リンク状況監視用のネットリンクに接続できません: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink ハンドル信任情報の伝達を有効にできません: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "リンクステータス監視用のネットリンクハンドルを割り当て出来ません: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "リンク状況監視用のネットリンクのリンクキャッシュを割り当てできません: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink グループへ参加できません: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "リンクキャッシュの更新中にエラー: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "無効なオプション。--help を使用して有効なオプションの一覧をご覧下さい。\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s --help を使用して有効なオプションの一覧をご覧下さい。\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager で作成されています\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s からマージされています\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "使用できる DHCP クライアントが見付かりませんでした。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' が見付かりました" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' は見付かりません。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "サポートの無い DHCP クライアント '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "不明なログインレベル '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "不明なログドメイン '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "注記: libc リゾルバは 3つ以上のネームサーバーをサポートできません。" + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "以下の一覧にあるネームサーバーは認識されないかも知れません。" + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "自動 %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "システム" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "保護された WiFi ネットワーク経由で接続共有" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "開放した WiFi ネットワーク経由で接続共有" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "永続化システムのホスト名を修正" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "システム接続を修正" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "システムポリシーがシステム設定の修正を阻止します。" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "システムポリシーが永続化システムのホスト名修正を阻止します。" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "システムポリシーが保護された WiFi ネットワーク経由の接続共有を阻止します。" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "システムポリシーが開放した WiFi ネットワーク経由の接続共有を阻止します。" + diff --git a/po/ka.po b/po/ka.po new file mode 100644 index 00000000..58835670 --- /dev/null +++ b/po/ka.po @@ -0,0 +1,1089 @@ +# translation of ka.po to Georgian +# Vladimer Sichinava ვლადიმერ სიჭინავა , 2007. +# Malkhaz Barkalaya მალზახ ბარკალაია +msgid "" +msgstr "" +"Project-Id-Version: ka\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-03 18:02+0200\n" +"PO-Revision-Date: 2007-08-28 02:51+0200\n" +"Last-Translator: Vladimer Sichinava ვლადიმერ სიჭინავა \n" +"Language-Team: Georgian \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: KBabel 1.11.4\n" + +#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:926 +#, c-format +msgid "Passphrase for wireless network %s" +msgstr "პაროლი უკაბელო შეერთებისათვის %s" + +#: ../gnome/applet/applet-dbus.c:274 +#, c-format +msgid "Connection to the wireless network '%s' failed." +msgstr "ვერ მოხერხდა შეერთება უკაბელო ქსელთან \"%s\"." + +#: ../gnome/applet/applet-dbus.c:279 +msgid "Connection to the wired network failed." +msgstr "ვერ მოხერხდა შეერთება უკაბელო ქსელთან." + +#: ../gnome/applet/applet.c:182 +msgid "Error displaying connection information:" +msgstr "შეცდომა შეერთების შესახებ ინფორმაციის ჩვენებისას:" + +#: ../gnome/applet/applet.c:200 +msgid "Could not find some required resources (the glade file)!" +msgstr "ვერ მოინახა ზოგი საჭირო რესურსი (ფაილი glade)!" + +#: ../gnome/applet/applet.c:210 +msgid "No active connections!" +msgstr "არავითარი აქტიური შეერთება!" + +#: ../gnome/applet/applet.c:227 +#, c-format +msgid "%d Mb/s" +msgstr "%d მბ/წმ" + +#: ../gnome/applet/applet.c:230 +#, c-format +msgid "Wired Ethernet (%s)" +msgstr "კაბელიანი Ethernet (%s)" + +#: ../gnome/applet/applet.c:232 +#, c-format +msgid "Wireless Ethernet (%s)" +msgstr "უკაბელო Ethernet (%s)" + +#: ../gnome/applet/applet.c:238 +msgid "Unknown" +msgstr "უცნობია" + +#: ../gnome/applet/applet.c:330 ../gnome/applet/applet.c:357 +msgid "NetworkManager Applet" +msgstr "აპლეტი NetworkManager" + +#: ../gnome/applet/applet.c:332 +msgid "" +"Copyright © 2004-2006 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"Copyright © 2004-2006 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:334 ../gnome/applet/applet.c:361 +msgid "Notification area applet for managing your network devices and connections." +msgstr "" +"ქსელური მოწყობილობებისა და " +"შეერთებების მართვის აპლეტი." + +#: ../gnome/applet/applet.c:337 ../gnome/applet/applet.c:365 +msgid "translator-credits" +msgstr "Malkhaz Barkalaya მალზახ ბარკალაია " + +#: ../gnome/applet/applet.c:359 +msgid "" +"Copyright © 2004-2005 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"Copyright © 2004-2005 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:421 +msgid "VPN Login Failure" +msgstr "VPN-ავტორიზაციის შეცდომა" + +#: ../gnome/applet/applet.c:422 +#, c-format +msgid "Could not start the VPN connection '%s' due to a login failure." +msgstr "" +"VPN-შეერთების '%s' გაშვება ავტორიზაციის შეცდომის გამო " +"ვერ მოხერხდა." + +#: ../gnome/applet/applet.c:426 +msgid "VPN Start Failure" +msgstr "შეცდომა VPN-ის გაშვებისას" + +#: ../gnome/applet/applet.c:427 +#, c-format +msgid "" +"Could not start the VPN connection '%s' due to a failure launching the VPN " +"program." +msgstr "VPN-შეერთების '%s' გაშვება VPN-პროგრამის შეცდომის გამო ვერ მოხერხდა." + +#: ../gnome/applet/applet.c:431 ../gnome/applet/applet.c:441 +msgid "VPN Connect Failure" +msgstr "შეცდომა VPN-შეერთებისას" + +#: ../gnome/applet/applet.c:432 +#, c-format +msgid "Could not start the VPN connection '%s' due to a connection error." +msgstr "შეერთების შეცდომის გამო ვერ მოხერხდა VPN-შეერთების '%s'გაშვება." + +#: ../gnome/applet/applet.c:436 +msgid "VPN Configuration Error" +msgstr "VPN-კონფგურაციის შეცდომა" + +#: ../gnome/applet/applet.c:437 +#, c-format +msgid "The VPN connection '%s' was not correctly configured." +msgstr "VPN-შეერთება '%s' არასწორად იყო კონფიგურირებული." + +#: ../gnome/applet/applet.c:442 +#, c-format +msgid "" +"Could not start the VPN connection '%s' because the VPN server did not " +"return an adequate network configuration." +msgstr "" +"ვერ მოხერხდა VPN-შეერთების " +"'%s'გაშვება იმის გამო, რომ " +"VPN-სერვერის მიერ არ იყო " +"დაბრუნებული ადეკვატური " +"კონფიგურაცია." + +#: ../gnome/applet/applet.c:512 +msgid "VPN Login Message" +msgstr "VPN-ავტორიზაციის შეტყობინება" + +#: ../gnome/applet/applet.c:737 ../gnome/applet/applet.c:2635 +#: ../gnome/applet/other-network-dialog.c:458 +#: ../gnome/applet/passphrase-dialog.c:228 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"აპლეტი NetworkManager ვერ პოულობს საჭირო რესურსებს (ვერ " +"მოინახა ფაილი glade)." + +#: ../gnome/applet/applet.c:749 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "" +"ქსელურ მოწყობილობას \"%s (%s)\" " +"არა აქვს უკაბელო სკანირების " +"მხარდაჭერა." + +#: ../gnome/applet/applet.c:757 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "" +"ქსელურ მოწყობილობას \"%s (%s)\" " +"არა აქვს შეერთების " +"აღმოჩენის მხარდაჭერა." + +#. Note to translators: this is used if no essid is known +#: ../gnome/applet/applet.c:905 ../gnome/applet/applet.c:1103 +msgid "(unknown)" +msgstr "(უცნობია)" + +#: ../gnome/applet/applet.c:911 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "" +"მოწყობილობა %s ემზადება " +"კაბელური ქსელისათვის..." + +#: ../gnome/applet/applet.c:913 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "მოწყობილობა %s-ის მზადება უკაბელო '%s' ქსელისათვის..." + +#: ../gnome/applet/applet.c:921 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "" +"მოწყობილობა %s " +"კონფიგურირდება კაბელური " +"ქსელისათვის" + +#: ../gnome/applet/applet.c:923 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "" +"შეერთების მცდელობა უკაბელო " +"ქსელთან '%s'..." + +#: ../gnome/applet/applet.c:931 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "ველოდები ქსელურ გასაღებს უკაბელო ქსელისათვის '%s'..." + +#: ../gnome/applet/applet.c:939 ../gnome/applet/applet.c:949 +msgid "Requesting a network address from the wired network..." +msgstr "" +"ქსელური მისამართის " +"მოთხოვნა კაბელური " +"ქსელისაგან..." + +#: ../gnome/applet/applet.c:941 ../gnome/applet/applet.c:951 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "" +"ქსელური მისამართის " +"მოთხოვნა უკაბელო " +"ქსელისაგან '%s'..." + +#: ../gnome/applet/applet.c:959 +msgid "Finishing connection to the wired network..." +msgstr "" +"კაბელურ ქსელთან შეერთების " +"დასრულება..." + +#: ../gnome/applet/applet.c:961 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "" +"შეერთების დასრულება " +"უკაბელო ქსელთან '%s'..." + +#: ../gnome/applet/applet.c:1078 +msgid "NetworkManager is not running" +msgstr "NetworkManager არ არის გაშვებული" + +#: ../gnome/applet/applet.c:1086 ../gnome/applet/applet.c:1843 +msgid "Networking disabled" +msgstr "ქსელური საშუალებები გამორთულია" + +#: ../gnome/applet/applet.c:1091 +msgid "No network connection" +msgstr "არ არის ქსელთან შეერთება" + +#: ../gnome/applet/applet.c:1096 +msgid "Wired network connection" +msgstr "შეერთებულია კაბელურ ქსელთან" + +#: ../gnome/applet/applet.c:1100 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "" +"შეერთებულია უკაბელო " +"ქსელთან Ad-Hoc" + +#: ../gnome/applet/applet.c:1102 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "" +"შეერთებულია უკაბელო " +"ქსელთან '%s' (%d%%)" + +#: ../gnome/applet/applet.c:1123 +#, c-format +msgid "VPN connection to '%s'" +msgstr "შეერთებულია VPN-ქსელთან '%s'" + +#: ../gnome/applet/applet.c:1131 +#, c-format +msgid "VPN connecting to '%s'" +msgstr "შეერთება VPN-ქსელთან '%s'" + +#: ../gnome/applet/applet.c:1556 +msgid "_Connect to Other Wireless Network..." +msgstr "" +"_სხვა უკაბელო ქსელთან " +"შეერთება ..." + +#: ../gnome/applet/applet.c:1577 +msgid "Create _New Wireless Network..." +msgstr "" +"_ახალი უკაბელო ქსელის " +"შექმნა..." + +#: ../gnome/applet/applet.c:1700 +msgid "_VPN Connections" +msgstr "_VPN-შეერთებები" + +#: ../gnome/applet/applet.c:1745 +msgid "_Configure VPN..." +msgstr "_VPN-ის კონფიგურირება..." + +#: ../gnome/applet/applet.c:1749 +msgid "_Disconnect VPN..." +msgstr "_VPN-ის გათიშვა..." + +#: ../gnome/applet/applet.c:1771 +msgid "_Dial Up Connections" +msgstr "_მოდემური შეერთებები" + +#. FIXME: We should save and then check the state of the devices and show Connect _or_ Disconnect for each item +#: ../gnome/applet/applet.c:1782 +#, c-format +msgid "Connect to %s..." +msgstr "შეერთება ქსელთან %s..." + +#: ../gnome/applet/applet.c:1788 +#, c-format +msgid "Disconnect from %s..." +msgstr "გათიშვა ქსელისაგან %s..." + +#: ../gnome/applet/applet.c:1837 +msgid "No network devices have been found" +msgstr "" +"ვერ მოინახა ქსელური " +"მოწყობილობა" + +#: ../gnome/applet/applet.c:2029 +msgid "NetworkManager is not running..." +msgstr "NetworkManager არ არის გაშვებული..." + +#. 'Enable Networking' item +#: ../gnome/applet/applet.c:2210 +msgid "Enable _Networking" +msgstr "" +"_ქსელური შეერთების ნების " +"დართვა" + +#. 'Enable Wireless' item +#: ../gnome/applet/applet.c:2216 +msgid "Enable _Wireless" +msgstr "" +"_უკაბელო ქსელური შეერთების " +"ნების დართვა" + +#. 'Connection Information' item +#: ../gnome/applet/applet.c:2222 +msgid "Connection _Information" +msgstr "" +"_ინფორმაცია შეერთების " +"შესახებ" + +#. Help item +#: ../gnome/applet/applet.c:2233 +msgid "_Help" +msgstr "_დახმარება" + +#. About item +#: ../gnome/applet/applet.c:2242 +msgid "_About" +msgstr "_პროგრამის შესახებ" + +#: ../gnome/applet/applet.c:2824 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "" +"NetworkManager ვერ პოულობს საჭირო " +"რესურსებს. გაგრძელება " +"შეუძლებელია.\n" + +#: ../gnome/applet/wireless-security-option.c:157 +msgid "Open System" +msgstr "ღია სისტემა " + +#: ../gnome/applet/wireless-security-option.c:160 +msgid "Shared Key" +msgstr "ზიარი გასაღები" + +#: ../gnome/applet/wireless-security-option.c:208 +msgid "Automatic (Default)" +msgstr "ავტომატურად (ნაგულისხმევია)" + +#: ../gnome/applet/wireless-security-option.c:215 +msgid "AES-CCMP" +msgstr "AES-CCMP" + +#: ../gnome/applet/wireless-security-option.c:223 +msgid "TKIP" +msgstr "TKIP" + +#: ../gnome/applet/wireless-security-option.c:231 +msgid "Dynamic WEP" +msgstr "Dynamic WEP" + +#: ../gnome/applet/wso-none.c:53 +msgid "None" +msgstr "არა" + +#: ../gnome/applet/wso-wep-ascii.c:138 +msgid "WEP 64/128-bit ASCII" +msgstr "WEP 64/128-bit ASCII" + +#: ../gnome/applet/wso-wep-hex.c:135 +msgid "WEP 64/128-bit Hex" +msgstr "WEP 64/128-bit Hex" + +#: ../gnome/applet/wso-wep-passphrase.c:135 +msgid "WEP 128-bit Passphrase" +msgstr "WEP 128-bit Passphrase" + +#: ../gnome/applet/wso-wpa-eap.c:237 +msgid "PEAP" +msgstr "PEAP" + +#: ../gnome/applet/wso-wpa-eap.c:238 +msgid "TLS" +msgstr "TLS" + +#: ../gnome/applet/wso-wpa-eap.c:239 +msgid "TTLS" +msgstr "TTLS" + +#: ../gnome/applet/wso-wpa-eap.c:247 ../src/nm-ap-security-wpa-eap.c:93 +#: ../src/nm-ap-security-wpa-eap.c:117 +msgid "WPA2 Enterprise" +msgstr "WPA2 Enterprise" + +#: ../gnome/applet/wso-wpa-eap.c:249 ../src/nm-ap-security-wpa-eap.c:95 +#: ../src/nm-ap-security-wpa-eap.c:122 +msgid "WPA Enterprise" +msgstr "WPA Enterprise" + +#: ../gnome/applet/wso-wpa-psk.c:178 +msgid "WPA2 Personal" +msgstr "WPA2 Personal" + +#: ../gnome/applet/wso-wpa-psk.c:180 +msgid "WPA Personal" +msgstr "WPA Personal" + +#: ../gnome/applet/eggtrayicon.c:134 +msgid "Orientation" +msgstr "ორიენტაცია" + +#: ../gnome/applet/eggtrayicon.c:135 +msgid "The orientation of the tray." +msgstr "პანელის ორიენტაცია" + +#: ../gnome/applet/menu-items.c:88 +#, c-format +msgid "Wired Network (%s)" +msgstr "კაბელური ქსელი (%s)" + +#: ../gnome/applet/menu-items.c:91 +msgid "_Wired Network" +msgstr "_კაბელური ქსელი" + +#: ../gnome/applet/menu-items.c:162 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "უკაბელო ქსელი (%s)" + +#: ../gnome/applet/menu-items.c:164 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "უკაბელო ქსელი" + +#: ../gnome/applet/menu-items.c:343 +msgid " (invalid Unicode)" +msgstr "(არასწორი უნიკოდი)" + +#: ../gnome/applet/other-network-dialog.c:352 +#, c-format +msgid "" +"By default, the wireless network's name is set to your computer's name, %s, " +"with no encryption enabled" +msgstr "" +"უკაბელო ქსელის " +"ნაგულისხმევი სახელია " +"თქვენი კომპიუტერის სახელი, %s, " +"და შიფრვა გამორთულია" + +#: ../gnome/applet/other-network-dialog.c:358 +msgid "Create new wireless network" +msgstr "ახალი უკაბელო ქსელის შექმნა" + +#: ../gnome/applet/other-network-dialog.c:359 +msgid "" +"Enter the name and security settings of the wireless network you wish to " +"create." +msgstr "" +"შეიყვანეთ თქვენი ახალი " +"ქსელის სახელი და " +"უსაფრთხოების პარამეტრები." + +#: ../gnome/applet/other-network-dialog.c:363 +msgid "Create New Wireless Network" +msgstr "ახალი უკაბელო ქსელის შექმნა" + +#: ../gnome/applet/other-network-dialog.c:368 +msgid "Existing wireless network" +msgstr "არსებული უკაბელო ქსელი" + +#: ../gnome/applet/other-network-dialog.c:369 +msgid "Enter the name of the wireless network to which you wish to connect." +msgstr "" +"შეიყვანეთ ქსელის სახელი, " +"რომელსაც გინდათ მიუერთდეთ." + +#: ../gnome/applet/other-network-dialog.c:371 +msgid "Connect to Other Wireless Network" +msgstr "" +"სხვა უკაბელო ქსელთან " +"მიერთება" + +#: ../gnome/applet/passphrase-dialog.c:215 +msgid "Error connecting to wireless network" +msgstr "" +"შეცდომა უკაბელო ქსელთან " +"მიერთებისას" + +#: ../gnome/applet/passphrase-dialog.c:216 +msgid "" +"The requested wireless network requires security capabilities unsupported by " +"your hardware." +msgstr "" +"თქვენს აპარატურას არა აქვს " +"ამ უკაბელო ქსელთან " +"მიერთებისათვის საჭირო " +"უსაფრთხოების პარამეტრების " +"მხარდაჭერა." + +#: ../gnome/applet/vpn-password-dialog.c:151 +#: ../gnome/applet/vpn-password-dialog.c:188 +#, c-format +msgid "Cannot start VPN connection '%s'" +msgstr "" +"VPN-შეერთების '%s' გაშვება ვერ " +"ხერხდება" + +#: ../gnome/applet/vpn-password-dialog.c:154 +#, c-format +msgid "" +"Could not find the authentication dialog for VPN connection type '%s'. " +"Contact your system administrator." +msgstr "" +"'%s' ტიპის VPN-შეერთებისათვის " +"ვერ მოინახა აუტენთიკაციის " +"დიალოგი. მიმართეთ სისტემის " +"ადმინისტრატორს." + +#: ../gnome/applet/vpn-password-dialog.c:191 +#, c-format +msgid "" +"There was a problem launching the authentication dialog for VPN connection " +"type '%s'. Contact your system administrator." +msgstr "" +"'%s' ტიპის VPN-შეერთებისათვის " +"აუტენთიკაციის დიალოგს " +"პრობლემები აქვს. მიმართეთ " +"სისტემის ადმინისტრატორს." + +#: ../gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: ../gnome/applet/applet.glade.h:2 +msgid "Active Connection Information" +msgstr "" +"ინფორმაცია " +"აქტიური შეერთების " +"შესახებ" + +#: ../gnome/applet/applet.glade.h:4 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network " +"'%s'." +msgstr "" +"უკაბელო ქსელისათვის ითხოვს " +"პაროლს" +"\n" +"უკაბელო ქსელთან დაშვებისათვის საჭიროა პაროლის ან შიფრის გასაღების შეყვანა " +"'%s'." + +#: ../gnome/applet/applet.glade.h:8 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" +"ქსელის " +"ფუნქციონირების შეზღუდვა\n" +"\n" +"%s ქსელი არ იმუშავებს " +"სრულყოფილად." + +#: ../gnome/applet/applet.glade.h:12 +#, no-c-format +msgid "" +"Wireless Network Login " +"Confirmation\n" +"\n" +"You have chosen to log in to the wireless network '%s'. If you are sure " +"that this wireless network is secure, click the checkbox below and " +"NetworkManager will not require confirmation on subsequent log ins." +msgstr "" +"უკაბელო ქსელში რეგისტრირების " +"დადასტურება\n" +"\n" +"თქვენ უერთდებით უკაბელო ქსელს '%s'. თუ თქვენ დარწმუნებული ხართ მის " +"უსაფრთხოებაში, მონიშნეთ ეს უჯრა და NetworkManager აღარ მოგთხოვთ " +"დადასტურებას." + +#: ../gnome/applet/applet.glade.h:15 +msgid "Anonymous Identity:" +msgstr "ანონიმური იდენტიფიკაცია:" + +#: ../gnome/applet/applet.glade.h:16 +msgid "Authentication:" +msgstr "აუტენთიკაცია:" + +#: ../gnome/applet/applet.glade.h:17 +msgid "Broadcast Address:" +msgstr "" +"ფართეზოლოვანი მაუწყებლობის " +"მისამართი:" + +#: ../gnome/applet/applet.glade.h:18 +msgid "CA Certificate File:" +msgstr "CA სერტიფიკატის ფაილი:" + +#: ../gnome/applet/applet.glade.h:19 +msgid "C_onnect" +msgstr "_შეერთება" + +#: ../gnome/applet/applet.glade.h:20 +msgid "Client Certificate File:" +msgstr "" +"კლიენტის სერტიფიკატის " +"ფაილი:" + +#: ../gnome/applet/applet.glade.h:21 +msgid "Connection Information" +msgstr "" +"ინფორმაცია შეერთების " +"შესახებ" + +#: ../gnome/applet/applet.glade.h:22 +msgid "Default Route:" +msgstr "ნაგულისხმევი რაბი:" + +#: ../gnome/applet/applet.glade.h:23 +msgid "Destination Address:" +msgstr "დანიშნულების მისამართი:" + +#: ../gnome/applet/applet.glade.h:24 +msgid "Driver:" +msgstr "დრაივერი:" + +#: ../gnome/applet/applet.glade.h:25 +msgid "EAP Method:" +msgstr "მეთოდი EAP:" + +#: ../gnome/applet/applet.glade.h:26 +msgid "Hardware Address:" +msgstr "MAC-მისამართი:" + +#: ../gnome/applet/applet.glade.h:27 +msgid "IP Address:" +msgstr "IP მისამართი:" + +#: ../gnome/applet/applet.glade.h:28 +msgid "Identity:" +msgstr "იდენტიფიკაცია:" + +#: ../gnome/applet/applet.glade.h:29 +msgid "Interface:" +msgstr "ინტერფეისი:" + +#: ../gnome/applet/applet.glade.h:30 +msgid "Key Type:" +msgstr "გასაღების ტიპი:" + +#: ../gnome/applet/applet.glade.h:31 +msgid "Key management:" +msgstr "გასაღებების მართვა:" + +#: ../gnome/applet/applet.glade.h:32 +msgid "Key:" +msgstr "გასაღები:" + +#: ../gnome/applet/applet.glade.h:33 +msgid "" +"None\n" +"WEP 128-bit Passphrase\n" +"WEP 64/128-bit Hex\n" +"WEP 64/128-bit ASCII\n" +msgstr "" +"არცერთი\n" +"WEP 128-bit ფრაზა-პაროლი\n" +"WEP 64/128-bit Hex\n" +"WEP 64/128-bit ASCII\n" + +#: ../gnome/applet/applet.glade.h:38 +msgid "" +"Open System\n" +"Shared Key" +msgstr "" +"ღია სისტემა\n" +"ზიარი გასაღები" + +#: ../gnome/applet/applet.glade.h:40 +msgid "Other Wireless Network..." +msgstr "სხვა უკაბელო ქსელი..." + +#: ../gnome/applet/applet.glade.h:41 +msgid "Passphrase:" +msgstr "ფრაზა-პაროლი:" + +#: ../gnome/applet/applet.glade.h:42 +msgid "Password:" +msgstr "პაროლი:" + +#: ../gnome/applet/applet.glade.h:43 +msgid "Primary DNS:" +msgstr "პირველადი DNS:" + +#: ../gnome/applet/applet.glade.h:44 +msgid "Private Key File:" +msgstr "პირადი გასაღების ფაილი:" + +#: ../gnome/applet/applet.glade.h:45 +msgid "Private Key Password:" +msgstr "პირადი გასაღების პაროლი:" + +#: ../gnome/applet/applet.glade.h:46 +msgid "Secondary DNS:" +msgstr "მეორადი DNS:" + +#: ../gnome/applet/applet.glade.h:47 +msgid "Select the CA Certificate File" +msgstr "აირჩიეთ CA სერტიფიკატის ფაილი" + +#: ../gnome/applet/applet.glade.h:48 +msgid "Select the Client Certificate File" +msgstr "" +"აირჩიეთ კლიენტის " +"სერტიფიკატის ფაილი" + +#: ../gnome/applet/applet.glade.h:49 +msgid "Select the Private Key File" +msgstr "" +"აირჩიეთ პირადი გასაღების " +"ფაილი" + +#: ../gnome/applet/applet.glade.h:50 +msgid "Show key" +msgstr "გასაღების ჩვენება" + +#: ../gnome/applet/applet.glade.h:51 +msgid "Show passphrase" +msgstr "ფრაზა-პაროლის ჩვენება" + +#: ../gnome/applet/applet.glade.h:52 +msgid "Show password" +msgstr "პაროლის ჩვენება" + +#: ../gnome/applet/applet.glade.h:53 +msgid "Show passwords" +msgstr "პაროლების ჩვენება" + +#: ../gnome/applet/applet.glade.h:54 +msgid "Speed:" +msgstr "სიჩქარე:" + +#: ../gnome/applet/applet.glade.h:55 +msgid "Subnet Mask:" +msgstr "ქსელის შაბლონი:" + +#: ../gnome/applet/applet.glade.h:56 +msgid "Type:" +msgstr "ტიპი:" + +#: ../gnome/applet/applet.glade.h:57 +msgid "User Name:" +msgstr "სახელი:" + +#: ../gnome/applet/applet.glade.h:58 +msgid "Wireless Network Key Required" +msgstr "" +"საჭიროა უკაბელო ქსელის " +"გადაღები" + +#: ../gnome/applet/applet.glade.h:59 +msgid "Wireless _adapter:" +msgstr "_უკაბელო ადაპტერი:" + +#: ../gnome/applet/applet.glade.h:60 +msgid "_Always Trust this Wireless Network" +msgstr "" +"_ყოველთვის ვენდოთ ამ უკაბელო " +"ქსელს" + +#: ../gnome/applet/applet.glade.h:61 +msgid "_Don't remind me again" +msgstr "_შეხსენების აკრძალვა" + +#: ../gnome/applet/applet.glade.h:62 +msgid "_Fallback on this Network" +msgstr "" +"_სარეზერვო ქსელად " +"გამოყენება" + +#: ../gnome/applet/applet.glade.h:63 +msgid "_Login to Network" +msgstr "_რეგისტრაცია ქსელში" + +#: ../gnome/applet/applet.glade.h:64 +msgid "_Network Name:" +msgstr "_ქსელის სახელი:" + +#: ../gnome/applet/applet.glade.h:65 +msgid "_Wireless Security:" +msgstr "_უკაბელო ქსელის დაცვა:" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:417 +msgid "Cannot add VPN connection" +msgstr "ვერ მოინახა VPN შეერთება" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:419 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"VPN-პროგრამა არ არის თქვენს " +"სისტემაში. მიმართეთ " +"სისადმინს. " + +#: ../gnome/vpn-properties/nm-vpn-properties.c:461 +msgid "Cannot import VPN connection" +msgstr "" +"ვერ მოხერხდა VPN-შეერთების " +"იმპორტი\n" +" " + +#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" +"ვერ მოიძენა '%s' " +"VPN-შეერთებისათვის'%s' ფაილის " +"იმპორტისათვის საჭირო " +"პროგრამა. მიმართეთ " +"სისადმინს. " + +#: ../gnome/vpn-properties/nm-vpn-properties.c:580 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "" +"ვერ განხორციელდა VPN-შეერთება " +"'%s' " + +#: ../gnome/vpn-properties/nm-vpn-properties.c:583 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "ვერ მოიძენა '%s' VPN-შეერთებისათვის UI ფაილი. მიმართეთ სისადმინს." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:727 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "წავშალოთ VPN-შეერთება \"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:730 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"დაკარგულია მთელი " +"ინფორმაცია \"%s\" VPN-შეერთების " +"შესახებ. მიმართეთ სისადმინს " +"ახლის შესაქმნელად." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:924 +msgid "Unable to load" +msgstr "არ იტვირთება" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:926 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "" +"ვერ მოინახა ზოგი საჭირო " +"რესურსი (ფაილი glade)!" + +#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), +#. NULL, +#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, +#. GTK_STOCK_CANCEL, +#. GTK_RESPONSE_REJECT, +#. GTK_STOCK_APPLY, +#. GTK_RESPONSE_ACCEPT, +#. NULL)); +#: ../gnome/vpn-properties/nm-vpn-properties.c:1081 +msgid "Create VPN Connection" +msgstr "VPN-შეერთების შექმნა" + +#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); +#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); +#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); +#. make the druid window modal wrt. our main window +#. gtk_window_set_modal (druid_window, TRUE); +#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1099 +msgid "Edit VPN Connection" +msgstr "VPN-შეერთების რედაქტირება" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "ახალი VPN-შეერთების დამატება " + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Delete the selected VPN connection" +msgstr "" +"მითითებული VPN-შეერთების " +"წაშლა" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "E_xport" +msgstr "_ექსპორტი" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Edit the selected VPN connection" +msgstr "" +"მითითებული VPN-შეერთების " +"რედაქტირება" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Export the VPN settings to a file" +msgstr "" +"VPN-პარამეტრების ფაილში " +"ექსპორტი" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Export the selected VPN connection to a file" +msgstr "VPN-შეერთების ფაილში ექსპორტი " + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Manage Virtual Private Network Connections" +msgstr "VPN-შეერთებების მართვა" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "VPN Connections" +msgstr "VPN-შეერთებები" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "40-ბიტიანი WEP" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "104-ბიტიანი WEP" + +#: ../src/nm-ap-security-wpa-psk.c:51 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:53 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:55 +msgid "WPA Automatic" +msgstr "WPA Automatic" + +#: ../src/nm-ap-security-wpa-psk.c:60 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:62 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:64 +msgid "WPA2 Automatic" +msgstr "WPA2 Automatic" + +#: ../src/nm-ap-security.c:334 +msgid "none" +msgstr "არცერთი" + +#: ../src/nm-netlink-monitor.c:174 +#, c-format +msgid "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"ვერ ხერხდება netlink-სოკეტის " +"შექმნა კაბელიანი " +"ეთერნეტ-მოწყობილობის " +"მართვისათვის - %s" + +#: ../src/nm-netlink-monitor.c:192 +#, c-format +msgid "unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"ვერ ხერხდება netlink-სოკეტითან " +"მიერთება კაბელიანი " +"ეთერნეტ-მოწყობილობის " +"მართვისათვის - %s" + +#: ../src/nm-netlink-monitor.c:427 +msgid "operation took too long" +msgstr "" +"ოპერაცია მეტისმეტად " +"დიდხანს გრძელდება" + +#: ../src/nm-netlink-monitor.c:524 +msgid "received data from wrong type of sender" +msgstr "" +"მიღებულია მონაცემები " +"არასწორი ტიპის " +"გამომგზავნისაგან" + +#: ../src/nm-netlink-monitor.c:537 +msgid "received data from unexpected sender" +msgstr "" +"მიღებულია მონაცემები " +"გამომგზავნისაგან, ვისგანაც " +"არ იყო მოსალოდნელი " + +#: ../src/nm-netlink-monitor.c:666 +msgid "too much data was sent over socket and some of it was lost" +msgstr "" +"სოკეტის გავლით გაგზავნილი " +"იყო მეტისმეტად ბევრი " +"მონაცემი და მათი ნაწილი " +"დაიკარგა " + +#: ../src/nm-netlink-monitor.c:776 +msgid "error occurred while waiting for data on socket" +msgstr "" +"შეცდომა სოკეტისაგან " +"მონაცემთა მიღების " +"ლოდინისას " + +#: ../gnome/applet/applet-dbus-devices.c:930 +#, c-format +msgid "You are now connected to the Ad-Hoc wireless network '%s'." +msgstr "" +"თქვენ შეერთებული ხართ " +"უკაბელო AdHoc ქსელთან \"%s\"." + +#: ../gnome/applet/applet-dbus-devices.c:935 +#, c-format +msgid "You are now connected to the wireless network '%s'." +msgstr "" +"თქვენ შეერთებული ხართ " +"უკაბელო ქსელთან \"%s\"." + +#: ../gnome/applet/applet-dbus-devices.c:942 +msgid "You are now connected to the wired network." +msgstr "" +"თქვენ შეერთებული ხართ " +"კაბელურ ქსელთან." + +#: ../gnome/applet/applet-dbus-devices.c:948 +msgid "Connection Established" +msgstr "შეერთება დამყარებულია" + +#: ../gnome/applet/applet-dbus-devices.c:997 +msgid "Disconnected" +msgstr "გათიშულია" + +#: ../gnome/applet/applet-dbus-devices.c:998 +msgid "The network connection has been disconnected." +msgstr "ქსელური შეერთება გათიშულია." + +#: ../src/nm-ap-security-leap.c:66 ../src/nm-ap-security-leap.c:82 +msgid "LEAP" +msgstr "LEAP" + diff --git a/po/kn.po b/po/kn.po new file mode 100644 index 00000000..be51ba0d --- /dev/null +++ b/po/kn.po @@ -0,0 +1,1811 @@ +# translation of NetworkManager.po.master.kn.po to Kannada +# Kannada translation of NetworkManager. +# Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the NetworkManager package. +# +# Shankar Prasad , 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.po.master.kn\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:54+0530\n" +"Last-Translator: Shankar Prasad \n" +"Language-Team: kn-IN <>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ಬಳಕೆ: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "ದೋಷ: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ದೋಷ: 'con list': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "ಸಂಪರ್ಕದ ವಿವರಗಳು" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "ವ್ಯವಸ್ಥೆ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ಬಳಕೆದಾರ" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ಎಂದಿಗೂ ಬೇಡ" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ಹೌದು" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ಇಲ್ಲ" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳು" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ಬಳಕೆದಾರ ಸಂಪರ್ಕಗಳು" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ದೋಷ: %s ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ದೋಷ: %s - ಅಂತಹ ಯಾವುದೆ ಸಂಪರ್ಕಗಳಿಲ್ಲ." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "ಗೊತ್ತಿರದ ನಿಯತಾಂಕಗಳು: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ದೋಷ: ಮಾನ್ಯವಾದ ಯಾವುದೆ ನಿಯತಾಂಖವನ್ನು ಸೂಚಿಸಲಾಗಿಲ್ಲ." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ದೋಷ: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ದೋಷ: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ದೋಷ: 'con status': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕಗಳು" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "'%s' ಎಂಬ ಸಾಧನದಲ್ಲಿ ಯಾವುದೆ ಸಕ್ರಿಯ ಸಂಪರ್ಕವು ಕಂಡುಬಂದಿಲ್ಲ" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "ಯಾವುದೆ ಸಕ್ರಿಯ ಸಂಪರ್ಕ ಅಥವ ಸಾಧನವು ಕಂಡುಬಂದಿಲ್ಲ" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "'%s' ಎಂಬ ಸಾಧನವು '%s' ಸಂಪರ್ಕದೊಂದಿಗೆ ಹೊಂದಿಕೊಳ್ಳುತ್ತಿಲ್ಲ" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "'%s' ಸಂಪರ್ಕಕ್ಕಾಗಿ ಯಾವುದೆ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "ಸಕ್ರಿಯಗೊಳ್ಳುತ್ತಿದೆ" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "ಸಕ್ರಿಯಗೊಂಡಿದೆ" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "ಗೊತ್ತಿಲ್ಲದ" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಿದ್ಧಗೊಳಿಕೆ)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ದೃಢೀಕರಣದ ಅಗತ್ಯವಿದೆ)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN ಸಂಪರ್ಕಿತಗೊಳ್ಳುತ್ತಿದೆ" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN ಸಂಪರ್ಕಗೊಂಡಿದೆ (IP ಸಂರಚನೆಯನ್ನು ಪಡೆಯಲಾಗುತ್ತಿದೆ)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN ಸಂಪರ್ಕಗೊಂಡಿದೆ" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN ಸಂಪರ್ಕವು ವಿಫಲಗೊಂಡಿದೆ" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN ಸಂಪರ್ಕ ಕಡಿದಿದೆ" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "ಗೊತ್ತಿರದ ಕಾರಣ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "ಯಾವುದೂ ಇಲ್ಲ" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ಬಳಕೆದಾರರೊಂದಿಗೆ ಸಂಪರ್ಕ ಕಡಿದುಹೋಗಿದೆ" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "ಮೂಲ ಜಾಲಬಂಧ ಸಂಪರ್ಕಕ್ಕೆ ತಡೆಯುಂಟಾಗಿದೆ" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN ಸೇವೆಯನ್ನು ಅನಿರೀಕ್ಷಿತವಾಗಿ ನಿಲ್ಲಿಸಲಾಗಿದೆ" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN ಸೇವೆಯು ಅಮಾನ್ಯವಾದ ಸಂರಚನೆಯನ್ನು ಮರಳಿಸಿದೆ" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "ಸಂಪರ್ಕದ ಪ್ರಯತ್ನದ ಕಾಲಾವಧಿ ಮೀರಿದೆ" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN ಸೇವೆಯು ಸರಿಯಾದ ಸಮಯದಲ್ಲಿ ಆರಂಭಗೊಳ್ಳಲಿಲ್ಲ" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN ಸೇವೆಯು ಆರಂಭಗೊಳ್ಳಲು ವಿಫಲಗೊಂಡಿದೆ" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "ಯಾವುದೆ ಮಾನ್ಯವಾದ VPN ರಹಸ್ಯಗಳಿಲ್ಲ (ಸೀಕ್ರೇಟ್‌ಗಳಿಲ್ಲ)" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "ಅಮಾನ್ಯವಾದ VPN ರಹಸ್ಯಗಳು" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "ಸಂಪರ್ಕವನ್ನು ತೆಗೆದು ಹಾಕಲಾಗಿದೆ" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "ಸ್ಥಿತಿ: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "ಸಂಪರ್ಕವನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ದೋಷ: ಸಂಪರ್ಕವನ್ನು ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "ಸ್ಥಿತಿ: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ದೋಷ: ಸಂಪರ್ಕ ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ದೋಷ: ಕಾಲಾವಧಿ %d sec ತೀರಿದೆ." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ದೋಷ: ಸಂಪರ್ಕ ಸಕ್ರಿಯಗೊಳಿಕೆಯು ವಿಫಲಗೊಂಡಿದೆ: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ದೋಷ: '%s' ಗಾಗಿ ಸಕ್ರಿಯ ಸಂಪರ್ಕವನ್ನು ಪಡೆಯುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕದ ಸ್ಥಿತಿ: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "ಸಕ್ರಿಯ ಸಂಪರ್ಕ ಮಾರ್ಗ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ದೋಷ: ಗೊತ್ತಿರದ ಸಂಪರ್ಕ: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ದೋಷ: '%s' ಎಂಬ ಕಾಲಾವಧಿ ತೀರಿಕೆ ಮೌಲ್ಯವು ಅಮಾನ್ಯವಾಗಿದೆ." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ದೋಷ: id ಅಥವ uuid ಅನ್ನು ಸೂಚಿಸಬೇಕು." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ದೋಷ: ಯಾವುದೆ ಸೂಕ್ತವಾದ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ದೋಷ: ಯಾವುದೆ ಸೂಕ್ತವಾದ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "ಎಚ್ಚರಿಕೆ: ಸಂಪರ್ಕವು ಸಕ್ರಿಯವಾಗಿಲ್ಲ\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ದೋಷ: 'con' ಆಜ್ಷೆ '%s' ಎಂಬುದು ಮಾನ್ಯವಾದುದಲ್ಲ." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ದೋಷ: D-Bus ನೊಂದಿಗೆ ಸಂಪರ್ಕಸಾಧಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ದೋಷ: ವ್ಯವಸ್ಥೆಯ ಸಿದ್ಧತೆಗಳು ಕಂಡುಬಂದಿಲ್ಲ." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ದೋಷ: ಬಳಕೆದಾರ ಸಿದ್ಧತೆಗಳು ಕಂಡುಬಂದಿಲ್ಲ." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ದೋಷ: ಸಂಪರ್ಕಗಳನ್ನು ಪಡೆಯಲಾಗಿಲ್ಲ: ಸಿದ್ಧತೆಗಳು ಚಾಲನೆಯಲ್ಲಿಲ್ಲ." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"ಬಳಕೆ:: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "ನಿರ್ವಹಿಸದೆ ಇರುವ" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "ಲಭ್ಯವಿಲ್ಲ" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "ಸಂಪರ್ಕಕಡಿದು ಹೋಗಿದೆ" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಿದ್ಧಗೊಳಿಕೆ)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ಸಂರಚಿಸುವಿಕೆ)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (ದೃಢೀಕರಣದ ಅಗತ್ಯವಿದೆ)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ (IP ಸಂರಚನೆಯನ್ನು ಪಡೆಯಲಾಗುತ್ತಿದೆ)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "ಸಂಪರ್ಕಗೊಂಡಿದೆ" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "ಸಂಪರ್ಕ ವಿಫಲಗೊಂಡಿದೆ" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "ಗೊತ್ತಿರದ" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(ಯಾವುದೂ ಇಲ್ಲ)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ವಿಳಾಸ 0x%X ಅನ್ನು ಪರಿವರ್ತಿಸುವಲ್ಲಿ ದೋಷ" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "ಗೂಢಲಿಪೀಕರಣಗೊಂಡ: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "ಎಂಟರ್ಪ್ರೈಸ್ " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "ತಾತ್ಕಾಲಿಕ" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "ಮೂಲಭೂತ ವ್ಯವಸ್ಥೆ" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ದೋಷ: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ದೋಷ: 'dev list'; %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ಸಾಧನದ ವಿವರಗಳು" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(ಗೊತ್ತಿರದ)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "ಗೊತ್ತಿರದ)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ಆನ್‌" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ಆಫ್" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ದೋಷ: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ದೋಷ: 'dev status': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ಸಾಧನಗಳ ಸ್ಥಿತಿ" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ದೋಷ: '%s' ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ದೋಷ: '%s' ಎಂಬ ಸಾಧನವು ಕಂಡು ಬಂದಿಲ್ಲ." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "ಯಶಸ್ಸು: '%s' ಎಂಬ ಸಾಧನದಿಂದ ಯಶಸ್ವಿಯಾಗಿ ಸಂಪರ್ಕವನ್ನು ಕಡಿದುಹಾಕಲಾಗಿದೆ." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ದೋಷ: '%s' (%s) ಎಂಬ ಸಾಧನದ ಸಂಪರ್ಕವನ್ನು ಕಡಿದು ಹಾಕುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ಸಾಧನದ ಸ್ಥಿತಿ: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ದೋಷ: iface ಅನ್ನು ಸೂಚಿಸಬೇಕು." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ದೋಷ: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ದೋಷ: 'dev wifi': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi ಸ್ಕ್ಯಾನ್ ಪಟ್ಟಿ" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ದೋಷ: '%s' ಎಂಬ hwaddr ನ ನಿಲುಕಣಾ ಬಿಂದುವು ಕಾಣಿಸುತ್ತಿಲ್ಲ." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ದೋಷ: '%s' ಎಂಬುದು ಒಂದು WiFi ಸಾಧನವಾಗಿಲ್ಲ." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ದೋಷ: '%s' ಎಂಬ 'dev wifi' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ದೋಷ: '%s' ಎಂಬ 'dev' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "ನಿದ್ರಿಸುವ" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "ಸಂಪರ್ಕ ಕಲ್ಪಿಸಲಾಗುತ್ತಿದೆ" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ದೋಷ: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ದೋಷ: 'nm status': %s; ಅನುಮತಿಸಲಾದ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager ಸ್ಥಿತಿ" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "ಸಕ್ರಿಯಗೊಂಡ" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "ಅಶಕ್ತಗೊಂಡ" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "ಚಾಲನೆಯಲ್ಲಿದೆ" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "ಚಾಲನೆಯಲ್ಲಿಲ್ಲ" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ದೋಷ: '--fields' '%s' ಎಂಬ ಮೌಲ್ಯವು ಇಲ್ಲಿ ಸರಿಯಾದುದಲ್ಲ.; ಅನುಮತಿ ಇರುವ ಕ್ಷೇತ್ರಗಳು: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi ಸಕ್ರಿಯಗೊಂಡಿದೆ" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ದೋಷ: ಅಮಾನ್ಯವಾದ 'wifi' ನಿಯತಾಂಕ: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN ಸಕ್ರಿಯಗೊಂಡಿದೆ" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ದೋಷ: ಅಮಾನ್ಯವಾದ 'wwan' ರ ನಿಯತಾಂಕ: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ದೋಷ: '%s' ಎಂಬ 'nm' ಆಜ್ಞೆಯು ಮಾನ್ಯವಾದುದಲ್ಲ." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ದೋಷ: '%s' ಎಂಬ ವಸ್ತುವಿನ ಬಗೆಗೆ ತಿಳಿದಿಲ್ಲ, 'nmcli help' ಅನ್ನು ಪ್ರಯತ್ನಿಸಿ." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ದೋಷ: '--terse' ಎಂಬ ಆಯ್ಕೆಯನ್ನು ಎರಡನೆ ಬಾರಿಗೆ ಸೂಚಿಸಲಾಗಿದೆ." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ದೋಷ: '--terse' ಎಂಬುದು '--pretty' ಯೊಂದಿಗೆ ಪರಸ್ಪರ ಮೀಸಲಾಗಿದೆ." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ದೋಷ: '--pretty' ಎಂಬ ಆಯ್ಕೆಯನ್ನು ಎರಡನೆ ಬಾರಿಗೆ ಸೂಚಿಸಲಾಗಿದೆ." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ದೋಷ: '--pretty' ಎಂಬುದು '--terse' ಯೊಂದಿಗೆ ಪರಸ್ಪರ ಮೀಸಲಾಗಿದೆ." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ದೋಷ: '%s' ಆರ್ಗ್ಯುಮೆಂಟ್ ಕಾಣಿಸುತ್ತಿಲ್ಲ" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ದೋಷ: '%s' ಎನ್ನುವುದು '%s' ಎಂಬ ಆಯ್ಕೆಗೆ ಸರಿಯಾದ ಆರ್ಗ್ಯುಮೆಂಟ್ ಆಗಿಲ್ಲ." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ದೋಷ: '%s' ಎಂಬ ಆಯ್ಕೆಯ ಕ್ಷೇತ್ರಗಳು ಕಾಣಿಸುತ್ತಿಲ್ಲ." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli ಉಪಕರಣ, ಆವೃತ್ತಿ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ದೋಷ: '%s' ಎಂಬ ಆಯ್ಕೆಯ ಬಗೆಗೆ ತಿಳಿದಿಲ್ಲ, 'nmcli -help' ಅನ್ನು ಪ್ರಯತ್ನಿಸಿ." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d ಎಂಬ ಸಂಕೇತವು ಕಂಡುಬಂದಿದೆ, ಮುಚ್ಚಲಾಗುತ್ತಿದೆ......" + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ದೋಷ: NetworkManager ನೊಂದಿಗೆ ಸಂಪರ್ಕಸಾಧಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "ಯಶಸ್ವಿಯಾಗಿದೆ" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-ಬಿಟ್‌ ಗುಪ್ತವಾಕ್ಯಾಂಶ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (ಅಜ್ಞಾತ)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (ಗೊತ್ತಿರದ)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ಯಾವುದಾದರೂ, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "ಸ್ವಯಂಚಾಲಿತ" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "ಹೊಂದಿಸಲಾಗಿಲ್ಲ" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "'%s' ಎಂಬ ಕ್ಷೇತ್ರವು ಒಂಟಿಯಾಗಿಯೆ ಇರಬೇಕು" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ಅಮಾನ್ಯವಾದ ಕ್ಷೇತ್ರ '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "'--terse' ಎಂಬ ಆಯ್ಕೆಗೆ '--fields' ಅನ್ನು ಸೂಚಿಸಬೇಕಾಗುತ್ತದೆ" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"'--terse' ಎಂಬ ಆಯ್ಕೆಗೆ ನಿಶ್ಚಿತವಾದ '--fields' ಆಯ್ಕೆಯ ಮೌಲ್ಯದ ಅಗತ್ಯವಿರುತ್ತದೆಯೆ ಹೊರತು, '%s' " +"ಎಂಬುದಲ್ಲ" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM ಕೀಲಿ ಕಡತವು ಯಾವುದೆ ಅಂತ್ಯ ಟ್ಯಾಗ್ '%s' ಅನ್ನು ಹೊಂದಿಲ್ಲ." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "ಒಂದು PEM ಖಾಸಗಿ ಕೀಲಿ ಕಡತದಂತೆ ತೋರುತ್ತಿಲ್ಲ." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ಕಡತ ದತ್ತಾಂಶವನ್ನು ಶೇಖರಿಸಿಡಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "ತಪ್ಪಾಗಿರುವ PEM ಕಡತ: Proc-ಬಗೆಯು ಮೊದಲಿನ ಟ್ಯಾಗ್ ಆಗಿಲ್ಲ." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "ತಪ್ಪಾಗಿರುವ PEM ಕಡತ: ಗೊತ್ತಿರದ Proc-ಬಗೆಯ ಟ್ಯಾಗ್ '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "ತಪ್ಪಾಗಿರುವ PEM ಕಡತ: DEK-Info ಯು ಎರಡನೆ ಟ್ಯಾಗ್ ಆಗಿಲ್ಲ." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "ತಪ್ಪಾಗಿರುವ PEM ಕಡತ: DEK-Info ಟ್ಯಾಗ್‌ನಲ್ಲಿ ಯಾವುದೆ IV ಕಂಡುಬಂದಿಲ್ಲ." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "ತಪ್ಪಾಗಿರುವ PEM ಕಡತ: DEK-Info ಟ್ಯಾಗ್‌ನಲ್ಲಿ IV ಯ ಅಮಾನ್ಯವಾದ ವಿನ್ಯಾಸ." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "ತಪ್ಪಾಗಿರುವ PEM ಕಡತ: ಗೊತ್ತಿರದ ಖಾಸಗಿ ಕೀಲಿ ಸಿಫರ್ '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕೋಡ್ ಮಾಡಲಾಗಲಿಲ್ಲ." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM ಪ್ರಮಾಣಪತ್ರ '%s' ಯಾವುದೆ ಅಂತ್ಯ ಟ್ಯಾಗ್ '%s' ಅನ್ನು ಹೊಂದಿಲ್ಲ." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "ಪ್ರಮಾಣಪತ್ರವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "ಪ್ರಮಾಣಪತ್ರ ದತ್ತಾಂಶವನ್ನು ಶೇಖರಿಸಿಡಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ಕಡತ ದತ್ತಾಂಶವನ್ನು ಶೇಖರಿಸಿಡಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ಯ ಉದ್ದವು ಸರಿ ಸಂಖ್ಯೆಯ ಬೈಟ್‌ಗಳಂದ ಆಗಿರಬೇಕು." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV ಅನ್ನು ಶೇಖರಿಸಿಡಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV ಯು ಹೆಕ್ಸಾ-ದಶಮಾಂಶ ಅಲ್ಲದ ಅಂಕೆಗಳನ್ನು ಹೊಂದಿದೆ." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "ಖಾಸಗಿ ಕೀಲಿ ಸಿಫರ್ '%s' ತಿಳಿದಿಲ್ಲ." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯ ಬಗೆಯನ್ನು ನಿರ್ಧರಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲಾದ ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಶೇಖರಿಸಿಡಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "ಕ್ರಿಪ್ಟೋ ಎಂಜಿನ್ ಅನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 ಎಂಜಿನ್ ಅನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "ಅಮಾನ್ಯವಾದ IV ಗಾತ್ರ (ಕನಿಷ್ಟ %zd ಇರಬೇಕು)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲಾದ ಬಫರಿಗಾಗಿ ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ಡೀಕ್ರಿಪ್ಸ್ ಮಾಡುವ ಸಿಫರ್ ಸಂದರ್ಭವನ್ನು ಆರಂಭಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು IV ಅನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: ಅನಿರೀಕ್ಷಿತವಾದ ಪ್ಯಾಡಿಂಗ್ ಗಾತ್ರ" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಸಿಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "ಗೂಢಲಿಪೀಕರಣ ಸಿಫರ್ ಸಂದರ್ಭವನ್ನು ಆರಂಭಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು IV ಅನ್ನು ಹೊಂದಿಸಲು ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಗೂಢಲಿಪೀಕರಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "ಪ್ರಮಾಣಪತ್ರ ದತ್ತಾಂಶವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ದೋಷ ಉಂಟಾಗಿದೆ: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "ಪ್ರಮಾಣಪತ್ರವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ಡೀಕೋಡರ್ ಅನ್ನು ಆರಂಭಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ಕಡತವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ಕಡತವನ್ನು ಪರಿಶೀಲಿಸಲಾಗಿಲ್ಲ: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "ಕ್ರಿಪ್ಟೊ ಎಂಜಿನ್ ಅನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 ಸಂದರ್ಭವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "ಅಮಾನ್ಯವಾದ IV ಗಾತ್ರ (ಕನಿಷ್ಟ %d ಇರಬೇಕು)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ಡೀಕ್ರಪ್ಟ್ ಮಾಡಲಾಗುವ ಸಿಫರ್ ಜಾಗವನ್ನು ಆರಂಭಿಸಲು ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲು IV ಅನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವ ಸನ್ನಿವೇಶವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡಲಾದ ದತ್ತಾಂಶದ ಗಾತ್ರವು " +"ಬಹಳ ದೊಡ್ಡದಾಗಿದೆ." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಡೀಕ್ರಿಪ್ಟ್ ಮಾಡುವಿಕೆಯನ್ನು ಪೂರ್ಣಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲಾಗುವ ಸಿಫರ್ ಜಾಗವನ್ನು ಆರಂಭಿಸಲು ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಸಿಮಿಟ್ರಿಕ್ ಕೀಲಿಯನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು IV ಅನ್ನು ಹೊಂದಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "ಗೂಢಲಿಪೀಕರಿಸುವ ಸನ್ನಿವೇಶವನ್ನು ಆರಂಭಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "ಗೂಢಲಿಪೀಕರಿಸುವಲ್ಲಿ ವಿಫಲಗೊಂಡಿದೆ: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲು ಅನಿರೀಕ್ಷಿತವಾದ ದತ್ತಾಂಶದ ಮೊತ್ತ." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "ಪ್ರಮಾಣಪತ್ರವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "ಗುಪ್ತಪದವನ್ನು UCS2 ಗೆ ಬದಲಾಯಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ಡೀಕೋಡರ್ ಅನ್ನು ಆರಂಭಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ಕಡತವನ್ನು ಡೀಕೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ಕಡತವನ್ನು ಖಚಿತಪಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "ಮನಸ್ಸಿಗೆ ಬಂದ ದತ್ತಾಂಶವನ್ನು ಉತ್ಪಾದಿಸಲಾಗಲಿಲ್ಲ." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "ಖಾಸಗಿ ಕೀಲಿಯನ್ನು ಗೂಢಲಿಪೀಕರಿಸಲು ಸಾಕಷ್ಟು ಮೆಮೊರಿ ಇಲ್ಲ." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ಕಡತ ರಚನೆಗೆ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IV ಅನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "ಗೂಢಲಿಪೀಕರಿಸಲಾದ ಕೀಲಿಯನ್ನು PEM ಕಡತಕ್ಕೆ ಬರೆಯಲು ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ಕಡತ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಮೆಮೊರಿಯನ್ನು ನಿಯೋಜಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "ನೆಟ್‌ಲಿಂಕ್ ಸಂದೇಶವನ್ನು ಸಂಸ್ಕರಿಸುವಲ್ಲಿ ದೋಷ ಉಂಟಾಗಿದೆ: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ಸಾಕೆಟ್‌ನಲ್ಲಿ ದತ್ತಾಂಶಕ್ಕಾಗಿ ಕಾಯುವಾಗ ದೋಷವು ಎದುರಾಗಿದೆ" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %" +"s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಕ್ರೆಡೆನ್ಶಿಯಲ್ ಪಾಸಿಂಗ್ ಅನ್ನು ಶಕ್ತಗೊಳಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಹ್ಯಾಂಡಲ್ ಅನ್ನು ನಿಯೋಜಿಸಲು " +"ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ನಿಯೋಜಿಸಲು " +"ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "ಕೊಂಡಿ ಕ್ಯಾಶೆಯನ್ನು ಅಪ್‌ಡೇಟ್ ಮಾಡುವಾಗ ದೋಷ ಉಂಟಾಗಿದೆ: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "ಅಮಾನ್ಯವಾದ ಆಯ್ಕೆ. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. ಮಾನ್ಯವಾದ ಆಯ್ಕೆಗಳಿಗಾಗಿ ದಯವಿಟ್ಟು --help ಅನ್ನು ನೋಡಿ.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager ನಿಂದ ನಿರ್ಮಿಸಲಾಗಿದೆ\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s ಇಂದ ಒಗ್ಗೂಡಿಸಲಾಗಿದೆ\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ಬಳಸಬಹುದಾದ ಯಾವುದೆ DHCP ಕ್ಲೈಂಟ್ ಕಂಡುಬಂದಿಲ್ಲ." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' ಕಂಡು ಬಂದಿದೆ." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ಕಂಡು ಬಂದಿದೆ." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "ಬೆಂಬಲವಿರದ DHCP ಕ್ಲೈಂಟ್ '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಮಟ್ಟ '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "ಗೊತ್ತಿರದ ದಾಖಲೆ ಡೊಮೈನ್ '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"ಸೂಚನೆ: libc ಪರಿಹಾರಕವು(ರಿಸಾಲ್ವರ್) ೩ ನಾಮಪರಿಚಾರಕಗಳಿಗಿಂತ ಹೆಚ್ಚಿನವುಗಳನ್ನು " +"ಬೆಂಬಲಿಸುವುದಿಲ್ಲ." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "ಈ ಕೆಳಗೆ ಸೂಚಿಸಲಾದ ನಾಮಪರಿಚಾರಕಗಳನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "ಸ್ವಯಂ %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "ವ್ಯವಸ್ಥೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸುವಿಕೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸುವಿಕೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸಿ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸು" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ" + +#~ msgid "Type" +#~ msgstr "ಬಗೆ" + +#~ msgid "Name" +#~ msgstr "ಹೆಸರು" + +#~ msgid "User connections:\n" +#~ msgstr "ಬಳಕೆದಾರ ಸಂಪರ್ಕಗಳು:\n" + +#~ msgid "System-wide connections" +#~ msgstr "ವ್ಯವಸ್ಥೆಯಾದ್ಯಂತದ ಸಂಪರ್ಕಗಳು" + +#~ msgid "Default" +#~ msgstr "ಪೂರ್ವನಿಯೋಜಿತ" + +#~ msgid "Service" +#~ msgstr "ಸೇವೆ" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, ಫ್ರೀಕ್ವೆ %d MHz, ದರ %d Mb/s, ದೃಢತೆ %d" + +#~ msgid "Device" +#~ msgstr "ಸಾಧನ" + +#~ msgid "Driver" +#~ msgstr "ಚಾಲಕ" + +#~ msgid "State" +#~ msgstr "ಸ್ಥಿತಿ" + +#~ msgid "HW Address" +#~ msgstr "HW ವಿಳಾಸ" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " ಸಾಮಾರ್ಥ್ಯಗಳು:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "ಕ್ಯಾರಿಯರ್ ಪತ್ತೆ" + +#~ msgid "Speed" +#~ msgstr "ವೇಗ" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " ವೈರ್ಲೆಸ್‌ ಗುಣಧರ್ಮಗಳು\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP ಗೂಢಲಿಪೀಕರಣ" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA ಗೂಢಲಿಪೀಕರಣ" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 ಗೂಢಲಿಪೀಕರಣ" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP ಸಿಫರ್" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP ಸಿಫರ್" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " ವೈರ್ಲೆಸ್ ನಿಲುಕಣಾ ಬಿಂದುಗಳು %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = ಪ್ರಸಕ್ತ AP)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " ವೈರ್ಡ್ ಗುಣಧರ್ಮಗಳು\n" + +#~ msgid "Carrier" +#~ msgstr "ವಾಹಕ(ಕ್ಯಾರಿಯರ್)" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPV4 ಸಿದ್ಧತೆಗಳು:\n" + +#~ msgid "Address" +#~ msgstr "ವಿಳಾಸ" + +#~ msgid "Prefix" +#~ msgstr "ಪ್ರಿಫಿಕ್ಸ್" + +#~ msgid "Gateway" +#~ msgstr "ಗೇಟ್‌ವೇ" + +#~ msgid "Device:" +#~ msgstr "ಸಾಧನ:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "ದೋಷ: hwaddr ಅನ್ನು ಸೂಚಿಸಬೇಕು." + +#~ msgid "AP parameters" +#~ msgstr "AP ನಿಯತಾಂಕಗಳು" + +#~ msgid "Frequency:" +#~ msgstr "ಫ್ರೀಕ್ವೆನ್ಸಿ:" + +#~ msgid "Mode:" +#~ msgstr "ಕ್ರಮ:" + +#~ msgid "Ad-hoc" +#~ msgstr "ತಾತ್ಕಾಲಿಕ" + +#~ msgid "Maximal bitrate:" +#~ msgstr "ಗರಿಷ್ಟ ಬಿಟ್ ದರ:" + +#~ msgid "Strength:" +#~ msgstr "ದೃಢತೆ:" + +#~ msgid "Flags:" +#~ msgstr "ಫ್ಲಾಗ್‌ಗಳು:" + +#~ msgid "privacy" +#~ msgstr "ಗೌಪ್ಯತೆ" + +#~ msgid "WPA flags:" +#~ msgstr "WPA ಫ್ಲಾಗ್‌ಗಳು:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN ಫ್ಲಾಗ್‌ಗಳು:" + +#~ msgid "NM running:" +#~ msgstr "NM ಚಾಲನೆಯಲ್ಲಿದೆ:" + +#~ msgid "NM state:" +#~ msgstr "NM ಸ್ಥಿತಿ:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM ವೈರ್ಲೆಸ್‌ ಯಂತ್ರಾಂಶ:" + +#~ msgid "NM wireless:" +#~ msgstr "NM ಯಂತ್ರಾಂಶ:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN ಯಂತ್ರಾಂಶ:" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "" +#~ "ಕೊಂಡಿಯ ಸ್ಥಿತಿಯನ್ನು ಮೇಲ್ವಿಚಾರಣೆ ನಡೆಸಲು ನೆಟ್‌ಲಿಂಕ್ ಗುಂಪನ್ನು ಸೇರಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "ನೆಟ್‌ಲಿಂಕ್‌ನೊಂದಿಗೆ ಸಂಪರ್ಕ ಜೋಡಿಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ: %s" diff --git a/po/ko.po b/po/ko.po new file mode 100644 index 00000000..ad463ab1 --- /dev/null +++ b/po/ko.po @@ -0,0 +1,1641 @@ +# translation of ko.po to Korean +# networkmanager korean translation. +# Copyright (C) 2007 THE NetworkManager'S COPYRIGHT HOLDER +# This file is distributed under the same license as the NetworkManager package. +# +# +# Young-Ho Cha , 2006-2007. +# Namhyung Kim , 2007. +# Hyunsok Oh , 2010. +# Hyunsok Oh , 2010. +msgid "" +msgstr "" +"Project-Id-Version: ko\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 13:48+1000\n" +"Last-Translator: Hyunsok Oh \n" +"Language-Team: Korean \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: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "이름" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "장치" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "범위" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "디폴트" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-서비스" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "스펙-객체" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "유형" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "타임스탬프" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "실제 타임스탬프" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "자동연결" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "읽기전용" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"사용법: nmcli con { 명령어 | help }\n" +" 명령어 := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface <인터페이스>] [ap <하드웨어주소>] [--nowait] " +"[--timeout <타임아웃시간>]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "오류: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "오류: 'con list': %s; 허용된 필드: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "연결 상세 정보" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "시스템" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "사용자" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "하지않음" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "예" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "아니오" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "시스템 연결" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "사용자의 연결" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "오류: %s 인자가 없습니다." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "오류: %s - 그런 연결이 없습니다." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "알려져있지 않은 매개변수입니다: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "오류: 옳바른 매개변수가 지정되지 않았습니다." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "오류: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "오류: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "오류: 'con status': %s; 허용된 필드: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "활성화된 연결" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "장치 '%s'에 활성화된 연결이 없습니다" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "활성화된 연결이나 장치가 없습니다" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "장치 '%s'는 연걸 '%s'와 호환되지 않습니다" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "연결 '%s'에 대한 장치를 찾을 수 없습니다" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "활성화중" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "활성화됨" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "알 수 없음" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN 연결 중 (준비)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN 연결 중 (인증 필요)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN 연결 중" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN 연결 중 (IP 설정 얻는 중)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN 연결 됨" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN 연결 실패" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN 연결 끊겼음" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "알 수 없는 이유" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "없음" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "사용자 연결이 끊어졌습니다" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "기반 네트워크 연결이 중지되었습니다" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN 서비스가 예기치 못하게 중단되었습니다" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN 서비스가 잘못된 설정을 반환했습니다" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "연결 시도가 시간을 초과했습니다" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN 서비스가 제 시간에 시작되지 않았습니다" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN 서비스를 시작하는 데 실패했습니다" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "옳바른 VPN 비밀 정보가 없습니다" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "잘못된 VPN 비밀정보" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "연결이 제거되었습니다" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "상태: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "연결이 활성화되었습니다\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "오류: 연결 활성화가 실패했습니다." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "상태: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "오류: 연결 활성화가 실패했습니다: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "오류: 제한시간 %d초를 초과했습니다." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "오류: 연결 활성화가 실패했습니다: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "오류: '%s'에 대한 활성화된 연결을 얻는 데 실패했습니다." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "활성화된 연결 상태: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "활성화된 연결 경로: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "오류: 알려지지 않은 연결: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "오류: 시간 제한 값 '%s'가 올바르지 않습니다." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "오류: id나 uuid를 지정해야만 합니다." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "오류: 적절한 장치를 찾을 수 없습니다: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "오류: 적절한 장치를 찾을 수 없습니다." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "경고: 연결이 활성화되어 있지 않습니다\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "오류: 'con' 명령 '%s'는 바른 명령이 아닙니다." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "오류: D-버스에 연결할 수 없습니다." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "오류: 시스템 설정을 얻을 수 없습니다." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "오류: 사용자 설정을 얻을 수 없습니다." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "오류: 연결을 얻을 수 없습니다: 설정 서비스가 실행중이지 않습니다." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "장치" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "상태" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "일반" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "기능" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-특성" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "유선 상태" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4 설정" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4 DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "드라이버" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "하드웨어주소" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "캐리어 감지" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "속도" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "캐리어" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "주소" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "접두사" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "게이트웨이" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "모드" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "주파수" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "전송률" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "신호" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "보안" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA 플래그" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN 플래그" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "활성" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"사용법: nmcli dev { 명령어 | help }\n" +"\n" +" 명령어 := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface <인터페이스>]\n" +" disconnect iface <인터페이스> [--nowait] [--timeout <타임아웃시간>]\n" +" wifi [list [iface <인터페이스>] | hwaddr <하드웨어주소>]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "관리되지 않음" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "사용할 수 없음" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "연결 끊겼음" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "연결 중 (준비)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "연결 중 (설정중)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "연결 중 (인증 필요)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "연결 중 (IP 설정 가져오는 중)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "연결됨" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "연결 실패함" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "알 수 없음" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(없음)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 주소 0x%X를 변환하는 중 오류가 있습니다" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "암호화됨: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "기업용 WPA " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "애드혹" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "인프라스트럭쳐" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "오류: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "오류: 'dev list': %s; 허용된 필드: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "장치 상세정보" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(알 수 없음)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "알 수 없음)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "켜짐" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "꺼짐" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "오류: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "오류: 'dev status': %s; 허용되는 필드: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "장치 상태" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "오류: '%s' 인자가 없습니다." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "오류: 장치 '%s'를 찾을 수 없습니다." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "성공: 장치 '%s'가 성공적으로 연결 해제되었습니다." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "오류: 장치 '%s' (%s)의 연결 해제가 실패했습니다: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "장치 상태: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "오류: iface를 지정해야만 합니다." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "오류 'dev wifi': '%s'" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "오류: 'dev wifi': %s; 허용되는 필드: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "검색된 WiFi 목록" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "오류: 하드웨어주소가 '%s'인 억세스 포인트를 찾을 수 없습니다." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "오류: 장치 '%s'는 WiFi 장치가 아닙니다." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "오류 'dev wifi' 명령어 '%s'가 바르지 않습니다." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "오류: 'dev' 명령어 '%s'가 바르지 않습니다." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "실행중" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI 하드웨어" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN 하드웨어" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"사용법: nmcli nm { 명령어 | help }\n" +"\n" +" 명령어 := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "잠듦" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "연결" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "오류: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "오류: 'nm status': %s; 허용되는 필드: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "네트워크 관리자 상태" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "사용" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "미사용" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "실행 중" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "실행 중이 아님" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "오류: '--fields' 값 '%s'은 올바르지 않습니다; 허용되는 필드: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi 사용중" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "오류: 잘못된 'wifi' 매개변수: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN 사용중" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "오류: 잘못된 'wwan' 매개변수: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "오류: 'mn' 명령어 '%s'가 바르지 않습니다." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"사용법: %s [옵션] 대상 { 명령어 | help }\n" +"\n" +"옵션\n" +" -t[erse] 간략한 출력\n" +" -p[retty] 보기좋은 출력\n" +" -m[ode] tabular|multiline 출력 모드 " +" -f[ields] <필드1,필드2,...>|all|common 출력 필드 지정\n" +" -e[scape] yes|no 값에서 컬럼 구분자를 이스케이프\n" +" -v[ersion] 프로그램 버전 정보 보여주기\n" +" -h[elp] 이 도움말 보여주기\n" +"\n" +"대상\n" +" nm 네트워크 관리자 상태\n" +" con 네트워크 관리자 연결\n" +" dev 네트워크 관리자가 관리하는 장치\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "대상 '%s'가 알려져 있지 않습니다. 'nmcli help'를 해 보십시오." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "오류: 옵션 '--terse'가 두번째로 설정되었습니다." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "오류: 옵션 '--terse'를 '--pretty'와 함께 사용할 수 없습니다." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "오류: 옵션 '--pretty'가 두번째로 설정되었습니다." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "오류: 옵션 '--pretty'를 '--terse'와 함께 사용할 수 없습니다." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "오류: '%s' 옵션에 인자가 없습니다." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "오류: '%s'는 올바른 인자가 아닙니다('%s' 옵션에 사용됨)." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "오류: '%s'옵션에 대해 필드가 없습니다." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli 도구, 버전 %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "오류: 옵션 '%s'는 알려져 있지 않습니다. 'nmcli -help'를 해 보십시오." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "시그널 %d를 받았습니다. 종료합니다..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "오류: NetworkManager에 연결할 수 없습니다." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "성공" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (16진 아시키 열쇠글)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-비트 열쇠글)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (알 수 없음)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (알 수 없음)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "아무, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "자동" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "설정 안됨" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "필드 '%s'는 혼자만 있어야만 합니다" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "잘못된 필드 '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "옵션 '--terse'는 '--fields' 설정을 요구합니다" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "옵션 '--terse'는 '%s'가 아닌 구체적인 '--fields' 값을 요구합니다" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM 키 파일에 끝 태그 '%s'가 없습니다." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM 비밀 키 파일처럼 보이지 않습니다." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM 파일 정보를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "잘못된 형태의 PEM 파일: Proc-Type이 첫번째 태그가 아닙니다." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "잘못된 형태의 PEM 파일: 알려져 있지 않은 Proc-Type 태그 '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "잘못된 형태의 PEM 파일: DEK-Info가 두번째 태그가 아님." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "잘못된 형태의 PEM 파일: IV를 DEK-Info 태그에서 찾을 수 없음." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "잘못된 형태의 PEM 파일: DEK-Info 태그안에 잘못된 형태의 IV가 있음." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "잘못된 형태의 PEM 파일: 알려져 있지 않은 비밀 키 암호화 방법 '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "비밀 키를 해독할 수 없습니다." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM 인증서 '%s'에 끝 태그 '%s'가 없습니다." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "인증서 해독에 실패했습니다." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "인증서 정보를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "파일 정보를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV의 길이는 짝수여야만 합니다." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV에 16진수 숫자가 아닌 문자가 있습니다." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "비밀 키 암호화 방식 '%s'가 알려져 있지 않습니다." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "비밀 키를 해독할 메모리가 부족합니다." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "비밀 키 유형을 결정할 수 없습니다." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "해독된 비밀 키를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "암호화 엔진을 초기화하는 데 실패했습니다." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 엔진을 초기화하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "잘못된 IV 길이 (최소한 %zd바이트 이상이어야 함)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "해독된 키 버퍼를 저장할 메모리가 부족합니다." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "암호 해독 문맥을 초기화하는 데 실패했습니다: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "해독을 위한 대칭 키를 설정하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "해독을 위해 IV를 설정하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "비밀 키를 해독하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "비밀 키를 해독하는 데 실패했습니다: 예기치 못한 패딩 길이." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "비밀 키를 해독하는 데 실패했습니다." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "암호화를 위한 메모리를 할당할 수 없습니다." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "암호화 문맥을 초기화하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "암호화를 위한 대칭키를 설정하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "암호화를 위한 IV를 설정하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "데이터를 암호화하는 데 실패했습니다: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "인증서 정보를 초기화하는 중 오류가 발생했습니다: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "인증서를 해독할 수 없습니다: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 복호기를 초기화할 수 없습니다: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 파일을 해독할 수 없습니다: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 파일을 검증할 수 없습니다: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "암호화 엔진을 초기화하는 데 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 문맥을 초기화하는 데 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "잘못된 IV 길이입니다(최소한 %d 이상이어야 함)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "해독용 암호 슬롯을 할당하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "해독을 위한 대칭키를 설정하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "해독을 위한 IV를 설정하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "해독 문맥을 초기화하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "비밀 키를 해독하는 데 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "비밀 키를 해독하는 데 실패했습니다: 해독 데이터가 너무 큽니다." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "비밀 키의 해독을 마무리하는 데 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "암호화 암호 슬롯을 초기화하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "암호화를 위한 대칭키를 설정하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "암호화를 위한 IV를 설정하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "암호화 문맥을 초기화하는 데 실패했습니다." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "암호화에 실패했습니다: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "암호화 후 데이터 크기가 예상과 다릅니다." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "인증서를 복호화할 수 없습니다: %d." + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "암호를 UCS2로 변환할 수 없습니다: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 복호기를 초기화할 수 없습니다: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 파일을 복호화할 수 없습니다: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 파일을 검증할 수 없습니다: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "랜덤 데이터를 생성할 수 없습니다." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "암호화 키를 생성할 메모리가 부족합니다." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM 파일 생성을 위한 메모리를 할당할 수 없습니다." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IV를 PEM 파일에 쓰기 위한 메모리를 할당할 수 없습니다." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "암호화된 키를 PEM 파일에 기록하기 위한 메모리를 할당할 수 없습니다." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM 파일 데이터를 위한 메모리를 할당할 수 없습니다." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "넷링크 메시지를 처리하는 중 오류: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "소켓에서 데이터를 기다리는 동안 오류가 발생했습니다" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "회선 상태를 감시하는 넷링크에 연결할 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "넷링크 핸들을 통한 암호정보 전달을 사용 할 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "회선 상태를 감시하는 넷링크 핸들을 할당 할 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "회선 상태를 감시하는 넷링크 링크 캐시를 만들 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "넷링크 그룹에 합류할 수 없습니다: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "넷링크 캐시를 갱신하는 중 오류가 발생했습니다: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "잘못된 옵션. 올바른 옵션의 목록을 보려면 --help 옵션을 이용하십시오.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. 올바른 옵션의 목록을 보려면 --help 옵션을 이용하십시오.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager가 생성함\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s에서 병합됨\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "사용 가능한 DHCP 클라이언트를 찾을 수 없습니다." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient'를 찾을 수 없습니다." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd'를 찾을 수 있습니다." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "지원하지 않는 DHCP 클라이언트 '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "알려지지 않은 로그 수준 '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "알려지지 않은 로그 영역 '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "주의: libc 주소 검색은 3개를 초과하는 네임서버를 지원하지 않을 수 있습니다." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "아래 열거된 네임서버를 인식하지 못할 수 있습니다." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "자동 %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "시스템" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "보호된 WiFi 네트워크를 통한 연결 공유" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "열린 WiFi 네트워크를 통한 연결 공유" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "영구적인 시스템 호스트명을 변경합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "시스템 연결을 변경합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "시스템 정책이 시스템 설정을 변경하는 것을 금지합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "시스템 정책이 호스트 이름을 영구히 변경하는 것을 금지합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "시스템 정책이 보호된 WiFi 네트워크를 통한 연결 공유를 금지합니다" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "시스템 정책이 열린 WiFi 네트워크를 통한 연결 공유를 금지합니다" + diff --git a/po/ku.po b/po/ku.po new file mode 100644 index 00000000..8856c085 --- /dev/null +++ b/po/ku.po @@ -0,0 +1,904 @@ +# Kurdish translation for network-manager +# Copyright (c) 2007 Rosetta Contributors and Canonical Ltd 2007 +# This file is distributed under the same license as the network-manager package. +# FIRST AUTHOR , 2007. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: network-manager\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2006-05-18 02:36+0000\n" +"PO-Revision-Date: 2007-01-02 21:47+0000\n" +"Last-Translator: Erdal Ronahi \n" +"Language-Team: Kurdish \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-Rosetta-Export-Date: 2007-01-03 01:08+0000\n" + +#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:923 +#, c-format +msgid "Passphrase for wireless network %s" +msgstr "" + +#: ../gnome/applet/applet-dbus.c:265 +#, c-format +msgid "Connection to the wireless network '%s' failed." +msgstr "" + +#: ../gnome/applet/applet-dbus.c:270 +msgid "Connection to the wired network failed." +msgstr "" + +#: ../gnome/applet/applet.c:184 +msgid "Error displaying connection information:" +msgstr "" + +#: ../gnome/applet/applet.c:202 +msgid "Could not find some required resources (the glade file)!" +msgstr "" + +#: ../gnome/applet/applet.c:213 +msgid "No active connections!" +msgstr "Girêdanên çalak tune!" + +#: ../gnome/applet/applet.c:234 +#, c-format +msgid "Wired Ethernet (%s)" +msgstr "" + +#: ../gnome/applet/applet.c:236 +#, c-format +msgid "Wireless Ethernet (%s)" +msgstr "" + +#: ../gnome/applet/applet.c:337 ../gnome/applet/applet.c:362 +msgid "NetworkManager Applet" +msgstr "Sepanoka NetworkManager" + +#: ../gnome/applet/applet.c:339 ../gnome/applet/applet.c:364 +msgid "Copyright © 2004-2005 Red Hat, Inc." +msgstr "" + +#: ../gnome/applet/applet.c:340 ../gnome/applet/applet.c:365 +msgid "" +"Notification area applet for managing your network devices and connections." +msgstr "" + +#: ../gnome/applet/applet.c:343 ../gnome/applet/applet.c:370 +msgid "translator-credits" +msgstr "" + +#: ../gnome/applet/applet.c:418 +msgid "Stop automatically running the networking applet?" +msgstr "" + +#: ../gnome/applet/applet.c:419 +msgid "" +"The networking applet will now terminate, but will automatically launch the " +"next time you login. Would you like to stop automatically running the " +"networking applet on login?" +msgstr "" + +#: ../gnome/applet/applet.c:506 +msgid "VPN Login Failure" +msgstr "" + +#: ../gnome/applet/applet.c:507 +#, c-format +msgid "Could not start the VPN connection '%s' due to a login failure." +msgstr "" + +#: ../gnome/applet/applet.c:511 +msgid "VPN Start Failure" +msgstr "" + +#: ../gnome/applet/applet.c:512 +#, c-format +msgid "" +"Could not start the VPN connection '%s' due to a failure launching the VPN " +"program." +msgstr "" + +#: ../gnome/applet/applet.c:516 ../gnome/applet/applet.c:526 +msgid "VPN Connect Failure" +msgstr "" + +#: ../gnome/applet/applet.c:517 +#, c-format +msgid "Could not start the VPN connection '%s' due to a connection error." +msgstr "" + +#: ../gnome/applet/applet.c:521 +msgid "VPN Configuration Error" +msgstr "" + +#: ../gnome/applet/applet.c:522 +#, c-format +msgid "The VPN connection '%s' was not correctly configured." +msgstr "" + +#: ../gnome/applet/applet.c:527 +#, c-format +msgid "" +"Could not start the VPN connection '%s' because the VPN server did not " +"return an adequate network configuration." +msgstr "" + +#: ../gnome/applet/applet.c:597 +msgid "VPN Login Message" +msgstr "" + +#: ../gnome/applet/applet.c:821 ../gnome/applet/applet.c:2593 +#: ../gnome/applet/other-network-dialog.c:453 +#: ../gnome/applet/passphrase-dialog.c:229 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" + +#: ../gnome/applet/applet.c:833 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "" + +#: ../gnome/applet/applet.c:841 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "" + +#: ../gnome/applet/applet.c:988 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "" + +#: ../gnome/applet/applet.c:990 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "" + +#: ../gnome/applet/applet.c:998 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "" + +#: ../gnome/applet/applet.c:1000 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "" + +#: ../gnome/applet/applet.c:1008 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "" + +#: ../gnome/applet/applet.c:1016 ../gnome/applet/applet.c:1026 +msgid "Requesting a network address from the wired network..." +msgstr "" + +#: ../gnome/applet/applet.c:1018 ../gnome/applet/applet.c:1028 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "" + +#: ../gnome/applet/applet.c:1036 +msgid "Finishing connection to the wired network..." +msgstr "" + +#: ../gnome/applet/applet.c:1038 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "" + +#: ../gnome/applet/applet.c:1155 +msgid "NetworkManager is not running" +msgstr "" + +#: ../gnome/applet/applet.c:1163 ../gnome/applet/applet.c:1906 +msgid "Networking disabled" +msgstr "" + +#: ../gnome/applet/applet.c:1168 +msgid "No network connection" +msgstr "Girêdana torê tune" + +#: ../gnome/applet/applet.c:1173 +msgid "Wired network connection" +msgstr "Girêdana torê ya biqablo" + +#: ../gnome/applet/applet.c:1177 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "" + +#: ../gnome/applet/applet.c:1179 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "" + +#: ../gnome/applet/applet.c:1200 +#, c-format +msgid "VPN connection to '%s'" +msgstr "" + +#: ../gnome/applet/applet.c:1208 +#, c-format +msgid "VPN connecting to '%s'" +msgstr "" + +#: ../gnome/applet/applet.c:1621 +msgid "_Connect to Other Wireless Network..." +msgstr "" + +#: ../gnome/applet/applet.c:1642 +msgid "Create _New Wireless Network..." +msgstr "" + +#: ../gnome/applet/applet.c:1763 +msgid "_VPN Connections" +msgstr "" + +#: ../gnome/applet/applet.c:1808 +msgid "_Configure VPN..." +msgstr "" + +#: ../gnome/applet/applet.c:1812 +msgid "_Disconnect VPN..." +msgstr "" + +#: ../gnome/applet/applet.c:1834 +msgid "_Dial Up Connections" +msgstr "" + +#: ../gnome/applet/applet.c:1845 +#, c-format +msgid "Connect to %s..." +msgstr "Bi %s re girêbide..." + +#: ../gnome/applet/applet.c:1851 +#, c-format +msgid "Disconnect from %s..." +msgstr "" + +#: ../gnome/applet/applet.c:1900 +msgid "No network devices have been found" +msgstr "" + +#: ../gnome/applet/applet.c:2092 +msgid "NetworkManager is not running..." +msgstr "" + +#: ../gnome/applet/applet.c:2248 +msgid "Enable _Networking" +msgstr "_Torê Çalak bike" + +#: ../gnome/applet/applet.c:2254 +msgid "Enable _Wireless" +msgstr "_Bêqablo Çalak bike" + +#: ../gnome/applet/applet.c:2260 +msgid "Connection _Information" +msgstr "_Agahiya Girêdanê" + +#: ../gnome/applet/applet.c:2271 +msgid "_Help" +msgstr "_Alîkarî" + +#: ../gnome/applet/applet.c:2280 +msgid "_About" +msgstr "_Der barê de" + +#: ../gnome/applet/applet.c:2287 +msgid "_Remove" +msgstr "_Rake" + +#: ../gnome/applet/applet.c:2712 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "" + +#: ../gnome/applet/wireless-security-option.c:157 +msgid "Open System" +msgstr "Pergalê Vekirî" + +#: ../gnome/applet/wireless-security-option.c:160 +msgid "Shared Key" +msgstr "" + +#: ../gnome/applet/wireless-security-option.c:208 +msgid "Automatic (Default)" +msgstr "" + +#: ../gnome/applet/wireless-security-option.c:215 +msgid "AES-CCMP" +msgstr "" + +#: ../gnome/applet/wireless-security-option.c:223 +msgid "TKIP" +msgstr "" + +#: ../gnome/applet/wireless-security-option.c:231 +msgid "Dynamic WEP" +msgstr "" + +#: ../gnome/applet/wso-none.c:53 +msgid "None" +msgstr "Tune" + +#: ../gnome/applet/wso-wep-ascii.c:138 +msgid "WEP 64/128-bit ASCII" +msgstr "" + +#: ../gnome/applet/wso-wep-hex.c:135 +msgid "WEP 64/128-bit Hex" +msgstr "" + +#: ../gnome/applet/wso-wep-passphrase.c:135 +msgid "WEP 128-bit Passphrase" +msgstr "" + +#: ../gnome/applet/wso-wpa-eap.c:237 +msgid "PEAP" +msgstr "" + +#: ../gnome/applet/wso-wpa-eap.c:238 +msgid "TLS" +msgstr "" + +#: ../gnome/applet/wso-wpa-eap.c:239 +msgid "TTLS" +msgstr "" + +#: ../gnome/applet/wso-wpa-eap.c:247 ../src/nm-ap-security-wpa-eap.c:92 +#: ../src/nm-ap-security-wpa-eap.c:116 +msgid "WPA2 Enterprise" +msgstr "" + +#: ../gnome/applet/wso-wpa-eap.c:249 ../src/nm-ap-security-wpa-eap.c:94 +#: ../src/nm-ap-security-wpa-eap.c:121 +msgid "WPA Enterprise" +msgstr "" + +#: ../gnome/applet/wso-wpa-psk.c:178 +msgid "WPA2 Personal" +msgstr "" + +#: ../gnome/applet/wso-wpa-psk.c:180 +msgid "WPA Personal" +msgstr "" + +#: ../gnome/applet/eggtrayicon.c:134 +msgid "Orientation" +msgstr "" + +#: ../gnome/applet/eggtrayicon.c:135 +msgid "The orientation of the tray." +msgstr "" + +#: ../gnome/applet/menu-items.c:87 +#, c-format +msgid "Wired Network (%s)" +msgstr "Tora Biqablo (%s)" + +#: ../gnome/applet/menu-items.c:90 +msgid "_Wired Network" +msgstr "Tora Bi_qablo" + +#: ../gnome/applet/menu-items.c:161 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Tora Bêqablo (%s)" +msgstr[1] "Torên Bêqablo (%s)" + +#: ../gnome/applet/menu-items.c:163 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Tora Bêqablo (%s)" +msgstr[1] "Torên Bêqablo (%s)" + +#: ../gnome/applet/menu-items.c:330 +msgid " (invalid Unicode)" +msgstr " (Unicode a nederbasdar)" + +#: ../gnome/applet/other-network-dialog.c:352 +#, c-format +msgid "" +"By default, the wireless network's name is set to your computer's name, %s, " +"with no encryption enabled" +msgstr "" + +#: ../gnome/applet/other-network-dialog.c:358 +msgid "Create new wireless network" +msgstr "" + +#: ../gnome/applet/other-network-dialog.c:359 +msgid "" +"Enter the name and security settings of the wireless network you wish to " +"create." +msgstr "" + +#: ../gnome/applet/other-network-dialog.c:363 +msgid "Create New Wireless Network" +msgstr "" + +#: ../gnome/applet/other-network-dialog.c:368 +msgid "Existing wireless network" +msgstr "" + +#: ../gnome/applet/other-network-dialog.c:369 +msgid "Enter the name of the wireless network to which you wish to connect." +msgstr "" + +#: ../gnome/applet/other-network-dialog.c:371 +msgid "Connect to Other Wireless Network" +msgstr "" + +#: ../gnome/applet/passphrase-dialog.c:216 +msgid "Error connecting to wireless network" +msgstr "" + +#: ../gnome/applet/passphrase-dialog.c:217 +msgid "" +"The requested wireless network requires security capabilities unsupported by " +"your hardware." +msgstr "" + +#: ../gnome/applet/vpn-password-dialog.c:152 +#: ../gnome/applet/vpn-password-dialog.c:189 +#, c-format +msgid "Cannot start VPN connection '%s'" +msgstr "" + +#: ../gnome/applet/vpn-password-dialog.c:155 +#, c-format +msgid "" +"Could not find the authentication dialog for VPN connection type '%s'. " +"Contact your system administrator." +msgstr "" + +#: ../gnome/applet/vpn-password-dialog.c:192 +#, c-format +msgid "" +"There was a problem launching the authentication dialog for VPN connection " +"type '%s'. Contact your system administrator." +msgstr "" + +#: ../gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: ../gnome/applet/applet.glade.h:2 +msgid "" +"Active Connection Information" +msgstr "" + +#: ../gnome/applet/applet.glade.h:4 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network " +"'%s'." +msgstr "" + +#: ../gnome/applet/applet.glade.h:8 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" + +#: ../gnome/applet/applet.glade.h:12 +#, no-c-format +msgid "" +"Wireless Network Login " +"Confirmation\n" +"\n" +"You have chosen to log in to the wireless network '%s'. If you are sure " +"that this wireless network is secure, click the checkbox below and " +"NetworkManager will not require confirmation on subsequent log ins." +msgstr "" + +#: ../gnome/applet/applet.glade.h:15 +msgid "Anonymous Identity:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:16 +msgid "Authentication:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:17 +msgid "Broadcast Address:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:18 +msgid "CA Certificate File:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:19 +msgid "C_onnect" +msgstr "_Girêbide" + +#: ../gnome/applet/applet.glade.h:20 +msgid "Client Certificate File:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:21 +msgid "Connection Information" +msgstr "" + +#: ../gnome/applet/applet.glade.h:22 +msgid "Default Route:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:23 +msgid "Destination Address:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:24 +msgid "Driver:" +msgstr "Ajoger:" + +#: ../gnome/applet/applet.glade.h:25 +msgid "EAP Method:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:26 +msgid "Hardware Address:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:27 +msgid "IP Address:" +msgstr "Navnîşana IP:" + +#: ../gnome/applet/applet.glade.h:28 +msgid "Identity:" +msgstr "Nasname:" + +#: ../gnome/applet/applet.glade.h:29 +msgid "Interface:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:30 +msgid "Key Type:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:31 +msgid "Key:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:32 +msgid "" +"None\n" +"WEP 128-bit Passphrase\n" +"WEP 64/128-bit Hex\n" +"WEP 64/128-bit ASCII\n" +msgstr "" + +#: ../gnome/applet/applet.glade.h:37 +msgid "" +"Open System\n" +"Shared Key" +msgstr "" + +#: ../gnome/applet/applet.glade.h:39 +msgid "Other Wireless Network..." +msgstr "" + +#: ../gnome/applet/applet.glade.h:40 +msgid "Passphrase:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:41 +msgid "Password:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:42 +msgid "Primary DNS:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:43 +msgid "Private Key File:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:44 +msgid "Private Key Password:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:45 +msgid "Secondary DNS:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:46 +msgid "Select the CA Certificate File" +msgstr "" + +#: ../gnome/applet/applet.glade.h:47 +msgid "Select the Client Certificate File" +msgstr "" + +#: ../gnome/applet/applet.glade.h:48 +msgid "Select the Private Key File" +msgstr "" + +#: ../gnome/applet/applet.glade.h:49 +msgid "Show key" +msgstr "" + +#: ../gnome/applet/applet.glade.h:50 +msgid "Show passphrase" +msgstr "" + +#: ../gnome/applet/applet.glade.h:51 +msgid "Show password" +msgstr "" + +#: ../gnome/applet/applet.glade.h:52 +msgid "Show passwords" +msgstr "" + +#: ../gnome/applet/applet.glade.h:53 +msgid "Speed:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:54 +msgid "Subnet Mask:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:55 +msgid "Type:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:56 +msgid "User Name:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:57 +msgid "Wireless Network Key Required" +msgstr "" + +#: ../gnome/applet/applet.glade.h:58 +msgid "Wireless _adapter:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:59 +msgid "_Always Trust this Wireless Network" +msgstr "" + +#: ../gnome/applet/applet.glade.h:60 +msgid "_Don't remind me again" +msgstr "" + +#: ../gnome/applet/applet.glade.h:61 +msgid "_Login to Network" +msgstr "" + +#: ../gnome/applet/applet.glade.h:62 +msgid "_Network Name:" +msgstr "" + +#: ../gnome/applet/applet.glade.h:63 +msgid "_Wireless Security:" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:361 +msgid "Cannot add VPN connection" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:363 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:415 +msgid "Cannot import VPN connection" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:417 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:557 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:560 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:717 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:720 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:928 +msgid "Unable to load" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:930 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:1038 +msgid "Edit VPN Connection" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Choose which type of VPN connection you wish to create." +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "Connect to:" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Create VPN Connection" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Create VPN Connection - 1 of 2" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Create VPN Connection - 2 of 2" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Delete the selected VPN connection" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "E_xport" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:9 +msgid "Edit the selected VPN connection" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:10 +msgid "Export the VPN settings to a file" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:11 +msgid "Export the selected VPN connection to a file" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:12 +msgid "Finish Creating VPN Connection" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:13 +msgid "Manage Virtual Private Network Connections" +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:14 +msgid "" +"This assistant will guide you through the creation of a connection to a " +"Virtual Private Network (VPN).\n" +"\n" +"It will require some information, such as IP addresses and secrets. Please " +"see your system administrator to obtain this information." +msgstr "" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:17 +msgid "VPN Connections" +msgstr "" + +#: ../src/nm-ap-security-wep.c:47 +msgid "40-bit WEP" +msgstr "" + +#: ../src/nm-ap-security-wep.c:49 +msgid "104-bit WEP" +msgstr "" + +#: ../src/nm-ap-security-wpa-psk.c:50 +msgid "WPA TKIP" +msgstr "" + +#: ../src/nm-ap-security-wpa-psk.c:52 +msgid "WPA CCMP" +msgstr "" + +#: ../src/nm-ap-security-wpa-psk.c:54 +msgid "WPA Automatic" +msgstr "" + +#: ../src/nm-ap-security-wpa-psk.c:59 +msgid "WPA2 TKIP" +msgstr "" + +#: ../src/nm-ap-security-wpa-psk.c:61 +msgid "WPA2 CCMP" +msgstr "" + +#: ../src/nm-ap-security-wpa-psk.c:63 +msgid "WPA2 Automatic" +msgstr "" + +#: ../src/nm-ap-security.c:320 +msgid "none" +msgstr "" + +#: ../src/nm-netlink-monitor.c:154 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" + +#: ../src/nm-netlink-monitor.c:172 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" + +#: ../src/nm-netlink-monitor.c:405 +msgid "operation took too long" +msgstr "" + +#: ../src/nm-netlink-monitor.c:502 +msgid "received data from wrong type of sender" +msgstr "" + +#: ../src/nm-netlink-monitor.c:515 +msgid "received data from unexpected sender" +msgstr "" + +#: ../src/nm-netlink-monitor.c:646 +msgid "too much data was sent over socket and some of it was lost" +msgstr "" + +#: ../src/nm-netlink-monitor.c:735 +msgid "error occurred while waiting for data on socket" +msgstr "" + +#: ../gnome/applet/applet-dbus-devices.c:897 +#, c-format +msgid "You are now connected to the Ad-Hoc wireless network '%s'." +msgstr "" + +#: ../gnome/applet/applet-dbus-devices.c:902 +#, c-format +msgid "You are now connected to the wireless network '%s'." +msgstr "" + +#: ../gnome/applet/applet-dbus-devices.c:909 +msgid "You are now connected to the wired network." +msgstr "" + +#: ../gnome/applet/applet-dbus-devices.c:915 +msgid "Connection Established" +msgstr "Girêdan Pêkhat" + +#: ../gnome/applet/applet-dbus-devices.c:958 +msgid "Disconnected" +msgstr "Negirêdayî" + +#: ../gnome/applet/applet-dbus-devices.c:959 +msgid "The network connection has been disconnected." +msgstr "" \ No newline at end of file diff --git a/po/lt.po b/po/lt.po new file mode 100644 index 00000000..70212c82 --- /dev/null +++ b/po/lt.po @@ -0,0 +1,1861 @@ +# Lithuanian translation of NetworkManager. +# Copyright (C) 2005-2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the NetworkManager package. +# Žygimantas Beručka , 2005-2006, 2008, 2010. +# Aurimas Černius , 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager HEAD\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=Networ" +"kManager&component=general\n" +"POT-Creation-Date: 2010-06-28 08:52+0000\n" +"PO-Revision-Date: 2010-07-15 14:09+0300\n" +"Last-Translator: Aurimas Černius \n" +"Language-Team: Lithuanian \n" +"Language: lt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: UTF-8\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%" +"100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Virtaal 0.6.1\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "PAVADINIMAS" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "ĮRENGINIAI" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SRITIS" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "NUMATYTASIS" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-TARNYBA" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECTAS" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TIPAS" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "LAIKO-ŽYMA" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "LAIKO-ŽYMA-TIKROJI" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOPRISIJUNGIMAS" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "TIKSKAITOMA" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Naudojimas: nmcli con { KOMANDA | help }\n" +" KOMANDA := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Klaida: „con list“: %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Klaida: „con list“: %s; leidžiami laukai: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Ryšio informacija" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "sisteminis" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "naudotojo" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "niekada" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:551 ../cli/src/settings.c:652 +#: ../cli/src/settings.c:926 ../cli/src/settings.c:927 +#: ../cli/src/settings.c:929 ../cli/src/settings.c:931 +#: ../cli/src/settings.c:1056 ../cli/src/settings.c:1057 +#: ../cli/src/settings.c:1058 ../cli/src/settings.c:1137 +#: ../cli/src/settings.c:1138 ../cli/src/settings.c:1139 +#: ../cli/src/settings.c:1140 ../cli/src/settings.c:1141 +#: ../cli/src/settings.c:1142 ../cli/src/settings.c:1143 +#: ../cli/src/settings.c:1144 ../cli/src/settings.c:1145 +#: ../cli/src/settings.c:1146 ../cli/src/settings.c:1147 +#: ../cli/src/settings.c:1148 ../cli/src/settings.c:1149 +#: ../cli/src/settings.c:1224 +msgid "yes" +msgstr "taip" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:508 +#: ../cli/src/settings.c:510 ../cli/src/settings.c:551 +#: ../cli/src/settings.c:652 ../cli/src/settings.c:926 +#: ../cli/src/settings.c:927 ../cli/src/settings.c:929 +#: ../cli/src/settings.c:931 ../cli/src/settings.c:1056 +#: ../cli/src/settings.c:1057 ../cli/src/settings.c:1058 +#: ../cli/src/settings.c:1137 ../cli/src/settings.c:1138 +#: ../cli/src/settings.c:1139 ../cli/src/settings.c:1140 +#: ../cli/src/settings.c:1141 ../cli/src/settings.c:1142 +#: ../cli/src/settings.c:1143 ../cli/src/settings.c:1144 +#: ../cli/src/settings.c:1145 ../cli/src/settings.c:1146 +#: ../cli/src/settings.c:1147 ../cli/src/settings.c:1148 +#: ../cli/src/settings.c:1149 ../cli/src/settings.c:1224 +msgid "no" +msgstr "ne" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Sistemos ryšiai" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Naudotojo ryšiai" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Klaida: trūksta argumento %s." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Klaida: ryšio %s nėra." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Nežinomas parametras: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Klaida: nenurodyta tinkamų parametrų." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Klaida: %s" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Klaida: „con status“: %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Klaida: „con status“: %s; leidžiami laukai: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Aktyvūs ryšiai" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "nėra aktyvaus ryšio įrenginyje „%s“" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "nėra aktyvaus ryšio įrenginyje" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "įrenginys „%s“ nesuderinamas su ryšiu „%s“" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "nerastas įrenginys ryšiui „%s“" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "aktyvuojama" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "aktyvuota" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:473 +msgid "unknown" +msgstr "nežinoma" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN jungiamasi (ruošiama)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN jungiamasi (reikia nustatyti tapatybę)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN jungiamasi" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN jungiamasi (gaunama IP konfigūracija)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN prisijungta" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN prisijungti nepavyko" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN atsijungta" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "nežinoma priežastis" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "jokia" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "naudotojas buvo atjungtas" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "bazinis tinklo ryšys buvo pertrauktas" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN tarnyba netikėtai sustojo" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN tarnyba grąžino netinkamą konfigūraciją" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "bandymo jungtis laikas baigėsi" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN tarnyba nebuvo paleista laiku" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "nepavyko paleisti VPN tarnybos" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "nėra tinkamų VPN paslapčių" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "netinkamos VPN paslaptys" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "ryšys buvo pašalintas" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "būsena: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Ryšys aktyvuotas\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Klaida: nepavyko aktyvuoti ryšio." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "būsena: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Klaida: nepavyko aktyvuoti ryšio: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Klaida: baigėsi %d sek. laikas." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Klaida: nepavyko aktyvuoti ryšio: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Klaida: nepavyko „%s“ gauti aktyvaus ryšio." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Aktyvaus ryšio būsena: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Aktyvaus ryšio kelias: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Klaida: nežinomas ryšys: %s" + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Klaida: netinkama laukimo laiko reikšmė „%s“." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Klaida: id arba uuid turi būti nurodytas." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Klaida: nerastas tinkamas įrenginys: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Klaida: nerastas tinkamas įrenginys." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Įspėjimas: ryšys neaktyvus\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Klaida: netinkama „con“ komanda „%s“." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Klaida: nepavyko prisijungti prie D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Klaida: nepavyko gauti sistemos nustatymų." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Klaida: nepavyko gauti naudotojo nustatymų." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Klaida: nepavyko gauti ryšių: nustatymų tarnybos neveikia." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "ĮRENGINYS" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "BŪSENA" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "BENDRA" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "GEBOS" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-SAVYBĖS" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "LAIDINIO-TINKLO-SAVYBĖS" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-PARAMETRAI" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "TVARKYKLĖ" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "APARATINIS-ADRESAS" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "NEŠLIO-APTIKIMAS" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPARTA" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "NEŠLYS" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADRESAS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PRIEŠDĖLIS" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "ŠLIUZAS" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "VEIKSENA" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "DAŽNIS" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "DAŽNUMAS" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNALAS" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SAUGA" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-ŽYMOS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-ŽYMOS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "AKTYVUS" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Naudojimas: nmcli dev { KOMANDA | help }\n" +"\n" +" KOMANDA := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "nevaldomas" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "neprieinamas" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "atjungtas" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "jungiamasi (ruošiama)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "jungiamasi (konfigūruojama)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "jungiamasi (reikia nustatyti tapatybę)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "jungiamasi (gaunama IP konfigūracija)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "prisijungta" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "prisijungti nepavyko" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "Nežinoma" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(jokios)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: klaida konvertuojant IP4 adresą 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Šifruota: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP" + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA" + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2" + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Kompanija " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Infrastruktūra" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Klaida: „dev list“: %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Klaida: „dev list“: %s; leidžiami laukai: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Įrenginio informacija" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(nežinoma)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "nežinoma)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "įjungta" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "išjungta" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Klaida: „dev status“: %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Klaida: „dev status“: %s; leidžiami laukai: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Įrenginių būsena" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Klaida: trūksta argumento „%s“." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Klaida: nerastas įrenginys „%s“." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Pavyko: sėkmingai atjungtas įrenginys „%s“." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Klaida: įrenginio „%s“ (%s) atjungti nepavyko: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Įrenginio būsena: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Klaida: turi būti nurodytas iface." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Klaida: „dev wifi“: %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Klaida: „dev wifi“: %s; leidžiami laukai: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi skenavimo sąrašas" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Klaida: nerastas prieigos taškas su hwaddr „%s“." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Klaida: „%s“ nėra WiFi įrenginys " + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Klaida: netinkama „dev wifi“ komanda „%s“." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Klaida: netinkama „dev“ komanda „%s“." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "VEIKIA" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-APARATINĖ-ĮRANGA" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-APARATINĖ-ĮRANGA" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Naudojimas: nmcli nm { KOMANDA | help }\n" +"\n" +" KOMANDA := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "miegantis" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "jungiamasi" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Klaida: „nm status“: %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Klaida: „nm status“: %s; leidžiami laukai: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager būsena" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "įjungta" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "išjungta" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "veikia" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "neveikia" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Klaida: „--fields“ reikšmė „%s“ čia netinkama; leidžiami laukai: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi įjungtas" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Klaida: netinkamas „wifi“ parametras: „%s“." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN įjungta" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Klaida: netinkamas „wwan“ parametras: „%s“." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Klaida: netinkama „nm“ komanda „%s“." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Naudojimas: %s [PARINKTYS] OBJEKTAS { KOMANDA | help }\n" +"\n" +"PARINKTYS\n" +" -t[erse] trumpa išvestis\n" +" -p[retty] graži išvestis\n" +" -m[ode] tabular|multiline išvedimo veiksena\n" +" -f[fields] |all|common nurodyti išvedamus laukus\n" +" -e[scape] yes|no atlikti stulpelių skirtukų " +"kaitą\n" +" -v[ersion] rodyti programos versiją\n" +" -h[elp] išvesti šią pagalbą\n" +"\n" +"OBJEKTAS\n" +" nm NetworkManager būsena\n" +" con NetworkManager ryšiai\n" +" dev NetworkManager valdomi įrenginiai\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Klaida: nežinomas objektas „%s“, bandykite „nmcli help“." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Klaida: parinktis „--terse“ nurodyta antrą kartą." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Klaida: parinktis „--terse“ yra tarpusavyje nesuderinama su „--pretty“." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Klaida: parinktis „--pretty“ nurodyta antrą kartą." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Klaida: parinktis „--pretty“ yra tarpusavyje nesuderinama su „--terse“." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Klaida: trūksta argumento parinkčiai „%s“." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Klaida: „%s“ yra netinkamas argumentas parinkčiai „%s“." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Klaida: trūksta laukų parinktims „%s“." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli įrankis, versija %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Klaida: nežinoma parinktis „%s“, bandykite „nmcli -help“." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Gautas signalas %d, išjungiama..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Klaida: nepavyko prisijungti prie NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Pavyko" + +#: ../cli/src/settings.c:411 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (šešioliktainis ascii raktas)" + +#: ../cli/src/settings.c:413 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128 bitų slaptažodis)" + +#: ../cli/src/settings.c:416 +#, c-format +msgid "%d (unknown)" +msgstr "%d (nežinoma)" + +#: ../cli/src/settings.c:442 +msgid "0 (unknown)" +msgstr "0 (nežinoma)" + +#: ../cli/src/settings.c:448 +msgid "any, " +msgstr "bet koks, " + +#: ../cli/src/settings.c:450 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:454 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:456 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:468 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:470 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:554 ../cli/src/settings.c:721 +msgid "auto" +msgstr "automatinis" + +#: ../cli/src/settings.c:716 ../cli/src/settings.c:719 +#: ../cli/src/settings.c:720 ../cli/src/utils.c:172 +msgid "not set" +msgstr "nenustatyta" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "laukas „%s“ turi būti vienintelis" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "netinkamas laukas „%s“" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Parinktis „--terse“ reikalauja nurodyti „--fields“" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"Parinktis „--terse“ reikalauja konkrečių parinkties „--fields“ reikšmių, ne " +"„%s“" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM rakto faile nėra pabaigos gairės „%s“." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Nepanašu į PEM asmeninio rakto failą." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Nepakanka atminties PEM failo duomenų saugojimui." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Netinkamai suformuotas PEM failas: Proc-Type buvo ne pirma gairė." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Netinkamai suformuotas PEM failas: nežinoma Proc-Type gairė „%s“." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Netinkamai suformuotas PEM failas: DEK-Info buvo ne antra gairė." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Netinkamai suformuotas PEM failas: DEK-Info gairėje nerasta IV." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" +"Netinkamai suformuotas PEM failas: DEK-Info gairėje netinkamas IV formatas." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "" +"Netinkamai suformuotas PEM failas: nežinomas asmeninio rakto šifras „%s“." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Nepavyko iškoduoti asmeninio rakto." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM liudijime „%s“ nėra pabaigos gairės „%s“." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Nepavyko iškoduoti liudijimo." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Nepakanka atminties liudijimo duomnų saugojimui." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Nepakanka atminties įrašyti failo duomenis." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ilgis turi būti lyginis baitų skaičius." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Nepakanka atminties IV saugojimui." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV yra ne šešioliktainių skaitmenų." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Asmeninio rakto šifras „%s“ nežinomas." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Nepakanka atminties iššifruoti asmeninį raktą." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Nepavyko nustatyti asmeninio rakto tipo." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Nepakanka atminties iššifruoto asmeninio rakto saugojimui." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Nepavyko inicijuoti šifravimo posistemės." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Nepavyko inicijuoti MD5 posistemės: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Netinkamas IV ilgis (turi būti bent %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Nepakanka atminties iššifruoto rakto buferiui." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Nepavyko inicijuoti iššifravimo šifro konteksto: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Nepavyko iššifravimui nustatyti simetriško rakto: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Nepavyko iššifravimui nustatyti IV: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Nepavyko iššifruoti asmeninio rakto: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Nepavyko iššifruoti asmeninio rakto: netikėtas užpildo ilgis." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Nepavyko iššifruoti asmeninio rakto." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Nepavyko išskirti atminties šifravimui." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Nepavyko inicijuoti šifravimo šifro konteksto: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Nepavyko šifravimui nustatyti simetriško rakto: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Nepavyko šifravimui nustatyti IV: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Nepavyko šifruoti duomenų: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Klaida inicijuojant liudijimo duomenis: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Nepavyko iškoduoti liudijimo: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Nepavyko inicializuoti PKCS#12 dekoderio: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Nepavyko iškoduoti PKCS#12 failo: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Nepavyko patvirtinti PKCS#12 failo: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Nepavyko inicijuoti šifravimo posistemės: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Nepavyko inicijuoti MD5 konteksto: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Netinkamas IV ilgis (turi būti bent %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Nepavyko inicijuoti iššifravimo šifro lizdo." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Nepavyko iššifravimui nustatyti simetriško rakto." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Nepavyko iššifravimui nustatyti IV." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Nepavyko inicijuoti iššifravimo konteksto." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Nepavyko iššifruoti asmeninio rakto: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Nepavyko iššifruoti asmeninio rakto: iššifruoti duomenys per dideli." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Nepavyko baigti asmeninio rakto iššifravimo: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Nepavyko inicijuoti šifravimo šifro lizdo." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Nepavyko šifravimui nustatyti simetriško rakto." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Nepavyko šifravimui nustatyti IV." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Nepavyko inicijuoti šifravimo konteksto." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Nepavyko šifruoti: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Netikėtas duomenų kiekis po šifravimo." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Nepavyko iškoduoti liudijimo: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Nepavyko konvertuoti slaptažodžio į UCS-2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Nepavyko inicializuoti PKCS#12 dekoderio: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Nepavyko iškoduoti PKCS#12 failo: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Nepavyko patvirtinti PKCS#12 failo: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Nepavyko sugeneruoti atsitiktinių duomenų." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Nepakanka atminties šifravimo raktui sukurti." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Nepakanka atminties PEM failui sukurti." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Nepakanka atminties IV įrašyti į PEM failą." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Nepakanka atminties šifruotam raktui įrašyti į PEM failą." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Nepakanka atminties PEM failo duomenims." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Dalijimasis ryšiu naudojant apsaugotą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Dalijimasis ryšiu naudojant atvirą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Keisti pastovų sistemos vardą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Keisti sistemos ryšius" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistemos politika neleidžia keisti sistemos nustatymų" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistemos politika neleidžia keisti įsiminto sistemos vardo" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Sistemos politika nelaidžia dalytis ryšiais naudojant apsaugotą WiFi tinklą" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Sistemos politika neleidžia dalytis ryšiais naudojant atvirą WiFi tinklą" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:1 +msgid "Allow control of network connections" +msgstr "Leisti valdyti tinklo ryšius" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:2 +msgid "Allow use of user-specific connections" +msgstr "Leisti naudoti pasirinktinius naudotojo ryšius" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:3 +msgid "Enable or disable WiFi devices" +msgstr "Įjungti arba išjungti WiFi įrenginius" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:4 +msgid "Enable or disable mobile broadband devices" +msgstr "Įjungti arba išjungti mobiliojo plačiajuosčio ryšio įrenginius" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:5 +msgid "Enable or disable system networking" +msgstr "Įjungti arba išjungti sistemos prieigą prie tinklo" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:6 +msgid "" +"Put NetworkManager to sleep or wake it up (should only be used by system " +"power management)" +msgstr "" +"Užmigdyti arba pažadinti NetworkManager (tai turėtų naudoti tik sistemos " +"energijos valdymo posistemė)" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:7 +msgid "System policy prevents control of network connections" +msgstr "Sistemos politika neleidžia valdyti tinklo ryšių" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:8 +msgid "System policy prevents enabling or disabling WiFi devices" +msgstr "Sistemos politika neleidžia įjungti arba išjungti WiFi įrenginių" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:9 +msgid "System policy prevents enabling or disabling mobile broadband devices" +msgstr "" +"Sistemos politika neleidžia įjungti arba išjungti mobiliojo plačiajuosčio " +"ryšio įrenginių" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:10 +msgid "System policy prevents enabling or disabling system networking" +msgstr "" +"Sistemos politika neleidžia įjungti arba išjungti sistemos prieigos prie " +"tinklo" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:11 +msgid "System policy prevents putting NetworkManager to sleep or waking it up" +msgstr "Sistemos politika neleidžia užmigdyti arba pažadinti NetworkManager" + +#: ../policy/org.freedesktop.NetworkManager.policy.in.h:12 +msgid "System policy prevents use of user-specific connections" +msgstr "Sistemos politika neleidžia naudoti pasirinktinių naudotojo ryšių" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "klaida apdorojant netlink pranešimą: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "laukiant lizde duomenų įvyko klaida" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "nepavyko prisijungti prie netlink saito būsenai stebėti: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "nepavyko įjungti netlink valdiklio įgaliojimams perduoti: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "nepavyko rezervuoti netlink valdiklio saito būsenai stebėti: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "nepavyko rezervuoti netlink saito podėlio saito būsenai stebėti: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nepavyko prisijungti prie netlink grupės: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "klaida atnaujinant saito podėlį: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Netinkama parinktis. Galimų parinkčių sąrašą galite pamatyti naudodami " +"parametrą --help.\n" + +#: ../src/main.c:568 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Naudokite --help, galimų parinkčių sąrašui gauti.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Sukurta NetworkManager programos\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Sulieta iš %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "nerastas veikiantis DHCP klientas." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "nerastas „dhclient“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "nerastas „dhcpcd“." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "nepalaikomas DHCP klientas „%s“." + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Nežinomas žurnalo vedimo lygis „%s“" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Nežinoma žurnalo sritis „%s“" + +#: ../src/named-manager/nm-named-manager.c:350 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"PASTABA: libc adresų nustatymo funkcija gali nepalaikyti daugiau nei 3 vardų " +"serverių." + +#: ../src/named-manager/nm-named-manager.c:352 +msgid "The nameservers listed below may not be recognized." +msgstr "Žemiau pateikti vardų serveriai gali būti neatpažinti." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Automatinis %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3275 +msgid "System" +msgstr "Sistema" + +#~ msgid "Type" +#~ msgstr "Tipas" + +#~ msgid "Name" +#~ msgstr "Pavadinimas" + +#~ msgid "User connections:\n" +#~ msgstr "Naudotojo ryšiai:\n" + +#~ msgid "System-wide connections" +#~ msgstr "Sistemos ryšiai" + +#~ msgid "Default" +#~ msgstr "Numatyta" + +#~ msgid "Service" +#~ msgstr "Tarnyba" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, dažnis %d MHz, sparta %d Mb/s, stiprumas %d" + +#~ msgid "Device" +#~ msgstr "Įrenginys" + +#~ msgid "Driver" +#~ msgstr "Tvarkyklė" + +#~ msgid "State" +#~ msgstr "Būsena" + +#~ msgid "HW Address" +#~ msgstr "Aparatinis adresas" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ "Galimybės:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "Perdavimo aptikimas" + +#~ msgid "Speed" +#~ msgstr "Sparta" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " Belaidžio ryšio savybės\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP šifravimas" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA šifravimas" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 šifravimas" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP šifras" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP šifras" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " Belaidžiai prieigos taškai %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = dabartinis prieigos taškas)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ "Laidinio ryšio savybės\n" + +#~ msgid "Carrier" +#~ msgstr "Perdavimas" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4 nustatymai:\n" + +#~ msgid "Address" +#~ msgstr "Adresas" + +#~ msgid "Prefix" +#~ msgstr "Priešdėlis" + +#~ msgid "Gateway" +#~ msgstr "Šliuzas" + +#~ msgid "Device:" +#~ msgstr "Įrenginys:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "Klaida: turi būti nurodytas hwaddr." + +#~ msgid "AP parameters" +#~ msgstr "Prieigos taško parametrai" + +#~ msgid "Frequency:" +#~ msgstr "Dažnis:" + +#~ msgid "Mode:" +#~ msgstr "Veiksena:" + +#~ msgid "Ad-hoc" +#~ msgstr "Ad-hoc" + +#~ msgid "Maximal bitrate:" +#~ msgstr "Didžiausias galimas bitų dažnis:" + +#~ msgid "Strength:" +#~ msgstr "Stiprumas:" + +#~ msgid "Flags:" +#~ msgstr "Požymiai:" + +#~ msgid "privacy" +#~ msgstr "privatumas" + +#~ msgid "WPA flags:" +#~ msgstr "WPA požymiai:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN požymiai:" + +#~ msgid "NM running:" +#~ msgstr "NM veikimas:" + +#~ msgid "NM state:" +#~ msgstr "NM būsena" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM belaidė įranga:" + +#~ msgid "NM wireless:" +#~ msgstr "NM belaidis:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN įranga:" diff --git a/po/lv.po b/po/lv.po new file mode 100644 index 00000000..96946a0f --- /dev/null +++ b/po/lv.po @@ -0,0 +1,969 @@ +# translation of NetworkManager.HEAD2.po to Latvian +# translation of NetworkManager.HEAD.po to Latvian +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# Raivis Dejus , 2006. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.HEAD2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-06-21 13:50+0300\n" +"PO-Revision-Date: 2006-06-12 22:05+0300\n" +"Last-Translator: Raivis Dejus \n" +"Language-Team: Latvian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" +"X-Generator: KBabel 1.10.2\n" + +#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:926 +#, c-format +msgid "Passphrase for wireless network %s" +msgstr "Parole priekš bezvadu tīkla %s" + +#: ../gnome/applet/applet-dbus.c:383 +#, c-format +msgid "Connection to the wireless network '%s' failed." +msgstr "Pieslēgums bezvadu tīklam '%s' neizdevies." + +#: ../gnome/applet/applet-dbus.c:388 +msgid "Connection to the wired network failed." +msgstr "Pieslēgums vadu tīklam neizdevies." + +#: ../gnome/applet/applet.c:184 +msgid "Error displaying connection information:" +msgstr "Kļuda paziņojot pieslēguma informāciju:" + +#: ../gnome/applet/applet.c:202 +msgid "Could not find some required resources (the glade file)!" +msgstr "Nevar atrast dažus pieprasījuma resursus (noras fails)!" + +#: ../gnome/applet/applet.c:213 +msgid "No active connections!" +msgstr "Nav aktīvu sakaru!" + +#: ../gnome/applet/applet.c:234 +#, c-format +msgid "Wired Ethernet (%s)" +msgstr "Vadu tīkls ethernet (%s)" + +#: ../gnome/applet/applet.c:236 +#, c-format +msgid "Wireless Ethernet (%s)" +msgstr "Bezvadu tīks ethernet (%s)" + +#: ../gnome/applet/applet.c:337 ../gnome/applet/applet.c:363 +msgid "NetworkManager Applet" +msgstr "NetworkManager aplets" + +#: ../gnome/applet/applet.c:339 +msgid "" +"Copyright © 2004-2006 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"Copyright © 2004-2006 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:341 ../gnome/applet/applet.c:367 +msgid "" +"Notification area applet for managing your network devices and connections." +msgstr "" +"Notifikācijas laukuma aplets priekš jūsus tīkla ierīču un savienojumu " +"vadības." + +#: ../gnome/applet/applet.c:344 ../gnome/applet/applet.c:372 +msgid "translator-credits" +msgstr "translator-atzīšana" + +#: ../gnome/applet/applet.c:365 +msgid "" +"Copyright © 2004-2005 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"Copyright © 2004-2005 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:428 +msgid "VPN Login Failure" +msgstr "VPN litotājvārda kļūme" + +#: ../gnome/applet/applet.c:429 +#, c-format +msgid "Could not start the VPN connection '%s' due to a login failure." +msgstr "Nevar sākt VPN savienojumu '%s' litotājvārda kļūmes dēļ." + +#: ../gnome/applet/applet.c:433 +msgid "VPN Start Failure" +msgstr "VPN sākšanas kļūme" + +#: ../gnome/applet/applet.c:434 +#, c-format +msgid "" +"Could not start the VPN connection '%s' due to a failure launching the VPN " +"program." +msgstr "Nevar sākt VPN savienojumu '%s' VPN startēšanās kļūdas dēļ." + +#: ../gnome/applet/applet.c:438 ../gnome/applet/applet.c:448 +msgid "VPN Connect Failure" +msgstr "VPN savienojuma kļūme" + +#: ../gnome/applet/applet.c:439 +#, c-format +msgid "Could not start the VPN connection '%s' due to a connection error." +msgstr "Nevar sākt VPN savienojumu '%s' savienojuma kļūmes dēļ." + +#: ../gnome/applet/applet.c:443 +msgid "VPN Configuration Error" +msgstr "VPN konfigrācijas kļūme" + +#: ../gnome/applet/applet.c:444 +#, c-format +msgid "The VPN connection '%s' was not correctly configured." +msgstr "VPN savienojums '%s' nebija korekti konfigurēts." + +#: ../gnome/applet/applet.c:449 +#, c-format +msgid "" +"Could not start the VPN connection '%s' because the VPN server did not " +"return an adequate network configuration." +msgstr "" +"Nevar sākt VPN savienojumu '%s' tādēļ, ka VPN serveris neatgriezaadekvātu " +"tīkla konfigurāciju." + +#: ../gnome/applet/applet.c:519 +msgid "VPN Login Message" +msgstr "VPN litotājvārda ziņojums" + +#: ../gnome/applet/applet.c:743 ../gnome/applet/applet.c:2510 +#: ../gnome/applet/other-network-dialog.c:458 +#: ../gnome/applet/passphrase-dialog.c:228 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"Tīkla administartora aplets nevarēja atrast dažus pieprasītos resursus " +"(noras failsnetika atrasts)." + +#: ../gnome/applet/applet.c:755 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "Tīkla ierīce \"%s (%s)\" natbalsta bezvadu skanēšanu." + +#: ../gnome/applet/applet.c:763 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "Tīkla ierīce \"%s (%s)\" natbalsta saites atklāšanu." + +#: ../gnome/applet/applet.c:910 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "Ierīce %s tiek sagatavota priekš vadu tīkla..." + +#: ../gnome/applet/applet.c:912 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "Ierīce %s tiek sagatavota priekš bezvadu tīkla '%s'..." + +#: ../gnome/applet/applet.c:920 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "Ierīce %s tiek konfigurēta vadu tīklam..." + +#: ../gnome/applet/applet.c:922 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "Mēģina pievienoties bezvadu tīklam '%s'..." + +#: ../gnome/applet/applet.c:930 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "Gaida tīla atslēgu priekš bezvadu tīla '%s'..." + +#: ../gnome/applet/applet.c:938 ../gnome/applet/applet.c:948 +msgid "Requesting a network address from the wired network..." +msgstr "Tiek pieprasīta tīkla adrese priekš vadu tīkla..." + +#: ../gnome/applet/applet.c:940 ../gnome/applet/applet.c:950 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "Tiek pieprasīta tīkla adrese priekš bezvadu tīkla '%s'..." + +#: ../gnome/applet/applet.c:958 +msgid "Finishing connection to the wired network..." +msgstr "Tiek pabeigta pieslēgšanās vadu tīklam..." + +#: ../gnome/applet/applet.c:960 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "Tiek pabeigta pieslēgšanās bezvadu tīklam '%s'..." + +#: ../gnome/applet/applet.c:1077 +msgid "NetworkManager is not running" +msgstr "Tīkla administrators nav palaists" + +#: ../gnome/applet/applet.c:1085 ../gnome/applet/applet.c:1830 +msgid "Networking disabled" +msgstr "Tīklošana atslēgta" + +#: ../gnome/applet/applet.c:1090 +msgid "No network connection" +msgstr "Nav tīla pieslēguma" + +#: ../gnome/applet/applet.c:1095 +msgid "Wired network connection" +msgstr "Vadu tīkla pieslēgums" + +#: ../gnome/applet/applet.c:1099 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "Pieslēgs pie Ad-Hoc bezvadu tīkla" + +#: ../gnome/applet/applet.c:1101 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "Bezvadu tīkla pieslēgums pie '%s' (%d%%)" + +#: ../gnome/applet/applet.c:1122 +#, c-format +msgid "VPN connection to '%s'" +msgstr "VPN pieslēgums pie '%s'" + +#: ../gnome/applet/applet.c:1130 +#, c-format +msgid "VPN connecting to '%s'" +msgstr "VPN pieslēdzas pie '%s'" + +#: ../gnome/applet/applet.c:1543 +msgid "_Connect to Other Wireless Network..." +msgstr "Pieslēgties _citam bezvadu tīlam..." + +#: ../gnome/applet/applet.c:1564 +msgid "Create _New Wireless Network..." +msgstr "Izveidot jau_nu bezvadu tīklu..." + +#: ../gnome/applet/applet.c:1687 +msgid "_VPN Connections" +msgstr "_VPN savienojumi" + +#: ../gnome/applet/applet.c:1732 +msgid "_Configure VPN..." +msgstr "_Konfigurēt VPN..." + +#: ../gnome/applet/applet.c:1736 +msgid "_Disconnect VPN..." +msgstr "_Atvienot VPN..." + +#: ../gnome/applet/applet.c:1758 +msgid "_Dial Up Connections" +msgstr "Ie_zvanpieslēgums" + +#. FIXME: We should save and then check the state of the devices and show Connect _or_ Disconnect for each item +#: ../gnome/applet/applet.c:1769 +#, c-format +msgid "Connect to %s..." +msgstr "Pieslēgties pie %s..." + +#: ../gnome/applet/applet.c:1775 +#, c-format +msgid "Disconnect from %s..." +msgstr "Atvienoties no %s..." + +#: ../gnome/applet/applet.c:1824 +msgid "No network devices have been found" +msgstr "Neviena tīkla ierīce netika atrasta" + +#: ../gnome/applet/applet.c:2016 +msgid "NetworkManager is not running..." +msgstr "Tīkla administrators nav palaists..." + +#. 'Enable Networking' item +#: ../gnome/applet/applet.c:2172 +msgid "Enable _Networking" +msgstr "Aktivizēt _tīklu" + +#. 'Enable Wireless' item +#: ../gnome/applet/applet.c:2178 +msgid "Enable _Wireless" +msgstr "Aktivizēt _WiFi" + +#. 'Connection Information' item +#: ../gnome/applet/applet.c:2184 +msgid "Connection _Information" +msgstr "Pieslēguma _informācija" + +#. Help item +#: ../gnome/applet/applet.c:2195 +msgid "_Help" +msgstr "_Palīdzība" + +#. About item +#: ../gnome/applet/applet.c:2204 +msgid "_About" +msgstr "P_ar" + +#: ../gnome/applet/applet.c:2669 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "" +"Tīkla administratora aplets nevarēja atrast dažus pieprasītos resursus. Tas " +"nevar turpinat.\n" + +#: ../gnome/applet/wireless-security-option.c:157 +msgid "Open System" +msgstr "Atvērt sistēmu" + +#: ../gnome/applet/wireless-security-option.c:160 +msgid "Shared Key" +msgstr "Koplietošanas atslēga" + +#: ../gnome/applet/wireless-security-option.c:208 +msgid "Automatic (Default)" +msgstr "Automātiski (noklusēti)" + +#: ../gnome/applet/wireless-security-option.c:215 +msgid "AES-CCMP" +msgstr "AES-CCMP" + +#: ../gnome/applet/wireless-security-option.c:223 +msgid "TKIP" +msgstr "TKIP" + +#: ../gnome/applet/wireless-security-option.c:231 +msgid "Dynamic WEP" +msgstr "Dinamiskais WEP" + +#: ../gnome/applet/wso-none.c:53 +msgid "None" +msgstr "Nekas" + +#: ../gnome/applet/wso-wep-ascii.c:138 +msgid "WEP 64/128-bit ASCII" +msgstr "WEP 64/128-bit ASCII" + +#: ../gnome/applet/wso-wep-hex.c:135 +msgid "WEP 64/128-bit Hex" +msgstr "WEP 64/128-bit Hex" + +#: ../gnome/applet/wso-wep-passphrase.c:135 +msgid "WEP 128-bit Passphrase" +msgstr "WEP 128-bit Parole" + +#: ../gnome/applet/wso-wpa-eap.c:237 +msgid "PEAP" +msgstr "PEAP" + +#: ../gnome/applet/wso-wpa-eap.c:238 +msgid "TLS" +msgstr "TLS" + +#: ../gnome/applet/wso-wpa-eap.c:239 +msgid "TTLS" +msgstr "TTLS" + +#: ../gnome/applet/wso-wpa-eap.c:247 ../src/nm-ap-security-wpa-eap.c:93 +#: ../src/nm-ap-security-wpa-eap.c:117 +msgid "WPA2 Enterprise" +msgstr "WPA2 Uzņēmums" + +#: ../gnome/applet/wso-wpa-eap.c:249 ../src/nm-ap-security-wpa-eap.c:95 +#: ../src/nm-ap-security-wpa-eap.c:122 +msgid "WPA Enterprise" +msgstr "WPA Uzņēmums" + +#: ../gnome/applet/wso-wpa-psk.c:178 +msgid "WPA2 Personal" +msgstr "WPA2 Privāts" + +#: ../gnome/applet/wso-wpa-psk.c:180 +msgid "WPA Personal" +msgstr "WPA Privāts" + +#: ../gnome/applet/eggtrayicon.c:134 +msgid "Orientation" +msgstr "Orientācija" + +#: ../gnome/applet/eggtrayicon.c:135 +msgid "The orientation of the tray." +msgstr "Paplātes orientācija." + +#: ../gnome/applet/menu-items.c:88 +#, c-format +msgid "Wired Network (%s)" +msgstr "Vadu tīkls (%s)" + +#: ../gnome/applet/menu-items.c:91 +msgid "_Wired Network" +msgstr "_Vadu tīkls" + +#: ../gnome/applet/menu-items.c:162 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Bezvadu tīkls (%s)" +msgstr[1] "Bezvadu tīkli (%s)" +msgstr[2] "Bezvadu tīklu (%s)" + +#: ../gnome/applet/menu-items.c:164 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Bezvadu tīkls" +msgstr[1] "Bezvadu tīkli" +msgstr[2] "Bezvadu tīklu" + +#: ../gnome/applet/menu-items.c:343 +msgid " (invalid Unicode)" +msgstr " (nederīgs unikods)" + +#: ../gnome/applet/other-network-dialog.c:352 +#, c-format +msgid "" +"By default, the wireless network's name is set to your computer's name, %s, " +"with no encryption enabled" +msgstr "" +"Noklusēti bezvadu tīkla nosaukums ir uzstādīts tāds, kā jūsu datora " +"nosaukums %s bez sifrēšanas" + +#: ../gnome/applet/other-network-dialog.c:358 +msgid "Create new wireless network" +msgstr "Izveidot jaunu bezvadu tīklu" + +#: ../gnome/applet/other-network-dialog.c:359 +msgid "" +"Enter the name and security settings of the wireless network you wish to " +"create." +msgstr "" +"Ievadiet nosaukumu un drošības uzstādījumus bezvadu tīklam, ko jūs vēlaties " +"izveidot." + +#: ../gnome/applet/other-network-dialog.c:363 +msgid "Create New Wireless Network" +msgstr "Radīt jaunu bezvadu tīklu" + +#: ../gnome/applet/other-network-dialog.c:368 +msgid "Existing wireless network" +msgstr "Pastāvošs bezvadu tīkls" + +#: ../gnome/applet/other-network-dialog.c:369 +msgid "Enter the name of the wireless network to which you wish to connect." +msgstr "Ievadiet nosaukumu tam bezvadu tīklam, kuram jūs vēlaties pieslēgties." + +#: ../gnome/applet/other-network-dialog.c:371 +msgid "Connect to Other Wireless Network" +msgstr "Pieslēgties citam bezvadu tīklam" + +#: ../gnome/applet/passphrase-dialog.c:215 +msgid "Error connecting to wireless network" +msgstr "Bezvadu tīkla savienojuma kļūda" + +#: ../gnome/applet/passphrase-dialog.c:216 +msgid "" +"The requested wireless network requires security capabilities unsupported by " +"your hardware." +msgstr "" +"Pieprasītais bezvadu tīkls pieprasa drošību, ko neatbalsta jūsu aparatūra." + +#: ../gnome/applet/vpn-password-dialog.c:151 +#: ../gnome/applet/vpn-password-dialog.c:188 +#, c-format +msgid "Cannot start VPN connection '%s'" +msgstr "Nevar sākt VPN savienojumu '%s'" + +#: ../gnome/applet/vpn-password-dialog.c:154 +#, c-format +msgid "" +"Could not find the authentication dialog for VPN connection type '%s'. " +"Contact your system administrator." +msgstr "" +"Nevar atrast autentifikācijas dialogu priekš VPN savienojuma tipa '%s'. " +"Sazinieties ar savu sistēmas administratoru." + +#: ../gnome/applet/vpn-password-dialog.c:191 +#, c-format +msgid "" +"There was a problem launching the authentication dialog for VPN connection " +"type '%s'. Contact your system administrator." +msgstr "" +"Bija problēma startējot autentifikācijas dialogu priekš VPN savienojuma tipa " +"'%s'. Sazinieties ar jūsu sistēmas administratoru." + +#: ../gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: ../gnome/applet/applet.glade.h:2 +msgid "" +"Active Connection Information" +msgstr "" +"Aktīvā savienojuma informācija" + +#: ../gnome/applet/applet.glade.h:4 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Bezvadu tīkls pieprasa paroli\n" +"\n" +"Parole vai šifrēšanas atslēga tiek piepraīta, lai piekļūtu bevadu tīlam '%s'." + +#: ../gnome/applet/applet.glade.h:8 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" +"Atvieglota tīkla funkcionēšana\n" +"\n" +"%s Tas nebūs pilnīgi funkcionāli." + +#: ../gnome/applet/applet.glade.h:12 +#, no-c-format +msgid "" +"Wireless Network Login Confirmation\n" +"\n" +"You have chosen to log in to the wireless network '%s'. If you are sure " +"that this wireless network is secure, click the checkbox below and " +"NetworkManager will not require confirmation on subsequent log ins." +msgstr "" +"Bezvadu tīkla lietotājvārda " +"apstiprināšana\n" +"\n" +"Jūs esat izvēlējies pieslēgties šim bezvadu tīklam: '%s'. Ja jūs esat " +"pārliecināts, ka šis bezvadu tīkls ir drošs, uzklikšķiniet blakus esošajā " +"atzīmes rūtiņā un tīkla administrators neprasīs apstiprināšanu turpmāk " +"piereģistrējoties." + +#: ../gnome/applet/applet.glade.h:15 +msgid "Anonymous Identity:" +msgstr "Anonīma identitāte:" + +#: ../gnome/applet/applet.glade.h:16 +msgid "Authentication:" +msgstr "Autentificēšana:" + +#: ../gnome/applet/applet.glade.h:17 +msgid "Broadcast Address:" +msgstr "Apraides adrese:" + +#: ../gnome/applet/applet.glade.h:18 +msgid "CA Certificate File:" +msgstr "CA setrifikāta fails:" + +#: ../gnome/applet/applet.glade.h:19 +msgid "C_onnect" +msgstr "_Savienot" + +#: ../gnome/applet/applet.glade.h:20 +msgid "Client Certificate File:" +msgstr "Klienta sertifikāta fails:" + +#: ../gnome/applet/applet.glade.h:21 +msgid "Connection Information" +msgstr "Savienojuma informācija" + +#: ../gnome/applet/applet.glade.h:22 +msgid "Default Route:" +msgstr "Noklusētais maršruts:" + +#: ../gnome/applet/applet.glade.h:23 +msgid "Destination Address:" +msgstr "Saņēmēja adrese:" + +#: ../gnome/applet/applet.glade.h:24 +msgid "Driver:" +msgstr "Draiveris:" + +#: ../gnome/applet/applet.glade.h:25 +msgid "EAP Method:" +msgstr "EAP metode:" + +#: ../gnome/applet/applet.glade.h:26 +msgid "Hardware Address:" +msgstr "Aparatūras adrese:" + +#: ../gnome/applet/applet.glade.h:27 +msgid "IP Address:" +msgstr "IP adrese:" + +#: ../gnome/applet/applet.glade.h:28 +msgid "Identity:" +msgstr "Identitāte:" + +#: ../gnome/applet/applet.glade.h:29 +msgid "Interface:" +msgstr "Saskarne:" + +#: ../gnome/applet/applet.glade.h:30 +msgid "Key Type:" +msgstr "Atslēgas tips:" + +#: ../gnome/applet/applet.glade.h:31 +msgid "Key:" +msgstr "Atslēga:" + +#: ../gnome/applet/applet.glade.h:32 +msgid "" +"None\n" +"WEP 128-bit Passphrase\n" +"WEP 64/128-bit Hex\n" +"WEP 64/128-bit ASCII\n" +msgstr "" +"Neviens\n" +"WEP 128-bit Parole\n" +"WEP 64/128-bit Hex\n" +"WEP 64/128-bit ASCII\n" + +#: ../gnome/applet/applet.glade.h:37 +msgid "" +"Open System\n" +"Shared Key" +msgstr "" +"Atvērt sistēmu\n" +"Koplietojamā atslēga" + +#: ../gnome/applet/applet.glade.h:39 +msgid "Other Wireless Network..." +msgstr "Cits bezvadu tīkls..." + +#: ../gnome/applet/applet.glade.h:40 +msgid "Passphrase:" +msgstr "Parole:" + +#: ../gnome/applet/applet.glade.h:41 +msgid "Password:" +msgstr "Parole:" + +#: ../gnome/applet/applet.glade.h:42 +msgid "Primary DNS:" +msgstr "Primārais DNS:" + +#: ../gnome/applet/applet.glade.h:43 +msgid "Private Key File:" +msgstr "Privātās atslēgas fails:" + +#: ../gnome/applet/applet.glade.h:44 +msgid "Private Key Password:" +msgstr "Privātās atslēgas parole:" + +#: ../gnome/applet/applet.glade.h:45 +msgid "Secondary DNS:" +msgstr "Sekundārais DNS:" + +#: ../gnome/applet/applet.glade.h:46 +msgid "Select the CA Certificate File" +msgstr "Izvēlieties CA sertifikāta failu" + +#: ../gnome/applet/applet.glade.h:47 +msgid "Select the Client Certificate File" +msgstr "Izvēlieties klienta sertifikāta failu" + +#: ../gnome/applet/applet.glade.h:48 +msgid "Select the Private Key File" +msgstr "Izvēlieties privātās atslēgas failu" + +#: ../gnome/applet/applet.glade.h:49 +msgid "Show key" +msgstr "Rādīt atslēgu" + +#: ../gnome/applet/applet.glade.h:50 +msgid "Show passphrase" +msgstr "Rādīt paroli" + +#: ../gnome/applet/applet.glade.h:51 +msgid "Show password" +msgstr "Rādīt paroli" + +#: ../gnome/applet/applet.glade.h:52 +msgid "Show passwords" +msgstr "Rādīt paroles" + +#: ../gnome/applet/applet.glade.h:53 +msgid "Speed:" +msgstr "Ātrums:" + +#: ../gnome/applet/applet.glade.h:54 +msgid "Subnet Mask:" +msgstr "Apakštīkla mask:" + +#: ../gnome/applet/applet.glade.h:55 +msgid "Type:" +msgstr "Tips:" + +#: ../gnome/applet/applet.glade.h:56 +msgid "User Name:" +msgstr "Lietotāja vārds:" + +#: ../gnome/applet/applet.glade.h:57 +msgid "Wireless Network Key Required" +msgstr "Tiek pieprasīta bezvadu tīkla atslēga" + +#: ../gnome/applet/applet.glade.h:58 +msgid "Wireless _adapter:" +msgstr "Bezvadu _adapteris:" + +#: ../gnome/applet/applet.glade.h:59 +msgid "_Always Trust this Wireless Network" +msgstr "_Vienmēr uzticēties šim bezvadu tīlaam" + +#: ../gnome/applet/applet.glade.h:60 +msgid "_Don't remind me again" +msgstr "Neatgā_dināt vairs" + +#: ../gnome/applet/applet.glade.h:61 +msgid "_Fallback on this Network" +msgstr "Šī tīkla atkāpe (_Fallback)" + +#: ../gnome/applet/applet.glade.h:62 +msgid "_Login to Network" +msgstr "Pies_lēgties tīklam" + +#: ../gnome/applet/applet.glade.h:63 +msgid "_Network Name:" +msgstr "_Tīkla nosaukums:" + +#: ../gnome/applet/applet.glade.h:64 +msgid "_Wireless Security:" +msgstr "Bez_vadu drošība:" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:383 +msgid "Cannot add VPN connection" +msgstr "Nevar pievienot VPN savienojumu" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:385 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"Jūsu sistēmā netika atrasta piemērota VPN programmatūra. Sazinieties ar savu " +"sistēmadministaratoru." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:437 +msgid "Cannot import VPN connection" +msgstr "Nevar importēt VPN savienojumu" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:439 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" +"Nevar atrast piemērotu programmatūru priekš VPN savienojuma tipa'%s'lai " +"importētu failu '%s'. sazinieties ar savu sistēmadministratoru." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:579 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "Kļūda atgūstot VPN savienojumu '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:582 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "" +"Nevar atrast UI failus priekš VPN savienojuma tipa'%s'. Sazinieties ar savu " +"sistēmadministratoru." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:739 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "Izdzēst VPN savienojumu \"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:742 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"Visa informācija par VPN savienojumu \"%s\" tiks pazaudēta un jums būs " +"nepieciešams jūsusistēmas administrators, lai sagādātu informāciju, lai " +"radītu jaunu savienojumu." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:959 +msgid "Unable to load" +msgstr "Nevar ielādēt" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:961 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "Nevar atrast dažus vajadzīgos resursus (noras fails)!" + +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1071 +msgid "Edit VPN Connection" +msgstr "Rediģēt VPN savienojumu" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "Pievienot jaunu VPN savienojumu" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Choose which type of VPN connection you wish to create." +msgstr "Izvēlieties kuru VPN savienojuma tipu jūs vēlaties radīt." + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "Connect to:" +msgstr "Svienot ar:" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Create VPN Connection" +msgstr "Izveidot VPN savienojumu" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Create VPN Connection - 1 of 2" +msgstr "Izveidot VPN savienojumu -1 no 2" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Create VPN Connection - 2 of 2" +msgstr "Izveidot VPN savienojumu -2 no 2" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Delete the selected VPN connection" +msgstr "Izdzēst izvēlēto VPN savienojumu" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "E_xport" +msgstr "E_ksportēt" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:9 +msgid "Edit the selected VPN connection" +msgstr "Rediģēt izvēlēto VPN savienojumu" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:10 +msgid "Export the VPN settings to a file" +msgstr "Eksportēt VPN uzstādījumus uz failu" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:11 +msgid "Export the selected VPN connection to a file" +msgstr "Eksportēt izvēlēto VPN savienojumu uz failu" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:12 +msgid "Finish Creating VPN Connection" +msgstr "Pabeigt veidot VPN savienojumu" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:13 +msgid "Manage Virtual Private Network Connections" +msgstr "Pārvaldīt virtuālo privāto tīklu savienojumus" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:14 +msgid "" +"This assistant will guide you through the creation of a connection to a " +"Virtual Private Network (VPN).\n" +"\n" +"It will require some information, such as IP addresses and secrets. Please " +"see your system administrator to obtain this information." +msgstr "" +"Šis asistents iepazīstinās jūs ar Virtuālā Privātā Tīkla (VPN) savienojuma " +"radīšanu.\n" +"\n" +"Tas pieprasīs mazliet informācijas, tādu kā IP adresi un noslēpumus. Lūdzu " +"vaicājiet savam sistēmadministratoram, lai iegūtu šo informāciju." + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:17 +msgid "VPN Connections" +msgstr "VPN savienojumi" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "40-bitu WEP" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "104-bitu WEP" + +#: ../src/nm-ap-security-wpa-psk.c:50 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:52 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:54 +msgid "WPA Automatic" +msgstr "WPA automātiskais" + +#: ../src/nm-ap-security-wpa-psk.c:59 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:61 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:63 +msgid "WPA2 Automatic" +msgstr "WPA2 automātiskais" + +#: ../src/nm-ap-security.c:321 +msgid "none" +msgstr "neviens" + +#: ../src/nm-netlink-monitor.c:170 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"Nespēj radīt tīla saites ligzdu priekš cietsavienojuma tīkla ethernet " +"ierīces - %s monitoringa" + +#: ../src/nm-netlink-monitor.c:188 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"Nespēj piesaistīties pie tīkla saites ligzdas priekš cietsavienojuma tīkla " +"ethernet ierīces - %s monitoringa" + +#: ../src/nm-netlink-monitor.c:425 +msgid "operation took too long" +msgstr "Operācija rit pārāk ilgi" + +#: ../src/nm-netlink-monitor.c:522 +msgid "received data from wrong type of sender" +msgstr "saņemti dati no nepareiza tipa sūtītāja" + +#: ../src/nm-netlink-monitor.c:535 +msgid "received data from unexpected sender" +msgstr "saņemti dati no negaidīta sūtītāja" + +#: ../src/nm-netlink-monitor.c:664 +msgid "too much data was sent over socket and some of it was lost" +msgstr "Pārāk daudzi dati tika sūtīti caur ligzdu un daži tika pazaudēti" + +#: ../src/nm-netlink-monitor.c:774 +msgid "error occurred while waiting for data on socket" +msgstr "Gaidot datus caur ligzdu, ieviesusies kļūda" + +#: ../gnome/applet/applet-dbus-devices.c:922 +#, c-format +msgid "You are now connected to the Ad-Hoc wireless network '%s'." +msgstr "Jūs esat savienots ar Ad-Hoc bezvadu tīlu '%s'." + +#: ../gnome/applet/applet-dbus-devices.c:927 +#, c-format +msgid "You are now connected to the wireless network '%s'." +msgstr "Jūs esat savienots ar bezvadu tīlu '%s'." + +#: ../gnome/applet/applet-dbus-devices.c:934 +msgid "You are now connected to the wired network." +msgstr "Jūs esat savienots ar cietsavienojuma tīlu." + +#: ../gnome/applet/applet-dbus-devices.c:940 +msgid "Connection Established" +msgstr "Savienojums ir ieviesies" + +#: ../gnome/applet/applet-dbus-devices.c:983 +msgid "Disconnected" +msgstr "Atslēgts" + +#: ../gnome/applet/applet-dbus-devices.c:984 +msgid "The network connection has been disconnected." +msgstr "Tīkla savienojums ir ticis atslēgts." diff --git a/po/mk.po b/po/mk.po new file mode 100644 index 00000000..3e53190b --- /dev/null +++ b/po/mk.po @@ -0,0 +1,57 @@ +# translation of NetworkManager.HEAD.po to Macedonian +# translation of mk.po. +# Copyright (C) 2005 THE mk.po'S COPYRIGHT HOLDER +# This file is distributed under the same license as the mk.po package. +# +# Арангел Ангов , 2005. +# <>, 2005. +# Jovan Naumovski , 2006. +# Arangel Angov , 2006, 2007, 2008. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-12-18 17:15+0000\n" +"PO-Revision-Date: 2008-02-27 23:15+0100\n" +"Last-Translator: Arangel Angov \n" +"Language-Team: Macedonian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural= n==1 || n%10==1 ? 0 : 1\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../src/nm-netlink-monitor.c:188 ../src/nm-netlink-monitor.c:448 +#, c-format +msgid "error processing netlink message: %s" +msgstr "грешка при процесирање на netlink пораката: %s" + +#: ../src/nm-netlink-monitor.c:245 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "не можам да алоцирам нетлинк справувач за надгледување на статусот на врската: %s" + +#: ../src/nm-netlink-monitor.c:255 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "не можам да се поврзам за нетлинк за надгледување на статусот на врската: %s" + +#: ../src/nm-netlink-monitor.c:263 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "не можам да ја приклучам нетлинк групата за надгледување на статусот на врската: %s" + +#: ../src/nm-netlink-monitor.c:271 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "не можам да алоцирам нетлинк кеш за надгледување на статусот на врската: %s" + +#: ../src/nm-netlink-monitor.c:471 +msgid "error occurred while waiting for data on socket" +msgstr "се случи грешка при чекањето на податоци од сокетот" + +#: ../src/NetworkManager.c:255 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Невалидна опција. Ве молам користете --help за листа на валидни опции.\n" + diff --git a/po/ml.po b/po/ml.po new file mode 100644 index 00000000..6c1e92f7 --- /dev/null +++ b/po/ml.po @@ -0,0 +1,1637 @@ +# translation of ml.po to +# translation of NetworkManager.master_upstream.ml.po to +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Ani Peter , 2010 +# +msgid "" +msgstr "" +"Project-Id-Version: ml\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 15:31+0530\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ഉപയോഗിക്കേണ്ട വിധം: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "പിശക്: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "പിശക്: 'con list': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "കണക്ഷന്‍ വിശദാംശങ്ങള്‍" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "സിസ്റ്റം" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ഉപയോക്താവു്" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ഒരിക്കലുമില്ല" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ഉവ്വു്" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ഇല്ല" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "സിസ്റ്റം കണക്ഷനുകള്‍" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ഉപയോക്താവിനുള്ള കണക്ഷനുകള്‍" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "പിശക്: %s ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "പിശക്: %s - ഇത്തരം കണക്ഷന്‍ ലഭ്യമല്ല." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "അപരിചിതമായ പരാമീറ്റര്‍: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "പിശക്: ശരിയായ പരാമീറ്റര്‍ നല്‍കിയിട്ടില്ല." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "പിശക്: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "പിശക്: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "പിശക്: 'con status': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "സജീവമായ കണക്ഷനുകള്‍" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ഡിവൈസ് '%s'-ല്‍ സജീവമായ കണക്ഷന്‍ ലഭ്യമല്ല" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "സജീവമായ കണക്ഷന്‍ അല്ലെങ്കില്‍ ഡിവൈസ് ലഭ്യമല്ല" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "'%s' ഡിവൈസ് '%s' കണക്ഷനുമായി പൊരുത്തപ്പെടുന്നില്ല" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "ഡിവൈസ് '%s'-ല്‍ സജീവമായ കണക്ഷന്‍ ലഭ്യമല്ല" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "സജീവമാക്കുന്നു" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "സജീവമാക്കിയിരിക്കുന്നു" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "അപരിചിതം" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (തയ്യാറാകുക)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (ആധികാരികത ഉറപ്പാക്കേണ്ടതുണ്ടു്)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്യുന്നു (ഐപി ക്രമീകരണം ലഭ്യമാക്കുന്നു)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "വിപിഎന്‍ കണക്ട് ചെയ്തിരിക്കുന്നു" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "വിപിഎന്‍ കണക്ഷന്‍ പരാജയപ്പെട്ടു" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "വിപിഎന്‍ വിഛേദിച്ചിരിക്കുന്നു" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "അപരിചിതമായ കാരണം" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "ഒന്നുമില്ല" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ഉപയോക്താവു് വിഛേദിച്ചിരിക്കുന്നു" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "അടിസ്ഥാന നെറ്റ്‌വര്‍ക്ക് കണക്ഷന്‍ തടസ്സപ്പെടുത്തിയിരിക്കുന്നു" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "വിപിഎന്‍ സര്‍വീസ് അപ്രതീക്ഷിതമായി നിര്‍ത്തിയിരിക്കുന്നു" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "വിപിഎന്‍ സര്‍വീസ് തെറ്റായ ക്രമീകരണം തിരികെ നല്‍കിയിരിക്കുന്നു" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "കണക്ഷനുള്ള ശ്രമം കഴിഞ്ഞിരിക്കുന്നു" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "വിപിഎന്‍ സര്‍വീസ് സമയത്തിനു് ആരംഭിച്ചില്ല" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "വിപിഎന്‍ സര്‍വീസ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "ശരിയായ വിപിഎന്‍ രഹസ്യങ്ങള്‍ ലഭ്യമല്ല" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "തെറ്റായ വിപിഎന്‍ രഹസ്യങ്ങള്‍" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "കണക്ഷന്‍ നീക്കം ചെയ്തിരിക്കുന്നു" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "അവസ്ഥ: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "കണക്ഷന്‍ സജീവമാക്കിയിരിക്കുന്നു\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "അവസ്ഥ: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "പിശക്: സമയപരിധി %d നിമിഷത്തിന്റെ കാലാവധി കഴിഞ്ഞിരിക്കുന്നു." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "പിശക്: കണക്ഷന്‍ സജീവമാക്കല്‍ പരാജയപ്പെട്ടു: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "പിശക്: '%s'-നുള്ള സജീവമായ കണക്ഷന്‍ ലഭ്യമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "സജീവമായ കണക്ഷന്റെ അവസ്ഥ: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "സജീവമായ കണക്ഷന്‍ പാഥ്: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "പിശക്: അപരിചിതമായ കണക്ഷന്‍: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "പിശഖ്: സമയപരിധിയുടെ മൂല്ല്യം '%s' തെറ്റാണു്." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "പിശക്: id അല്ലെങ്കില്‍ uuid വ്യക്തമാക്കേണ്ടതുണ്ടു്." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "പിശക്: ഉചിതമായ ഡിവൈസ് ലഭ്യമായില്ല: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "പിശക്: ഉചിതമായ ഡിവൈസ് ലഭ്യമായില്ല." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "മുന്നറിയിപ്പു്: കണക്ഷന്‍ സജീവമല്ല\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "പിശക്: 'con' കമാന്‍ഡ് '%s' ശരിയല്ല." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "പിശക്: D-Bus-ലേക്കു് കണക്ട് ചെയ്യുവാന്‍ സാധ്യമായില്ല." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "പിശക്: സിസ്റ്റം സജ്ജീകരണങ്ങള്‍ ലഭ്യമാക്കവാന്‍ സാധ്യമായില്ല." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "പിശക്: ഉപയോക്താവിനുള്ള സജ്ജീകരണങ്ങള്‍ ലഭ്യമാക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "പിശക്: കണക്ഷനുകള്‍ ലഭ്യമാക്കുവാന്‍ സാധ്യമല്ല: സജ്ജീകരണങ്ങള്‍ക്കുള്ള സര്‍വീസുകള്‍ പ്രവര്‍ത്തിക്കുന്നില്ല." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "കൈകാര്യം ചെയ്തിട്ടില്ലാത്തതു്" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "ലഭ്യമല്ലാത്തതു്" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "വിഛേദിച്ചിരിക്കുന്നു" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "കണക്ട് ചെയ്യുന്നു (തയ്യാറാക്കുക)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "കണക്ട് ചെയ്യുന്നു (ക്രമീകരിക്കുന്നു)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "കണക്ട് ചെയ്യുന്നു (ആധികാരികത ഉറപ്പാക്കേണ്ടതുണ്ടു്)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "കണക്ട് ചെയ്യുന്നു (ഐപി ക്രമീകരണം ലഭ്യമാക്കുന്നു)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "കണക്ട് ചെയ്തിരിക്കുന്നു" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "കണക്ഷന്‍ പരാജയപ്പെട്ടു" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "അപരിചിതം" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(ഒന്നുമില്ല)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s:IP4 വിലാസം 0x%X വേര്‍തിരിക്കുന്നതില്‍ പിശക്" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "എന്‍ക്രിപ്റ്റ് ചെയ്തിരിക്കുന്നു: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "എന്റര്‍പ്രൈസ്" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "അഡ്-ഹോക്" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "ഇന്‍ഫ്രാസ്ട്രക്ചര്‍" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "പിശക്: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "പിശക്: 'dev list': %s, അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ഡിവൈസിന്റെ വിശദാംശങ്ങള്‍" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(അപരിചിതം)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "(അപരിചിതം)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ഓണ്‍" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ഓഫ്" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "പിശക്: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "പിശക്: 'dev status': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ഡിവൈസുകളുടെ അവസ്ഥ" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "പിശക്: '%s' ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "പിശക്: ഡിവൈസ് '%s' ലഭ്യമായില്ല." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "വിജയിച്ചു: ഡിവൈസ് '%s' വിജയകരമായി വിഛേദിച്ചിരിക്കുന്നു." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "പിശക്: ഡിവൈസ് '%s' (%s) വിഛേദിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ഡിവൈസിന്റെ അവസ്ഥ: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "പിശക്: iface നല്‍കേണ്ടതുണ്ടു്." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "പിശക്: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "പിശക്: 'dev wifi': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi പരിശോധന പട്ടിക" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "പിശക്: hwaddr '%s'-നുള്ള ആക്സെസ്സ് പോയിന്റ് ലഭ്യമല്ല." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "പിശക്: '%s' ഡിവൈസ് ഒരു വൈഫൈ ഡിവൈസല്ല." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "പിശക്: 'dev wifi' കമാന്‍ഡ് '%s' ശരിയല്ല." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "പിശക്: 'dev' കമാന്‍ഡ് '%s' ശരിയല്ല." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ഉപയോഗിക്കേണ്ട വിധം: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "കണക്ട് ചെയ്യുന്നു" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "പിശക്: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "പിശക്: 'nm status': %s; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "നെറ്റ്‌വര്‍ക്ക്മാനേജറിന്റെ അവസ്ഥ" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "enabled" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "disabled" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "പ്രവര്‍ത്തനത്തില്‍" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "പ്രവര്‍ത്തനത്തിലില്ല" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "പിശക്: '%s' എന്നു് '--fields'-നുള്ള മൂല്ല്യം അസാധുവാണു്; അനുവദിക്കുന്ന ഫീള്‍ഡുകള്‍: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi സജ്ജം" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "പിശക്: തെറ്റായ 'wifi' പരാമീറ്റര്‍: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN സജ്ജം" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "പിശക്: തെറ്റായ 'wwan' പരാമീറ്റര്‍: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "പിശക്: 'nm' കമാന്‍ഡ് '%s' ശരിയല്ല." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "പിശക്: '%s'വസ്തു അപരിചിതം, 'nmcli help' ശ്രമിക്കുക." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "പിശക്: '--terse' രണ്ടാമതും നല്‍കിയിരിക്കുന്നു." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Error: Option '--terse' is mutually exclusive with '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "പിശക്: '--pretty' രണ്ടാമതും നല്‍കിയിരിക്കുന്നു." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Error: Option '--pretty' is mutually exclusive with '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "പിശക്: '%s' ഐച്ഛികത്തിനുള്ള ആര്‍ഗ്യുമെന്റ് ലഭ്യമല്ല." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "പിശക്: '%s' ഐച്ഛികത്തിനുള്ള '%s' ശരിയായ ആര്‍ഗ്യുമെന്റല്ല." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "പിശക്: '%s' ഐച്ഛികങ്ങള്‍ക്കുള്ള ഫീള്‍ഡുകള്‍ ലഭ്യമല്ല." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli പ്രയോഗം, പതിപ്പു് %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "പിശക്: '%s' ഐഛികം അപരിചിതം, 'nmcli -help' ശ്രമിക്കുക." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d സിഗ്നല്‍ ലഭ്യമായി, അടച്ചു പൂട്ടുന്നു..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "പിശക്: നെറ്റ്‌വര്‍ക്ക്മാനേജറിലേക്കു് കണക്ട് ചെയ്യുവാന്‍ സാധ്യമായില്ല." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "വിജയിച്ചു" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-ബിറ്റ് പാസ്ഫ്രെയിസ്)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (അപരിചിതം)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (അപരിചിതം)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ഏതെങ്കിലും," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "ഓട്ടോ" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "സജ്ജമല്ല" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "ഫീള്‍ഡ് '%s' മാത്രമായിരിക്കണം" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "തെറ്റായ ഫീള്‍ഡ് '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "'--terse' ഐച്ഛികത്തിനു് '--fields' നല്‍കേണ്ടതുണ്ടു്" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "'--terse' എന്ന ഐച്ഛികത്തിനു് പ്രത്യേക '--fields' ഐച്ഛികം ആവശ്യമുണ്ടു്, '%s' അല്ല" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM കീ ഫയലിനു് അവസാനമുള്ള റ്റാഗ് '%s' ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "ഒരു PEM സ്വകാര്യ കീ ഫയല്‍ പോലെയല്ലിതു്." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr " ‌PEM ഫയല്‍ ഡേറ്റാ സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "തെറ്റായ PEM ഫയല്‍: Proc-രീതിയിലുള്ളതു് ആദ്യത്തെ റ്റാഗ് അല്ല." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "തെറ്റായ PEM ഫയല്‍: അപരിചിതമായ Proc-രീതിയിലുള്ള റ്റാഗ് '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "തെറ്റായ PEM ഫയല്‍: DEK-Info രണ്ടാത്തെ റ്റാഗ് അല്ല." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "തെറ്റായ PEM ഫയല്‍: DEK-Info റ്റാഗില്‍ IV ലഭ്യമായില്ല." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "തെറ്റായ PEM ഫയല്‍: DEK-Info റ്റാഗില്‍ IV-ന്റെ ശൈലി തെറ്റാണു്." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "തെറ്റായ PEM ഫയല്‍: അപരിചിതമായ സ്വകാര്യ കീ സിഫര്‍ '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "സ്വകാര്യ കീ ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമല്ല." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM സര്‍ട്ടിഫിക്കേറ്റ് '%s'-നു് ഒടുവിലുള്ള റ്റാഗ് '%s' ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "സര്‍ട്ടിഫിക്കേറ്റ് ഡീകോഡ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "‌സര്‍ട്ടിഫിക്കേറ്റ് ഡേറ്റാ സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ഫയല്‍ ഡേറ്റാ സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV-ന്റെ വ്യാപ്തി ഈവന്‍ അക്കത്തിലുള്ള ബൈറ്റുകളായിരിക്കണം." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV-ല്‍ നോണ്‍-ഹെക്സാഡെസിമല്‍ അക്കങ്ങളുണ്ടു്." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "സ്വകാര്യ കീ സിഫര്‍ '%s' അപരിചിതം." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "സ്വകാര്യ കീ രീതി കണ്ടുപിടിക്കുവാന്‍ സാധ്യമല്ല." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ഡീക്രിപ്റ്റ് ചെയ്ത സ്വകാര്യ കീ സൂക്ഷിക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "ക്രിപ്റ്റോ എഞ്ചില്‍ ആരംഭിക്കുന്നതില്‍ പരാജയം." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 എഞ്ചില്‍ ആരംഭിക്കുവാന്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "തെറ്റായ IV വ്യാപ്തി (കുറഞ്ഞതു് %zd ആയിരിക്കണം)" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "ഡീക്രിപ്റ്റ് ചെയ്ത കീ ബഫറിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ഡീക്രിപ്ഷന്‍ സിഫര്‍ കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയം: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ഡീക്രിപ്ഷനുള്ള സിമ്മെട്രിക് കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "ഡീക്രിപ്ഷനുള്ള IV സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: അപ്രതീക്ഷിതമായ പാഢിങ് നീളം." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "എന്‍ക്രിപ്റ്റിങിനുള്ള മെമ്മറി അനുവദിക്കുന്നതില്‍ പരാജയപ്പെട്ടു," + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "എന്‍ക്രിപ്ഷന്‍ സിഫര്‍ കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "എന്‍ക്രിപ്ഷനുള്ള സിമ്മെട്രിക് കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "എന്‍ക്രിപ്ഷനുള്ള IV സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "ഡേറ്റാ എന്‍ക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "സര്‍ട്ടിഫിക്കേറ്റ് ഡേറ്റാ ആരംഭിക്കുന്നതില്‍ പിശക്: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "സര്‍ട്ടിഫിക്കേറ്റ് ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമല്ല: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ഡീകോഡര്‍ ആരംഭിക്കുവാന്‍ സാധ്യമായില്ല: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ഫയല്‍ ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമായില്ല: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ഫയല്‍ ഉറപ്പാക്കുവാന്‍ സാധ്യമായില്ല: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "ക്രിപ്റ്റോ എഞ്ചിന്‍ ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "തെറ്റായ IV നീളം (കുറഞ്ഞതു് %d ആയിരിക്കണം)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ഡീക്രിപ്ഷന്‍ സിഫര്‍ സ്ലോട്ട് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ഡീക്രിപ്ഷനുള്ള സിമ്മെട്രിക് കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ഡീക്രിപ്ഷനായി IV സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ഡീക്രിപ്ഷന്‍ കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "സ്വകാര്യ കീ ഡീക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: ഡീക്രിപ്റ്റ് ചെയ്ത ഡേറ്റ വളരെ വലുതാണു്." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "സ്വകാര്യ കീയുടെ ‍ഡീക്രിപ്ഷന്‍ ഉറപ്പാക്കുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "എന്‍ക്രിപ്ഷന്‍ സിഫര്‍ സ്ലോട്ട് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "എന്‍ക്രിപ്ഷനുള്ള സിമ്മെട്രിക് കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "എന്‍ക്രിപ്ഷനുള്ള IV കീ സജ്ജമാക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "എന്‍ക്രിപ്ഷന്‍ കോണ്‍ടെക്സ്റ്റ് ആരംഭിക്കുന്നതില്‍ പരാജയപ്പെട്ടു." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "എന്‍ക്രിപ്റ്റ് ചെയ്യുന്നതില്‍ പരാജയപ്പെട്ടു: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "എന്‍ക്രിപ്റ്റ് ചെയ്തതിനു് ശേഷം അപ്രതീക്ഷിതമായ ഡേറ്റാ" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "സര്‍ട്ടിഫിക്കേറ്റ് ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "രഹസ്യവാക്ക് UCS2-ലേക്ക് വേര്‍തിരിക്കുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ഡീകോഡര്‍ ആരംഭിക്കുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ഫയല്‍ ഡീകോഡ് ചെയ്യുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ഫയല്‍ ഉറപ്പാക്കുവാന്‍ സാധ്യമായില്ല: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "വേഗത്തില്‍ ഡേറ്റാ തയ്യാറാക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "എന്‍ക്രിപ്ഷന്‍ കീ തയ്യാറാക്കുന്നതിനാവശ്യമായ മെമ്മറി ലഭ്യമല്ല." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ഫയല്‍ ഉണ്ടാക്കുന്നതിനുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ഫയലിലേക്ക് IV സൂക്ഷിക്കുന്നതിനാവശ്യമുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ഫയലിലേക്ക് എന്‍ക്രിപ്റ്റ് ചെയ്ത കീ സൂക്ഷിക്കുന്നതിനുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ഫയല്‍ ഡേറ്റായ്ക്കുള്ള മെമ്മറി അനുവദിക്കുവാന്‍ സാധ്യമായില്ല." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "നെറ്റ്ലിങ്ക് സന്ദേശം പ്രവര്‍ത്തിപ്പിക്കുമ്പോള്‍ പിശക്: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "സോക്കറ്റില്‍ ഡേറ്റായ്ക്കായി കാത്തിരിക്കുമ്പോള്‍ പിശകുണ്ടായിരിക്കുന്നു" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ലിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്കുമായി കണക്ട് ചെയ്യുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "നെറ്റ്ലിങ്ക് ഹാന്‍ഡില്‍ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ലിിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ഹാന്‍ഡില്‍ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ലിങ്കിന്റെ അവസ്ഥ നിരീക്ഷിക്കുന്നതിനുള്ള നെറ്റ്ലിങ്ക് ലിങ്ക് കാഷേ അനുവദിക്കുവാന്‍ സാധ്യമല്ല: %s " + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "നെറ്റ്ലിങ്ക് ഗ്രൂപ്പില്‍ ചേരുവാന്‍ സാധ്യമല്ല: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "ലിങ്ക് കാഷേ പരിഷ്കരിക്കുന്നതില്‍ പിശക്: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "തെറ്റായ ഉപാധി. ശരിയായ കൂടുതല്‍ ഉപാധികള്‍ക്കായി ദയവായി --help ഉപയോഗിക്കുക.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. ശരിയായ കൂടുതല്‍ ഉപാധികള്‍ക്കായി ദയവായി --help ഉപയോഗിക്കുക.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# തയ്യാറാക്കിയതു് NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s-ല്‍ നിന്നും കൂട്ടിചേര്‍ത്തിരിക്കുന്നു\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ഉപയോഗിക്കുവാന്‍ സാധിക്കുന്ന DHCP ക്ലയന്റ് ലഭ്യമായില്ല." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' ലഭ്യമായില്ല." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ലഭ്യമായില്ല." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "പിന്തണലഭ്യമല്ലാത്ത DHCP ക്ലയന്റ് '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "അപരിചതമായ ലോഗ് ലവല്‍ '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "അപരിചിതമായ ലോഗ് ഡൊമെയിന്‍ '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "കുറിപ്പു്: libc റിസോള്‍വര്‍ 3 നെയിംസര്‍വറുകളില്‍ കൂടതല്‍ പിന്തുണയ്ക്കുന്നതല്ല." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "താഴെ പറഞ്ഞിരിക്കുന്ന നെയിംസര്‍വറുകള്‍ തിരിച്ചറിയപ്പെടുന്നവയല്ല." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "ഓട്ടോ %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "സിസ്റ്റം" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "സുരക്ഷിതമായ ഒരു വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷന്‍ പങ്കിടുക" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ഒരു തുറന്ന വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷന്‍ പങ്കിടുക" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "സിസ്റ്റത്തിന്റെ ഹോസ്റ്റ്നാമത്തില്‍ മാറ്റം വരുത്തുക" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "സിസ്റ്റം കണക്ഷനുകളില്‍ മാറ്റം വരുത്തുക" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr " സിസ്റ്റത്തിന്റെ സജ്ജീകരണങ്ങളില്‍ മാറ്റം വരുത്തുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "സിസ്റ്റത്തിന്റെ ഹോസ്റ്റ്നാമത്തില്‍ മാറ്റം വരുത്തുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "സുരക്ഷിതമായ ഒരു വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷനുകള്‍ പങ്കിടുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ഒരു തുറന്ന വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷനുകള്‍ പങ്കിടുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു" + diff --git a/po/mr.po b/po/mr.po new file mode 100644 index 00000000..d2bc41c8 --- /dev/null +++ b/po/mr.po @@ -0,0 +1,1638 @@ +# translation of mr.po to Marathi +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Sandeep Shedmake , 2009. +# Sandeep Shedmake , 2010. +msgid "" +msgstr "" +"Project-Id-Version: mr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 10:40+0530\n" +"Last-Translator: Sandeep Shedmake \n" +"Language-Team: Marathi \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"वापर: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "त्रुटी: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "त्रुटी: 'con list': %s; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "जोडणीचे तपशील" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "प्रणाली" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "वापरकर्ता" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "कधिच नाही" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "होय" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "नाही" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "प्रणाली जोडणी" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "वापरकर्त्याची जोडणी" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "त्रुटी: %s घटक आढळले नाही." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "त्रुटी: %s - याप्रकारची जोडणी आढळली नाही." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "अपरिचीत घटक: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "त्रुटी: वैध घटक निर्देशीत नाही." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "त्रुटी: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "त्रुटी: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "त्रुटी: 'con status': %s; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "सक्रिय जोडणी" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "साधण '%s' वरील सक्रिय जोडणी आढळली नाही" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "सक्रिय जोडणी किंवा साधण आढळले नाही" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "साधण '%s' जोडणी '%s' सह सहत्व नाही" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "जोडणी '%s' करीता साधण आढळले नाही" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "सक्रिय करत आहे" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "सक्रिय केले" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "अपरिचीत" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN जोडणी (तयार करा)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN जोडणी (ओळख पटवणे आवश्यक आहे)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN जोडणी" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN जोडणी (IP संरचना प्राप्त करत आहे)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN जोडणी यशस्वी" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN जोडणी अपयशी" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN जोडणी खंडीत झाली" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "अपरिचीत कारण" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "काहिच नाही" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "वापरकर्ता खंडीत झाले" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "बेस नेटवर्क जोडणी खंडीत झाले" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN सेवा अनपेक्षीतरित्या थांबली" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN सेवाने अवैध संरचना रिटर्न केली" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "जोडणी प्रयत्नाची वेळ समाप्ती आढळली" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN सेवा वेळेवर सुरू झाली नाही" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN सेवा सुरू होण्यास अपयशी" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "वैध VPN गोपणीयता आढळले नाही" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "अवैध VPN गोपणीयता" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "जोडणी काढून टाकली" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "स्तर: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "जोडणी सक्रिय केली\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "स्तर: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "त्रुटी: वेळसमाप्ती %d सेकंद समाप्त." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "त्रुटी: जोडणी सक्रिय करण्यास अपयशी: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "त्रुटी: '%s' करीता सक्रिय जोडणी प्राप्त करण्यास अपयशी." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "सक्रिय जोडणीचे स्तर: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "सक्रिय जोडणीचे मार्ग: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "त्रुटी: अपरिचीत जोडणी: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "त्रुटी: वेळसमाप्तीचे मुल्य '%s' वैध नाही." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "त्रुटी: id किंवा uuid निर्देशीत करणे आवश्यक आहे." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "त्रुटी: योग्य साधण आढळले नाही: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "त्रुटी: योग्य साधण आढळले नाही." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "सावधान: जोडणी सक्रिय नाही\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "त्रुटी: 'con' आदेश '%s' वैध नाही." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "त्रुटी: D-Bus सह जोडणी करणे अशक्य." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "त्रुटी: प्रणालीची संयोजना प्राप्त करणे अशक्य." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "त्रुटी: वापरकर्ताची संयोजना प्राप्त करणे अशक्य." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "त्रुटी: जोडणी प्राप्त करण्यास अशक्य: सेटिंग्स् सेवा कार्यरत नाही." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"वापर: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "अव्यवस्थापीत" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "अनुपल्बध" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "खंडीत" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "जोडणी (तयार करत आहे)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "जोडणी (संरचीत करत आहे)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "जोडणी (ओळख पटवणे आवश्यक आहे)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "जोडणी (IP संरचना प्राप्त करत आहे)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "जोडणी यशस्वी" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "जोडणी अपयशी" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "अपरिचीत" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(काहिच नाही)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 पत्ता 0x%X यांस रूपांतरीत करतेवेळी त्रुटी" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "एनक्रिप्टेड: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "एंटरप्राइज" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "ऍड-हॉक" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "इंफ्रास्ट्रक्चर" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "त्रुटी: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "त्रुटी: 'dev list': %s; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "साधणाचे तपशील" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(अपरिचीत)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "अपरिचीत)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "सुरू करा" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "बंद करा" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "त्रुटी: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "त्रुटी: 'dev status': %s; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "साधणांची स्थिती" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "त्रुटी: '%s' घटक आढळले नाही." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "त्रुटी: साधण '%s' आढळले नाही." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "यशस्वी: साधण '%s' यशस्वीरित्या खंडीत झाले." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "त्रुटी: साधण '%s' (%s) खंडीत होणे अपयशी झाले: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "साधणाचे स्तर: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "त्रुटी: iface निर्देशीत करणे आवश्यक आहे." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "त्रुटी: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "त्रुटी: 'dev wifi': %s; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi स्कॅन सूची" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "त्रुटी: ऍक्सेस पॉईंट hwaddr '%s' सह आढळले नाही." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "त्रुटी: साधण '%s' WiFi साधण नाही." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "त्रुटी: 'dev wifi' आदेश '%s' वैध नाही." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "त्रुटी: 'dev' आदेश '%s' वैध नाही." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"वापर: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "अस्लीप्" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "जोडणी करत आहे" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "त्रुटी: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "त्रुटी: 'nm status': %s; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager स्थिती" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "सुरू केले" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "बंद केले" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "कार्यरत आहे" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "कार्यरत नाही" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "त्रुटी: येथील '--fields' मूल्य '%s' वैध नाही; स्वीकार्य क्षेत्र: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi समर्थीत" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "त्रुटी: अवैध 'wifi' घटक: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN समर्थीत" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "त्रुटी: अवैध 'wwan' घटक: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "त्रुटी: 'nm' आदेश '%s' वैध नाही." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"वापर: %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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "त्रुटी: घटक '%s' अपरिचीत आहे, 'nmcli help' वापरून पहा." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "त्रुटी: पर्याय '--terse' दुसऱ्यावेळी निर्देशीत केले." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "त्रुटी: '--pretty' च्या तुलनेत पर्याय '--terse' वेगळे आहे." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "त्रुटी: पर्याय '--pretty' दुसऱ्यावेळी निर्देशीत केले." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "त्रुटी: '--terse' च्या तुलनेत पर्याय '--pretty' वेगळे आहे." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "त्रुटी: '%s' पर्यायकरीता न आढळलेले घटक." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "त्रुटी: '%s' पर्यायकरीता '%s' वैध घटक नाही." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "त्रुटी: '%s' पर्यायकरीता क्षेत्र आढळले नाही." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli साधण, आवृत्ती %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "त्रुटी: पर्याय '%s' अपरिचीत आहे, 'nmcli -help' वापरून पहा." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "संकेत %d प्राप्त झाले, बंद करत आहे..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "त्रुटी: NetworkManager सह जोडणी करण्यास अशक्य." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "यश" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-बीट पासफ्रेज)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (अपरिचीत)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (अपरिचीत)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "कुठलेही, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "स्वयं" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "सेट केले नाही" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "क्षेत्र '%s' वेगळे असायला हवे" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "अवैध क्षेत्र '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "पर्याय '--terse' यांस '--fields' निर्देशीत करणे आवश्यक आहे" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "पर्याय '--terse' यांस '--fields' पर्याय मूल्ये निर्देशीत करणे आवश्यक आहे , '%s' नाही" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM कि फाइल अंतर्गत समाप्त टॅघ '%s' आढळले नाही." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM वैयक्तिक कि फाइल नुरूप आढळले नाही." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM फाइल माहिती साठवण्याकरीता स्मृती शिल्लक नाही." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "सदोषीत PEM फाइल: Proc-Type प्रथम टॅग नव्हते." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "सदोषीत PEM फाइल: अपरिचीत Proc-Type टॅग '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "सदोषीत PEM फाइल: DEK-Info दूसरे टॅग नव्हते." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "सदोषीत PEM फाइल: DEK-Info टॅग अंतर्गत IV आढळले नाही." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "सदोषीत PEM फाइल:DEK-Info टॅग अंतर्गत IV चे अवैध स्वरूप आढळे." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "सदोषीत PEM फाइल: अपरिचीत वैयक्तिक सीफर कि '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "वैयक्तिक कि डिकोड करू शकले नाही." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM प्रमाणपत्र '%s' had no end tag '%s'." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "प्रमाणपत्र डिकोड करण्यास अपयशी." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "प्रमाणपत्र माहिती साठवण्याकरीता स्मृती शिल्लक नाही." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "फाइल माहिती साठवण्याकरीता स्मृती शिल्लक नाही." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ची लांबी सम बाईटस् ची संख्या असायला हवी." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV साठवण्याकरीता स्मृती शिल्ल्क नाही." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV अंतर्गत non-hexadecimal अंक." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "वैयक्तिक कि सिफर '%s' अपरिचीत नुरूप आढळले." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "फाइल माहिती साठवण्याकरीता स्मृती शिल्लक नाही." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "वैयक्तिक कि प्रकार ओळखणे अशक्य." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "जुणी वैयक्तिक कि साठवण्याकरीता स्मृती शिल्ल्क नाही." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "क्रिप्टो इंजीन प्रारंभ करण्यास अपयशी." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 इंजीन प्रारंभ करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "अवैध IV लांबी (किमान %zd असायला हवे)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "जुणे कि बफर करीता स्मृती शिल्लक नाही." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "डिक्रीपशन सिफर संदर्भ प्रारंभ करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "डिक्रीपशन करीता सम कि निश्चित करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "डिक्रीपशन करीता IV निश्चित करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "वैयक्तिक कि डिक्रीप्ट करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "प्राइव्हेट कि डिक्रीप्ट करणे अशक्य: अनपेक्षीत पॅडींग लांबी." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "वैयक्तिक कि डिक्रीप्ट करण्यास अपयशी." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "एनक्रिप्टींग करीता मेमरीचे वाटप करणे अशक्य." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "एनक्रिप्शन सीफर संदर्भ सुरू करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "एनक्रिप्शनकरीता सम कि सेट करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "एनक्रिप्शन करीता IV सेट करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "डिक्रीप्ट करण्यास अपयशी: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "प्रमाण माहिती प्रारंभ करण्यास त्रुटी: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "प्रमाणपत्र डिकोड करण्यास अशक्य: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 डिकोडर प्रारंभ करण्यास अशक्य: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 फाइल डिकोड करण्यास अपयशी: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 फाइल तपासण्यास अशक्य: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "क्रिप्टो इंजीन प्रारंभ करण्यास अपयशी: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 संदर्भ प्रारंभ करण्यास अपयशी: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "अवैध IV लांबी (किमान %d असायला हवे)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "डिक्रीपशन सिफर क्षेत्र प्रारंभ करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "डिक्रीपशन करीता सम कि निश्चित करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "डिक्रीपशन करीता IV निश्चित करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "डिक्रीपशन संदर्भ प्रारंभ करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "वैयक्तिक कि डिक्रीप्ट करण्यास अपयशी: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "प्राइव्हेट कि डिक्रीप्ट करणे अशक्य: डिक्रीप्ट केलेला डाटा खूप मोठा आहे." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "वैयक्तिक किचे डिक्रीपशन ठरविण्यास अपयशी: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "एनक्रिप्शन सीफर स्लॉट सुरू करणे अशक्य." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "एनक्रिप्शन करीता सिमेट्रीक कि सेट करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "एनक्रिप्शनसाठी IV सेट करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "एनक्रिप्शन संदर्भ प्रारंभ करण्यास अपयशी." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "एनक्रिप्ट करण्यास अपयशी: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "एनक्रिप्टींग नंतर अनपेक्षीत डाटाचे प्रमाण." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "प्रमाणपत्र डिकोड करणे अशक्य: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "परवलीचा शब्द UCS2 नुरूप रूपांतरन अशक्य: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 डिकोडर प्रारंभ करण्यास अशक्य: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 फाइल डिकोड करण्यास अशक्य: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 फाइल तपास करण्यास अशक्य: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "विनाक्रम डाटा निर्माण करणे अशक्य." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "एनक्रिप्शन कि निर्माण करण्यास अतिरीक्त मेमरी आढळली नाही." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM फाइल निर्माणकरीता मेमरीचे वाटप करणे अशक्य." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IV ला PEM फाइलवर लिहण्यासाठी मेमरीचे वाटप करणे अशक्य." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "एनक्रिप्टेड किला PEM फाइलवर लिहण्यासाठी मेमरीचे वाटप करणे अशक्य." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM फाइल डाटाकरीता मेमरीचे वाटप करणे अशक्य." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink संदेश विश्लेषीत करतेवेळी त्रुटी: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "सॉकेट वरील माहिती करीता प्रतिक्षा करतेवेळी त्रुटी आढळली" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink शी जुळवणी स्थापीत करणे अशक्य: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink द्वारे परवानगी स्वीकारणे समर्थीत करण्यास अशक्य: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink handle चे वाटप अशक्य: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "दुवा स्थिती नियंत्रीत करण्याकरीता netlink दुवा कॅशे वाटप करणे अशक्य: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink गटसह जोडणी करणे अशक्य: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "दुवा कॅशे अद्ययावत करतेवेळी त्रुटी: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "अवैध पर्याय. वैध पर्यायची यादी पहाण्याकरीता कृपया --help वापरा.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. वैध पर्यायची सूची पहाण्याकरीता कृपया --help वापरा.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager द्वारे निर्मीत\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s पासून एकत्रीत केले\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "वापरण्याजोगी DHCP क्लाएंट आढळले नाही." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' आढळले नाही." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' आढळले नाही." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "असमर्थीत DHCP क्लाएंट '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "अपरिचीत लॉग स्तर '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "अपरिचीत लॉग डोमेन '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "NOTE: libc रिजॉलव्हर 3 पेक्षा जास्त नेमसर्व्हर्स् करीता समर्थन पुरवू शकणार नाही." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "खालिल यादीतील नेमसर्व्हर्स् अनोळखी राहतील." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "स्वयं %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "प्रणाली" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "सुरक्षीत WiFi नेटवर्क द्वारे जोडणीचे शेअरींग करा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ओपन WiFi नेटवर्क द्वारे कनेक्शन शेअरींग करा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "पर्सिस्टंट प्रणाली यजमाननाव संपादीत करा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "प्रणाली जुळवणी संपादीत करा" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "प्रणाली करार, प्रणाली संयोजना संपादीत करण्यापासून रोखतो" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "प्रणाली करार पर्सिस्टंट प्रणाली यजमाननावाचे संपादन रोखत आहे" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "प्रणाली करार सुरक्षीत WiFi नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "प्रणाली करार ओपन WiFi नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे" + diff --git a/po/nb.po b/po/nb.po new file mode 100644 index 00000000..fece349e --- /dev/null +++ b/po/nb.po @@ -0,0 +1,275 @@ +# translation of NetworkManager to Norwegian Bokmal +# This file is distributed under the same license as the NetworkManager package. +# Copyright (C) 2004, 2005 Red Hat, Inc. +# Kjartan Maraas , 2004-2008. +# Terance Edward Sola , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager 0.9.x\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-10-18 12:26+0200\n" +"PO-Revision-Date: 2008-10-18 12:26+0200\n" +"Last-Translator: Kjartan Maraas \n" +"Language-Team: Norwegian Bokmål \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" + +#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:474 +#, c-format +msgid "error processing netlink message: %s" +msgstr "feil ved prosessering av netlink-melding: %s" + +#: ../src/nm-netlink-monitor.c:250 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"kan ikke opprette netlink-håndtak for overvåking av tilkoblingsstatus: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "kan ikke koble til netlink for overvåking av status for tilkobling: %s" + +#: ../src/nm-netlink-monitor.c:268 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"kan ikke bli med i netlink-gruppen for overvåking av status for tilkobling: %" +"s" + +#: ../src/nm-netlink-monitor.c:276 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"kan ikke allokere netlink-tilkoblingsbuffer for overvåking av status for " +"tilkobling: %s" + +#: ../src/nm-netlink-monitor.c:439 +#, c-format +msgid "error updating link cache: %s" +msgstr "feil ved oppdatering av link-buffer: %s" + +#: ../src/nm-netlink-monitor.c:497 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "det skjedde en feil under venting på data på sokkel" + +#: ../src/NetworkManager.c:250 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Ugyldig flagg. Vennligst bruk --help for å se en liste med gyldige flagg.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:89 +msgid "# Created by NetworkManager\n" +msgstr "# Laget av NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:95 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Flettet fra %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:256 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "MERK: libc navneoppslag støtter ikke flere enn 3 navnetjenere." + +#: ../src/named-manager/nm-named-manager.c:258 +msgid "The nameservers listed below may not be recognized." +msgstr "Navnetjenere listet under vil kanskje ikke bli gjenkjent." + +#: ../system-settings/src/main.c:366 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../libnm-util/crypto.c:125 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM-nøkkelfil hadde ikke avsluttende tagg «%s»." + +#: ../libnm-util/crypto.c:135 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Ser ikke ut som en privat PEM-nøkkelfil." + +#: ../libnm-util/crypto.c:143 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Ikke nok minne til å lagre data for PEM-fil." + +#: ../libnm-util/crypto.c:159 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Feilutformet PEM-fil: Proc-Type var ikke første tagg." + +#: ../libnm-util/crypto.c:167 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:177 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "" + +#: ../libnm-util/crypto.c:188 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "" + +#: ../libnm-util/crypto.c:195 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" + +#: ../libnm-util/crypto.c:208 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:227 +#, c-format +msgid "Could not decode private key." +msgstr "Kunne ikke dekode privat nøkkel." + +#: ../libnm-util/crypto.c:271 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:281 +#, c-format +msgid "Failed to decode certificate." +msgstr "Klarte ikke å dekode sertifikat." + +#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Ikke nok minne til å lagre sertifikatdata." + +#: ../libnm-util/crypto.c:328 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "" + +#: ../libnm-util/crypto.c:337 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Ikke nok minne til å lagre IV." + +#: ../libnm-util/crypto.c:348 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "" + +#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:143 +#: ../libnm-util/crypto_nss.c:157 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "" + +#: ../libnm-util/crypto.c:395 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Ikke nok minne til å dekryptere privat nøkkel." + +#: ../libnm-util/crypto.c:513 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Ikke nok minne til å lagre dekryptert privat nøkkel." + +#: ../libnm-util/crypto_gnutls.c:45 +msgid "Failed to initialize the crypto engine." +msgstr "Klarte ikke å initiere kryptomotor." + +#: ../libnm-util/crypto_gnutls.c:89 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:166 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:160 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:169 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:178 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:187 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:225 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:237 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Kunne ikke dekode sertifikat: %s" + +#: ../libnm-util/crypto_nss.c:52 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:98 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:174 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "" + +#: ../libnm-util/crypto_nss.c:184 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "" + +#: ../libnm-util/crypto_nss.c:194 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "" + +#: ../libnm-util/crypto_nss.c:202 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "" + +#: ../libnm-util/crypto_nss.c:215 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:227 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:271 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Kunne ikke dekode sertifikat: %d" diff --git a/po/ne.po b/po/ne.po new file mode 100644 index 00000000..274aec0b --- /dev/null +++ b/po/ne.po @@ -0,0 +1,229 @@ +# translation of NetworkManager.NETWORKMANAGER_0_6_0_RELEASE.ne.po to Nepali +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Jyotsna Shrestha , 2005. +# Shyam Krishna Bal , 2007. +# Shiva Pokharel , 2007. +# Nabin Gautam , 2008. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.NETWORKMANAGER_0_6_0_RELEASE.ne\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-03-03 03:27+0000\n" +"PO-Revision-Date: 2008-01-21 11:28+0545\n" +"Last-Translator: Nabin Gautam \n" +"Language-Team: Nepali \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: KBabel 1.11.4\n" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:405 +msgid "Cannot add VPN connection" +msgstr "भीपीएन जडान थप गर्न सकिँदैन" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:407 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"तपाईँको प्रणालीमा कुनै अनुकूल भीपीएन सफ्टवेयर फेला परेन । तपाईँको प्रणाली " +"प्रशासकलाई सम्पर्क गर्नुहोस् ।" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:457 +msgid "Cannot import VPN connection" +msgstr "भीपीएन जडान आयात गर्न सकिँदैन" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:459 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "फाइल '%s' आयात गर्न भीपीएन जडान प्रकार '%s' का लागि उपयोगी सफ्टवेयर फेला पार्न सकिँदैन । तपाईँको प्रणाली प्रशासकलाई सम्पर्क गर्नुहोस् ।" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:596 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "भीपीएन जडान पुन: प्राप्ति गर्दा त्रुटि '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:599 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "भीपीएन जडान प्रकार '%s' का लागि यूआई फाइलहरू फेला पार्न सकेन । तपाईँको प्रणाली प्रशासकलाई सम्पर्क गर्नुहोस् ।" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:746 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "भीपीएन जडान \"%s\" मेट्नुहुन्छ ?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:749 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "भीपीएन जडान \"%s\" बारेका सबै जानकारी हराउनेछन् र तपाईँलाई नयाँ जडान सिर्जना गर्न जानकारी उपलब्ध गराउन प्रणाली प्रशासक आवश्यक पर्दछ ।" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:963 +msgid "Unable to load" +msgstr "लोड गर्न असक्षम" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:965 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "केही आवश्यक संसाधानहरू फेला पार्न सकिँदैन (ग्लेड फाइल)!" + +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1084 +msgid "Edit VPN Connection" +msgstr "भीपीएन जडान सम्पादन गर्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "नयाँ भीपीएन जडान थप्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Choose which type of VPN connection you wish to create." +msgstr "तपाईँ कस्तो प्रकारको भीपीएन जडान सिर्जना गर्न चाहनुहुन्छ रोज्नुहोस् ।" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "Connect to:" +msgstr "जडान गर्नुहोस्:" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Create VPN Connection" +msgstr "भीपीएन जडान सिर्जना गर्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Create VPN Connection - 1 of 2" +msgstr "भीपीएन जडान सिर्जना गर्नुहोस् - २ को १" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Create VPN Connection - 2 of 2" +msgstr "भीपीएन जडान सिर्जना गर्नुहोस् - २ को २" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Delete the selected VPN connection" +msgstr "चयन गरिएका भीपीएन जडान मेट्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "E_xport" +msgstr "निर्यात गर्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:9 +msgid "Edit the selected VPN connection" +msgstr "चयन गरिएका भीपीएन जडान सम्पादन गर्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:10 +msgid "Export the VPN settings to a file" +msgstr "फाइलमा भीपीएन सेटिङ निर्यात गर्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:11 +msgid "Export the selected VPN connection to a file" +msgstr "फाइलमा चयन गरिएका भीपीएन जडान निर्यात गर्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:12 +msgid "Finish Creating VPN Connection" +msgstr "भीपीएन जडानको सिर्जना समाप्त गर्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:13 +msgid "Manage Virtual Private Network Connections" +msgstr "अवास्तविक नीजि सञ्जाल जडानहरू प्रबन्ध गर्नुहोस्" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:14 +msgid "" +"This assistant will guide you through the creation of a connection to a " +"Virtual Private Network (VPN).\n" +"\n" +"It will require some information, such as IP addresses and secrets. Please " +"see your system administrator to obtain this information." +msgstr "" +"यो सहयोगले तपाईँलाई अवास्तविक नीजि सञ्जाल (भीपीएन) मा जडानको सिर्जना मार्फत मार्गदर्शन गर्नेछ ।\n" +"\n" +"यसलाई केही सूचनाको आवश्यक पर्नेछ, जस्तै आईपी ठेगानाहरू र गोप्य कुराहरू । कृपया यो जानकारी प्राप्त गर्न तपाईँको प्रणाली प्रशासकलाई सोध्नुहोस् ।" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:17 +msgid "VPN Connections" +msgstr "भीपीएन जडान" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "40-bit WEP" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "104-bit WEP" + +#: ../src/nm-ap-security-wpa-psk.c:50 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:52 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:54 +msgid "WPA Automatic" +msgstr "WPA स्वचालित" + +#: ../src/nm-ap-security-wpa-psk.c:59 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:61 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:63 +msgid "WPA2 Automatic" +msgstr "WPA2 स्वचालित" + +#: ../src/nm-ap-security.c:338 +msgid "none" +msgstr "कुनै पनि होइन" + +#: ../src/nm-netlink-monitor.c:170 +#, c-format +msgid "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "तारसहितको इथरनेट यन्त्रहरूको अनुगमनका लागि नेटलिङ्क सकेट सिर्जना गर्न असक्षम - %s" + +#: ../src/nm-netlink-monitor.c:188 +#, c-format +msgid "unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "तारसहितको इथरनेट यन्त्रको अनुगमनका लागि नेटलिङ्क सकेटमा बाइन्ड गर्न असक्षम - %s" + +#: ../src/nm-netlink-monitor.c:426 +msgid "operation took too long" +msgstr "सञ्चालनले धेरै लामो समय लियो" + +#: ../src/nm-netlink-monitor.c:523 +msgid "received data from wrong type of sender" +msgstr "गलत प्रकारको प्रेषकबाट पठाएको डेटा प्राप्त गरियो ।" + +#: ../src/nm-netlink-monitor.c:536 +msgid "received data from unexpected sender" +msgstr "अनपेक्षित प्रेषकबाट पठाएको डेटा प्राप्त गरियो" + +#: ../src/nm-netlink-monitor.c:665 +msgid "too much data was sent over socket and some of it was lost" +msgstr "सकेट माथी धेरै डेटाहरू पठाइयो र त्यसमध्ये केही हराएको थियो ।" + +#: ../src/nm-netlink-monitor.c:775 +msgid "error occurred while waiting for data on socket" +msgstr "सकेटमा डेटा प्रतिक्षा गर्दा त्रुटि देखापर्यो" + +#: ../src/nm-ap-security-wpa-eap.c:96 ../src/nm-ap-security-wpa-eap.c:120 +msgid "WPA2 Enterprise" +msgstr "WPA2 उद्यमशीलता" + +#: ../src/nm-ap-security-wpa-eap.c:98 ../src/nm-ap-security-wpa-eap.c:125 +msgid "WPA Enterprise" +msgstr "WPA उद्यमशीलता" + +#: ../src/nm-ap-security-leap.c:66 ../src/nm-ap-security-leap.c:82 +msgid "LEAP" +msgstr "LEAP" + diff --git a/po/nl.po b/po/nl.po new file mode 100644 index 00000000..0d9b571a --- /dev/null +++ b/po/nl.po @@ -0,0 +1,293 @@ +# Dutch translation of Network Manager +# +# This file is distributed under the same license as the +# NetworkManager package. +# +# Tino Meinen , 2004, 2005, 2006, 2008. +# Daniel van Eeden , 2004. +# +# +# the wired network het kabelnetwerk (is meer voor TV-kabelnetwerk?) +# bekabelde/bekabeld netwerk/draadnetwerk/vast netwerk +# the wireless network het draadloos netwerk +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-09-15 10:14+0200\n" +"PO-Revision-Date: 2008-09-14 23:56+0200\n" +"Last-Translator: Tino Meinen \n" +"Language-Team: Dutch \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" + +#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:474 +#, c-format +msgid "error processing netlink message: %s" +msgstr "fout bij verwerken netlink-bericht: %s" + +# dit is lelijk +#: ../src/nm-netlink-monitor.c:250 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"niet in staat om een netlink-hendel toe te wijzen voor het monitoren van de " +"linkstatus: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, fuzzy, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"Niet in staat om te binden aan netlink-socket voor het monitoren van " +"bekabelde ethernet-apparaten - %s" + +#: ../src/nm-netlink-monitor.c:268 +#, fuzzy, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"Niet in staat om te binden aan netlink-socket voor het monitoren van " +"bekabelde ethernet-apparaten - %s" + +#: ../src/nm-netlink-monitor.c:276 +#, fuzzy, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"niet in staat om een netlink-socket aan te maken voor het monitoren van " +"bekabelde ethernet-apparaten - %s" + +#: ../src/nm-netlink-monitor.c:439 +#, c-format +msgid "error updating link cache: %s" +msgstr "fout bij updaten link-cache: %s" + +#: ../src/nm-netlink-monitor.c:497 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "er is een fout opgetreden bij het wachten op data van de ‘socket’" + +#: ../src/NetworkManager.c:250 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Ongeldige optie. Gebruik --help om een lijst met geldige opties te zien.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:89 +msgid "# Created by NetworkManager\n" +msgstr "# Aangemaakt door NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:95 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Samengevoegd vanuit %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:256 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"Merk op: de resolver van libc ondersteunt mogelijkerwijs niet meer dan 3 " +"nameservers." + +#: ../src/named-manager/nm-named-manager.c:258 +msgid "The nameservers listed below may not be recognized." +msgstr "De naamservers hieronder worden mogelijk niet herkend." + +#: ../system-settings/src/main.c:366 +#, c-format +msgid "Auto %s" +msgstr "Automatisch %s" + +#: ../libnm-util/crypto.c:125 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM-sleutelbestand bevat geen sluiting ‘%s’" + +#: ../libnm-util/crypto.c:135 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Ziet er niet uit als een PEM-privésleutelbestand." + +#: ../libnm-util/crypto.c:143 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Onvoldoende vrij geheugen om PEM-bestandsgegevens op te slaan." + +# misvormd/foutief/onjuist/fout in/ +#: ../libnm-util/crypto.c:159 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Fout in PEM-bestand: Proc-Type was niet de eerste tag." + +#: ../libnm-util/crypto.c:167 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Fout in PEM-bestand: onbekend Proc-Type tag ‘%s’" + +#: ../libnm-util/crypto.c:177 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Fout in PEM-bestand: DEK-Info was niet de tweede tag." + +#: ../libnm-util/crypto.c:188 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Fout in PEM-bestand: geen IV gevonden in DEK-Info tag." + +#: ../libnm-util/crypto.c:195 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Fout in PEM-bestand: ongeldig format van IV in DEK-Info tag." + +#: ../libnm-util/crypto.c:208 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Fout in PEM-bestand: onbekende cryptografische privésleutel ‘%s’." + +# ontcijferen/decoderen +#: ../libnm-util/crypto.c:227 +#, c-format +msgid "Could not decode private key." +msgstr "Kon privésleutel niet decoderen." + +#: ../libnm-util/crypto.c:271 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM-certificaat ‘%s’ bevat geen sluitings-tag ‘%s’" + +# ontcijferen/decoderen +#: ../libnm-util/crypto.c:281 +#, c-format +msgid "Failed to decode certificate." +msgstr "Kon certificaat niet decoderen." + +#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Onvoldoende vrij geheugen om certificaatdata op te slaan." + +#: ../libnm-util/crypto.c:328 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV moet een even aantal bytes in lengte zijn." + +#: ../libnm-util/crypto.c:337 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Onvoldoende vrij geheugen om de IV op te slaan." + +#: ../libnm-util/crypto.c:348 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV bevat niet-hexadecimale cijfers." + +#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:143 +#: ../libnm-util/crypto_nss.c:157 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Cryptografische privésleutel ‘%s’ is onbekend." + +#: ../libnm-util/crypto.c:395 +#, c-format +msgid "Not enough memory to create private key decryption key." +msgstr "" +"Onvoldoende vrij geheugen om privésleutel voor sleutelontcijfering aan te " +"maken." + +#: ../libnm-util/crypto.c:513 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Onvoldoende vrij geheugen om de ontcijferde privésleutel op te slaan." + +#: ../libnm-util/crypto_gnutls.c:45 +msgid "Failed to initialize the crypto engine." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:89 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:152 ../libnm-util/crypto_nss.c:166 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:160 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:169 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:178 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:187 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:225 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:237 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "" + +#: ../libnm-util/crypto_nss.c:52 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:98 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:174 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "" + +#: ../libnm-util/crypto_nss.c:184 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "" + +#: ../libnm-util/crypto_nss.c:194 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "" + +#: ../libnm-util/crypto_nss.c:202 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "" + +#: ../libnm-util/crypto_nss.c:215 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:227 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:271 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Kon certificaat: %d niet decoderen" diff --git a/po/oc.po b/po/oc.po new file mode 100644 index 00000000..df55c4a7 --- /dev/null +++ b/po/oc.po @@ -0,0 +1,241 @@ +# Occitan translation of NetworkManager. +# Copyright (C) 2004-2007 The GNOME Foundation. +# This file is distributed under the same license as the NetworkManager package. +# +# Yannig Marchegay (Kokoyaya) , 2007. +msgid "" +msgstr "" +"Project-Id-Version: oc\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-07-02 09:01+0200\n" +"PO-Revision-Date: 2007-12-29 18:31+0100\n" +"Last-Translator: Yannig Marchegay (Kokoyaya) \n" +"Language-Team: Occitan \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" + +#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:471 +#, c-format +msgid "error processing netlink message: %s" +msgstr "error al moment de tractar lo messatge netlink : %s" + +#: ../src/nm-netlink-monitor.c:250 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" + +#: ../src/nm-netlink-monitor.c:268 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" + +#: ../src/nm-netlink-monitor.c:276 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" + +#: ../src/nm-netlink-monitor.c:494 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "" + +#: ../src/NetworkManager.c:250 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" + +#: ../src/named-manager/nm-named-manager.c:117 +msgid "NOTE: the glibc resolver does not support more than 3 nameservers." +msgstr "" + +#: ../src/named-manager/nm-named-manager.c:119 +msgid "The nameservers listed below may not be recognized." +msgstr "" + +#: ../system-settings/src/main.c:365 +#, c-format +msgid "Auto %s" +msgstr "" + +#: ../libnm-util/crypto.c:123 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:133 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "" + +#: ../libnm-util/crypto.c:141 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "" + +#: ../libnm-util/crypto.c:157 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "" + +#: ../libnm-util/crypto.c:165 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:175 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "" + +#: ../libnm-util/crypto.c:186 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "" + +#: ../libnm-util/crypto.c:193 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "" + +#: ../libnm-util/crypto.c:206 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:225 +#, c-format +msgid "Could not decode private key." +msgstr "" + +#: ../libnm-util/crypto.c:269 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "" + +#: ../libnm-util/crypto.c:279 +#, c-format +msgid "Failed to decode certificate." +msgstr "" + +#: ../libnm-util/crypto.c:288 ../libnm-util/crypto.c:296 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "" + +#: ../libnm-util/crypto.c:326 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "" + +#: ../libnm-util/crypto.c:335 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "" + +#: ../libnm-util/crypto.c:346 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "" + +#: ../libnm-util/crypto.c:384 ../libnm-util/crypto_gnutls.c:125 +#: ../libnm-util/crypto_nss.c:134 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "" + +#: ../libnm-util/crypto.c:393 +#, c-format +msgid "Not enough memory to create private key decryption key." +msgstr "" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:72 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:134 ../libnm-util/crypto_nss.c:143 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:142 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:151 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:160 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:169 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:207 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "" + +#: ../libnm-util/crypto_gnutls.c:219 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "" + +#: ../libnm-util/crypto_nss.c:76 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:151 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "" + +#: ../libnm-util/crypto_nss.c:161 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "" + +#: ../libnm-util/crypto_nss.c:171 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "" + +#: ../libnm-util/crypto_nss.c:192 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:204 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "" + +#: ../libnm-util/crypto_nss.c:248 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "" diff --git a/po/or.po b/po/or.po new file mode 100644 index 00000000..d9fa2b71 --- /dev/null +++ b/po/or.po @@ -0,0 +1,1641 @@ +# translation of or.po to Oriya +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Manoj Kumar Giri , 2008, 2010. +msgid "" +msgstr "" +"Project-Id-Version: or\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 12:43+0530\n" +"Last-Translator: Manoj Kumar Giri \n" +"Language-Team: Oriya \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" +"\n" +"\n" +"\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "ତ୍ରୁଟି: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'con list': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ର: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "ସଂଯୋଗ ବିବରଣୀ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "ତନ୍ତ୍ର" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ଚାଳକ" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "କଦାପି ନୁହଁ" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ହଁ" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ନାଁ" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "ତନ୍ତ୍ର ସଂଯୋଗଗୁଡ଼ିକ" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ଚାଳକ ସଂଯୋଗଗୁଡ଼ିକ" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ତ୍ରୁଟି: %s ସ୍ୱତନ୍ତ୍ରଚର ଅନୁପସ୍ଥିତ ଅଛି।" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ତ୍ରୁଟି: %s - ଏପରି କୌଣସି ସଂଯୋଗ ନାହିଁ।" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "ଅଜଣା ପ୍ରାଚଳ: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ତ୍ରୁଟି: କୌଣସି ବୈଧ ପ୍ରାଚଳ ଉଲ୍ଲେଖ ହୋଇନାହିଁ।" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ତ୍ରୁଟି: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "ତ୍ରୁଟି: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'con status': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ର: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "ସକ୍ରିୟ ସଂଯୋଗଗୁଡ଼ିକ" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ଉପକରଣ '%s' ରେ କୌଣସି ସକ୍ରିୟ ସଂଯୋଗ ନାହିଁ" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "କୌଣସି ସକ୍ରିୟ ସଂଯୋଗ କିମ୍ବା ଉପକରଣ ନାହିଁ" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "ଉପକରଣ '%s' ସଂଯୋଗ '%s' ସହିତ ସୁସଙ୍ଗତ ନୁହଁ" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "ସଂଯୋଗ '%s' ପାଇଁ କୌଣସି ଉପକରଣ ମିଳିଲା ନାହିଁ" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "ସକ୍ରିୟ କରୁଅଛି" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "ସକ୍ରିୟ ହୋଇସାରିଛି" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "ଅଜଣା" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN ସଂଯୋଗ କରୁଅଛି (ପ୍ରସ୍ତୁତ)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN ସଂଯୋଗ କରୁଅଛି (ବୈଧିକରଣ ଆବଶ୍ୟକ)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN ସଂଯୋଗ କରୁଅଛି" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN ସଂଯୋଗ କରୁଅଛି (IP ସଂରଚନା ଗ୍ରହଣ କରୁଅଛି)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN ସଂଯୁକ୍ତ ହୋଇଛି" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN ସଂଯୋଗ ବିଫଳ ହୋଇଛି" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "ଅଜଣା କାରଣ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "କିଛି ନୁହେଁ" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ଚାଳକଟି ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଥିଲା" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "ମୂଳ ନେଟୱର୍କ ସଂଯୋଗଟି ବାଧାପ୍ରାପ୍ତ ହୋଇଥିଲା" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN ସର୍ଭିସ ଅପ୍ରତ୍ୟାଶିତ ଭାବରେ ବନ୍ଦ ହୋଇଯାଇଛି" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN ସର୍ଭିସ ଅବୈଧ ସଂରଚନା ଫେରାଇଛି" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "ସଂଯୋଗ ସମୟ ସମାପ୍ତ ପାଇଁ ଚେଷ୍ଟାକରିଛି" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN ସର୍ଭିସ ଠିକ ସମୟରେ ଆରମ୍ଭ ହୋଇନଥିଲା" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN ସର୍ଭିସ ଆରମ୍ଭ ହେବାରେ ବିଫଳ ହୋଇଛି" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "କୌଣସି ବୈଧ VPN ଗୁପ୍ତ ତଥ୍ୟ ନାହିଁ" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "ଅବୈଧ VPN ଗୁପ୍ତ ତଥ୍ୟଗୁଡ଼ିକ" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "ସଂଯୋଗକୁ କଢ଼ାଯାଇଛି" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "ଅବସ୍ଥା: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "ସଂଯୋଗ ସକ୍ରିୟ ହୋଇଛି\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି।" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "ଅବସ୍ଥା: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ତ୍ରୁଟି: ସମୟ ସମାପ୍ତ %d ସେକଣ୍ଡ ବିତିଯାଇଛି।" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ସକ୍ରିୟଣ ବିଫଳ ହୋଇଛି: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ତ୍ରୁଟି: '%s' ପାଇଁ ସକ୍ରିୟ ସଂଯୋଗ ଧାରଣ କରିବାରେ ବିଫଳ ହୋଇଛି।" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "ସକ୍ରିୟ ସଂଯୋଗ ଅବସ୍ଥା: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "ସକ୍ରିୟ ସଂଯୋଗ ପଥ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ତ୍ରୁଟି: ଅଜଣା ସଂଯୋଗ: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ତ୍ରୁଟି: ସମୟ ସମାପ୍ତ ମୂଲ୍ୟ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ତ୍ରୁଟି: id କିମ୍ବା uuid କୁ ଉଲ୍ଲେଖ କରିବା ଉଚିତ।" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ତ୍ରୁଟି: କୌଣସି ଉପଯୁକ୍ତ ଉପକରଣ ମିଳିଲାନାହିଁ: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ତ୍ରୁଟି: କୌଣସି ଉପଯୁକ୍ତ ଉପକରଣ ମିଳିଲାନାହିଁ।" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "ଚେତାବନୀ: ସଂଯୋଗ ସକ୍ରିୟ ନୁହଁ\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ତ୍ରୁଟି: 'con' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ତ୍ରୁଟି: D-Bus ସହିତ ସଂଯୁକ୍ତ ହୋଇପାରିଲା ନାହିଁ।" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ତ୍ରୁଟି: ତନ୍ତ୍ର ସଂରଚନା ପାଇଲା ନାହିଁ।" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ତ୍ରୁଟି: ଚାଳକ ସଂରଚନା ପାଇଲା ନାହିଁ।" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ତ୍ରୁଟି: ସଂଯୋଗ ଧାରଣ କରିପାରିବେ ନାହିଁ: ବିନ୍ୟାସ ସର୍ଭିସଗୁଡ଼ିକ ଚାଲୁନାହିଁ।" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "ଅପରିଚାଳିତ" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "ଅନୁପଲବ୍ଧ" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "ସଂଯୋଗ କରୁଅଛି (ପ୍ରସ୍ତୁତ)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "ସଂଯୋଗ କରୁଅଛି (ବିନ୍ୟାସ କରୁଅଛି)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "ସଂଯୋଗ କରୁଅଛି (ବୈଧିକରଣ ଆବଶ୍ୟକ)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "ସଂଯୋଗ କରୁଅଛି (IP ସଂରଚନା ଗ୍ରହଣ କରୁଅଛି)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "ସଂଯୋଗ ସ୍ଥାପିତ ହେଲା" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "ସଂଯୋଗ ବିଫଳ ହୋଇଛି" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "ଅଜଣା" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(କିଛି ନାହିଁ)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ଠିକଣା 0x%X କୁ ପରିବର୍ତ୍ତନ କରିବାରେ ତ୍ରୁଟି" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "ସଂଗୁପ୍ତ: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "ବାଣିଜ୍ୟିକ" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "ଏଡ-ହୋକ" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "ଅବସଂରଚନା" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "ତ୍ରୁଟି: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'dev list': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ଉପକରଣ ବିବରଣୀ" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(ଅଜଣା)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "ଅଜଣା)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ଚାଲୁ" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ବନ୍ଦ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "ତ୍ରୁଟି: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'dev status': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ଉପକରଣର ସ୍ଥିତି" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ତ୍ରୁଟି: '%s' ସ୍ୱତନ୍ତ୍ରଚର ଅନୁପସ୍ଥିତ।" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' ମିଳିଲା ନାହିଁ।" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "ସଫଳ: ଉପକରଣ '%s' ସଫଳତାର ସହିତ ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ହୋଇଛି।" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' (%s) ସଂଯୋଗ ବିଚ୍ଛିନ୍ନ ବିଫଳ ହୋଇଛି: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ଉପକରଣ ସ୍ଥିତି: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ତ୍ରୁଟି: iface କୁ ଉଲ୍ଲେଖ କରାଯିବା ଉଚିତ।" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "ତ୍ରୁଟି: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'dev wifi': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi କ୍ରମବୀକ୍ଷଣ ତାଲିକା" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ତ୍ରୁଟି: hwaddr '%s' ସହିତ ଅଭିଗମ୍ୟତା ବିନ୍ଦୁ ମିଳିଲା ନାହିଁ।" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ତ୍ରୁଟି: ଉପକରଣ '%s' ଟି ଗୋଟିଏ WiFi ଉପକରଣ ନୁହଁ।" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ତ୍ରୁଟି: 'dev wifi' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ତ୍ରୁଟି: 'dev' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "ଶୁପ୍ତ" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "ସଂଯୋଗ କରୁଅଛି" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "ତ୍ରୁଟି: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "ତ୍ରୁଟି: 'nm status': %s; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager ସ୍ଥିତି" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "ସକ୍ରିୟ" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "ନିଷ୍କ୍ରିୟ" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "ଚାଲୁଅଛି" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "ଚାଲୁନାହିଁ" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "ତ୍ରୁଟି: '--fields' ମୂଲ୍ୟ '%s' ଏଠାରେ ବୈଧ ନୁହଁ; ଅନୁମତିପ୍ରାପ୍ତ କ୍ଷେତ୍ରଗୁଡ଼ିକ: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi ସକ୍ରିୟ ଅଛି" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ତ୍ରୁଟି: ଅବୈଧ 'wifi' ପ୍ରାଚଳ: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN ସକ୍ରିୟ ଅଛି" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ତ୍ରୁଟି: ଅବୈଧ 'wwan' ପ୍ରାଚଳ: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ତ୍ରୁଟି: 'nm' ନିର୍ଦ୍ଦେଶ '%s' ଟି ବୈଧ ନୁହଁ।" + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "ତ୍ରୁଟି: ବସ୍ତୁ '%s' ଟି ଅଜଣା ଅଟେ, 'nmcli help' କୁ ଚେଷ୍ଟା କରନ୍ତୁ।" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '--terse' କୁ ଦ୍ୱିତୀୟ ଥର ପାଇଁ ଉଲ୍ଲେଖ କରାଯାଇଛି।" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '--terse' ଏବଂ '--pretty' ପରସ୍ପର ଠାରୁ ପୃଥକ।" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '--pretty' କୁ ଦ୍ୱିତୀୟ ଥର ପାଇଁ ଉଲ୍ଲେଖ କରାଯାଇଛି।" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '--pretty' ଏବଂ '--terse' ପରସ୍ପର ଠାରୁ ପୃଥକ।" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ତ୍ରୁଟି: '%s' ବିକଳ୍ପ ପାଇଁ ସ୍ୱତନ୍ତ୍ରଚର ଅନୁପସ୍ଥିତ ଅଛି।" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "ତ୍ରୁଟି: '%s' ଟି '%s' ପାଇଁ ଗୋଟିଏ ବୈଧ ସ୍ୱତନ୍ତ୍ରଚର ନୁହଁ।" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "ତ୍ରୁଟି: '%s' ବିକଳ୍ପ ପାଇଁ ସ୍ଥାନ ଅନୁପସ୍ଥିତ।" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli ସାଧନ, ସଂସ୍କରଣ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ତ୍ରୁଟି: ବିକଳ୍ପ '%s' ଟି ଅଜଣା, 'nmcli -help' କୁ ଚେଷ୍ଟାକରନ୍ତୁ।" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "ସଂକେତ %d କୁ ଧରିଅଛି, ବନ୍ଦ କରୁଅଛି..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ତ୍ରୁଟି: NetworkManager ସହିତ ସଂଯୋଗ ସ୍ଥାପନ କରିପାରିଲା ନାହିଁ।" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "ସଫଳତା" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-ବିଟ ପ୍ରବେଶ ସଂକେତ ବାକ୍ୟାଂଶ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (ଅଜଣା)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (ଅଜଣା)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ଯେକୌଣସି, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "ସ୍ୱୟଂଚାଳିତ" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "ସେଟ ହୋଇନାହିଁ" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "କ୍ଷେତ୍ର '%s' ଏକୁଟିଆ ଥିବା ଉଚିତ" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ଅବୈଧ କ୍ଷେତ୍ର '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "ବିକଳ୍ପ '--terse' '--fields' କୁ ଉଲ୍ଲେଖ କରିବା ଆବଶ୍ୟକ କରିଥାଏ" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "ବିକଳ୍ପ '--terse' ନିର୍ଦ୍ଦିଷ୍ଟ '--fields' ବିକଳ୍ପ ମୂଲ୍ୟଗୁଡ଼ିକୁ ଆବଶ୍ୟକ କରିଥାଏ , '%s' କୁ ନୁହଁ" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM କି ଫାଇଲରେ କୌଣସି ଅନ୍ତ ଟ୍ୟାଗ ନାହିଁ '%s'." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM ବ୍ୟକ୍ତିଗତ କି ଫାଇଲ ପରି ଦେଖାଯାଉନାହିଁ." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ଫାଇଲ ତଥ୍ୟକୁ ସଂରକ୍ଷଣ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "ତ୍ରୁଟିଯୁକ୍ତ PEM ଫାଇଲ: Proc-ପ୍ରକାରଟି ପ୍ରଥମ ଟ୍ୟାଗ ନୁହଁ." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "ତ୍ରୁଟିଯୁକ୍ତ PEM ଫାଇଲ: ଅଜଣା Proc-ପ୍ରକାର ଟ୍ୟାଗ '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "ତ୍ରୁଟିଯୁକ୍ତ PEM ଫାଇଲ: DEK-ସୂଚନାଟି ଦ୍ୱିତୀୟ ଟ୍ୟାଗ ନୁହଁ." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "ତ୍ରୁଟିଯୁକ୍ତ PEM ଫାଇଲ: DEK-ସୂଚନା ଟ୍ୟାଗରେ କୌଣସି IV ମିଳିଲା ନାହିଁ." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "ତ୍ରୁଟିଯୁକ୍ତ PEM ଫାଇଲ: DEK-ସୂଚନା ଟ୍ୟାଗରେ IVର ଅବୈଧ ଶୈଳୀ." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "ତ୍ରୁଟିଯୁକ୍ତ PEM ଫାଇଲ: ଅଜଣା ବ୍ୟକ୍ତିଗତ କି କୁଞ୍ଜି '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "ବ୍ୟକ୍ତିଗତ କି କୁ ଅବସଂକେତ କରିହେବ ନାହିଁ." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM ପ୍ରମାଣ ପତ୍ର '%s' ରେ ଅନ୍ତ ଟ୍ୟାଗ ନାହିଁ '%s'." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "ପ୍ରମାଣପତ୍ର ଅବସଂକେତକ କରିବାରେ ବିଫଳ." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "ପ୍ରମାଣପତ୍ର ତଥ୍ୟ ସଂରକ୍ଷଣ ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ଫାଇଲ ତଥ୍ୟ ସଂରକ୍ଷଣ ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ଆକାରରେ ନିଶ୍ଚିତ ରୂପେ ଗୋଟିଏ ଯୁଗ୍ମ ସଂଖ୍ୟକ ବାଇଟ ହୋଇଥିବା ଉଚିତ." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV କୁ ସଂରକ୍ଷଣ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV ଷୋହଳମିକ ସଂଖ୍ୟା ଧାରଣ କରିନଥାଏ." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "ବ୍ୟକ୍ତିଗତ କି କୁଞ୍ଜି '%s' ଅଜଣା ଥିଲା." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "ବ୍ୟକ୍ତିଗତ କି କୁ ବିକୋଡ଼ନ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "ବ୍ୟକ୍ତିଗତ କି ପ୍ରକାର ନିର୍ଧାରଣ କରିବାରେ ଅସମର୍ଥ." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ବିକୋଡ଼ନ ବ୍ୟକ୍ତିଗତ ତଥ୍ୟ ସଂରକ୍ଷଣ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "କ୍ରିପ୍ଟ ଯନ୍ତ୍ରକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 ଯନ୍ତ୍ରକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "ଅବୈଧ IV ଲମ୍ବ (ଅତିକମରେ %zd ହେବା ଉଚିତ)।" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "କି ବଫରକୁ ବିକୋଡ଼ନ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ଥାନ ନାହିଁ." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ବିକୋଡ଼ନ କୁଞ୍ଜି ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ବିକୋଡ଼ନ ପାଇଁ ସମମିତ କି ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "ବିକୋଡ଼ନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "ବ୍ୟକ୍ତିଗତ କି କୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରିବାରେ ବିଫଳ: ଅପ୍ରତ୍ୟାଶିତ ପ୍ୟାଡିଙ୍ଗ ଲମ୍ବ।" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "ବ୍ୟକ୍ତିଗତ କି କୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "ସଂଗୁପ୍ତ କରିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନକୁ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "ବିକୋଡ଼ନ କୁଞ୍ଜି ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "ବିକୋଡ଼ନ ପାଇଁ ସମମିତ କି ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "ବିକୋଡ଼ନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "ତଥ୍ୟକୁ ବିକୋଡ଼ନ କରିବାରେ ବିଫଳ: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "ପ୍ରମାଣପତ୍ର ତଥ୍ୟକୁ ଆରମ୍ଭ କରିବାରେ ତ୍ରୁଟି: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "ପ୍ରମାଣପତ୍ରକୁ ଅବସଂକେତ କରିପାରିଲେ ନାହିଁ: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ଅବସଂକେତକକୁ ଆରମ୍ଭ କରିପାରିଲେ ନାହିଁ: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ଫାଇଲକୁ ଅବସଂକେତ କରିହେବ ନାହିଁ: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ଫାଇଲକୁ ଯାଞ୍ଚ କରିହେଲା ନାହିଁ: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "କ୍ରିପ୍ଟ ଯନ୍ତ୍ରକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "ଅବୈଧ IV ଲମ୍ବ (ନିଶ୍ଚିତ ଭାବରେ ଅତିକମରେ %d ହେବା ଉଚିତ)।" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ଅବସଂକେତନ କୁଞ୍ଜି ସ୍ଥାନକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ଅବସଂକେତନ ପାଇଁ ସମମିତ କିକୁ ବିନ୍ୟାସ କରିବାରେ ବିଫଳ." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ଅବସଂକେତନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ଅବସଂକେତନ ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରିବାରେ ବିଫଳ: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "ବ୍ୟକ୍ତିଗତ କିକୁ ଅବସଂକେତ କରିବାରେ ବିଫଳ: ଅବସଂକେତ ତଥ୍ୟଟି ଅତ୍ୟଧିକ ବଡ଼।" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "ବ୍ୟକ୍ତିଗତ କିର ଅବସଂକେତନକୁ ନିଶ୍ଚୟ କରିବାରେ ବିଫଳ: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "ଅବସଂକେତନ କୁଞ୍ଜି ସ୍ଥାନକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ।" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "ଅବସଂକେତନ ପାଇଁ ସମମିତ କିକୁ ବିନ୍ୟାସ କରିବାରେ ବିଫଳ।" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "ଅବସଂକେତନ ପାଇଁ IV ବିନ୍ୟାସ କରିବାରେ ବିଫଳ।" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "ଅବସଂକେତନ ପ୍ରସଙ୍ଗକୁ ଆରମ୍ଭ କରିବାରେ ବିଫଳ।" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "ଅବସଂକେତ କରିବାରେ ବିଫଳ: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ସଂଗୁପ୍ତ କରିବା ପରେ ଅପ୍ରତ୍ୟଶିତ ପରିମାଣର ତଥ୍ୟ।" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "ପ୍ରମାଣପତ୍ରକୁ ଅବସଂକେତନ କରିହେଲା ନାହିଁ: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "ପ୍ରବେଶସଙ୍କେତକୁ UCS2ରେ ପରିବର୍ତ୍ତନ କରିହେଲା ନାହିଁ: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ଅବସଂକେତକକୁ ଆରମ୍ଭ କରିହେଲା ନାହିଁ: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ଫାଇଲକୁ ଅବସଂକେତନ କରିହେଲା ନାହିଁ: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ଫାଇଲକୁ ଯାଞ୍ଚ କରିହେଲାନାହିଁ: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "ମନଇଚ୍ଛା ତଥ୍ୟକୁ ଅବସଂକେତ କରିହେଲା ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "ବିକୋଡ଼ନ କି କୁ ନିର୍ମାଣ କରିବା ପାଇଁ ଯଥେଷ୍ଟ ସ୍ମୃତି ସ୍ଥାନ ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ଫାଇଲ ନିର୍ମାଣ ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ଫାଇଲରେ IV ଲେଖିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ଫାଇଲରେ ସଂଗୁପ୍ତ କି ଲେଖିବା ପାଇଁ ସ୍ମୃତି ସ୍ଥାନ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ଫାଇଲ ତଥ୍ୟକୁ ବଣ୍ଟନ କରିପାରିଲା ନାହିଁ।" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink ସନ୍ଦେଶ ପଠାଇବାରେ ତ୍ରୁଟି: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ସକେଟରେ ତଥ୍ୟ ପାଇଁ ଅପେକ୍ଷା କରିବା ସମୟରେ ତ୍ରୁଟି" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ସହିତ ସଂଯୋଗ ହେବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink ନିୟନ୍ତ୍ରଣ ଅଧିକାର ପଠାଇବାକୁ ସକ୍ରିୟ କରିବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink ନିୟନ୍ତ୍ରଣ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ସଂଯୋଗ ସ୍ଥିତି ଅନ୍ୱେଷଣ କରିବା ପାଇଁ netlink କ୍ୟାଶେ ଦର୍ଶାଇବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink ଶ୍ରେଣୀରେ ମିଶିବାରେ ଅସମର୍ଥ: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "ସଂଯୋଗ କ୍ୟାଶେ ଅଦ୍ୟତନ କରିବାରେ ତ୍ରୁଟି: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "ଅବୈଧ ବିକଳ୍ପ. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --ସହାୟତା ବ୍ୟବହାର କରନ୍ତୁ.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. ବୈଧ ବିକଳ୍ପର ତାଲିକା ଦେଖିବା ପାଇଁ ଦୟାକରି --help ବ୍ୟବହାର କରନ୍ତୁ।\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# NetworkManager ଦ୍ୱାରା ନିର୍ମିତ\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %s ରୁ ମିଶ୍ରିତ\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "କୌଣସି ଉପଯୋଗୀ DHCP କ୍ଲାଏଣ୍ଟ ମିଳିଲା ନାହିଁ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' ମିଳି ପାରିଲା।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ମିଳିପାରିଲା।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "ଅସମର୍ଥିତ DHCP କ୍ଲାଏଣ୍ଟ '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "ଅଜ୍ଞାତ ଲଗ ସ୍ତର '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "ଅଜ୍ଞାତ ଲଗ ଡମେନ '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "ଟିପ୍ପଣୀ: libc resolver 3 ରୁ ଅଧିକ nameserverଗୁଡ଼ିକୁ ସମର୍ଥନ କରିନପାରେ." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "ନିମ୍ନରେ ତାଲିକାଭୁକ୍ତ nameserverଗୁଡ଼ିକୁ ଚିହ୍ନି ହୋଇନପାରେ." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "ସ୍ୱୟଂ %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "ତନ୍ତ୍ର" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ଗୋଟିଏ ସୁରକ୍ଷିତ WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ଗୋଟିଏ ଖୋଲା WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "ସ୍ଥାୟୀ ତନ୍ତ୍ର ହୋଷ୍ଟନାମକୁ ପରିବର୍ତ୍ତନ କରନ୍ତୁ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "ତନ୍ତ୍ର ସଂଯୋଗଗୁଡ଼ିକୁ ପରିବର୍ତ୍ତନ କରନ୍ତୁ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "ତନ୍ତ୍ର ନିତୀ ତନ୍ତ୍ର ବିନ୍ୟାସ ପରିବର୍ତ୍ତନକୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "ତନ୍ତ୍ର ନିତୀ ସ୍ଥାୟୀ ତନ୍ତ୍ର ହୋଷ୍ଟନାମର ପରିବର୍ତ୍ତନକୁ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "ତନ୍ତ୍ର ନିତୀ ଗୋଟିଏ ସୁରକ୍ଷିତ WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ତନ୍ତ୍ର ନିତୀ ଗୋଟିଏ ଖୋଲା WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ" + diff --git a/po/pa.po b/po/pa.po new file mode 100644 index 00000000..90b36c5a --- /dev/null +++ b/po/pa.po @@ -0,0 +1,1900 @@ +# translation of NetworkManager.HEAD.po to Punjabi +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Amanpreet Singh Alam , 2004. +# Amanpreet Singh Alam , 2005. +# A S Alam , 2007. +# Jaswinder Singh , 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:40+0530\n" +"Last-Translator: Jaswinder Singh \n" +"Language-Team: Punjabi/Panjabi \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"ਵਰਤੋਂ: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Error: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Error: 'con list': %s; allowed fields: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "ਕੁਨੈਕਸ਼ਨ ਵੇਰਵਾ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "ਸਿਸਟਮ" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "ਯੂਜ਼ਰ" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ਕਦੇ ਨਹੀਂ" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ਹਾਂ" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "ਨਹੀਂ" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "ਸਿਸਟਮ ਕੁਨੈਕਸ਼ਨ" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "ਗਲਤੀ: %s ਆਰਗੂਮੈਂਟ ਮੌਜੂਦ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "ਗਲਤੀ: %s - ਇੰਝ ਦਾ ਕੋਈ ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਹੈ" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "ਅਣਜਾਣ ਪੈਰਾਮੀਟਰ: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਪੈਰਾਮੀਟਰ ਨਹੀਂ ਦਿੱਤਾ।" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "ਗਲਤੀ: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Error: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Error: 'con status': %s; allowed fields: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "ਜੰਤਰ '%s' ਉੱਤੇ ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਹੈ" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "ਕੋਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਜਾਂ ਜੰਤਰ ਨਹੀਂ ਹੈ" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "device '%s' not compatible with connection '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "ਕੁਨੈਕਸ਼ਨ '%s' ਲਈ ਕੋਈ ਜੰਤਰ ਨਹੀਂ ਲੱਭਿਆ" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "ਚਾਲੂ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "ਚਾਲੂ ਕੀਤਾ" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "ਅਣਜਾਣ" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN ਕੁਨੈਕਸ਼ਨ (ਤਿਆਰੀ)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ ਹੈ)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN ਕੁਨੈਕਟ ਹੈ" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ ਹੋਇਆ" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN ਡਿਸ-ਕੁਨੈਕਟ" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "ਅਣਜਾਣ ਕਾਰਨ" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "ਕੋਈ ਨਹੀਂ" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "ਯੂਜ਼ਰ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "ਬੇਸ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ 'ਚ ਰੁਕਾਵਟ" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN ਸਰਵਿਸ ਅਚਾਨਕ ਰੁਕ ਗਈ" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN ਸਰਵਿਸ ਨੇ ਅਢੁੱਕਵੀਂ ਸੰਰਚਨਾ ਵਾਪਸ ਕੀਤੀ" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "ਕੁਨੈਕਸ਼ਨ ਕੋਸ਼ਿਸ਼ ਦੌਰਾਨ ਸਮਾਂ ਸਮਾਪਤ ਹੋ ਗਿਆ" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN ਸਰਵਿਸ ਸਮੇਂ 'ਚ ਸ਼ੁਰੂ ਨਹੀਂ ਹੋਈ" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN ਸਰਵਿਸ ਸ਼ੁਰੂ ਹੋਣ ਲਈ ਫੇਲ੍ਹ ਹੋਈ" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "ਕੋਈ ਢੁੱਕਵਾਂ VPN ਭੇਦ ਨਹੀਂ" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "ਅਢੁੱਕਵਾਂ VPN ਭੇਦ" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "ਕੁਨੈਕਸ਼ਨ ਹਟਾਇਆ ਗਿਆ" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "ਹਾਲਤ: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕੀਤਾ\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "ਗਲਤ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "ਹਾਲਤ: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s।" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "ਗਲਤੀ: ਸਮਾਂ-ਸਮਾਪਤੀ %d ਸਕਿੰਟ ਖਤਮ ਹੋਏ।" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "ਗਲਤੀ: '%s' ਲਈ ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਲੈਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਹਾਲਤ: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "ਚਾਲੂ ਕੁਨੈਕਸ਼ਨ ਪਾਥ: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "ਗਲਤੀ: ਅਣਜਾਣ ਕੁਨੈਕਸ਼ਨ: %s।" + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "ਗਲਤੀ: ਸਮਾਂ-ਸਮਾਪਤੀ ਮੁੱਲ '%s' ਢੁੱਕਵਾਂ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "ਗਲਤੀ: id ਜਾਂ uuid ਨਹੀਂ ਦਿੱਤਾ।" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਜੰਤਰ ਨਹੀਂ ਲੱਭਿਆ: %s।" + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "ਗਲਤੀ: ਕੋਈ ਢੁੱਕਵਾਂ ਜੰਤਰ ਨਹੀਂ ਮਿਲਿਆ।" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "ਚੇਤਾਵਨੀ: ਕੁਨੈਕਸ਼ਨ ਚਾਲੂ ਨਹੀਂ ਹੈ\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "ਗਲਤੀ: 'con' ਕਮਾਂਡ '%s' ਢੁੱਕਵਾਂ ਨਹੀਂ।" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "ਗਲਤੀ: ਡੀ-ਬੱਸ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "ਗਲਤੀ: ਸਿਸਟਮ ਸੈਟਿੰਗ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ।" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "ਗਲਤੀ: ਯੂਜ਼ਰ ਸੈਟਿੰਗ ਨਹੀਂ ਲਈ ਜਾ ਸਕੀ।" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "ਗਲਤੀ: ਕੁਨੈਕਸ਼ਨ ਨਹੀਂ ਲਿਆ ਜਾ ਸਕਦਾ: ਸਿਸਟਮ ਸਰਵਿਸ ਨਹੀਂ ਚੱਲ ਰਹੀ ਹੈ।" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"ਵਰਤੋਂ: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "ਬਿਨ-ਪਰਬੰਧ" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "ਅਣ-ਉਪਲੱਬਧ" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "ਡਿਸ-ਕੁਨੈਕਟ ਕੀਤਾ" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਤਿਆਰੀ)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਸੰਰਚਨਾ ਜਾਰੀ)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (ਪਰਮਾਣਕਿਤਾ ਦੀ ਲੋੜ)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ (IP ਸੰਰਚਨਾ ਲਈ ਜਾ ਰਹੀ ਹੈ)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "ਕੁਨੈਕਟ ਹੋਇਆ" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ ਹੈ" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "ਅਣਜਾਣ" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(ਕੋਈ ਨਹੀਂ)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 ਐਡਰੈੱਸ 0x%X ਬਦਲਣ ਦੌਰਾਨ ਗਲਤੀ" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "ਇੰਕ੍ਰਿਪਟ ਕੀਤਾ: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "ਇੰਫਰਾਸਟੱਕਚਰ" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Error: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Error: 'dev list': %s; allowed fields: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "ਜੰਤਰ ਵੇਰਵਾ" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(ਅਣਜਾਣ)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "ਅਣਜਾਣ)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ਚਾਲੂ" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ਬੰਦ" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Error: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Error: 'dev status': %s; allowed fields: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "ਜੰਤਰਾਂ ਦੀ ਹਾਲਤ" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "ਗਲਤੀ: '%s' ਆਰਗੂਮੈਂਟ ਗੁੰਮ ਹੈ।" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਨਹੀਂ ਲੱਭਿਆ।" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "ਸਫ਼ਲ: ਜੰਤਰ '%s' ਠੀਕ ਤਰ੍ਹਾਂ ਡਿਸ-ਕੁਨੈਕਟ ਹੋ ਗਿਆ।" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' (%s) ਡਿਸ-ਕੁਨੈਕਸ਼ਨ ਫੇਲ੍ਹ: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "ਜੰਤਰ ਹਾਲਤ: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "ਗਲਤੀ: iface ਦੇਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Error: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Error: 'dev wifi': %s; allowed fields: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "ਵਾਈਫਾਈ ਸਕੈਨ ਲਿਸਟ" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "ਗਲਤੀ: hwaddr '%s' ਵਾਲਾ ਅਸੈੱਸ ਪੁਆਇੰਟ ਨਹੀਂ ਲੱਭਿਆ।" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "ਗਲਤੀ: ਜੰਤਰ '%s' ਵਾਈ-ਫਾਈ ਜੰਤਰ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "ਗਲਤੀ: 'dev wifi' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "ਗਲਤੀ: 'dev' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"ਵਰਤੋਂ: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "ਕੁਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Error: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Error: 'nm status': %s; allowed fields: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਹਾਲਤ" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "ਚਾਲੂ ਹੈ" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "ਬੰਦ ਹੈ" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "ਚੱਲ ਰਿਹਾ ਹੈ" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "ਨਹੀਂ ਚੱਲ ਰਿਹਾ ਹੈ" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Error: '--fields' value '%s' is not valid here; allowed fields: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi enabled" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wifi' ਪੈਰਾਮੀਟਰ: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN enabled" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "ਗਲਤੀ: ਅਢੁੱਕਵਾਂ 'wwan' ਪੈਰਾਮੀਟਰ: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "ਗਲਤੀ: 'nm' ਕਮਾਂਡ '%s' ਢੁੱਕਵੀਂ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"ਵਰਤੋਂ: %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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Error: Object '%s' is unknown, try 'nmcli help'." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Error: Option '--terse' is specified the second time." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Error: Option '--terse' is mutually exclusive with '--pretty'." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Error: Option '--pretty' is specified the second time." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Error: Option '--pretty' is mutually exclusive with '--terse'." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "ਗਲਤੀ: '%s' ਚੋਣ ਲਈ ਆਰਗੂਮੈਂਟ ਮੌਜੂਦ ਨਹੀਂ ਹੈ।" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Error: '%s' is not valid argument for '%s' option." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Error: fields for '%s' options are missing." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli ਟੂਲ, ਵਰਜਨ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "ਗਲਤੀ: ਚੋਣ '%s' ਅਣਜਾਣੀ ਹੈ 'nmcli -help' ਵਰਤ ਕੇ ਵੇਖੋ।" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d ਸਿਗਨਲ ਮਿਲਿਆ, ਬੰਦ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "ਗਲਤੀ: ਨੈੱਟਵਰਕਮੈਨੇਜਰ ਨਾਲ ਕੁਨੈਕਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "ਸਫ਼ਲ" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit ਗੁਪਤਕੋਡ)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (ਅਣਜਾਣ)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (ਅਣਜਾਣ)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ਕੋਈ ਵੀ, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "ਆਟੋ" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "ਸੈੱਟ ਨਹੀਂ ਹੈ" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "ਖੇਤਰ '%s' ਇਕੱਲਾ ਹੋਵੇਗਾ" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "ਗਲਤ ਖੇਤਰ '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Option '--terse' requires specifying '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Option '--terse' requires specific '--fields' option values , not '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM ਕੁੰਜੀ ਫਾਇਲ ਦਾ ਕੋਈ ਅੰਤ ਟੈਗ '%s' ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਫਾਇਲ ਵਾਂਗ ਨਹੀਂ ਜਾਪਦੀ।" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ਫਾਇਲ ਡਾਟਾ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: Proc-Type ਪਹਿਲਾਂ ਟੈਗ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: ਅਣਜਾਣ Proc-Type ਟੈਗ '%s' ਹੈ।" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: DEK-Info ਦੂਜਾ ਟੈਗ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: DEK-Info ਟੈਗ ਵਿੱਚ ਕੋਈ IV ਨਹੀਂ ਲੱਭਿਆ।" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr " ਨਿਕਾਰਾ PEM ਫਾਇਲ: DEK-Info ਟੈਗ ਵਿੱਚ ਗਲਤ ਫਾਰਮੈਟ IV" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "ਨਿਕਾਰਾ PEM ਫਾਇਲ: ਅਣਜਾਣ ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਸੀਫਰ '%s'।" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡੀਕੋਡ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ।" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM ਸਰਟੀਫਿਕੇਟ '%s' ਵਿੱਚ ਕੋਈ ਅੰਤ ਟੈਗ '%s' ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "ਸਰਟੀਫਿਕੇਟ ਡੀਕੋਡ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "ਸਰਟੀਫਿਕੇਟ ਡਾਟਾ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ਫਾਇਲ ਡਾਟਾ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ਲਈ ਲੰਬਾਈ ਜਿਸਤ ਅੰਕ ਹੋਣੀ ਲਾਜ਼ਮੀ ਹੈ।" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV ਵਿੱਚ ਗ਼ੈਰ-ਹੈਕਸਾਡੈਸੀਮਲ ਅੰਕ ਹਨ।" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਸੀਫ਼ਰ '%s' ਅਣਜਾਣ ਹੈ।" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡੀਕੋਡ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਕਿਸਮ ਜਾਣਨ ਲਈ ਅਸਮਰੱਥ ਹੈ।" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "ਡਿਕ੍ਰਿਪਟ ਕੀਤੀ ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "ਕ੍ਰਿਪਟੂ ਇੰਜਣ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 ਇੰਜਣ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "ਅਢੁੱਕਵੀਂ IV ਲੰਬਾਈ (ਘੱਟੋ-ਘੱਟ %zd ਹੋਣੀ ਲਾਜ਼ਮੀ ਹੈ)।" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "ਡੀਕ੍ਰਿਪਟ ਕੀਤੇ ਕੁੰਜੀ ਬਫ਼ਰ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਸੀਫਰ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਲਈ ਸਮਮਿਤੀ ਕੁੰਜੀ ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "%s / %s : ਡਿਕ੍ਰਿਪਟ ਲਈ IV ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: ਅਣਜਾਣ ਪੈਡਿੰਗ ਲੰਬਾਈ।" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ।" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਸੀਫ਼ਰ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ ਸਮਮਿਤੀ ਕੁੰਜੀ ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ IV ਸੈੱਟ ਕਰਨ ਵਾਸਤੇ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "ਡਾਟਾ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %s / %s" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "ਸਰਟੀਫਿਕੇਟ ਡਾਟਾ ਸ਼ੁਰੂ 'ਚ ਗਲਤੀ: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "ਸਰਟੀਫਿਕੇਟ ਡੀਕੋਡ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 ਡੀਕੋਡਰ ਸ਼ੁਰੂ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ਫਾਇਲ ਡੀਕੋਡ ਨਹੀਂ ਜਾ ਸਕੀ: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ਫਾਇਲ ਜਾਂਚੀ ਨਹੀਂ ਜਾ ਸਕੀ: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "ਕ੍ਰਿਪਟੂ ਇੰਜਣ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "ਅਢੁੱਕਵੀਂ IV ਲੰਬਾਈ (ਘੱਟੋ-ਘੱਟ %d ਹੋਣੀ ਲਾਜ਼ਮੀ ਹੈ)।" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਸੀਫਰ ਸਲਾਟ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਲਈ ਸਮਮਿਤੀ ਕੁੰਜੀ ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "ਡਿਕ੍ਰਿਪਟ ਲਈ IV ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "ਡਿਕ੍ਰਿਪਸ਼ਨ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: " + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜੀ ਡਿਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: ਡਿਕ੍ਰਿਪਟ ਡਾਟਾ ਬਹੁਤ ਵੱਡਾ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "ਪ੍ਰਾਈਵੇਟ ਕੁੰਜ ਲਈ ਡੀਕ੍ਰਿਪਸ਼ਨ ਮੁਕੰਮਲ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ: %d।" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "ਕ੍ਰਿਪਸ਼ਨ ਸੀਫ਼ਰ ਸਲਾਟ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ ਸਮਮਿਤੀ ਕੁੰਜੀ ਸੈੱਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ।" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਲਈ IV ਸੈੱਟ ਕਰਨ ਵਾਸਤੇ ਫੇਲ੍ਹ।" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਪਰਸੰਗ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਫੇਲ੍ਹ ਹੈ।" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "ਇੰਕ੍ਰਿਪਟ ਕਰਨ ਲਈ ਫੇਲ੍ਹ: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ਇੰਕ੍ਰਿਪਟ ਕਰਨ ਦੇ ਬਾਅਦ ਅਚਾਨਕ ਅਣਜਾਣ ਮਾਤਰਾ 'ਚ ਡਾਟਾ।" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "ਸਰਟੀਫਿਕੇਟ ਡੀਕੋਡ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "ਪਾਸਵਰਡ ਨੂੰ UCS2 'ਚ ਬਦਲਿਆ ਨਹੀਂ ਜਾ ਸਕਿਆ: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 ਡੀਕੋਡਰ ਸ਼ੁਰੂ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ਫਾਇਲ ਜਾਂਚੀ ਨਹੀਂ ਜਾ ਸਕੀ: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ਫਾਇਲ ਜਾਂਚੀ ਨਹੀਂ ਜਾ ਸਕੀ: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "ਰਲਵਾਂ ਡਾਟਾ ਤਿਆਰ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ।" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "ਇੰਕ੍ਰਿਪਸ਼ਨ ਕੁੰਜੀ ਬਣਾਉਣ ਲਈ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ।" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM ਫਾਇਲ ਬਣਾਉਣ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ।" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ IV ਲਿਖਣ ਲਈ ਮੈਮੋਰੀ ਦਿੱਤੀ ਨਹੀਂ ਜਾ ਸਕੀ।" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM ਫਾਇਲ ਵਾਸਤੇ ਇੰਕ੍ਰਿਪਟ ਕੀਤੀ ਕੁੰਜੀ ਲਿਖਣ ਲਈ ਮੈਮੋਰੀ ਦਿੱਤੀ ਨਹੀਂ ਜਾ ਸਕੀ।" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ਫਾਇਲ ਡਾਟੇ ਲਈ ਮੈਮੋਰੀ ਜਾਰੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "ਨੈੱਟਲਿੰਕ ਸੁਨੇਹੇ ਉੱਤੇ ਕਾਰਵਾਈ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ਸਾਕਟ ਉੱਤੇ ਡਾਟੇ ਦੀ ਉਡੀਕ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਨਾਲ ਕੁਨੈਕਟ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink ਹੈੱਡਲ ਕਰੀਡੈਂਸ਼ਲ ਪਾਸਿੰਗ ਯੋਯਗ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਜਾਰੀ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਲਿੰਕ ਕੈਸ਼ ਜਾਰੀ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਣਸਮਰੱਥ:: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "ਲਿੰਕ ਕੈਸ਼ ਅੱਪਡੇਟ ਕਰਨ ਦੌਰਾਨ ਗਲਤੀ: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "ਗਲਤ ਚੋਣ। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s। ਢੁੱਕਵੀਆਂ ਚੋਣਾਂ ਦੀ ਲਿਸਟ ਵੇਖਣ ਲਈ --help ਵਰਤੋਂ ਜੀ।\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "#ਨੈੱਟਵਰਕ ਮੈਨੇਜਰ ਵਲੋਂ ਬਣਾਈ\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"#%s ਤੋਂ ਮਿਲਾਇਆ\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ਕੋਈ ਵਰਤੋਂਯੋਗ DHCP ਕਲਾਇਟ ਨਹੀਂ ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' ਲੱਭਿਆ ਜਾ ਸਕਿਆ।" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "ਗੈਰਸਹਾਇਕ DHCP ਕਲਾਇਟ '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "ਅਣਜਾਣ ਲਾਗ ਲੈਵਲ '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "ਅਣਜਾਣ ਲਾਗ ਡੋਮੇਨ '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "ਨੋਟ: libc ਰਿਜ਼ੋਲਵਰ ੩ ਤੋਂ ਵੱਧ ਨੇਮ-ਸਰਵਰ ਲਈ ਸਹਾਇਕ ਨਹੀਂ ਹੋ ਸਕਦਾ ਹੈ।" + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "ਹੇਠਾਂ ਦਿੱਤੇ ਨੇਮ-ਸਰਵਰ ਪਛਾਣੇ ਨਹੀਂ ਜਾ ਸਕਦੇ।" + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "ਆਟੋ %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "IPL ਲੀਨਕਸ (Linux) ਸਿਸਟਮ।" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਸੋਧ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "ਸਿਸਟਮ ਕੁਨੈਸ਼ਨ ਸੋਧ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਿਸਟਮ ਸੈਟਿੰਗ ਲਈ ਸੋਧ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਲਈ ਸੋਧਾਂ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ" + +#~ msgid "Type" +#~ msgstr "ਕਿਸਮ" + +#~ msgid "Name" +#~ msgstr "ਨਾਂ" + +#~ msgid "User connections:\n" +#~ msgstr "ਯੂਜ਼ਰ ਕੁਨੈਕਸ਼ਨ:\n" + +#~ msgid "System-wide connections" +#~ msgstr "ਸਿਸਟਮ-ਲਈ ਕੁਨੈਕਸ਼ਨ" + +#~ msgid "Default" +#~ msgstr "ਡਿਫਾਲਟ" + +#~ msgid "Service" +#~ msgstr "ਸਰਵਿਸ" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, ਫਰੀਕਿਊਂਸੀ %d MHz, ਦਰ %d Mb/s, ਤਾਕਤ %d" + +#~ msgid "Device" +#~ msgstr "ਜੰਤਰ" + +#~ msgid "Driver" +#~ msgstr "ਡਰਾਇਵਰ" + +#~ msgid "State" +#~ msgstr "ਹਾਲਤ" + +#~ msgid "HW Address" +#~ msgstr "HW ਐਡਰੈੱਸ" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " ਸਮਰੱਥਾ:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "ਕੈਰੀਅਰ ਖੋਜ" + +#~ msgid "Speed" +#~ msgstr "ਸਪੀਡ" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " ਬੇਤਾਰ ਵਿਸ਼ੇਸ਼ਤਾ\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 ਇੰਕ੍ਰਿਪਸ਼ਨ" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP ਸਿਫਰ" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP ਸੀਫਰ" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " ਬੇਤਾਰ ਅਸੈੱਸ ਪੁਆਇੰਟ %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = current AP)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " ਤਾਰ ਨਾਲ ਵਿਸ਼ੇਸ਼ਤਾ\n" + +#~ msgid "Carrier" +#~ msgstr "ਕੈਰੀਅਰ" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4 ਵਿਸ਼ੇਸ਼ਤਾ:\n" + +#~ msgid "Address" +#~ msgstr "ਐਡਰੈੱਸ" + +#~ msgid "Prefix" +#~ msgstr "ਪ੍ਰੀ-ਫਿਕਸ" + +#~ msgid "Gateway" +#~ msgstr "ਗੇਟਵੇ" + +#~ msgid "Device:" +#~ msgstr "ਜੰਤਰ:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "ਗਲਤੀ: hwaddr ਦੇਣ ਦੀ ਲੋੜ ਹੈ।" + +#~ msgid "AP parameters" +#~ msgstr "AP ਪੈਰਾਮੀਟਰ" + +#~ msgid "Frequency:" +#~ msgstr "ਫਰੀਕਿਊਨਸੀ:" + +#~ msgid "Mode:" +#~ msgstr "ਮੋਡ:" + +#~ msgid "Ad-hoc" +#~ msgstr "Ad-hoc" + +#~ msgid "Maximal bitrate:" +#~ msgstr "ਵੱਧੋ-ਵੱਧ ਬਿੱਟਰੇਟ:" + +#~ msgid "Strength:" +#~ msgstr "ਤਾਕਤ:" + +#~ msgid "Flags:" +#~ msgstr "ਫਲੈਗ:" + +#~ msgid "privacy" +#~ msgstr "ਪਰਾਈਵੇਸੀ" + +#~ msgid "WPA flags:" +#~ msgstr "WPA ਫਲੈਗ:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN ਫਲੈਗ:" + +#~ msgid "NM running:" +#~ msgstr "NM ਚੱਲ ਰਿਹਾ ਹੈ:" + +#~ msgid "NM state:" +#~ msgstr "NM ਹਾਲਤ:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM ਬੇਤਾਰ ਹਾਰਡਵੇਅਰ:" + +#~ msgid "NM wireless:" +#~ msgstr "NM ਬੇਤਾਰ:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN ਹਾਰਡਵੇਅਰ:" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "ਲਿੰਕ ਹਾਲਤ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਨੈੱਟਲਿੰਕ ਗਰੁੱਪ ਜੁਆਇੰਨ ਕਰਨ ਲਈ ਅਸਮਰੱਥ: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "netlink ਨਾਲ ਕੁਨੈਕਟ ਹੋਣ ਲਈ ਅਸਮਰੱਥ: %s" + +#~ msgid "Cannot add VPN connection" +#~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਜੋੜਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾ ਹੈ" + +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "" +#~ "ਤੁਹਾਡੇ ਸਿਸਟਮ ਉੱਤੇ ਕੋਈ ਠੀਕ VPN ਸਾਫਟਵੇਅਰ ਨਹੀਂ ਲੱਭਾ ਹੈ। ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" + +#~ msgid "Cannot import VPN connection" +#~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਆਯਾਤ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ" + +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "VPN ਕੁਨੈਕਸ਼ਨ ਕਿਸਮ '%s' ਲਈ ਫਾਇਲ '%s' ਆਯਾਤ ਕਰਨ ਲਈ ਕੋਈ ਢੁੱਕਵਾਂ ਸਾਫਟਵੇਅਰ ਨਹੀਂ ਲੱਭਿਆ ਹੈ। " +#~ "ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" + +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "" +#~ "VPN ਕੁਨੈਕਸ਼ਨ ਕਿਸਮ '%s' ਲਈ UI ਫਾਇਲਾਂ ਨਹੀਂ ਲੱਭੀਆਂ ਹਨ। ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰੋ।" + +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "ਕੀ VPN \"%s\" ਕੁਨੈਕਸ਼ਨ ਹਟਾਉਣਾ ਹੈ?" + +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "VPN ਕੁਨੈਕਸ਼ਨ \"%s\" ਬਾਰੇ ਸਭ ਜਾਣਕਾਰੀ ਖਤਮ ਹੋ ਗਈ ਹੈ ਅਤੇ ਤੁਹਾਨੂੰ ਨਵੇਂ ਕੁਨੈਕਸ਼ਨ ਬਣਾਉਣ ਲਈ " +#~ "ਜਾਣਕਾਰੀ ਵਾਸਤੇ ਆਪਣੇ ਸਿਸਟਮ ਪਰਸ਼ਾਸ਼ਕ ਨਾਲ ਸੰਪਰਕ ਕਰਨਾ ਪਵੇਗਾ।" + +#~ msgid "Unable to load" +#~ msgstr "ਲੋਡ ਕਰਨ ਲਈ ਫੇਲ੍ਹ" + +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "ਕੁਝ ਲੋੜੀਦੇ ਸਰੋਤ ਨਹੀਂ ਮਿਲੇ (ਗਲੇਡ ਫਾਇਲ)!" + +#~ msgid "Create VPN Connection" +#~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਬਣਾਓ" + +#~ msgid "Edit VPN Connection" +#~ msgstr "VPN ਕੁਨੈਕਸ਼ਨ ਸੋਧ" + +#~ msgid "Add a new VPN connection" +#~ msgstr "ਇੱਕ ਨਵਾਂ VPN ਕੁਨੈਕਸ਼ਨ ਸ਼ਾਮਿਲ" + +#~ msgid "Delete the selected VPN connection" +#~ msgstr "ਚੁਣਿਆ VPN ਕੁਨੈਕਸ਼ਨ ਹਟਾਓ" + +#~ msgid "E_xport" +#~ msgstr "ਨਿਰਯਾਤ(_x)" + +#~ msgid "Edit the selected VPN connection" +#~ msgstr "ਚੁਣੇ VPN ਕੁਨੈਕਸ਼ਨ 'ਚ ਸੋਧ" + +#~ msgid "Export the VPN settings to a file" +#~ msgstr "VPN ਸੈਟਿੰਗ ਨੂੰ ਫਾਇਲ 'ਚ ਭੇਜੋ" + +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "ਚੁਣੇ VPN ਕੁਨੈਕਸ਼ਨ ਫਾਇਲ 'ਚ ਭੇਜੋ" + +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "ਵੁਰਚੁਅਲ ਪ੍ਰਾਈਵੇਟ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ ਪਰਬੰਧ" + +#~ msgid "40-bit WEP" +#~ msgstr "40-ਬਿੱਟ WEP" + +#~ msgid "104-bit WEP" +#~ msgstr "104-ਬਿੱਟ WEP" + +#~ msgid "WPA Automatic" +#~ msgstr "WPA ਆਟੋਮੈਟਿਕ" + +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" + +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" + +#~ msgid "WPA2 Automatic" +#~ msgstr "WPA2 ਆਟੋਮੈਟਿਕ" + +#~ msgid "operation took too long" +#~ msgstr "ਓਪਰੇਸ਼ਨ ਨੂੰ ਬਹੁਤ ਸਮਾਂ ਲੱਗ ਗਿਆ" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "ਭੇਜਣ ਵਾਲੇ ਦੀ ਗਲਤ ਕਿਸਮ ਤੋਂ ਡਾਟਾ ਮਿਲਿਆ" + +#~ msgid "received data from unexpected sender" +#~ msgstr "ਅਣਜਾਣ ਭੇਜਣ ਵਾਲੇ ਵਲੋਂ ਡਾਟਾ ਮਿਲਿਆ" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "ਸਾਕਟ ਉੱਤੇ ਬਹੁਤ ਵੱਧ ਡਾਟਾ ਭੇਜਿਆ ਗਿਆ ਅਤੇ ਇਸ 'ਚੋਂ ਕੁਝ ਗੁੰਮ ਹੋ ਗਿਆ" diff --git a/po/pl.po b/po/pl.po new file mode 100644 index 00000000..7ffa1799 --- /dev/null +++ b/po/pl.po @@ -0,0 +1,1616 @@ +# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +# Aviary.pl +# Jeśli masz jakiekolwiek uwagi odnoszące się do tłumaczenia lub chcesz +# pomóc w jego rozwijaniu i pielęgnowaniu, napisz do nas: +# gnomepl@aviary.pl +# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-02-26 03:24+0000\n" +"PO-Revision-Date: 2010-03-08 11:52+0100\n" +"Last-Translator: Tomasz Dominikowski \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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" +"X-Poedit-Language: Polish\n" +"X-Poedit-Country: Poland\n" + + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" +msgstr "" +"Użycie: nmcli con { POLECENIE | help }\n" +" POLECENIE := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" + + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Połączenia" + + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "Type" +msgstr "Typ" + + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Name" +msgstr "Nazwa" + + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Połączenia systemowe:\n" + + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Połączenia użytkownika:\n" + + +#: ../cli/src/connections.c:178 +#: ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 +#: ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 +#: ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 +#: ../cli/src/devices.c:614 +#: ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 +#: ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Błąd: brak parametru %s." + + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Błąd: %s - nie ma takiego połączenia." + + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Połączenia systemowe" + + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Połączenia użytkownika" + + +#: ../cli/src/connections.c:212 +#: ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 +#: ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 +#: ../cli/src/devices.c:628 +#: ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Nieznany parametr: %s\n" + + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Błąd: nie podano prawidłowego parametru." + + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 +#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 +#: ../cli/src/devices.c:353 +#: ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 +#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:361 +msgid "yes" +msgstr "tak" + + +#: ../cli/src/connections.c:268 +#: ../cli/src/devices.c:304 +msgid "no" +msgstr "nie" + + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Aktywne połączenia" + + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:304 +msgid "Default" +msgstr "Domyślne" + + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Service" +msgstr "Usługa" + + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Urządzenia" + + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "brak aktywnych połączeń na urządzeniu \"%s\"" + + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "brak aktywnych połączeń na urządzeń" + + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktywowanie" + + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktywowano" + + +#: ../cli/src/connections.c:735 +#: ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 +#: ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 +#: ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "nieznane" + + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "Łączenie z VPN (przygotowanie)" + + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "Łączenie z VPN (wymaga uwierzytelnienia)" + + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "Łączenie z VPN" + + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "Łączenie z VPN (pobieranie konfiguracji adresu IP)" + + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "Połączono z VPN" + + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "Połączenie z VPN się nie powiodło" + + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "Rozłączono z VPN" + + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "nieznany powód" + + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "brak" + + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "użytkownik został rozłączony" + + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "podstawowe połączenie sieciowe zostało przerwane" + + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "usługa VPN została nieoczekiwanie zatrzymana" + + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "usługa VPN zwróciła nieprawidłową konfigurację" + + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "próba połączenia przekroczyła czas oczekiwania" + + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "usługa VPN nie została uruchomiona w czasie" + + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "uruchomienie usługi VPN się nie powiodło" + + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "brak prawidłowych haseł VPN" + + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "nieprawidłowe hasła VPN" + + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "połączenie zostało usunięte" + + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "stan: %s\n" + + +#: ../cli/src/connections.c:806 +#: ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Aktywowano połączenie\n" + + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Błąd: aktywacja połączenia się nie powiodła." + + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "stan: %s (%d)\n" + + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Błąd: aktywacja połączenia się nie powiodła: %s." + + +#: ../cli/src/connections.c:855 +#: ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Błąd: przekroczono czas oczekiwania o %d sekund." + + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Błąd: aktywacja połączenia się nie powiodła: %s" + + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Błąd: uzyskanie aktywnego połączenia dla \"%s\" się nie powiodło." + + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Stan aktywnego połączenia: %s\n" + + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Ścieżka aktywnego połączenia: %s\n" + + +#: ../cli/src/connections.c:976 +#: ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Błąd: nieznane połączenie: %s." + + +#: ../cli/src/connections.c:1011 +#: ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Błąd: wartość czasu oczekiwania \"%s\" jest nieprawidłowa." + + +#: ../cli/src/connections.c:1024 +#: ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Błąd: należy podać identyfikator lub UUID." + + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Błąd: nie odnaleziono odpowiedniego urządzenia: %s" + + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Błąd: nie odnaleziono odpowiedniego urządzenia." + + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Ostrzeżenie: połączenie nie jest aktywne\n" + + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Błąd: polecenie \"con\" \"%s\" jest nieprawidłowe." + + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Błąd: nie można połączyć się z D-Bus." + + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Błąd: nie można uzyskać ustawień systemu." + + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Błąd: nie można uzyskać ustawień użytkownika." + + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Błąd: nie można uzyskać połączeń: usługi ustawień nie są uruchomione." + + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Użycie: nmcli dev { POLECENIE | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "niezarządzane" + + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "niedostępne" + + +#: ../cli/src/devices.c:97 +#: ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "rozłączono" + + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "łączenie (przygotowanie)" + + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "łączenie (konfigurowanie)" + + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "łączenie (wymaga uwierzytelnienia)" + + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "łączenie (pobieranie konfiguracji adresu IP)" + + +#: ../cli/src/devices.c:107 +#: ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "połączono" + + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "połączenie się nie powiodło" + + +#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Nieznane" + + +#. print them +#: ../cli/src/devices.c:164 +#: ../cli/src/devices.c:266 +#: ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(brak)" + + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: błąd podczas konwertowania adresu IPv4 0x%X" + + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, częstotliwość %d MHz, prędkość %d Mb/s, siła sygnału %d" + + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-hoc" + + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", zaszyfrowane: " + + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Enterprise" + + +#: ../cli/src/devices.c:294 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "Device" +msgstr "Urządzenie" + + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Sterownik" + + +#: ../cli/src/devices.c:299 +#: ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(nieznane)" + + +#: ../cli/src/devices.c:300 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "State" +msgstr "Stan" + + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Adres sprzętowy" + + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Możliwości:\n" + + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Wykrywanie operatora" + + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Prędkość" + + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Właściwości sieci bezprzewodowej\n" + + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "Szyfrowanie WEP" + + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "Szyfrowanie WPA" + + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "Szyfrowanie WPA2" + + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "Szyfr TKIP" + + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "Szyfr CCMP" + + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Bezprzewodowe punkty dostępowe %s\n" + + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = bieżący punkt dostępowy)" + + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Właściwości sieci przewodowej\n" + + +#: ../cli/src/devices.c:377 +#: ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Operator" + + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "włączone" + + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "wyłączone" + + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" Ustawienia IPv4:\n" + + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adres" + + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Przedrostek" + + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Brama" + + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Stan urządzenia" + + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Błąd: brak parametru \"%s\"." + + +#: ../cli/src/devices.c:516 +#: ../cli/src/devices.c:655 +#: ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Błąd: nie odnaleziono urządzenia \"%s\"." + + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Powodzenie: urządzenie \"%s\" zostało rozłączone." + + +#: ../cli/src/devices.c:564 +#, 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:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Stan urządzenia: %d (%s)\n" + + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Błąd: należy podać interfejs." + + +#: ../cli/src/devices.c:736 +#: ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Lista skanowania sieci WiFi" + + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Błąd: urządzenie \"%s\" nie jest urządzeniem WiFi." + + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Urządzenie:" + + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Błąd: należy podać adres sprzętowy." + + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Błąd: nie odnaleziono punktu dostępowego z adresem sprzętowym \"%s\"." + + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + + +#: ../cli/src/devices.c:869 +#: ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Parametry punkty dostępowego" + + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Częstotliwość:" + + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Tryb:" + + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastruktura" + + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Maksymalna prędkość:" + + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Siła sygnału:" + + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Flagi:" + + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "prywatne" + + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "Flagi WPA:" + + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "Flagi RSN:" + + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Błąd: polecenie \"dev wifi\" \"%s\" jest nieprawidłowe." + + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Błąd: polecenie \"dev\" \"%s\" jest nieprawidłowe." + + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Użycie: nmcli nm { POLECENIE | help }\n" +"\n" +" POLECENIE := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "wstrzymane" + + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "łączenie" + + +#: ../cli/src/network-manager.c:93 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 +#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "włączone" + + +#: ../cli/src/network-manager.c:93 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 +#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "wyłączone" + + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "Stan programu NetworkManager" + + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "Program NetworkManager jest uruchomiony:" + + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "uruchamiany" + + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "nieuruchomiony" + + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "Stan programu NetworkManager:" + + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "Adres sprzętowy programu NetworkManager:" + + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 +#: ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "Sieć bezprzewodowa programu NetworkManager:" + + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "WWAM sprzętu programu NetworkManager:" + + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 +#: ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "WWAN programu NetworkManager:" + + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Błąd: nieprawidłowy parametr \"wifi\": \"%s\"." + + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Błąd: nieprawidłowy parametr \"wwan\": \"%s\"." + + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Błąd: parametr \"nm\" \"%s\" jest nieprawidłowy." + + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Użycie: %s [OPCJE] OBIEKT { POLECENIE | help }\n" +"\n" +"OPCJE\n" +" -t[erse] zwięzłe wyjście\n" +" -p[retty] sformatowane wyjście\n" +" -v[ersion] wyświetla wersję programu\n" +" -h[elp] wyświetla tę opcję\n" +"\n" +"OBIEKT\n" +" nm stan programu NetworkManager\n" +" con połączenia programu NetworkManager\n" +" dev urządzenia zarządzane przez program NetworkManager\n" +"\n" + + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Obiekt \"%s\" jest nieznany. Można spróbować polecenie \"nmcli help\"." + + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "narzędzie nmcli, wersja %s\n" + + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Opcja \"%s\" jest nieznana. Można spróbować polecenie \"nmcli help\"." + + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Przechwycono sygnał %d, wyłączanie..." + + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Błąd: nie można połączyć się z programem NetworkManager." + + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Powodzenie" + + +#: ../libnm-util/crypto.c:120 +#, 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:130 +#, 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:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Brak wystarczającej ilości pamięci do przechowania danych pliku PEM." + +#: ../libnm-util/crypto.c:154 +#, 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:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Uszkodzony plik PEM: nieznany znacznik Proc-Type \"%s\"." + +#: ../libnm-util/crypto.c:172 +#, 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:183 +#, 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:190 +#, 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:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Uszkodzony plik PEM: nieznany szyfr klucza prywatnego: \"%s\"." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Nie można zdekodować klucza prywatnego." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Certyfikat PEM \"%s\" nie zawiera kończącego znacznika \"%s\"." + + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Zdekodowanie certyfikatu się nie powiodło." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Brak wystarczającej ilości pamięci do przechowania danych certyfikatu." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Brak wystarczającej ilości pamięci do przechowania danych pliku." + + +#: ../libnm-util/crypto.c:324 +#, 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:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Brak wystarczającej ilości pamięci do przechowania IV." + + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV zawiera nieszesnastkowe cyfry." + +#: ../libnm-util/crypto.c:382 +#: ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 +#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Nieznany szyfr klucza prywatnego \"%s\"." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Brak wystarczającej ilości pamięci do odszyfrowania klucza prywatnego." + + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Nie można określić typu klucza prywatnego." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Brak wystarczającej ilości pamięci do przechowania odszyfrowanego klucza prywatnego." + + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Zainicjowanie modułu szyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_gnutls.c:93 +#, 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:156 +#, 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:165 +#: ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Brak wystarczającej ilości pamięci dla bufora odszyfrowanego klucza." + + +#: ../libnm-util/crypto_gnutls.c:173 +#, 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:182 +#, 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:191 +#, 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:200 +#, 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:210 +#: ../libnm-util/crypto_nss.c:267 +#, 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:221 +#: ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Odszyfrowanie klucza prywatnego się nie powiodło." + + +#: ../libnm-util/crypto_gnutls.c:286 +#: ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Nie można przydzielić pamięci do szyfrowania." + + +#: ../libnm-util/crypto_gnutls.c:294 +#, 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:303 +#, 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:313 +#, 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:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Zaszyfrowanie danych się nie powiodło: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Błąd podczas inicjowania danych certyfikatu: %s" + + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Nie można zdekodować certyfikatu: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Nie można zainicjować dekodera PKCS#12: %s" + + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Nie można odszyfrować pliku PKCS#12: %s" + + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Nie można zweryfikować pliku PKCS#12: %s" + + +#: ../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:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Zainicjowanie kontekstu MD5 się nie powiodło: %d." + + +#: ../libnm-util/crypto_nss.c:179 +#, 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:196 +#, 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:206 +#, 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:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Ustawienie IV do odszyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Zainicjowanie kontekstu odszyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Odszyfrowanie klucza prywatnego się nie powiodło: %d." + + +#: ../libnm-util/crypto_nss.c:245 +#, 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:256 +#, 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:364 +#, 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:372 +#, 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:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Ustawienie IV do szyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Zainicjowanie kontekstu szyfrowania się nie powiodło." + + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Zaszyfrowanie się nie powiodło: %d." + + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Nieoczekiwana ilość danych po zaszyfrowaniu." + + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Nie można zdekodować certyfikatu: %d" + + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Nie można przekonwertować hasła do UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Nie można zainicjować dekodera PKCS#12: %d" + + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Nie można odszyfrować pliku PKCS#12: %d" + + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Nie można zweryfikować pliku PKCS#12: %d" + + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Nie można utworzyć losowych danych." + + +#: ../libnm-util/nm-utils.c:1545 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Brak wystarczającej ilości pamięci, aby utworzyć klucz szyfrowania." + + +#: ../libnm-util/nm-utils.c:1655 +msgid "Could not allocate memory for PEM file creation." +msgstr "Nie można przydzielić pamięci do utworzenia pliku PEM." + + +#: ../libnm-util/nm-utils.c:1667 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Nie można przydzielić pamięci do zapisywania IV do pliku PEM." + + +#: ../libnm-util/nm-utils.c:1679 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Nie można przydzielić pamięci do zapisywania zaszyfrowanego klucza do pliku PEM." + + +#: ../libnm-util/nm-utils.c:1698 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Nie można przydzielić pamięci dla danych pliku PEM." + +#: ../src/nm-netlink-monitor.c:194 +#: ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "błąd podczas przetwarzania komunikatu netlink: %s" + + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "nie można przydzielić uchwytu netlink dla monitorowania stanu połączenia: %s" + + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "nie można połączyć się z netlink dla monitorowania stanu połączenia: %s" + + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "nie można dołączyć do grupy netlink dla monitorowania stanu połączenia: %s" + + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "nie można przydzielić pamięci podręcznej połączenia netlink dla monitorowania stanu połączenia: %s" + + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "wystąpił błąd podczas oczekiwania na dane na gnieździe" + + +#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "błąd podczas aktualizowania pamięci podręcznej połączenia: %s" + + +#: ../src/NetworkManager.c:494 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Nieprawidłowa opcja. Parametr --help wyświetli listę prawidłowych opcji.\n" + + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +msgid "# Created by NetworkManager\n" +msgstr "# Utworzony przez program NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Scalony od %s\n" +"\n" + + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "nie można przydzielić uchwytu netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "nie można połączyć się z netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "nie można dołączyć do grupy netlink: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +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." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Poniższe serwery nazw nie mogą nie zostać rozpoznane." + + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Automatyczne %s" + + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "Systemowe" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Współdzielenie połączenia przez chronioną sieć WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Współdzielenie połączenia przez otwartą sieć WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modyfikacja trwałej systemowej nazwy komputera" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modyfikacja połączeń systemowych" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Polityka systemu powstrzymuje modyfikację ustawień systemowych" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Polityka systemu powstrzymuje modyfikację trwałej systemowej nazwy komputera" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Polityka systemu powstrzymuje współdzielenie połączeń przez chronioną sieć WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Polityka systemu powstrzymuje współdzielenie połączeń przez otwartą sieć WiFi" + diff --git a/po/pt.po b/po/pt.po new file mode 100644 index 00000000..8d7e68a9 --- /dev/null +++ b/po/pt.po @@ -0,0 +1,218 @@ +# NetworkManager's Portuguese translation +# Copyright © 2007 NetworkManager +# This file is distributed under the same license as the NetworkManager package. +# Duarte Loreto , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: 2.18\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-02-08 17:55+0000\n" +"PO-Revision-Date: 2007-02-08 18:15+0000\n" +"Last-Translator: Duarte Loreto \n" +"Language-Team: Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:417 +msgid "Cannot add VPN connection" +msgstr "Incapaz de adicionar uma ligação VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:419 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"Não foi encontrado no seu sistema nenhuma aplicação adequada de VPN. " +"Contacte o administrador do seu sistema." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:461 +msgid "Cannot import VPN connection" +msgstr "Incapaz de importar a ligação VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" +"Incapaz de encontrar uma aplicação adequada para o tipo de ligação VPN '%s' " +"para importar o ficheiro '%s'. Contacte o administrador do seu sistema." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:580 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "Erro ao obter a ligação VPN '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:583 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "" +"Incapaz de encontrar os ficheiros de Interface Gráfica para o tipo de " +"ligação VPN '%s'. Contacte o administrador do seu sistema." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:727 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "Apagar a ligação VPN \"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:730 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"Toda a informação sobre a ligação VPN \"%s\" será perdida e poderá necessitar " +"que o seu administrador de sistemas lhe dê informação para criar uma nova " +"ligação." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:924 +msgid "Unable to load" +msgstr "Incapaz de ler" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:926 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "Incapaz de encontrar um recurso necessário (o ficheiro glade)!" + +#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), +#. NULL, +#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, +#. GTK_STOCK_CANCEL, +#. GTK_RESPONSE_REJECT, +#. GTK_STOCK_APPLY, +#. GTK_RESPONSE_ACCEPT, +#. NULL)); +#: ../gnome/vpn-properties/nm-vpn-properties.c:1081 +msgid "Create VPN Connection" +msgstr "Criar uma Ligação VPN" + +#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); +#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); +#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); +#. make the druid window modal wrt. our main window +#. gtk_window_set_modal (druid_window, TRUE); +#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1099 +msgid "Edit VPN Connection" +msgstr "Editar uma Ligação VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "Adicionar uma nova ligação VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Delete the selected VPN connection" +msgstr "Apagar a ligação VPN seleccionada" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "E_xport" +msgstr "E_xportar" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Edit the selected VPN connection" +msgstr "Editar a ligação VPN seleccionada" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Export the VPN settings to a file" +msgstr "Exportar as definições VPN para um ficheiro" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Export the selected VPN connection to a file" +msgstr "Exportar a ligação VPN seleccionada para um ficheiro" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Manage Virtual Private Network Connections" +msgstr "gerir Ligações de Redes Privadas Virtuais (VPN)" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "VPN Connections" +msgstr "Ligações VPN" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "40-bit WEP" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "104-bit WEP" + +#: ../src/nm-ap-security-wpa-psk.c:51 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:53 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:55 +msgid "WPA Automatic" +msgstr "WPA Automático" + +#: ../src/nm-ap-security-wpa-psk.c:60 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:62 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:64 +msgid "WPA2 Automatic" +msgstr "WPA2 Automático" + +#: ../src/nm-ap-security.c:334 +msgid "none" +msgstr "nenhum" + +#: ../src/nm-netlink-monitor.c:174 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"incapaz de criar um socket netlink para monitorizar dispositivos ethernet com fios - %s" + +#: ../src/nm-netlink-monitor.c:192 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"incapaz de se ligar ao socket netlink para monitorizar dispositivos ethernet com fios - %s" + +#: ../src/nm-netlink-monitor.c:427 +msgid "operation took too long" +msgstr "operação demorou demasiado tempo" + +#: ../src/nm-netlink-monitor.c:524 +msgid "received data from wrong type of sender" +msgstr "dados recebidos do tipo de remetente errado" + +#: ../src/nm-netlink-monitor.c:537 +msgid "received data from unexpected sender" +msgstr "dados recebidos de um remetente inesperado" + +#: ../src/nm-netlink-monitor.c:666 +msgid "too much data was sent over socket and some of it was lost" +msgstr "foram enviados demasiados dados no socket e alguns destes foram perdidos" + +#: ../src/nm-netlink-monitor.c:774 +msgid "error occurred while waiting for data on socket" +msgstr "ocorreu um erro enquanto se aguardava por dados no socket" + +#: ../src/nm-ap-security-wpa-eap.c:93 ../src/nm-ap-security-wpa-eap.c:117 +msgid "WPA2 Enterprise" +msgstr "WPA2 Enterprise" + +#: ../src/nm-ap-security-wpa-eap.c:95 ../src/nm-ap-security-wpa-eap.c:122 +msgid "WPA Enterprise" +msgstr "WPA Enterprise" + +#: ../src/nm-ap-security-leap.c:66 ../src/nm-ap-security-leap.c:82 +msgid "LEAP" +msgstr "LEAP" diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 00000000..13c7a276 --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,1368 @@ +# Brazilian Portuguese translation of NetworkManager. +# Copyright (C) 2004-2008 Free Software Foundation, Inc. +# This file is distributed under the same license as the NetworkManager package. +# Raphael Higino , 2004-2007 +# Luiz Armesto , 2007. +# Henrique P. Machado , 2008, 2010. +# Og Maciel , 2008. +# Fabrício Godoy , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" +"product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-04-27 15:25+0000\n" +"PO-Revision-Date: 2010-06-06 18:36-0300\n" +"Last-Translator: Henrique P. Machado \n" +"Language-Team: Brazilian Portuguese \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" + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Uso: nmcli con { COMANDO | help }\n" +" COMANDO := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +msgid "Connections" +msgstr "Conexões" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Type" +msgstr "Tipo" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + +#: ../cli/src/connections.c:158 ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Name" +msgstr "Nome" + +#: ../cli/src/connections.c:163 +#, c-format +msgid "System connections:\n" +msgstr "Conexões de sistema:\n" + +#: ../cli/src/connections.c:167 +#, c-format +msgid "User connections:\n" +msgstr "Conexões de usuário:\n" + +#: ../cli/src/connections.c:178 ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 ../cli/src/devices.c:614 ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Erro: faltando argumento %s." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Erro: %s - não existe esta conexão." + +#: ../cli/src/connections.c:196 +msgid "System-wide connections" +msgstr "Conexões de sistema" + +#: ../cli/src/connections.c:205 +msgid "User connections" +msgstr "Conexões de usuário" + +#: ../cli/src/connections.c:212 ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 ../cli/src/devices.c:628 ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Parâmetro desconhecido: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Erro: nenhum parâmetro válido especificado." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 ../cli/src/devices.c:353 ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 ../cli/src/devices.c:359 ../cli/src/devices.c:361 +msgid "yes" +msgstr "sim" + +#: ../cli/src/connections.c:268 ../cli/src/devices.c:304 +msgid "no" +msgstr "não" + +#: ../cli/src/connections.c:297 +msgid "Active connections" +msgstr "Conexões ativas" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 ../cli/src/devices.c:304 +msgid "Default" +msgstr "Padrão" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Service" +msgstr "Serviço" + +#: ../cli/src/connections.c:297 ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Dispositivos" + +#: ../cli/src/connections.c:659 +#, c-format +msgid "no active connection on device '%s'" +msgstr "nenhuma conexão ativa no dispositivo \"%s\"" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "nenhuma conexão ou dispositivo ativo" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "ativando" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "ativado" + +#: ../cli/src/connections.c:735 ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 ../cli/src/network-manager.c:98 +msgid "unknown" +msgstr "desconhecido" + +#: ../cli/src/connections.c:744 +msgid "VPN connecting (prepare)" +msgstr "Conexão VPN (preparando)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "Conexão VPN (precisa de autenticação)" + +#: ../cli/src/connections.c:748 +msgid "VPN connecting" +msgstr "Conexão VPN" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "Conexão VPN (obtendo configuração de IP)" + +#: ../cli/src/connections.c:752 +msgid "VPN connected" +msgstr "VPN conectada" + +#: ../cli/src/connections.c:754 +msgid "VPN connection failed" +msgstr "Conexão VPN falhou" + +#: ../cli/src/connections.c:756 +msgid "VPN disconnected" +msgstr "VPN desconectada" + +#: ../cli/src/connections.c:767 +msgid "unknown reason" +msgstr "razão desconhecida" + +#: ../cli/src/connections.c:769 +msgid "none" +msgstr "nenhum(a)" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "o usuário foi desconectado" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "a conexão de rede base foi interrompida" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "o serviço VPN parou inesperadamente" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "o serviço VPN retornou uma configuração inválida" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "tentativa de conexão esgotada" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "o serviço VPN não iniciou a tempo" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "o serviço VPN falhou ao iniciar" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "sem segredos VPN válidos" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "segredos VPN inválidos" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "a conexão foi removida" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "estado: %s\n" + +#: ../cli/src/connections.c:806 ../cli/src/connections.c:832 +#, c-format +msgid "Connection activated\n" +msgstr "Conexão ativada\n" + +#: ../cli/src/connections.c:809 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Erro: a ativação da conexão falhou." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "estado: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Erro: a ativação da conexão falhou: %s." + +#: ../cli/src/connections.c:855 ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Erro: tempo expirado - %d seg." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Erro: a ativação da conexão falhou: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Erro: falha na obtenção da conexão ativa para \"%s\"." + +#: ../cli/src/connections.c:921 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Estado da conexão ativa: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Caminho da conexão ativa: %s\n" + +#: ../cli/src/connections.c:976 ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Erro: conexão desconhecida: %s." + +#: ../cli/src/connections.c:1011 ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Erro: valor do tempo de expiração \"%s\" não é válido." + +#: ../cli/src/connections.c:1024 ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Erro: id ou uuid tem que ser especificada." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Erro: nenhum dispositivo adequado encontrado: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Erro: nenhum dispositivo adequado encontrado." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Aviso: conexão inativa\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Erro: comando \"con\" \"%s\" não é válido." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Erro: não foi possível conectar ao D-Bus." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Erro: não foi possível obter as configurações do sistema." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Erro: não foi possível obter as configurações do usuário." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "" +"Erro: Não é possível obter conexões - serviços de configuração não estão em " +"execução." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Uso: nmcli dev { COMANDO | help }\n" +"\n" +" COMANDO := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "não gerenciável" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "indisponível" + +#: ../cli/src/devices.c:97 ../cli/src/network-manager.c:73 +msgid "disconnected" +msgstr "desconectado" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "conectando (preparando)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "conectando (configurando)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "conectando (precisa de autenticação)" + +#: ../cli/src/devices.c:105 +msgid "connecting (getting IP configuration)" +msgstr "conectando (obtendo configuração de IP)" + +#: ../cli/src/devices.c:107 ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "conectado" + +#: ../cli/src/devices.c:109 +msgid "connection failed" +msgstr "falha na conexão" + +#: ../cli/src/devices.c:132 ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Desconhecido" + +#. print them +#: ../cli/src/devices.c:164 ../cli/src/devices.c:266 ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +msgid "(none)" +msgstr "(nenhum(a))" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: erro ao converter endereço IP4 0x%X" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Freq %d MHz, Taxa %d Mb/s, Força %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", Criptografada:" + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Enterprise" + +#: ../cli/src/devices.c:294 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "Device" +msgstr "Dispositivo" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Controlador" + +#: ../cli/src/devices.c:299 ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(desconhecido)" + +#: ../cli/src/devices.c:300 ../cli/src/devices.c:458 ../cli/src/devices.c:460 +msgid "State" +msgstr "Estado" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Endereço de HW" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Capacidades:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Detecção de Operadora" + +#: ../cli/src/devices.c:336 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Velocidade" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Propriedades de rede sem fio\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "Criptografia WEP" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "Criptografia WPA" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "Criptografia WPA2" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "Cifrador TKIP" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "Cifrador CCMP" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Pontos de acesso sem fio %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = PA atual)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Propriedades de rede com fio\n" + +#: ../cli/src/devices.c:377 ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Operadora" + +#: ../cli/src/devices.c:377 +msgid "on" +msgstr "ligado" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "desligado" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" Configurações IPv4\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Endereço" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Prefixo" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Gateway" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Status dos dispositivos" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Erro: argumento \"%s\" está faltando." + +#: ../cli/src/devices.c:516 ../cli/src/devices.c:655 ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Erro: dispositivo \"%s\" não encontrado." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Sucesso: dispositivo \"%s\" desconectado com sucesso." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Erro: desconexão do dispositivo \"%s\" (%s) falhou: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Estado do dispositivo: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Erro: iface tem que ser especificada." + +#: ../cli/src/devices.c:736 ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "Lista de varredura de redes sem fio" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Erro: dispositivo \"%s\" não é um dispositivo sem fio." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Dispositivo:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Erro: hwaddr tem que ser especificado." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Erro: Ponto de acesso com hwaddr \"%s\" não encontrado." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "Parâmetros do PA" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Frequência:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Modo:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infraestrutura" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Bitrate máxima:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Potência:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Flags:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "privacidade" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "Flags WPA:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "Flags RSN:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Erro: comando \"dev wifi %s\" é inválido." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Erro: comando \"dev %s\" é inválido." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Uso: nmcli nm { COMANDO | help }\n" +"\n" +" COMANDO := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "adormecido" + +#: ../cli/src/network-manager.c:69 +msgid "connecting" +msgstr "conectando" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "habilitado" + +#: ../cli/src/network-manager.c:93 ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "desabilitado" + +#: ../cli/src/network-manager.c:102 +msgid "NetworkManager status" +msgstr "Status do NetworkManager" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM rodando:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "executando" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "não executando" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "Estado do NM:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "Hardware sem fio do NM:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM sem fio:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "Hardware NM WWAN:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Erro: parâmetro \"wifi\" inválido: \"%s\"" + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Erro: parâmetro \"wwan\" inválido: \"%s\"" + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Erro: comando \"nm %s\" é inválido." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Uso: %s [OPÇÕES] OBJETO { COMANDO | help }\n" +"\n" +"OPÇÕES\n" +" -t[erse] saída concisa\n" +" -p[retty] saída elegante\n" +" -v[ersion] mostra a versão do programa\n" +" -h[elp] imprime esta ajuda\n" +"\n" +"OBJETO\n" +" nm Status do NetworkManager\n" +" con Conexões do NetworkManager\n" +" dev Dispositivos gerenciados pelo NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Objeto \"%s\" é desconhecido, tente \"nmcli help\"." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "ferramenta nmcli, versão %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Opção \"%s\" é desconhecida, tente \"nmcli -help\"." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Sinal capturado %d, desligando..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Erro: não foi possível conectar ao NetworkManager." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Sucesso" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "A chave do arquivo PEM não tinha a marca de finalização \"%s\"." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Não se parece com um arquivo de chave privada PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Memória insuficiente para armazenar os dados do arquivo PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Arquivo PEM defeituoso: Proc-Type não era a primeira marca." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Arquivo PEM defeituoso: marca Proc-Type desconhecida: \"%s\"." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Arquivo PEM defeituoso: DEK-Info não era a segunda marca." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Arquivo PEM defeituoso: nenhum IV localizado na marca DEK-Info." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Arquivo PEM defeituoso: formato inválido do IV na marca DEK-Info." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Arquivo PEM defeituoso: cifra de chave privada desconhecida \"%s\"." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Não foi possível decodificar chave privada." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Certificado PEM \"%s\" não tinha a marca de finalização \"%s\"." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Falha ao decodificar o certificado." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Memória insuficiente para armazenar os dados do certificado." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Memória insuficiente para armazenar dados no arquivo." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "O tamanho do IV deve ser um número par de bytes." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Memória insuficiente para armazenar o IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV contém dígitos não-hexadecimais." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "A cifra da chave privada \"%s\" era desconhecida." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Memória insuficiente para descriptografar a chave privada." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Não foi possível determinar o tipo da chave privada." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "" +"Memória insuficiente para armazenar a chave privada de descriptografia." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Falha ao inicializar o motor de criptografia." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Falha ao inicializar o motor MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Tamanho do IV inválido (tem que ser pelo menos %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Memória insuficiente para o buffer da chave descriptografada." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Falha ao inicializar o contexto da cifra de descriptografia: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Falha ao definir chave simétrica para descriptografia: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Falha ao definir IV para descriptografia: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Falha ao descriptografar a chave privada: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "" +"Falha ao descriptografar a chave privada: comprimento de preenchimento não " +"esperado." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Falha ao descriptografar a chave privada." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Não foi possível alocar memória para criptografia." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Falha ao inicializar o contexto da cifra de criptografia: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Falha ao definir chave simétrica para criptografia: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Falha ao definir IV para criptografia: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Falha ao criptografar a chave privada: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Erro ao inicializar os dados do certificado: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Não foi possível decodificar o certificado: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Não foi possível inicializar o decodificador PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Não foi possível decodificar o arquivo PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Não foi possível verificar o arquivo PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Falha ao inicializar o motor de criptografia: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Falha ao inicializar o contexto MD5: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Tamanho inválido do IV (tem que ser pelo menos %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Falha ao inicializar o espaço de cifra de descriptografia." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Falha ao definir chave simétrica para descriptografia." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Falha ao definir IV para descriptografia." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Falha ao inicializar o contexto de descriptografia." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Falha ao descriptografar a chave privada: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Falha ao descriptografar a chave privada: dados descriptografados muito " +"compridos." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Falha ao finalizar a descriptografia da chave privada: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Falha ao inicializar o espaço de cifra de criptografia." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Falha ao definir chave simétrica para criptografia." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Falha ao definir IV para criptografia." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Falha ao inicializar o contexto de criptografia." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Falha ao criptografar a chave privada: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Quantidade de dados inesperados depois da criptografia." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Não foi possível decodificar o certificado: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Não foi possível converter senha para o formato UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Não foi possível inicializar o decodificador PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Não foi possível decodificar o arquivo PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Não foi possível verificar o arquivo PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Não foi possível gerar dados aleatórios." + +#: ../libnm-util/nm-utils.c:1924 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Memória insuficiente para criar a chave de criptografia." + +#: ../libnm-util/nm-utils.c:2034 +msgid "Could not allocate memory for PEM file creation." +msgstr "Não foi possível alocar memória para criação do arquivo PEM." + +#: ../libnm-util/nm-utils.c:2046 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Não foi possível alocar memória para gravar IV no arquivo PEM." + +#: ../libnm-util/nm-utils.c:2058 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "" +"Não foi possível alocar memória para gravar a chave criptografada no arquivo " +"PEM." + +#: ../libnm-util/nm-utils.c:2077 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Não foi possível alocar memória para os dados do arquivo PEM." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "erro ao processar mensagem do netlink: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "ocorreu um erro ao esperar pelos dados da conexão" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"não foi possível conectar ao netlink para monitoração de status do link: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "" +"não foi possível habilitar o manipulador de credencial de passagem do " +"netlink: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"não foi possível alocar o manipulador do netlink para monitoração de status " +"do link: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"não foi possível alocar o cache de link do netlink para monitoração de " +"status do link: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "não foi possível associar-se ao grupo do netlink: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "erro ao atualizar o cache de link: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Opção inválida. Por favor, use --help para ver uma lista de opções válidas.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Por favor, use --help para ver uma lista de opções válidas.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Criado pelo NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Mesclado de %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "nenhum cliente DHCP utilizável pôde ser encontrado." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "\"dhclient\" não pôde ser encontrado." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "\"dhcpd\" não pôde ser encontrado." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "cliente DHCP \"%s\" não suportado" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Nível de registro \"%s\" desconhecido" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Domínio de registro \"%s\" desconhecido" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"NOTA: o resolvedor da libc não tem suporte a mais do que 3 servidores de " +"nomes." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "Os servidores de nomes listados abaixo podem não ser reconhecidos." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Auto %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3254 +msgid "System" +msgstr "Sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Compartilhamento de conexão via rede sem fio protegida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Compartilhamento de conexão via rede sem fio aberta" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Modificar máquina de sistema persistente" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Modificar conexões de sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Políticas de sistema previnem modificação das configurações do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "" +"Políticas de sistema previnem modificação da máquina persistente do sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Políticas de sistema previnem compartilhamento de conexões através de uma " +"rede sem fio protegida" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Políticas de sistema previnem compartilhamento de conexões através de uma " +"rede sem fio aberta" diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 00000000..eaf0b896 --- /dev/null +++ b/po/ru.po @@ -0,0 +1,1651 @@ +# translation of ru.po to +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Leonid Kanter , 2006, 2007. +# Артём Попов , 2009. +# Yulia , 2010. +msgid "" +msgstr "" +"Project-Id-Version: ru\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-19 12:20+1000\n" +"Last-Translator: \n" +"Language-Team: Russian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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" +"X-Launchpad-Export-Date: 2009-02-12 11:00+0000\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "ИМЯ" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "УСТРОЙСТВА" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "ОБЛАСТЬ" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "ПО УМОЛЧАНИЮ" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "СЛУЖБА DBUS" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "ТИП" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "ВРЕМЕННАЯ МЕТКА" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "ДЕЙСТВ. ВРЕМЕННАЯ МЕТКА" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "АВТОПОДКЛЮЧЕНИЕ" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "ТОЛЬКО ДЛЯ ЧТЕНИЯ" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Применение: nmcli con { КОМАНДА | help }\n" +" КОМАНДА := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "Ошибка: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Ошибка: 'con list': %s; разрешённые поля: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "Сведения о соединении" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "система" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "пользователь" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "никогда" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "да" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "нет" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "Соединения систем" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "Соединения пользователя" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Ошибка: отсутствует аргумент %s" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Ошибка: нет подключения %s" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Неизвестный параметр: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Ошибка: не указан допустимый параметр." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "Ошибка: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "Ошибка: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "Ошибка: 'con status': %s; разрешённые поля: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "Активные соединения" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "нет активных соединений на устройстве «%s»" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "нет активного соединения или устройства" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "устройство «%s» несовместимо с соединением «%s»" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "не найдено устройство для соединения «%s»" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "активация" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "активно" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "неизвестно" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "Подключение VPN (подготовка)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "Подключение VPN (требуется аутентификация)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "Подключение VPN" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "Подключение VPN (получение конфигурации IP)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN подключен" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "Сбой подключения VPN" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN отключен" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "неизвестная причина" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "нет" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "пользователь был отключен" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "основное соединение с сетью было разорвано" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "служба VPN внезапно прекратила работу" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "служба VPN вернула недопустимую конфигурацию" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "время ожидания соединения истекло" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "служба VPN не была запущена вовремя" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "не удалось запустить службу VPN" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "нет верных секретов VPN" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "неверные секреты VPN" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "соединение удалено" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "статус: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "Соединение активно\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "Ошибка: сбой активации соединения." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "статус: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Ошибка: сбой активации соединения: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Ошибка: превышено время ожидания: %d сек." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Ошибка: сбой активации соединения: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Ошибка: не удалось установить активное соединение для «%s»" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "Статус активного соединения: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "Путь активного соединения: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Ошибка: неизвестное соединение: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Ошибка: недопустимое значение таймаута: «%s»" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Ошибка: необходимо указать ID или UUID." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Ошибка: подходящее устройство не найдено: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "Ошибка: подходящее устройство не найдено." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Предупреждение: соединение не активно\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Ошибка: недопустимая команда «con»: «%s»" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Ошибка: не удалось подключиться к D-Bus." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Ошибка: не удалось получить системные настройки." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Ошибка: не удалось получить настройки пользователя." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Ошибка: не удалось получить соединения, не выполняются службы настройки." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "УСТРОЙСТВО" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "СТАТУС" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "ОБЩИЕ" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "ВОЗМОЖНОСТИ" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "СВОЙСТВА WIFI" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "ТОЧКА" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "СВОЙСТВА ПРОВОДНОГО СОЕДИНЕНИЯ" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "ПАРАМЕТРЫ IP4" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "ДРАЙВЕР" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "ОПРЕД.НЕСУЩУЮ" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "СКОРОСТЬ" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "НЕСУЩАЯ" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "АДРЕС" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "ПРЕФИКС" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "ШЛЮЗ" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "РЕЖИМ" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "ЧАСТОТА" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "СКОРОСТЬ" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "СИГНАЛ" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "ЗАЩИТА" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "ФЛАГИ WPA" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "ФЛАГИ RSN" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "АКТИВЕН" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Применение: nmcli dev { КОМАНДА | help }\n" +"\n" +" КОМАНДА := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [ waddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "без управления" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "недоступен" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "отключен" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "подключается (подготовка)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "подключается (конфигурация)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "подключается (требуется аутентификация)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "подключается (получение настроек IP)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "подключен" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "сбой соединения" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "Неизвестно" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(нет)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: ошибка преобразования адреса IP4 0x%X" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u МГц" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u МБ/с" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "Зашифровано: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "Enterprise " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "Инфраструктура" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "Ошибка: «dev list»: %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "Ошибка: «dev list»: %s; разрешённые поля: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "Сведения об устройстве" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(неизвестно)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "неизвестно)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Мб/c" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "вкл" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "выкл" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "Ошибка: «dev status»: %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "Ошибка: «dev status»: %s; разрешённые поля: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "Статус устройств" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Ошибка: отсутствует аргумент «%s»" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Ошибка: не найдено устройство «%s»." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Выполнено: устройство «%s» подключено." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Ошибка: не удалось отключить устройство «%s» (%s): %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Статус устройства: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Ошибка: необходимо указать интерфейс." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "Ошибка: «dev wifi»: «%s»" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "Ошибка: «dev wifi»: %s; разрешённые поля: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "Список проверки WiFi" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Ошибка: точка доступа с адресом «%s» не найдена." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Ошибка: «%s» не является устройством WiFi." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Ошибка: неверная команда «dev wifi»: «%s»" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Ошибка: неверная команда «dev»: «%s»" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "ВЫПОЛНЯЕТСЯ" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "ОБОРУДОВАНИЕ WIFI" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "ОБОРУДОВАНИЕ WWAN" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Применение: nmcli nm { КОМАНДА | help }\n" +"\n" +" КОМАНДА := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "спящий" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "подключается" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "Ошибка: «nm status»: %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "Ошибка: «nm status»: %s; разрешённые поля: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "Статус NetworkManager" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "включен" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "отключен" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "выполняется" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "не выполняется" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "Ошибка: недопустимое значение «--fields»: «%s»; разрешённые поля: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi включен" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Ошибка: недопустимый параметр «wifi»: «%s»" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN включен" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Ошибка: недопустимый параметр «wwan»: «%s»" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Ошибка: недопустимая команда «nm»: «%s»." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Применение: %s [ПАРАМЕТРЫ] ОБЪЕКТ { КОМАНДА | help }\n" +"\n" +"ПАРАМЕТРЫ\n" +" -t[erse] сжатый вывод\n" +" -p[retty] отформатированный вывод\n" +" -m[ode] tabular|multiline режим вывода\n" +" -f[ields] <поле1,поле2,...>|all|common вывод выбранных полей\n" +" -e[scape] yes|no отделять разделитель столбцов в значениях специальными символами\n" +" -v[ersion] показать версию программы\n" +" -h[elp] показать эту справку\n" +"\n" +"ОБЪЕКТ\n" +" nm статус NetworkManager\n" +" con соединения NetworkManager\n" +" dev устройства под управлением NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "Ошибка: неизвестный объект «%s». Попробуйте выполнить «nmcli help»." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "Ошибка: параметр «--terse» указан дважды." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "Ошибка: параметры «--terse» и «--pretty» взаимоисключаемы." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "Ошибка: параметр «--pretty» указан дважды." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "Ошибка: параметры «--pretty» и «--terse» взаимоисключаемы." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "Ошибка: отсутствует аргумент параметра «%s»." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "Ошибка: недопустимый аргумент «%s» для параметра «%s»." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "Ошибка: отсутствуют поля для параметров «%s»." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "утилита nmcli, версия %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "Ошибка: неизвестный параметр «%s». Попробуйте выполнить «nmcli -help»." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Получен сигнал %d. Завершение работы..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Ошибка: не удалось подключиться к NetworkManager." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "Успешно" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (16-теричный ASCII-ключ)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-битная парольная фраза)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (неизвестно)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (неизвестно)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "любой, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 МГц, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 МГц, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 МГц, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 МГц, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 МГц, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 МГц, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 МГц, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 МГц, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 МГц, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 МГц, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 МГц, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "авто" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "не задано" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "поле «%s» должно быть единственным" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "недопустимое поле «%s»" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "Параметр «--terse» требует указания «--fields»" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "Параметр «--terse» требует определённых значений «--fields», но не «%s»" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Файл ключа PEM не содержит завершающий тег «%s»." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Возможно, это не файл личного ключа PEM." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Недостаточно памяти для загрузки данных из файла PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Некорректный файл PEM: Proc-Type не является первым тегом." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Некорректный файл PEM: неизвестный тег Proc-Type «%s»." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Некорректный файл PEM: DEK-Info не является вторым тегом." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Некорректный файл PEM: в теге DEK-Info не найден ВИ." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Некорректный файл PEM: неверный формат ВИ в теге DEK-Info." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Некорректный файл PEM: неизвестный шифр личного ключа «%s»." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Не удалось расшифровать личный ключ." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Сертификат PEM «%s» не имеет тега окончания «%s»." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Не удалось расшифровать сертификат." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Недостаточно памяти для загрузки данных сертификата." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Недостаточно памяти для загрузки данных из файла." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "Длина ВИ должна быть равна чётному количеству байт." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Недостаточно памяти для загрузки ВИ." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "ВИ включает нешестнадцатеричные цифры." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Неизвестный шифр личного ключа «%s»." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Недостаточно памяти для расшифровки личного ключа." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Не удаётся определить тип личного ключа." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Недостаточно памяти для загрузки расшифрованного личного ключа." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Не удалось инициализировать криптографический модуль." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Не удалось инициализировать модуль MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Недопустимая длина ВИ (минимально %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Недостаточно памяти для буфера расшифрованного ключа." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Не удалось инициализировать контекст шифра декодирования: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Не удалось создать симметричный ключ для расшифровки: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Не удалось создать ВИ для расшифровки: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Не удалось создать ВИ для расшифровки: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Не удалось расшифровать личный ключ: непредвиденная длина заполнения." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Не удалось расшифровать личный ключ." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Не удалось выделить память для шифрования" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Не удалось инициализировать контекст кода шифрования: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Не удалось создать симметричный ключ для шифрования: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Не удалось создать ВИ для шифрования: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Не удалось зашифровать данные: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Ошибка инициализации данных сертификата: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Не удалось расшифровать сертификат: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Не удалось инициализировать декодер PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Не удалось расшифровать файл PKCS#12: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Не удалось проверить файл PKCS#12: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Не удалось инициализировать криптографический модуль: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Не удалось инициализировать контекст MD5: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Недопустимая длина ВИ (минимально %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Не удалось инициализировать слот шифра декодирования." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Не удалось задать симметричный ключ расшифровки." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Не удалось задать ВИ расшифровки." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Не удалось инициализировать контекст расшифровки." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Не удалось расшифровать личный ключ: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"Не удалось расшифровать личный ключ: слишком большой объем расшифрованных " +"данных." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Не удалось завершить расшифровку личного ключа: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Не удалось инициализировать слот шифра декодирования." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Не удалось задать симметричный ключ для шифрования." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Не удалось задать ВИ расшифровки." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Не удалось инициализировать контекст шифрования." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Не удалось зашифровать: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Непредвиденный объём данных после шифрования." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Не удалось расшифровать сертификат: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Не удалось преобразовать пароль в UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Не удалось инициализировать декодер PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Не удалось расшифровать файл PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Не удалось проверить файл PKCS#12: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "Ошибка при генерации случайных данных." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Недостаточно памяти для создания ключа шифрования." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "Не удалось выделить память для создания файла PEM." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Не удалось выделить память для записи ВИ в файл PEM." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Не удалось выделить память для записи зашифрованного ключа в файл PEM." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Не удалось выделить память для данных файла PEM." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "ошибка обработки сообщения netlink: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "произошла ошибка при ожидании данных из сокета" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "не удаётся подключиться к netlink для отслеживания статуса соединения: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "не удаётся включить проверку данных авторизации netlink: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"не удаётся создать идентификатор netlink для отслеживания статуса " +"соединения: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "не удаётся выделить кэш netlink для отслеживания статуса соединения: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "не удалось войти в группу netlink: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "ошибка обновления кэша соединения: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Неверный параметр. Используйте --help для вывода списка возможных " +"параметров.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. Используйте --help для вывода списка допустимых параметров.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Создано NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Совмещено с %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "не найден клиент DHCP." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' не найден." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' не найден." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "клиент DHCP '%s' не поддерживается" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "Неизвестный уровень журналирования «%s»" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "Неизвестный домен журналирования «%s»" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "" +"ВНИМАНИЕ: преобразователь имён glibc не поддерживает более трёх серверов " +"имён." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "Нижеперечисленные сервера могут быть пропущены." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Авто %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "Система" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Совместное использование соединений в закрытой сети WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Совместное использование соединений в открытой сети WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Изменить постоянное имя узла компьютера" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Изменить соединения системы" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Системная политика запрещает изменение системных настроек" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Системная политика запрещает изменение постоянного имени узла компьютера" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"Системная политика запрещает совместное использование соединений в закрытой " +"сети WiFi" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "" +"Системная политика запрещает совместное использование соединений в закрытой " +"сети WiFi" + diff --git a/po/rw.po b/po/rw.po new file mode 100644 index 00000000..05d92b38 --- /dev/null +++ b/po/rw.po @@ -0,0 +1,398 @@ +# translation of NetworkManager to Kinyarwanda. +# Copyright (C) 2005 Free Software Foundation, Inc. +# This file is distributed under the same license as the NetworkManager package. +# Steve Murphy , 2005 +# Steve performed initial rough translation from compendium built from translations provided by the following translators: +# Philibert Ndandali , 2005. +# Viateur MUGENZI , 2005. +# Noëlla Mupole , 2005. +# Carole Karema , 2005. +# JEAN BAPTISTE NGENDAHAYO , 2005. +# Augustin KIBERWA , 2005. +# Donatien NSENGIYUMVA , 2005.. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-04-01 16:22-0700\n" +"PO-Revision-Date: 2005-03-31 20:55-0700\n" +"Last-Translator: Steve Murphy \n" +"Language-Team: Kinyarwanda \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"ULL NAME \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: info-daemon/networks.glade.h:1 +#, fuzzy +msgid "Wireless Networks:" +msgstr "Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "Wireless Network Login Confirmation\n" +"\n" +"You have chosen log in to the wireless network '%s'. If you are sure this " +"wireless network is secure, click the checkbox below and NetworkManager will " +"no longer pester you with stupid questions when you connect to it." +msgstr "" +", 2004, 2005, 2006. +# +# $Id: sk.po,v 1.47 2006/10/15 22:29:21 marcel Exp $ +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 00:28+0200\n" +"PO-Revision-Date: 2006-10-16 00:29+0200\n" +"Last-Translator: Marcel Telka \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural= (n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;\n" + +#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:926 +#, c-format +msgid "Passphrase for wireless network %s" +msgstr "Heslo pre bezdrôtovú sieť %s" + +#: ../gnome/applet/applet-dbus.c:265 +#, c-format +msgid "Connection to the wireless network '%s' failed." +msgstr "Pripájanie k bezdrôtovej sieti '%s' zlyhalo." + +#: ../gnome/applet/applet-dbus.c:270 +msgid "Connection to the wired network failed." +msgstr "Pripájanie k drôtovej sieti zlyhalo." + +#: ../gnome/applet/applet.c:187 +msgid "Error displaying connection information:" +msgstr "Chyba pri zobrazovaní informácií o spojení:" + +#: ../gnome/applet/applet.c:205 +msgid "Could not find some required resources (the glade file)!" +msgstr "Nepodarilo sa nájsť niektoré vyžadované zdroje (súbor glade)!" + +#: ../gnome/applet/applet.c:216 +msgid "No active connections!" +msgstr "Bez aktívnych sieťových spojení!" + +#: ../gnome/applet/applet.c:234 +#, c-format +msgid "%d Mb/s" +msgstr "%d Mb/s" + +#: ../gnome/applet/applet.c:237 +#, c-format +msgid "Wired Ethernet (%s)" +msgstr "Drôtový ethernet (%s)" + +#: ../gnome/applet/applet.c:239 +#, c-format +msgid "Wireless Ethernet (%s)" +msgstr "Bezdrôtový ethernet (%s)" + +#: ../gnome/applet/applet.c:245 +msgid "Unknown" +msgstr "Neznáme" + +#: ../gnome/applet/applet.c:335 ../gnome/applet/applet.c:361 +msgid "NetworkManager Applet" +msgstr "Applet NetworkManager" + +#: ../gnome/applet/applet.c:337 +msgid "" +"Copyright © 2004-2006 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"Autorské práva © 2004-2006 Red Hat, Inc.\n" +"Autorské práva © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:339 ../gnome/applet/applet.c:365 +msgid "" +"Notification area applet for managing your network devices and connections." +msgstr "" +"Aplet oblasti upozornení pre správu vašich sieťových zariadení a pripojení." + +#: ../gnome/applet/applet.c:342 ../gnome/applet/applet.c:369 +msgid "translator-credits" +msgstr "Marcel Telka " + +#: ../gnome/applet/applet.c:363 +msgid "" +"Copyright © 2004-2005 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"Autorské práva © 2004-2005 Red Hat, Inc.\n" +"Autorské práva © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:425 +msgid "VPN Login Failure" +msgstr "Zlyhanie VPN prihlásenia" + +#: ../gnome/applet/applet.c:426 +#, c-format +msgid "Could not start the VPN connection '%s' due to a login failure." +msgstr "Nepodarilo sa spustiť VPN spojenie '%s' kvôli zlyhania prihlásenia." + +#: ../gnome/applet/applet.c:430 +msgid "VPN Start Failure" +msgstr "Zlyhanie spustenia VPN" + +#: ../gnome/applet/applet.c:431 +#, c-format +msgid "" +"Could not start the VPN connection '%s' due to a failure launching the VPN " +"program." +msgstr "" +"Nepodarilo sa spustiť VPN spojenie '%s' kvôli zlyhaniu spustenia VPN " +"programu." + +#: ../gnome/applet/applet.c:435 ../gnome/applet/applet.c:445 +msgid "VPN Connect Failure" +msgstr "Zlyhanie VPN spojenia" + +#: ../gnome/applet/applet.c:436 +#, c-format +msgid "Could not start the VPN connection '%s' due to a connection error." +msgstr "Nepodarilo sa spustiť VPN spojenie '%s' kvôli chybe spojenia." + +#: ../gnome/applet/applet.c:440 +msgid "VPN Configuration Error" +msgstr "Chyba konfigurácie VPN" + +#: ../gnome/applet/applet.c:441 +#, c-format +msgid "The VPN connection '%s' was not correctly configured." +msgstr "VPN spojenie '%s' nebolo správne nakonfigurované." + +#: ../gnome/applet/applet.c:446 +#, c-format +msgid "" +"Could not start the VPN connection '%s' because the VPN server did not " +"return an adequate network configuration." +msgstr "" +"Nepodarilo sa spustiť VPN spojenie '%s', pretože VPN server nevrátil " +"príslušnú konfiguráciu siete." + +#: ../gnome/applet/applet.c:516 +msgid "VPN Login Message" +msgstr "Správa VPN prihlásenia" + +#: ../gnome/applet/applet.c:740 ../gnome/applet/applet.c:2510 +#: ../gnome/applet/other-network-dialog.c:458 +#: ../gnome/applet/passphrase-dialog.c:228 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"Applet NetworkManager nemohol nájsť niektoré vyžadované zdroje (súbor glade " +"nebol nájdený)." + +#: ../gnome/applet/applet.c:752 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "Sieťové zariadenie \"%s (%s)\" nepodporuje bezdrôtové vyhľadávanie." + +#: ../gnome/applet/applet.c:760 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "Sieťové zariadenie \"%s (%s)\" nepodporuje detekciu linky." + +#. Note to translators: this is used if no essid is known +#: ../gnome/applet/applet.c:902 ../gnome/applet/applet.c:1100 +msgid "(unknown)" +msgstr "(neznáme)" + +#: ../gnome/applet/applet.c:908 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "Pripravujem zariadenie %s pre drôtovú sieť..." + +#: ../gnome/applet/applet.c:910 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "Pripravujem zariadenie %s pre bezdrôtovú sieť '%s'..." + +#: ../gnome/applet/applet.c:918 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "Konfigurácia zariadenia %s pre drôtovú sieť..." + +#: ../gnome/applet/applet.c:920 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "Pokus o pripojenie k bezdrôtovej sieti '%s'..." + +#: ../gnome/applet/applet.c:928 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "Čakanie na sieťový kľúč pre bezdrôtovú sieť '%s'..." + +#: ../gnome/applet/applet.c:936 ../gnome/applet/applet.c:946 +msgid "Requesting a network address from the wired network..." +msgstr "Vyžiadanie sieťovej adresy z drôtovej siete..." + +#: ../gnome/applet/applet.c:938 ../gnome/applet/applet.c:948 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "Vyžiadanie sieťovej adresy z bezdrôtovej siete '%s'..." + +#: ../gnome/applet/applet.c:956 +msgid "Finishing connection to the wired network..." +msgstr "Ukončovanie spojenia k drôtovej sieti..." + +#: ../gnome/applet/applet.c:958 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "Ukončovanie spojenia k bezdrôtovej sieti '%s'..." + +#: ../gnome/applet/applet.c:1075 +msgid "NetworkManager is not running" +msgstr "NetworkManager nebeží" + +#: ../gnome/applet/applet.c:1083 ../gnome/applet/applet.c:1828 +msgid "Networking disabled" +msgstr "Sieť deaktivovaná" + +#: ../gnome/applet/applet.c:1088 +msgid "No network connection" +msgstr "Bez sieťového spojenia" + +#: ../gnome/applet/applet.c:1093 +msgid "Wired network connection" +msgstr "Pripojenie k drôtovej sieti" + +#: ../gnome/applet/applet.c:1097 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "Pripájané k bezdrôtovej sieti Ad-Hoc" + +#: ../gnome/applet/applet.c:1099 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "Bezdrôtové sieťové pripojenie k '%s' (%d%%)" + +#: ../gnome/applet/applet.c:1120 +#, c-format +msgid "VPN connection to '%s'" +msgstr "VPN spojenie s '%s'" + +#: ../gnome/applet/applet.c:1128 +#, c-format +msgid "VPN connecting to '%s'" +msgstr "VPN pripájanie k '%s'" + +#: ../gnome/applet/applet.c:1541 +msgid "_Connect to Other Wireless Network..." +msgstr "_Pripojiť sa k inej bezdrôtovej sieti..." + +#: ../gnome/applet/applet.c:1562 +msgid "Create _New Wireless Network..." +msgstr "Vytvoriť _novú bezdrôtovú sieť..." + +#: ../gnome/applet/applet.c:1685 +msgid "_VPN Connections" +msgstr "_VPN spojenia" + +#: ../gnome/applet/applet.c:1730 +msgid "_Configure VPN..." +msgstr "_Konfigurovať VPN..." + +#: ../gnome/applet/applet.c:1734 +msgid "_Disconnect VPN..." +msgstr "_Odpojiť VPN..." + +#: ../gnome/applet/applet.c:1756 +msgid "_Dial Up Connections" +msgstr "_Vytáčané spojenia" + +#. FIXME: We should save and then check the state of the devices and show Connect _or_ Disconnect for each item +#: ../gnome/applet/applet.c:1767 +#, c-format +msgid "Connect to %s..." +msgstr "Pripojiť k %s..." + +#: ../gnome/applet/applet.c:1773 +#, c-format +msgid "Disconnect from %s..." +msgstr "Odpojiť od %s..." + +#: ../gnome/applet/applet.c:1822 +msgid "No network devices have been found" +msgstr "Neboli nájdené iné sieťové zariadenia" + +#: ../gnome/applet/applet.c:2014 +msgid "NetworkManager is not running..." +msgstr "NetworkManager nebeží..." + +#. 'Enable Networking' item +#: ../gnome/applet/applet.c:2170 +msgid "Enable _Networking" +msgstr "Povoliť _sieť" + +#. 'Enable Wireless' item +#: ../gnome/applet/applet.c:2176 +msgid "Enable _Wireless" +msgstr "Povoliť _bezdrôtové pripojenie" + +#. 'Connection Information' item +#: ../gnome/applet/applet.c:2182 +msgid "Connection _Information" +msgstr "_Informácie o spojení" + +#. Help item +#: ../gnome/applet/applet.c:2193 +msgid "_Help" +msgstr "_Pomocník" + +#. About item +#: ../gnome/applet/applet.c:2202 +msgid "_About" +msgstr "_O programe" + +#: ../gnome/applet/applet.c:2669 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "" +"Applet NetworkManager nemohol nájsť niektoré vyžadované zdroje. Nemôže " +"pokračovať.\n" + +#: ../gnome/applet/wireless-security-option.c:157 +msgid "Open System" +msgstr "Otvorený systém" + +#: ../gnome/applet/wireless-security-option.c:160 +msgid "Shared Key" +msgstr "Zdieľaný kľúč" + +#: ../gnome/applet/wireless-security-option.c:208 +msgid "Automatic (Default)" +msgstr "Automatické (Predvolené)" + +#: ../gnome/applet/wireless-security-option.c:215 +msgid "AES-CCMP" +msgstr "AES-CCMP" + +#: ../gnome/applet/wireless-security-option.c:223 +msgid "TKIP" +msgstr "TKIP" + +#: ../gnome/applet/wireless-security-option.c:231 +msgid "Dynamic WEP" +msgstr "Dynamický WEP" + +#: ../gnome/applet/wso-none.c:53 +msgid "None" +msgstr "Nič" + +#: ../gnome/applet/wso-wep-ascii.c:138 +msgid "WEP 64/128-bit ASCII" +msgstr "WEP 64/128 bitov v ASCII" + +#: ../gnome/applet/wso-wep-hex.c:135 +msgid "WEP 64/128-bit Hex" +msgstr "WEP 64/128 bitov v šestnástkovej sústave" + +#: ../gnome/applet/wso-wep-passphrase.c:135 +msgid "WEP 128-bit Passphrase" +msgstr "WEP 128 bitové heslo" + +#: ../gnome/applet/wso-wpa-eap.c:237 +msgid "PEAP" +msgstr "PEAP" + +#: ../gnome/applet/wso-wpa-eap.c:238 +msgid "TLS" +msgstr "TLS" + +#: ../gnome/applet/wso-wpa-eap.c:239 +msgid "TTLS" +msgstr "TTLS" + +#: ../gnome/applet/wso-wpa-eap.c:247 ../src/nm-ap-security-wpa-eap.c:93 +#: ../src/nm-ap-security-wpa-eap.c:117 +msgid "WPA2 Enterprise" +msgstr "Podnikové WPA2" + +#: ../gnome/applet/wso-wpa-eap.c:249 ../src/nm-ap-security-wpa-eap.c:95 +#: ../src/nm-ap-security-wpa-eap.c:122 +msgid "WPA Enterprise" +msgstr "Podnikové WPA" + +#: ../gnome/applet/wso-wpa-psk.c:178 +msgid "WPA2 Personal" +msgstr "Osobné WPA2" + +#: ../gnome/applet/wso-wpa-psk.c:180 +msgid "WPA Personal" +msgstr "Osobné WPA" + +#: ../gnome/applet/eggtrayicon.c:134 +msgid "Orientation" +msgstr "Orientácia" + +#: ../gnome/applet/eggtrayicon.c:135 +msgid "The orientation of the tray." +msgstr "Orientácia zásobníka." + +#: ../gnome/applet/menu-items.c:88 +#, c-format +msgid "Wired Network (%s)" +msgstr "Drôtová sieť (%s)" + +#: ../gnome/applet/menu-items.c:91 +msgid "_Wired Network" +msgstr "_Drôtová sieť" + +#: ../gnome/applet/menu-items.c:162 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Bezdrôtových sietí (%s)" +msgstr[1] "Bezdrôtová sieť (%s)" +msgstr[2] "Bezdrôtové siete (%s)" + +#: ../gnome/applet/menu-items.c:164 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Bezdrôtových sietí" +msgstr[1] "Bezdrôtová sieť" +msgstr[2] "Bezdrôtové siete" + +#: ../gnome/applet/menu-items.c:343 +msgid " (invalid Unicode)" +msgstr " (neplatný Unikód)" + +#: ../gnome/applet/other-network-dialog.c:352 +#, c-format +msgid "" +"By default, the wireless network's name is set to your computer's name, %s, " +"with no encryption enabled" +msgstr "" +"Štandardne je názov bezdrôtovej siete nastavený na názov vášho počítača, %s, " +"bez povoleného šifrovania" + +#: ../gnome/applet/other-network-dialog.c:358 +msgid "Create new wireless network" +msgstr "Vytvoriť novú bezdrôtovú sieť" + +#: ../gnome/applet/other-network-dialog.c:359 +msgid "" +"Enter the name and security settings of the wireless network you wish to " +"create." +msgstr "" +"Zadajte názov a bezpečnostné nastavenia bezdrôtovej siete, ktorú chcete " +"vytvoriť." + +#: ../gnome/applet/other-network-dialog.c:363 +msgid "Create New Wireless Network" +msgstr "Vytvoriť _novú bezdrôtovú sieť" + +#: ../gnome/applet/other-network-dialog.c:368 +msgid "Existing wireless network" +msgstr "Existujúca bezdrôtová sieť" + +#: ../gnome/applet/other-network-dialog.c:369 +msgid "Enter the name of the wireless network to which you wish to connect." +msgstr "Zadajte názov bezdrôtovej siete, ku ktorej sa chcete pripojiť." + +#: ../gnome/applet/other-network-dialog.c:371 +msgid "Connect to Other Wireless Network" +msgstr "_Pripojiť sa k inej bezdrôtovej sieti" + +#: ../gnome/applet/passphrase-dialog.c:215 +msgid "Error connecting to wireless network" +msgstr "Chyba pri pripájaní bezdrôtovej sieti" + +#: ../gnome/applet/passphrase-dialog.c:216 +msgid "" +"The requested wireless network requires security capabilities unsupported by " +"your hardware." +msgstr "" +"Požadované bezdrôtová sieť vyžaduje bezpečnostné vlastnosti nepodporované " +"vašim hardvérom." + +#: ../gnome/applet/vpn-password-dialog.c:151 +#: ../gnome/applet/vpn-password-dialog.c:188 +#, c-format +msgid "Cannot start VPN connection '%s'" +msgstr "Nepodarilo sa spustiť VPN spojenie '%s'" + +#: ../gnome/applet/vpn-password-dialog.c:154 +#, c-format +msgid "" +"Could not find the authentication dialog for VPN connection type '%s'. " +"Contact your system administrator." +msgstr "" +"Nepodarilo sa nájsť dialógové okno overenia totožnosti pre VPN spojenie typu " +"'%s'. Spojte sa s vašim správcom systému." + +#: ../gnome/applet/vpn-password-dialog.c:191 +#, c-format +msgid "" +"There was a problem launching the authentication dialog for VPN connection " +"type '%s'. Contact your system administrator." +msgstr "" +"Vyskytol sa problém pri spúšťaní dialógového okna overenia totožnosti pre " +"VPN spojenie typu '%s'. Spojte sa s vašim sprácom systému." + +#: ../gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: ../gnome/applet/applet.glade.h:2 +msgid "" +"Active Connection Information" +msgstr "" +"Informácie o aktívnom spojení" + +#: ../gnome/applet/applet.glade.h:4 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Heslo vyžadované bezdrôtovou sieťou\n" +"\n" +"Heslo alebo šifrovací kľúč je potrebný pre prístup k bezdrôtovej sieti '%s'." + +#: ../gnome/applet/applet.glade.h:8 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" +"Obmedzená sieťová funkčnosť\n" +"\n" +"%s Nebude to úplne funkčné." + +#: ../gnome/applet/applet.glade.h:12 +#, no-c-format +msgid "" +"Wireless Network Login Confirmation\n" +"\n" +"You have chosen to log in to the wireless network '%s'. If you are sure " +"that this wireless network is secure, click the checkbox below and " +"NetworkManager will not require confirmation on subsequent log ins." +msgstr "" +"Potvrdenie prihlásenia do bezdrôtovej " +"siete\n" +"\n" +"Vybrali ste si prihlásenie do bezdrôtovej siete '%s'. Ak ste si istý, že " +"táto bezdrôtová sieť je bezpečná, označte zaškrtávacie pole nižšie a " +"NetworkManager nebude viac vyžadovať potvrdenie pri ďalších prihláseniach." + +#: ../gnome/applet/applet.glade.h:15 +msgid "Anonymous Identity:" +msgstr "Anonymná identita:" + +#: ../gnome/applet/applet.glade.h:16 +msgid "Authentication:" +msgstr "Overenie totožnosti:" + +#: ../gnome/applet/applet.glade.h:17 +msgid "Broadcast Address:" +msgstr "Adresa šírenia:" + +#: ../gnome/applet/applet.glade.h:18 +msgid "CA Certificate File:" +msgstr "Súbor CA certifikátu:" + +#: ../gnome/applet/applet.glade.h:19 +msgid "C_onnect" +msgstr "Prip_ojiť" + +#: ../gnome/applet/applet.glade.h:20 +msgid "Client Certificate File:" +msgstr "Súbor s certifikátom klienta:" + +#: ../gnome/applet/applet.glade.h:21 +msgid "Connection Information" +msgstr "Informácie o spojení" + +#: ../gnome/applet/applet.glade.h:22 +msgid "Default Route:" +msgstr "Predvolené smerovanie:" + +#: ../gnome/applet/applet.glade.h:23 +msgid "Destination Address:" +msgstr "Cieľová adresa:" + +#: ../gnome/applet/applet.glade.h:24 +msgid "Driver:" +msgstr "Ovládač:" + +#: ../gnome/applet/applet.glade.h:25 +msgid "EAP Method:" +msgstr "Metóda EAP:" + +#: ../gnome/applet/applet.glade.h:26 +msgid "Hardware Address:" +msgstr "Hardvérová adresa:" + +#: ../gnome/applet/applet.glade.h:27 +msgid "IP Address:" +msgstr "IP adresa:" + +#: ../gnome/applet/applet.glade.h:28 +msgid "Identity:" +msgstr "Identita:" + +#: ../gnome/applet/applet.glade.h:29 +msgid "Interface:" +msgstr "Rozhranie:" + +#: ../gnome/applet/applet.glade.h:30 +msgid "Key Type:" +msgstr "Typ kľúča:" + +#: ../gnome/applet/applet.glade.h:31 +msgid "Key management:" +msgstr "Správa kľúčov:" + +#: ../gnome/applet/applet.glade.h:32 +msgid "Key:" +msgstr "Kľúč:" + +#: ../gnome/applet/applet.glade.h:33 +msgid "" +"None\n" +"WEP 128-bit Passphrase\n" +"WEP 64/128-bit Hex\n" +"WEP 64/128-bit ASCII\n" +msgstr "" +"Žiaden\n" +"WEP 128 bitové heslo\n" +"WEP 64/128 bitov v šestnástkovej sústave\n" +"WEP 64/128 bitov ASCII\n" + +#: ../gnome/applet/applet.glade.h:38 +msgid "" +"Open System\n" +"Shared Key" +msgstr "" +"Otvorený systém\n" +"Zdieľaný kľúč" + +#: ../gnome/applet/applet.glade.h:40 +msgid "Other Wireless Network..." +msgstr "Ostatné bezdrôtové siete..." + +#: ../gnome/applet/applet.glade.h:41 +msgid "Passphrase:" +msgstr "Heslo:" + +#: ../gnome/applet/applet.glade.h:42 +msgid "Password:" +msgstr "Heslo:" + +#: ../gnome/applet/applet.glade.h:43 +msgid "Primary DNS:" +msgstr "Primárne DNS:" + +#: ../gnome/applet/applet.glade.h:44 +msgid "Private Key File:" +msgstr "Súbor súkromného kľúča:" + +#: ../gnome/applet/applet.glade.h:45 +msgid "Private Key Password:" +msgstr "Heslo súkromného kľúča:" + +#: ../gnome/applet/applet.glade.h:46 +msgid "Secondary DNS:" +msgstr "Sekundárne DNS:" + +#: ../gnome/applet/applet.glade.h:47 +msgid "Select the CA Certificate File" +msgstr "Vybrať súbor s CA certifikátom" + +#: ../gnome/applet/applet.glade.h:48 +msgid "Select the Client Certificate File" +msgstr "Vybrať súbor s certifikátom klienta" + +#: ../gnome/applet/applet.glade.h:49 +msgid "Select the Private Key File" +msgstr "Vybrať súbor súbor súkromného kľúča" + +#: ../gnome/applet/applet.glade.h:50 +msgid "Show key" +msgstr "Zobraziť kľúč" + +#: ../gnome/applet/applet.glade.h:51 +msgid "Show passphrase" +msgstr "Zobraziť heslo" + +#: ../gnome/applet/applet.glade.h:52 +msgid "Show password" +msgstr "Zobraziť heslo" + +#: ../gnome/applet/applet.glade.h:53 +msgid "Show passwords" +msgstr "Zobraziť heslá" + +#: ../gnome/applet/applet.glade.h:54 +msgid "Speed:" +msgstr "Rýchlosť:" + +#: ../gnome/applet/applet.glade.h:55 +msgid "Subnet Mask:" +msgstr "Maska podsiete:" + +#: ../gnome/applet/applet.glade.h:56 +msgid "Type:" +msgstr "Typ:" + +#: ../gnome/applet/applet.glade.h:57 +msgid "User Name:" +msgstr "Meno používateľa:" + +#: ../gnome/applet/applet.glade.h:58 +msgid "Wireless Network Key Required" +msgstr "Je potrebný kľúč bezdrôtovej siete" + +#: ../gnome/applet/applet.glade.h:59 +msgid "Wireless _adapter:" +msgstr "Bezdrôtový _adaptér:" + +#: ../gnome/applet/applet.glade.h:60 +msgid "_Always Trust this Wireless Network" +msgstr "_Vždy dôverovať tejto bezdrôtovej sieti" + +#: ../gnome/applet/applet.glade.h:61 +msgid "_Don't remind me again" +msgstr "_Nepripomínať mi znovu" + +#: ../gnome/applet/applet.glade.h:62 +msgid "_Fallback on this Network" +msgstr "_Núdzovo použiť túto sieť" + +#: ../gnome/applet/applet.glade.h:63 +msgid "_Login to Network" +msgstr "_Prihlásenie k sieti" + +#: ../gnome/applet/applet.glade.h:64 +msgid "_Network Name:" +msgstr "_Sieťové meno:" + +#: ../gnome/applet/applet.glade.h:65 +msgid "_Wireless Security:" +msgstr "Bezdrôtová bezpečnosť:" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:419 +msgid "Cannot add VPN connection" +msgstr "Nemôžte pridať VPN spojenie" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:421 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"Vo vašom systéme nebol nájdený použiteľný softvér pre VPN. Spojte sa so " +"správcom vášho systému." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +msgid "Cannot import VPN connection" +msgstr "Nemôžte importovať VPN spojenie" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:465 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" +"Nepodarilo sa nájsť použiteľný softvér pre pre VPN spojenie typu '%s' na " +"import súboru '%s'. Spojte sa so správcom vášho systému." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:585 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "Chyba pri získavaní VPN spojenia '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:588 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "" +"Nepodarilo sa nájsť súbory používateľského rozhrania pre VPN spojenie typu '%" +"s'. Spojte sa so správcom vášho systému." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:732 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "Odstrániť VPN spojenie \"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:735 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"Všetky informácie o VPN spojení \"%s\" budú stratené a možno budete " +"potrebovať správcu vášho systému, aby vám poskytol informácie na vytvorenie " +"nového spojenia." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:908 +msgid "Unable to load" +msgstr "Nepodarilo sa načítať" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:910 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "Nepodarilo sa nájsť niektoré vyžadované zdroje (súbor glade)!" + +#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), +#. NULL, +#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, +#. GTK_STOCK_CANCEL, +#. GTK_RESPONSE_REJECT, +#. GTK_STOCK_APPLY, +#. GTK_RESPONSE_ACCEPT, +#. NULL)); +#: ../gnome/vpn-properties/nm-vpn-properties.c:1055 +msgid "Create VPN Connection" +msgstr "Vytvoriť VPN spojenie" + +#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); +#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); +#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); +#. make the druid window modal wrt. our main window +#. gtk_window_set_modal (druid_window, TRUE); +#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1073 +msgid "Edit VPN Connection" +msgstr "Upraviť VPN spojenie" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "Pridať nové VPN spojenie" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Delete the selected VPN connection" +msgstr "Odstrániť vybrané VPN spojenie" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "E_xport" +msgstr "E_xportovať" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Edit the selected VPN connection" +msgstr "Upraviť vybrané VPN spojenie" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Export the VPN settings to a file" +msgstr "Exportovať VPN nastavenia do súboru" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Export the selected VPN connection to a file" +msgstr "Exportovať vybrané VPN spojenie do súboru" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Manage Virtual Private Network Connections" +msgstr "Spravovať spojenia Virtuálnych Privátnych Sietí (VPN)" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "VPN Connections" +msgstr "VPN spojenia" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "40 bitový WEP" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "104 bitový WEP" + +#: ../src/nm-ap-security-wpa-psk.c:50 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:52 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:54 +msgid "WPA Automatic" +msgstr "Automatické WPA" + +#: ../src/nm-ap-security-wpa-psk.c:59 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:61 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:63 +msgid "WPA2 Automatic" +msgstr "Automatické WPA2" + +#: ../src/nm-ap-security.c:338 +msgid "none" +msgstr "nič" + +#: ../src/nm-netlink-monitor.c:174 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"nepodarilo sa vytvoriť sieťovú zásuvku pre sledovanie drôtových ethernet " +"zariadení - %s" + +#: ../src/nm-netlink-monitor.c:192 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"nepodarilo sa pripojiť k sieťovej zásuvke pre sledovanie drôtových ethernet " +"zariadení - %s" + +#: ../src/nm-netlink-monitor.c:427 +msgid "operation took too long" +msgstr "operácia trvala veľmi dlho" + +#: ../src/nm-netlink-monitor.c:524 +msgid "received data from wrong type of sender" +msgstr "prijaté dáta od zlého typu odosielateľa" + +#: ../src/nm-netlink-monitor.c:537 +msgid "received data from unexpected sender" +msgstr "prijaté dáta od neočakávaného odosielateľa" + +#: ../src/nm-netlink-monitor.c:666 +msgid "too much data was sent over socket and some of it was lost" +msgstr "" +"príliš veľa dát bolo odoslaných cez zásuvku a niektoré z nich boli stratené" + +#: ../src/nm-netlink-monitor.c:776 +msgid "error occurred while waiting for data on socket" +msgstr "vyskytla sa chyba pri čakaní na dáta zo zásuvky" + +#: ../gnome/applet/applet-dbus-devices.c:922 +#, c-format +msgid "You are now connected to the Ad-Hoc wireless network '%s'." +msgstr "Teraz ste pripojený k bezdrôtovej sieti '%s' Ad-Hoc." + +#: ../gnome/applet/applet-dbus-devices.c:927 +#, c-format +msgid "You are now connected to the wireless network '%s'." +msgstr "Teraz ste pripojený k bezdrôtovej sieti '%s'." + +#: ../gnome/applet/applet-dbus-devices.c:934 +msgid "You are now connected to the wired network." +msgstr "Teraz ste pripojený k drôtovej sieti." + +#: ../gnome/applet/applet-dbus-devices.c:940 +msgid "Connection Established" +msgstr "Spojenie nadviazané" + +#: ../gnome/applet/applet-dbus-devices.c:983 +msgid "Disconnected" +msgstr "Odpojené" + +#: ../gnome/applet/applet-dbus-devices.c:984 +msgid "The network connection has been disconnected." +msgstr "Sieťové spojenie bolo rozpojené." diff --git a/po/sl.po b/po/sl.po new file mode 100644 index 00000000..425fd752 --- /dev/null +++ b/po/sl.po @@ -0,0 +1,992 @@ +# Slovenian translation of NetworkManager. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the NetworkManager package. +# Matic Žgur , 2007. +# Andrej Žnidaršič , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2009-09-29 03:25+0000\n" +"PO-Revision-Date: 2009-12-17 07:10+0100\n" +"Last-Translator: Andrej Žnidaršič \n" +"Language-Team: Slovenian GNOME Translation Team \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n" +"X-Poedit-Country: SLOVENIA\n" +"X-Poedit-Language: Slovenian\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Ključna datoteka PEM nima končne oznake '%s'." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Ni videti kot PEM zasebna ključna datoteka." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Ni dovolj pomnilnika za shranjevanje podatkov datoteke PEM." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Slabo oblikovana datoteka PEM: Proc-Type ni prva oznaka." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Slabo oblikovana datoteka PEM: neznana oznaka Proc-Type '%s'" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Slabo oblikovana datoteka PEM: DEK-Info ni druga oznaka." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Slabo oblikovana datoteka PEM: IV ni mogoče najti v DEK-Info oznaki." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Slabo oblikovana datoteka PEM: neveljavna oblika IV v DEK-Info oznaki." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Slabo oblikovana datoteka PEM: neznana cifra zasebnega ključa '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Zasebnega ključa ni mogoče dekodirati." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM potrdilo '%s' nima končne oznake '%s'." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Dekodiranje potrdila je spodletelo." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Ni dovolj pomnilnika za shranjevanje podatkov potrdila." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Ni dovolj pomnilnika za shranjevanje podatkov datoteke." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV mora biti dolg sodo število bajtov." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Za shranjevanje IV ni dovolj pomnilnika." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV vsebuje ne-šestnajstiške številke." + +#: ../libnm-util/crypto.c:382 +#: ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 +#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:335 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Cifra zasebnega ključa '%s' je neznana." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Ni dovolj pomnilnika za dešifriranje zasebnega ključa." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Ni mogoče določiti vrste zasebnega ključa." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Ni dovolj pomnilnika za shranjevanje dešifriranega zasebnega ključa." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Zagon motorja šifriranja je spodletel." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Zagon motorja MD5 je spodletel: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Neveljavna dolžina IV (mora biti vsaj %zd)" + +#: ../libnm-util/crypto_gnutls.c:165 +#: ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Ni dovolj pomnilnika za medpomnilnik ključa dešifriranja." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Zagon vsebine cifre dešifriranje je spodletel: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "Nastavljanje simetričnega ključa za dešifriranje je spodletelo: %s / %s. " + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Nastavljanje IV za dešifriranje je spodletelo: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Dešifriranje zasebnega ključa je spodletelo: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 +#: ../libnm-util/crypto_nss.c:266 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Dešifriranje zasebnega ključa je spodletelo: nepričakovana dolžina blazinjenja." + +#: ../libnm-util/crypto_gnutls.c:221 +#: ../libnm-util/crypto_nss.c:277 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Dešifriranje zasebnega ključa je spodletelo." + +#: ../libnm-util/crypto_gnutls.c:286 +#: ../libnm-util/crypto_nss.c:355 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Pomnilnika za šifriranje ni mogoče dodeliti." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Zagon vsebine šifrirne cifre je spodletel: %s / %s. " + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Nastavitev simetričnega ključa za šifriranje je spodletela: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Nastavitev IV za šifriranje je spodletela: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "Šifriranje podatkov je spodletelo: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Napaka med zaganjanjem podatkov potrdila: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Potrdila ni mogoča dekodirati: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Dekodirnika PKCS#12 ni mogoče zagnati: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Datoteke PKCS#12 ni mogoče dekodirati: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Datoteke PKCS#12 ni mogoče preveriti: %s" + +#: ../libnm-util/crypto_nss.c:57 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Zagon motorja šifriranja je spodletel: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Zagon vsebine MD5 je spodletel: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Neveljavna dolžina IV (mora biti vsaj %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Zagon polja cifre dešifriranja je spodletel." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Nastavljanje simetričnega ključa za opis je spodletelo." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Nastavljanje IV za dešifriranje je spodletelo." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Zagon vsebine dešifriranja je spodletel." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Dešifriranje zasebnega ključa je spodletelo: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Dešifriranje zasebnega ključa je spodletelo: dešifrirani podatki so preveliki." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Končanje dešifriranja zasebnega ključa je spodletelo: %d." + +#: ../libnm-util/crypto_nss.c:363 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "Zagon polja cifre šifriranja je spodletel." + +#: ../libnm-util/crypto_nss.c:371 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "Nastavljanje simetričnega ključa za šifriranje je spodletelo." + +#: ../libnm-util/crypto_nss.c:379 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "Nastavljanje IV za šifriranje je spodletelo." + +#: ../libnm-util/crypto_nss.c:387 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "Zaganjanje vsebine šifriranja je spodletelo." + +#: ../libnm-util/crypto_nss.c:395 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "Šifriranje je spodletelo: %d." + +#: ../libnm-util/crypto_nss.c:403 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Nepričakovana količina podatkov po šifriranju." + +#: ../libnm-util/crypto_nss.c:446 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Potrdila ni mogoče dekodirati: %d" + +#: ../libnm-util/crypto_nss.c:481 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Gesla ni mogoče pretvoriti v UCS2: %d" + +#: ../libnm-util/crypto_nss.c:509 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Dekodirnika PKCS#12 ni mogoče zagnati: %d" + +#: ../libnm-util/crypto_nss.c:518 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Datoteke PCKS#12 ni mogoče dekodirati: %d" + +#: ../libnm-util/crypto_nss.c:527 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Datoteke PCKS#12 ni mogoče preveriti: %d" + +#: ../libnm-util/crypto_nss.c:556 +msgid "Could not generate random data." +msgstr "Naključnih podatkov ni mogoče ustvariti." + +#: ../libnm-util/nm-utils.c:1522 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "Ni dovolj pomnilnika za ustvarjanje šifrirnega ključa." + +#: ../libnm-util/nm-utils.c:1633 +msgid "Could not allocate memory for PEM file creation." +msgstr "Ni mogoče dodeliti pomnilnika za ustvarjanje datoteke PEM." + +#: ../libnm-util/nm-utils.c:1645 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Ni mogoče dodeliti pomnilnika za zapis IV v datoteko PEM." + +#: ../libnm-util/nm-utils.c:1657 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Ni mogoče dodeliti pomnilnika za zapis šifriranega ključa v datoteko PEM." + +#: ../libnm-util/nm-utils.c:1676 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "Ni mogoče dodeliti pomnilnika za podatke datoteke PEM." + +#: ../src/nm-netlink-monitor.c:194 +#: ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:569 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "napaka med obdelovanjem sporočila netlink: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +#| msgid "" +#| "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "ni mogoče dodeliti ročice netlink za nadziranje stanja povezave: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +#| msgid "" +#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" +#| "s" +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "ni se mogoče povezati z netlink za nadziranje stanja povezave: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +#| msgid "" +#| "unable to bind to netlink socket for monitoring wired ethernet devices - %" +#| "s" +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "ni se mogoče povezati s skupino netlink za nadziranje stanja povezave: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +#| msgid "" +#| "unable to create netlink socket for monitoring wired ethernet devices - %s" +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "ni mogoče dodeliti predpomnilnika netlink povezav za nadziranje stanja povezave: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "med čakanjem na podatke na vtiču je prišlo do napake" + +#: ../src/nm-netlink-monitor.c:558 +#, c-format +msgid "error updating link cache: %s" +msgstr "napaka med posodabljanjem predpomnilnika povezave: %s" + +#: ../src/NetworkManager.c:330 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Neveljavna možnost. Uporabite --help za seznam veljavnih možnosti.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:304 +msgid "# Created by NetworkManager\n" +msgstr "#Ustvaril upravljalnik omrežij\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:310 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Združeno iz %s\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +msgid "unable to allocate netlink handle: %s" +msgstr "Ročnika netlink ni mogoče dodeliti: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +msgid "unable to connect to netlink: %s" +msgstr "z netlink se ni mogoče povezati: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "skupini netlink se ni mogoče pridružiti: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "OPOMBA: libc razreševalnik morda ne podpira več kot 3 imenske strežnike." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Imenski strežniki našteti spodaj morda ne bodo prepoznani." + +#: ../src/system-settings/nm-default-wired-connection.c:194 +#, c-format +msgid "Auto %s" +msgstr "Samodejno %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:2406 +#| msgid "Open System" +msgid "System" +msgstr "Sistem" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Deljene povezave preko zaščitenega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Deljene povezave preko odprtega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Spremeni trajno sistemsko ime gostitelja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +#| msgid "No active connections!" +msgid "Modify system connections" +msgstr "Spremeni sistemske povezave" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Sistemska določila onemogočajo spreminjanje sistemskih nastavitev" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Sistemska pravila preprečujejo spremembo imena gostitelja trajnega sistema" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "Sistemska pravila preprečujejo deljenje povezav preko zaščitenega WiFi omrežja" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "Sistemska pravila preprečujejo deljenje povezav preko odprtega WiFi omrežja" + +#~ msgid "Passphrase for wireless network %s" +#~ msgstr "Šifrirna fraza za brezžično omrežje %s" +#~ msgid "Connection to the wireless network '%s' failed." +#~ msgstr "Povezava z brezžičnim omrežjem %s ni uspela" +#~ msgid "Connection to the wired network failed." +#~ msgstr "Povezava z žičnim omrežjem ni uspela." +#~ msgid "Error displaying connection information:" +#~ msgstr "Napaka pri prikazovanju informacij o povezavi:" +#~ msgid "Could not find some required resources (the glade file)!" +#~ msgstr "Ni mogoče najti nekaterih zahtevanih virov (datoteke glade)!" +#~ msgid "%d Mb/s" +#~ msgstr "%d Mb/s" +#~ msgid "Wired Ethernet (%s)" +#~ msgstr "Žični eternet (%s)" +#~ msgid "Wireless Ethernet (%s)" +#~ msgstr "Brezžični eternet (%s)" +#~ msgid "Unknown" +#~ msgstr "Neznano" +#~ msgid "NetworkManager Applet" +#~ msgstr "Programček NetworkManager" +#~ msgid "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "" +#~ "Programček za območje obvestil za upravljanje vaših mrežnih naprav in " +#~ "povezav." +#~ msgid "translator-credits" +#~ msgstr "Matic Žgur " +#~ msgid "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgid "VPN Login Failure" +#~ msgstr "Neuspela prijava VPN" +#~ msgid "Could not start the VPN connection '%s' due to a login failure." +#~ msgstr "Ni mogoče začeti povezave VPN '%s' zaradi neuspele prijave." +#~ msgid "VPN Start Failure" +#~ msgstr "Neuspel zagon VPN" +#~ msgid "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." +#~ msgstr "" +#~ "Ni mogoče začeti povezave VPN '%s' zaradi neuspelega zagona programa VPN." +#~ msgid "VPN Connect Failure" +#~ msgstr "Neuspela povezava VPN" +#~ msgid "Could not start the VPN connection '%s' due to a connection error." +#~ msgstr "Ni mogoče začeti povezave VPN '%s' zaradi napake pri povezavi." +#~ msgid "VPN Configuration Error" +#~ msgstr "Napaka nastavitev VPN" +#~ msgid "The VPN connection '%s' was not correctly configured." +#~ msgstr "Povezava VPN '%s' ni pravilno nastavljena." +#~ msgid "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." +#~ msgstr "" +#~ "Ni mogoče začeti povezave VPN '%s', ker strežnik VPN ni vrnil ustreznih " +#~ "nastavitev." +#~ msgid "VPN Login Message" +#~ msgstr "Prijavno sporočilo VPN" +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "Programček NetworkManager ne more najti nekaterih zahtevanih virov " +#~ "(datoteka glade ni bila najdena)." +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "" +#~ "Omrežna naprava \"%s (%s)\" ne podpira skeniranja brezžičnih omrežij." +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "Omrežna naprava \"%s (%s)\" ne podpira odkrivanja povezav." +#~ msgid "(unknown)" +#~ msgstr "(neznano)" +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "Pripravljanje naprave %s na žično omrežje ..." +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "Pripravljanje naprave %s na rezžično omrežje '%s' ..." +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "Nastavljanje naprave %s za žično omrežje ..." +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "Poskus pridruževanja brezžičnemu omrežju '%s' ..." +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "Čakanje na omrežni ključ za brezžično omrežje '%s' ..." +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "Zahtevanje omrežnega naslova iz žičnega omrežja ..." +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "Zahtevanje omrežnega naslova iz brezžičnega omrežja '%s' ..." +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "Zaključevanje povezave v žično omrežje ..." +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "Zaključevanje povezave v brezžično omrežje '%s' ..." +#~ msgid "NetworkManager is not running" +#~ msgstr "NetworkManager ni zagnan" +#~ msgid "Networking disabled" +#~ msgstr "Omrežje onemogočeno" +#~ msgid "No network connection" +#~ msgstr "Nobene omrežne povezave" +#~ msgid "Wired network connection" +#~ msgstr "Žična omrežna povezava" +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Povezan v ad-hoc brezžično omrežje" +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Brezžična omrežna povezava z '%s' (%d%%)" +#~ msgid "VPN connection to '%s'" +#~ msgstr "Povezave VPN z '%s'" +#~ msgid "VPN connecting to '%s'" +#~ msgstr "Povezovanje VPN z '%s'" +#~ msgid "_Connect to Other Wireless Network..." +#~ msgstr "Po_veži se v drugo brezžično omrežje ..." +#~ msgid "Create _New Wireless Network..." +#~ msgstr "_Ustvari novo brezžično omrežje ..." +#~ msgid "_VPN Connections" +#~ msgstr "_Povezave VPN" +#~ msgid "_Configure VPN..." +#~ msgstr "_Nastavi VPN ..." +#~ msgid "_Disconnect VPN..." +#~ msgstr "_Prekini povezavo z VPN ..." +#~ msgid "_Dial Up Connections" +#~ msgstr "_Klicna povezava" +#~ msgid "Connect to %s..." +#~ msgstr "Poveži se v %s ..." +#~ msgid "Disconnect from %s..." +#~ msgstr "Prekini povezavo z %s ..." +#~ msgid "No network devices have been found" +#~ msgstr "Najdena ni bila nobena omrežna naprava" +#~ msgid "NetworkManager is not running..." +#~ msgstr "NetworkManager ni zagnan ..." +#~ msgid "Enable _Networking" +#~ msgstr "Omogoči _omrežje" +#~ msgid "Enable _Wireless" +#~ msgstr "Omogoči _brezžično omrežje" +#~ msgid "Connection _Information" +#~ msgstr "_Informacije o povezavi" +#~ msgid "_Help" +#~ msgstr "_Pomoč" +#~ msgid "_About" +#~ msgstr "_O Programu" +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "Programček NetworkManager ne more najti nekaterih zahtevanih virov. Ni " +#~ "mogoče nadaljevati.\n" +#~ msgid "Shared Key" +#~ msgstr "Deljeni ključ" +#~ msgid "Automatic (Default)" +#~ msgstr "Samodejno (privzeto)" +#~ msgid "AES-CCMP" +#~ msgstr "AES-CCMP" +#~ msgid "TKIP" +#~ msgstr "TKIP" +#~ msgid "Dynamic WEP" +#~ msgstr "Dinamični WEP" +#~ msgid "None" +#~ msgstr "Brez" +#~ msgid "WEP 64/128-bit ASCII" +#~ msgstr "WEP 64/128-bit ASCII" +#~ msgid "WEP 64/128-bit Hex" +#~ msgstr "WEP 64/128-bit Hex" +#~ msgid "WEP 128-bit Passphrase" +#~ msgstr "WEP 128-bit šifrirna fraza" +#~ msgid "PEAP" +#~ msgstr "PEAP" +#~ msgid "TLS" +#~ msgstr "TLS" +#~ msgid "TTLS" +#~ msgstr "TTLS" +#~ msgid "WPA2 Enterprise" +#~ msgstr "Podjetniški WPA2" +#~ msgid "WPA Enterprise" +#~ msgstr "Podjetniški WPA" +#~ msgid "WPA2 Personal" +#~ msgstr "Osebni WPA2" +#~ msgid "WPA Personal" +#~ msgstr "Osebni WPA" +#~ msgid "Orientation" +#~ msgstr "Usmerjenost" +#~ msgid "The orientation of the tray." +#~ msgstr "Usmeritev pladnja." +#~ msgid "Wired Network (%s)" +#~ msgstr "Žično omrežje (%s)" +#~ msgid "_Wired Network" +#~ msgstr "Ž_ično omrežje" +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "Brezžično omrežje (%s)" +#~ msgstr[1] "Brezžični omrežji (%s)" +#~ msgstr[2] "Brezžična omrežja (%s)" +#~ msgstr[3] "Brezžična omrežja (%s)" +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "Brezžično omrežje" +#~ msgstr[1] "Brezžični omrežji" +#~ msgstr[2] "Brezžična omrežja" +#~ msgstr[3] "Brezžična omrežja" +#~ msgid " (invalid Unicode)" +#~ msgstr " (neveljaven Unicode)" +#~ msgid "" +#~ "By default, the wireless network's name is set to your computer's name, %" +#~ "s, with no encryption enabled" +#~ msgstr "" +#~ "Privzeto je ime brezžičnega omrežja nastavljeno na ime vašega " +#~ "računalnika, %s, brez omogočenega šifriranja" +#~ msgid "Create new wireless network" +#~ msgstr "Ustvari novo brezžično omrežje" +#~ msgid "" +#~ "Enter the name and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "" +#~ "Vnesite ime in varnostne nastavitve brezžičnega omrežja, ki ga želite " +#~ "ustvariti." +#~ msgid "Create New Wireless Network" +#~ msgstr "Ustvari novo brezžično omrežje" +#~ msgid "Existing wireless network" +#~ msgstr "Obstoječe brezžično omrežje" +#~ msgid "Enter the name of the wireless network to which you wish to connect." +#~ msgstr "Vnesite ime brezžičnega omrežja, v katerega se želite povezati." +#~ msgid "Connect to Other Wireless Network" +#~ msgstr "Poveži se v drugo brezžično omrežje" +#~ msgid "Error connecting to wireless network" +#~ msgstr "Napaka pri povezovanju z brezžičnim omrežjem" +#~ msgid "" +#~ "The requested wireless network requires security capabilities unsupported " +#~ "by your hardware." +#~ msgstr "" +#~ "Zahtevano brezžično omrežje zahteva varnostne zmožnosti, ki so nepodprte " +#~ "z vašo strojno opremo." +#~ msgid "Cannot start VPN connection '%s'" +#~ msgstr "Ni mogoče začeti povezave VPN '%s'" +#~ msgid "" +#~ "Could not find the authentication dialog for VPN connection type '%s'. " +#~ "Contact your system administrator." +#~ msgstr "" +#~ "Ni mogoče najti pogovornega okna za overitev za povezavo VPN vrste '%s'. " +#~ "Kontaktirajte sistemskega administratorja." +#~ msgid "" +#~ "There was a problem launching the authentication dialog for VPN " +#~ "connection type '%s'. Contact your system administrator." +#~ msgstr "" +#~ "Pri zagonu pogovornega okna za overovitev za povezavo VPN vrste '%s' je " +#~ "prišlo do problema. Kontaktirajte sistemskega administratorja." +#~ msgid " " +#~ msgstr " " +#~ msgid "" +#~ "Active Connection Information" +#~ msgstr "" +#~ "Informacije o aktivni povezavi" +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "Šifrirna fraza, ki jo zahteva " +#~ "brezžično omrežje\n" +#~ "\n" +#~ "Za dostop do brezžičnega omrežja '%s' je zahtevana šifrirna fraza ali " +#~ "šifrirni ključ." +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "Zmanjšana uporabnost omrežja\n" +#~ "\n" +#~ "%s ne bo popolnoma uporaben." +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen to log in to the wireless network '%s'. If you are sure " +#~ "that this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will not require confirmation on subsequent log ins." +#~ msgstr "" +#~ "Potrditev prijave v brezžično " +#~ "omrežje\n" +#~ "\n" +#~ "Izbrali ste prijavo v brezžično omrežje '%s'. Če ste prepričani, da je to " +#~ "brezžično omrežje varno, kliknite potrditveno polje spodaj in " +#~ "NetworkManager ne bo več zahteval potrditve za nadaljnje prijave." +#~ msgid "Anonymous Identity:" +#~ msgstr "Anonimna identiteta:" +#~ msgid "Authentication:" +#~ msgstr "Overovitev:" +#~ msgid "Broadcast Address:" +#~ msgstr "Naslov za razpršeno oddajanje:" +#~ msgid "CA Certificate File:" +#~ msgstr "Datoteka overiteljevega (CA) certifikata:" +#~ msgid "C_onnect" +#~ msgstr "Po_veži se" +#~ msgid "Client Certificate File:" +#~ msgstr "Datoteka odjemalčevega certifikata:" +#~ msgid "Connection Information" +#~ msgstr "Informacije o povezavi" +#~ msgid "Default Route:" +#~ msgstr "Privzeta smer:" +#~ msgid "Destination Address:" +#~ msgstr "Ciljni naslov:" +#~ msgid "Driver:" +#~ msgstr "Gonilnik:" +#~ msgid "EAP Method:" +#~ msgstr "Metoda EAP:" +#~ msgid "Hardware Address:" +#~ msgstr "Naslov strojne opreme:" +#~ msgid "IP Address:" +#~ msgstr "IP naslov:" +#~ msgid "Identity:" +#~ msgstr "Identiteta:" +#~ msgid "Interface:" +#~ msgstr "Vmesnik:" +#~ msgid "Key Type:" +#~ msgstr "Vrsta ključa:" +#~ msgid "Key management:" +#~ msgstr "Upravljanje s ključi:" +#~ msgid "Key:" +#~ msgstr "Ključ:" +#~ msgid "" +#~ "None\n" +#~ "WEP 128-bit Passphrase\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" +#~ msgstr "" +#~ "Brez\n" +#~ "WEP 128-bit šifrirna fraza\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" +#~ msgid "" +#~ "Open System\n" +#~ "Shared Key" +#~ msgstr "" +#~ "Odprti sistem\n" +#~ "Deljeni ključ" +#~ msgid "Other Wireless Network..." +#~ msgstr "Drugo brezžično omrežje ..." +#~ msgid "Passphrase:" +#~ msgstr "Šifrirna fraza:" +#~ msgid "Password:" +#~ msgstr "Geslo:" +#~ msgid "Primary DNS:" +#~ msgstr "Primarni DNS;" +#~ msgid "Private Key File:" +#~ msgstr "Datoteka zasebnega ključa:" +#~ msgid "Private Key Password:" +#~ msgstr "Geslo zasebnega ključa:" +#~ msgid "Secondary DNS:" +#~ msgstr "Sekundarni DNS:" +#~ msgid "Select the CA Certificate File" +#~ msgstr "Izberite datoteko overiteljevega (CA) certifikata" +#~ msgid "Select the Client Certificate File" +#~ msgstr "Izberite datoteko odjemalčevega certifikata" +#~ msgid "Select the Private Key File" +#~ msgstr "Izberite datoteko zasebnega ključa" +#~ msgid "Show key" +#~ msgstr "Pokaži ključ" +#~ msgid "Show passphrase" +#~ msgstr "Pokaži šifrirno frazo" +#~ msgid "Show password" +#~ msgstr "Pokaži geslo" +#~ msgid "Show passwords" +#~ msgstr "Pokaži gesla" +#~ msgid "Speed:" +#~ msgstr "Hitrost:" +#~ msgid "Subnet Mask:" +#~ msgstr "Maska podomrežja:" +#~ msgid "Type:" +#~ msgstr "Vrsta:" +#~ msgid "User Name:" +#~ msgstr "Uporabniško ime:" +#~ msgid "Wireless Network Key Required" +#~ msgstr "Zahtevan ključ brezžičnega omrežja" +#~ msgid "Wireless _adapter:" +#~ msgstr "Brezžični _vmesnik:" +#~ msgid "_Always Trust this Wireless Network" +#~ msgstr "Vedno _zaupaj temu brezžičnemu omrežju" +#~ msgid "_Don't remind me again" +#~ msgstr "_Ne spomni me več" +#~ msgid "_Login to Network" +#~ msgstr "_Prijava v omrežje" +#~ msgid "_Network Name:" +#~ msgstr "_Ime omrežja:" +#~ msgid "_Wireless Security:" +#~ msgstr "_Zaščita omrežja:" +#~ msgid "Cannot add VPN connection" +#~ msgstr "Ni mogoče dodati povezave VPN" +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "" +#~ "Ustrezna programska oprema za VPN ni bila najdena na vašem sistemu. " +#~ "Kontaktirajte vašega sistemskega administratorja." +#~ msgid "Cannot import VPN connection" +#~ msgstr "Ni mogoče uvoziti povezave VPN" +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "Ni mogoče najti ustrezne programske opreme za povezavo VPN vrste '%s' za " +#~ "uvoz datoteke '%s'. Kontaktirajte vašega sistemskega administratorja." +#~ msgid "Error retrieving VPN connection '%s'" +#~ msgstr "Napaka pri pridobivanju povezave VPN '%s'" +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "" +#~ "Ni mogoče najti datotek uporabniškega vmesnika za povezavo VPN vrste \"%s" +#~ "\". Kontaktirajte vašega sistemskega administratorja." +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "Ali želite izbrisati povezavo VPN \"%s\"?" +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "Vse informacije o povezavi VPN \"%s\" bodo izgubljene in mogoče boste " +#~ "potrebovali vašega sistemskega administratorja, da vam priskrbi " +#~ "informacije za ustvarjanje nove povezave." +#~ msgid "Unable to load" +#~ msgstr "Ni mogoče naložiti" +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "Ni mogoče najti nekaterih potrebnih virov (datoteke glade)!" +#~ msgid "Create VPN Connection" +#~ msgstr "Ustvari povezavo VPN" +#~ msgid "Edit VPN Connection" +#~ msgstr "Uredi povezavo VPN" +#~ msgid "Add a new VPN connection" +#~ msgstr "Dodaj novo povezavo VPN" +#~ msgid "Delete the selected VPN connection" +#~ msgstr "Izbriši izbrano povezavo VPN" +#~ msgid "E_xport" +#~ msgstr "I_zvozi" +#~ msgid "Edit the selected VPN connection" +#~ msgstr "Uredi izbrano povezavo VPN" +#~ msgid "Export the VPN settings to a file" +#~ msgstr "Izvozi nastavitve VPN v datoteko" +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "Izvozi izbrano povezavo VPN v datoteko" +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "Upravljanje povezav navideznega zasebnega omrežja (VPN)" +#~ msgid "VPN Connections" +#~ msgstr "Povezave VPN" +#~ msgid "40-bit WEP" +#~ msgstr "40-bitni WEP" +#~ msgid "104-bit WEP" +#~ msgstr "104-bitni WEP" +#~ msgid "WPA TKIP" +#~ msgstr "WPA TKIP" +#~ msgid "WPA CCMP" +#~ msgstr "WPA CCMP" +#~ msgid "WPA Automatic" +#~ msgstr "Samodejni WPA" +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" +#~ msgid "WPA2 Automatic" +#~ msgstr "Samodejni WPA2" +#~ msgid "none" +#~ msgstr "brez" +#~ msgid "operation took too long" +#~ msgstr "operacija je trajala predolgo" +#~ msgid "received data from wrong type of sender" +#~ msgstr "prejeti podatki od pošiljatelja napačne vrste" +#~ msgid "received data from unexpected sender" +#~ msgstr "prejeti podatki od nepričakovanega pošiljatelja" +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "" +#~ "preveč podatkov je bilo poslano preko vtiča in nekaj se jih je izgubilo" +#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." +#~ msgstr "Zdaj ste povezani v ad-hoc brezžično omrežje '%s'." +#~ msgid "You are now connected to the wireless network '%s'." +#~ msgstr "Zdaj ste povezani z brezžičnim omrežjem '%s'." +#~ msgid "You are now connected to the wired network." +#~ msgstr "Zdaj ste povezani z žičnim omrežjem." +#~ msgid "Connection Established" +#~ msgstr "Povezava vzpostavljena" +#~ msgid "Disconnected" +#~ msgstr "Prekinjena povezava" +#~ msgid "The network connection has been disconnected." +#~ msgstr "Omrežna povezava je bila prekinjena." +#~ msgid "LEAP" +#~ msgstr "LEAP" + diff --git a/po/sq.po b/po/sq.po new file mode 100644 index 00000000..b425d1e3 --- /dev/null +++ b/po/sq.po @@ -0,0 +1,184 @@ +# Përkthimi i mesazheve të NetworkManager në shqip +# This file is distributed under the same license as the NetworkManager package. +# Copyright (C) 2004 Free Software Foundation, Inc. +# Laurent Dhima , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-10-19 13:38-0400\n" +"PO-Revision-Date: 2004-09-15 11:49+0200\n" +"Last-Translator: Laurent Dhima \n" +"Language-Team: Albanian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: info-daemon/networks.glade:11 +msgid "Modify Wireless Networks" +msgstr "Ndrysho Rrjetet Wireless" + +#: info-daemon/networks.glade:92 +msgid "Wireless Networks:" +msgstr "Rrjete Wireless:" + +#: info-daemon/passphrase.glade:9 +msgid "Wireless Network Key Required" +msgstr "Nevoitet Kyçi i Rrjetit Wireless" + +#: info-daemon/passphrase.glade:52 +msgid "_Login to Network" +msgstr "_Identifikohu në Rrjet" + +#: info-daemon/passphrase.glade:100 +#, fuzzy +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Fjalëkalimi kërkohet nga Rrjeti " +"Wirelessi\n" +"\n" +"Për t'u futur në rrjetin wireless '%s' kërkohet fjalëkalimi ose një kyç WEP." + +#: info-daemon/passphrase.glade:129 +msgid "Key Type:" +msgstr "" + +#: info-daemon/passphrase.glade:150 +msgid "" +"128-bit Passphrase\n" +"128-bit Raw Hex Key" +msgstr "" + +#: info-daemon/passphrase.glade:180 +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:101 +msgid "Passphrase:" +msgstr "Fjalëkalimi:" + +#: info-daemon/passphrase.glade:208 panel-applet/essid.glade:162 +msgid "*" +msgstr "*" + +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:104 +msgid "Key:" +msgstr "" + +#. Reuse the above string to make the translators less angry. +#: panel-applet/NMWirelessApplet.c:691 panel-applet/NMWirelessApplet.c:701 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"Instrumenti NetworkManager nuk arrin të gjejë disa burime të nevojshme (file " +"glade nuk u gjet)." + +#: panel-applet/NMWirelessApplet.c:716 +#, fuzzy +msgid "Custom wireless network" +msgstr "Ndrysho Rrjetet Wireless" + +#: panel-applet/NMWirelessApplet.c:717 +msgid "Enter the ESSID of the wireless network to which you wish to connect." +msgstr "" + +#: panel-applet/NMWirelessApplet.c:800 +#, fuzzy +msgid "Other Wireless Networks..." +msgstr "Rrjete të tjerë Wireless..." + +#: panel-applet/NMWirelessApplet.c:911 +msgid "No network devices have been found" +msgstr "" + +#: panel-applet/NMWirelessApplet.c:1028 +msgid "NetworkManager is not running..." +msgstr "NetworkManager nuk është duke punuar..." + +#: panel-applet/essid.glade:52 +msgid "C_onnect" +msgstr "" + +#: panel-applet/essid.glade:131 +#, fuzzy +msgid "Wireless _Network:" +msgstr "Ndrysho Rrjetet Wireless" + +#: panel-applet/essid.glade:177 +msgid "Wireless _adapter:" +msgstr "" + +#: panel-applet/menu-info.c:101 +#, fuzzy, c-format +msgid "Wired Network (%s)" +msgstr "Ndrysho Rrjetet Wireless" + +#: panel-applet/menu-info.c:103 +#, fuzzy +msgid "Wired Network" +msgstr "Ndrysho Rrjetet Wireless" + +#: panel-applet/menu-info.c:168 +#, fuzzy, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Ndrysho Rrjetet Wireless" +msgstr[1] "Ndrysho Rrjetet Wireless" + +#: panel-applet/menu-info.c:170 +#, fuzzy +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Ndrysho Rrjetet Wireless" +msgstr[1] "Ndrysho Rrjetet Wireless" + +#: panel-applet/menu-info.c:307 +msgid " (invalid Unicode)" +msgstr "" + +#: examples/python/systray/eggtrayicon.c:111 +msgid "Orientation" +msgstr "" + +#: examples/python/systray/eggtrayicon.c:112 +msgid "The orientation of the tray." +msgstr "" + +#~ msgid "There are no wireless networks..." +#~ msgstr "Nuk ekziston asnjë rrjet wireless..." + +#~ msgid "There are no network devices..." +#~ msgstr "Nuk ekziston asnjë dispozitiv rrjeti..." + +#~ msgid "Network Connections" +#~ msgstr "Lidhjet e rrjetit" + +#~ msgid "_About..." +#~ msgstr "_Informacione..." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen log in to the wireless network '%s'. If you are sure " +#~ "this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will no longer pester you with stupid questions when you " +#~ "connect to it." +#~ msgstr "" +#~ "Konfirmimi i futjes në Rrjetin " +#~ "Wireless\n" +#~ "\n" +#~ "Jeni duke u futur në rrjetin wireless '%s'. Nëse jeni i sigurt që ky " +#~ "rrjet pa fije është i sigurt, kliko tek kutia zgjedhëse e mëposhtme dhe " +#~ "NetworkManager nuk do t'ju bezdisë më me pyetje të kota në momentin që do " +#~ "të dëshironi të lidheni me të." + +#~ msgid "Always Trust this Wireless Network" +#~ msgstr "Ky rrjet wireless është gjithmonë i besueshëm" diff --git a/po/sr.po b/po/sr.po new file mode 100644 index 00000000..e04c0164 --- /dev/null +++ b/po/sr.po @@ -0,0 +1,437 @@ +# Serbian Cyrillic and Latin translations for NetworkManager +# Copyright (C) 2004-2005 GNOME Foundation +# This file is distributed under the same licence as the NetworkManager package. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-05-13 16:11-0400\n" +"PO-Revision-Date: 2006-06-02 20:40+0200\n" +"Last-Translator: Filip Miletic \n" +"Language-Team: Serbian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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" + +#: examples/python/systray/eggtrayicon.c:111 gnome/applet/eggtrayicon.c:118 +msgid "Orientation" +msgstr "Усмерење" + +# Потребан је бољи превод за ово +#: examples/python/systray/eggtrayicon.c:112 gnome/applet/eggtrayicon.c:119 +msgid "The orientation of the tray." +msgstr "Усмерење обавештајне зоне." + +#: gnome/applet/applet-dbus-info.c:852 +#, c-format +msgid "" +"The requested wireless network '%s' does not appear to be in range. A " +"different wireless network will be used if any are available." +msgstr "Тражена бежична мрежа „%s“ није у домету. Биће коришћена друга бежична мрежа ако је расположива." + +#: gnome/applet/applet-dbus.c:573 +#, c-format +msgid "Connection to the wireless network '%s' failed.\n" +msgstr "Неуспела веза са бежичном мрежом „%s“.\n" + +#: gnome/applet/applet-dbus.c:578 +msgid "Connection to the wired network failed.\n" +msgstr "Неуспела веза са жичаном мрежом.\n" + +#: gnome/applet/applet.c:194 gnome/applet/applet.c:212 +msgid "NetworkManager Applet" +msgstr "Аплет Управник мреже" + +#: gnome/applet/applet.c:196 gnome/applet/applet.c:214 +msgid "Copyright (C) 2004-2005 Red Hat, Inc." +msgstr "Copyright (C) 2004-2005 Red Hat, Inc." + +#: gnome/applet/applet.c:197 gnome/applet/applet.c:215 +msgid "" +"Notification area applet for managing your network devices and connections." +msgstr "Аплет за обавештајну зону за управљање мрежним уређајима и везама." + +#: gnome/applet/applet.c:280 +#, c-format +msgid "" +"VPN Login Failure\n" +"\n" +"Could not start the VPN connection '%s' due to a login failure.\n" +"\n" +"The VPN service said: \"%s\"" +msgstr "" +"Пријава на VPN није успела\n" +"\n" +"VPN веза са мрежом „%s“ није остварена јер пријава није успела.\n" +"\n" +"Порука VPN сервиса је била : „%s“" + +#: gnome/applet/applet.c:341 +#, c-format +msgid "" +"VPN Login Message\n" +"\n" +"VPN connection '%s' said:\n" +"\n" +"\"%s\"" +msgstr "" +"Порука при пријави на VPN\n" +"\n" +"Порука VPN везе „%s“ је:\n" +"\n" +"„%s“" + +#: gnome/applet/applet.c:559 gnome/applet/applet.c:1922 +#: gnome/applet/other-network-dialog.c:315 +#: gnome/applet/passphrase-dialog.c:430 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "Аплет Управник мреже није могао да пронађе неке од потребних ресурса (глејд датотека није пронађена)." + +#: gnome/applet/applet.c:572 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "Мрежни уређај „%s (%s)“ не подржава потрагу за бежичним мрежама." + +#: gnome/applet/applet.c:579 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "Мрежни уређај „%s (%s)“ не подржава откривање везе." + +#: gnome/applet/applet.c:700 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "Припрема уређаја %s за жичану мрежу..." + +#: gnome/applet/applet.c:702 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "Припрема уређаја %s за бежичну мрежу „%s“..." + +#: gnome/applet/applet.c:709 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "Подешавање уређаја %s за бежичну мрежу..." + +#: gnome/applet/applet.c:711 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "Покушај приступа бежичној мрежи „%s“..." + +#: gnome/applet/applet.c:718 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "Чекање на мрежни кључ за бежичну мрежу „%s“..." + +#: gnome/applet/applet.c:725 gnome/applet/applet.c:734 +msgid "Requesting a network address from the wired network..." +msgstr "Потраживање мрежне адресе за жичану мрежу..." + +#: gnome/applet/applet.c:727 gnome/applet/applet.c:736 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "Потраживање мрежне адресе за бежичну мрежу „%s“..." + +#: gnome/applet/applet.c:743 +msgid "Finishing connection to the wired network..." +msgstr "Обустављање везе са жичаном мрежом..." + +#: gnome/applet/applet.c:745 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "Обустављање везе са бежичном мрежом „%s“..." + +#: gnome/applet/applet.c:791 +msgid "NetworkManager is not running" +msgstr "Управљач мреже није покренут" + +#: gnome/applet/applet.c:802 +msgid "No network connection" +msgstr "Нема мрежних веза" + +#: gnome/applet/applet.c:809 +msgid "Wired network connection" +msgstr "Жична мрежна веза" + +# FIXME Ад-хок +#: gnome/applet/applet.c:816 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "Повезан са ад-хок бежичном мрежом" + +#: gnome/applet/applet.c:830 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "Бежична мрежна веза са „%s“ (%d%%)" + +#: gnome/applet/applet.c:1181 +msgid "Other Wireless Networks..." +msgstr "Остале бежичне мреже..." + +#: gnome/applet/applet.c:1202 +msgid "Create new Wireless Network..." +msgstr "Направи нову бежичну мрежу..." + +#: gnome/applet/applet.c:1315 +msgid "VPN Connections" +msgstr "VPN везе" + +#: gnome/applet/applet.c:1337 +msgid "Disconnect VPN..." +msgstr "Искључи VPN..." + +#: gnome/applet/applet.c:1366 +msgid "No network devices have been found" +msgstr "Није пронађен ниједан мрежни уређај" + +#: gnome/applet/applet.c:1529 +msgid "NetworkManager is not running..." +msgstr "Управљач мрежом није покренут..." + +#: gnome/applet/applet.c:1599 gnome/applet/applet.c:1647 +msgid "Pause Wireless Scanning" +msgstr "Обустави тражење бежичне мреже" + +#: gnome/applet/applet.c:1604 +msgid "Resume Wireless Scanning" +msgstr "Настави тражење бежичне мреже" + +#: gnome/applet/applet.c:1614 gnome/applet/applet.c:1653 +msgid "Stop All Wireless Devices" +msgstr "Заустави све бежичне уређаје" + +#: gnome/applet/applet.c:1619 +msgid "Start All Wireless Devices" +msgstr "Покрени све бежичне уређаје" + +#: gnome/applet/applet.c:1662 +msgid "Help" +msgstr "Помоћ" + +#: gnome/applet/applet.c:1669 +msgid "About" +msgstr "О програму" + +#: gnome/applet/applet.c:2070 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "Управљач мрежом није успео да пронађе неопходне ресурсе и не може да настави рад.\n" + +#: gnome/applet/gtkcellrendererprogress.c:243 +#: gnome/applet/gtkcellrendererprogress.c:301 +#, c-format +msgid "progress bar label|%d %%" +msgstr "%d %%" + +#: gnome/applet/menu-items.c:91 +#, c-format +msgid "Wired Network (%s)" +msgstr "Жичана мрежа (%s)" + +#: gnome/applet/menu-items.c:93 +msgid "Wired Network" +msgstr "Жичана мрежа" + +#: gnome/applet/menu-items.c:166 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Бежична мрежа (%s)" +msgstr[1] "Бежичне мреже (%s)" +msgstr[2] "Бежичних мрежа (%s)" + +#: gnome/applet/menu-items.c:168 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Бежична мрежа" +msgstr[1] "Бежичне мреже" +msgstr[2] "Бежичне мреже" + +#: gnome/applet/menu-items.c:294 +msgid " (invalid Unicode)" +msgstr " (неисправан Уникод)" + +#: gnome/applet/other-network-dialog.c:148 +#: gnome/applet/passphrase-dialog.c:164 +#: gnome/applet/applet.glade.h:27 +msgid "Passphrase:" +msgstr "Лозинка:" + +#: gnome/applet/other-network-dialog.c:151 +#: gnome/applet/passphrase-dialog.c:167 +msgid "Ascii Key:" +msgstr "АСКРИ кључ:" + +#: gnome/applet/other-network-dialog.c:154 +#: gnome/applet/passphrase-dialog.c:170 +msgid "Hex Key:" +msgstr "Хекса кључ:" + +#: gnome/applet/other-network-dialog.c:229 +msgid "Create new wireless network" +msgstr "Направи нову бежичну мрежу" + +#: gnome/applet/other-network-dialog.c:230 +msgid "" +"Enter the ESSID and security settings of the wireless network you wish to " +"create." +msgstr "Унесите ESSID и безбедносне поставке бежичне мреже коју желите да начините." + +#: gnome/applet/other-network-dialog.c:235 +msgid "Custom wireless network" +msgstr "Корисничка бежична мрежа" + +#: gnome/applet/other-network-dialog.c:236 +msgid "Enter the ESSID of the wireless network to which you wish to connect." +msgstr "Унесите ESSID бежичне мреже са којом желите да се повежете." + +#: gnome/applet/vpn-password-dialog.c:105 +#, c-format +msgid "You must log in to access the Virtual Private Network '%s'." +msgstr "Морате бити пријављени како бисте користили виртуелну приватну мрежу „%s“." + +#: gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: gnome/applet/applet.glade.h:2 +msgid "*" +msgstr "*" + +#: gnome/applet/applet.glade.h:3 +msgid "" +"128-bit Passphrase (WEP)\n" +"Ascii Key (WEP)\n" +"Hex Key (WEP)" +msgstr "" +"128-битни кључ (WEP)\n" +"АСКРИ кључ (WEP)\n" +"Хекс кључ (WEP)" + +#: gnome/applet/applet.glade.h:6 +msgid "" +"128-bit passphrase (WEP)\n" +"Ascii key (WEP)\n" +"Hex key (WEP)" +msgstr "" +"128-битни кључ (WEP)\n" +"АСКРИ кључ (WEP)\n" +"Хекс кључ (WEP)" + +#: gnome/applet/applet.glade.h:10 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Бежична мрежа захтева лозинку\n" +"\n" +" Лозинка или кључ за шифровање су неопходни за приступ бежичној мрежи „%s“." + +#: gnome/applet/applet.glade.h:14 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" +"Смањена употребна вредност мреже\n" +"\n" +"%s неће бити сасвим употребљива." + +#: gnome/applet/applet.glade.h:18 +#, no-c-format +msgid "" +"Wireless Network Login Confirmation\n" +"\n" +"You have chosen log in to the wireless network '%s'. If you are sure this " +"wireless network is secure, click the checkbox below and NetworkManager will " +"no longer pester you with stupid questions when you connect to it." +msgstr "" +"Потврда пријаве на мрежу\n" +"\n" +"Желите да се пријавите на мрежу „%s“. Ако сте сигурни да је ова бежична мрежа безбедна, обележите кућицу испод и Управник мреже вам више неће постављати сувишна питања при пријави на ову мрежу." + +#: gnome/applet/applet.glade.h:21 +msgid "Always Trust this Wireless Network" +msgstr "Увек поклони поверење бежичној мрежи" + +#: gnome/applet/applet.glade.h:22 +msgid "C_onnect" +msgstr "П_овежи се" + +#: gnome/applet/applet.glade.h:23 +msgid "Connect with encryption enabled" +msgstr "Повежи се и укључи шифровање" + +#: gnome/applet/applet.glade.h:24 +msgid "Don't remind me again" +msgstr "Не подсећај ме више" + +#: gnome/applet/applet.glade.h:25 +msgid "Key Type:" +msgstr "Врста кључа:" + +#: gnome/applet/applet.glade.h:26 +msgid "Key type:" +msgstr "Врста кључа:" + +#: gnome/applet/applet.glade.h:28 +msgid "Wireless Network Key Required" +msgstr "Потребан је кључ за бежичну мрежу" + +#: gnome/applet/applet.glade.h:29 +msgid "Wireless _adapter:" +msgstr "Бежични _уређај:" + +#: gnome/applet/applet.glade.h:30 +msgid "Wireless _network:" +msgstr "Бежична _мрежа:" + +#: gnome/applet/applet.glade.h:31 +msgid "_Login to Network" +msgstr "_Умрежи се" + +#: gnome/applet/applet.glade.h:32 +msgid "_OK" +msgstr "_У реду" + +#: src/nm-netlink-monitor.c:154 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "Није могуће направити утичницу за посматрање жичаног мрежног уређаја - %s" + +#: src/nm-netlink-monitor.c:172 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "Није могуће повезати се на утичницу за посматрање жичаног мрежног уређаја - %s" + +#: src/nm-netlink-monitor.c:404 +msgid "operation took too long" +msgstr "Потрага је предуго трајала" + +#: src/nm-netlink-monitor.c:501 +msgid "received data from wrong type of sender" +msgstr "Примљени су подаци погрешног типа од пошиљаоца" + +#: src/nm-netlink-monitor.c:514 +msgid "received data from unexpected sender" +msgstr "Примљени су подаци од неочекиваног пошиљаоца" + +#: src/nm-netlink-monitor.c:536 +#, c-format +msgid "%s" +msgstr "%s" + +#: src/nm-netlink-monitor.c:645 +msgid "too much data was sent over socket and some of it was lost" +msgstr "Сувише података је послато кроз утичницу и нешто од њих је изгубљено" diff --git a/po/sr@latin.po b/po/sr@latin.po new file mode 100644 index 00000000..4904cecd --- /dev/null +++ b/po/sr@latin.po @@ -0,0 +1,437 @@ +# Serbian Cyrillic and Latin translations for NetworkManager +# Copyright (C) 2004-2005 GNOME Foundation +# This file is distributed under the same licence as the NetworkManager package. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-05-13 16:11-0400\n" +"PO-Revision-Date: 2006-06-02 20:40+0200\n" +"Last-Translator: Filip Miletic \n" +"Language-Team: Serbian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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" + +#: examples/python/systray/eggtrayicon.c:111 gnome/applet/eggtrayicon.c:118 +msgid "Orientation" +msgstr "Usmerenje" + +# Potreban je bolji prevod za ovo +#: examples/python/systray/eggtrayicon.c:112 gnome/applet/eggtrayicon.c:119 +msgid "The orientation of the tray." +msgstr "Usmerenje obaveštajne zone." + +#: gnome/applet/applet-dbus-info.c:852 +#, c-format +msgid "" +"The requested wireless network '%s' does not appear to be in range. A " +"different wireless network will be used if any are available." +msgstr "Tražena bežična mreža „%s“ nije u dometu. Biće korišćena druga bežična mreža ako je raspoloživa." + +#: gnome/applet/applet-dbus.c:573 +#, c-format +msgid "Connection to the wireless network '%s' failed.\n" +msgstr "Neuspela veza sa bežičnom mrežom „%s“.\n" + +#: gnome/applet/applet-dbus.c:578 +msgid "Connection to the wired network failed.\n" +msgstr "Neuspela veza sa žičanom mrežom.\n" + +#: gnome/applet/applet.c:194 gnome/applet/applet.c:212 +msgid "NetworkManager Applet" +msgstr "Aplet Upravnik mreže" + +#: gnome/applet/applet.c:196 gnome/applet/applet.c:214 +msgid "Copyright (C) 2004-2005 Red Hat, Inc." +msgstr "Copyright (C) 2004-2005 Red Hat, Inc." + +#: gnome/applet/applet.c:197 gnome/applet/applet.c:215 +msgid "" +"Notification area applet for managing your network devices and connections." +msgstr "Aplet za obaveštajnu zonu za upravljanje mrežnim uređajima i vezama." + +#: gnome/applet/applet.c:280 +#, c-format +msgid "" +"VPN Login Failure\n" +"\n" +"Could not start the VPN connection '%s' due to a login failure.\n" +"\n" +"The VPN service said: \"%s\"" +msgstr "" +"Prijava na VPN nije uspela\n" +"\n" +"VPN veza sa mrežom „%s“ nije ostvarena jer prijava nije uspela.\n" +"\n" +"Poruka VPN servisa je bila : „%s“" + +#: gnome/applet/applet.c:341 +#, c-format +msgid "" +"VPN Login Message\n" +"\n" +"VPN connection '%s' said:\n" +"\n" +"\"%s\"" +msgstr "" +"Poruka pri prijavi na VPN\n" +"\n" +"Poruka VPN veze „%s“ je:\n" +"\n" +"„%s“" + +#: gnome/applet/applet.c:559 gnome/applet/applet.c:1922 +#: gnome/applet/other-network-dialog.c:315 +#: gnome/applet/passphrase-dialog.c:430 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "Aplet Upravnik mreže nije mogao da pronađe neke od potrebnih resursa (glejd datoteka nije pronađena)." + +#: gnome/applet/applet.c:572 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "Mrežni uređaj „%s (%s)“ ne podržava potragu za bežičnim mrežama." + +#: gnome/applet/applet.c:579 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "Mrežni uređaj „%s (%s)“ ne podržava otkrivanje veze." + +#: gnome/applet/applet.c:700 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "Priprema uređaja %s za žičanu mrežu..." + +#: gnome/applet/applet.c:702 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "Priprema uređaja %s za bežičnu mrežu „%s“..." + +#: gnome/applet/applet.c:709 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "Podešavanje uređaja %s za bežičnu mrežu..." + +#: gnome/applet/applet.c:711 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "Pokušaj pristupa bežičnoj mreži „%s“..." + +#: gnome/applet/applet.c:718 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "Čekanje na mrežni ključ za bežičnu mrežu „%s“..." + +#: gnome/applet/applet.c:725 gnome/applet/applet.c:734 +msgid "Requesting a network address from the wired network..." +msgstr "Potraživanje mrežne adrese za žičanu mrežu..." + +#: gnome/applet/applet.c:727 gnome/applet/applet.c:736 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "Potraživanje mrežne adrese za bežičnu mrežu „%s“..." + +#: gnome/applet/applet.c:743 +msgid "Finishing connection to the wired network..." +msgstr "Obustavljanje veze sa žičanom mrežom..." + +#: gnome/applet/applet.c:745 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "Obustavljanje veze sa bežičnom mrežom „%s“..." + +#: gnome/applet/applet.c:791 +msgid "NetworkManager is not running" +msgstr "Upravljač mreže nije pokrenut" + +#: gnome/applet/applet.c:802 +msgid "No network connection" +msgstr "Nema mrežnih veza" + +#: gnome/applet/applet.c:809 +msgid "Wired network connection" +msgstr "Žična mrežna veza" + +# FIXME Ad-hok +#: gnome/applet/applet.c:816 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "Povezan sa ad-hok bežičnom mrežom" + +#: gnome/applet/applet.c:830 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "Bežična mrežna veza sa „%s“ (%d%%)" + +#: gnome/applet/applet.c:1181 +msgid "Other Wireless Networks..." +msgstr "Ostale bežične mreže..." + +#: gnome/applet/applet.c:1202 +msgid "Create new Wireless Network..." +msgstr "Napravi novu bežičnu mrežu..." + +#: gnome/applet/applet.c:1315 +msgid "VPN Connections" +msgstr "VPN veze" + +#: gnome/applet/applet.c:1337 +msgid "Disconnect VPN..." +msgstr "Isključi VPN..." + +#: gnome/applet/applet.c:1366 +msgid "No network devices have been found" +msgstr "Nije pronađen nijedan mrežni uređaj" + +#: gnome/applet/applet.c:1529 +msgid "NetworkManager is not running..." +msgstr "Upravljač mrežom nije pokrenut..." + +#: gnome/applet/applet.c:1599 gnome/applet/applet.c:1647 +msgid "Pause Wireless Scanning" +msgstr "Obustavi traženje bežične mreže" + +#: gnome/applet/applet.c:1604 +msgid "Resume Wireless Scanning" +msgstr "Nastavi traženje bežične mreže" + +#: gnome/applet/applet.c:1614 gnome/applet/applet.c:1653 +msgid "Stop All Wireless Devices" +msgstr "Zaustavi sve bežične uređaje" + +#: gnome/applet/applet.c:1619 +msgid "Start All Wireless Devices" +msgstr "Pokreni sve bežične uređaje" + +#: gnome/applet/applet.c:1662 +msgid "Help" +msgstr "Pomoć" + +#: gnome/applet/applet.c:1669 +msgid "About" +msgstr "O programu" + +#: gnome/applet/applet.c:2070 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "Upravljač mrežom nije uspeo da pronađe neophodne resurse i ne može da nastavi rad.\n" + +#: gnome/applet/gtkcellrendererprogress.c:243 +#: gnome/applet/gtkcellrendererprogress.c:301 +#, c-format +msgid "progress bar label|%d %%" +msgstr "%d %%" + +#: gnome/applet/menu-items.c:91 +#, c-format +msgid "Wired Network (%s)" +msgstr "Žičana mreža (%s)" + +#: gnome/applet/menu-items.c:93 +msgid "Wired Network" +msgstr "Žičana mreža" + +#: gnome/applet/menu-items.c:166 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Bežična mreža (%s)" +msgstr[1] "Bežične mreže (%s)" +msgstr[2] "Bežičnih mreža (%s)" + +#: gnome/applet/menu-items.c:168 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Bežična mreža" +msgstr[1] "Bežične mreže" +msgstr[2] "Bežične mreže" + +#: gnome/applet/menu-items.c:294 +msgid " (invalid Unicode)" +msgstr " (neispravan Unikod)" + +#: gnome/applet/other-network-dialog.c:148 +#: gnome/applet/passphrase-dialog.c:164 +#: gnome/applet/applet.glade.h:27 +msgid "Passphrase:" +msgstr "Lozinka:" + +#: gnome/applet/other-network-dialog.c:151 +#: gnome/applet/passphrase-dialog.c:167 +msgid "Ascii Key:" +msgstr "ASKRI ključ:" + +#: gnome/applet/other-network-dialog.c:154 +#: gnome/applet/passphrase-dialog.c:170 +msgid "Hex Key:" +msgstr "Heksa ključ:" + +#: gnome/applet/other-network-dialog.c:229 +msgid "Create new wireless network" +msgstr "Napravi novu bežičnu mrežu" + +#: gnome/applet/other-network-dialog.c:230 +msgid "" +"Enter the ESSID and security settings of the wireless network you wish to " +"create." +msgstr "Unesite ESSID i bezbednosne postavke bežične mreže koju želite da načinite." + +#: gnome/applet/other-network-dialog.c:235 +msgid "Custom wireless network" +msgstr "Korisnička bežična mreža" + +#: gnome/applet/other-network-dialog.c:236 +msgid "Enter the ESSID of the wireless network to which you wish to connect." +msgstr "Unesite ESSID bežične mreže sa kojom želite da se povežete." + +#: gnome/applet/vpn-password-dialog.c:105 +#, c-format +msgid "You must log in to access the Virtual Private Network '%s'." +msgstr "Morate biti prijavljeni kako biste koristili virtuelnu privatnu mrežu „%s“." + +#: gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: gnome/applet/applet.glade.h:2 +msgid "*" +msgstr "*" + +#: gnome/applet/applet.glade.h:3 +msgid "" +"128-bit Passphrase (WEP)\n" +"Ascii Key (WEP)\n" +"Hex Key (WEP)" +msgstr "" +"128-bitni ključ (WEP)\n" +"ASKRI ključ (WEP)\n" +"Heks ključ (WEP)" + +#: gnome/applet/applet.glade.h:6 +msgid "" +"128-bit passphrase (WEP)\n" +"Ascii key (WEP)\n" +"Hex key (WEP)" +msgstr "" +"128-bitni ključ (WEP)\n" +"ASKRI ključ (WEP)\n" +"Heks ključ (WEP)" + +#: gnome/applet/applet.glade.h:10 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Bežična mreža zahteva lozinku\n" +"\n" +" Lozinka ili ključ za šifrovanje su neophodni za pristup bežičnoj mreži „%s“." + +#: gnome/applet/applet.glade.h:14 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" +"Smanjena upotrebna vrednost mreže\n" +"\n" +"%s neće biti sasvim upotrebljiva." + +#: gnome/applet/applet.glade.h:18 +#, no-c-format +msgid "" +"Wireless Network Login Confirmation\n" +"\n" +"You have chosen log in to the wireless network '%s'. If you are sure this " +"wireless network is secure, click the checkbox below and NetworkManager will " +"no longer pester you with stupid questions when you connect to it." +msgstr "" +"Potvrda prijave na mrežu\n" +"\n" +"Želite da se prijavite na mrežu „%s“. Ako ste sigurni da je ova bežična mreža bezbedna, obeležite kućicu ispod i Upravnik mreže vam više neće postavljati suvišna pitanja pri prijavi na ovu mrežu." + +#: gnome/applet/applet.glade.h:21 +msgid "Always Trust this Wireless Network" +msgstr "Uvek pokloni poverenje bežičnoj mreži" + +#: gnome/applet/applet.glade.h:22 +msgid "C_onnect" +msgstr "P_oveži se" + +#: gnome/applet/applet.glade.h:23 +msgid "Connect with encryption enabled" +msgstr "Poveži se i uključi šifrovanje" + +#: gnome/applet/applet.glade.h:24 +msgid "Don't remind me again" +msgstr "Ne podsećaj me više" + +#: gnome/applet/applet.glade.h:25 +msgid "Key Type:" +msgstr "Vrsta ključa:" + +#: gnome/applet/applet.glade.h:26 +msgid "Key type:" +msgstr "Vrsta ključa:" + +#: gnome/applet/applet.glade.h:28 +msgid "Wireless Network Key Required" +msgstr "Potreban je ključ za bežičnu mrežu" + +#: gnome/applet/applet.glade.h:29 +msgid "Wireless _adapter:" +msgstr "Bežični _uređaj:" + +#: gnome/applet/applet.glade.h:30 +msgid "Wireless _network:" +msgstr "Bežična _mreža:" + +#: gnome/applet/applet.glade.h:31 +msgid "_Login to Network" +msgstr "_Umreži se" + +#: gnome/applet/applet.glade.h:32 +msgid "_OK" +msgstr "_U redu" + +#: src/nm-netlink-monitor.c:154 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "Nije moguće napraviti utičnicu za posmatranje žičanog mrežnog uređaja - %s" + +#: src/nm-netlink-monitor.c:172 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "Nije moguće povezati se na utičnicu za posmatranje žičanog mrežnog uređaja - %s" + +#: src/nm-netlink-monitor.c:404 +msgid "operation took too long" +msgstr "Potraga je predugo trajala" + +#: src/nm-netlink-monitor.c:501 +msgid "received data from wrong type of sender" +msgstr "Primljeni su podaci pogrešnog tipa od pošiljaoca" + +#: src/nm-netlink-monitor.c:514 +msgid "received data from unexpected sender" +msgstr "Primljeni su podaci od neočekivanog pošiljaoca" + +#: src/nm-netlink-monitor.c:536 +#, c-format +msgid "%s" +msgstr "%s" + +#: src/nm-netlink-monitor.c:645 +msgid "too much data was sent over socket and some of it was lost" +msgstr "Suviše podataka je poslato kroz utičnicu i nešto od njih je izgubljeno" diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 00000000..d9d9147a --- /dev/null +++ b/po/sv.po @@ -0,0 +1,1602 @@ +# Swedish messages for NetworkManager. +# Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. +# Christian Rose , 2004, 2005, 2006. +# Daniel Nylander , 2006, 2008, 2009, 2010. +# +# $Id: sv.po,v 1.14 2006/12/10 18:34:55 dnylande Exp $ +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager&component=general\n" +"POT-Creation-Date: 2010-02-26 03:24+0000\n" +"PO-Revision-Date: 2010-03-02 22:05+0100\n" +"Last-Translator: Daniel Nylander \n" +"Language-Team: Swedish \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" + +#: ../cli/src/connections.c:86 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" +msgstr "" +"Användning: nmcli con { KOMMANDO | help }\n" +" KOMMANDO := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | användare]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout ]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:158 +#| msgid "_VPN Connections" +msgid "Connections" +msgstr "Anslutningar" + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/devices.c:298 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "Type" +msgstr "Typ" + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "UUID" +msgstr "UUID" + +#: ../cli/src/connections.c:158 +#: ../cli/src/connections.c:160 +#: ../cli/src/connections.c:196 +#: ../cli/src/connections.c:198 +#: ../cli/src/connections.c:205 +#: ../cli/src/connections.c:207 +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Name" +msgstr "Namn" + +#: ../cli/src/connections.c:163 +#, c-format +#| msgid "Modify system connections" +msgid "System connections:\n" +msgstr "Systemanslutningar:\n" + +#: ../cli/src/connections.c:167 +#, c-format +#| msgid "No network connection" +msgid "User connections:\n" +msgstr "Användaranslutningar:\n" + +#: ../cli/src/connections.c:178 +#: ../cli/src/connections.c:967 +#: ../cli/src/connections.c:983 +#: ../cli/src/connections.c:992 +#: ../cli/src/connections.c:1003 +#: ../cli/src/connections.c:1085 +#: ../cli/src/devices.c:604 +#: ../cli/src/devices.c:614 +#: ../cli/src/devices.c:699 +#: ../cli/src/devices.c:785 +#: ../cli/src/devices.c:792 +#, c-format +msgid "Error: %s argument is missing." +msgstr "Fel: %s-argument saknas." + +#: ../cli/src/connections.c:189 +#, c-format +msgid "Error: %s - no such connection." +msgstr "Fel: %s - ingen sådan anslutning." + +#: ../cli/src/connections.c:196 +#| msgid "Modify system connections" +msgid "System-wide connections" +msgstr "Systemanslutningar" + +#: ../cli/src/connections.c:205 +#| msgid "No network connection" +msgid "User connections" +msgstr "Användaranslutningar" + +#: ../cli/src/connections.c:212 +#: ../cli/src/connections.c:1016 +#: ../cli/src/connections.c:1103 +#: ../cli/src/devices.c:446 +#: ../cli/src/devices.c:494 +#: ../cli/src/devices.c:628 +#: ../cli/src/devices.c:706 +#: ../cli/src/devices.c:798 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "Okänd parameter: %s\n" + +#: ../cli/src/connections.c:221 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "Fel: ingen giltig parameter angiven." + +#. FIXME: Fix the output +#: ../cli/src/connections.c:268 +#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:321 +#: ../cli/src/devices.c:353 +#: ../cli/src/devices.c:355 +#: ../cli/src/devices.c:357 +#: ../cli/src/devices.c:359 +#: ../cli/src/devices.c:361 +msgid "yes" +msgstr "ja" + +#: ../cli/src/connections.c:268 +#: ../cli/src/devices.c:304 +msgid "no" +msgstr "nej" + +#: ../cli/src/connections.c:297 +#| msgid "Modify system connections" +msgid "Active connections" +msgstr "Aktiva anslutningar" + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +#: ../cli/src/devices.c:302 +#: ../cli/src/devices.c:304 +msgid "Default" +msgstr "Standard" + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Service" +msgstr "Tjänst" + +#: ../cli/src/connections.c:297 +#: ../cli/src/connections.c:299 +msgid "Devices" +msgstr "Enheter" + +#: ../cli/src/connections.c:659 +#, c-format +#| msgid "VPN connection to '%s'" +msgid "no active connection on device '%s'" +msgstr "ingen aktiv anslutning på enheten \"%s\"" + +#: ../cli/src/connections.c:667 +#, c-format +msgid "no active connection or device" +msgstr "ingen aktiv anslutning eller enhet" + +#: ../cli/src/connections.c:730 +msgid "activating" +msgstr "aktiverar" + +#: ../cli/src/connections.c:732 +msgid "activated" +msgstr "aktiverad" + +#: ../cli/src/connections.c:735 +#: ../cli/src/connections.c:758 +#: ../cli/src/connections.c:791 +#: ../cli/src/devices.c:111 +#: ../cli/src/network-manager.c:76 +#: ../cli/src/network-manager.c:98 +#| msgid "(unknown)" +msgid "unknown" +msgstr "okänt" + +#: ../cli/src/connections.c:744 +#| msgid "VPN connecting to '%s'" +msgid "VPN connecting (prepare)" +msgstr "VPN ansluter (förbereder)" + +#: ../cli/src/connections.c:746 +msgid "VPN connecting (need authentication)" +msgstr "VPN ansluter (behöver autentisering)" + +#: ../cli/src/connections.c:748 +#| msgid "_VPN Connections" +msgid "VPN connecting" +msgstr "VPN ansluter" + +#: ../cli/src/connections.c:750 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN ansluter (hämtar IP-konfiguration)" + +#: ../cli/src/connections.c:752 +#| msgid "_VPN Connections" +msgid "VPN connected" +msgstr "VPN ansluten" + +#: ../cli/src/connections.c:754 +#| msgid "VPN Connect Failure" +msgid "VPN connection failed" +msgstr "VPN-anslutning misslyckades" + +#: ../cli/src/connections.c:756 +#| msgid "VPN Connect Failure" +msgid "VPN disconnected" +msgstr "VPN frånkopplad" + +#: ../cli/src/connections.c:767 +#| msgid "(unknown)" +msgid "unknown reason" +msgstr "okänd anledning" + +#: ../cli/src/connections.c:769 +#| msgid "None" +msgid "none" +msgstr "ingen" + +#: ../cli/src/connections.c:771 +msgid "the user was disconnected" +msgstr "användaren kopplades från" + +#: ../cli/src/connections.c:773 +msgid "the base network connection was interrupted" +msgstr "basnätverksanslutningen avbröts" + +#: ../cli/src/connections.c:775 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN-tjänsten stoppades oväntat" + +#: ../cli/src/connections.c:777 +msgid "the VPN service returned invalid configuration" +msgstr "VPN-tjänsten returnerade en ogiltig konfiguration" + +#: ../cli/src/connections.c:779 +msgid "the connection attempt timed out" +msgstr "anslutningsförsöket översteg tidsgränsen" + +#: ../cli/src/connections.c:781 +msgid "the VPN service did not start in time" +msgstr "VPN-tjänsten startade inte i tid" + +#: ../cli/src/connections.c:783 +msgid "the VPN service failed to start" +msgstr "VPN-tjänsten misslyckades med att starta" + +#: ../cli/src/connections.c:785 +msgid "no valid VPN secrets" +msgstr "inga giltiga VPN-hemligheter" + +#: ../cli/src/connections.c:787 +msgid "invalid VPN secrets" +msgstr "ogiltiga VPN-hemligheter" + +#: ../cli/src/connections.c:789 +msgid "the connection was removed" +msgstr "anslutningen togs bort" + +#: ../cli/src/connections.c:803 +#, c-format +msgid "state: %s\n" +msgstr "tillstånd: %s\n" + +#: ../cli/src/connections.c:806 +#: ../cli/src/connections.c:832 +#, c-format +#| msgid "Connection _Information" +msgid "Connection activated\n" +msgstr "Anslutning aktiverad\n" + +#: ../cli/src/connections.c:809 +#, c-format +#| msgid "Connection to the wired network failed." +msgid "Error: Connection activation failed." +msgstr "Fel: Aktivering av anslutning misslyckades." + +#: ../cli/src/connections.c:828 +#, c-format +msgid "state: %s (%d)\n" +msgstr "tillstånd: %s (%d)\n" + +#: ../cli/src/connections.c:838 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "Fel: Aktivering av anslutning misslyckades: %s." + +#: ../cli/src/connections.c:855 +#: ../cli/src/devices.c:551 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "Fel: Tidsgränsen %d sekunder gick ut." + +#: ../cli/src/connections.c:898 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "Fel: Aktivering av anslutning misslyckades: %s" + +#: ../cli/src/connections.c:912 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Fel: Hämtning av aktiv anslutning för \"%s\" misslyckades." + +#: ../cli/src/connections.c:921 +#, c-format +#| msgid "VPN connection to '%s'" +msgid "Active connection state: %s\n" +msgstr "Tillstånd för aktiv anslutning: %s\n" + +#: ../cli/src/connections.c:922 +#, c-format +#| msgid "VPN connection to '%s'" +msgid "Active connection path: %s\n" +msgstr "Sökväg för aktiv anslutning: %s\n" + +#: ../cli/src/connections.c:976 +#: ../cli/src/connections.c:1094 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "Fel: Okänd anslutning: %s." + +#: ../cli/src/connections.c:1011 +#: ../cli/src/devices.c:622 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "Fel: värdet \"%s\" för tidsgränsen är inte giltigt." + +#: ../cli/src/connections.c:1024 +#: ../cli/src/connections.c:1111 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "Fel: id eller uuid måste anges." + +#: ../cli/src/connections.c:1044 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "Fel: Ingen lämplig enhet hittades: %s." + +#: ../cli/src/connections.c:1046 +#, c-format +msgid "Error: No suitable device found." +msgstr "Fel: Ingen lämplig enhet hittades." + +#: ../cli/src/connections.c:1138 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "Varning: Anslutningen är inte aktiv\n" + +#: ../cli/src/connections.c:1189 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "Fel: \"con\"-kommandot \"%s\" är inte giltigt." + +#: ../cli/src/connections.c:1216 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "Fel: kunde inte ansluta till D-Bus." + +#: ../cli/src/connections.c:1223 +#, c-format +msgid "Error: Could not get system settings." +msgstr "Fel: Kunde inte få systeminställningar." + +#: ../cli/src/connections.c:1231 +#, c-format +msgid "Error: Could not get user settings." +msgstr "Fel: Kunde inte få användarinställningar." + +#: ../cli/src/connections.c:1241 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "Fel: Kan inte få anslutningar: inställningstjänster är inte igång." + +#: ../cli/src/devices.c:73 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" +msgstr "" +"Användning: nmcli dev { KOMMANDO | help }\n" +"\n" +" KOMMANDO := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:93 +msgid "unmanaged" +msgstr "ohanterad" + +#: ../cli/src/devices.c:95 +msgid "unavailable" +msgstr "otillgänglig" + +#: ../cli/src/devices.c:97 +#: ../cli/src/network-manager.c:73 +#| msgid "_Disconnect VPN..." +msgid "disconnected" +msgstr "frånkopplad" + +#: ../cli/src/devices.c:99 +msgid "connecting (prepare)" +msgstr "ansluter (förbereder)" + +#: ../cli/src/devices.c:101 +msgid "connecting (configuring)" +msgstr "ansluter (konfigurerar)" + +#: ../cli/src/devices.c:103 +msgid "connecting (need authentication)" +msgstr "ansluter (behöver autentisering)" + +#: ../cli/src/devices.c:105 +#| msgid "Connection _Information" +msgid "connecting (getting IP configuration)" +msgstr "ansluter (hämtar IP-konfiguration)" + +#: ../cli/src/devices.c:107 +#: ../cli/src/network-manager.c:71 +msgid "connected" +msgstr "ansluten" + +#: ../cli/src/devices.c:109 +#| msgid "Connection _Information" +msgid "connection failed" +msgstr "anslutningen misslyckades" + +#: ../cli/src/devices.c:132 +#: ../cli/src/devices.c:876 +msgid "Unknown" +msgstr "Okänt" + +#. print them +#: ../cli/src/devices.c:164 +#: ../cli/src/devices.c:266 +#: ../cli/src/devices.c:861 +#: ../cli/src/devices.c:879 +#| msgid "(unknown)" +msgid "(none)" +msgstr "(ingen)" + +#: ../cli/src/devices.c:209 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: fel vid konvertering av IP4-adress 0x%X" + +#: ../cli/src/devices.c:238 +#, c-format +msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +msgstr "%s, %s, Frekv %d MHz, Hast %d Mb/s, Styrka %d" + +#: ../cli/src/devices.c:239 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:248 +msgid ", Encrypted: " +msgstr ", Krypterad: " + +#: ../cli/src/devices.c:253 +msgid " WEP" +msgstr " WEP" + +#: ../cli/src/devices.c:255 +msgid " WPA" +msgstr " WPA" + +#: ../cli/src/devices.c:257 +msgid " WPA2" +msgstr " WPA2" + +#: ../cli/src/devices.c:260 +msgid " Enterprise" +msgstr " Enterprise" + +#: ../cli/src/devices.c:294 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "Device" +msgstr "Enhet" + +#: ../cli/src/devices.c:299 +msgid "Driver" +msgstr "Drivrutin" + +#: ../cli/src/devices.c:299 +#: ../cli/src/devices.c:567 +msgid "(unknown)" +msgstr "(okänt)" + +#: ../cli/src/devices.c:300 +#: ../cli/src/devices.c:458 +#: ../cli/src/devices.c:460 +msgid "State" +msgstr "Tillstånd" + +#: ../cli/src/devices.c:313 +msgid "HW Address" +msgstr "Hårdvaruadress" + +#: ../cli/src/devices.c:319 +#, c-format +msgid "" +"\n" +" Capabilities:\n" +msgstr "" +"\n" +" Förmågor:\n" + +#: ../cli/src/devices.c:321 +msgid "Carrier Detect" +msgstr "Bärardetektering" + +#: ../cli/src/devices.c:336 +#, c-format +#| msgid "%d Mb/s" +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#: ../cli/src/devices.c:337 +msgid "Speed" +msgstr "Hastighet" + +#: ../cli/src/devices.c:348 +#, c-format +msgid "" +"\n" +" Wireless Properties\n" +msgstr "" +"\n" +" Trådlösa egenskaper\n" + +#: ../cli/src/devices.c:353 +msgid "WEP Encryption" +msgstr "WEP-kryptering" + +#: ../cli/src/devices.c:355 +msgid "WPA Encryption" +msgstr "WPA-kryptering" + +#: ../cli/src/devices.c:357 +msgid "WPA2 Encryption" +msgstr "WPA2-kryptering" + +#: ../cli/src/devices.c:359 +msgid "TKIP cipher" +msgstr "TKIP-chiffer" + +#: ../cli/src/devices.c:361 +msgid "CCMP cipher" +msgstr "CCMP-chiffer" + +#: ../cli/src/devices.c:368 +#, c-format +msgid "" +"\n" +" Wireless Access Points %s\n" +msgstr "" +"\n" +" Trådlösa accesspunkter %s\n" + +#: ../cli/src/devices.c:368 +msgid "(* = current AP)" +msgstr "(* = aktuell AP)" + +#: ../cli/src/devices.c:374 +#, c-format +msgid "" +"\n" +" Wired Properties\n" +msgstr "" +"\n" +" Trådbundna egenskaper\n" + +#: ../cli/src/devices.c:377 +#: ../cli/src/devices.c:379 +msgid "Carrier" +msgstr "Bärare" + +#: ../cli/src/devices.c:377 +#| msgid "None" +msgid "on" +msgstr "på" + +#: ../cli/src/devices.c:379 +msgid "off" +msgstr "av" + +#: ../cli/src/devices.c:387 +#, c-format +msgid "" +"\n" +" IPv4 Settings:\n" +msgstr "" +"\n" +" IPv4-inställningar:\n" + +#: ../cli/src/devices.c:395 +msgid "Address" +msgstr "Adress" + +#: ../cli/src/devices.c:401 +msgid "Prefix" +msgstr "Prefix" + +#: ../cli/src/devices.c:405 +msgid "Gateway" +msgstr "Gateway" + +#: ../cli/src/devices.c:416 +msgid "DNS" +msgstr "DNS" + +#: ../cli/src/devices.c:458 +msgid "Status of devices" +msgstr "Status för enheter" + +#: ../cli/src/devices.c:487 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "Fel: \"%s\"-argument saknas." + +#: ../cli/src/devices.c:516 +#: ../cli/src/devices.c:655 +#: ../cli/src/devices.c:729 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "Fel: Enheten \"%s\" hittades inte." + +#: ../cli/src/devices.c:539 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "Lyckades: Enheten \"%s\" kopplades från." + +#: ../cli/src/devices.c:564 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "Fel: Frånkoppling av enheten \"%s\" (%s) misslyckades: %s" + +#: ../cli/src/devices.c:572 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "Enhetstillstånd: %d (%s)\n" + +#: ../cli/src/devices.c:636 +#, c-format +msgid "Error: iface has to be specified." +msgstr "Fel: gränssnitt (iface) måste anges." + +#: ../cli/src/devices.c:736 +#: ../cli/src/devices.c:746 +msgid "WiFi scan list" +msgstr "WiFi-avsökningslista" + +#: ../cli/src/devices.c:740 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "Fel: Enheten \"%s\" är inte en WiFi-enhet." + +#: ../cli/src/devices.c:754 +msgid "Device:" +msgstr "Enhet:" + +#: ../cli/src/devices.c:806 +#, c-format +msgid "Error: hwaddr has to be specified." +msgstr "Fel: hwaddr måste anges." + +#: ../cli/src/devices.c:844 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "Fel: Accesspunkt med hwaddr \"%s\" hittades inte." + +#: ../cli/src/devices.c:862 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:863 +#, c-format +#| msgid "%d Mb/s" +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:869 +#: ../cli/src/devices.c:871 +msgid "AP parameters" +msgstr "AP-parametrar" + +#: ../cli/src/devices.c:873 +msgid "SSID:" +msgstr "SSID:" + +#: ../cli/src/devices.c:874 +msgid "BSSID:" +msgstr "BSSID:" + +#: ../cli/src/devices.c:875 +msgid "Frequency:" +msgstr "Frekvens:" + +#: ../cli/src/devices.c:876 +msgid "Mode:" +msgstr "Läge:" + +#: ../cli/src/devices.c:876 +msgid "Ad-hoc" +msgstr "Ad-hoc" + +#: ../cli/src/devices.c:876 +msgid "Infrastructure" +msgstr "Infrastruktur" + +#: ../cli/src/devices.c:877 +msgid "Maximal bitrate:" +msgstr "Maximal bitfrekvens:" + +#: ../cli/src/devices.c:878 +msgid "Strength:" +msgstr "Styrka:" + +#: ../cli/src/devices.c:879 +msgid "Flags:" +msgstr "Flaggor:" + +#: ../cli/src/devices.c:879 +msgid "privacy" +msgstr "integritet" + +#: ../cli/src/devices.c:880 +msgid "WPA flags:" +msgstr "WPA-flaggor:" + +#: ../cli/src/devices.c:881 +msgid "RSN flags:" +msgstr "RSN-flaggor:" + +#: ../cli/src/devices.c:907 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "Fel: \"dev wifi\"-kommandot \"%s\" är inte giltigt." + +#: ../cli/src/devices.c:943 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "Fel: \"dev\"-kommandot \"%s\" är inte giltigt." + +#: ../cli/src/network-manager.c:46 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Användning: nmcli nm { KOMMANDO | help }\n" +"\n" +" KOMMANDO := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:67 +msgid "asleep" +msgstr "sover" + +#: ../cli/src/network-manager.c:69 +#| msgid "VPN connecting to '%s'" +msgid "connecting" +msgstr "ansluter" + +#: ../cli/src/network-manager.c:93 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 +#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:160 +msgid "enabled" +msgstr "aktiverad" + +#: ../cli/src/network-manager.c:93 +#: ../cli/src/network-manager.c:94 +#: ../cli/src/network-manager.c:95 +#: ../cli/src/network-manager.c:96 +#: ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:160 +msgid "disabled" +msgstr "inaktiverad" + +#: ../cli/src/network-manager.c:102 +#| msgid "NetworkManager Applet" +msgid "NetworkManager status" +msgstr "Status för Nätverkshanterare" + +#: ../cli/src/network-manager.c:104 +msgid "NM running:" +msgstr "NM kör:" + +#: ../cli/src/network-manager.c:104 +msgid "running" +msgstr "kör" + +#: ../cli/src/network-manager.c:104 +msgid "not running" +msgstr "kör inte" + +#: ../cli/src/network-manager.c:105 +msgid "NM state:" +msgstr "NM tillstånd:" + +#: ../cli/src/network-manager.c:106 +msgid "NM wireless hardware:" +msgstr "NM trådlös hårdvara:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:107 +#: ../cli/src/network-manager.c:143 +msgid "NM wireless:" +msgstr "NM trådlös:" + +#: ../cli/src/network-manager.c:108 +msgid "NM WWAN hardware:" +msgstr "NM WWAN hårdvara:" + +#. no argument, show current state +#: ../cli/src/network-manager.c:109 +#: ../cli/src/network-manager.c:160 +msgid "NM WWAN:" +msgstr "NM WWAN:" + +#: ../cli/src/network-manager.c:150 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "Fel: ogiltig \"wifi\"-parameter: \"%s\"." + +#: ../cli/src/network-manager.c:167 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "Fel: ogiltig \"wwan\"-parameter: \"%s\"." + +#: ../cli/src/network-manager.c:178 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Fel: \"nm\"-kommandot \"%s\" är inte giltigt." + +#: ../cli/src/nmcli.c:65 +#, c-format +msgid "" +"Usage: %s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"Användning: %s [FLAGGOR] OBJEKT { KOMMANDO | help }\n" +"\n" +"FLAGGOR\n" +" -t[erse] kort utdata\n" +" -p[retty] vackert utdata\n" +" -v[ersion] visa programversion\n" +" -h[elp] skriv ut denna hjälp\n" +"\n" +"OBJEKT\n" +" nm status för Nätverkshanterare\n" +" con anslutningar i Nätverkshanterare\n" +" dev enheter hanterade av Nätverkshanterare\n" +"\n" + +#: ../cli/src/nmcli.c:106 +#, c-format +msgid "Object '%s' is unknown, try 'nmcli help'." +msgstr "Objektet \"%s\" är okänt, prova \"nmcli help\"." + +#: ../cli/src/nmcli.c:139 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli-verktyg, version %s\n" + +#: ../cli/src/nmcli.c:145 +#, c-format +msgid "Option '%s' is unknown, try 'nmcli -help'." +msgstr "Flagan \"%s\" är okänd, prova \"nmcli -help\"." + +#: ../cli/src/nmcli.c:164 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "Fångade signal %d, stänger av..." + +#: ../cli/src/nmcli.c:189 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "Fel: Kunde inte ansluta till Nätverkshanterare." + +#: ../cli/src/nmcli.c:205 +msgid "Success" +msgstr "Lyckades" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM-nyckelfilen hade ingen sluttagg \"%s\"." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Ser inte ut som en privat PEM-nyckelfil." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Inte tillräckligt mycket minne för att lagra PEM-fildata." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Felformulerad PEM-fil: Proc-Type var inte första taggen." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Felformulerad PEM-fil: okänd Proc-Type-tagg \"%s\"." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Felformulerad PEM-fil: DEK-Info var inte andra taggen." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Felformulerad PEM-fil: ingen IV hittades i DEK-Info-taggen." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Felformulerad PEM-fil: ogiltigt format för IV i DEK-Info-taggen." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Felformulerad PEM-fil: okänt chiffer för privat nyckel \"%s\"." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "Kunde inte avkoda privat nyckel." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM-certifikatet \"%s\" hade ingen sluttagg \"%s\"." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "Misslyckades med att avkoda certifikat." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Inte tillräckligt mycket minne för att lagra certifikatdata." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "Inte tillräckligt mycket minne för att lagra fildata." + +#: ../libnm-util/crypto.c:324 +#, 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-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Inte tillräckligt mycket minne för att lagra IV." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV innehåller icke-hexadecimala siffror." + +#: ../libnm-util/crypto.c:382 +#: ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 +#: ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Privata nyckelchiffret \"%s\" var okänt." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "Inte tillräckligt mycket minne för att dekryptera privat nyckel." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "Kunde inte bestämma typ av privat nyckel." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Inte tillräckligt mycket minne för att lagra dekrypterad privat nyckel." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "Misslyckades med att initiera krypteringsmotorn." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Misslyckades med att initiera MD5-motorn: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "Ogiltig IV-längd (måste vara minst %zd)." + +#: ../libnm-util/crypto_gnutls.c:165 +#: ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Inte tillräckligt mycket minne för buffert för dekrypterade nycklar." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Misslyckades med att initiera chifferkontexten för dekryptering: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, 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." + +#: ../libnm-util/crypto_gnutls.c:191 +#, 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-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Misslyckades med att dekryptera den privata nyckeln: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 +#: ../libnm-util/crypto_nss.c:267 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "Misslyckades med att dekryptera privata nyckeln: oväntad utfyllningslängd." + +#: ../libnm-util/crypto_gnutls.c:221 +#: ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "Misslyckades med att dekryptera privata nyckeln." + +#: ../libnm-util/crypto_gnutls.c:286 +#: ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "Kunde inte allokera minne för kryptering." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +#| msgid "Failed to initialize the decryption cipher context: %s / %s." +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "Misslyckades med att initiera chifferkontexten för kryptering: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +#| msgid "Failed to set symmetric key for decryption: %s / %s." +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "Misslyckades med att ställa in symmetrisk nyckel för kryptering: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +#| msgid "Failed to set IV for decryption: %s / %s." +msgid "Failed to set IV for encryption: %s / %s." +msgstr "Misslyckades med att ställa in IV för kryptering: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +#| msgid "Failed to decrypt the private key: %s / %s." +msgid "Failed to encrypt the data: %s / %s." +msgstr "Misslyckades med att kryptera datat: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Fel vid initiering av certifikatdata: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Kunde inte avkoda certifikat: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "Kunde inte initiera PKCS#12-avkodare: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "Kunde inte avkoda PKCS#12-fil: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "Kunde inte verifiera PKCS#12-fil: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "Misslyckades med att initiera krypteringsmotorn: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Misslyckades med att initiera MD5-kontexten: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "Ogiltig IV-längd (måste vara minst %d)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "Misslyckades med att initiera dekrypteringschifferplatsen." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Misslyckades med att ställa in symmetrisk nyckel för dekryptering." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Misslyckades med att ställa in IV för dekryptering." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "Misslyckades med att initiera dekrypteringskontexten." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Misslyckades med att dekryptera privata nyckeln: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "Misslyckades med att dekryptera privata nyckeln: dekrypterat data är för stort." + +#: ../libnm-util/crypto_nss.c:256 +#, 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." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +#| msgid "Failed to initialize the decryption cipher slot." +msgid "Failed to initialize the encryption cipher slot." +msgstr "Misslyckades med att initiera krypteringschifferplatsen." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +#| msgid "Failed to set symmetric key for decryption." +msgid "Failed to set symmetric key for encryption." +msgstr "Misslyckades med att ställa in symmetrisk nyckel för kryptering." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +#| msgid "Failed to set IV for decryption." +msgid "Failed to set IV for encryption." +msgstr "Misslyckades med att ställa in IV för kryptering." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +#| msgid "Failed to initialize the decryption context." +msgid "Failed to initialize the encryption context." +msgstr "Misslyckades med att initiera krypteringskontexten." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +#| msgid "Failed to decrypt the private key: %d." +msgid "Failed to encrypt: %d." +msgstr "Misslyckades med att kryptera: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "Oväntad mängd data efter kryptering." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Kunde inte avkoda certifikat: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "Kunde inte konvertera lösenord till UCS2: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "Kunde inte initiera PKCS#12-avkodare: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "Kunde inte avkoda PKCS#12-fil: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "Kunde inte verifiera PKCS#12-fil: %d" + +#: ../libnm-util/crypto_nss.c:557 +#| msgid "Could not decode private key." +msgid "Could not generate random data." +msgstr "Kunde inte generera slumpmässigt data." + +#: ../libnm-util/nm-utils.c:1545 +#, c-format +#| msgid "Not enough memory to create private key decryption key." +msgid "Not enough memory to make encryption key." +msgstr "Inte tillräckligt mycket minne för att skapa krypteringsnyckel." + +#: ../libnm-util/nm-utils.c:1655 +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file creation." +msgstr "Kunde inte allokera minne för att skapa PEM-fil." + +#: ../libnm-util/nm-utils.c:1667 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "Kunde inte allokera minne för skrivning av IV till PEM-fil." + +#: ../libnm-util/nm-utils.c:1679 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "Kunde inte allokera minne för skrivning av krypterad nyckel till PEM-fil." + +#: ../libnm-util/nm-utils.c:1698 +#, c-format +#| msgid "Not enough memory to store PEM file data." +msgid "Could not allocate memory for PEM file data." +msgstr "Kunde inte allokera minne för PEM-fildata." + +#: ../src/nm-netlink-monitor.c:194 +#: ../src/nm-netlink-monitor.c:464 +#: ../src/nm-netlink-monitor.c:582 +#: ../src/ip6-manager/nm-netlink-listener.c:352 +#, c-format +msgid "error processing netlink message: %s" +msgstr "fel vid behandling av netlink-meddelande: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "kan inte allokera netlink-handtag för övervakning av länkstatus: %s" + +#: ../src/nm-netlink-monitor.c:270 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "kan inte ansluta till netlink för övervakning av länkstatus: %s" + +#: ../src/nm-netlink-monitor.c:278 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "kan inte gå med i netlink-grupp för övervakning av länkstatus: %s" + +#: ../src/nm-netlink-monitor.c:286 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "kan inte allokera netlink-länkcache för övervakning av länkstatus: %s" + +#: ../src/nm-netlink-monitor.c:494 +#: ../src/ip6-manager/nm-netlink-listener.c:382 +msgid "error occurred while waiting for data on socket" +msgstr "fel inträffade vid väntan på data i uttaget" + +#: ../src/nm-netlink-monitor.c:558 +#: ../src/nm-netlink-monitor.c:571 +#, c-format +msgid "error updating link cache: %s" +msgstr "fel vid uppdatering av länkcache: %s" + +#: ../src/NetworkManager.c:494 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "Ogiltig flagga. Använd --help för att se en lista över giltiga flaggor.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:300 +msgid "# Created by NetworkManager\n" +msgstr "# Skapad av Nätverkshanterare\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:316 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Sammanfogad från %s\n" +"\n" + +#: ../src/ip6-manager/nm-netlink-listener.c:200 +#, c-format +#| msgid "unable to allocate netlink handle for monitoring link status: %s" +msgid "unable to allocate netlink handle: %s" +msgstr "kan inte allokera netlink-handtag: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:210 +#, c-format +#| msgid "unable to connect to netlink for monitoring link status: %s" +msgid "unable to connect to netlink: %s" +msgstr "kan inte ansluta till netlink: %s" + +#: ../src/ip6-manager/nm-netlink-listener.c:307 +#, c-format +#| msgid "unable to join netlink group for monitoring link status: %s" +msgid "unable to join netlink group: %s" +msgstr "kan inte gå med i netlink-grupp: %s" + +#: ../src/named-manager/nm-named-manager.c:315 +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." + +#: ../src/named-manager/nm-named-manager.c:317 +msgid "The nameservers listed below may not be recognized." +msgstr "Namnservrarna listade nedan kanske inte kommer att kännas igen." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "Automatisk %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3213 +msgid "System" +msgstr "System" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "Anslutningsdelning via ett skyddat trådlöst nätverk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "Anslutningsdelning via ett öppet trådlöst nätverk" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "Ändra bestående värdnamn för systemet" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "Ändra systemanslutningar" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "Systemets policy förhindrar ändring av systeminställningar" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "Systemets policy förhindrar ändring av bestående värdnamn för systemet" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +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" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +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" + +#~ msgid "operation took too long" +#~ msgstr "åtgärden tog för lång tid" +#~ msgid "received data from wrong type of sender" +#~ msgstr "tog emot data från fel typ av avsändare" +#~ msgid "received data from unexpected sender" +#~ msgstr "tog emot data från oväntad avsändare" +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "för mycket data skickades över uttaget och en del gick förlorat" +#~ msgid "Passphrase for wireless network %s" +#~ msgstr "Lösenfras för det trådlösa nätverket %s" +#~ msgid "Connection to the wireless network '%s' failed." +#~ msgstr "Anslutning till det trådlösa nätverket \"%s\" misslyckades." +#~ msgid "Error displaying connection information:" +#~ msgstr "Fel vid visning av anslutningsinformation:" +#~ msgid "Could not find some required resources (the glade file)!" +#~ msgstr "Kunde inte hitta en del nödvändiga resurser (glade-filen)!" +#~ msgid "Wired Ethernet (%s)" +#~ msgstr "Trådbundet Ethernet (%s)" +#~ msgid "Wireless Ethernet (%s)" +#~ msgstr "Trådlöst Ethernet (%s)" +#~ msgid "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "" +#~ "Panelprogram i notifieringsytan för hantering av dina nätverksenheter och " +#~ "nätverksanslutningar." +#~ msgid "translator-credits" +#~ msgstr "" +#~ "Daniel Nylander\n" +#~ "Christian Rose\n" +#~ "\n" +#~ "Skicka synpunkter på översättningen till\n" +#~ "tp-sv@listor.tp-sv.se" +#~ msgid "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgid "VPN Login Failure" +#~ msgstr "VPN-inloggningsfel" +#~ msgid "Could not start the VPN connection '%s' due to a login failure." +#~ msgstr "" +#~ "Kunde inte starta VPN-anslutningen \"%s\" på grund av ett inloggningfel." +#~ msgid "VPN Start Failure" +#~ msgstr "VPN-startfel" +#~ msgid "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." +#~ msgstr "" +#~ "Kunde inte starta VPN-anslutningen \"%s\" på grund av ett fel vid start " +#~ "av VPN-programmet." +#~ msgid "Could not start the VPN connection '%s' due to a connection error." +#~ msgstr "" +#~ "Kunde inte starta VPN-anslutningen \"%s\" på grund av ett anslutningsfel." +#~ msgid "VPN Configuration Error" +#~ msgstr "VPN-konfigurationsfel" +#~ msgid "The VPN connection '%s' was not correctly configured." +#~ msgstr "VPN-anslutningen \"%s\" konfigurerades inte korrekt." +#~ msgid "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." +#~ msgstr "" +#~ "Kunde inte starta VPN-anslutningen \"%s\" eftersom VPN-servern inte " +#~ "returnerade en lämplig nätverkskonfiguration." +#~ msgid "VPN Login Message" +#~ msgstr "VPN-inloggningsmeddelande" +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "" +#~ "Panelprogrammet för nätverkshantering kunde inte hitta en del nödvändiga " +#~ "resurser (glade-filen hittades inte)." +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "Nätverksenheten \"%s (%s)\" stöder inte trådlös genomsökning." +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "Nätverksenheten \"%s (%s)\" stöder inte länkdetektering." +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "Förbereder enheten %s för det trådbundna nätverket..." +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "Förbereder enheten %s för det trådlösa nätverket \"%s\"..." +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "Konfigurerar enheten %s för det trådbundna nätverket..." +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "Försöker ansluta till det trådlösa nätverket \"%s\"..." +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "Väntar på nätverksnyckel för det trådlösa nätverket \"%s\"..." +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "Begär en nätverksadress från det trådbundna nätverket..." +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "Begär en nätverksadress från det trådlösa nätverket \"%s\"..." +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "Slutför anslutning till det trådbundna nätverket..." +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "Slutför anslutning till det trådlösa nätverket \"%s\"..." +#~ msgid "NetworkManager is not running" +#~ msgstr "Nätverkshanteraren är inte igång" +#~ msgid "Networking disabled" +#~ msgstr "Nätverk inaktiverat" +#~ msgid "Wired network connection" +#~ msgstr "Trådbunden nätverksanslutning" +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "Ansluten till ett trådlöst ad hoc-nätverk" +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "Trådlös nätverksanslutning till \"%s\" (%d%%)" +#~ msgid "_Connect to Other Wireless Network..." +#~ msgstr "_Anslut till annat trådlöst nätverk..." +#~ msgid "Create _New Wireless Network..." +#~ msgstr "Skapa _nytt trådlöst nätverk..." +#~ msgid "_Configure VPN..." +#~ msgstr "_Konfigurera VPN..." +#~ msgid "_Dial Up Connections" +#~ msgstr "_Uppringda anslutningar" +#~ msgid "Connect to %s..." +#~ msgstr "Anslut till %s..." +#~ msgid "Disconnect from %s..." +#~ msgstr "Koppla från %s..." +#~ msgid "No network devices have been found" +#~ msgstr "Inga nätverksenheter har hittats" +#~ msgid "NetworkManager is not running..." +#~ msgstr "Nätverkshanteraren är inte igång..." +#~ msgid "Enable _Networking" +#~ msgstr "Aktivera _nätverk" +#~ msgid "Enable _Wireless" +#~ msgstr "Aktivera _trådlöst" +#~ msgid "_Help" +#~ msgstr "_Hjälp" +#~ msgid "_About" +#~ msgstr "_Om" +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "" +#~ "Panelprogrammet för nätverkshantering kunde inte hitta en del nödvändiga " +#~ "resurser. Det kan inte fortsätta.\n" +#~ msgid "Shared Key" +#~ msgstr "Delad nyckel" +#~ msgid "Automatic (Default)" +#~ msgstr "Automatiskt (standard)" +#~ msgid "AES-CCMP" +#~ msgstr "AES-CCMP" +#~ msgid "TKIP" +#~ msgstr "TKIP" +#~ msgid "Dynamic WEP" +#~ msgstr "Dynamisk WEP" +#~ msgid "WEP 64/128-bit ASCII" +#~ msgstr "WEP 64/128-bitars ASCII" +#~ msgid "WEP 64/128-bit Hex" +#~ msgstr "WEP 64/128-bitars hexadecimal" +#~ msgid "WEP 128-bit Passphrase" +#~ msgstr "WEP 128-bitars lösenfras" +#~ msgid "PEAP" +#~ msgstr "PEAP" +#~ msgid "TLS" +#~ msgstr "TLS" +#~ msgid "TTLS" +#~ msgstr "TTLS" + diff --git a/po/ta.po b/po/ta.po new file mode 100644 index 00000000..1642030c --- /dev/null +++ b/po/ta.po @@ -0,0 +1,1806 @@ +# translation of NetworkManager.po.master.ta.po to Tamil +# Tamil translation for NetworkManager. +# Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the NetworkManager package. +# +# Felix I , 2009. +# I. Felix , 2009, 2010. +# I Felix , 2010. +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager.po.master.ta\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 13:26+0530\n" +"Last-Translator: I Felix \n" +"Language-Team: Tamil \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"பயன்பாடு: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "பிழை: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "Error: 'con list': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "இணைப்பு விவரங்கள்" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "கணினி" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "பயனர்" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ஒருபோதும் இல்லை" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "ஆம்" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "இல்லை" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "கணினி இணைப்புகள்" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "பயனர் இணைப்புகள்" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "பிழை: %s விவாதம் விடுபட்டுள்ளது." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "பிழை: %s - அது போன்ற இணைப்பு இல்லை." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "தெரியாத அளவுரு: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "பிழை: குறிப்பிடப்பட்ட சரியான அளவுரு இல்லை." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "பிழை: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "பிழை: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "பிழை: 'con status': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "இணைப்புகளை செயற்படுத்து" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "சாதனம் '%s' இல் செயல்படும் இணைப்பு இல்லை" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "செயல்படும் இணைப்பு அல்லது சாதனம் இல்லை" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "சாதனம் '%s' இணைப்பு '%s' உடன் உகந்தது அல்ல" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "இணைப்பு '%s'க்கு சாதனம் எதுவும் இல்லை" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "செயல்படுகிறது" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "செயல்படுத்தப்பட்டது" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "தெரியாத" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN இணைக்கிறது (தயாராகு)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN இணைக்கிறது (அங்கீகாரம் தேவை)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN இணைக்கிறது" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN இணைக்கிறது (IP கட்டமைப்பை பெறுகிறது)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN இணைக்கிறது" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN ஐ இணைக்க முடியவில்லை" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN துண்டிக்கப்பட்டது" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "தெரியாத காரணம்" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "ஒன்றுமில்லாத" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "பயனர் செயல்நீக்கப்பட்டார்" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "தளப் பிணைய இணைப்பானது தடை செய்யப்பட்டிருந்தது" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "எதிர்பாராமல் VPN சேவை நிறுத்தப்பட்டது" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN சேவையானது தவறான கட்டமைப்பிற்கு திரும்பியது" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "இணைப்பு முயற்சியின் நேரம் முடிந்தது" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN சேவை நேரத்திற்கு துவங்கவில்லை" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN சேவையை துவக முடியவில்லை" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "சரியான VPN இரகசியங்கள் இல்லை" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "தவறான VPN இரகசியங்கள்" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "இணைப்பானது நீக்கப்பட்டது" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "நிலை: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "இணைப்பு செயல்படுத்தப்பட்டது\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "பிழை: இணைப்பை செயல்படுத்த முடியவில்லை." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "நிலை: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "பிழை: இணைப்பை செயல்படுத்த முடியவில்லை: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "பிழை: நேரமுடிந்த %d விநாடி காலாவதியானது." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "பிழை: இணைப்பை செயல்படுத்த முடியவில்லை:%s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "Error: Obtaining active connection for '%s' failed." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "செயல்படும் இணைப்பின் நிலை: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "செயல்படும் இணைப்பின் பாதை: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "பிழை: தெரியாத பிழை: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "பிழை: நேரமுடிவு மதிப்பு '%s' சரியானதல்ல." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "பிழை: id அல்லது uuid குறிப்பிடப்பட வேண்டும்." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "பிழை: தகுதியான சாதனம் காணப்படவில்லை: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "பிழை: தகுதியான சாதனம் காணப்படவில்லை." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "எச்சரிக்கை: இணைப்பு செயல்பாட்டில் இல்லை\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "பிழை: 'con' கட்டளை '%s' சரியானதல்ல." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "பிழை: D-பஸ்ஸை இணைக்க முடியவில்லை." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "பிழை: கணினி அமைவுகளை பெற முடியவில்லை." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "பிழை: பயனர் அமைவுகளை பெற முடியவில்லை." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "பிழை: இணைப்பை பெற முடியவில்லை: அமைவுகளின் சேவைகள் இயங்கவில்லை." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "பராமரிக்கப்படாத" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "கிடைக்கப்பெறாத" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "துண்டிக்கப்பட்டது" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "இணைக்கிறது (தயாராக்கு)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "இணைக்கிறது (கட்டமைக்கிறது)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "இணைக்கிறது (அங்கீகாரம் தேவை)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "இணைக்கிறது (IP கட்டமைப்பை பெறுகிறது)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "இணைக்கப்பட்டது" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "இணைக்க முடியவில்லை" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "தெரியாத" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(ஒன்றுமில்லாத)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 முகவரி 0x%X ஐ மாற்றுவதில் பிழை" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "மறைகுறியாக்கப்பட்டது: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "என்டர்பிரைசஸ்" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "அடித்தளம்" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "பிழை: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "பிழை: 'dev list': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "சாதன விவரங்கள்" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(தெரியாத)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "தெரியாத)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ஆன் " + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ஆஃப்" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "பிழை: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "பிழை: 'dev status': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "சாதனங்களின் நிலை" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "பிழை: '%s' விவாதம் விடுபட்டது." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "பிழை: சாதனம் '%s' காணப்படவில்லை." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "வெற்றி: சாதனம் '%s' வெற்றிகரமாக துண்டிக்கப்பட்டது." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "பிழை: சாதனம் '%s' (%s) துண்டிக்கபடவில்லை: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "சாதன நிலை: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "பிழை: iபேஸ் குறிப்பிடப்பட வேண்டும்." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "பிழை: 'dev wifi': '%s'" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "பிழை: 'dev wifi': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi ஸ்கேன் பட்டியல்" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "பிழை:hwaddr '%s' உடன் அணுகல் புள்ளி காணப்படவில்லை." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "பிழை: சாதனம் '%s' ஒரு WiFi சாதனம் இல்லை." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "பிழை: 'dev wifi' கட்டளை '%s' ஆனது தவறானது." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "பிழை: 'dev' கட்டளை '%s' தவறானது." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"பயன்பாடு: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" நிலை\n" +" தூக்கம்\n" +" விழிப்பு\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "தூங்கிக் கொண்டிருத்தல்" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "இணைக்கிறது" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "பிழை: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "பிழை: 'nm status': %s; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "பிணைய மேலாளர் நிலை" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "செயல்படுத்தப்பட்டது" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "செயல்நீக்கப்பட்டது" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "இயங்குகிறது" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "இயங்கவில்லை" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "பிழை: '--fields' மதிப்பு '%s' இங்கே சரியாக இல்லை; அனுமதிக்கப்பட்ட புலங்கள்: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi செயல்படுத்தப்பட்டது" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "பிழை: தவறான 'wifi' அளவுரு: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN செயல்படுத்தப்பட்டது" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "பிழை: தவறான 'wwan' அளவுரு: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "Error: 'nm' கட்டளை '%s' தவனாறது." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "பிழை: பொருள் '%s' ஆனது தெரியாதது, 'nmcli உதவியை' முயற்சிக்கவும்." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "பிழை: விருப்பம் '--terse' இரண்டாவது முறை குறிப்பிடப்பட்டது." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "பிழை: விருப்பம் '--terse'ஆனது '--pretty' உடன் ஒன்றாக உள்ளது." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "பிழை: விருப்பம் '--pretty' இரண்டாவது முறை குறிப்பிட்டது." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "பிழை: விருப்பம் '--pretty'ஆனது '--terse' உடன் ஒன்றாக உள்ளது" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "பிழை: '%s' விருப்பத்திற்கு விவாதம் விடுபட்டுள்ளது." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "பிழை: '%s' ஆனது '%s' விருப்பத்திற்கு சரியான விவாதம் அல்ல." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "பிழை: '%s' க்கு புலங்கள் விடுபட்டது." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli கருவி, பதிப்பு %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "பிழை: விருப்பம் '%s'ஆனது தெரியாதது, 'nmcli -உதவியை' முயற்சிக்கவும்." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "%d சிக்னல் கிடைத்துவிட்டது, பணி நிறுத்துகிறது..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "பிழை: பிணைய மேலாளரை இணைக்க முடியவில்லை." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "வெற்றி" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit கடவுச்சொல்)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (தெரியாத)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (தெரியாத)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ஏதாவது," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "தானே" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "அமைக்கப்படவில்லை" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "புலம் '%s' தனியாக இருக்க வேண்டும்" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "தவறான புலம் '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "விருப்பம் '--terse' '--fields'ஐ குறிப்பிட தேவைப்படுகிறது" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "" +"விருப்பம் '--terse'க்கு குறிப்பிட்ட '--fields' விருப்ப மதிப்புகள் தேவை, '%s' அல்ல" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM விசைக் கோப்பிற்கு முடிவு ஒட்டு'%s' இல்லை." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "இதைப் பார்ப்பதற்கு ஒரு PEM தனிப்பட்ட விசைக் கோப்பு போல் இல்லை." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM கோப்பு தரவை சேமிக்க போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "முறையற்ற PEM கோப்பு: Proc-வகையானது முதல் ஒட்டு இல்லை." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "முறையற்ற PEM கோப்பு: தெரியாத Proc-வகை ஒட்டு '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "முறையற்ற PEM கோப்பு: DEK-தகவலானது இரண்டாவது ஒட்டாக இருக்க முடியாது." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "முறையற்ற PEM கோப்பு: IV ஆனது DEK-தகவல் ஒட்டில் காணப்படவில்லை." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "முறையற்ற PEM கோப்பு: DEK-தகவல் ஒட்டினுள் IV ன் தவறான வடிவம்." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "முறையற்ற PEM கோப்பு: தெரியாத தனிப்பட்ட விசை cipher '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "தனிப்பட்ட விசையை குறியாக்க முடியவில்லை." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM சான்றிதழானது '%s' முடிவு ஒட்டு '%s'ஐ பெற்றிருக்கவில்லை." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "சான்றிதழை குறியாக முடியவில்லை." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "சான்றிதழ் தரவை சேமிக்க போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "கோப்பு தரவை சேமிக்க போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV ஆனது நீளத்தில் ஒரு பைட்டிகளின் எண்னைப் பெற்றுள்ளது." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IVஐ சேமிக்க போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV ஆனது-ஹெக்ஸா தசம எண்களை பெற்றிருக்கவில்லை." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "தனிப்பட்ட விசை cipher '%s' ஆனது தெரியாதது." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "தனிப்பட்ட விசையின் மறைகுறிமுறையை நீக்க போதை நினைவகம் இல்லை." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "தனிப்பட்ட விசை வகையை வரையறுக்க முடியவில்லை." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "தனிப்பட்ட விசையின் மறைகுறிமுறையை நீக்கத்தை சேமிக்க போதை நினைவகம் இல்லை." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "crypto என்ஜினைத் துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 என்ஜினைத் துவக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "தவறான IV நீளம் ( %zdவது இருக்க வேண்டும்)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "மறைகுறிமுறைநீக்க விசை பஃப்பருக்கான போதைய நினைவகம் இல்லை." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "cipher சேர்த்து மறைகுறிமுறை நீக்கத்தை துவக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "மறைகுறிமுறைநீக்கத்திற்கான ஒத்த விசையை அமைக்க முடியவில்லை.: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "IV கான மறைகுறிமுறை நீக்கத்தை அமைக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "தனிப்பட்ட விசைக்கு மறைகுறிமுறையை நீக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "தனிப்பட்ட விசைக்கு மறைகுறிமுறையை நீக்க முடியவில்லை: எதிர்பாராத பாடிங் நீளம்." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "தனிப்பட்ட விசைக்கு மறைகுறிமுறையை நீக்க முடியவில்லை." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "மறைகுறியாக்கத்திற்கான நினைவகத்தை ஒதுக்கிட முடியவில்லை." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "cipher சேர்த்து மறைகுறியாக்கத்தை துவக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "மறைகுறியாக்கத்திற்கான ஒத்த விசையை அமைக்க முடியவில்லை.: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "IV கான மறைகுறியாக்கத்தை அமைக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "தரவை மறைகுறியாக்க முடியவில்லை: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "சான்றிதழ் தரவை துவக்குவதில் பிழை: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "சான்றிதழை குறியாக்க முடியவில்லை: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 குறியாளரை துவக்க முடியவில்லை: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 கோப்பை குறியாக்க முடியவில்லை: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 கோப்பை சரிபார்க்க முடியவில்லை: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "crypto என்ஜினைத் துவக்க முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 உரையை துவக்க முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "தவறான IV நீளம் (%dயாவது இருக்க வேண்டும்)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "மறைகுறிமுறையை நீக்க cipher வரிசையை துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "மறைகுறிமுறைநீக்கத்திற்கான ஒத்த விசையை அமைக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "IV கான மறைகுறிமுறையை அமைக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "மறைகுறிமுறைநீக்கத்தை சேர்த்து துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "தனிப்பட்ட விசையின் மறைகுறிமுறையை நீக்க முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "" +"தனிப்பட்ட விசையின் மறைகுறிமுறையை நீக்க முடியவில்லை: மறைகுறிமுறை நீக்கப்பட்ட தரவு மிக " +"நீளமானது." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "தனிப்பட்ட விசையின் மறைகுறிமுறையை முடி முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "மறைகுறியாக்க cipher வரிசையை துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "மறைகுறியாக்கத்திற்கான ஒத்த விசையை அமைக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "IV கான மறைகுறியாக்கத்தை அமைக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "மறைகுறியாக்க சேர்த்து துவக்க முடியவில்லை." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "மறைகுறியாக்க முடியவில்லை: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "மறைகுறியாக்கத்திற்குப் பின் எதிர்பாராத தரவின் எண்ணிக்கை." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "சான்றிதழை குறியாக்க முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "கடவுச்சொல்லை UCS2க்கு மாற்ற முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 குறியாக்கத்தை துவக்க முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 கோப்பை குறியாக்க முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 கோப்பை சரிபார்க்க முடியவில்லை: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "தற்செயலான தரவை உருவாக்க முடியவில்லை." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "மறைகுறியாக்க விசையை செய்ய போதைய நினைவகம் இல்லை." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "PEM கோப்பிற்கான உருவாக்கத்திற்கு போதைய நினைவ ஒதுக்கீடு இல்லை." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "PEM கோப்பில் IVஐ எழுதுவதற்கு போதைய நினைவக ஒதுக்கீடு இல்லை." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "PEM கோப்பிற்கு மறைகுறியாக்க விசையை எழுதுவதற்கான போதைய நினைவகத்தை ஒதுக்கவில்லை." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM கோப்பு தரவிற்காக போதைய நினைவக ஒதுக்கீடு இல்லை." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "netlink செய்தியின் செயல்முறையில் பிழை: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "சாக்கெட்டில் தரவிற்காக காத்திருக்கும் போது பிழை ஏற்பட்டது" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "இணைப்பு நிலையை பார்வையிட நெட்இணைப்பை இணைக்க முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "netlink ஹாண்டில் நற்சான்றை செயல்படுத்த முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "இணைப்பு நிலைக்கான netlink ஹாண்டிலை ஒதுக்கிட முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "இணைப்பு நிலையை கண்கானிக்க netlink இணைப்பு செக்கை ஒதுக்கிட முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "netlink குழுவுடன் சேர முடியவில்லை: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "பிழை மேம்படுத்தும் இணைப்பு செக்: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"தவறான விருப்பம். உதவியை --பயன்படுத்தி சரியான விருப்பங்களின் பட்டியலைப் பார்க்கவும்.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. --helpஐ பயன்படுத்தி சரியான விருப்பங்களின் பட்டியலைப் பார்க்கவும்.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Created by NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Merged from %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "பயன்படக்கூடிய DHCP வாடிக்கையாளர் காணப்படவில்லை" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' காணப்படவில்லை." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' காணப்படவில்லை." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "துணைபுரியாத DHCP வாடிக்கையாளர் '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "தெரியாத பதிவு நிலை '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "தெரியாத பதிவு டொமைன் '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "குறிப்பு: இந்த libc மறுதீர்வாளர் 3 பெயர்சேவையர்களுக்கு மேல் துணைபுரியவதில்லை." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "கீழே பட்டியலிட்டப்படுள்ள பெயர்சேவையகங்கள் கண்டுபிடிக்கப்படவில்லை." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "தானியக்கி %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "கணினி" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "ஒரு பாதுகாக்கப்ப WiFi நெட்வொர்க்கின் வழியாக இணைப்பு பகிரப்படுகிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ஒரு திறந்த WiFi நெட்வொர்க்கின் வழியாக இணைப்பு பகிரப்படுகிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "நிலையான கணினி புரவலப்பெயரை மாற்றியமை" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "கணினி இணைப்புகளை மாற்றியமைக்கவும்" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "கணினி அமைவுகளின் மாற்றத்தை கணினி பாலிசி தடுக்கிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "நிலையான கணினி புரவலபெயர் மாற்றியமைப்பதை கணினி பாலிசி தடுக்கிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "" +"பாதுகாக்கப்பட்ட WiFi நெட்வொர்க்கின் வழியாக இணைப்புகளை பகிருவதை கணினி பாலிசி தடுக்கிறது" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "திறந்த WiFi நெட்வொர்க்கின் வழியாக இணைப்புகளை பகிருவதை கணினி பாலிசி தடுக்கிறது" + +#~ msgid "Type" +#~ msgstr "வகை" + +#~ msgid "Name" +#~ msgstr "பெயர்" + +#~ msgid "User connections:\n" +#~ msgstr "பயனர் இணைப்புகள்:\n" + +#~ msgid "System-wide connections" +#~ msgstr "பரந்த கணினி இணைப்புகள்" + +#~ msgid "Default" +#~ msgstr "முன்னிருப்பு" + +#~ msgid "Service" +#~ msgstr "சேவை" + +#~ msgid "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d" +#~ msgstr "%s, %s, Freq %d MHz, விகிதம் %d Mb/s, வலிமை %d" + +#~ msgid "Device" +#~ msgstr "சாதனம்" + +#~ msgid "Driver" +#~ msgstr "இயக்கி" + +#~ msgid "State" +#~ msgstr "நிலை" + +#~ msgid "HW Address" +#~ msgstr "HW முகவரி" + +#~ msgid "" +#~ "\n" +#~ " Capabilities:\n" +#~ msgstr "" +#~ "\n" +#~ " ஆற்றல்கள்:\n" + +#~ msgid "Carrier Detect" +#~ msgstr "கேரியர் கண்டுபிடிப்பு" + +#~ msgid "Speed" +#~ msgstr "வேகம்" + +#~ msgid "" +#~ "\n" +#~ " Wireless Properties\n" +#~ msgstr "" +#~ "\n" +#~ " கம்பியில்லா தன்மைகள்\n" + +#~ msgid "WEP Encryption" +#~ msgstr "WEP மறைகுறியநாக்கம்" + +#~ msgid "WPA Encryption" +#~ msgstr "WPA மறைகுறியாக்கம்" + +#~ msgid "WPA2 Encryption" +#~ msgstr "WPA2 மறைகுறியாக்கம்" + +#~ msgid "TKIP cipher" +#~ msgstr "TKIP cipher" + +#~ msgid "CCMP cipher" +#~ msgstr "CCMP சிப்பர்" + +#~ msgid "" +#~ "\n" +#~ " Wireless Access Points %s\n" +#~ msgstr "" +#~ "\n" +#~ " வயர்லெஸ் அணுகல் புள்ளி %s\n" + +#~ msgid "(* = current AP)" +#~ msgstr "(* = நடப்பு AP)" + +#~ msgid "" +#~ "\n" +#~ " Wired Properties\n" +#~ msgstr "" +#~ "\n" +#~ " வயர்டு தன்மைகள்\n" + +#~ msgid "Carrier" +#~ msgstr "கேரியர்" + +#~ msgid "" +#~ "\n" +#~ " IPv4 Settings:\n" +#~ msgstr "" +#~ "\n" +#~ " IPv4 அமைவுகள்:\n" + +#~ msgid "Address" +#~ msgstr "முகவரி" + +#~ msgid "Prefix" +#~ msgstr "முன்பொருத்தம்" + +#~ msgid "Gateway" +#~ msgstr "நுழைவாயில்" + +#~ msgid "Device:" +#~ msgstr "சாதனம்:" + +#~ msgid "Error: hwaddr has to be specified." +#~ msgstr "பிழை: hwaddr குறிப்பிடப்பட வேண்டும்." + +#~ msgid "AP parameters" +#~ msgstr "AP அளவுருக்கள்" + +#~ msgid "Frequency:" +#~ msgstr "அடிக்கடி:" + +#~ msgid "Mode:" +#~ msgstr "முறைமை:" + +#~ msgid "Ad-hoc" +#~ msgstr "Ad-hoc" + +#~ msgid "Maximal bitrate:" +#~ msgstr "அதிகபட்ச பிட்ரெட்:" + +#~ msgid "Strength:" +#~ msgstr "வலிமை:" + +#~ msgid "Flags:" +#~ msgstr "கொடிகள்:" + +#~ msgid "privacy" +#~ msgstr "தனிப்பட்ட" + +#~ msgid "WPA flags:" +#~ msgstr "WPA கொடிகள்:" + +#~ msgid "RSN flags:" +#~ msgstr "RSN கொடிகள்:" + +#~ msgid "NM running:" +#~ msgstr "NM இயங்குகிறது:" + +#~ msgid "NM state:" +#~ msgstr "NM நிலை:" + +#~ msgid "NM wireless hardware:" +#~ msgstr "NM வயர்லெஸ் வன்பொருள்:" + +#~ msgid "NM wireless:" +#~ msgstr "NM வயர்லெஸ்:" + +#~ msgid "NM WWAN hardware:" +#~ msgstr "NM WWAN வன்பொருள்:" + +#~ msgid "unable to join netlink group for monitoring link status: %s" +#~ msgstr "இணைப்பு நிலையை கண்கானிக்க netlink குழுவில் சேர முடியவில்லை: %s" + +#~ msgid "unable to connect to netlink: %s" +#~ msgstr "netlinkஉடன் இணைக்க முடியவில்லை: %s" diff --git a/po/te.po b/po/te.po new file mode 100644 index 00000000..54c6fed6 --- /dev/null +++ b/po/te.po @@ -0,0 +1,1642 @@ +# translation of te.po to Telugu +# Telugu translation of NetworkManager. +# Copyright (C) 2009 NetworkManager's COPYRIGHT HOLDER +# This file is distributed under the same license as the NetworkManager package. +# +# Krishna Babu K , 2009, 2010. +msgid "" +msgstr "" +"Project-Id-Version: te\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-06 19:30+0530\n" +"Last-Translator: Krishna Babu K \n" +"Language-Team: Telugu \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n\n" +"\n" +"\n" +"\n" +"\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "దోషము: 'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "దోషము: 'con list': %s; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "అనుసంధానము వివరములు" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "సిస్టమ్" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "వినియోగదారి" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "ఎప్పటికికాదు" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "అవును" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "కాదు" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "సిస్టమ్ అనుసంధానములు" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "వినియోగదారి అనుసంధానములు" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "దోషము: %s ఆర్గుమెంట్ తప్పిపోయినది." + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "దోషము: %s - అటువంటి అనుసంధానము లేదు." + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "తెలియని పారామితి: %s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "దోషము: ఏ చెల్లునటువంటి పారామితి తెలుపబడలేదు." + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "దోషము: %s." + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "దోషము: 'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "దోషము: 'con status': %s; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "క్రియాశీల అనుసంధానములు" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "పరికరము '%s' పైన యెటువంటి క్రియాశీల అనుసంధానము లేదు" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "ఎటువంటి క్రియాశీల అనుసంధానము లేదా పరికరము లేదు" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "పరికరము '%s' అనుసంధానము '%s'తో సారూప్యమైనది కాదు" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "అనుసంధానము '%s' కొరకు యే పరికరము కనుగొనబడలేదు" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "క్రియాశీలపరచుచున్నది" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "క్రియాశీలపరచబడింది" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "తెలియని" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN అనుసంధానమౌచున్నది (సిద్దపరచు)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN అనుసంధానమౌచున్నది (ధృవీకరణము అవసరము)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN అనుసంధానమౌచున్నది" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN అనుసంధానమౌచున్నది (IP ఆకృతీకరణను పొందుచున్నది)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN అనుసంధానమైంది" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN అనుసంధానము విఫలమైంది" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN అననుసంధానమైంది" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "తెలియని కారణము" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "ఏదీకాదు" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "వినియోగదారి అననుసంధానింప బడినారు" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "ఆధార నెట్వర్కు అనుసంధానము ఆటంకపరచబడింది" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN సేవ అనుకోకుండా ఆపివేయబడింది" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN సేవ చెల్లని ఆకృతీకరణను తిప్పియిచ్చినది" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "అనుసంధానపు ప్రయత్నం సమయం మించిపోయినది" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN సేవ సమయం లోపల ప్రారంభించబడలేదు" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN సేవ ప్రారంభమగుటకు విఫలమైంది" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "ఏ విలువైన VPN రహస్యాలు లేవు" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "చెల్లని VPN రహస్యాలు" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "అనుసంధానము తీసివేయబడింది" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "స్థితి: %s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "అనుసంధానము క్రియాశీలపరచబడింది\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది." + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "స్థితి: %s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది: %s." + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "దోషము: కాలపరిమితి %d సె మించినది." + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "దోషము: అనుసంధానము క్రియాశీలపరచుట విఫలమైంది: %s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "దోషము: '%s' కొరకు క్రియాశీల అనుసంధానమును పొందుటలో విఫలమైంది." + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "క్రియాశీల అనుసంధానము స్థితి: %s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "క్రియాశీల అనుసంధానము పాత్: %s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "దోషము: తెలియని దోషము: %s." + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "దోషము: కాలముగింపు విలువ '%s' చెల్లనిది." + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "దోషము: id లేదా uuid తెలుపవలసి వుంది." + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "దోషము: ఎటువంటి సూటయ్యే పరికరము కనబడలేదు: %s." + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "దోషము: ఏ సూటగు పరికరము కనబడలేదు." + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "దహెచ్చరిక: అనుసంధానము క్రియాశీలంగా లేదు\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "దోషము: 'con' ఆదేశము '%s' చెల్లునది కాదు." + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "దోషము: D-Busకు అనుసంధానము కాలేకపోయినది." + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "దోషము: సిస్టమ్ అమరికలను పొందలేక పోయింది." + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "దోషము: వినియోగదారి అమరికలను పొందలేక పోయింది." + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "దోషము: అనుసంధానములను పొందలేదు: అమరికల సేవలు నడుచుటలేదు." + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "నిర్వహించని" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "అందుబాటులోలేని" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "అననుసంధానమైన" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "అనుసంధానమౌచున్నది (సిద్దపడుతోంది)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "అనుసంధానమౌచున్నది (ఆకృతీకరించబడుతోంది)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "అనుసంధానమౌచున్నది (ధృవీకరణము అవసరము)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "అనుసంధానమౌచున్నది (IP ఆకృతీకరణను పొందుచున్నది)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "అనుసంధానమైంది" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "అనుసంధానము విఫలమైంది" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "తెలియని" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(ఏదీకాదు)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s: IP4 చిరునామా 0x%X మార్చుటలో దోషము" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "ఎన్క్రిప్టెడ్: " + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "ఎంటర్‌ప్రైజ్ " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "అవస్థాపన(ఇన్ఫ్రాస్ట్రక్చర్)" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "దోషము: 'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "దోషము: 'dev list': %s; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "పరికరము వివరములు" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(తెలియని)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "తెలియని)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "ఆన్" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "ఆఫ్" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "దోషము: 'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "దోషము: 'dev status': %s; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "పరికరముల యొక్క స్థితి" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "దోషము: '%s' ఆర్గుమెంట్ తప్పిపోయినది." + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "దోషము: పరికరము '%s' కనబడలేదు." + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "సఫలమైంది: పరికరము '%s' సఫలవంతంగా అననుసంధానించబడింది." + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "దోషము: పరికరము '%s' (%s) అననుసంధానము విఫలమైంది: %s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "పరికరము స్థితి: %d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "దోషము: iface తెలుపవలసి వుంది." + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "దోషము: 'dev wifi': %s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "దోషము: 'dev wifi': %s; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi స్కాన్ జాబితా" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "దోషము: హార్డువేర్‌చిరునామా '%s'తో యాక్సెస్ పాయింట్ కనబడలేదు." + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "దోషము: పరికరము '%s' అనునది WiFi పరికరము కాదు." + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "దోషము: 'dev wifi' ఆదేశము '%s' చెల్లనిది." + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "దోషము: 'dev' ఆదేశము '%s' చెల్లనిది." + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "స్థబ్దుగా(asleep)" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "అనుసంధానమౌచున్నది" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "దోషము: 'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "దోషము: 'nm status': %s; allowed fields: %s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "నెట్వర్కునిర్వాహిక స్థితి" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "చేతనమైంది" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "అచేతనమైంది" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "నడుచుచున్నది" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "నడుచుటలేదు" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "దోషము: '--fields' విలువ '%s' యిక్కడ చెల్లునది కాదు; అనుమతించబడు క్షేత్రములు: %s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi చేతనమైంది" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "దోషము: చెల్లని 'wifi' పారామితి: '%s'." + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN చేతనమైంది" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "దోషము: చెల్లని 'wwan' పారామితి: '%s'." + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "దోషము: 'nm' ఆదేశము '%s' చెల్లనిది." + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "దోషము: ఆబ్జక్టు '%s' తెలియనిది, 'nmcli help' ప్రయత్నించు." + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "దోషము: ఐచ్చికము '--terse' రెండవ సమయాన్ని తెలిపినది." + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "దోషము: ఐచ్చికము '--terse' అనునది '--pretty'తో పరస్పరం విభేదించుచున్నది." + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "దోషము: ఐచ్చికము '--pretty' రెండవసారి తెలుపబడింది." + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "దోషము: ఐచ్చికము '--pretty' అనునది '--terse'తో పరస్పరం విభేదించుచున్నది." + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "దోషము: '%s' ఐచ్చికము కొరకు తప్పిపోయిన ఆర్గుమెంట్." + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "దోషము: '%s' అనునది '%s' ఐచ్చికము కొరకు చెల్లునటువంటి ఆర్గుమెంట్ కాదు." + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "దోషము: '%s' ఐచ్చికముల కొరకు క్షేత్రములు అనునవి తప్పిపోవుచున్నవి." + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli సాధనము, వర్షన్ %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "దోషము: ఐచ్చికము '%s' తెలియనిది, 'nmcli -help' ప్రయత్నించుము." + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "సిగ్నల్ %d వచ్చింది, మూసివేయుచున్నది..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "దోషము: నెట్వర్కునిర్వాహికకు అనుసంధానము కాలేకపోయింది." + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "సఫలంమైంది" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d (104/128-bit passphrase)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d (తెలియని)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0 (తెలియని)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "ఏదైనా, " + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "స్వయంచాలక" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "అమర్చ లేదు" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "క్షేత్రము '%s' వొంటరిగా వుండాలి" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "క్షేత్రము '%s' చెల్లనిది" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "ఐచ్చికము '--terse' కు '--fields' తెలుపుట అవసరము" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "ఐచ్చికము '--terse' కు ప్రత్యేకించి '--fields' ఐచ్చికము విలువలు అవసరము , '%s' కాదు" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM కీ ఫైలు అంత్య టాగ్ '%s' కలిగిలేదు." + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "PEM వ్యక్తిగత కీ ఫైలువలె అనిపించుటలేదు." + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "PEM ఫైలు డాటాను నిల్వవుంచుటకు సరిపోవు మెమొరి లేదు." + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "తప్పుగావున్న PEM ఫైలు: Proc-Type మొదటి టాగ్ కాదు." + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "తప్పుగావున్న PEM ఫైలు: తెలియని Proc-Type టాగ్ '%s'." + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "తప్పుగావున్న PEM దస్త్రము: DEK-Info రెండవ టాగ్ కాదు." + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "తప్పుగావున్న PEM ఫైలు: DEK-Info టాగ్‌నందు IV కనబడలేదు." + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "తప్పుగావున్న PEM ఫైలు: DEK-Info టాగ్‌నందు చెల్లని ఫార్మాట్." + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "తప్పుగావున్న PEM ఫైలు: తెలియని వ్యక్తిగత కీ సైఫర్ '%s'." + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "వ్యక్తిగత కీను డీకోడ్ చేయలేక పోయింది." + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM దృవీకరణపత్రము '%s' అంత్య టాగ్‌ '%s'ను కలిగిలేదు." + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "దృవీకరణపత్రమును డీకోడ్ చేయుటకు విఫలమైంది." + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "దృవీకరణపత్రము డాటాను నిల్వవుంచుటకు సరిపోని మెమొరి." + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "ఫైల్ డాటాను నిల్వవుంచుటకు సరిపోవు మెమొరీ లేదు." + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV పొడవు తప్పక సరిసంఖ్య బైట్లలోనే వుండాలి." + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "IV నిల్వవుంచుటకు సరిపోవునంత మెమొరి లేదు." + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV నాన్-హెక్సాడెసిమల్ సంఖ్యలను కలిగివుంది." + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "వ్యక్తిగత కీ సైఫర్ '%s' అనునది తెలియనిది." + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటకు సరిపోవునంత మెమొరీలేదు." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "వ్యక్తిగత కీ రకమును నిర్ణయించలేక పోయింది." + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "డీక్రిప్టు చేసిన వ్యక్తిగత కీను నిల్వవుంచుటకు సరిపోవునంత మెమొరీలేదు." + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "క్రిప్టో యింజన్‌ను సిద్దముచేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "MD5 యింజన్ సిద్దము చేయుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "చెల్లని IV పొడవు (తప్పక కనీసం %zd అయివుండాలి)." + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "డిక్రిప్టెడ్ కీ బఫర్ కొరకు సరిపోవునంత మెమొరి లేదు." + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "డిక్రిప్షన్ సైఫర్ కాంటెస్టును సిద్దము చేయుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "వివరణ కొరకు సిమెట్రిక్ కీను అమర్చుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "వివరణ కొరకు IV అమర్చుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: అనుకోని పాడింగ్ పొడవు." + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "ఎన్క్రిప్టింగ్ కొరకు మెమొరీ కేటాయించలేక పోయింది." + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "ఎన్క్రిప్షన్ సైఫర్ కాంటెస్టును సిద్దము చేయుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "ఎన్క్రిప్షన్ కొరకు సిమెట్రిక్ కీను అమర్చుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "ఎన్క్రిప్షన్ కొరకు IV అమర్చుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "డాటాను ఎన్క్రిప్టు చేయుటలో విఫలమైంది: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "దృవీకరణపత్రం డాటాను సిద్దపరచుటలో దోషము: %s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "దృవీకరణపత్రమును డీకోడ్ చేయలేక పోయింది: %s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "PKCS#12 డీకోడర్‌ను సిద్దపరచలేక పోయింది: %s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "PKCS#12 ఫైలును డీకోడ్ పరచలేక పోయింది: %s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "PKCS#12 ఫైలును నిర్ధారించలేక పోయింది: %s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "క్రిప్టో యింజన్ సిద్దము చేయుటలో విఫలమైంది: %d." + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "MD5 కాంటెస్టును సిద్దము చేయుటలో విఫలమైంది: %d." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "చెల్లని IV పొడవు (తప్పక కనీసం %d వుండాలి)." + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "డిక్రిప్షన్ సైఫర్ స్లాట్‌ను సిద్దము చేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "వివరణ కొరకు సిమెట్రిక్ కీ అమర్చుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "వివరణ కొరకు IV అమర్చుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "వివరణ సందర్భమును సిద్దపరచుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: %d." + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "వ్యక్తిగత కీను డిక్రిప్టు చేయుటలో విఫలమైంది: డిక్రిప్టు చేసిన డాటా మరీ పెద్దది." + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "వ్యక్తిగత కీ యొక్క డిక్రిప్షన్ ఖరారు చేయుటలో విఫలమైంది: %d." + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "ఎన్క్రిప్షన్ సైఫర్ స్లాట్‌ను సిద్దముచేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "ఎన్క్రిప్షన్ కొరకు సిమ్మెట్రిక్ కీను అమర్చుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "ఎన్క్రిప్షన్ కొరకు IV అమర్చుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "ఎన్క్రిప్షన్ సందర్భమును సిద్దముచేయుటలో విఫలమైంది." + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "ఎన్క్రిప్టు చేయుటకు విఫలమైంది: %d." + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "ఎన్క్రిప్టు చేసిన తర్వాత అనుకోని డాటా మొత్తము." + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "దృవీకరణపత్రమును డీకోడ్ చేయలేక పోయింది: %d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "సంకేతపదమును UCS2కు మార్చలేక పోయింది: %d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "PKCS#12 డీకోడర్‌ను సిద్దము చేయలేక పోయింది: %d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "PKCS#12 ఫైలు డీకోడ్ చేయలేక పోయింది: %d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "PKCS#12 ఫైలు నిర్దారించలేక పోయింది: %d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "యాదృశ్చిక డాటాను జనియింపచేయలేక పోయింది." + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "ఎన్క్రిప్షన్ కీను తయారుచేయుటకు సరిపోవు మెమొరీ లేదు." + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "మెమొరీను PEM ఫైలు సృష్టీకరణ కొరకు కేటాయించలేక పోయింది." + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "IVను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "ఎన్క్రిప్టు చేసిన కీను PEM ఫైలునకు వ్రాయుటకు మెమొరీను కేటాయించలేక పోయింది." + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "PEM ఫైలు డాటా కొరకు మెమొరీను కేటాయించలేక పోయింది." + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "నెట్‌లింక్ సందేశమును ప్రోసెసింగ్ చేయుటలో దోషము: %s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "సాకెట్ నందు డాటా కొరకు వేచివుండునప్పుడు దోషము సంభవించినది" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకుకు అనుసంధానము కాలేకపోయింది: %s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "నెట్‌లింక్ హాండిల్ క్రెడెన్షియల్ పాసింగ్ చేతము చేయలేదు: %s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు హాండిల్‌ను కేటాయించలేక పోయింది: %s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "లింకు స్థితిని పర్యవేక్షించుటకు నెట్‌లింకు క్యాచీని కేటాయించలేక పోయింది: %s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "నెట్‌లింకు సమూహాన్ని చేర్చుకొనలేక పోయింది: %s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "లింకు క్యాచీని నవీకరించుటలో దోషము: %s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "చెల్లని ఐచ్చికము. చెల్లునటువంటి ఐచ్చికముల జాబితా కొరకు --help వుపయోగించండి.\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s. చెల్లునటువంటి ఐచ్చికముల జాబితా చూచుటకు దయచేసి --help వుపయోగించుము.\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# నెట్వర్కునిర్వాహిక ద్వారా సృష్టించబడింది\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# %sనుండి కలుపబడింది\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "ఎటువంటి వుపయోగకర DHCP క్లైంట్ కనుగొనబడలేదు." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "'dhclient' కనుగొనబడ గలదు." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "'dhcpcd' కనుగొనబడ గలదు." + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "మద్దతీయని DHCP క్లైంట్ '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "తెలియని లాగ్ స్థాయి '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "తెలియని లాగ్ డొమైన్ '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "గమనిక: libc రిజాల్వర్ 3 నామపు సేవికలకన్నా యెక్కువ వాటికి మద్దతివ్వలేదు." + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "క్రిందన జాబితాచేసివున్న నామపుసేవికలు గుర్తించబడక పోవచ్చును." + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "స్వయంచాలక %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "సిస్టమ్" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "రక్షిత WiFi నెట్వర్కు ద్వారా అనుసంధానపు భాగస్వామ్యము." + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "ఓపెన్ WiFi నెట్వర్కు ద్వారా అనుసంధానపు భాగస్వామ్యము" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "నిరంతర సిస్టమ్ హోస్టునామము మార్చుము" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "సిస్టమ్ అనుసంధానములను సవరించుము" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "సిస్టమ్ అమరికలు సవరించుటకు సిస్టమ్ పాలసి నిరోధిస్తుంది" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "నిరంతర సిస్టమ్ హోస్టునామమును సవరించుటను సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "రక్షిత WiFi నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "ఓపెన్ WiFi నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది" + diff --git a/po/th.po b/po/th.po new file mode 100644 index 00000000..aeb3df39 --- /dev/null +++ b/po/th.po @@ -0,0 +1,943 @@ +# Thai translation of NetworkManager. +# Copyright (C) 2007 Free Software Foundation, Inc. +# This file is distributed under the same license as the NetworkManager package. +# Isriya Paireepairit , 2006. +# Theppitak Karoonboonyanan , 2006-2007. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-01-23 23:12+0700\n" +"PO-Revision-Date: 2007-01-23 23:15+0700\n" +"Last-Translator: Theppitak Karoonboonyanan \n" +"Language-Team: Thai \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;" + +#: ../gnome/applet/applet-compat.c:171 ../gnome/applet/applet-dbus-info.c:926 +#, c-format +msgid "Passphrase for wireless network %s" +msgstr "วลีรหัสผ่านสำหรับเครือข่ายไร้สาย %s" + +#: ../gnome/applet/applet-dbus.c:274 +#, c-format +msgid "Connection to the wireless network '%s' failed." +msgstr "เชื่อมต่อไปยังเครือข่ายไร้สาย '%s' ไม่สำเร็จ" + +#: ../gnome/applet/applet-dbus.c:279 +msgid "Connection to the wired network failed." +msgstr "เชื่อมต่อไปยังเครือข่ายแบบมีสายไม่สำเร็จ" + +#: ../gnome/applet/applet.c:182 +msgid "Error displaying connection information:" +msgstr "เกิดปัญหาในการแสดงข้อมูลการเชื่อมต่อ:" + +#: ../gnome/applet/applet.c:200 +msgid "Could not find some required resources (the glade file)!" +msgstr "หาข้อมูลบางอย่างที่ต้องใช้ (แฟ้ม glade) ไม่พบ!" + +#: ../gnome/applet/applet.c:210 +msgid "No active connections!" +msgstr "ไม่มีการเชื่อมต่อที่ใช้งานอยู่!" + +#: ../gnome/applet/applet.c:227 +#, c-format +msgid "%d Mb/s" +msgstr "%d Mb/s" + +#: ../gnome/applet/applet.c:230 +#, c-format +msgid "Wired Ethernet (%s)" +msgstr "อีเทอร์เน็ตมีสาย (%s)" + +#: ../gnome/applet/applet.c:232 +#, c-format +msgid "Wireless Ethernet (%s)" +msgstr "อีเทอร์เน็ตไร้สาย (%s)" + +#: ../gnome/applet/applet.c:238 +msgid "Unknown" +msgstr "ไม่มีข้อมูล" + +#: ../gnome/applet/applet.c:330 ../gnome/applet/applet.c:357 +msgid "NetworkManager Applet" +msgstr "แอพเพล็ต NetworkManager" + +#: ../gnome/applet/applet.c:332 +msgid "" +"Copyright © 2004-2006 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"สงวนลิขสิทธิ์ © 2004-2006 Red Hat, Inc.\n" +"สงวนลิขสิทธิ์ © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:334 ../gnome/applet/applet.c:361 +msgid "" +"Notification area applet for managing your network devices and connections." +msgstr "แอพเพล็ตพื้นที่แจ้งเหตุสำหรับจัดการอุปกรณ์เครือข่ายและการเชื่อมต่อ" + +#: ../gnome/applet/applet.c:337 ../gnome/applet/applet.c:365 +msgid "translator-credits" +msgstr "" +"อิสริยะ ไพรีพ่ายฤทธิ์ \n" +"เทพพิทักษ์ การุญบุญญานันท์ " + +#: ../gnome/applet/applet.c:359 +msgid "" +"Copyright © 2004-2005 Red Hat, Inc.\n" +"Copyright © 2005-2006 Novell, Inc." +msgstr "" +"สงวนลิขสิทธิ์ © 2004-2005 Red Hat, Inc.\n" +"สงวนลิขสิทธิ์ © 2005-2006 Novell, Inc." + +#: ../gnome/applet/applet.c:421 +msgid "VPN Login Failure" +msgstr "ล็อกอิน VPN ไม่สำเร็จ" + +#: ../gnome/applet/applet.c:422 +#, c-format +msgid "Could not start the VPN connection '%s' due to a login failure." +msgstr "ไม่สามารถเริ่มการเชื่อมต่อ VPN '%s' เนื่องจากล็อกอินไม่สำเร็จ" + +#: ../gnome/applet/applet.c:426 +msgid "VPN Start Failure" +msgstr "เริ่มต้น VPN ไม่สำเร็จ" + +#: ../gnome/applet/applet.c:427 +#, c-format +msgid "" +"Could not start the VPN connection '%s' due to a failure launching the VPN " +"program." +msgstr "ไม่สามารถเริ่มการเชื่อมต่อ VPN '%s' เนื่องจากเรียกโปรแกรม VPN ไม่ได้" + +#: ../gnome/applet/applet.c:431 ../gnome/applet/applet.c:441 +msgid "VPN Connect Failure" +msgstr "เชื่อมต่อ VPN ไม่สำเร็จ" + +#: ../gnome/applet/applet.c:432 +#, c-format +msgid "Could not start the VPN connection '%s' due to a connection error." +msgstr "ไม่สามารถเริ่มการเชื่อมต่อ VPN '%s' เนื่องจากเกิดปัญหาในการเชื่อมต่อ" + +#: ../gnome/applet/applet.c:436 +msgid "VPN Configuration Error" +msgstr "ตั้งค่า VPN ผิดพลาด" + +#: ../gnome/applet/applet.c:437 +#, c-format +msgid "The VPN connection '%s' was not correctly configured." +msgstr "การเชื่อมต่อ VPN '%s' ตั้งค่าไว้ไม่ถูกต้อง" + +#: ../gnome/applet/applet.c:442 +#, c-format +msgid "" +"Could not start the VPN connection '%s' because the VPN server did not " +"return an adequate network configuration." +msgstr "" +"ไม่สามารถเริ่มการเชื่อมต่อ VPN '%s' เนื่องจากเซิร์ฟเวอร์ VPN " +"ส่งข้อมูลเครือข่ายกลับมาไม่พอกับที่ต้องการ" + +#: ../gnome/applet/applet.c:512 +msgid "VPN Login Message" +msgstr "ข้อความล็อกอิน VPN" + +#: ../gnome/applet/applet.c:737 ../gnome/applet/applet.c:2635 +#: ../gnome/applet/other-network-dialog.c:458 +#: ../gnome/applet/passphrase-dialog.c:228 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "แอพเพล็ต NetworkManager ไม่พบข้อมูลบางอย่างที่ต้องใช้ (ไม่พบแฟ้ม glade)" + +#: ../gnome/applet/applet.c:749 +#, c-format +msgid "The network device \"%s (%s)\" does not support wireless scanning." +msgstr "อุปกรณ์เครือข่าย \"%s (%s)\" ไม่สนับสนุนการค้นหาเครือข่ายไร้สาย" + +#: ../gnome/applet/applet.c:757 +#, c-format +msgid "The network device \"%s (%s)\" does not support link detection." +msgstr "อุปกรณ์เครือข่าย \"%s (%s)\" ไม่สนับสนุนการค้นหาเครือข่ายอัตโนมัติ" + +#. Note to translators: this is used if no essid is known +#: ../gnome/applet/applet.c:905 ../gnome/applet/applet.c:1103 +msgid "(unknown)" +msgstr "(ไม่รู้จัก)" + +#: ../gnome/applet/applet.c:911 +#, c-format +msgid "Preparing device %s for the wired network..." +msgstr "กำลังเตรียมอุปกรณ์ %s สำหรับเครือข่ายมีสาย..." + +#: ../gnome/applet/applet.c:913 +#, c-format +msgid "Preparing device %s for the wireless network '%s'..." +msgstr "กำลังเตรียมอุปกรณ์ %s สำหรับเครือข่ายไร้สาย '%s'..." + +#: ../gnome/applet/applet.c:921 +#, c-format +msgid "Configuring device %s for the wired network..." +msgstr "กำลังตั้งค่าอุปกรณ์ %s สำหรับเครือข่ายมีสาย..." + +#: ../gnome/applet/applet.c:923 +#, c-format +msgid "Attempting to join the wireless network '%s'..." +msgstr "กำลังติดต่อขอเข้าเครือข่ายไร้สาย '%s'..." + +#: ../gnome/applet/applet.c:931 +#, c-format +msgid "Waiting for Network Key for the wireless network '%s'..." +msgstr "กำลังคอยกุญแจเข้าสู่เครือข่ายไร้สาย '%s'..." + +#: ../gnome/applet/applet.c:939 ../gnome/applet/applet.c:949 +msgid "Requesting a network address from the wired network..." +msgstr "กำลังขอที่อยู่จากเครือข่ายมีสาย..." + +#: ../gnome/applet/applet.c:941 ../gnome/applet/applet.c:951 +#, c-format +msgid "Requesting a network address from the wireless network '%s'..." +msgstr "กำลังขอที่อยู่จากเครือข่ายไร้สาย '%s'..." + +#: ../gnome/applet/applet.c:959 +msgid "Finishing connection to the wired network..." +msgstr "เชื่อมต่อกับเครือข่ายมีสายสำเร็จ..." + +#: ../gnome/applet/applet.c:961 +#, c-format +msgid "Finishing connection to the wireless network '%s'..." +msgstr "เชื่อมต่อกับเครือข่ายไร้สาย '%s' สำเร็จ..." + +#: ../gnome/applet/applet.c:1078 +msgid "NetworkManager is not running" +msgstr "NetworkManager ไม่ได้ทำงานอยู่" + +#: ../gnome/applet/applet.c:1086 ../gnome/applet/applet.c:1843 +msgid "Networking disabled" +msgstr "ปิดการใช้งานเครือข่ายอยู่" + +#: ../gnome/applet/applet.c:1091 +msgid "No network connection" +msgstr "ไม่ได้เชื่อมกับเครือข่าย" + +#: ../gnome/applet/applet.c:1096 +msgid "Wired network connection" +msgstr "เชื่อมกับเครือข่ายมีสาย" + +#: ../gnome/applet/applet.c:1100 +msgid "Connected to an Ad-Hoc wireless network" +msgstr "เชื่อมต่อกับเครือข่ายไร้สายแบบ Ad-Hoc" + +#: ../gnome/applet/applet.c:1102 +#, c-format +msgid "Wireless network connection to '%s' (%d%%)" +msgstr "การเชื่อมต่อเครือข่ายไร้สาย '%s' (%d%%)" + +#: ../gnome/applet/applet.c:1123 +#, c-format +msgid "VPN connection to '%s'" +msgstr "เชื่อมต่อ VPN ไปยัง '%s'" + +#: ../gnome/applet/applet.c:1131 +#, c-format +msgid "VPN connecting to '%s'" +msgstr "กำลังเชื่อมต่อ VPN ไปยัง '%s'" + +#: ../gnome/applet/applet.c:1556 +msgid "_Connect to Other Wireless Network..." +msgstr "เ_ชื่อมต่อกับเครือข่ายไร้สายอื่น..." + +#: ../gnome/applet/applet.c:1577 +msgid "Create _New Wireless Network..." +msgstr "_สร้างเครือข่ายไร้สายใหม่..." + +#: ../gnome/applet/applet.c:1700 +msgid "_VPN Connections" +msgstr "_การเชื่อมต่อ VPN" + +#: ../gnome/applet/applet.c:1745 +msgid "_Configure VPN..." +msgstr "_ตั้งค่า VPN..." + +#: ../gnome/applet/applet.c:1749 +msgid "_Disconnect VPN..." +msgstr "ตั_ดการเชื่อมต่อ VPN..." + +#: ../gnome/applet/applet.c:1771 +msgid "_Dial Up Connections" +msgstr "_การเชื่อมต่อไดอัลอัพ" + +#. FIXME: We should save and then check the state of the devices and show Connect _or_ Disconnect for each item +#: ../gnome/applet/applet.c:1782 +#, c-format +msgid "Connect to %s..." +msgstr "เชื่อมต่อไปยัง %s..." + +#: ../gnome/applet/applet.c:1788 +#, c-format +msgid "Disconnect from %s..." +msgstr "ตัดการเชื่อมต่อจาก %s..." + +#: ../gnome/applet/applet.c:1837 +msgid "No network devices have been found" +msgstr "ไม่พบอุปกรณ์เครือข่ายในระบบ" + +#: ../gnome/applet/applet.c:2029 +msgid "NetworkManager is not running..." +msgstr "NetworkManager ไม่ได้ทำงานอยู่..." + +#. 'Enable Networking' item +#: ../gnome/applet/applet.c:2210 +msgid "Enable _Networking" +msgstr "เปิดใช้เ_ครือข่าย" + +#. 'Enable Wireless' item +#: ../gnome/applet/applet.c:2216 +msgid "Enable _Wireless" +msgstr "เปิดใช้ไ_ร้สาย" + +#. 'Connection Information' item +#: ../gnome/applet/applet.c:2222 +msgid "Connection _Information" +msgstr "_ข้อมูลการเชื่อมต่อ" + +#. Help item +#: ../gnome/applet/applet.c:2233 +msgid "_Help" +msgstr "_วิธีใช้" + +#. About item +#: ../gnome/applet/applet.c:2242 +msgid "_About" +msgstr "เ_กี่ยวกับ" + +#: ../gnome/applet/applet.c:2824 +msgid "" +"The NetworkManager applet could not find some required resources. It cannot " +"continue.\n" +msgstr "แอพเพล็ต NetworkManager หาข้อมูลที่ต้องการไม่สำเร็จ ไม่สามารถดำเนินการต่อได้\n" + +#: ../gnome/applet/wireless-security-option.c:157 +msgid "Open System" +msgstr "ระบบเปิด" + +#: ../gnome/applet/wireless-security-option.c:160 +msgid "Shared Key" +msgstr "ใช้กุญแจร่วมกัน" + +#: ../gnome/applet/wireless-security-option.c:208 +msgid "Automatic (Default)" +msgstr "อัตโนมัติ (ค่าปริยาย)" + +#: ../gnome/applet/wireless-security-option.c:215 +msgid "AES-CCMP" +msgstr "AES-CCMP" + +#: ../gnome/applet/wireless-security-option.c:223 +msgid "TKIP" +msgstr "TKIP" + +#: ../gnome/applet/wireless-security-option.c:231 +msgid "Dynamic WEP" +msgstr "WEP แบบผันแปร" + +#: ../gnome/applet/wso-none.c:53 +msgid "None" +msgstr "ไม่มี" + +#: ../gnome/applet/wso-wep-ascii.c:138 +msgid "WEP 64/128-bit ASCII" +msgstr "WEP 64/128 บิต แบบ ASCII" + +#: ../gnome/applet/wso-wep-hex.c:135 +msgid "WEP 64/128-bit Hex" +msgstr "WEP 64/128 บิต แบบฐานสิบหก" + +#: ../gnome/applet/wso-wep-passphrase.c:135 +msgid "WEP 128-bit Passphrase" +msgstr "WEP 128 บิต แบบวลีรหัสผ่าน" + +#: ../gnome/applet/wso-wpa-eap.c:237 +msgid "PEAP" +msgstr "PEAP" + +#: ../gnome/applet/wso-wpa-eap.c:238 +msgid "TLS" +msgstr "TLS" + +#: ../gnome/applet/wso-wpa-eap.c:239 +msgid "TTLS" +msgstr "TTLS" + +#: ../gnome/applet/wso-wpa-eap.c:247 ../src/nm-ap-security-wpa-eap.c:93 +#: ../src/nm-ap-security-wpa-eap.c:117 +msgid "WPA2 Enterprise" +msgstr "WPA2 เอนเทอร์ไพรส์" + +#: ../gnome/applet/wso-wpa-eap.c:249 ../src/nm-ap-security-wpa-eap.c:95 +#: ../src/nm-ap-security-wpa-eap.c:122 +msgid "WPA Enterprise" +msgstr "WPA เอนเทอร์ไพรส์" + +#: ../gnome/applet/wso-wpa-psk.c:178 +msgid "WPA2 Personal" +msgstr "WPA2 ส่วนบุคคล" + +#: ../gnome/applet/wso-wpa-psk.c:180 +msgid "WPA Personal" +msgstr "WPA ส่วนบุคคล" + +#: ../gnome/applet/eggtrayicon.c:134 +msgid "Orientation" +msgstr "แนววาง" + +#: ../gnome/applet/eggtrayicon.c:135 +msgid "The orientation of the tray." +msgstr "แนววางของถาด" + +#: ../gnome/applet/menu-items.c:88 +#, c-format +msgid "Wired Network (%s)" +msgstr "เครือข่ายมีสาย (%s)" + +#: ../gnome/applet/menu-items.c:91 +msgid "_Wired Network" +msgstr "เครือข่าย_มีสาย" + +#: ../gnome/applet/menu-items.c:162 +#, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "เครือข่ายไร้สาย (%s)" + +#: ../gnome/applet/menu-items.c:164 +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "เครือข่ายไร้สาย" + +#: ../gnome/applet/menu-items.c:343 +msgid " (invalid Unicode)" +msgstr " (รหัสยูนิโค้ดไม่ถูกต้อง)" + +#: ../gnome/applet/other-network-dialog.c:352 +#, c-format +msgid "" +"By default, the wireless network's name is set to your computer's name, %s, " +"with no encryption enabled" +msgstr "" +"ตามปกติแล้ว ชื่อเครือข่ายไร้สายจะใช้ชื่อเครื่องคอมพิวเตอร์ของคุณ (%s) โดยไม่เปิดใช้การเข้ารหัส" + +#: ../gnome/applet/other-network-dialog.c:358 +msgid "Create new wireless network" +msgstr "สร้างเครือข่ายไร้สายใหม่" + +#: ../gnome/applet/other-network-dialog.c:359 +msgid "" +"Enter the name and security settings of the wireless network you wish to " +"create." +msgstr "ป้อนชื่อ และข้อมูลด้านการรักษาความปลอดภัยของเครือข่ายไร้สายที่ต้องการสร้าง" + +#: ../gnome/applet/other-network-dialog.c:363 +msgid "Create New Wireless Network" +msgstr "สร้างเครือข่ายไร้สายใหม่" + +#: ../gnome/applet/other-network-dialog.c:368 +msgid "Existing wireless network" +msgstr "เครือข่ายไร้สายที่มีอยู่" + +#: ../gnome/applet/other-network-dialog.c:369 +msgid "Enter the name of the wireless network to which you wish to connect." +msgstr "ป้อนชื่อเครือข่ายไร้สายที่ต้องการเชื่อมต่อ" + +#: ../gnome/applet/other-network-dialog.c:371 +msgid "Connect to Other Wireless Network" +msgstr "เชื่อมต่อไปยังเครือข่ายไร้สายอื่น" + +#: ../gnome/applet/passphrase-dialog.c:215 +msgid "Error connecting to wireless network" +msgstr "เกิดข้อผิดพลาดในการเชื่อมต่อเครือข่ายไร้สาย" + +#: ../gnome/applet/passphrase-dialog.c:216 +msgid "" +"The requested wireless network requires security capabilities unsupported by " +"your hardware." +msgstr "เครือข่ายไร้สายที่ระบุ ต้องการความสามารถด้านการรักษาความปลอดภัยที่อุปกรณ์ของคุณไม่มี" + +#: ../gnome/applet/vpn-password-dialog.c:151 +#: ../gnome/applet/vpn-password-dialog.c:188 +#, c-format +msgid "Cannot start VPN connection '%s'" +msgstr "ไม่สามารถเริ่มการเชื่อมต่อ VPN '%s'" + +#: ../gnome/applet/vpn-password-dialog.c:154 +#, c-format +msgid "" +"Could not find the authentication dialog for VPN connection type '%s'. " +"Contact your system administrator." +msgstr "หาคำโต้ตอบสำหรับการเชื่อมต่อ VPN ชนิด '%s' ไม่พบ กรุณาติดต่อผู้ดูแลระบบของคุณ" + +#: ../gnome/applet/vpn-password-dialog.c:191 +#, c-format +msgid "" +"There was a problem launching the authentication dialog for VPN connection " +"type '%s'. Contact your system administrator." +msgstr "" +"เกิดปัญหาขณะเรียกส่วนโต้ตอบเพื่อยืนยันตัวบุคคลในการเชื่อมต่อ VPN ชนิด '%s' " +"กรุณาติดต่อผู้ดูแลระบบของคุณ" + +#: ../gnome/applet/applet.glade.h:1 +msgid " " +msgstr " " + +#: ../gnome/applet/applet.glade.h:2 +msgid "" +"Active Connection Information" +msgstr "ข้อมูลการเชื่อมต่อที่ใช้งานอยู่" + +#: ../gnome/applet/applet.glade.h:4 +#, no-c-format +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"เครือข่ายไร้สายต้องการวลีรหัสผ่าน\n" +"\n" +"คุณต้องป้อนวลีรหัสผ่าน หรือกุญแจเข้ารหัสลับ เพื่อเข้าสู่เครือข่ายไร้สาย '%s'" + +#: ../gnome/applet/applet.glade.h:8 +#, no-c-format +msgid "" +"Reduced Network Functionality\n" +"\n" +"%s It will not be completely functional." +msgstr "" +"เครือข่ายทำงานไม่เต็มความสามารถ\n" +"\n" +"%s เครือข่ายจะทำงานไม่สมบูรณ์" + +#: ../gnome/applet/applet.glade.h:12 +#, no-c-format +msgid "" +"Wireless Network Login Confirmation\n" +"\n" +"You have chosen to log in to the wireless network '%s'. If you are sure " +"that this wireless network is secure, click the checkbox below and " +"NetworkManager will not require confirmation on subsequent log ins." +msgstr "" +"ยืนยันการล็อกอินเข้าเครือข่ายไร้สาย\n" +"\n" +"คุณได้เลือกล็อกอินเข้าสู่เครือข่ายไร้สาย '%s' ถ้าคุณแน่ใจว่าเครือข่ายนี้ปลอดภัย " +"ให้คลิกตัวเลือกด้านล่าง และ NetworkManager จะไม่ถามยืนยันกับคุณอีก" + +#: ../gnome/applet/applet.glade.h:15 +msgid "Anonymous Identity:" +msgstr "ชื่อในระบบแบบนิรนาม:" + +#: ../gnome/applet/applet.glade.h:16 +msgid "Authentication:" +msgstr "การยืนยันตัวบุคคล:" + +#: ../gnome/applet/applet.glade.h:17 +msgid "Broadcast Address:" +msgstr "ที่อยู่บรอดแคสต์:" + +#: ../gnome/applet/applet.glade.h:18 +msgid "CA Certificate File:" +msgstr "แฟ้มใบรับรองของ CA:" + +#: ../gnome/applet/applet.glade.h:19 +msgid "C_onnect" +msgstr "เ_ชื่อมต่อ" + +#: ../gnome/applet/applet.glade.h:20 +msgid "Client Certificate File:" +msgstr "แฟ้มใบรับรองเครื่องลูกข่าย:" + +#: ../gnome/applet/applet.glade.h:21 +msgid "Connection Information" +msgstr "ข้อมูลการเชื่อมต่อ" + +#: ../gnome/applet/applet.glade.h:22 +msgid "Default Route:" +msgstr "เส้นทางปริยาย:" + +#: ../gnome/applet/applet.glade.h:23 +msgid "Destination Address:" +msgstr "ที่อยู่ปลายทาง:" + +#: ../gnome/applet/applet.glade.h:24 +msgid "Driver:" +msgstr "ไดรเวอร์:" + +#: ../gnome/applet/applet.glade.h:25 +msgid "EAP Method:" +msgstr "วิธีของ EAP:" + +#: ../gnome/applet/applet.glade.h:26 +msgid "Hardware Address:" +msgstr "หมายเลขฮาร์ดแวร์:" + +#: ../gnome/applet/applet.glade.h:27 +msgid "IP Address:" +msgstr "ที่อยู่ไอพี:" + +#: ../gnome/applet/applet.glade.h:28 +msgid "Identity:" +msgstr "ชื่อในระบบ:" + +#: ../gnome/applet/applet.glade.h:29 +msgid "Interface:" +msgstr "อินเทอร์เฟซ:" + +#: ../gnome/applet/applet.glade.h:30 +msgid "Key Type:" +msgstr "ชนิดกุญแจ:" + +#: ../gnome/applet/applet.glade.h:31 +msgid "Key management:" +msgstr "การจัดการกุญแจ:" + +#: ../gnome/applet/applet.glade.h:32 +msgid "Key:" +msgstr "กุญแจ:" + +#: ../gnome/applet/applet.glade.h:33 +msgid "" +"None\n" +"WEP 128-bit Passphrase\n" +"WEP 64/128-bit Hex\n" +"WEP 64/128-bit ASCII\n" +msgstr "" +"ไม่มี\n" +"WEP 128 บิต แบบวลีรหัสผ่าน\n" +"WEP 64/128 บิต แบบฐานสิบหก\n" +"WEP 64/128 บิต แบบ ASCII\n" + +#: ../gnome/applet/applet.glade.h:38 +msgid "" +"Open System\n" +"Shared Key" +msgstr "" +"ระบบเปิด\n" +"ใช้กุญแจร่วมกัน" + +#: ../gnome/applet/applet.glade.h:40 +msgid "Other Wireless Network..." +msgstr "เครือข่ายไร้สายอื่น..." + +#: ../gnome/applet/applet.glade.h:41 +msgid "Passphrase:" +msgstr "วลีรหัสผ่าน:" + +#: ../gnome/applet/applet.glade.h:42 +msgid "Password:" +msgstr "รหัสผ่าน:" + +#: ../gnome/applet/applet.glade.h:43 +msgid "Primary DNS:" +msgstr "DNS หลัก:" + +#: ../gnome/applet/applet.glade.h:44 +msgid "Private Key File:" +msgstr "แฟ้มกุญแจส่วนตัว:" + +#: ../gnome/applet/applet.glade.h:45 +msgid "Private Key Password:" +msgstr "รหัสผ่านกุญแจส่วนตัว:" + +#: ../gnome/applet/applet.glade.h:46 +msgid "Secondary DNS:" +msgstr "DNS สำรอง:" + +#: ../gnome/applet/applet.glade.h:47 +msgid "Select the CA Certificate File" +msgstr "เลือกแฟ้มใบรับรอง CA" + +#: ../gnome/applet/applet.glade.h:48 +msgid "Select the Client Certificate File" +msgstr "เลือกแฟ้มใบรับรองเครื่องลูกข่าย" + +#: ../gnome/applet/applet.glade.h:49 +msgid "Select the Private Key File" +msgstr "เลือกแฟ้มกุญแจส่วนตัว" + +#: ../gnome/applet/applet.glade.h:50 +msgid "Show key" +msgstr "แสดงกุญแจ" + +#: ../gnome/applet/applet.glade.h:51 +msgid "Show passphrase" +msgstr "แสดงวลีรหัสผ่าน" + +#: ../gnome/applet/applet.glade.h:52 +msgid "Show password" +msgstr "แสดงรหัสผ่าน" + +#: ../gnome/applet/applet.glade.h:53 +msgid "Show passwords" +msgstr "แสดงรหัสผ่าน" + +#: ../gnome/applet/applet.glade.h:54 +msgid "Speed:" +msgstr "ความเร็ว:" + +#: ../gnome/applet/applet.glade.h:55 +msgid "Subnet Mask:" +msgstr "ซับเน็ตแมสก์:" + +#: ../gnome/applet/applet.glade.h:56 +msgid "Type:" +msgstr "ชนิด:" + +#: ../gnome/applet/applet.glade.h:57 +msgid "User Name:" +msgstr "ชื่อผู้ใช้:" + +#: ../gnome/applet/applet.glade.h:58 +msgid "Wireless Network Key Required" +msgstr "ต้องการกุญแจเข้าเครือข่ายไร้สาย" + +#: ../gnome/applet/applet.glade.h:59 +msgid "Wireless _adapter:" +msgstr "_อุปกรณ์ไร้สาย:" + +#: ../gnome/applet/applet.glade.h:60 +msgid "_Always Trust this Wireless Network" +msgstr "เ_ชื่อถือเครือข่ายไร้สายนี้เสมอ" + +#: ../gnome/applet/applet.glade.h:61 +msgid "_Don't remind me again" +msgstr "ไ_ม่ต้องเตือนฉันอีก" + +#: ../gnome/applet/applet.glade.h:62 +msgid "_Fallback on this Network" +msgstr "ใช้เครือข่ายนี้_สำรองแทน" + +#: ../gnome/applet/applet.glade.h:63 +msgid "_Login to Network" +msgstr "_ล็อกอินเข้าเครือข่าย" + +#: ../gnome/applet/applet.glade.h:64 +msgid "_Network Name:" +msgstr "_ชื่อเครือข่าย:" + +#: ../gnome/applet/applet.glade.h:65 +msgid "_Wireless Security:" +msgstr "การรักษา_ความปลอดภัยเครือข่ายไร้สาย:" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:417 +msgid "Cannot add VPN connection" +msgstr "ไม่สามารถเพิ่มการเชื่อมต่อ VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:419 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "ไม่มีซอฟต์แวร์ VPN ที่เหมาะสมอยู่ในระบบ กรุณาติดต่อผู้ดูแลระบบ" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:461 +msgid "Cannot import VPN connection" +msgstr "ไม่สามารถนำเข้าการเชื่อมต่อ VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "ไม่มีซอฟต์แวร์ VPN แบบ '%s' ที่เหมาะสมจากแฟ้มนำเข้า '%s' กรุณาติดต่อผู้ดูแลระบบ" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:580 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "เกิดปัญหาในการรับข้อมูลการเชื่อมต่อ VPN '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:583 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "ไม่พบแฟ้ม UI สำหรับการเชื่อมต่อ VPN แบบ '%s' กรุณาติดต่อผู้ดูแลระบบ" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:727 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "ลบการเชื่อมต่อ VPN \"%s\" หรือไม่?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:730 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"ข้อมูลเกี่ยวกับการเชื่อมต่อ VPN \"%s\" จะสูญหายทั้งหมด และคุณอาจต้องสอบถามผู้ดูแลระบบ " +"เพื่อขอข้อมูลในการสร้างการเชื่อมต่อใหม่" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:924 +msgid "Unable to load" +msgstr "โหลดไม่สำเร็จ" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:926 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "ไม่พบข้อมูลบางอย่างที่ต้องใช้ (แฟ้ม glade)!" + +#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), +#. NULL, +#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, +#. GTK_STOCK_CANCEL, +#. GTK_RESPONSE_REJECT, +#. GTK_STOCK_APPLY, +#. GTK_RESPONSE_ACCEPT, +#. NULL)); +#: ../gnome/vpn-properties/nm-vpn-properties.c:1081 +msgid "Create VPN Connection" +msgstr "สร้างการเชื่อมต่อ VPN" + +#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); +#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); +#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); +#. make the druid window modal wrt. our main window +#. gtk_window_set_modal (druid_window, TRUE); +#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1099 +msgid "Edit VPN Connection" +msgstr "แก้ไขการเชื่อมต่อ VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "เพิ่มการเชื่อมต่อ VPN ใหม่" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Delete the selected VPN connection" +msgstr "ลบการเชื่อมต่อ VPN ที่เลือก" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "E_xport" +msgstr "_ส่งออก" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Edit the selected VPN connection" +msgstr "แก้ไขการเชื่อมต่อ VPN ที่เลือก" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Export the VPN settings to a file" +msgstr "ส่งออกข้อมูลการเชื่อมต่อ VPN ออกเป็นแฟ้ม" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Export the selected VPN connection to a file" +msgstr "ส่งออกข้อมูลการเชื่อมต่อ VPN ที่เลือกออกเป็นแฟ้ม" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Manage Virtual Private Network Connections" +msgstr "จัดการเชื่อมต่อ Virtual Private Network" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "VPN Connections" +msgstr "การเชื่อมต่อ VPN" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "WEP 40 บิต" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "WEP 104 บิต" + +#: ../src/nm-ap-security-wpa-psk.c:51 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:53 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:55 +msgid "WPA Automatic" +msgstr "WPA อัตโนมัติ" + +#: ../src/nm-ap-security-wpa-psk.c:60 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:62 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:64 +msgid "WPA2 Automatic" +msgstr "WPA2 อัตโนมัติ" + +#: ../src/nm-ap-security.c:334 +msgid "none" +msgstr "ไม่มี" + +#: ../src/nm-netlink-monitor.c:174 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "ไม่สามารถสร้างซ็อกเก็ต netlink สำหรับติดตามอุปกรณ์อีเทอร์เน็ตแบบมีสายได้ - %s" + +#: ../src/nm-netlink-monitor.c:192 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "ไม่สามารถ bind กับซ็อกเก็ต netlink เพื่อติดตามอุปกรณ์อีเทอร์เน็ตแบบมีสายได้ - %s" + +#: ../src/nm-netlink-monitor.c:427 +msgid "operation took too long" +msgstr "การดำเนินการใช้เวลานานผิดปกติ" + +#: ../src/nm-netlink-monitor.c:524 +msgid "received data from wrong type of sender" +msgstr "ได้รับข้อมูลจากผู้ส่งไม่ถูกชนิด" + +#: ../src/nm-netlink-monitor.c:537 +msgid "received data from unexpected sender" +msgstr "ได้รับข้อมูลจากผู้ส่งที่ไม่ต้องการ" + +#: ../src/nm-netlink-monitor.c:666 +msgid "too much data was sent over socket and some of it was lost" +msgstr "ข้อมูลถูกส่งผ่านซ็อกเก็ตมากเกินไป และบางส่วนสูญหาย" + +#: ../src/nm-netlink-monitor.c:774 +msgid "error occurred while waiting for data on socket" +msgstr "เกิดปัญหาระหว่างรอข้อมูลจากซ็อกเก็ต" + +#: ../gnome/applet/applet-dbus-devices.c:930 +#, c-format +msgid "You are now connected to the Ad-Hoc wireless network '%s'." +msgstr "คุณเชื่อมต่อกับเครือข่ายไร้สายแบบ Ad-Hoc '%s' แล้ว" + +#: ../gnome/applet/applet-dbus-devices.c:935 +#, c-format +msgid "You are now connected to the wireless network '%s'." +msgstr "คุณเชื่อมต่อกับเครือข่ายไร้สาย '%s' แล้ว" + +#: ../gnome/applet/applet-dbus-devices.c:942 +msgid "You are now connected to the wired network." +msgstr "คุณเชื่อมต่อกับเครือข่ายแบบมีสายแล้ว" + +#: ../gnome/applet/applet-dbus-devices.c:948 +msgid "Connection Established" +msgstr "เชื่อมต่อเครือข่ายแล้ว" + +#: ../gnome/applet/applet-dbus-devices.c:997 +msgid "Disconnected" +msgstr "ตัดการเชื่อมต่อแล้ว" + +#: ../gnome/applet/applet-dbus-devices.c:998 +msgid "The network connection has been disconnected." +msgstr "การเชื่อมต่อเครือข่ายถูกตัดแล้ว" + +#: ../src/nm-ap-security-leap.c:66 ../src/nm-ap-security-leap.c:82 +msgid "LEAP" +msgstr "LEAP" diff --git a/po/uk.po b/po/uk.po new file mode 100644 index 00000000..40850710 --- /dev/null +++ b/po/uk.po @@ -0,0 +1,222 @@ +# Ukrainian translation of NetworkManager +# Copyright (C) Free Software Foundation, 2005 +# This file is distributed under the same license as the NetworkManager package. +# Maxim Dziumanenko , 2005-2007 +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-02-16 15:51+0200\n" +"PO-Revision-Date: 2007-02-16 03:32+0200\n" +"Last-Translator: Maxim Dziumanenko \n" +"Language-Team: Ukrainian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\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" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:417 +msgid "Cannot add VPN connection" +msgstr "Не вдається додати з'єднання VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:419 +msgid "" +"No suitable VPN software was found on your system. Contact your system " +"administrator." +msgstr "" +"У системі не встановлено потрібне програмне забезпечення VPN. Зв'яжіться з " +"системним адміністратором." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:461 +msgid "Cannot import VPN connection" +msgstr "Не вдається імпортувати з'єднання VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:463 +#, c-format +msgid "" +"Cannot find suitable software for VPN connection type '%s' to import the " +"file '%s'. Contact your system administrator." +msgstr "" +"Не вдається знайти відповідне програмне забезпечення для з'єднань VPN типу '%" +"s', щоб імпортувати файл '%s'. Зв'яжіться з системним адміністратором." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:580 +#, c-format +msgid "Error retrieving VPN connection '%s'" +msgstr "Помилка отримання з'єднання VPN '%s'" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:583 +#, c-format +msgid "" +"Could not find the UI files for VPN connection type '%s'. Contact your " +"system administrator." +msgstr "" +"Не вдається знайти файли графічного інтерфейсу для з'єднання VPN типу '%s'. " +"Зв'яжіться з системним адміністратором." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:727 +#, c-format +msgid "Delete VPN connection \"%s\"?" +msgstr "Видалити з'єднання VPN \"%s\"?" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:730 +#, c-format +msgid "" +"All information about the VPN connection \"%s\" will be lost and you may " +"need your system administrator to provide information to create a new " +"connection." +msgstr "" +"Уся інформація про з'єднання VPN \"%s\" буде втрачена. Можливо, вам " +"доведеться звернутись до системного адміністратора за інформацією для " +"створення нового з'єднання." + +#: ../gnome/vpn-properties/nm-vpn-properties.c:924 +msgid "Unable to load" +msgstr "Не вдається завантажити" + +#: ../gnome/vpn-properties/nm-vpn-properties.c:926 +msgid "Cannot find some needed resources (the glade file)!" +msgstr "Не вдається знайти деякі необхідні ресурси (не знайдено файл glade)!" + +#. druid_window = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Create VPN Connection"), +#. NULL, +#. GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, +#. GTK_STOCK_CANCEL, +#. GTK_RESPONSE_REJECT, +#. GTK_STOCK_APPLY, +#. GTK_RESPONSE_ACCEPT, +#. NULL)); +#: ../gnome/vpn-properties/nm-vpn-properties.c:1081 +msgid "Create VPN Connection" +msgstr "Створення з'єднання VPN" + +#. gtk_container_add (GTK_CONTAINER (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label"))); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(druid), TRUE,TRUE,0); +#. gtk_box_pack_start (GTK_BOX (druid_window->vbox), GTK_WIDGET(gtk_label_new("Some label")), TRUE,TRUE,0); +#. toplevel = gtk_widget_get_toplevel (GTK_WIDGET (druid)); +#. gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event", GTK_SIGNAL_FUNC (vpn_window_close), NULL); +#. make the druid window modal wrt. our main window +#. gtk_window_set_modal (druid_window, TRUE); +#. gtk_window_set_transient_for (GTK_WINDOW(druid_window), GTK_WINDOW (dialog)); +#. Edit dialog +#: ../gnome/vpn-properties/nm-vpn-properties.c:1099 +msgid "Edit VPN Connection" +msgstr "Правка з'єднання VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:1 +msgid "Add a new VPN connection" +msgstr "Додати нове з'єднання VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:2 +msgid "Delete the selected VPN connection" +msgstr "Видалити виділені з'єднання VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:3 +msgid "E_xport" +msgstr "_Експорт" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:4 +msgid "Edit the selected VPN connection" +msgstr "Редагувати виділене з'єднання VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:5 +msgid "Export the VPN settings to a file" +msgstr "Експортувати параметри VPN у файл" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:6 +msgid "Export the selected VPN connection to a file" +msgstr "Експортувати виділене з'єднання VPN у файл" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:7 +msgid "Manage Virtual Private Network Connections" +msgstr "Керування з'єднаннями VPN" + +#: ../gnome/vpn-properties/nm-vpn-properties.glade.h:8 +msgid "VPN Connections" +msgstr "Налаштовування VPN" + +#: ../src/nm-ap-security-wep.c:52 +msgid "40-bit WEP" +msgstr "40-bit WEP" + +#: ../src/nm-ap-security-wep.c:54 +msgid "104-bit WEP" +msgstr "104-bit WEP" + +#: ../src/nm-ap-security-wpa-psk.c:51 +msgid "WPA TKIP" +msgstr "WPA TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:53 +msgid "WPA CCMP" +msgstr "WPA CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:55 +msgid "WPA Automatic" +msgstr "WPA Automatic" + +#: ../src/nm-ap-security-wpa-psk.c:60 +msgid "WPA2 TKIP" +msgstr "WPA2 TKIP" + +#: ../src/nm-ap-security-wpa-psk.c:62 +msgid "WPA2 CCMP" +msgstr "WPA2 CCMP" + +#: ../src/nm-ap-security-wpa-psk.c:64 +msgid "WPA2 Automatic" +msgstr "WPA2 Automatic" + +#: ../src/nm-ap-security.c:326 +msgid "none" +msgstr "немає" + +#: ../src/nm-netlink-monitor.c:174 +#, c-format +msgid "" +"unable to create netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"не вдається створити мережний сокет для контролю пристрою ethernet - %s" + +#: ../src/nm-netlink-monitor.c:192 +#, c-format +msgid "" +"unable to bind to netlink socket for monitoring wired ethernet devices - %s" +msgstr "" +"не вдається прив'язатись до мережного сокету для контролю пристрою ethernet " +"- %s" + +#: ../src/nm-netlink-monitor.c:427 +msgid "operation took too long" +msgstr "операція виконується надто довго" + +#: ../src/nm-netlink-monitor.c:524 +msgid "received data from wrong type of sender" +msgstr "отримано дані з неправильним типом відправника" + +#: ../src/nm-netlink-monitor.c:537 +msgid "received data from unexpected sender" +msgstr "отримано дані з несподіваним відправником" + +#: ../src/nm-netlink-monitor.c:666 +msgid "too much data was sent over socket and some of it was lost" +msgstr "через сокет надто багато даних надіслано, та частину з них втрачено" + +#: ../src/nm-netlink-monitor.c:774 +msgid "error occurred while waiting for data on socket" +msgstr "помилка при очікуванні даних з сокету" + +#: ../src/nm-ap-security-wpa-eap.c:93 ../src/nm-ap-security-wpa-eap.c:112 +msgid "WPA2 Enterprise" +msgstr "WPA2 Enterprise" + +#: ../src/nm-ap-security-wpa-eap.c:95 ../src/nm-ap-security-wpa-eap.c:115 +msgid "WPA Enterprise" +msgstr "WPA Enterprise" + +#: ../src/nm-ap-security-leap.c:66 ../src/nm-ap-security-leap.c:80 +msgid "LEAP" +msgstr "LEAP" + diff --git a/po/vi.po b/po/vi.po new file mode 100644 index 00000000..cca7c1bf --- /dev/null +++ b/po/vi.po @@ -0,0 +1,253 @@ +# Vietnamese translation for Network Manager. +# Copyright © 2008 Free Software Foundation, Inc. +# Clytie Siddall , 2006-2008. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager GNOME TRUNK\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-05-19 07:43+0000\n" +"PO-Revision-Date: 2008-06-06 15:18+0930\n" +"Last-Translator: Clytie Siddall \n" +"Language-Team: Vietnamese \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: LocFactoryEditor 1.7b3\n" + +#: ../src/nm-netlink-monitor.c:193 +#: ../src/nm-netlink-monitor.c:471 +#, c-format +msgid "error processing netlink message: %s" +msgstr "gặp lỗi khi xử lý thông điệp netlink : %s" + +#: ../src/nm-netlink-monitor.c:250 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "" +"không thể cấp phát bộ xử lý netlink để theo dõi trạng thái của liên kết: %s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "" +"không thể kết nối tới netlink để theo dõi trạng thái của liên kết: %s" + +#: ../src/nm-netlink-monitor.c:268 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "" +"không thể vào nhóm netlink để theo dõi trạng thái của liên kết: %s" + +#: ../src/nm-netlink-monitor.c:276 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "" +"không thể cấp phát vùng nhớ tạm liên kết netlink để theo dõi trạng thái của liên kết: %s" + +#: ../src/nm-netlink-monitor.c:494 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "gặp lỗi khi đợi dữ liệu trên ổ cắm" + +#: ../src/NetworkManager.c:254 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "" +"Tùy chọn không hợp lệ. Hãy sử dụng tùy chọn trợ giúp « --help » để xem một danh sách các tùy chọn hợp lệ.\n" + +#: ../src/named-manager/nm-named-manager.c:218 +msgid "NOTE: the glibc resolver does not support more than 3 nameservers." +msgstr "GHI CHÚ : hàm giải quyết glibc chỉ hỗ trợ đến 3 máy phục vụ tên." + +#: ../src/named-manager/nm-named-manager.c:220 +msgid "The nameservers listed below may not be recognized." +msgstr "Những máy phục vụ tên được liệt kê dưới đây có lẽ không nhận ra được." + +#: ../system-settings/src/main.c:349 +#, c-format +msgid "Auto %s" +msgstr "Tự động %s" + +#: ../libnm-util/crypto.c:123 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "Tập tin khoá PEM không có thẻ đuôi « %s »." + +#: ../libnm-util/crypto.c:133 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "Không hỉnh như một tập tin khoá riêng PEM." + +#: ../libnm-util/crypto.c:141 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "Không đủ bộ nhớ để chứa dữ liệu tập tin PEM." + +#: ../libnm-util/crypto.c:157 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "Tập tin PEM dạng sai: Proc-Type không phải thẻ đầu tiên." + +#: ../libnm-util/crypto.c:165 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "Tập tin PEM dạng sai: thẻ Proc-Type không rõ « %s »." + +#: ../libnm-util/crypto.c:175 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "Tập tin PEM dạng sai: DEK-info không phải thẻ thứ hai." + +#: ../libnm-util/crypto.c:186 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "Tập tin PEM dạng sai: không tìm thấy IV trong thẻ DEK-info." + +#: ../libnm-util/crypto.c:193 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "Tập tin PEM dạng sai: IV định dạng sai trong thẻ DEK-info." + +#: ../libnm-util/crypto.c:206 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "Tập tin PEM dạng sai: không rõ mật mã khoá riêng « %s »." + +#: ../libnm-util/crypto.c:225 +#, c-format +msgid "Could not decode private key." +msgstr "Không thể giải mã khoá riêng." + +#: ../libnm-util/crypto.c:269 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "Chứng nhận PEM « %s » không có thẻ đuôi « %s »." + +#: ../libnm-util/crypto.c:279 +#, c-format +msgid "Failed to decode certificate." +msgstr "Lỗi giải mã chứng nhận." + +#: ../libnm-util/crypto.c:288 +#: ../libnm-util/crypto.c:296 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "Không đủ bộ nhớ để chứa dữ liệu chứng nhận." + +#: ../libnm-util/crypto.c:326 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV phải có chiều dài là một số byte dương." + +#: ../libnm-util/crypto.c:335 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "Không đủ bộ nhớ để chứa IV." + +#: ../libnm-util/crypto.c:346 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV chứa chữ số khác thập phân." + +#: ../libnm-util/crypto.c:384 +#: ../libnm-util/crypto_gnutls.c:125 +#: ../libnm-util/crypto_nss.c:134 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "Không rõ mật mã khoá riêng « %s »." + +#: ../libnm-util/crypto.c:393 +#, c-format +msgid "Not enough memory to create private key decryption key." +msgstr "Không đủ bộ nhớ để tạo khoá giải mã khoá riêng." + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "Không đủ bộ nhớ để chứa khoá riêng đã giải mã." + +#: ../libnm-util/crypto_gnutls.c:72 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "Lỗi sơ khởi cơ chế MD5: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:134 +#: ../libnm-util/crypto_nss.c:143 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "Không đủ bộ nhớ cho vùng đệm khoá đã giải mã." + +#: ../libnm-util/crypto_gnutls.c:142 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "Lỗi sơ khởi ngữ cảnh mật mã giải mã: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:151 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "" +"Lỗi đặt khoá đối xứng để giải mã: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:160 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "Lỗi đặt IV để giải mã: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:169 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "Lỗi giải mã khoá riêng: %s / %s." + +#: ../libnm-util/crypto_gnutls.c:207 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "Gặp lỗi khi sơ khởi dữ liệu chứng nhận: %s" + +#: ../libnm-util/crypto_gnutls.c:219 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "Không thể giải mã chứng nhận: %s" + +#: ../libnm-util/crypto_nss.c:76 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "Lỗi sơ khởi ngữ cảnh MD5: %d." + +#: ../libnm-util/crypto_nss.c:151 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "" +"Lỗi sơ khởi khoảng trống mật mã giải mã." + +#: ../libnm-util/crypto_nss.c:161 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "Lỗi đặt khoá đối xứng để giải mã." + +#: ../libnm-util/crypto_nss.c:171 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "Lỗi đặt IV để giải mã." + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "" +"Lỗi sơ khởi ngữ cảnh giải mã." + +#: ../libnm-util/crypto_nss.c:192 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "Lỗi giải mã khoá riêng: %d." + +#: ../libnm-util/crypto_nss.c:204 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "Lỗi làm xong tiến trình giải mã khoá riêng: %d." + +#: ../libnm-util/crypto_nss.c:248 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "Không thể giải mã chứng nhận: %d" diff --git a/po/wa.po b/po/wa.po new file mode 100644 index 00000000..41bccf2a --- /dev/null +++ b/po/wa.po @@ -0,0 +1,193 @@ +# translation of wa.po to Walloon +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) 2004 Free Software Foundation, Inc. +# Pablo Saratxaga , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: NetworkManager\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-10-19 13:38-0400\n" +"PO-Revision-Date: 2004-09-09 10:41+0200\n" +"Last-Translator: Pablo Saratxaga \n" +"Language-Team: Walloon \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" + +#: info-daemon/networks.glade:11 +msgid "Modify Wireless Networks" +msgstr "Candjî les rantoeles sins fyis" + +#: info-daemon/networks.glade:92 +msgid "Wireless Networks:" +msgstr "Rantoeles sins fyis:" + +#: info-daemon/passphrase.glade:9 +msgid "Wireless Network Key Required" +msgstr "I gn a mezåjhe d' ene clé d' ecriptaedje pol rantoele sins fyis" + +#: info-daemon/passphrase.glade:52 +msgid "_Login to Network" +msgstr "S' _elodjî sol rantoele" + +#: info-daemon/passphrase.glade:100 +#, fuzzy +msgid "" +"Passphrase Required by Wireless " +"Network\n" +"\n" +"A passphrase or encryption key is required to access the wireless network '%" +"s'." +msgstr "" +"Li rantoele sins fyis a mezåjhe d' on " +"scret\n" +"\n" +"I gn a mezåjhe d' on sicret ou d' ene clé WEP po-z aveur accès al rantoele " +"sins fyis «%s»." + +#: info-daemon/passphrase.glade:129 +msgid "Key Type:" +msgstr "" + +#: info-daemon/passphrase.glade:150 +msgid "" +"128-bit Passphrase\n" +"128-bit Raw Hex Key" +msgstr "" + +#: info-daemon/passphrase.glade:180 +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:101 +msgid "Passphrase:" +msgstr "Sicret:" + +#: info-daemon/passphrase.glade:208 panel-applet/essid.glade:162 +msgid "*" +msgstr "*" + +#: info-daemon/NetworkManagerInfoPassphraseDialog.c:104 +msgid "Key:" +msgstr "" + +#. Reuse the above string to make the translators less angry. +#: panel-applet/NMWirelessApplet.c:691 panel-applet/NMWirelessApplet.c:701 +msgid "" +"The NetworkManager Applet could not find some required resources (the glade " +"file was not found)." +msgstr "" +"L' aplikete manaedjresse di rantoeles n' a nén savou trover sacwantès " +"rsoûces k' end a mezåjhe (li fitchî glade n' a nén stî trové)." + +#: panel-applet/NMWirelessApplet.c:716 +#, fuzzy +msgid "Custom wireless network" +msgstr "Rantoeles sins fyis" + +#: panel-applet/NMWirelessApplet.c:717 +msgid "Enter the ESSID of the wireless network to which you wish to connect." +msgstr "" + +#: panel-applet/NMWirelessApplet.c:800 +#, fuzzy +msgid "Other Wireless Networks..." +msgstr "Rantoeles sins fyis" + +#: panel-applet/NMWirelessApplet.c:911 +msgid "No network devices have been found" +msgstr "" + +#: panel-applet/NMWirelessApplet.c:1028 +msgid "NetworkManager is not running..." +msgstr "Li manaedjeu d' rantoeles n' est nén en alaedje..." + +#: panel-applet/essid.glade:52 +msgid "C_onnect" +msgstr "" + +#: panel-applet/essid.glade:131 +#, fuzzy +msgid "Wireless _Network:" +msgstr "Rantoeles sins fyis" + +#: panel-applet/essid.glade:177 +#, fuzzy +msgid "Wireless _adapter:" +msgstr "Rantoeles sins fyis" + +#: panel-applet/menu-info.c:101 +#, fuzzy, c-format +msgid "Wired Network (%s)" +msgstr "Rantoeles sins fyis" + +#: panel-applet/menu-info.c:103 +#, fuzzy +msgid "Wired Network" +msgstr "Rantoeles sins fyis" + +#: panel-applet/menu-info.c:168 +#, fuzzy, c-format +msgid "Wireless Network (%s)" +msgid_plural "Wireless Networks (%s)" +msgstr[0] "Rantoeles sins fyis" +msgstr[1] "Rantoeles sins fyis" + +#: panel-applet/menu-info.c:170 +#, fuzzy +msgid "Wireless Network" +msgid_plural "Wireless Networks" +msgstr[0] "Rantoeles sins fyis" +msgstr[1] "Rantoeles sins fyis" + +#: panel-applet/menu-info.c:307 +msgid " (invalid Unicode)" +msgstr "" + +#: examples/python/systray/eggtrayicon.c:111 +msgid "Orientation" +msgstr "" + +#: examples/python/systray/eggtrayicon.c:112 +msgid "The orientation of the tray." +msgstr "" + +#~ msgid "There are no network devices..." +#~ msgstr "I gn a nou éndjin rantoele...." + +#~ msgid "There are no wireless networks..." +#~ msgstr "I gn a nole rantoele sins fyis..." + +#~ msgid "Network Connections" +#~ msgstr "Raloyaedjes rantoele" + +#~ msgid "No network connection is currently active..." +#~ msgstr "Nou raloyaedje rantoele en alaedje pol moumint..." + +#~ msgid "A wired network connection is currently active..." +#~ msgstr "On raloyaedje rantoele, mins so fyis, est en alaedje pol moumint..." + +#~ msgid "_About..." +#~ msgstr "Å_d fwait..." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen log in to the wireless network '%s'. If you are sure " +#~ "this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will no longer pester you with stupid questions when you " +#~ "connect to it." +#~ msgstr "" +#~ "Acertinaedje di l' elodjaedje al " +#~ "rantoele sins fyis\n" +#~ "\n" +#~ "Vos avoz tchoezi di vs elodjî al rantoele sins fyis «%s». Si vos estoz " +#~ "seur ki cisse rantoele la est fiyåve, clitchîz sol boesse a clitchî chal " +#~ "pa dzo, eyet l' manaedjeu di rantoeles ni vos pelrè pus avou ces kesses " +#~ "ci l' côp ki vént." + +#~ msgid "Always Trust this Wireless Network" +#~ msgstr "Aveur tofer fiyate dins cisse rantoele ci" diff --git a/po/zh_CN.po b/po/zh_CN.po new file mode 100644 index 00000000..d1e17ae8 --- /dev/null +++ b/po/zh_CN.po @@ -0,0 +1,1636 @@ +# translation of zh_CN.po to Wei Liu +# Simplified Chinese translation to NetworkManager +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. +# This file is distributed under the same license as the NetworkManager package. +# +# Funda Wang , 2004. +# Aron Xu , 2009. +# Leah Liu , 2010. +msgid "" +msgstr "" +"Project-Id-Version: zh_CN\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-10 19:25+1000\n" +"Last-Translator: Leah Liu \n" +"Language-Team: Wei Liu\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: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "名称" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "设备" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "范围" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "默认" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS 服务" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC 对象" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "类型" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "时间戳" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "真实时间戳" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "自动连接" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "只读" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"用法:nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "错误:'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "错误:'con list': %s;允许的字段:%s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "连接详情" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "系统" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "用户" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "从不" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "是" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "否" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "系统连接" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "用户连接" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "错误:缺少 %s 参数。" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "错误:%s - 没有这个连接。" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "未知参数:%s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "错误:没有指定有效参数。" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "错误:%s。" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "错误:'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "错误:'con status': %s;允许的字段:%s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "活跃连接" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "设备 '%s' 中没有活跃连接" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "没有活跃连接或者设备" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "设备 '%s' 不兼容连接 '%s'" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "没有找到可用于连接 '%s' 的设备" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "激活中" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "激活的" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "未知" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN 连接(准备)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN 连接中(需要验证)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN 连接中" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN 连接中(获取 IP 配置)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VNP 连接" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN 连接失败" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "断开 VPN 连接" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "未知原因" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "无" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "断开连接的用户" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "基点网络连接中断" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN 服务意外停止" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN 服务返回无效配置" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "连接尝试超时" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN 连接没有按时启动" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN 服务启动失败" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "没有有效 VPN secret" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "无效 VPN secret" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "连接被删除" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "状态:%s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "连接被激活\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "错误:激活连接失败。" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "状态:%s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "错误:激活连接失败:%s。" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "错误:超时 %d 秒过期。" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "错误:激活连接失败:%s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "错误:获取 '%s' 的活跃连接失败。" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "活跃连接状态:%s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "活跃连接路径:%s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "错误:未知连接:%s" + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "错误:超时值 '%s' 无效。" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "错误:必须指定 id 或者 uuid。" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "错误:没有找到合适的设备:%s。" + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "错误:没有找到合适的设备。" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "警告:连接没有激活\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "错误:'con' 命令 '%s' 无效。" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "错误:无法连接到 D-Bus。" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "错误:无法获得系统设置。" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "错误:无法获得用户设置。" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "错误:无法获得连接:设定服务没有运行。" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "设备" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "状态" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "常规" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "功能" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI 属性" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "有线连接属性" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4 设置" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "驱动程序" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "硬盘" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "容器探测" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "速度" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "容器" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "地址" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "前缀" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "网关" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "型号" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "频率" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "信号" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "安全性" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-标志" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-标志" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "活跃" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"用法:nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] | apinfo iface hwaddr ]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "未管理的" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "不可用的" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "断开连接" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "连接中(准备)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "连接中(配置中)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "连接中(需要验证)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "连接中(获得 IP 配置)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "连接的" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "连接失败" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "未知" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(无)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s:转换 IP4 地址 0x%X 出错" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "加密的:" + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP" + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA" + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2" + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "企业级" + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "Ad-Hoc" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "基础构架" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "错误:'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "错误:'dev list': %s;允许的字段:%s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "设备详情" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(未知)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "未知)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "开" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "关" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "错误:'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "错误:'dev status': %s;允许的字段:%s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "设备状态" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "错误:缺少 '%s' 参数。" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "错误:没有找到设备 '%s'。" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "成功:成功断开设备 '%s'。" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "错误:断开设备 '%s'(%s)失败:%s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "设备状态:%d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "错误:没有指定 iface。" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "错误:'dev wifi':%s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "错误:'dev wifi': %s;允许的字段:%s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi 扫描列表" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "错误:没有找到使用 hwaddr '%s' 的访问点。" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "错误:设备 '%s' 不是 WiFi 设备。" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "错误:'dev wifi' 命令 '%s' 无效。" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "错误:'dev' 命令 '%s' 无效。" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "运行中" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI 硬件" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN 硬件" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "连接中" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "错误:'nm status': %s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "错误:'nm status': %s;允许的字段:%s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "网络管理器状态" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "启用的" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "禁用的" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "运行中" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "没有运行" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "错误:'--fields' 值 '%s' 在此无效;允许的字段:%s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "启用 WiFi" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "错误:无效 'wifi' 参数:'%s'。" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "启用 WWAN" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "错误:无效 'wwan' 参数:'%s'。" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "错误:'nm' 命令 '%s' 无效。" + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"用法:%s [OPTIONS] OBJECT { COMMAND | help }\n" +"\n" +"OPTIONS\n" +" -t[erse] terse output\n" +" -p[retty] pretty output\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "错误:对象 '%s' 未知,尝试 'nmcli help'。" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "错误:第二此指定选项 '--terse'。" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "错误:选项 '--terse' 与 '--pretty' 相互排斥。" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "错误:第二次指定选项 '--pretty'。" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "错误:选项 '--pretty' 与 '--terse' 相互排斥。" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "错误:'%s' 选项缺少参数。" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "错误:'%s' 不是 '%s' 选项的有效参数。" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "错误:缺少 '%s' 选项字段。" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli 工具,版本 %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "错误:选项 '%s' 未知,尝试 'nmcli -help'。" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "捕获信号 %d,关闭中......" + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "错误:无法连接到网络管理器。" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "成功" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d (hex-ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d(104/128 位密码短语)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d(未知)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0(未知)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "任意," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz," + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz," + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz," + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz," + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz," + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz," + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz," + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz," + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz," + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz," + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz," + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "自动" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "未设置" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "字段 '%s' 必须是单独的" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "无效字段 '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "选项 '--terse' 要求指定 '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "选项 '--terse' 需要特定 '--fields' 选项值,不是 '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM 密钥文件没有结束标记“%s”。" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "不像是一个 PEM 私钥文件。" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "没有足够的空间储存 PEM 文件数据" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "错误的 PEM 文件格式:Proc-Type 不是第一个标记。" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "错误的 PEM 文件格式:未知的 Proc-Type 标记“%s”。" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "错误的 PEM 文件格式:DEK-Info 不是第二个标记。" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "错误的 PEM 文件格式:没有在 DEK-Info 标签找到初始向量。" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "错误的 PEM 文件格式:DEK-Info 标签中的初始向量格式无效。" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "对 PEM 文件进行操作:未知专用密钥 '%s'。" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "无法解码私钥。" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM 证书“%s”没有结束标记“%s”。" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "无法解码证书。" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "没有足够的空间存储证书数据。" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "没有足够的空间储存文件数据。" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV 长度必须是偶数字节。" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "没有足够的空间储存初始向量。" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "初始向量中包含非十六进制数字。" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "未知专用密钥密码 '%s'。" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "没有足够的空间解密私钥。" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "无法确定私钥类型。" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "没有足够的空间储存解密后的私钥。" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "初始化加密引擎失败。" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "初始化 MD5 引擎失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "无效 IV 长度(必须至少为 %zd)。" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "没有足够的空间作为已解密密钥缓冲。" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "初始化解密计算内容失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "为解密设定对称密钥失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "为解密设置初始向量失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "解密私钥失败:%s / %s" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "解密私钥失败:意外的填充长度。" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "解密私钥失败。" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "无法为加密分配内存。" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "初始化加密计算内容失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "为加密设置对称密钥失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "为加密设置 IV 失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "加密数据失败:%s / %s。" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "初始化证书数据出错:%s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "无法解码证书:%s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "无法初始化 PKCS#12 解码器:%s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "无法解码 PKCS#12 文件:%s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "无法校验 PKCS#12 文件:%s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "初始化加密引擎失败:%d。" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "初始化 MD5 环境失败:%d。" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "无效 IV 长度(必须至少 %d)。" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "初始化解密计算插槽失败。" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "为解密设置对称密钥失败。" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "为解密设置初始向量失败。" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "初始化解密环境失败。" + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "解密私钥失败:%d。" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "解密私钥失败:解密数据太大。" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "结束解密私钥失败:%d。" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "初始化加密计算插槽失败。" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "为加密设置对称密钥失败。" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "为加密设置 IV 失败。" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "初始化加密内容失败。" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "加密失败:%d。" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "加密后意外的数据量。" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "无法解码证书:%d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "无法将密码转换为 USC2 方式:%d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "无法初始化 PKCS#12 解码器:%d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "无法解码 PKCS#12 文件:%d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "无法校验 PKCS#12 文件:%d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "无法生成随机数据。" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "没有足够的空间生成加密密钥。" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "无法为创建 PEM 文件分配内存。" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "无法为在 PEM 文件中写入 IV 分配内存。" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "无法为在 PEM 文件中写入加密密钥分配内存。" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "无法为 PEM 文件数据分配内存。" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "处理网路信息出错:%s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "等候套接字上的数据时发生了错误" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "无法为监视连接状态连接到网路:%s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "无法启用网络链接句柄证书通过:%s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "无法为监视连接状态分配网路句柄:%s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "无法为监视连接状态分配网路连接:%s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "无法加入网络链接组群:%s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "更新链接缓存出错:%s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "无效选项。请使用 --help 查看有效选项列表。\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s。请使用 --help 查看有效选项列表。\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# 由 NetworkManger 创建\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# 合并自 %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "找到无法使用的 DHCP 客户端。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "找到 'dhclient'。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "找到 'dhcpcd'。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "不支持的 DHCP 客户端 '%s'" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "未知日志等级 '%s'" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "未知日志域 '%s'" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "注意:libc 解析器可能不支持超过三个名字服务器。" + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "以下列出的名字服务器可能无法被识别。" + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "自动 %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "系统" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "通过受保护的 WiFi 网络共享连接" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "通过公开 WiFi 网络共享连接" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "更改系统固有主机名" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "更改系统连接" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "系统策略阻止更改系统设置" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "系统策略阻止更改系统固有主机名" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "系统策略阻止使用受保护的 WiFi 网络共享连接" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "系统策略组织使用公开 WiFi 网络共享连接" + diff --git a/po/zh_HK.po b/po/zh_HK.po new file mode 100644 index 00000000..c56c2781 --- /dev/null +++ b/po/zh_HK.po @@ -0,0 +1,1004 @@ +# Chinese (Hong Kong) translation of Network Manager. +# Copyright (C) 2005 Free Software Foundation, Inc. +# Woodman Tuen , 2005. +# Chao-Hsiung Liao , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: Network Manager 0.7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-21 20:14+0800\n" +"PO-Revision-Date: 2008-08-22 20:13+0800\n" +"Last-Translator: Chao-Hsiung Liao \n" +"Language-Team: Chinese (Hong Kong) \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" + +#: ../src/nm-netlink-monitor.c:193 ../src/nm-netlink-monitor.c:474 +#, c-format +msgid "error processing netlink message: %s" +msgstr "處理 netlink 訊息時發生錯誤:%s" + +#: ../src/nm-netlink-monitor.c:439 +#, c-format +msgid "error updating link cache: %s" +msgstr "更新連線快取時發生錯誤:%s" + +#: ../src/NetworkManager.c:250 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "無效的選項。請使用 --help 來查看有效選項的清單。\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:87 +msgid "# Created by NetworkManager\n" +msgstr "# Created by NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:93 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Merged from %s\n" +"\n" + +#: ../src/named-manager/nm-named-manager.c:257 +msgid "NOTE: the glibc resolver does not support more than 3 nameservers." +msgstr "注意:glibc 解析器不支援 3 個以上的名稱伺服器。" + +#: ../src/named-manager/nm-named-manager.c:259 +msgid "The nameservers listed below may not be recognized." +msgstr "下面列出的名稱伺服器可能不會被辨識。" + +#: ../system-settings/src/main.c:365 +#, c-format +msgid "Auto %s" +msgstr "自動 %s" + +#: ../libnm-util/crypto.c:125 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM 密碼匙檔案沒有結束標籤「%s」。" + +#: ../libnm-util/crypto.c:135 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "看起來不像是 PEM 私密密碼匙檔案。" + +#: ../libnm-util/crypto.c:143 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "沒有足夠的記憶體可儲存 PEM 檔案資料。" + +#: ../libnm-util/crypto.c:159 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "格式不良的 PEM 檔案:Proc-Type 不是第一個標籤。" + +#: ../libnm-util/crypto.c:167 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "格式不良的 PEM 檔案:未知的 Proc-Type 標籤「%s」" + +#: ../libnm-util/crypto.c:177 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "格式不良的 PEM 檔案:DEK-Info 不是第二個標籤。" + +#: ../libnm-util/crypto.c:188 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "格式不良的 PEM 檔案:在 DEK-Info 標籤中找不到 IV。" + +#: ../libnm-util/crypto.c:195 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "格式不良的 PEM 檔案:DEK-Info 標籤中的 IV 格式是無效的。" + +#: ../libnm-util/crypto.c:208 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "格式不良的 PEM 檔案:未知的私密密碼匙加密器「%s」。" + +#: ../libnm-util/crypto.c:227 +#, c-format +msgid "Could not decode private key." +msgstr "無法解碼私密密碼匙。" + +#: ../libnm-util/crypto.c:271 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM 證書「%s」沒有結束標籤「%s」。" + +#: ../libnm-util/crypto.c:281 +#, c-format +msgid "Failed to decode certificate." +msgstr "解碼證書失敗。" + +#: ../libnm-util/crypto.c:290 ../libnm-util/crypto.c:298 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "沒有足夠的記憶體可儲存證書資料。" + +#: ../libnm-util/crypto.c:328 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV 的長度必須為偶數碼元組。" + +#: ../libnm-util/crypto.c:337 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "沒有足夠的記憶體可儲存 IV。" + +#: ../libnm-util/crypto.c:348 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV 包含非十六進位的數字。" + +#: ../libnm-util/crypto.c:386 ../libnm-util/crypto_gnutls.c:126 +#: ../libnm-util/crypto_nss.c:136 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "私密密碼匙加密器「%s」不明。" + +#: ../libnm-util/crypto.c:395 +#, c-format +msgid "Not enough memory to create private key decryption key." +msgstr "沒有足夠的記憶體可建立私密密碼匙的解密碼匙匙。" + +#: ../libnm-util/crypto.c:513 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "沒有足夠的記憶體可儲存解密的私密密碼匙。" + +#: ../libnm-util/crypto_gnutls.c:73 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "初始化 MD5 引擎失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:135 ../libnm-util/crypto_nss.c:145 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "沒有足夠的記憶體供作解密密碼匙緩衝區。" + +#: ../libnm-util/crypto_gnutls.c:143 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "初始化解密用的加密器失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:152 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "設定解密用的對稱式密碼匙失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:161 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "設定解密用的 IV 失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:170 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "解密私密密碼匙失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:208 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "初始化證書資料時發生錯誤:%s" + +#: ../libnm-util/crypto_gnutls.c:220 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "無法解碼證書:%s" + +#: ../libnm-util/crypto_nss.c:78 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "初始化 MD5 失敗:%d。" + +#: ../libnm-util/crypto_nss.c:153 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "初始化解密用的加密器插槽失敗。" + +#: ../libnm-util/crypto_nss.c:163 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "設定解密用的對稱式密碼匙失敗。" + +#: ../libnm-util/crypto_nss.c:173 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "設定解密用的 IV 失敗。" + +#: ../libnm-util/crypto_nss.c:181 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "初始化解密上下文失敗。" + +#: ../libnm-util/crypto_nss.c:194 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "解密私密密碼匙失敗:%d。" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "結束私密密碼匙的解密失敗:%d。" + +#: ../libnm-util/crypto_nss.c:250 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "無法解碼證書:%d" + +#: ../src/nm-netlink-monitor.c:250 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "無法配置 netlink 處理器以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:260 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "無法連結 netlink 以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:268 +#, c-format +msgid "unable to join netlink group for monitoring link status: %s" +msgstr "無法加入 netlink 羣組以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:276 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "無法配置 netlink 連線快取以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:497 +#, c-format +msgid "error occurred while waiting for data on socket" +msgstr "等待 socket 上的資料時發生錯誤" + +#~ msgid "Passphrase for wireless network %s" +#~ msgstr "無線網路 %s 的通行碼" + +#~ msgid "Connection to the wireless network '%s' failed." +#~ msgstr "連接無線網路‘%s’失敗。" + +#~ msgid "Connection to the wired network failed." +#~ msgstr "連接有線網路失敗。" + +#~ msgid "Error displaying connection information:" +#~ msgstr "顯示連線資訊時發生錯誤:" + +#~ msgid "Could not find some required resources (the glade file)!" +#~ msgstr "無法找到一些需要的資源(glade 檔)!" + +#~ msgid "No active connections!" +#~ msgstr "沒有使用中的連線" + +#~ msgid "%d Mb/s" +#~ msgstr "%d Mb/s" + +#~ msgid "Wired Ethernet (%s)" +#~ msgstr "有線乙太網路 (%s)" + +#~ msgid "Wireless Ethernet (%s)" +#~ msgstr "有線乙太網路 (%s)" + +#~ msgid "Unknown" +#~ msgstr "不明" + +#~ msgid "NetworkManager Applet" +#~ msgstr "NetworkManager 面板程式" + +#~ msgid "" +#~ "Copyright © 2004-2006 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "版權所有 (C) 2004-2006 Red Hat, Inc.\n" +#~ "版權所有 (C) 2005-2006 Novell, Inc." + +#~ msgid "" +#~ "Notification area applet for managing your network devices and " +#~ "connections." +#~ msgstr "管理網路裝置與連線的通知區面板程式。" + +#~ msgid "translator-credits" +#~ msgstr "" +#~ "如對翻譯有任何意見,請送一封電子郵件給\n" +#~ "以下地址,GNOME 翻譯團隊會盡快回覆您:\n" +#~ "community@linuxhall.org\n" +#~ "\n" +#~ "Woodman Tuen , 2005." + +#~ msgid "" +#~ "Copyright © 2004-2005 Red Hat, Inc.\n" +#~ "Copyright © 2005-2006 Novell, Inc." +#~ msgstr "" +#~ "版權所有 (C) 2004-2005 Red Hat, Inc.\n" +#~ "版權所有 (C) 2005-2006 Novell, Inc." + +#~ msgid "VPN Login Failure" +#~ msgstr "VPN 登入失敗" + +#~ msgid "Could not start the VPN connection '%s' due to a login failure." +#~ msgstr "因為登入失敗所以無法執行 VPN 連線‘%s’。" + +#~ msgid "VPN Start Failure" +#~ msgstr "VPN 啟動失敗" + +#~ msgid "" +#~ "Could not start the VPN connection '%s' due to a failure launching the " +#~ "VPN program." +#~ msgstr "因為執行 VPN 程式失敗所以無法建立 VPN 連線‘%s’。" + +#~ msgid "VPN Connect Failure" +#~ msgstr "VPN 連線失敗" + +#~ msgid "Could not start the VPN connection '%s' due to a connection error." +#~ msgstr "因為連線錯誤,所以無法啟動 VPN 連線‘%s’。" + +#~ msgid "VPN Configuration Error" +#~ msgstr "VPN 組態發生錯誤" + +#~ msgid "The VPN connection '%s' was not correctly configured." +#~ msgstr "VPN 連線‘%s’沒有設定正確。" + +#~ msgid "" +#~ "Could not start the VPN connection '%s' because the VPN server did not " +#~ "return an adequate network configuration." +#~ msgstr "因為 VPN 伺服器沒有傳回足夠的網路組態所以無法建立 VPN 連線‘%s’。" + +#~ msgid "VPN Login Message" +#~ msgstr "VPN 登入訊息" + +#~ msgid "" +#~ "The NetworkManager Applet could not find some required resources (the " +#~ "glade file was not found)." +#~ msgstr "NetworkManager 面板程式無法找到一些需要的資源(找不到 glade 檔)" + +#~ msgid "The network device \"%s (%s)\" does not support wireless scanning." +#~ msgstr "網路裝置“%s (%s)”不支援無線網路掃描。" + +#~ msgid "The network device \"%s (%s)\" does not support link detection." +#~ msgstr "網路裝置“%s (%s)”不支援連接偵測" + +#~ msgid "(unknown)" +#~ msgstr "(未知)" + +#~ msgid "Preparing device %s for the wired network..." +#~ msgstr "裝置 %s 正準備連接有線網路..." + +#~ msgid "Preparing device %s for the wireless network '%s'..." +#~ msgstr "裝置 %s 正準備連接無線網路‘%s’..." + +#~ msgid "Configuring device %s for the wired network..." +#~ msgstr "設定有線網路裝置 %s ..." + +#~ msgid "Attempting to join the wireless network '%s'..." +#~ msgstr "正在嘗試加入無線網路‘%s’..." + +#~ msgid "Waiting for Network Key for the wireless network '%s'..." +#~ msgstr "正在等待無線網路‘%s’的網路金鑰..." + +#~ msgid "Requesting a network address from the wired network..." +#~ msgstr "正要求有線網路提供網路位址..." + +#~ msgid "Requesting a network address from the wireless network '%s'..." +#~ msgstr "正要求無線網路‘%s’提供網路位址..." + +#~ msgid "Finishing connection to the wired network..." +#~ msgstr "連接有線網路完成..." + +#~ msgid "Finishing connection to the wireless network '%s'..." +#~ msgstr "連接無線網路‘%s’完成..." + +#~ msgid "NetworkManager is not running" +#~ msgstr "NetworkManager 沒有執行" + +#~ msgid "Networking disabled" +#~ msgstr "網路功能停用" + +#~ msgid "No network connection" +#~ msgstr "沒有網路連接" + +#~ msgid "Wired network connection" +#~ msgstr "有線網路連接" + +#~ msgid "Connected to an Ad-Hoc wireless network" +#~ msgstr "連接到 Ad-Hoc 點對點式無線網路" + +#~ msgid "Wireless network connection to '%s' (%d%%)" +#~ msgstr "無線網路連接到‘%s’ (%d%%)" + +#~ msgid "VPN connection to '%s'" +#~ msgstr "VPN 連線連接到‘%s’" + +#~ msgid "VPN connecting to '%s'" +#~ msgstr "VPN 連線至‘%s’" + +#~ msgid "_Connect to Other Wireless Network..." +#~ msgstr "連接到其它的無線網路(_C)..." + +#~ msgid "Create _New Wireless Network..." +#~ msgstr "建立新的無線網路(_N)..." + +#~ msgid "_VPN Connections" +#~ msgstr "_VPN 連線" + +#~ msgid "_Configure VPN..." +#~ msgstr "設定 VP_N..." + +#~ msgid "_Disconnect VPN..." +#~ msgstr "與 V_PN 斷線..." + +#~ msgid "_Dial Up Connections" +#~ msgstr "播接連線(_D)" + +#~ msgid "Connect to %s..." +#~ msgstr "連線到 %s..." + +#~ msgid "Disconnect from %s..." +#~ msgstr "與 %s 斷線..." + +#~ msgid "No network devices have been found" +#~ msgstr "找不到任何網路裝置" + +#~ msgid "NetworkManager is not running..." +#~ msgstr "NetworkManager 沒有執行...." + +#~ msgid "Enable _Networking" +#~ msgstr "啟用網路功能(_N)" + +#~ msgid "Enable _Wireless" +#~ msgstr "啟用無線網路(_W)" + +#~ msgid "Connection _Information" +#~ msgstr "連線資訊(_I)" + +#~ msgid "_Help" +#~ msgstr "求助(_H)" + +#~ msgid "_About" +#~ msgstr "關於(_A)" + +#~ msgid "" +#~ "The NetworkManager applet could not find some required resources. It " +#~ "cannot continue.\n" +#~ msgstr "NetworkManager 面板程式無法找到一些需要的資源。它無法繼續。\n" + +#~ msgid "Open System" +#~ msgstr "開放系統" + +#~ msgid "Shared Key" +#~ msgstr "分享金鑰" + +#~ msgid "Automatic (Default)" +#~ msgstr "自動(預設值)" + +#~ msgid "AES-CCMP" +#~ msgstr "AES-CCMP" + +#~ msgid "TKIP" +#~ msgstr "TKIP" + +#~ msgid "Dynamic WEP" +#~ msgstr "動態 WEP" + +#~ msgid "None" +#~ msgstr "None" + +#~ msgid "WEP 64/128-bit ASCII" +#~ msgstr "WEP 64/128-bit ASCII" + +#~ msgid "WEP 64/128-bit Hex" +#~ msgstr "WEP 64/128-bit Hex" + +#~ msgid "WEP 128-bit Passphrase" +#~ msgstr "WEP 128-bit 密語" + +#~ msgid "PEAP" +#~ msgstr "PEAP" + +#~ msgid "TLS" +#~ msgstr "TLS" + +#~ msgid "TTLS" +#~ msgstr "TTLS" + +#~ msgid "WPA2 Enterprise" +#~ msgstr "WPA2 企業版" + +#~ msgid "WPA Enterprise" +#~ msgstr "WPA 企業版" + +#~ msgid "WPA2 Personal" +#~ msgstr "WPA2 個人版" + +#~ msgid "WPA Personal" +#~ msgstr "WPA 個人版" + +#~ msgid "Orientation" +#~ msgstr "方向" + +#~ msgid "The orientation of the tray." +#~ msgstr "面板的方向" + +#~ msgid "Wired Network (%s)" +#~ msgstr "有線網路 (%s)" + +#~ msgid "_Wired Network" +#~ msgstr "有線網路(_W)" + +#~ msgid "Wireless Network (%s)" +#~ msgid_plural "Wireless Networks (%s)" +#~ msgstr[0] "無線網路 (%s)" + +#~ msgid "Wireless Network" +#~ msgid_plural "Wireless Networks" +#~ msgstr[0] "無線網路" + +#~ msgid " (invalid Unicode)" +#~ msgstr "(無效的統一碼)" + +#~ msgid "" +#~ "By default, the wireless network's name is set to your computer's name, %" +#~ "s, with no encryption enabled" +#~ msgstr "預設上無線網路的名稱是設為您的電腦名稱,%s,並不使用加密" + +#~ msgid "Create new wireless network" +#~ msgstr "建立新的無線網路" + +#~ msgid "" +#~ "Enter the name and security settings of the wireless network you wish to " +#~ "create." +#~ msgstr "輸入您要建立的無線網路的名稱及安全設定。" + +#~ msgid "Create New Wireless Network" +#~ msgstr "建立一個新的無線網路" + +#~ msgid "Existing wireless network" +#~ msgstr "現有的無線網路" + +#~ msgid "Enter the name of the wireless network to which you wish to connect." +#~ msgstr "輸入您要連接的無線網路的名稱。" + +#~ msgid "Connect to Other Wireless Network" +#~ msgstr "連接到其它的無線網路" + +#~ msgid "Error connecting to wireless network" +#~ msgstr "連接到無線網路發生錯誤" + +#~ msgid "" +#~ "The requested wireless network requires security capabilities unsupported " +#~ "by your hardware." +#~ msgstr "您的硬體不支援該無線網路所需的安全性機能。" + +#~ msgid "Cannot start VPN connection '%s'" +#~ msgstr "無法執行 VPN 連線‘%s’" + +#~ msgid "" +#~ "Could not find the authentication dialog for VPN connection type '%s'. " +#~ "Contact your system administrator." +#~ msgstr "找不到 VPN 連線類型‘%s’的驗證對話盒。請連絡您的系統管理者。" + +#~ msgid "" +#~ "There was a problem launching the authentication dialog for VPN " +#~ "connection type '%s'. Contact your system administrator." +#~ msgstr "執行 VPN 連線類型‘%s’的驗證對話盒時發生問題。請連絡您的系統管理者。" + +#~ msgid " " +#~ msgstr " " + +#~ msgid "" +#~ "Active Connection Information" +#~ msgstr "使用中的連線資訊:" + +#~ msgid "" +#~ "Passphrase Required by Wireless " +#~ "Network\n" +#~ "\n" +#~ "A passphrase or encryption key is required to access the wireless network " +#~ "'%s'." +#~ msgstr "" +#~ "無線網路通行碼請求\n" +#~ "\n" +#~ "需要一個通行碼或是密鑰來存取無線網路‘%s’" + +#~ msgid "" +#~ "Reduced Network Functionality\n" +#~ "\n" +#~ "%s It will not be completely functional." +#~ msgstr "" +#~ "簡化的網路功能\n" +#~ "\n" +#~ "%s 它並不能完整的作用。" + +#~ msgid "" +#~ "Wireless Network Login " +#~ "Confirmation\n" +#~ "\n" +#~ "You have chosen to log in to the wireless network '%s'. If you are sure " +#~ "that this wireless network is secure, click the checkbox below and " +#~ "NetworkManager will not require confirmation on subsequent log ins." +#~ msgstr "" +#~ "無線網路登入確認\n" +#~ "\n" +#~ "您已經選擇登入無線網路‘%s’。如果確定此無線網路是安全的,按下下面的核取方" +#~ "塊,NetworkManager 在接下來的登入就不會再要求確認。" + +#~ msgid "Anonymous Identity:" +#~ msgstr "匿名身分:" + +#~ msgid "Authentication:" +#~ msgstr "驗證方式:" + +#~ msgid "Broadcast Address:" +#~ msgstr "廣播位址:" + +#~ msgid "CA Certificate File:" +#~ msgstr "CA 憑證檔案:" + +#~ msgid "C_onnect" +#~ msgstr "連線(_O)" + +#~ msgid "Client Certificate File:" +#~ msgstr "客戶端憑證檔案:" + +#~ msgid "Connection Information" +#~ msgstr "連線資訊" + +#~ msgid "Default Route:" +#~ msgstr "預設路由:" + +#~ msgid "Destination Address:" +#~ msgstr "目的地位址:" + +#~ msgid "Driver:" +#~ msgstr "驅動程式:" + +#~ msgid "EAP Method:" +#~ msgstr "EAP 方法:" + +#~ msgid "Hardware Address:" +#~ msgstr "硬體位址:" + +#~ msgid "IP Address:" +#~ msgstr "IP 位址:" + +#~ msgid "Identity:" +#~ msgstr "身分:" + +#~ msgid "Interface:" +#~ msgstr "介面:" + +#~ msgid "Key Type:" +#~ msgstr "金鑰類型:" + +#~ msgid "Key management:" +#~ msgstr "金鑰管理:" + +#~ msgid "Key:" +#~ msgstr "金鑰:" + +#~ msgid "" +#~ "None\n" +#~ "WEP 128-bit Passphrase\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" +#~ msgstr "" +#~ "無\n" +#~ "WEP 128-bit 密語\n" +#~ "WEP 64/128-bit Hex\n" +#~ "WEP 64/128-bit ASCII\n" + +#~ msgid "" +#~ "Open System\n" +#~ "Shared Key" +#~ msgstr "" +#~ "開放系統\n" +#~ "分享金鑰" + +#~ msgid "Other Wireless Network..." +#~ msgstr "其它無線網路..." + +#~ msgid "Passphrase:" +#~ msgstr "通行碼:" + +#~ msgid "Password:" +#~ msgstr "密碼:" + +#~ msgid "Primary DNS:" +#~ msgstr "主要 DNS:" + +#~ msgid "Private Key File:" +#~ msgstr "私密金鑰檔案:" + +#~ msgid "Private Key Password:" +#~ msgstr "私密金鑰密碼 :" + +#~ msgid "Secondary DNS:" +#~ msgstr "次要 DNS:" + +#~ msgid "Select the CA Certificate File" +#~ msgstr "選擇 CA 憑證檔案" + +#~ msgid "Select the Client Certificate File" +#~ msgstr "選擇客戶端憑證檔案" + +#~ msgid "Select the Private Key File" +#~ msgstr "選擇私密金鑰檔案" + +#~ msgid "Show key" +#~ msgstr "顯示金鑰" + +#~ msgid "Show passphrase" +#~ msgstr "顯示密語" + +#~ msgid "Show password" +#~ msgstr "顯示密碼" + +#~ msgid "Show passwords" +#~ msgstr "顯示密碼" + +#~ msgid "Speed:" +#~ msgstr "連線速度:" + +#~ msgid "Subnet Mask:" +#~ msgstr "子網路遮罩:" + +#~ msgid "Type:" +#~ msgstr "Type:" + +#~ msgid "User Name:" +#~ msgstr "使用者名稱:" + +#~ msgid "Wireless Network Key Required" +#~ msgstr "需要無線網路金鑰" + +#~ msgid "Wireless _adapter:" +#~ msgstr "無線網絡卡(_A):" + +#~ msgid "_Always Trust this Wireless Network" +#~ msgstr "總是信任這無線網路(_A)" + +#~ msgid "_Don't remind me again" +#~ msgstr "不要再提醒我(_D)" + +#~ msgid "_Fallback on this Network" +#~ msgstr "退出此網路(_F)" + +#~ msgid "_Login to Network" +#~ msgstr "登入網路(_L)" + +#~ msgid "_Network Name:" +#~ msgstr "網路名稱(_N):" + +#~ msgid "_Wireless Security:" +#~ msgstr "無線安全性(_W):" + +#~ msgid "Cannot add VPN connection" +#~ msgstr "無法加入 VPN 連線" + +#~ msgid "" +#~ "No suitable VPN software was found on your system. Contact your system " +#~ "administrator." +#~ msgstr "在您的系統上找不到合適的 VPN 軟體。請連絡您的系統管理者。" + +#~ msgid "Cannot import VPN connection" +#~ msgstr "無法匯入 VPN 網路連線" + +#~ msgid "" +#~ "Cannot find suitable software for VPN connection type '%s' to import the " +#~ "file '%s'. Contact your system administrator." +#~ msgstr "" +#~ "找不到適合 VPN 連線類型‘%s’的軟體來匯入檔案‘%s’。請連絡您的系統管理者。" + +#~ msgid "Error retrieving VPN connection '%s'" +#~ msgstr "接收 VPN 連線‘%s’時發生錯誤" + +#~ msgid "" +#~ "Could not find the UI files for VPN connection type '%s'. Contact your " +#~ "system administrator." +#~ msgstr "找不到 VPN 連線類型‘%s’的 UI 檔案。請連絡您的系統管理者。" + +#~ msgid "Delete VPN connection \"%s\"?" +#~ msgstr "刪除 VPN 連線“%s”?" + +#~ msgid "" +#~ "All information about the VPN connection \"%s\" will be lost and you may " +#~ "need your system administrator to provide information to create a new " +#~ "connection." +#~ msgstr "" +#~ "所有 VPN 連線‘%s’的相關資訊都會消失,而您需要請系統管理者提供建立新連線的" +#~ "資訊。" + +#~ msgid "Unable to load" +#~ msgstr "無法載入" + +#~ msgid "Cannot find some needed resources (the glade file)!" +#~ msgstr "無法找到一些需要的資源( glade 檔)!" + +#~ msgid "Create VPN Connection" +#~ msgstr "建立 VPN 連線" + +#~ msgid "Edit VPN Connection" +#~ msgstr "編輯 VPN 連線" + +#~ msgid "Add a new VPN connection" +#~ msgstr "加入新的 VPN 連線" + +#~ msgid "Delete the selected VPN connection" +#~ msgstr "刪除選擇的 VPN 連線" + +#~ msgid "E_xport" +#~ msgstr "匯出(_X)" + +#~ msgid "Edit the selected VPN connection" +#~ msgstr "編輯已選的 VPN 連線" + +#~ msgid "Export the VPN settings to a file" +#~ msgstr "匯出 VPN 設定至檔案" + +#~ msgid "Export the selected VPN connection to a file" +#~ msgstr "匯出選擇的 VPN 連線至檔案" + +#~ msgid "Manage Virtual Private Network Connections" +#~ msgstr "管理虛擬私有網路連線" + +#~ msgid "VPN Connections" +#~ msgstr "VPN 連線" + +#~ msgid "40-bit WEP" +#~ msgstr "40-bit WEP" + +#~ msgid "104-bit WEP" +#~ msgstr "104-bit WEP" + +#~ msgid "WPA TKIP" +#~ msgstr "WPA TKIP" + +#~ msgid "WPA CCMP" +#~ msgstr "WPA CCMP" + +#~ msgid "WPA Automatic" +#~ msgstr "WPA 自動" + +#~ msgid "WPA2 TKIP" +#~ msgstr "WPA2 TKIP" + +#~ msgid "WPA2 CCMP" +#~ msgstr "WPA2 CCMP" + +#~ msgid "WPA2 Automatic" +#~ msgstr "WPA 自動" + +#~ msgid "none" +#~ msgstr "none" + +#~ msgid "operation took too long" +#~ msgstr "操作時間太久" + +#~ msgid "received data from wrong type of sender" +#~ msgstr "從傳送者接收錯誤類型的資料" + +#~ msgid "received data from unexpected sender" +#~ msgstr "從傳送者接收未預期類型的資料" + +#~ msgid "too much data was sent over socket and some of it was lost" +#~ msgstr "透過 socket 傳送太多資料以致其中有些遺失了" + +#~ msgid "You are now connected to the Ad-Hoc wireless network '%s'." +#~ msgstr "您目前連接到 Ad-Hoc 點對點式無線網路‘%s’。" + +#~ msgid "You are now connected to the wireless network '%s'." +#~ msgstr "您目前連接到無線網路‘%s’。" + +#~ msgid "You are now connected to the wired network." +#~ msgstr "您目前連接到有線網路‘%s’。" + +#~ msgid "Connection Established" +#~ msgstr "連線已建立" + +#~ msgid "Disconnected" +#~ msgstr "Disconnected" + +#~ msgid "The network connection has been disconnected." +#~ msgstr "該網路連線已經斷線。" + +#~ msgid "LEAP" +#~ msgstr "LEAP" + +#~ msgid "Failed to get information about the interface!" +#~ msgstr "無法取得網路介面的訊資!" + +#~ msgid "VPN Error" +#~ msgstr "VPN 錯誤" + +#~ msgid "" +#~ "VPN Login Message\n" +#~ "\n" +#~ "VPN connection '%s' said:\n" +#~ "\n" +#~ "\"%s\"" +#~ msgstr "" +#~ "VPN 登入訊息\n" +#~ "\n" +#~ "VPN 連線‘%s’說:\n" +#~ "\n" +#~ "\"%s\"" + +#~ msgid "_Stop All Wireless Devices" +#~ msgstr "停止所有無線網路裝置(_S)" + +#~ msgid "_Start All Wireless Devices" +#~ msgstr "開始執行所有無線網路裝置(_S)" + +#, fuzzy +#~ msgid "_Wireless Network Discovery" +#~ msgstr "無線網路 (%s)" + +#~ msgid "Always Search" +#~ msgstr "總是搜尋" + +#~ msgid "Search Only When Disconnected" +#~ msgstr "在斷線時才搜尋" + +#~ msgid "Never Search" +#~ msgstr "永不搜尋" + +#~ msgid "Stop All Wireless Devices" +#~ msgstr "停止所有無線網路裝置" + +#, fuzzy +#~ msgid "ASCII Key:" +#~ msgstr "Acii 格式金鑰:" + +#~ msgid "" +#~ "128-bit Passphrase (WEP)\n" +#~ "Ascii Key (WEP)\n" +#~ "Hex Key (WEP)" +#~ msgstr "" +#~ "128位元通行碼 (WEP)\n" +#~ "Acii 格式金鑰 (WEP)\n" +#~ "Hex 格式金鑰 (WEP)" + +#~ msgid "" +#~ "128-bit passphrase (WEP)\n" +#~ "Ascii key (WEP)\n" +#~ "Hex key (WEP)" +#~ msgstr "" +#~ "128位元通行碼 (WEP)\n" +#~ "Acii 格式金鑰 (WEP)\n" +#~ "Hex 格式金鑰 (WEP)" + +#~ msgid "Key type:" +#~ msgstr "金鑰類型:" + +#~ msgid "Wireless _network:" +#~ msgstr "無線網路(_N):" + +#~ msgid "_OK" +#~ msgstr "確定(_O)" + +#~ msgid "Create VPN Connection - 1 of 2" +#~ msgstr "建立 VPN 連線 - 第一步" + +#~ msgid "Create VPN Connection - 2 of 2" +#~ msgstr "建立 VPN 連線 - 第二步" + +#~ msgid "Finish create VPN Connection" +#~ msgstr "建立 VPN 連線完成" + +#~ msgid "%s" +#~ msgstr "%s" + +#~ msgid "Modify Wireless Networks" +#~ msgstr "修改無線網路" + +#~ msgid "*" +#~ msgstr "*" + +#~ msgid "You must log in to access the private network %s" +#~ msgstr "您需要登入來存取私有網路 %s" diff --git a/po/zh_TW.po b/po/zh_TW.po new file mode 100644 index 00000000..4357e266 --- /dev/null +++ b/po/zh_TW.po @@ -0,0 +1,1642 @@ +# translation of zh_TW.po to Traditional Chinese +# Traditional Chinese translation of Network Manager. +# Copyright (C) 2005, 2010 Free Software Foundation, Inc. +# +# Woodman Tuen , 2005. +# Chao-Hsiung Liao , 2008. +# Chester Cheng , 2010. +# Chester Cheng , 2010. +# Terry Chuang , 2010. +# Terry Chuang , 2010. +msgid "" +msgstr "" +"Project-Id-Version: zh_TW\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-06 14:31+0530\n" +"PO-Revision-Date: 2010-05-07 10:59+1000\n" +"Last-Translator: Terry Chuang \n" +"Language-Team: Traditional Chinese \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: KBabel 1.11.4\n" + +#: ../cli/src/connections.c:59 ../cli/src/connections.c:74 +#: ../cli/src/devices.c:85 ../cli/src/devices.c:98 ../cli/src/devices.c:108 +#: ../cli/src/devices.c:118 ../cli/src/devices.c:131 ../cli/src/devices.c:142 +#: ../cli/src/devices.c:152 +msgid "NAME" +msgstr "NAME" + +#. 0 +#: ../cli/src/connections.c:60 ../cli/src/connections.c:75 +msgid "UUID" +msgstr "UUID" + +#. 1 +#: ../cli/src/connections.c:61 +msgid "DEVICES" +msgstr "DEVICES" + +#. 2 +#: ../cli/src/connections.c:62 ../cli/src/connections.c:77 +msgid "SCOPE" +msgstr "SCOPE" + +#. 3 +#: ../cli/src/connections.c:63 +msgid "DEFAULT" +msgstr "DEFAULT" + +#. 4 +#: ../cli/src/connections.c:64 +msgid "DBUS-SERVICE" +msgstr "DBUS-SERVICE" + +#. 5 +#: ../cli/src/connections.c:65 +msgid "SPEC-OBJECT" +msgstr "SPEC-OBJECT" + +#. 6 +#: ../cli/src/connections.c:66 +msgid "VPN" +msgstr "VPN" + +#. 1 +#. 0 +#. 1 +#: ../cli/src/connections.c:76 ../cli/src/devices.c:61 ../cli/src/devices.c:87 +msgid "TYPE" +msgstr "TYPE" + +#. 3 +#: ../cli/src/connections.c:78 +msgid "TIMESTAMP" +msgstr "TIMESTAMP" + +#. 4 +#: ../cli/src/connections.c:79 +msgid "TIMESTAMP-REAL" +msgstr "TIMESTAMP-REAL" + +#. 5 +#: ../cli/src/connections.c:80 +msgid "AUTOCONNECT" +msgstr "AUTOCONNECT" + +#. 6 +#: ../cli/src/connections.c:81 +msgid "READONLY" +msgstr "READONLY" + +#: ../cli/src/connections.c:157 +#, c-format +msgid "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" +msgstr "" +"Usage: nmcli con { COMMAND | help }\n" +" COMMAND := { list | status | up | down }\n" +"\n" +" list [id | uuid | system | user]\n" +" status\n" +" up id | uuid [iface ] [ap ] [--nowait] [--timeout " +"]\n" +" down id | uuid \n" + +#: ../cli/src/connections.c:197 ../cli/src/connections.c:536 +#, c-format +msgid "Error: 'con list': %s" +msgstr "錯誤:'con list': %s" + +#: ../cli/src/connections.c:199 ../cli/src/connections.c:538 +#, c-format +msgid "Error: 'con list': %s; allowed fields: %s" +msgstr "錯誤:'con list': %s; 允許的欄位為:%s" + +#: ../cli/src/connections.c:207 +msgid "Connection details" +msgstr "連線詳情" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "system" +msgstr "系統" + +#: ../cli/src/connections.c:381 ../cli/src/connections.c:601 +msgid "user" +msgstr "使用者" + +#: ../cli/src/connections.c:383 +msgid "never" +msgstr "永不" + +#. "CAPABILITIES" +#. Print header +#. "WIFI-PROPERTIES" +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:544 ../cli/src/settings.c:643 +#: ../cli/src/settings.c:912 ../cli/src/settings.c:913 +#: ../cli/src/settings.c:915 ../cli/src/settings.c:917 +#: ../cli/src/settings.c:1042 ../cli/src/settings.c:1043 +#: ../cli/src/settings.c:1044 ../cli/src/settings.c:1123 +#: ../cli/src/settings.c:1124 ../cli/src/settings.c:1125 +#: ../cli/src/settings.c:1126 ../cli/src/settings.c:1127 +#: ../cli/src/settings.c:1128 ../cli/src/settings.c:1129 +#: ../cli/src/settings.c:1130 ../cli/src/settings.c:1131 +#: ../cli/src/settings.c:1132 ../cli/src/settings.c:1133 +#: ../cli/src/settings.c:1134 ../cli/src/settings.c:1135 +#: ../cli/src/settings.c:1210 +msgid "yes" +msgstr "是" + +#: ../cli/src/connections.c:384 ../cli/src/connections.c:385 +#: ../cli/src/connections.c:602 ../cli/src/connections.c:605 +#: ../cli/src/devices.c:388 ../cli/src/devices.c:513 ../cli/src/devices.c:539 +#: ../cli/src/devices.c:540 ../cli/src/devices.c:541 ../cli/src/devices.c:542 +#: ../cli/src/devices.c:543 ../cli/src/settings.c:504 +#: ../cli/src/settings.c:506 ../cli/src/settings.c:544 +#: ../cli/src/settings.c:643 ../cli/src/settings.c:912 +#: ../cli/src/settings.c:913 ../cli/src/settings.c:915 +#: ../cli/src/settings.c:917 ../cli/src/settings.c:1042 +#: ../cli/src/settings.c:1043 ../cli/src/settings.c:1044 +#: ../cli/src/settings.c:1123 ../cli/src/settings.c:1124 +#: ../cli/src/settings.c:1125 ../cli/src/settings.c:1126 +#: ../cli/src/settings.c:1127 ../cli/src/settings.c:1128 +#: ../cli/src/settings.c:1129 ../cli/src/settings.c:1130 +#: ../cli/src/settings.c:1131 ../cli/src/settings.c:1132 +#: ../cli/src/settings.c:1133 ../cli/src/settings.c:1134 +#: ../cli/src/settings.c:1135 ../cli/src/settings.c:1210 +msgid "no" +msgstr "否" + +#: ../cli/src/connections.c:457 ../cli/src/connections.c:500 +msgid "System connections" +msgstr "系統連線" + +#: ../cli/src/connections.c:462 ../cli/src/connections.c:513 +msgid "User connections" +msgstr "使用者連線" + +#: ../cli/src/connections.c:474 ../cli/src/connections.c:1334 +#: ../cli/src/connections.c:1350 ../cli/src/connections.c:1359 +#: ../cli/src/connections.c:1370 ../cli/src/connections.c:1452 +#: ../cli/src/devices.c:864 ../cli/src/devices.c:874 ../cli/src/devices.c:973 +#: ../cli/src/devices.c:980 +#, c-format +msgid "Error: %s argument is missing." +msgstr "錯誤:沒有 %s 參數。" + +#: ../cli/src/connections.c:487 +#, c-format +msgid "Error: %s - no such connection." +msgstr "錯誤:%s - 此連線不存在。" + +#: ../cli/src/connections.c:519 ../cli/src/connections.c:1383 +#: ../cli/src/connections.c:1470 ../cli/src/devices.c:687 +#: ../cli/src/devices.c:754 ../cli/src/devices.c:888 ../cli/src/devices.c:986 +#, c-format +msgid "Unknown parameter: %s\n" +msgstr "不明的參數:%s\n" + +#: ../cli/src/connections.c:528 +#, c-format +msgid "Error: no valid parameter specified." +msgstr "錯誤:未指定合於規定的參數。" + +#: ../cli/src/connections.c:543 ../cli/src/connections.c:1572 +#: ../cli/src/devices.c:1192 ../cli/src/network-manager.c:274 +#, c-format +msgid "Error: %s." +msgstr "錯誤:%s。" + +#: ../cli/src/connections.c:649 +#, c-format +msgid "Error: 'con status': %s" +msgstr "錯誤:'con status': %s" + +#: ../cli/src/connections.c:651 +#, c-format +msgid "Error: 'con status': %s; allowed fields: %s" +msgstr "錯誤:'con status': %s; 允許的欄位為:%s" + +#: ../cli/src/connections.c:658 +msgid "Active connections" +msgstr "使用中的連線" + +#: ../cli/src/connections.c:1026 +#, c-format +msgid "no active connection on device '%s'" +msgstr "裝置「%s」沒有使用中的連線" + +#: ../cli/src/connections.c:1034 +#, c-format +msgid "no active connection or device" +msgstr "沒有使用中的連線或裝置" + +#: ../cli/src/connections.c:1084 +#, c-format +msgid "device '%s' not compatible with connection '%s'" +msgstr "裝置 '%s' 和連線 '%s' 不相容" + +#: ../cli/src/connections.c:1086 +#, c-format +msgid "no device found for connection '%s'" +msgstr "連線「%s」沒有找到任何裝置" + +#: ../cli/src/connections.c:1097 +msgid "activating" +msgstr "啟用中" + +#: ../cli/src/connections.c:1099 +msgid "activated" +msgstr "已啟用" + +#: ../cli/src/connections.c:1102 ../cli/src/connections.c:1125 +#: ../cli/src/connections.c:1158 ../cli/src/devices.c:224 +#: ../cli/src/devices.c:514 ../cli/src/network-manager.c:92 +#: ../cli/src/network-manager.c:145 ../cli/src/settings.c:469 +msgid "unknown" +msgstr "不明" + +#: ../cli/src/connections.c:1111 +msgid "VPN connecting (prepare)" +msgstr "VPN 連線(準備)" + +#: ../cli/src/connections.c:1113 +msgid "VPN connecting (need authentication)" +msgstr "VPN 連線(需要身份認證)" + +#: ../cli/src/connections.c:1115 +msgid "VPN connecting" +msgstr "VPN 連線" + +#: ../cli/src/connections.c:1117 +msgid "VPN connecting (getting IP configuration)" +msgstr "VPN 連線(取得 IP 配置)" + +#: ../cli/src/connections.c:1119 +msgid "VPN connected" +msgstr "VPN 已連線" + +#: ../cli/src/connections.c:1121 +msgid "VPN connection failed" +msgstr "VPN 連線失敗" + +#: ../cli/src/connections.c:1123 +msgid "VPN disconnected" +msgstr "VPN 已離線" + +#: ../cli/src/connections.c:1134 +msgid "unknown reason" +msgstr "原因不明" + +#: ../cli/src/connections.c:1136 +msgid "none" +msgstr "none" + +#: ../cli/src/connections.c:1138 +msgid "the user was disconnected" +msgstr "該使用者已經斷線" + +#: ../cli/src/connections.c:1140 +msgid "the base network connection was interrupted" +msgstr "基礎的網路連線已經中斷" + +#: ../cli/src/connections.c:1142 +msgid "the VPN service stopped unexpectedly" +msgstr "VPN 服務無預期停止" + +#: ../cli/src/connections.c:1144 +msgid "the VPN service returned invalid configuration" +msgstr "VPN 服務傳回無效的配置" + +#: ../cli/src/connections.c:1146 +msgid "the connection attempt timed out" +msgstr "嚐試連線已經逾時" + +#: ../cli/src/connections.c:1148 +msgid "the VPN service did not start in time" +msgstr "VPN 服務並沒有按時開始" + +#: ../cli/src/connections.c:1150 +msgid "the VPN service failed to start" +msgstr "VPN 服務無法開始" + +#: ../cli/src/connections.c:1152 +msgid "no valid VPN secrets" +msgstr "VPN 密碼不正確" + +#: ../cli/src/connections.c:1154 +msgid "invalid VPN secrets" +msgstr "VPN 密碼不正確" + +#: ../cli/src/connections.c:1156 +msgid "the connection was removed" +msgstr "連線已移除" + +#: ../cli/src/connections.c:1170 +#, c-format +msgid "state: %s\n" +msgstr "狀態:%s\n" + +#: ../cli/src/connections.c:1173 ../cli/src/connections.c:1199 +#, c-format +msgid "Connection activated\n" +msgstr "連線已啟動\n" + +#: ../cli/src/connections.c:1176 +#, c-format +msgid "Error: Connection activation failed." +msgstr "錯誤:啟動連線失敗。" + +#: ../cli/src/connections.c:1195 +#, c-format +msgid "state: %s (%d)\n" +msgstr "狀態:%s (%d)\n" + +#: ../cli/src/connections.c:1205 +#, c-format +msgid "Error: Connection activation failed: %s." +msgstr "錯誤:啟動連線失敗:%s。" + +#: ../cli/src/connections.c:1222 ../cli/src/devices.c:811 +#, c-format +msgid "Error: Timeout %d sec expired." +msgstr "錯誤:逾時 %d 秒。" + +#: ../cli/src/connections.c:1265 +#, c-format +msgid "Error: Connection activation failed: %s" +msgstr "錯誤:啟動連線失敗:%s" + +#: ../cli/src/connections.c:1279 +#, c-format +msgid "Error: Obtaining active connection for '%s' failed." +msgstr "錯誤:為「%s」取得啟用中的連線失敗。" + +#: ../cli/src/connections.c:1288 +#, c-format +msgid "Active connection state: %s\n" +msgstr "啟用中連線的狀態:%s\n" + +#: ../cli/src/connections.c:1289 +#, c-format +msgid "Active connection path: %s\n" +msgstr "啟用中連線的路徑:%s\n" + +#: ../cli/src/connections.c:1343 ../cli/src/connections.c:1461 +#, c-format +msgid "Error: Unknown connection: %s." +msgstr "錯誤:不明的連線:%s。" + +#: ../cli/src/connections.c:1378 ../cli/src/devices.c:882 +#, c-format +msgid "Error: timeout value '%s' is not valid." +msgstr "錯誤:逾時值「%s」不合乎規定。" + +#: ../cli/src/connections.c:1391 ../cli/src/connections.c:1478 +#, c-format +msgid "Error: id or uuid has to be specified." +msgstr "錯誤:未指定 id 或 uuid。" + +#: ../cli/src/connections.c:1411 +#, c-format +msgid "Error: No suitable device found: %s." +msgstr "錯誤:找不到適用的裝置:%s。" + +#: ../cli/src/connections.c:1413 +#, c-format +msgid "Error: No suitable device found." +msgstr "錯誤:找不到適用的裝置。" + +#: ../cli/src/connections.c:1505 +#, c-format +msgid "Warning: Connection not active\n" +msgstr "警告:連線並未啟用\n" + +#: ../cli/src/connections.c:1561 +#, c-format +msgid "Error: 'con' command '%s' is not valid." +msgstr "錯誤:「con」指令「%s」不合乎規定。" + +#: ../cli/src/connections.c:1597 +#, c-format +msgid "Error: could not connect to D-Bus." +msgstr "錯誤:無法連到 D-Bus。" + +#: ../cli/src/connections.c:1604 +#, c-format +msgid "Error: Could not get system settings." +msgstr "錯誤:無法取得系統設定。" + +#: ../cli/src/connections.c:1612 +#, c-format +msgid "Error: Could not get user settings." +msgstr "錯誤:無法取得使用者設定。" + +#: ../cli/src/connections.c:1622 +#, c-format +msgid "Error: Can't obtain connections: settings services are not running." +msgstr "錯誤:無法取得連線:設定服務並未執行。" + +#. 0 +#. 9 +#: ../cli/src/devices.c:60 ../cli/src/devices.c:86 ../cli/src/devices.c:162 +msgid "DEVICE" +msgstr "DEVICE" + +#. 1 +#. 4 +#. 0 +#: ../cli/src/devices.c:62 ../cli/src/devices.c:90 +#: ../cli/src/network-manager.c:36 +msgid "STATE" +msgstr "STATE" + +#: ../cli/src/devices.c:71 +msgid "GENERAL" +msgstr "GENERAL" + +#. 0 +#: ../cli/src/devices.c:72 +msgid "CAPABILITIES" +msgstr "CAPABILITIES" + +#. 1 +#: ../cli/src/devices.c:73 +msgid "WIFI-PROPERTIES" +msgstr "WIFI-PROPERTIES" + +#. 2 +#: ../cli/src/devices.c:74 +msgid "AP" +msgstr "AP" + +#. 3 +#: ../cli/src/devices.c:75 +msgid "WIRED-PROPERTIES" +msgstr "WIRED-PROPERTIES" + +#. 4 +#: ../cli/src/devices.c:76 +msgid "IP4-SETTINGS" +msgstr "IP4-SETTINGS" + +#. 5 +#: ../cli/src/devices.c:77 +msgid "IP4-DNS" +msgstr "IP4-DNS" + +#. 2 +#: ../cli/src/devices.c:88 +msgid "DRIVER" +msgstr "DRIVER" + +#. 3 +#: ../cli/src/devices.c:89 +msgid "HWADDR" +msgstr "HWADDR" + +#. 0 +#: ../cli/src/devices.c:99 +msgid "CARRIER-DETECT" +msgstr "CARRIER-DETECT" + +#. 1 +#: ../cli/src/devices.c:100 +msgid "SPEED" +msgstr "SPEED" + +#. 0 +#: ../cli/src/devices.c:109 +msgid "CARRIER" +msgstr "CARRIER" + +#. 0 +#: ../cli/src/devices.c:119 +msgid "WEP" +msgstr "WEP" + +#. 1 +#: ../cli/src/devices.c:120 +msgid "WPA" +msgstr "WPA" + +#. 2 +#: ../cli/src/devices.c:121 +msgid "WPA2" +msgstr "WPA2" + +#. 3 +#: ../cli/src/devices.c:122 +msgid "TKIP" +msgstr "TKIP" + +#. 4 +#: ../cli/src/devices.c:123 +msgid "CCMP" +msgstr "CCMP" + +#. 0 +#: ../cli/src/devices.c:132 +msgid "ADDRESS" +msgstr "ADDRESS" + +#. 1 +#: ../cli/src/devices.c:133 +msgid "PREFIX" +msgstr "PREFIX" + +#. 2 +#: ../cli/src/devices.c:134 +msgid "GATEWAY" +msgstr "GATEWAY" + +#. 0 +#: ../cli/src/devices.c:143 +msgid "DNS" +msgstr "DNS" + +#. 0 +#: ../cli/src/devices.c:153 +msgid "SSID" +msgstr "SSID" + +#. 1 +#: ../cli/src/devices.c:154 +msgid "BSSID" +msgstr "BSSID" + +#. 2 +#: ../cli/src/devices.c:155 +msgid "MODE" +msgstr "MODE" + +#. 3 +#: ../cli/src/devices.c:156 +msgid "FREQ" +msgstr "FREQ" + +#. 4 +#: ../cli/src/devices.c:157 +msgid "RATE" +msgstr "RATE" + +#. 5 +#: ../cli/src/devices.c:158 +msgid "SIGNAL" +msgstr "SIGNAL" + +#. 6 +#: ../cli/src/devices.c:159 +msgid "SECURITY" +msgstr "SECURITY" + +#. 7 +#: ../cli/src/devices.c:160 +msgid "WPA-FLAGS" +msgstr "WPA-FLAGS" + +#. 8 +#: ../cli/src/devices.c:161 +msgid "RSN-FLAGS" +msgstr "RSN-FLAGS" + +#. 10 +#: ../cli/src/devices.c:163 +msgid "ACTIVE" +msgstr "ACTIVE" + +#: ../cli/src/devices.c:186 +#, c-format +msgid "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" +msgstr "" +"Usage: nmcli dev { COMMAND | help }\n" +"\n" +" COMMAND := { status | list | disconnect | wifi }\n" +"\n" +" status\n" +" list [iface ]\n" +" disconnect iface [--nowait] [--timeout ]\n" +" wifi [list [iface ] [hwaddr ]]\n" +"\n" + +#: ../cli/src/devices.c:206 +msgid "unmanaged" +msgstr "不受管理的" + +#: ../cli/src/devices.c:208 +msgid "unavailable" +msgstr "無法使用" + +#: ../cli/src/devices.c:210 ../cli/src/network-manager.c:89 +msgid "disconnected" +msgstr "離線" + +#: ../cli/src/devices.c:212 +msgid "connecting (prepare)" +msgstr "連線中(準備)" + +#: ../cli/src/devices.c:214 +msgid "connecting (configuring)" +msgstr "連線中(配置中)" + +#: ../cli/src/devices.c:216 +msgid "connecting (need authentication)" +msgstr "連線中(需要身份認證)" + +#: ../cli/src/devices.c:218 +msgid "connecting (getting IP configuration)" +msgstr "連線中(正在取得 IP 配置)" + +#: ../cli/src/devices.c:220 ../cli/src/network-manager.c:87 +msgid "connected" +msgstr "已連線" + +#: ../cli/src/devices.c:222 +msgid "connection failed" +msgstr "連線失敗" + +#: ../cli/src/devices.c:245 ../cli/src/devices.c:380 +msgid "Unknown" +msgstr "不明" + +#: ../cli/src/devices.c:277 +msgid "(none)" +msgstr "(none)" + +#: ../cli/src/devices.c:302 +#, c-format +msgid "%s: error converting IP4 address 0x%X" +msgstr "%s:轉換 IP4 位址 0x%x 時發生錯誤" + +#: ../cli/src/devices.c:349 +#, c-format +msgid "%u MHz" +msgstr "%u MHz" + +#: ../cli/src/devices.c:350 +#, c-format +msgid "%u MB/s" +msgstr "%u MB/s" + +#: ../cli/src/devices.c:359 +msgid "Encrypted: " +msgstr "已加密:" + +#: ../cli/src/devices.c:364 +msgid "WEP " +msgstr "WEP " + +#: ../cli/src/devices.c:366 +msgid "WPA " +msgstr "WPA " + +#: ../cli/src/devices.c:368 +msgid "WPA2 " +msgstr "WPA2 " + +#: ../cli/src/devices.c:371 +msgid "Enterprise " +msgstr "企業版 " + +#: ../cli/src/devices.c:380 +msgid "Ad-Hoc" +msgstr "點對點" + +#: ../cli/src/devices.c:380 +msgid "Infrastructure" +msgstr "基礎建設" + +#: ../cli/src/devices.c:442 +#, c-format +msgid "Error: 'dev list': %s" +msgstr "錯誤:'dev list': %s" + +#: ../cli/src/devices.c:444 +#, c-format +msgid "Error: 'dev list': %s; allowed fields: %s" +msgstr "錯誤:'dev list': %s; 允許的欄位為:%s" + +#: ../cli/src/devices.c:453 +msgid "Device details" +msgstr "裝置詳細資訊" + +#: ../cli/src/devices.c:483 ../cli/src/devices.c:827 +msgid "(unknown)" +msgstr "(不明)" + +#: ../cli/src/devices.c:484 +msgid "unknown)" +msgstr "不明)" + +#: ../cli/src/devices.c:510 +#, c-format +msgid "%u Mb/s" +msgstr "%u Mb/s" + +#. Print header +#. "WIRED-PROPERTIES" +#: ../cli/src/devices.c:583 +msgid "on" +msgstr "開" + +#: ../cli/src/devices.c:583 +msgid "off" +msgstr "關" + +#: ../cli/src/devices.c:710 +#, c-format +msgid "Error: 'dev status': %s" +msgstr "錯誤:'dev status': %s" + +#: ../cli/src/devices.c:712 +#, c-format +msgid "Error: 'dev status': %s; allowed fields: %s" +msgstr "錯誤:'dev status':%s; 允許的欄位為:%s" + +#: ../cli/src/devices.c:719 +msgid "Status of devices" +msgstr "裝置的狀態" + +#: ../cli/src/devices.c:747 +#, c-format +msgid "Error: '%s' argument is missing." +msgstr "錯誤:找不到「%s」參數。" + +#: ../cli/src/devices.c:776 ../cli/src/devices.c:915 ../cli/src/devices.c:1035 +#, c-format +msgid "Error: Device '%s' not found." +msgstr "錯誤:找不到「%s」裝置。" + +#: ../cli/src/devices.c:799 +#, c-format +msgid "Success: Device '%s' successfully disconnected." +msgstr "成功:裝置「%s」已經成功地斷線。" + +#: ../cli/src/devices.c:824 +#, c-format +msgid "Error: Device '%s' (%s) disconnecting failed: %s" +msgstr "錯誤:裝置「%s」(%s)斷線失敗:%s" + +#: ../cli/src/devices.c:832 +#, c-format +msgid "Device state: %d (%s)\n" +msgstr "裝置狀態:%d (%s)\n" + +#: ../cli/src/devices.c:896 +#, c-format +msgid "Error: iface has to be specified." +msgstr "錯誤:必須指定 iface。" + +#: ../cli/src/devices.c:1011 +#, c-format +msgid "Error: 'dev wifi': %s" +msgstr "錯誤:'dev wifi':%s" + +#: ../cli/src/devices.c:1013 +#, c-format +msgid "Error: 'dev wifi': %s; allowed fields: %s" +msgstr "錯誤:'dev wifi':%s; 允許的欄位為:%s" + +#: ../cli/src/devices.c:1020 +msgid "WiFi scan list" +msgstr "WiFi 掃描清單" + +#: ../cli/src/devices.c:1055 ../cli/src/devices.c:1109 +#, c-format +msgid "Error: Access point with hwaddr '%s' not found." +msgstr "錯誤:找不到擁有 hwaddr「%s」的存取點。" + +#: ../cli/src/devices.c:1072 +#, c-format +msgid "Error: Device '%s' is not a WiFi device." +msgstr "錯誤:「%s」不是 WiFi 裝置。" + +#: ../cli/src/devices.c:1136 +#, c-format +msgid "Error: 'dev wifi' command '%s' is not valid." +msgstr "錯誤:「dev wifi」指令「%s」不合乎規定。" + +#: ../cli/src/devices.c:1183 +#, c-format +msgid "Error: 'dev' command '%s' is not valid." +msgstr "錯誤:「dev」指令「%s」不合乎規定。" + +#: ../cli/src/network-manager.c:35 +msgid "RUNNING" +msgstr "RUNNING" + +#. 1 +#: ../cli/src/network-manager.c:37 +msgid "WIFI-HARDWARE" +msgstr "WIFI-HARDWARE" + +#. 2 +#: ../cli/src/network-manager.c:38 +msgid "WIFI" +msgstr "WIFI-HARDWARE" + +#. 3 +#: ../cli/src/network-manager.c:39 +msgid "WWAN-HARDWARE" +msgstr "WWAN-HARDWARE" + +#. 4 +#: ../cli/src/network-manager.c:40 +msgid "WWAN" +msgstr "WWAN" + +#: ../cli/src/network-manager.c:62 +#, c-format +msgid "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" +msgstr "" +"Usage: nmcli nm { COMMAND | help }\n" +"\n" +" COMMAND := { status | sleep | wakeup | wifi | wwan }\n" +"\n" +" status\n" +" sleep\n" +" wakeup\n" +" wifi [on|off]\n" +" wwan [on|off]\n" +"\n" + +#: ../cli/src/network-manager.c:83 +msgid "asleep" +msgstr "asleep" + +#: ../cli/src/network-manager.c:85 +msgid "connecting" +msgstr "連線中" + +#: ../cli/src/network-manager.c:125 +#, c-format +msgid "Error: 'nm status': %s" +msgstr "錯誤:'nm status':%s" + +#: ../cli/src/network-manager.c:127 +#, c-format +msgid "Error: 'nm status': %s; allowed fields: %s" +msgstr "錯誤:'nm status':%s; 允許的欄位為:%s" + +#: ../cli/src/network-manager.c:134 +msgid "NetworkManager status" +msgstr "NetworkManager 狀態" + +#. Print header +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "enabled" +msgstr "已啟用" + +#: ../cli/src/network-manager.c:140 ../cli/src/network-manager.c:141 +#: ../cli/src/network-manager.c:142 ../cli/src/network-manager.c:143 +#: ../cli/src/network-manager.c:211 ../cli/src/network-manager.c:243 +msgid "disabled" +msgstr "已停用" + +#: ../cli/src/network-manager.c:148 +msgid "running" +msgstr "執行中" + +#: ../cli/src/network-manager.c:148 +msgid "not running" +msgstr "非執行中" + +#: ../cli/src/network-manager.c:201 ../cli/src/network-manager.c:233 +#, c-format +msgid "Error: '--fields' value '%s' is not valid here; allowed fields: %s" +msgstr "錯誤:'--fields' 值 '%s' 在此無效; 允許的欄位為:%s" + +#: ../cli/src/network-manager.c:209 +msgid "WiFi enabled" +msgstr "WiFi 已啟用" + +#: ../cli/src/network-manager.c:220 +#, c-format +msgid "Error: invalid 'wifi' parameter: '%s'." +msgstr "錯誤:不合乎規定的「wifi」參數:%s。" + +#: ../cli/src/network-manager.c:241 +msgid "WWAN enabled" +msgstr "WWAN 已啟用" + +#: ../cli/src/network-manager.c:252 +#, c-format +msgid "Error: invalid 'wwan' parameter: '%s'." +msgstr "錯誤:不合乎規定的「wwan」參數:%s。" + +#: ../cli/src/network-manager.c:263 +#, c-format +msgid "Error: 'nm' command '%s' is not valid." +msgstr "錯誤:「nm」指令「%s」不合乎規定。" + +#: ../cli/src/nmcli.c:69 +#, 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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" +msgstr "" +"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] |all|common specify fields to output\n" +" -e[scape] yes|no escape columns separators in " +"values\n" +" -v[ersion] show program version\n" +" -h[elp] print this help\n" +"\n" +"OBJECT\n" +" nm NetworkManager status\n" +" con NetworkManager connections\n" +" dev devices managed by NetworkManager\n" +"\n" + +#: ../cli/src/nmcli.c:113 +#, c-format +msgid "Error: Object '%s' is unknown, try 'nmcli help'." +msgstr "錯誤:物件 '%s' 不明,請嘗試 'nmcli help'。" + +#: ../cli/src/nmcli.c:143 +#, c-format +msgid "Error: Option '--terse' is specified the second time." +msgstr "錯誤:選項 '--terse' 已指定了第二次。" + +#: ../cli/src/nmcli.c:148 +#, c-format +msgid "Error: Option '--terse' is mutually exclusive with '--pretty'." +msgstr "錯誤:選項 '--terse' 和 '--pretty' 是互斥的。" + +#: ../cli/src/nmcli.c:156 +#, c-format +msgid "Error: Option '--pretty' is specified the second time." +msgstr "錯誤:選項 '--pretty' 已指定了第二次。" + +#: ../cli/src/nmcli.c:161 +#, c-format +msgid "Error: Option '--pretty' is mutually exclusive with '--terse'." +msgstr "錯誤:選項 '--pretty' 和 '--terse' 是互斥的。" + +#: ../cli/src/nmcli.c:171 ../cli/src/nmcli.c:187 +#, c-format +msgid "Error: missing argument for '%s' option." +msgstr "錯誤:'%s' 選項的引數遺失。" + +#: ../cli/src/nmcli.c:180 ../cli/src/nmcli.c:196 +#, c-format +msgid "Error: '%s' is not valid argument for '%s' option." +msgstr "錯誤:'%s' 不是 '%s' 選項的有效引數。" + +#: ../cli/src/nmcli.c:203 +#, c-format +msgid "Error: fields for '%s' options are missing." +msgstr "錯誤:找不到 '%s' 選項的欄位。" + +#: ../cli/src/nmcli.c:209 +#, c-format +msgid "nmcli tool, version %s\n" +msgstr "nmcli 工具,版本 %s\n" + +#: ../cli/src/nmcli.c:215 +#, c-format +msgid "Error: Option '%s' is unknown, try 'nmcli -help'." +msgstr "錯誤:選項 '%s' 不明,請嚐試 'nmcli -help'。" + +#: ../cli/src/nmcli.c:234 +#, c-format +msgid "Caught signal %d, shutting down..." +msgstr "捕捉到訊號 %d,關閉..." + +#: ../cli/src/nmcli.c:259 +#, c-format +msgid "Error: Could not connect to NetworkManager." +msgstr "錯誤:無法連上 NetworkManager。" + +#: ../cli/src/nmcli.c:275 +msgid "Success" +msgstr "成功" + +#: ../cli/src/settings.c:407 +#, c-format +msgid "%d (hex-ascii-key)" +msgstr "%d(十六進位的 ascii-key)" + +#: ../cli/src/settings.c:409 +#, c-format +msgid "%d (104/128-bit passphrase)" +msgstr "%d(104/128 位元密碼)" + +#: ../cli/src/settings.c:412 +#, c-format +msgid "%d (unknown)" +msgstr "%d(不明)" + +#: ../cli/src/settings.c:438 +msgid "0 (unknown)" +msgstr "0(不明)" + +#: ../cli/src/settings.c:444 +msgid "any, " +msgstr "任何," + +#: ../cli/src/settings.c:446 +msgid "900 MHz, " +msgstr "900 MHz, " + +#: ../cli/src/settings.c:448 +msgid "1800 MHz, " +msgstr "1800 MHz, " + +#: ../cli/src/settings.c:450 +msgid "1900 MHz, " +msgstr "1900 MHz, " + +#: ../cli/src/settings.c:452 +msgid "850 MHz, " +msgstr "850 MHz, " + +#: ../cli/src/settings.c:454 +msgid "WCDMA 3GPP UMTS 2100 MHz, " +msgstr "WCDMA 3GPP UMTS 2100 MHz, " + +#: ../cli/src/settings.c:456 +msgid "WCDMA 3GPP UMTS 1800 MHz, " +msgstr "WCDMA 3GPP UMTS 1800 MHz, " + +#: ../cli/src/settings.c:458 +msgid "WCDMA 3GPP UMTS 1700/2100 MHz, " +msgstr "WCDMA 3GPP UMTS 1700/2100 MHz, " + +#: ../cli/src/settings.c:460 +msgid "WCDMA 3GPP UMTS 800 MHz, " +msgstr "WCDMA 3GPP UMTS 800 MHz, " + +#: ../cli/src/settings.c:462 +msgid "WCDMA 3GPP UMTS 850 MHz, " +msgstr "WCDMA 3GPP UMTS 850 MHz, " + +#: ../cli/src/settings.c:464 +msgid "WCDMA 3GPP UMTS 900 MHz, " +msgstr "WCDMA 3GPP UMTS 900 MHz, " + +#: ../cli/src/settings.c:466 +msgid "WCDMA 3GPP UMTS 1700 MHz, " +msgstr "WCDMA 3GPP UMTS 1700 MHz, " + +#: ../cli/src/settings.c:546 ../cli/src/settings.c:708 +msgid "auto" +msgstr "自動" + +#: ../cli/src/settings.c:704 ../cli/src/settings.c:707 ../cli/src/utils.c:172 +msgid "not set" +msgstr "不設置" + +#: ../cli/src/utils.c:124 +#, c-format +msgid "field '%s' has to be alone" +msgstr "欄位 '%s' 必須是單獨的" + +#: ../cli/src/utils.c:127 +#, c-format +msgid "invalid field '%s'" +msgstr "無效的欄位 '%s'" + +#: ../cli/src/utils.c:146 +#, c-format +msgid "Option '--terse' requires specifying '--fields'" +msgstr "選項 '--terse' 需指定 '--fields'" + +#: ../cli/src/utils.c:150 +#, c-format +msgid "Option '--terse' requires specific '--fields' option values , not '%s'" +msgstr "選項 '--terse' 需要特定的 '--fields' 選項值,而不是 '%s'" + +#: ../libnm-util/crypto.c:120 +#, c-format +msgid "PEM key file had no end tag '%s'." +msgstr "PEM 金鑰檔案沒有結束標籤「%s」。" + +#: ../libnm-util/crypto.c:130 +#, c-format +msgid "Doesn't look like a PEM private key file." +msgstr "看起來不像是 PEM 私密金鑰檔案。" + +#: ../libnm-util/crypto.c:138 +#, c-format +msgid "Not enough memory to store PEM file data." +msgstr "沒有足夠的記憶體可儲存 PEM 檔案資料。" + +#: ../libnm-util/crypto.c:154 +#, c-format +msgid "Malformed PEM file: Proc-Type was not first tag." +msgstr "格式不良的 PEM 檔案:Proc-Type 不是第一個標籤。" + +#: ../libnm-util/crypto.c:162 +#, c-format +msgid "Malformed PEM file: unknown Proc-Type tag '%s'." +msgstr "格式不良的 PEM 檔案:不明的 Proc-Type 標籤「%s」" + +#: ../libnm-util/crypto.c:172 +#, c-format +msgid "Malformed PEM file: DEK-Info was not the second tag." +msgstr "格式不良的 PEM 檔案:DEK-Info 不是第二個標籤。" + +#: ../libnm-util/crypto.c:183 +#, c-format +msgid "Malformed PEM file: no IV found in DEK-Info tag." +msgstr "格式不良的 PEM 檔案:在 DEK-Info 標籤中找不到 IV。" + +#: ../libnm-util/crypto.c:190 +#, c-format +msgid "Malformed PEM file: invalid format of IV in DEK-Info tag." +msgstr "格式不良的 PEM 檔案:DEK-Info 標籤中的 IV 格式是無效的。" + +#: ../libnm-util/crypto.c:203 +#, c-format +msgid "Malformed PEM file: unknown private key cipher '%s'." +msgstr "格式不良的 PEM 檔案:不明的私密金鑰加密器「%s」。" + +#: ../libnm-util/crypto.c:222 +#, c-format +msgid "Could not decode private key." +msgstr "無法解碼私密金鑰。" + +#: ../libnm-util/crypto.c:267 +#, c-format +msgid "PEM certificate '%s' had no end tag '%s'." +msgstr "PEM 憑證「%s」沒有結束標籤「%s」。" + +#: ../libnm-util/crypto.c:277 +#, c-format +msgid "Failed to decode certificate." +msgstr "解碼憑證失敗。" + +#: ../libnm-util/crypto.c:286 +#, c-format +msgid "Not enough memory to store certificate data." +msgstr "沒有足夠的記憶體可儲存憑證資料。" + +#: ../libnm-util/crypto.c:294 +#, c-format +msgid "Not enough memory to store file data." +msgstr "沒有足夠的記憶體可儲存檔案資料。" + +#: ../libnm-util/crypto.c:324 +#, c-format +msgid "IV must be an even number of bytes in length." +msgstr "IV 的長度必須為偶數位元組。" + +#: ../libnm-util/crypto.c:333 +#, c-format +msgid "Not enough memory to store the IV." +msgstr "沒有足夠的記憶體可儲存 IV。" + +#: ../libnm-util/crypto.c:344 +#, c-format +msgid "IV contains non-hexadecimal digits." +msgstr "IV 包含非十六進位的數字。" + +#: ../libnm-util/crypto.c:382 ../libnm-util/crypto_gnutls.c:148 +#: ../libnm-util/crypto_gnutls.c:266 ../libnm-util/crypto_nss.c:171 +#: ../libnm-util/crypto_nss.c:336 +#, c-format +msgid "Private key cipher '%s' was unknown." +msgstr "私密金鑰加密器「%s」不明。" + +#: ../libnm-util/crypto.c:391 +#, c-format +msgid "Not enough memory to decrypt private key." +msgstr "沒有足夠的記憶體可解密私密金鑰。" + +#: ../libnm-util/crypto.c:511 +#, c-format +msgid "Unable to determine private key type." +msgstr "無法決定私密金鑰的類型。" + +#: ../libnm-util/crypto.c:530 +#, c-format +msgid "Not enough memory to store decrypted private key." +msgstr "沒有足夠的記憶體可儲存解密的私密金鑰。" + +#: ../libnm-util/crypto_gnutls.c:49 +msgid "Failed to initialize the crypto engine." +msgstr "初始化 crypto 引擎失敗。" + +#: ../libnm-util/crypto_gnutls.c:93 +#, c-format +msgid "Failed to initialize the MD5 engine: %s / %s." +msgstr "初始化 MD5 引擎失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:156 +#, c-format +msgid "Invalid IV length (must be at least %zd)." +msgstr "不合乎規定的 IV 長度(必須至少是 %zd)。" + +#: ../libnm-util/crypto_gnutls.c:165 ../libnm-util/crypto_nss.c:188 +#, c-format +msgid "Not enough memory for decrypted key buffer." +msgstr "沒有足夠的記憶體供作解密金鑰緩衝區。" + +#: ../libnm-util/crypto_gnutls.c:173 +#, c-format +msgid "Failed to initialize the decryption cipher context: %s / %s." +msgstr "初始化解密用的加密器失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:182 +#, c-format +msgid "Failed to set symmetric key for decryption: %s / %s." +msgstr "設定解密用的對稱式金鑰失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:191 +#, c-format +msgid "Failed to set IV for decryption: %s / %s." +msgstr "設定解密用的 IV 失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:200 +#, c-format +msgid "Failed to decrypt the private key: %s / %s." +msgstr "解密私密金鑰失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:210 ../libnm-util/crypto_nss.c:267 +#, c-format +msgid "Failed to decrypt the private key: unexpected padding length." +msgstr "解密私密金鑰失敗:無預期的填空長度。" + +#: ../libnm-util/crypto_gnutls.c:221 ../libnm-util/crypto_nss.c:278 +#, c-format +msgid "Failed to decrypt the private key." +msgstr "解密私密金鑰失敗。" + +#: ../libnm-util/crypto_gnutls.c:286 ../libnm-util/crypto_nss.c:356 +#, c-format +msgid "Could not allocate memory for encrypting." +msgstr "無法分配記憶體,以供加密。" + +#: ../libnm-util/crypto_gnutls.c:294 +#, c-format +msgid "Failed to initialize the encryption cipher context: %s / %s." +msgstr "初始化加密用的加密器失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:303 +#, c-format +msgid "Failed to set symmetric key for encryption: %s / %s." +msgstr "設定加密用的對稱式金鑰失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:313 +#, c-format +msgid "Failed to set IV for encryption: %s / %s." +msgstr "設定加密用的 IV 失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:322 +#, c-format +msgid "Failed to encrypt the data: %s / %s." +msgstr "加密私密金鑰失敗: %s / %s。" + +#: ../libnm-util/crypto_gnutls.c:362 +#, c-format +msgid "Error initializing certificate data: %s" +msgstr "初始化憑證資料時發生錯誤:%s" + +#: ../libnm-util/crypto_gnutls.c:384 +#, c-format +msgid "Couldn't decode certificate: %s" +msgstr "無法解碼憑證:%s" + +#: ../libnm-util/crypto_gnutls.c:408 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %s" +msgstr "無法啟動 PKCS#12 解碼程式:%s" + +#: ../libnm-util/crypto_gnutls.c:421 +#, c-format +msgid "Couldn't decode PKCS#12 file: %s" +msgstr "無法解碼 PKCS#12 檔案:%s" + +#: ../libnm-util/crypto_gnutls.c:433 +#, c-format +msgid "Couldn't verify PKCS#12 file: %s" +msgstr "無法驗證 PKCS# 12 檔案:%s" + +#: ../libnm-util/crypto_nss.c:56 +#, c-format +msgid "Failed to initialize the crypto engine: %d." +msgstr "初始化 crypto 引擎失敗: %d。" + +#: ../libnm-util/crypto_nss.c:111 +#, c-format +msgid "Failed to initialize the MD5 context: %d." +msgstr "初始化 MD5 本文失敗:%d。" + +#: ../libnm-util/crypto_nss.c:179 +#, c-format +msgid "Invalid IV length (must be at least %d)." +msgstr "不合於規定的 IV 長度(必須至少是 %d)。" + +#: ../libnm-util/crypto_nss.c:196 +#, c-format +msgid "Failed to initialize the decryption cipher slot." +msgstr "初始化解密用的加密器插槽失敗。" + +#: ../libnm-util/crypto_nss.c:206 +#, c-format +msgid "Failed to set symmetric key for decryption." +msgstr "設定解密用的對稱式金鑰失敗。" + +#: ../libnm-util/crypto_nss.c:216 +#, c-format +msgid "Failed to set IV for decryption." +msgstr "設定解密用的 IV 失敗。" + +#: ../libnm-util/crypto_nss.c:224 +#, c-format +msgid "Failed to initialize the decryption context." +msgstr "初始化解密上下文失敗。" + +#: ../libnm-util/crypto_nss.c:237 +#, c-format +msgid "Failed to decrypt the private key: %d." +msgstr "解密私密金鑰失敗:%d。" + +#: ../libnm-util/crypto_nss.c:245 +#, c-format +msgid "Failed to decrypt the private key: decrypted data too large." +msgstr "解密私密金鑰失敗:解密的資料太龐大。" + +#: ../libnm-util/crypto_nss.c:256 +#, c-format +msgid "Failed to finalize decryption of the private key: %d." +msgstr "結束私密金鑰的解密失敗:%d。" + +#: ../libnm-util/crypto_nss.c:364 +#, c-format +msgid "Failed to initialize the encryption cipher slot." +msgstr "初始化加密用的加密器插槽失敗。" + +#: ../libnm-util/crypto_nss.c:372 +#, c-format +msgid "Failed to set symmetric key for encryption." +msgstr "設定加密用的對稱式金鑰失敗。" + +#: ../libnm-util/crypto_nss.c:380 +#, c-format +msgid "Failed to set IV for encryption." +msgstr "設定加密用的 IV 失敗。" + +#: ../libnm-util/crypto_nss.c:388 +#, c-format +msgid "Failed to initialize the encryption context." +msgstr "初始化加密本文失敗。" + +#: ../libnm-util/crypto_nss.c:396 +#, c-format +msgid "Failed to encrypt: %d." +msgstr "加密失敗:%d。" + +#: ../libnm-util/crypto_nss.c:404 +#, c-format +msgid "Unexpected amount of data after encrypting." +msgstr "加密後無預期的資料量。" + +#: ../libnm-util/crypto_nss.c:447 +#, c-format +msgid "Couldn't decode certificate: %d" +msgstr "無法解碼憑證:%d" + +#: ../libnm-util/crypto_nss.c:482 +#, c-format +msgid "Couldn't convert password to UCS2: %d" +msgstr "無法將密碼轉為 UCS2:%d" + +#: ../libnm-util/crypto_nss.c:510 +#, c-format +msgid "Couldn't initialize PKCS#12 decoder: %d" +msgstr "無法初始化 PKCS#12 解碼程式:%d" + +#: ../libnm-util/crypto_nss.c:519 +#, c-format +msgid "Couldn't decode PKCS#12 file: %d" +msgstr "無法解碼 PKCS#12 檔案:%d" + +#: ../libnm-util/crypto_nss.c:528 +#, c-format +msgid "Couldn't verify PKCS#12 file: %d" +msgstr "無法驗證 PKCS#12 檔案:%d" + +#: ../libnm-util/crypto_nss.c:557 +msgid "Could not generate random data." +msgstr "無法產生隨機資料。" + +#: ../libnm-util/nm-utils.c:1925 +#, c-format +msgid "Not enough memory to make encryption key." +msgstr "沒有足夠的記憶體建立加密金鑰。" + +#: ../libnm-util/nm-utils.c:2035 +msgid "Could not allocate memory for PEM file creation." +msgstr "無法分配記憶體,以建立 PEM 檔案。" + +#: ../libnm-util/nm-utils.c:2047 +#, c-format +msgid "Could not allocate memory for writing IV to PEM file." +msgstr "無法分配記憶體,好將 IV 寫入 PEM 檔案。" + +#: ../libnm-util/nm-utils.c:2059 +#, c-format +msgid "Could not allocate memory for writing encrypted key to PEM file." +msgstr "無法分配記憶體,將加密金鑰寫入 PEM 檔案。" + +#: ../libnm-util/nm-utils.c:2078 +#, c-format +msgid "Could not allocate memory for PEM file data." +msgstr "無法分配記憶體給 PEM 檔案資料。" + +#: ../src/nm-netlink-monitor.c:100 ../src/nm-netlink-monitor.c:231 +#: ../src/nm-netlink-monitor.c:653 +#, c-format +msgid "error processing netlink message: %s" +msgstr "處理 netlink 訊息時發生錯誤:%s" + +#: ../src/nm-netlink-monitor.c:214 +msgid "error occurred while waiting for data on socket" +msgstr "等待 socket 上的資料時發生錯誤" + +#: ../src/nm-netlink-monitor.c:254 +#, c-format +msgid "unable to connect to netlink for monitoring link status: %s" +msgstr "無法連結 netlink 以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:265 +#, c-format +msgid "unable to enable netlink handle credential passing: %s" +msgstr "無法啟用 netlink handle credential passing:%s" + +#: ../src/nm-netlink-monitor.c:291 ../src/nm-netlink-monitor.c:353 +#, c-format +msgid "unable to allocate netlink handle for monitoring link status: %s" +msgstr "無法配置 netlink 處理器以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:376 +#, c-format +msgid "unable to allocate netlink link cache for monitoring link status: %s" +msgstr "無法配置 netlink 連線快取以監控連線狀態:%s" + +#: ../src/nm-netlink-monitor.c:502 +#, c-format +msgid "unable to join netlink group: %s" +msgstr "無法加入 netlink 群組:%s" + +#: ../src/nm-netlink-monitor.c:629 ../src/nm-netlink-monitor.c:642 +#, c-format +msgid "error updating link cache: %s" +msgstr "更新連線快取時發生錯誤:%s" + +#: ../src/main.c:502 +#, c-format +msgid "Invalid option. Please use --help to see a list of valid options.\n" +msgstr "無效的選項。請使用 --help 來查看有效選項的清單。\n" + +#: ../src/main.c:562 +#, c-format +msgid "%s. Please use --help to see a list of valid options.\n" +msgstr "%s。請使用 --help 來查看有效選項的清單。\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:325 +msgid "# Created by NetworkManager\n" +msgstr "# Created by NetworkManager\n" + +#: ../src/dhcp-manager/nm-dhcp-dhclient.c:341 +#, c-format +msgid "" +"# Merged from %s\n" +"\n" +msgstr "" +"# Merged from %s\n" +"\n" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:279 +msgid "no usable DHCP client could be found." +msgstr "找不到可重複使用的 DHCP 用戶端。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:288 +msgid "'dhclient' could be found." +msgstr "找不到「dhclient」。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:298 +msgid "'dhcpcd' could be found." +msgstr "找不到「dhcpcd」。" + +#: ../src/dhcp-manager/nm-dhcp-manager.c:306 +#, c-format +msgid "unsupported DHCP client '%s'" +msgstr "不支援的 DHCP 用戶端「%s」" + +#: ../src/logging/nm-logging.c:146 +#, c-format +msgid "Unknown log level '%s'" +msgstr "不明日誌層級「%s」" + +#: ../src/logging/nm-logging.c:171 +#, c-format +msgid "Unknown log domain '%s'" +msgstr "不明日誌網域「%s」" + +#: ../src/named-manager/nm-named-manager.c:343 +msgid "NOTE: the libc resolver may not support more than 3 nameservers." +msgstr "注意:libc 解析器不支援 3 個以上的名稱伺服器。" + +#: ../src/named-manager/nm-named-manager.c:345 +msgid "The nameservers listed below may not be recognized." +msgstr "下面列出的名稱伺服器可能不會被辨識。" + +#: ../src/system-settings/nm-default-wired-connection.c:157 +#, c-format +msgid "Auto %s" +msgstr "自動 %s" + +#: ../system-settings/plugins/ifcfg-rh/reader.c:3256 +msgid "System" +msgstr "系統" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:1 +msgid "Connection sharing via a protected WiFi network" +msgstr "透過受保護的 WiFi 網路共享連線" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:2 +msgid "Connection sharing via an open WiFi network" +msgstr "透過開放的 WiFi 網路共享連線" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:3 +msgid "Modify persistent system hostname" +msgstr "修改永久系統的主機名稱" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:4 +msgid "Modify system connections" +msgstr "修改系統連線" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:5 +msgid "System policy prevents modification of system settings" +msgstr "系統政策讓您無法修改系統設定" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:6 +msgid "System policy prevents modification of the persistent system hostname" +msgstr "系統政策讓您無法修改永久的系統主機名稱" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:7 +msgid "System policy prevents sharing connections via a protected WiFi network" +msgstr "系統政策讓您無法透過受保護的 WiFi 網路共享連結" + +#: ../policy/org.freedesktop.network-manager-settings.system.policy.in.h:8 +msgid "System policy prevents sharing connections via an open WiFi network" +msgstr "系統政策讓您無法透過開放的 WiFi 網路共享連線" + diff --git a/policy/Makefile.am b/policy/Makefile.am new file mode 100644 index 00000000..409e8edd --- /dev/null +++ b/policy/Makefile.am @@ -0,0 +1,26 @@ +polkit_policydir = $(datadir)/polkit-1/actions + +dist_polkit_policy_in_files = org.freedesktop.network-manager-settings.system.policy.in +dist_polkit_policy_DATA = $(dist_polkit_policy_in_files:.policy.in=.policy) + +@INTLTOOL_POLICY_RULE@ + +# polkit >= 0.92 doesn't have an updated polkit-policy-file-validate +#check: +# @for f in $(dist_polkit_policy_DATA); do \ +# echo -n "Validate PolicyKit policy in $$f : "; \ +# $(POLKIT_POLICY_FILE_VALIDATE) $(srcdir)/$$f ; \ +# ret=$$?; \ +# if [ "$$ret" = "0" ]; \ +# then \ +# echo ok; \ +# else \ +# echo failed; \ +# exit 1; \ +# fi; \ +# done; + +clean-local : + rm -f *~ + +EXTRA_DIST = $(dist_polkit_policy_in_files) diff --git a/policy/Makefile.in b/policy/Makefile.in new file mode 100644 index 00000000..afef45c0 --- /dev/null +++ b/policy/Makefile.in @@ -0,0 +1,491 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = policy +DIST_COMMON = $(dist_polkit_policy_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(polkit_policydir)" +DATA = $(dist_polkit_policy_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +polkit_policydir = $(datadir)/polkit-1/actions +dist_polkit_policy_in_files = org.freedesktop.network-manager-settings.system.policy.in +dist_polkit_policy_DATA = $(dist_polkit_policy_in_files:.policy.in=.policy) +EXTRA_DIST = $(dist_polkit_policy_in_files) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu policy/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu policy/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dist_polkit_policyDATA: $(dist_polkit_policy_DATA) + @$(NORMAL_INSTALL) + test -z "$(polkit_policydir)" || $(MKDIR_P) "$(DESTDIR)$(polkit_policydir)" + @list='$(dist_polkit_policy_DATA)'; test -n "$(polkit_policydir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(polkit_policydir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(polkit_policydir)" || exit $$?; \ + done + +uninstall-dist_polkit_policyDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_polkit_policy_DATA)'; test -n "$(polkit_policydir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(polkit_policydir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(polkit_policydir)" && rm -f $$files +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(polkit_policydir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_polkit_policyDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_polkit_policyDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + clean-local distclean distclean-generic distclean-libtool \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am \ + install-dist_polkit_policyDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-dist_polkit_policyDATA + + +@INTLTOOL_POLICY_RULE@ + +# polkit >= 0.92 doesn't have an updated polkit-policy-file-validate +#check: +# @for f in $(dist_polkit_policy_DATA); do \ +# echo -n "Validate PolicyKit policy in $$f : "; \ +# $(POLKIT_POLICY_FILE_VALIDATE) $(srcdir)/$$f ; \ +# ret=$$?; \ +# if [ "$$ret" = "0" ]; \ +# then \ +# echo ok; \ +# else \ +# echo failed; \ +# exit 1; \ +# fi; \ +# done; + +clean-local : + rm -f *~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/policy/org.freedesktop.network-manager-settings.system.policy b/policy/org.freedesktop.network-manager-settings.system.policy new file mode 100644 index 00000000..3747f751 --- /dev/null +++ b/policy/org.freedesktop.network-manager-settings.system.policy @@ -0,0 +1,295 @@ + + + + + NetworkManager + http://www.gnome.org/projects/NetworkManager + nm-icon + + + Modify system connections + প্ৰণালীৰ সংযোগ পৰিবৰ্তন কৰক + সিস্টেমের সংযোগ পরিবর্তন করুন + Měnit systémová připojení + System-Verbindungen bearbeiten + Τροποποίηση συνδέσεων συστήματος + Modify system connections + Modificar conexiones de sistema + Aldatu sistemako konexioak + Modifier les connexions système + Modificar as conexións do sistema + સિસ્ટમ જોડાણોને બદલો + सिस्टम कनेक्शन सुधारें + Rendszerkapcsolatok módosítása + Modifica le connessioni di sistema + システム接続を修正 + ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸು + 시스템 연결을 변경합니다 + Keisti sistemos ryšius + സിസ്റ്റം കണക്ഷനുകളില്‍ മാറ്റം വരുത്തുക + प्रणाली जुळवणी संपादीत करा + ତନ୍ତ୍ର ସଂଯୋଗଗୁଡ଼ିକୁ ପରିବର୍ତ୍ତନ କରନ୍ତୁ + ਸਿਸਟਮ ਕੁਨੈਸ਼ਨ ਸੋਧ + Modyfikacja połączeń systemowych + Modificar conexões de sistema + Изменить соединения системы + Spremeni sistemske povezave + Ändra systemanslutningar + கணினி இணைப்புகளை மாற்றியமைக்கவும் + సిస్టమ్ అనుసంధానములను సవరించుము + 更改系统连接 + 修改系統連線 + System policy prevents modification of system settings + প্ৰণালীত ব্যৱহৃত নিয়ম-নীতিৰ বিধিনিষেধৰ কাৰণে প্ৰণালীৰ বৈশিষ্ট্য পৰিবৰ্তন কৰা সম্ভৱ নহয় + সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের বৈশিষ্ট্য পরিবর্তন করা সম্ভব নয় + Systémová politika zabránila změně systémového nastavení. + Die Systemrichtlinien verhindern das Bearbeiten von Systemeinstellungen + Η πολιτική συστήματος δεν επιτρέπει τροποποίηση των ρυθμίσεων συστήματος + System policy prevents modification of system settings + Política de sistema evita modificación de configuración de sistema + Sistemako arauek sistemako ezarpenak aldatzea saihesten dute + La stratégie du système empêche toute modification des paramètres du système + A política do sistema impide a modificación da configuración do sistema + સિસ્ટમ પોલિસી એ સિસ્ટમ સુયોજનોનાં બદલાવને અટકાવે છે + सिस्टम नीति सिस्टम सेटिंग के रूपांतरण को रोकता है. + A rendszer házirendje megakadályozza a rendszerbeállítások módosítását + La politica di sistema impedisce di modificare le impostazioni di sistema + システムポリシーがシステム設定の修正を阻止します。 + ವ್ಯವಸ್ಥೆಯ ಸಂಪರ್ಕಗಳನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತಿವೆ + 시스템 정책이 시스템 설정을 변경하는 것을 금지합니다 + Sistemos politika neleidžia keisti sistemos nustatymų + സിസ്റ്റത്തിന്റെ സജ്ജീകരണങ്ങളില്‍ മാറ്റം വരുത്തുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു + प्रणाली करार, प्रणाली संयोजना संपादीत करण्यापासून रोखतो + ତନ୍ତ୍ର ନିତୀ ତନ୍ତ୍ର ବିନ୍ୟାସ ପରିବର୍ତ୍ତନକୁ ବାରଣ କରିଥାଏ + ਸਿਸਟਮ ਪਾਲਸੀ ਸਿਸਟਮ ਸੈਟਿੰਗ ਲਈ ਸੋਧ ਤੋਂ ਰੋਕਦੀ ਹੈ + Polityka systemu powstrzymuje modyfikację ustawień systemowych + Políticas de sistema previnem modificação das configurações do sistema + Системная политика запрещает изменение системных настроек + Sistemska določila onemogočajo spreminjanje sistemskih nastavitev + Systemets policy förhindrar ändring av systeminställningar + கணினி அமைவுகளின் மாற்றத்தை கணினி பாலிசி தடுக்கிறது + సిస్టమ్ అమరికలు సవరించుటకు సిస్టమ్ పాలసి నిరోధిస్తుంది + 系统策略阻止更改系统设置 + 系統政策讓您無法修改系統設定 + + no + auth_admin_keep + + + + + Modify persistent system hostname + প্ৰণালীৰ স্থায়ী গৃহস্থৰ নাম পৰিবৰ্তন কৰক + সিস্টেমের স্থায়ী হোস্ট-নেম পরিবর্তন করুন + Měnit trvalý systémový název počítače + Den ständigen Rechnernamen des Systems bearbeiten + Αλλαγή πάγιου ονόματος συστήματος + Modify persistent system hostname + Modificar nombre de host de sistema persistente + Aldatu sistemako ostalari-izen iraunkorra + Modifier le nom d'hôte du système persistant + Modificar o nome persistente do anfitrión do sistema + નિરંતર સિસ્ટમ યજમાનનામને બદલો + स्थिर सिस्टम होस्टनेम को सुधारें + Állandó rendszergépnév módosítása + Modifica il nome host persistente del sistema + 永続化システムのホスト名を修正 + ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸಿ + 영구적인 시스템 호스트명을 변경합니다 + Keisti pastovų sistemos vardą + സിസ്റ്റത്തിന്റെ ഹോസ്റ്റ്നാമത്തില്‍ മാറ്റം വരുത്തുക + पर्सिस्टंट प्रणाली यजमाननाव संपादीत करा + ସ୍ଥାୟୀ ତନ୍ତ୍ର ହୋଷ୍ଟନାମକୁ ପରିବର୍ତ୍ତନ କରନ୍ତୁ + ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਸੋਧ + Modyfikacja trwałej systemowej nazwy komputera + Modificar máquina de sistema persistente + Изменить постоянное имя узла компьютера + Spremeni trajno sistemsko ime gostitelja + Ändra bestående värdnamn för systemet + நிலையான கணினி புரவலப்பெயரை மாற்றியமை + నిరంతర సిస్టమ్ హోస్టునామము మార్చుము + 更改系统固有主机名 + 修改永久系統的主機名稱 + System policy prevents modification of the persistent system hostname + প্ৰণালীত ব্যৱহৃত নিয়ম-নীতিৰ বিধি নিষেধৰ কাৰণে প্ৰণালীৰ স্থায়ী গৃহস্থৰ নাম পৰিবৰ্তন কৰা সম্ভৱ নহয় + সিস্টেমে ব্যবহৃত নিয়ম-নীতির বিধিনিষেধের কারণে সিস্টেমের স্থায়ী হোস্ট-নেম পরিবর্তন করা সম্ভব নয় + Systémová politika zabránila změně trvalého systémového názvu počítače + Die Systemrichtlinien verhindern das Bearbeiten des ständigen Rechnernamens des Systems + Η πολιτική συστήματος δεν επιτρέπει τροποποίηση του πάγιου ονόματος συστήματος + System policy prevents modification of the persistent system hostname + Política de sistema evita modificación de nombre de host de sistema persistente + Sistemako arauek sistemako ostalari-izen iraunkorra aldatzea saihesten dute + La stratégie du système empêche toute modification du nom d'hôte du système persistant + A política do sistema impide a modificación do nome do anfitrión do sistema + સિસ્ટમ પોલિસી એ નિરંતર સિસ્ટમ યજમાનનામનાં બદલાવને અટકાવે છે + सिस्टम नीति स्थिर सिस्टम होस्टनेम के रूपांतरण को रोकता है. + A rendszer házirendje megakadályozza a rendszer állandó gépnevének módosítását + La politica di sistema impedisce di modificare il nome host persistente del sistema + システムポリシーが永続化システムのホスト名修正を阻止します。 + ಸ್ಥಿರ ವ್ಯವಸ್ಥೆಯ ಆತಿಥೇಯ ಹೆಸರನ್ನು ಮಾರ್ಪಡಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ + 시스템 정책이 호스트 이름을 영구히 변경하는 것을 금지합니다 + Sistemos politika neleidžia keisti įsiminto sistemos vardo + സിസ്റ്റത്തിന്റെ ഹോസ്റ്റ്നാമത്തില്‍ മാറ്റം വരുത്തുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു + प्रणाली करार पर्सिस्टंट प्रणाली यजमाननावाचे संपादन रोखत आहे + ତନ୍ତ୍ର ନିତୀ ସ୍ଥାୟୀ ତନ୍ତ୍ର ହୋଷ୍ଟନାମର ପରିବର୍ତ୍ତନକୁ ବାରଣ କରିଥାଏ + ਸਿਸਟਮ ਪਾਲਸੀ ਸਥਿਰ ਸਿਸਟਮ ਹੋਸਟ-ਨਾਂ ਲਈ ਸੋਧਾਂ ਤੋਂ ਰੋਕਦੀ ਹੈ + Polityka systemu powstrzymuje modyfikację trwałej systemowej nazwy komputera + Políticas de sistema previnem modificação da máquina persistente do sistema + Системная политика запрещает изменение постоянного имени узла компьютера + Sistemska pravila preprečujejo spremembo imena gostitelja trajnega sistema + Systemets policy förhindrar ändring av bestående värdnamn för systemet + நிலையான கணினி புரவலபெயர் மாற்றியமைப்பதை கணினி பாலிசி தடுக்கிறது + నిరంతర సిస్టమ్ హోస్టునామమును సవరించుటను సిస్టమ్ విధానము నిరోధించుచున్నది + 系统策略阻止更改系统固有主机名 + 系統政策讓您無法修改永久的系統主機名稱 + + no + auth_admin_keep + + + + + Connection sharing via a protected WiFi network + নিৰাপদ ৱাই-ফাইলৈ নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ + নিরাপদ ওয়াই-ফাইল নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার + Sdílení připojení přes chráněnou síť WiFi + Verbindungsfreigabe über ein geschütztes WiFi-Netzwerk + Κοινή χρήση σύνδεσης μέσω προστατευμένου ασύρματου δικτύου + Connection sharing via a protected Wi-Fi network + Compartir conexión a través de una red WIFI protegida + Konexio partekatua babestutako haririk gabeko sarearen bidez + Partage de connexion via un réseau WiFi protégé + Conexión compartida a través dunha rede WiFi protexida + સુરક્ષિત થયેલ WiFi નેટવર્ક મારફતે જોડાણ વહેંચણી + किसी संरक्षित WiFi संजाल के द्वारा कनेक्शन साझा + Kapcsolatmegosztás védett WiFi hálózaton + Condivide connessione attraverso una rete WiFi protetta + 保護された WiFi ネットワーク経由で接続共有 + ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸುವಿಕೆ + 보호된 WiFi 네트워크를 통한 연결 공유 + Dalijimasis ryšiu naudojant apsaugotą WiFi tinklą + സുരക്ഷിതമായ ഒരു വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷന്‍ പങ്കിടുക + सुरक्षीत WiFi नेटवर्क द्वारे जोडणीचे शेअरींग करा + ଗୋଟିଏ ସୁରକ୍ଷିତ WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ + ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ + Współdzielenie połączenia przez chronioną sieć WiFi + Compartilhamento de conexão via rede sem fio protegida + Совместное использование соединений в закрытой сети WiFi + Deljene povezave preko zaščitenega WiFi omrežja + Anslutningsdelning via ett skyddat trådlöst nätverk + ஒரு பாதுகாக்கப்ப WiFi நெட்வொர்க்கின் வழியாக இணைப்பு பகிரப்படுகிறது + రక్షిత WiFi నెట్వర్కు ద్వారా అనుసంధానపు భాగస్వామ్యము. + 通过受保护的 WiFi 网络共享连接 + 透過受保護的 WiFi 網路共享連線 + System policy prevents sharing connections via a protected WiFi network + প্ৰণালীৰ নিয়মনীতিয়ে নিৰাপদ ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ প্ৰতিৰোধ কৰিছে + সিস্টেমের নিয়মনীতির কারণে, নিরাপদ ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার প্রতিরোধ করা হয়েছে + Systémová politika zabránila sdílení připojení přes chráněnou síť WiFi + Die Systemrichtlinien verhindern Verbindungsfreigaben über ein geschütztes WiFi-Netzwerk + Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω προστατευμένου ασύρματου δικτύου + System policy prevents sharing connections via a protected Wi-Fi network + Política de sistema evita compartir conexiones a través de una red WIFI protegida + Sistemako arauek babestutako haririk gabeko sareen bidez konexioak partekatzea saihesten dute + La stratégie du système empêche tout partage des connexions via un réseau WiFi protégé + A política do sistema impide compartir conexións a través dunha rede WiFi protexida + સિસ્ટમ પોલિસી એ સુરક્ષિત થયેલ WiFi નેટવર્ક મારફતે વહેંચણી જોડાણોને રોકી રહ્યા છે + किसी संरक्षित WiFi संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है + A rendszer házirendje megakadályozza a kapcsolatok megosztását védett WiFi hálózaton + La politica di sistema impedisce di condividere connessioni attraverso una rete WiFi protetta + システムポリシーが保護された WiFi ネットワーク経由の接続共有を阻止します。 + ಒಂದು ಸಂರಕ್ಷಿತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ + 시스템 정책이 보호된 WiFi 네트워크를 통한 연결 공유를 금지합니다 + Sistemos politika nelaidžia dalytis ryšiais naudojant apsaugotą WiFi tinklą + സുരക്ഷിതമായ ഒരു വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷനുകള്‍ പങ്കിടുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു + प्रणाली करार सुरक्षीत WiFi नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे + ତନ୍ତ୍ର ନିତୀ ଗୋଟିଏ ସୁରକ୍ଷିତ WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ + ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਸੁਰੱਖਿਅਤ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ + Polityka systemu powstrzymuje współdzielenie połączeń przez chronioną sieć WiFi + Políticas de sistema previnem compartilhamento de conexões através de uma rede sem fio protegida + Системная политика запрещает совместное использование соединений в закрытой сети WiFi + Sistemska pravila preprečujejo deljenje povezav preko zaščitenega WiFi omrežja + Systemets policy förhindrar delning av anslutningar via ett skyddat trådlöst nätverk + பாதுகாக்கப்பட்ட WiFi நெட்வொர்க்கின் வழியாக இணைப்புகளை பகிருவதை கணினி பாலிசி தடுக்கிறது + రక్షిత WiFi నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది + 系统策略阻止使用受保护的 WiFi 网络共享连接 + 系統政策讓您無法透過受保護的 WiFi 網路共享連結 + + no + yes + + + + + Connection sharing via an open WiFi network + উন্মুক্ত ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ + উন্মুক্ত ওয়াই-ফাইল নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার + Sdílení připojení přes otevřenou síť WiFi + Verbindungsfreigabe über ein offenes WiFi-Netzwerk + Κοινή χρήση σύνδεσης μέσω ανοιχτού ασύρματου δικτύου + Connection sharing via an open Wi-Fi network + Compartir conexión a través de una red WIFI abierta + Konexio partekatua irekitako haririk gabeko sarearen bidez + Partage de connexion via un réseau WiFi ouvert + Conexión compartida a través dunha rede WiFi aberta + ખુલ્લા WiFi નેટવર્ક મારફતે જોડાણ વહેંચણી + किसी खुले WiFi संजाल के द्वारा कनेक्शन साझा + Kapcsolatmegosztás nyílt WiFi hálózaton + Condivide connessione attraverso una rete WiFi aperta + 開放した WiFi ネットワーク経由で接続共有 + ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸುವಿಕೆ + 열린 WiFi 네트워크를 통한 연결 공유 + Dalijimasis ryšiu naudojant atvirą WiFi tinklą + ഒരു തുറന്ന വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷന്‍ പങ്കിടുക + ओपन WiFi नेटवर्क द्वारे कनेक्शन शेअरींग करा + ଗୋଟିଏ ଖୋଲା WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ + ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਕੁਨੈਕਸ਼ਨ ਸਾਂਝਾ ਕਰੋ + Współdzielenie połączenia przez otwartą sieć WiFi + Compartilhamento de conexão via rede sem fio aberta + Совместное использование соединений в открытой сети WiFi + Deljene povezave preko odprtega WiFi omrežja + Anslutningsdelning via ett öppet trådlöst nätverk + ஒரு திறந்த WiFi நெட்வொர்க்கின் வழியாக இணைப்பு பகிரப்படுகிறது + ఓపెన్ WiFi నెట్వర్కు ద్వారా అనుసంధానపు భాగస్వామ్యము + 通过公开 WiFi 网络共享连接 + 透過開放的 WiFi 網路共享連線 + System policy prevents sharing connections via an open WiFi network + প্ৰণালীৰ নিয়মনীতিয়ে উন্মুক্ত ৱাই-ফাই নে'টৱৰ্কৰ মাধ্যমে সংযোগৰ যৌথ ব্যৱহাৰ প্ৰতিৰোধ কৰিছে + সিস্টেমের নিয়মনীতির কারণে, উন্মুক্ত ওয়াই-ফাই নেটওয়ার্কের মাধ্যমে সংযোগের যৌথ ব্যবহার প্রতিরোধ করা হয়েছে + Systémová politika zabránila sdílení připojení přes otevřenou síť WiFi + Die Systemrichtlinien verhindern Verbindungsfreigaben über ein offenes WiFi-Netzwerk + Η πολιτική συστήματος δεν επιτρέπει κοινή χρήση συνδέσεων μέσω ανοιχτού ασύρματου δικτύου + System policy prevents sharing connections via an open Wi-Fi network + Política de sistema evita compartir conexiones a través de una red WIFI abierta + Sistemako arauek irakitako haririk gabeko sareen bidez konexioak partekatzea saihesten dute + La stratégie du système empêche tout partage des connexions via un réseau WiFi ouvert + A política do sistema impide compartir conexións a través dunha rede WiFi aberta + સિસ્ટમ પોલિસી એ ખુલ્લા WiFi નેટવર્ક મારફતે વહેંચણી જોડાણોને રોકી રહ્યા છે + किसी खुले WiFi संजाल के द्वारा साझा कनेक्शन को सिस्टम नीति रोकता है + A rendszer házirendje megakadályozza a kapcsolatok megosztását nyílt WiFi hálózaton + La politica di sistema impedisce di condividere connessioni attraverso una rete WiFi aperta + システムポリシーが開放した WiFi ネットワーク経由の接続共有を阻止します。 + ಒಂದು ಮುಕ್ತವಾದ WiFi ಜಾಲಬಂಧದ ಮೂಲಕ ಸಂಪರ್ಕ ಸಾಧಿಸದಂತೆ ವ್ಯವಸ್ಥೆಯ ನಿಯಮಗಳು ತಡೆಯುತ್ತವೆ + 시스템 정책이 열린 WiFi 네트워크를 통한 연결 공유를 금지합니다 + Sistemos politika neleidžia dalytis ryšiais naudojant atvirą WiFi tinklą + ഒരു തുറന്ന വൈഫൈ നെറ്റ്‌വര്‍ക്ക് വഴി കണക്ഷനുകള്‍ പങ്കിടുന്നതു് സിസ്റ്റം പോളിസി തടയുന്നു + प्रणाली करार ओपन WiFi नेटवर्क द्वारे जोडणीचे शेअरींग रोखत आहे + ତନ୍ତ୍ର ନିତୀ ଗୋଟିଏ ଖୋଲା WiFi ନେଟୱର୍କରେ ସଂଯୋଗ ସହଭାଗ କରିବାରେ ବାରଣ କରିଥାଏ + ਸਿਸਟਮ ਪਾਲਸੀ ਕੁਨੈਕਸ਼ਨ ਨੂੰ ਓਪਨ ਵਾਈ-ਫਾਈ ਨੈੱਟਵਰਕ ਰਾਹੀਂ ਸਾਂਝਾ ਕਰਨ ਤੋਂ ਰੋਕਦੀ ਹੈ + Polityka systemu powstrzymuje współdzielenie połączeń przez otwartą sieć WiFi + Políticas de sistema previnem compartilhamento de conexões através de uma rede sem fio aberta + Системная политика запрещает совместное использование соединений в закрытой сети WiFi + Sistemska pravila preprečujejo deljenje povezav preko odprtega WiFi omrežja + Systemets policy förhindrar delning av anslutningar via ett öppet trådlöst nätverk + திறந்த WiFi நெட்வொர்க்கின் வழியாக இணைப்புகளை பகிருவதை கணினி பாலிசி தடுக்கிறது + ఓపెన్ WiFi నెట్వర్కు ద్వారా అనుసంధానములను భాగస్వామ్యపరచుట సిస్టమ్ విధానము నిరోధించుచున్నది + 系统策略组织使用公开 WiFi 网络共享连接 + 系統政策讓您無法透過開放的 WiFi 網路共享連線 + + no + yes + + + + \ No newline at end of file diff --git a/policy/org.freedesktop.network-manager-settings.system.policy.in b/policy/org.freedesktop.network-manager-settings.system.policy.in new file mode 100644 index 00000000..620e3a6a --- /dev/null +++ b/policy/org.freedesktop.network-manager-settings.system.policy.in @@ -0,0 +1,48 @@ + + + + + + NetworkManager + http://www.gnome.org/projects/NetworkManager + nm-icon + + + <_description>Modify system connections + <_message>System policy prevents modification of system settings + + no + auth_admin_keep + + + + + <_description>Modify persistent system hostname + <_message>System policy prevents modification of the persistent system hostname + + no + auth_admin_keep + + + + + <_description>Connection sharing via a protected WiFi network + <_message>System policy prevents sharing connections via a protected WiFi network + + no + yes + + + + + <_description>Connection sharing via an open WiFi network + <_message>System policy prevents sharing connections via an open WiFi network + + no + yes + + + + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 00000000..5d2db6e3 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,278 @@ +SUBDIRS= \ + logging \ + named-manager \ + vpn-manager \ + dhcp-manager \ + ip6-manager \ + supplicant-manager \ + ppp-manager \ + backends \ + dnsmasq-manager \ + modem-manager \ + bluez-manager \ + system-settings \ + . \ + tests + +INCLUDES = -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src/named-manager \ + -I${top_srcdir}/src/vpn-manager \ + -I${top_srcdir}/src/dhcp-manager \ + -I${top_srcdir}/src/ip6-manager \ + -I${top_srcdir}/src/supplicant-manager \ + -I${top_srcdir}/src/dnsmasq-manager \ + -I${top_srcdir}/src/modem-manager \ + -I$(top_srcdir)/src/bluez-manager \ + -I$(top_srcdir)/src/system-settings \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib \ + -I${top_srcdir}/callouts + +########################################### +# Test libraries +########################################### + +noinst_LTLIBRARIES = libtest-dhcp.la libtest-policy-hosts.la + +########################################### +# DHCP test library +########################################### + +libtest_dhcp_la_SOURCES = \ + nm-ip4-config.c \ + nm-ip6-config.c \ + nm-hostname-provider.c \ + nm-dbus-manager.c + +libtest_dhcp_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(LIBNL_CFLAGS) + +libtest_dhcp_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) \ + $(LIBNL_LIBS) + +########################################### +# Hosts policy test library +########################################### + +libtest_policy_hosts_la_SOURCES = \ + nm-policy-hosts.c \ + nm-policy-hosts.h + +libtest_policy_hosts_la_CPPFLAGS = \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + $(GLIB_CFLAGS) + +libtest_policy_hosts_la_LIBADD = \ + ${top_builddir}/src/logging/libnm-logging.la \ + $(GLIB_LIBS) + + +########################################### +# NetworkManager +########################################### + +sbin_PROGRAMS = NetworkManager + +NetworkManager_SOURCES = \ + nm-call-store.c \ + nm-call-store.h \ + nm-device.c \ + nm-device.h \ + nm-device-interface.c \ + nm-device-interface.h \ + nm-device-private.h \ + nm-device-ethernet.c \ + nm-device-ethernet.h \ + nm-device-wifi.c \ + nm-device-wifi.h \ + nm-device-olpc-mesh.c \ + nm-device-olpc-mesh.h \ + nm-device-bt.c \ + nm-device-bt.h \ + nm-device-modem.h \ + nm-device-modem.c \ + nm-device-cdma.c \ + nm-device-cdma.h \ + nm-device-gsm.c \ + nm-device-gsm.h \ + nm-wifi-ap.c \ + nm-wifi-ap.h \ + nm-dbus-manager.h \ + nm-dbus-manager.c \ + nm-udev-manager.c \ + nm-udev-manager.h \ + nm-hostname-provider.c \ + nm-hostname-provider.h \ + nm-ip4-config.c \ + nm-ip4-config.h \ + nm-ip6-config.c \ + nm-ip6-config.h \ + nm-secrets-provider-interface.c \ + nm-secrets-provider-interface.h \ + nm-active-connection.h \ + nm-active-connection.c \ + main.c \ + nm-policy.c \ + nm-policy.h \ + nm-policy-hosts.c \ + nm-policy-hosts.h \ + nm-policy-hostname.c \ + nm-policy-hostname.h \ + NetworkManagerUtils.c \ + NetworkManagerUtils.h \ + nm-system.c \ + nm-system.h \ + nm-manager.c \ + nm-manager.h \ + nm-netlink-monitor.c \ + nm-netlink-monitor.h \ + nm-activation-request.c \ + nm-activation-request.h \ + nm-properties-changed-signal.c \ + nm-properties-changed-signal.h \ + wpa.c \ + wpa.h \ + nm-dhcp4-config.c \ + nm-dhcp4-config.h \ + nm-dhcp6-config.c \ + nm-dhcp6-config.h \ + nm-rfkill.h + +nm-access-point-glue.h: $(top_srcdir)/introspection/nm-access-point.xml + dbus-binding-tool --prefix=nm_access_point --mode=glib-server --output=$@ $< + +nm-manager-glue.h: $(top_srcdir)/introspection/nm-manager.xml + dbus-binding-tool --prefix=nm_manager --mode=glib-server --output=$@ $< + +nm-device-interface-glue.h: $(top_srcdir)/introspection/nm-device.xml + dbus-binding-tool --prefix=nm_device_interface --mode=glib-server --output=$@ $< + +nm-device-ethernet-glue.h: $(top_srcdir)/introspection/nm-device-ethernet.xml + dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-server --output=$@ $< + +nm-device-wifi-glue.h: $(top_srcdir)/introspection/nm-device-wifi.xml + dbus-binding-tool --prefix=nm_device_wifi --mode=glib-server --output=$@ $< + +nm-device-bt-glue.h: $(top_srcdir)/introspection/nm-device-bt.xml + dbus-binding-tool --prefix=nm_device_bt --mode=glib-server --output=$@ $< + +nm-device-olpc-mesh-glue.h: $(top_srcdir)/introspection/nm-device-olpc-mesh.xml + dbus-binding-tool --prefix=nm_device_olpc_mesh --mode=glib-server --output=$@ $< + +nm-ip4-config-glue.h: $(top_srcdir)/introspection/nm-ip4-config.xml + dbus-binding-tool --prefix=nm_ip4_config --mode=glib-server --output=$@ $< + +nm-ip6-config-glue.h: $(top_srcdir)/introspection/nm-ip6-config.xml + dbus-binding-tool --prefix=nm_ip6_config --mode=glib-server --output=$@ $< + +nm-active-connection-glue.h: $(top_srcdir)/introspection/nm-active-connection.xml + dbus-binding-tool --prefix=nm_active_connection --mode=glib-server --output=$@ $< + +nm-dhcp4-config-glue.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml + dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-server --output=$@ $< + +nm-dhcp6-config-glue.h: $(top_srcdir)/introspection/nm-dhcp6-config.xml + dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-server --output=$@ $< + +nm-device-cdma-glue.h: $(top_srcdir)/introspection/nm-device-cdma.xml + dbus-binding-tool --prefix=nm_device_cdma --mode=glib-server --output=$@ $< + +nm-device-gsm-glue.h: $(top_srcdir)/introspection/nm-device-gsm.xml + dbus-binding-tool --prefix=nm_device_gsm --mode=glib-server --output=$@ $< + +BUILT_SOURCES = \ + nm-access-point-glue.h \ + nm-manager-glue.h \ + nm-device-interface-glue.h \ + nm-device-ethernet-glue.h \ + nm-device-wifi-glue.h \ + nm-device-olpc-mesh-glue.h \ + nm-device-bt-glue.h \ + nm-device-cdma-glue.h \ + nm-device-gsm-glue.h \ + nm-ip4-config-glue.h \ + nm-ip6-config-glue.h \ + nm-active-connection-glue.h \ + nm-dhcp4-config-glue.h \ + nm-dhcp6-config-glue.h + +NetworkManager_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GUDEV_CFLAGS) \ + $(LIBNL_CFLAGS) \ + $(GMODULE_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DSBINDIR=\"$(sbindir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DNM_RUN_DIR=\"$(rundir)\" \ + -DNMLOCALEDIR=\"$(datadir)/locale\" \ + -DARP_DEBUG + +NetworkManager_LDADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + ./logging/libnm-logging.la \ + ./named-manager/libnamed-manager.la \ + ./vpn-manager/libvpn-manager.la \ + ./dhcp-manager/libdhcp-manager.la \ + ./ip6-manager/libip6-manager.la \ + ./supplicant-manager/libsupplicant-manager.la \ + ./dnsmasq-manager/libdnsmasq-manager.la \ + ./ppp-manager/libppp-manager.la \ + ./modem-manager/libmodem-manager.la \ + ./bluez-manager/libbluez-manager.la \ + ./system-settings/libsystem-settings.la \ + ./backends/libnmbackend.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(GUDEV_LIBS) \ + $(LIBNL_LIBS) \ + $(GMODULE_LIBS) \ + $(LIBM) \ + $(LIBDL) + +NetworkManager_LDFLAGS = -rdynamic + +libexec_PROGRAMS = nm-crash-logger +nm_crash_logger_SOURCES = nm-crash-logger.c +nm_crash_logger_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DSBINDIR=\"$(sbindir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" +nm_crash_logger_LDADD = $(GLIB_LIBS) + + +NetworkManagerdir = $(datadir)/NetworkManager +NetworkManager_DATA = gdb-cmd + +dbusservicedir = $(DBUS_SYS_DIR) +dbusservice_DATA = NetworkManager.conf + +EXTRA_DIST = \ + $(dbusservice_DATA) \ + $(NetworkManager_DATA) + +rundir=$(localstatedir)/run/NetworkManager +install-data-hook: + $(mkinstalldirs) -m 0700 $(DESTDIR)$(rundir) + +CLEANFILES = $(BUILT_SOURCES) + diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 00000000..7943a100 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,1722 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +sbin_PROGRAMS = NetworkManager$(EXEEXT) +libexec_PROGRAMS = nm-crash-logger$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libtest_dhcp_la_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libtest_dhcp_la_OBJECTS = libtest_dhcp_la-nm-ip4-config.lo \ + libtest_dhcp_la-nm-ip6-config.lo \ + libtest_dhcp_la-nm-hostname-provider.lo \ + libtest_dhcp_la-nm-dbus-manager.lo +libtest_dhcp_la_OBJECTS = $(am_libtest_dhcp_la_OBJECTS) +libtest_policy_hosts_la_DEPENDENCIES = \ + ${top_builddir}/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) +am_libtest_policy_hosts_la_OBJECTS = \ + libtest_policy_hosts_la-nm-policy-hosts.lo +libtest_policy_hosts_la_OBJECTS = \ + $(am_libtest_policy_hosts_la_OBJECTS) +am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" \ + "$(DESTDIR)$(NetworkManagerdir)" "$(DESTDIR)$(dbusservicedir)" +PROGRAMS = $(libexec_PROGRAMS) $(sbin_PROGRAMS) +am_NetworkManager_OBJECTS = NetworkManager-nm-call-store.$(OBJEXT) \ + NetworkManager-nm-device.$(OBJEXT) \ + NetworkManager-nm-device-interface.$(OBJEXT) \ + NetworkManager-nm-device-ethernet.$(OBJEXT) \ + NetworkManager-nm-device-wifi.$(OBJEXT) \ + NetworkManager-nm-device-olpc-mesh.$(OBJEXT) \ + NetworkManager-nm-device-bt.$(OBJEXT) \ + NetworkManager-nm-device-modem.$(OBJEXT) \ + NetworkManager-nm-device-cdma.$(OBJEXT) \ + NetworkManager-nm-device-gsm.$(OBJEXT) \ + NetworkManager-nm-wifi-ap.$(OBJEXT) \ + NetworkManager-nm-dbus-manager.$(OBJEXT) \ + NetworkManager-nm-udev-manager.$(OBJEXT) \ + NetworkManager-nm-hostname-provider.$(OBJEXT) \ + NetworkManager-nm-ip4-config.$(OBJEXT) \ + NetworkManager-nm-ip6-config.$(OBJEXT) \ + NetworkManager-nm-secrets-provider-interface.$(OBJEXT) \ + NetworkManager-nm-active-connection.$(OBJEXT) \ + NetworkManager-main.$(OBJEXT) \ + NetworkManager-nm-policy.$(OBJEXT) \ + NetworkManager-nm-policy-hosts.$(OBJEXT) \ + NetworkManager-nm-policy-hostname.$(OBJEXT) \ + NetworkManager-NetworkManagerUtils.$(OBJEXT) \ + NetworkManager-nm-system.$(OBJEXT) \ + NetworkManager-nm-manager.$(OBJEXT) \ + NetworkManager-nm-netlink-monitor.$(OBJEXT) \ + NetworkManager-nm-activation-request.$(OBJEXT) \ + NetworkManager-nm-properties-changed-signal.$(OBJEXT) \ + NetworkManager-wpa.$(OBJEXT) \ + NetworkManager-nm-dhcp4-config.$(OBJEXT) \ + NetworkManager-nm-dhcp6-config.$(OBJEXT) +NetworkManager_OBJECTS = $(am_NetworkManager_OBJECTS) +NetworkManager_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + ./logging/libnm-logging.la ./named-manager/libnamed-manager.la \ + ./vpn-manager/libvpn-manager.la \ + ./dhcp-manager/libdhcp-manager.la \ + ./ip6-manager/libip6-manager.la \ + ./supplicant-manager/libsupplicant-manager.la \ + ./dnsmasq-manager/libdnsmasq-manager.la \ + ./ppp-manager/libppp-manager.la \ + ./modem-manager/libmodem-manager.la \ + ./bluez-manager/libbluez-manager.la \ + ./system-settings/libsystem-settings.la \ + ./backends/libnmbackend.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +NetworkManager_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(NetworkManager_LDFLAGS) $(LDFLAGS) -o $@ +am_nm_crash_logger_OBJECTS = \ + nm_crash_logger-nm-crash-logger.$(OBJEXT) +nm_crash_logger_OBJECTS = $(am_nm_crash_logger_OBJECTS) +nm_crash_logger_DEPENDENCIES = $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libtest_dhcp_la_SOURCES) \ + $(libtest_policy_hosts_la_SOURCES) $(NetworkManager_SOURCES) \ + $(nm_crash_logger_SOURCES) +DIST_SOURCES = $(libtest_dhcp_la_SOURCES) \ + $(libtest_policy_hosts_la_SOURCES) $(NetworkManager_SOURCES) \ + $(nm_crash_logger_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +DATA = $(NetworkManager_DATA) $(dbusservice_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = \ + logging \ + named-manager \ + vpn-manager \ + dhcp-manager \ + ip6-manager \ + supplicant-manager \ + ppp-manager \ + backends \ + dnsmasq-manager \ + modem-manager \ + bluez-manager \ + system-settings \ + . \ + tests + +INCLUDES = -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src/named-manager \ + -I${top_srcdir}/src/vpn-manager \ + -I${top_srcdir}/src/dhcp-manager \ + -I${top_srcdir}/src/ip6-manager \ + -I${top_srcdir}/src/supplicant-manager \ + -I${top_srcdir}/src/dnsmasq-manager \ + -I${top_srcdir}/src/modem-manager \ + -I$(top_srcdir)/src/bluez-manager \ + -I$(top_srcdir)/src/system-settings \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib \ + -I${top_srcdir}/callouts + + +########################################### +# Test libraries +########################################### +noinst_LTLIBRARIES = libtest-dhcp.la libtest-policy-hosts.la + +########################################### +# DHCP test library +########################################### +libtest_dhcp_la_SOURCES = \ + nm-ip4-config.c \ + nm-ip6-config.c \ + nm-hostname-provider.c \ + nm-dbus-manager.c + +libtest_dhcp_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(LIBNL_CFLAGS) + +libtest_dhcp_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) \ + $(LIBNL_LIBS) + + +########################################### +# Hosts policy test library +########################################### +libtest_policy_hosts_la_SOURCES = \ + nm-policy-hosts.c \ + nm-policy-hosts.h + +libtest_policy_hosts_la_CPPFLAGS = \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + $(GLIB_CFLAGS) + +libtest_policy_hosts_la_LIBADD = \ + ${top_builddir}/src/logging/libnm-logging.la \ + $(GLIB_LIBS) + +NetworkManager_SOURCES = \ + nm-call-store.c \ + nm-call-store.h \ + nm-device.c \ + nm-device.h \ + nm-device-interface.c \ + nm-device-interface.h \ + nm-device-private.h \ + nm-device-ethernet.c \ + nm-device-ethernet.h \ + nm-device-wifi.c \ + nm-device-wifi.h \ + nm-device-olpc-mesh.c \ + nm-device-olpc-mesh.h \ + nm-device-bt.c \ + nm-device-bt.h \ + nm-device-modem.h \ + nm-device-modem.c \ + nm-device-cdma.c \ + nm-device-cdma.h \ + nm-device-gsm.c \ + nm-device-gsm.h \ + nm-wifi-ap.c \ + nm-wifi-ap.h \ + nm-dbus-manager.h \ + nm-dbus-manager.c \ + nm-udev-manager.c \ + nm-udev-manager.h \ + nm-hostname-provider.c \ + nm-hostname-provider.h \ + nm-ip4-config.c \ + nm-ip4-config.h \ + nm-ip6-config.c \ + nm-ip6-config.h \ + nm-secrets-provider-interface.c \ + nm-secrets-provider-interface.h \ + nm-active-connection.h \ + nm-active-connection.c \ + main.c \ + nm-policy.c \ + nm-policy.h \ + nm-policy-hosts.c \ + nm-policy-hosts.h \ + nm-policy-hostname.c \ + nm-policy-hostname.h \ + NetworkManagerUtils.c \ + NetworkManagerUtils.h \ + nm-system.c \ + nm-system.h \ + nm-manager.c \ + nm-manager.h \ + nm-netlink-monitor.c \ + nm-netlink-monitor.h \ + nm-activation-request.c \ + nm-activation-request.h \ + nm-properties-changed-signal.c \ + nm-properties-changed-signal.h \ + wpa.c \ + wpa.h \ + nm-dhcp4-config.c \ + nm-dhcp4-config.h \ + nm-dhcp6-config.c \ + nm-dhcp6-config.h \ + nm-rfkill.h + +BUILT_SOURCES = \ + nm-access-point-glue.h \ + nm-manager-glue.h \ + nm-device-interface-glue.h \ + nm-device-ethernet-glue.h \ + nm-device-wifi-glue.h \ + nm-device-olpc-mesh-glue.h \ + nm-device-bt-glue.h \ + nm-device-cdma-glue.h \ + nm-device-gsm-glue.h \ + nm-ip4-config-glue.h \ + nm-ip6-config-glue.h \ + nm-active-connection-glue.h \ + nm-dhcp4-config-glue.h \ + nm-dhcp6-config-glue.h + +NetworkManager_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GUDEV_CFLAGS) \ + $(LIBNL_CFLAGS) \ + $(GMODULE_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DSBINDIR=\"$(sbindir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DNM_RUN_DIR=\"$(rundir)\" \ + -DNMLOCALEDIR=\"$(datadir)/locale\" \ + -DARP_DEBUG + +NetworkManager_LDADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + ./logging/libnm-logging.la \ + ./named-manager/libnamed-manager.la \ + ./vpn-manager/libvpn-manager.la \ + ./dhcp-manager/libdhcp-manager.la \ + ./ip6-manager/libip6-manager.la \ + ./supplicant-manager/libsupplicant-manager.la \ + ./dnsmasq-manager/libdnsmasq-manager.la \ + ./ppp-manager/libppp-manager.la \ + ./modem-manager/libmodem-manager.la \ + ./bluez-manager/libbluez-manager.la \ + ./system-settings/libsystem-settings.la \ + ./backends/libnmbackend.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(GUDEV_LIBS) \ + $(LIBNL_LIBS) \ + $(GMODULE_LIBS) \ + $(LIBM) \ + $(LIBDL) + +NetworkManager_LDFLAGS = -rdynamic +nm_crash_logger_SOURCES = nm-crash-logger.c +nm_crash_logger_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DSBINDIR=\"$(sbindir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" + +nm_crash_logger_LDADD = $(GLIB_LIBS) +NetworkManagerdir = $(datadir)/NetworkManager +NetworkManager_DATA = gdb-cmd +dbusservicedir = $(DBUS_SYS_DIR) +dbusservice_DATA = NetworkManager.conf +EXTRA_DIST = \ + $(dbusservice_DATA) \ + $(NetworkManager_DATA) + +rundir = $(localstatedir)/run/NetworkManager +CLEANFILES = $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libtest-dhcp.la: $(libtest_dhcp_la_OBJECTS) $(libtest_dhcp_la_DEPENDENCIES) + $(LINK) $(libtest_dhcp_la_OBJECTS) $(libtest_dhcp_la_LIBADD) $(LIBS) +libtest-policy-hosts.la: $(libtest_policy_hosts_la_OBJECTS) $(libtest_policy_hosts_la_DEPENDENCIES) + $(LINK) $(libtest_policy_hosts_la_OBJECTS) $(libtest_policy_hosts_la_LIBADD) $(LIBS) +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libexecdir)" && rm -f $$files + +clean-libexecPROGRAMS: + @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sbindir)" && rm -f $$files + +clean-sbinPROGRAMS: + @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +NetworkManager$(EXEEXT): $(NetworkManager_OBJECTS) $(NetworkManager_DEPENDENCIES) + @rm -f NetworkManager$(EXEEXT) + $(NetworkManager_LINK) $(NetworkManager_OBJECTS) $(NetworkManager_LDADD) $(LIBS) +nm-crash-logger$(EXEEXT): $(nm_crash_logger_OBJECTS) $(nm_crash_logger_DEPENDENCIES) + @rm -f nm-crash-logger$(EXEEXT) + $(LINK) $(nm_crash_logger_OBJECTS) $(nm_crash_logger_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-NetworkManagerUtils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-activation-request.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-active-connection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-call-store.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-dbus-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device-bt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device-cdma.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device-ethernet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device-gsm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device-interface.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device-modem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device-olpc-mesh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device-wifi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-dhcp4-config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-dhcp6-config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-hostname-provider.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-ip4-config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-ip6-config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-netlink-monitor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-policy-hostname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-policy-hosts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-policy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-properties-changed-signal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-secrets-provider-interface.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-system.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-udev-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-nm-wifi-ap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkManager-wpa.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_dhcp_la-nm-dbus-manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_dhcp_la-nm-hostname-provider.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_dhcp_la-nm-ip4-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_dhcp_la-nm-ip6-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_policy_hosts_la-nm-policy-hosts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm_crash_logger-nm-crash-logger.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libtest_dhcp_la-nm-ip4-config.lo: nm-ip4-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_dhcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_dhcp_la-nm-ip4-config.lo -MD -MP -MF $(DEPDIR)/libtest_dhcp_la-nm-ip4-config.Tpo -c -o libtest_dhcp_la-nm-ip4-config.lo `test -f 'nm-ip4-config.c' || echo '$(srcdir)/'`nm-ip4-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_dhcp_la-nm-ip4-config.Tpo $(DEPDIR)/libtest_dhcp_la-nm-ip4-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip4-config.c' object='libtest_dhcp_la-nm-ip4-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_dhcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_dhcp_la-nm-ip4-config.lo `test -f 'nm-ip4-config.c' || echo '$(srcdir)/'`nm-ip4-config.c + +libtest_dhcp_la-nm-ip6-config.lo: nm-ip6-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_dhcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_dhcp_la-nm-ip6-config.lo -MD -MP -MF $(DEPDIR)/libtest_dhcp_la-nm-ip6-config.Tpo -c -o libtest_dhcp_la-nm-ip6-config.lo `test -f 'nm-ip6-config.c' || echo '$(srcdir)/'`nm-ip6-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_dhcp_la-nm-ip6-config.Tpo $(DEPDIR)/libtest_dhcp_la-nm-ip6-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip6-config.c' object='libtest_dhcp_la-nm-ip6-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_dhcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_dhcp_la-nm-ip6-config.lo `test -f 'nm-ip6-config.c' || echo '$(srcdir)/'`nm-ip6-config.c + +libtest_dhcp_la-nm-hostname-provider.lo: nm-hostname-provider.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_dhcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_dhcp_la-nm-hostname-provider.lo -MD -MP -MF $(DEPDIR)/libtest_dhcp_la-nm-hostname-provider.Tpo -c -o libtest_dhcp_la-nm-hostname-provider.lo `test -f 'nm-hostname-provider.c' || echo '$(srcdir)/'`nm-hostname-provider.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_dhcp_la-nm-hostname-provider.Tpo $(DEPDIR)/libtest_dhcp_la-nm-hostname-provider.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-hostname-provider.c' object='libtest_dhcp_la-nm-hostname-provider.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_dhcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_dhcp_la-nm-hostname-provider.lo `test -f 'nm-hostname-provider.c' || echo '$(srcdir)/'`nm-hostname-provider.c + +libtest_dhcp_la-nm-dbus-manager.lo: nm-dbus-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_dhcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_dhcp_la-nm-dbus-manager.lo -MD -MP -MF $(DEPDIR)/libtest_dhcp_la-nm-dbus-manager.Tpo -c -o libtest_dhcp_la-nm-dbus-manager.lo `test -f 'nm-dbus-manager.c' || echo '$(srcdir)/'`nm-dbus-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_dhcp_la-nm-dbus-manager.Tpo $(DEPDIR)/libtest_dhcp_la-nm-dbus-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dbus-manager.c' object='libtest_dhcp_la-nm-dbus-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_dhcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_dhcp_la-nm-dbus-manager.lo `test -f 'nm-dbus-manager.c' || echo '$(srcdir)/'`nm-dbus-manager.c + +libtest_policy_hosts_la-nm-policy-hosts.lo: nm-policy-hosts.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_policy_hosts_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtest_policy_hosts_la-nm-policy-hosts.lo -MD -MP -MF $(DEPDIR)/libtest_policy_hosts_la-nm-policy-hosts.Tpo -c -o libtest_policy_hosts_la-nm-policy-hosts.lo `test -f 'nm-policy-hosts.c' || echo '$(srcdir)/'`nm-policy-hosts.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libtest_policy_hosts_la-nm-policy-hosts.Tpo $(DEPDIR)/libtest_policy_hosts_la-nm-policy-hosts.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-policy-hosts.c' object='libtest_policy_hosts_la-nm-policy-hosts.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_policy_hosts_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtest_policy_hosts_la-nm-policy-hosts.lo `test -f 'nm-policy-hosts.c' || echo '$(srcdir)/'`nm-policy-hosts.c + +NetworkManager-nm-call-store.o: nm-call-store.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-call-store.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-call-store.Tpo -c -o NetworkManager-nm-call-store.o `test -f 'nm-call-store.c' || echo '$(srcdir)/'`nm-call-store.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-call-store.Tpo $(DEPDIR)/NetworkManager-nm-call-store.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-call-store.c' object='NetworkManager-nm-call-store.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-call-store.o `test -f 'nm-call-store.c' || echo '$(srcdir)/'`nm-call-store.c + +NetworkManager-nm-call-store.obj: nm-call-store.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-call-store.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-call-store.Tpo -c -o NetworkManager-nm-call-store.obj `if test -f 'nm-call-store.c'; then $(CYGPATH_W) 'nm-call-store.c'; else $(CYGPATH_W) '$(srcdir)/nm-call-store.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-call-store.Tpo $(DEPDIR)/NetworkManager-nm-call-store.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-call-store.c' object='NetworkManager-nm-call-store.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-call-store.obj `if test -f 'nm-call-store.c'; then $(CYGPATH_W) 'nm-call-store.c'; else $(CYGPATH_W) '$(srcdir)/nm-call-store.c'; fi` + +NetworkManager-nm-device.o: nm-device.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device.Tpo -c -o NetworkManager-nm-device.o `test -f 'nm-device.c' || echo '$(srcdir)/'`nm-device.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device.Tpo $(DEPDIR)/NetworkManager-nm-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device.c' object='NetworkManager-nm-device.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device.o `test -f 'nm-device.c' || echo '$(srcdir)/'`nm-device.c + +NetworkManager-nm-device.obj: nm-device.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device.Tpo -c -o NetworkManager-nm-device.obj `if test -f 'nm-device.c'; then $(CYGPATH_W) 'nm-device.c'; else $(CYGPATH_W) '$(srcdir)/nm-device.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device.Tpo $(DEPDIR)/NetworkManager-nm-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device.c' object='NetworkManager-nm-device.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device.obj `if test -f 'nm-device.c'; then $(CYGPATH_W) 'nm-device.c'; else $(CYGPATH_W) '$(srcdir)/nm-device.c'; fi` + +NetworkManager-nm-device-interface.o: nm-device-interface.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-interface.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-interface.Tpo -c -o NetworkManager-nm-device-interface.o `test -f 'nm-device-interface.c' || echo '$(srcdir)/'`nm-device-interface.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-interface.Tpo $(DEPDIR)/NetworkManager-nm-device-interface.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-interface.c' object='NetworkManager-nm-device-interface.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-interface.o `test -f 'nm-device-interface.c' || echo '$(srcdir)/'`nm-device-interface.c + +NetworkManager-nm-device-interface.obj: nm-device-interface.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-interface.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-interface.Tpo -c -o NetworkManager-nm-device-interface.obj `if test -f 'nm-device-interface.c'; then $(CYGPATH_W) 'nm-device-interface.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-interface.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-interface.Tpo $(DEPDIR)/NetworkManager-nm-device-interface.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-interface.c' object='NetworkManager-nm-device-interface.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-interface.obj `if test -f 'nm-device-interface.c'; then $(CYGPATH_W) 'nm-device-interface.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-interface.c'; fi` + +NetworkManager-nm-device-ethernet.o: nm-device-ethernet.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-ethernet.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-ethernet.Tpo -c -o NetworkManager-nm-device-ethernet.o `test -f 'nm-device-ethernet.c' || echo '$(srcdir)/'`nm-device-ethernet.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-ethernet.Tpo $(DEPDIR)/NetworkManager-nm-device-ethernet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-ethernet.c' object='NetworkManager-nm-device-ethernet.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-ethernet.o `test -f 'nm-device-ethernet.c' || echo '$(srcdir)/'`nm-device-ethernet.c + +NetworkManager-nm-device-ethernet.obj: nm-device-ethernet.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-ethernet.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-ethernet.Tpo -c -o NetworkManager-nm-device-ethernet.obj `if test -f 'nm-device-ethernet.c'; then $(CYGPATH_W) 'nm-device-ethernet.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-ethernet.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-ethernet.Tpo $(DEPDIR)/NetworkManager-nm-device-ethernet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-ethernet.c' object='NetworkManager-nm-device-ethernet.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-ethernet.obj `if test -f 'nm-device-ethernet.c'; then $(CYGPATH_W) 'nm-device-ethernet.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-ethernet.c'; fi` + +NetworkManager-nm-device-wifi.o: nm-device-wifi.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-wifi.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-wifi.Tpo -c -o NetworkManager-nm-device-wifi.o `test -f 'nm-device-wifi.c' || echo '$(srcdir)/'`nm-device-wifi.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-wifi.Tpo $(DEPDIR)/NetworkManager-nm-device-wifi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-wifi.c' object='NetworkManager-nm-device-wifi.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-wifi.o `test -f 'nm-device-wifi.c' || echo '$(srcdir)/'`nm-device-wifi.c + +NetworkManager-nm-device-wifi.obj: nm-device-wifi.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-wifi.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-wifi.Tpo -c -o NetworkManager-nm-device-wifi.obj `if test -f 'nm-device-wifi.c'; then $(CYGPATH_W) 'nm-device-wifi.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-wifi.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-wifi.Tpo $(DEPDIR)/NetworkManager-nm-device-wifi.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-wifi.c' object='NetworkManager-nm-device-wifi.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-wifi.obj `if test -f 'nm-device-wifi.c'; then $(CYGPATH_W) 'nm-device-wifi.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-wifi.c'; fi` + +NetworkManager-nm-device-olpc-mesh.o: nm-device-olpc-mesh.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-olpc-mesh.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-olpc-mesh.Tpo -c -o NetworkManager-nm-device-olpc-mesh.o `test -f 'nm-device-olpc-mesh.c' || echo '$(srcdir)/'`nm-device-olpc-mesh.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-olpc-mesh.Tpo $(DEPDIR)/NetworkManager-nm-device-olpc-mesh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-olpc-mesh.c' object='NetworkManager-nm-device-olpc-mesh.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-olpc-mesh.o `test -f 'nm-device-olpc-mesh.c' || echo '$(srcdir)/'`nm-device-olpc-mesh.c + +NetworkManager-nm-device-olpc-mesh.obj: nm-device-olpc-mesh.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-olpc-mesh.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-olpc-mesh.Tpo -c -o NetworkManager-nm-device-olpc-mesh.obj `if test -f 'nm-device-olpc-mesh.c'; then $(CYGPATH_W) 'nm-device-olpc-mesh.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-olpc-mesh.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-olpc-mesh.Tpo $(DEPDIR)/NetworkManager-nm-device-olpc-mesh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-olpc-mesh.c' object='NetworkManager-nm-device-olpc-mesh.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-olpc-mesh.obj `if test -f 'nm-device-olpc-mesh.c'; then $(CYGPATH_W) 'nm-device-olpc-mesh.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-olpc-mesh.c'; fi` + +NetworkManager-nm-device-bt.o: nm-device-bt.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-bt.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-bt.Tpo -c -o NetworkManager-nm-device-bt.o `test -f 'nm-device-bt.c' || echo '$(srcdir)/'`nm-device-bt.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-bt.Tpo $(DEPDIR)/NetworkManager-nm-device-bt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-bt.c' object='NetworkManager-nm-device-bt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-bt.o `test -f 'nm-device-bt.c' || echo '$(srcdir)/'`nm-device-bt.c + +NetworkManager-nm-device-bt.obj: nm-device-bt.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-bt.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-bt.Tpo -c -o NetworkManager-nm-device-bt.obj `if test -f 'nm-device-bt.c'; then $(CYGPATH_W) 'nm-device-bt.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-bt.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-bt.Tpo $(DEPDIR)/NetworkManager-nm-device-bt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-bt.c' object='NetworkManager-nm-device-bt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-bt.obj `if test -f 'nm-device-bt.c'; then $(CYGPATH_W) 'nm-device-bt.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-bt.c'; fi` + +NetworkManager-nm-device-modem.o: nm-device-modem.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-modem.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-modem.Tpo -c -o NetworkManager-nm-device-modem.o `test -f 'nm-device-modem.c' || echo '$(srcdir)/'`nm-device-modem.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-modem.Tpo $(DEPDIR)/NetworkManager-nm-device-modem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-modem.c' object='NetworkManager-nm-device-modem.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-modem.o `test -f 'nm-device-modem.c' || echo '$(srcdir)/'`nm-device-modem.c + +NetworkManager-nm-device-modem.obj: nm-device-modem.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-modem.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-modem.Tpo -c -o NetworkManager-nm-device-modem.obj `if test -f 'nm-device-modem.c'; then $(CYGPATH_W) 'nm-device-modem.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-modem.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-modem.Tpo $(DEPDIR)/NetworkManager-nm-device-modem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-modem.c' object='NetworkManager-nm-device-modem.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-modem.obj `if test -f 'nm-device-modem.c'; then $(CYGPATH_W) 'nm-device-modem.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-modem.c'; fi` + +NetworkManager-nm-device-cdma.o: nm-device-cdma.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-cdma.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-cdma.Tpo -c -o NetworkManager-nm-device-cdma.o `test -f 'nm-device-cdma.c' || echo '$(srcdir)/'`nm-device-cdma.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-cdma.Tpo $(DEPDIR)/NetworkManager-nm-device-cdma.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-cdma.c' object='NetworkManager-nm-device-cdma.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-cdma.o `test -f 'nm-device-cdma.c' || echo '$(srcdir)/'`nm-device-cdma.c + +NetworkManager-nm-device-cdma.obj: nm-device-cdma.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-cdma.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-cdma.Tpo -c -o NetworkManager-nm-device-cdma.obj `if test -f 'nm-device-cdma.c'; then $(CYGPATH_W) 'nm-device-cdma.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-cdma.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-cdma.Tpo $(DEPDIR)/NetworkManager-nm-device-cdma.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-cdma.c' object='NetworkManager-nm-device-cdma.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-cdma.obj `if test -f 'nm-device-cdma.c'; then $(CYGPATH_W) 'nm-device-cdma.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-cdma.c'; fi` + +NetworkManager-nm-device-gsm.o: nm-device-gsm.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-gsm.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-gsm.Tpo -c -o NetworkManager-nm-device-gsm.o `test -f 'nm-device-gsm.c' || echo '$(srcdir)/'`nm-device-gsm.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-gsm.Tpo $(DEPDIR)/NetworkManager-nm-device-gsm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-gsm.c' object='NetworkManager-nm-device-gsm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-gsm.o `test -f 'nm-device-gsm.c' || echo '$(srcdir)/'`nm-device-gsm.c + +NetworkManager-nm-device-gsm.obj: nm-device-gsm.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-device-gsm.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-device-gsm.Tpo -c -o NetworkManager-nm-device-gsm.obj `if test -f 'nm-device-gsm.c'; then $(CYGPATH_W) 'nm-device-gsm.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-gsm.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-device-gsm.Tpo $(DEPDIR)/NetworkManager-nm-device-gsm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-device-gsm.c' object='NetworkManager-nm-device-gsm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-device-gsm.obj `if test -f 'nm-device-gsm.c'; then $(CYGPATH_W) 'nm-device-gsm.c'; else $(CYGPATH_W) '$(srcdir)/nm-device-gsm.c'; fi` + +NetworkManager-nm-wifi-ap.o: nm-wifi-ap.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-wifi-ap.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-wifi-ap.Tpo -c -o NetworkManager-nm-wifi-ap.o `test -f 'nm-wifi-ap.c' || echo '$(srcdir)/'`nm-wifi-ap.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-wifi-ap.Tpo $(DEPDIR)/NetworkManager-nm-wifi-ap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-wifi-ap.c' object='NetworkManager-nm-wifi-ap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-wifi-ap.o `test -f 'nm-wifi-ap.c' || echo '$(srcdir)/'`nm-wifi-ap.c + +NetworkManager-nm-wifi-ap.obj: nm-wifi-ap.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-wifi-ap.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-wifi-ap.Tpo -c -o NetworkManager-nm-wifi-ap.obj `if test -f 'nm-wifi-ap.c'; then $(CYGPATH_W) 'nm-wifi-ap.c'; else $(CYGPATH_W) '$(srcdir)/nm-wifi-ap.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-wifi-ap.Tpo $(DEPDIR)/NetworkManager-nm-wifi-ap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-wifi-ap.c' object='NetworkManager-nm-wifi-ap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-wifi-ap.obj `if test -f 'nm-wifi-ap.c'; then $(CYGPATH_W) 'nm-wifi-ap.c'; else $(CYGPATH_W) '$(srcdir)/nm-wifi-ap.c'; fi` + +NetworkManager-nm-dbus-manager.o: nm-dbus-manager.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-dbus-manager.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-dbus-manager.Tpo -c -o NetworkManager-nm-dbus-manager.o `test -f 'nm-dbus-manager.c' || echo '$(srcdir)/'`nm-dbus-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-dbus-manager.Tpo $(DEPDIR)/NetworkManager-nm-dbus-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dbus-manager.c' object='NetworkManager-nm-dbus-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-dbus-manager.o `test -f 'nm-dbus-manager.c' || echo '$(srcdir)/'`nm-dbus-manager.c + +NetworkManager-nm-dbus-manager.obj: nm-dbus-manager.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-dbus-manager.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-dbus-manager.Tpo -c -o NetworkManager-nm-dbus-manager.obj `if test -f 'nm-dbus-manager.c'; then $(CYGPATH_W) 'nm-dbus-manager.c'; else $(CYGPATH_W) '$(srcdir)/nm-dbus-manager.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-dbus-manager.Tpo $(DEPDIR)/NetworkManager-nm-dbus-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dbus-manager.c' object='NetworkManager-nm-dbus-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-dbus-manager.obj `if test -f 'nm-dbus-manager.c'; then $(CYGPATH_W) 'nm-dbus-manager.c'; else $(CYGPATH_W) '$(srcdir)/nm-dbus-manager.c'; fi` + +NetworkManager-nm-udev-manager.o: nm-udev-manager.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-udev-manager.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-udev-manager.Tpo -c -o NetworkManager-nm-udev-manager.o `test -f 'nm-udev-manager.c' || echo '$(srcdir)/'`nm-udev-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-udev-manager.Tpo $(DEPDIR)/NetworkManager-nm-udev-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-udev-manager.c' object='NetworkManager-nm-udev-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-udev-manager.o `test -f 'nm-udev-manager.c' || echo '$(srcdir)/'`nm-udev-manager.c + +NetworkManager-nm-udev-manager.obj: nm-udev-manager.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-udev-manager.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-udev-manager.Tpo -c -o NetworkManager-nm-udev-manager.obj `if test -f 'nm-udev-manager.c'; then $(CYGPATH_W) 'nm-udev-manager.c'; else $(CYGPATH_W) '$(srcdir)/nm-udev-manager.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-udev-manager.Tpo $(DEPDIR)/NetworkManager-nm-udev-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-udev-manager.c' object='NetworkManager-nm-udev-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-udev-manager.obj `if test -f 'nm-udev-manager.c'; then $(CYGPATH_W) 'nm-udev-manager.c'; else $(CYGPATH_W) '$(srcdir)/nm-udev-manager.c'; fi` + +NetworkManager-nm-hostname-provider.o: nm-hostname-provider.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-hostname-provider.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-hostname-provider.Tpo -c -o NetworkManager-nm-hostname-provider.o `test -f 'nm-hostname-provider.c' || echo '$(srcdir)/'`nm-hostname-provider.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-hostname-provider.Tpo $(DEPDIR)/NetworkManager-nm-hostname-provider.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-hostname-provider.c' object='NetworkManager-nm-hostname-provider.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-hostname-provider.o `test -f 'nm-hostname-provider.c' || echo '$(srcdir)/'`nm-hostname-provider.c + +NetworkManager-nm-hostname-provider.obj: nm-hostname-provider.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-hostname-provider.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-hostname-provider.Tpo -c -o NetworkManager-nm-hostname-provider.obj `if test -f 'nm-hostname-provider.c'; then $(CYGPATH_W) 'nm-hostname-provider.c'; else $(CYGPATH_W) '$(srcdir)/nm-hostname-provider.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-hostname-provider.Tpo $(DEPDIR)/NetworkManager-nm-hostname-provider.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-hostname-provider.c' object='NetworkManager-nm-hostname-provider.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-hostname-provider.obj `if test -f 'nm-hostname-provider.c'; then $(CYGPATH_W) 'nm-hostname-provider.c'; else $(CYGPATH_W) '$(srcdir)/nm-hostname-provider.c'; fi` + +NetworkManager-nm-ip4-config.o: nm-ip4-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-ip4-config.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-ip4-config.Tpo -c -o NetworkManager-nm-ip4-config.o `test -f 'nm-ip4-config.c' || echo '$(srcdir)/'`nm-ip4-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-ip4-config.Tpo $(DEPDIR)/NetworkManager-nm-ip4-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip4-config.c' object='NetworkManager-nm-ip4-config.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-ip4-config.o `test -f 'nm-ip4-config.c' || echo '$(srcdir)/'`nm-ip4-config.c + +NetworkManager-nm-ip4-config.obj: nm-ip4-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-ip4-config.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-ip4-config.Tpo -c -o NetworkManager-nm-ip4-config.obj `if test -f 'nm-ip4-config.c'; then $(CYGPATH_W) 'nm-ip4-config.c'; else $(CYGPATH_W) '$(srcdir)/nm-ip4-config.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-ip4-config.Tpo $(DEPDIR)/NetworkManager-nm-ip4-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip4-config.c' object='NetworkManager-nm-ip4-config.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-ip4-config.obj `if test -f 'nm-ip4-config.c'; then $(CYGPATH_W) 'nm-ip4-config.c'; else $(CYGPATH_W) '$(srcdir)/nm-ip4-config.c'; fi` + +NetworkManager-nm-ip6-config.o: nm-ip6-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-ip6-config.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-ip6-config.Tpo -c -o NetworkManager-nm-ip6-config.o `test -f 'nm-ip6-config.c' || echo '$(srcdir)/'`nm-ip6-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-ip6-config.Tpo $(DEPDIR)/NetworkManager-nm-ip6-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip6-config.c' object='NetworkManager-nm-ip6-config.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-ip6-config.o `test -f 'nm-ip6-config.c' || echo '$(srcdir)/'`nm-ip6-config.c + +NetworkManager-nm-ip6-config.obj: nm-ip6-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-ip6-config.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-ip6-config.Tpo -c -o NetworkManager-nm-ip6-config.obj `if test -f 'nm-ip6-config.c'; then $(CYGPATH_W) 'nm-ip6-config.c'; else $(CYGPATH_W) '$(srcdir)/nm-ip6-config.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-ip6-config.Tpo $(DEPDIR)/NetworkManager-nm-ip6-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip6-config.c' object='NetworkManager-nm-ip6-config.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-ip6-config.obj `if test -f 'nm-ip6-config.c'; then $(CYGPATH_W) 'nm-ip6-config.c'; else $(CYGPATH_W) '$(srcdir)/nm-ip6-config.c'; fi` + +NetworkManager-nm-secrets-provider-interface.o: nm-secrets-provider-interface.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-secrets-provider-interface.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-secrets-provider-interface.Tpo -c -o NetworkManager-nm-secrets-provider-interface.o `test -f 'nm-secrets-provider-interface.c' || echo '$(srcdir)/'`nm-secrets-provider-interface.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-secrets-provider-interface.Tpo $(DEPDIR)/NetworkManager-nm-secrets-provider-interface.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-secrets-provider-interface.c' object='NetworkManager-nm-secrets-provider-interface.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-secrets-provider-interface.o `test -f 'nm-secrets-provider-interface.c' || echo '$(srcdir)/'`nm-secrets-provider-interface.c + +NetworkManager-nm-secrets-provider-interface.obj: nm-secrets-provider-interface.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-secrets-provider-interface.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-secrets-provider-interface.Tpo -c -o NetworkManager-nm-secrets-provider-interface.obj `if test -f 'nm-secrets-provider-interface.c'; then $(CYGPATH_W) 'nm-secrets-provider-interface.c'; else $(CYGPATH_W) '$(srcdir)/nm-secrets-provider-interface.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-secrets-provider-interface.Tpo $(DEPDIR)/NetworkManager-nm-secrets-provider-interface.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-secrets-provider-interface.c' object='NetworkManager-nm-secrets-provider-interface.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-secrets-provider-interface.obj `if test -f 'nm-secrets-provider-interface.c'; then $(CYGPATH_W) 'nm-secrets-provider-interface.c'; else $(CYGPATH_W) '$(srcdir)/nm-secrets-provider-interface.c'; fi` + +NetworkManager-nm-active-connection.o: nm-active-connection.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-active-connection.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-active-connection.Tpo -c -o NetworkManager-nm-active-connection.o `test -f 'nm-active-connection.c' || echo '$(srcdir)/'`nm-active-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-active-connection.Tpo $(DEPDIR)/NetworkManager-nm-active-connection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-active-connection.c' object='NetworkManager-nm-active-connection.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-active-connection.o `test -f 'nm-active-connection.c' || echo '$(srcdir)/'`nm-active-connection.c + +NetworkManager-nm-active-connection.obj: nm-active-connection.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-active-connection.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-active-connection.Tpo -c -o NetworkManager-nm-active-connection.obj `if test -f 'nm-active-connection.c'; then $(CYGPATH_W) 'nm-active-connection.c'; else $(CYGPATH_W) '$(srcdir)/nm-active-connection.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-active-connection.Tpo $(DEPDIR)/NetworkManager-nm-active-connection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-active-connection.c' object='NetworkManager-nm-active-connection.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-active-connection.obj `if test -f 'nm-active-connection.c'; then $(CYGPATH_W) 'nm-active-connection.c'; else $(CYGPATH_W) '$(srcdir)/nm-active-connection.c'; fi` + +NetworkManager-main.o: main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-main.o -MD -MP -MF $(DEPDIR)/NetworkManager-main.Tpo -c -o NetworkManager-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-main.Tpo $(DEPDIR)/NetworkManager-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='NetworkManager-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +NetworkManager-main.obj: main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-main.obj -MD -MP -MF $(DEPDIR)/NetworkManager-main.Tpo -c -o NetworkManager-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-main.Tpo $(DEPDIR)/NetworkManager-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='NetworkManager-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +NetworkManager-nm-policy.o: nm-policy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-policy.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-policy.Tpo -c -o NetworkManager-nm-policy.o `test -f 'nm-policy.c' || echo '$(srcdir)/'`nm-policy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-policy.Tpo $(DEPDIR)/NetworkManager-nm-policy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-policy.c' object='NetworkManager-nm-policy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-policy.o `test -f 'nm-policy.c' || echo '$(srcdir)/'`nm-policy.c + +NetworkManager-nm-policy.obj: nm-policy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-policy.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-policy.Tpo -c -o NetworkManager-nm-policy.obj `if test -f 'nm-policy.c'; then $(CYGPATH_W) 'nm-policy.c'; else $(CYGPATH_W) '$(srcdir)/nm-policy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-policy.Tpo $(DEPDIR)/NetworkManager-nm-policy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-policy.c' object='NetworkManager-nm-policy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-policy.obj `if test -f 'nm-policy.c'; then $(CYGPATH_W) 'nm-policy.c'; else $(CYGPATH_W) '$(srcdir)/nm-policy.c'; fi` + +NetworkManager-nm-policy-hosts.o: nm-policy-hosts.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-policy-hosts.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-policy-hosts.Tpo -c -o NetworkManager-nm-policy-hosts.o `test -f 'nm-policy-hosts.c' || echo '$(srcdir)/'`nm-policy-hosts.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-policy-hosts.Tpo $(DEPDIR)/NetworkManager-nm-policy-hosts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-policy-hosts.c' object='NetworkManager-nm-policy-hosts.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-policy-hosts.o `test -f 'nm-policy-hosts.c' || echo '$(srcdir)/'`nm-policy-hosts.c + +NetworkManager-nm-policy-hosts.obj: nm-policy-hosts.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-policy-hosts.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-policy-hosts.Tpo -c -o NetworkManager-nm-policy-hosts.obj `if test -f 'nm-policy-hosts.c'; then $(CYGPATH_W) 'nm-policy-hosts.c'; else $(CYGPATH_W) '$(srcdir)/nm-policy-hosts.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-policy-hosts.Tpo $(DEPDIR)/NetworkManager-nm-policy-hosts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-policy-hosts.c' object='NetworkManager-nm-policy-hosts.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-policy-hosts.obj `if test -f 'nm-policy-hosts.c'; then $(CYGPATH_W) 'nm-policy-hosts.c'; else $(CYGPATH_W) '$(srcdir)/nm-policy-hosts.c'; fi` + +NetworkManager-nm-policy-hostname.o: nm-policy-hostname.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-policy-hostname.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-policy-hostname.Tpo -c -o NetworkManager-nm-policy-hostname.o `test -f 'nm-policy-hostname.c' || echo '$(srcdir)/'`nm-policy-hostname.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-policy-hostname.Tpo $(DEPDIR)/NetworkManager-nm-policy-hostname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-policy-hostname.c' object='NetworkManager-nm-policy-hostname.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-policy-hostname.o `test -f 'nm-policy-hostname.c' || echo '$(srcdir)/'`nm-policy-hostname.c + +NetworkManager-nm-policy-hostname.obj: nm-policy-hostname.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-policy-hostname.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-policy-hostname.Tpo -c -o NetworkManager-nm-policy-hostname.obj `if test -f 'nm-policy-hostname.c'; then $(CYGPATH_W) 'nm-policy-hostname.c'; else $(CYGPATH_W) '$(srcdir)/nm-policy-hostname.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-policy-hostname.Tpo $(DEPDIR)/NetworkManager-nm-policy-hostname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-policy-hostname.c' object='NetworkManager-nm-policy-hostname.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-policy-hostname.obj `if test -f 'nm-policy-hostname.c'; then $(CYGPATH_W) 'nm-policy-hostname.c'; else $(CYGPATH_W) '$(srcdir)/nm-policy-hostname.c'; fi` + +NetworkManager-NetworkManagerUtils.o: NetworkManagerUtils.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-NetworkManagerUtils.o -MD -MP -MF $(DEPDIR)/NetworkManager-NetworkManagerUtils.Tpo -c -o NetworkManager-NetworkManagerUtils.o `test -f 'NetworkManagerUtils.c' || echo '$(srcdir)/'`NetworkManagerUtils.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-NetworkManagerUtils.Tpo $(DEPDIR)/NetworkManager-NetworkManagerUtils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerUtils.c' object='NetworkManager-NetworkManagerUtils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-NetworkManagerUtils.o `test -f 'NetworkManagerUtils.c' || echo '$(srcdir)/'`NetworkManagerUtils.c + +NetworkManager-NetworkManagerUtils.obj: NetworkManagerUtils.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-NetworkManagerUtils.obj -MD -MP -MF $(DEPDIR)/NetworkManager-NetworkManagerUtils.Tpo -c -o NetworkManager-NetworkManagerUtils.obj `if test -f 'NetworkManagerUtils.c'; then $(CYGPATH_W) 'NetworkManagerUtils.c'; else $(CYGPATH_W) '$(srcdir)/NetworkManagerUtils.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-NetworkManagerUtils.Tpo $(DEPDIR)/NetworkManager-NetworkManagerUtils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerUtils.c' object='NetworkManager-NetworkManagerUtils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-NetworkManagerUtils.obj `if test -f 'NetworkManagerUtils.c'; then $(CYGPATH_W) 'NetworkManagerUtils.c'; else $(CYGPATH_W) '$(srcdir)/NetworkManagerUtils.c'; fi` + +NetworkManager-nm-system.o: nm-system.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-system.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-system.Tpo -c -o NetworkManager-nm-system.o `test -f 'nm-system.c' || echo '$(srcdir)/'`nm-system.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-system.Tpo $(DEPDIR)/NetworkManager-nm-system.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-system.c' object='NetworkManager-nm-system.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-system.o `test -f 'nm-system.c' || echo '$(srcdir)/'`nm-system.c + +NetworkManager-nm-system.obj: nm-system.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-system.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-system.Tpo -c -o NetworkManager-nm-system.obj `if test -f 'nm-system.c'; then $(CYGPATH_W) 'nm-system.c'; else $(CYGPATH_W) '$(srcdir)/nm-system.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-system.Tpo $(DEPDIR)/NetworkManager-nm-system.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-system.c' object='NetworkManager-nm-system.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-system.obj `if test -f 'nm-system.c'; then $(CYGPATH_W) 'nm-system.c'; else $(CYGPATH_W) '$(srcdir)/nm-system.c'; fi` + +NetworkManager-nm-manager.o: nm-manager.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-manager.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-manager.Tpo -c -o NetworkManager-nm-manager.o `test -f 'nm-manager.c' || echo '$(srcdir)/'`nm-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-manager.Tpo $(DEPDIR)/NetworkManager-nm-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-manager.c' object='NetworkManager-nm-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-manager.o `test -f 'nm-manager.c' || echo '$(srcdir)/'`nm-manager.c + +NetworkManager-nm-manager.obj: nm-manager.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-manager.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-manager.Tpo -c -o NetworkManager-nm-manager.obj `if test -f 'nm-manager.c'; then $(CYGPATH_W) 'nm-manager.c'; else $(CYGPATH_W) '$(srcdir)/nm-manager.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-manager.Tpo $(DEPDIR)/NetworkManager-nm-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-manager.c' object='NetworkManager-nm-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-manager.obj `if test -f 'nm-manager.c'; then $(CYGPATH_W) 'nm-manager.c'; else $(CYGPATH_W) '$(srcdir)/nm-manager.c'; fi` + +NetworkManager-nm-netlink-monitor.o: nm-netlink-monitor.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-netlink-monitor.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-netlink-monitor.Tpo -c -o NetworkManager-nm-netlink-monitor.o `test -f 'nm-netlink-monitor.c' || echo '$(srcdir)/'`nm-netlink-monitor.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-netlink-monitor.Tpo $(DEPDIR)/NetworkManager-nm-netlink-monitor.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-netlink-monitor.c' object='NetworkManager-nm-netlink-monitor.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-netlink-monitor.o `test -f 'nm-netlink-monitor.c' || echo '$(srcdir)/'`nm-netlink-monitor.c + +NetworkManager-nm-netlink-monitor.obj: nm-netlink-monitor.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-netlink-monitor.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-netlink-monitor.Tpo -c -o NetworkManager-nm-netlink-monitor.obj `if test -f 'nm-netlink-monitor.c'; then $(CYGPATH_W) 'nm-netlink-monitor.c'; else $(CYGPATH_W) '$(srcdir)/nm-netlink-monitor.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-netlink-monitor.Tpo $(DEPDIR)/NetworkManager-nm-netlink-monitor.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-netlink-monitor.c' object='NetworkManager-nm-netlink-monitor.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-netlink-monitor.obj `if test -f 'nm-netlink-monitor.c'; then $(CYGPATH_W) 'nm-netlink-monitor.c'; else $(CYGPATH_W) '$(srcdir)/nm-netlink-monitor.c'; fi` + +NetworkManager-nm-activation-request.o: nm-activation-request.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-activation-request.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-activation-request.Tpo -c -o NetworkManager-nm-activation-request.o `test -f 'nm-activation-request.c' || echo '$(srcdir)/'`nm-activation-request.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-activation-request.Tpo $(DEPDIR)/NetworkManager-nm-activation-request.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-activation-request.c' object='NetworkManager-nm-activation-request.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-activation-request.o `test -f 'nm-activation-request.c' || echo '$(srcdir)/'`nm-activation-request.c + +NetworkManager-nm-activation-request.obj: nm-activation-request.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-activation-request.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-activation-request.Tpo -c -o NetworkManager-nm-activation-request.obj `if test -f 'nm-activation-request.c'; then $(CYGPATH_W) 'nm-activation-request.c'; else $(CYGPATH_W) '$(srcdir)/nm-activation-request.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-activation-request.Tpo $(DEPDIR)/NetworkManager-nm-activation-request.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-activation-request.c' object='NetworkManager-nm-activation-request.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-activation-request.obj `if test -f 'nm-activation-request.c'; then $(CYGPATH_W) 'nm-activation-request.c'; else $(CYGPATH_W) '$(srcdir)/nm-activation-request.c'; fi` + +NetworkManager-nm-properties-changed-signal.o: nm-properties-changed-signal.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-properties-changed-signal.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-properties-changed-signal.Tpo -c -o NetworkManager-nm-properties-changed-signal.o `test -f 'nm-properties-changed-signal.c' || echo '$(srcdir)/'`nm-properties-changed-signal.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-properties-changed-signal.Tpo $(DEPDIR)/NetworkManager-nm-properties-changed-signal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-properties-changed-signal.c' object='NetworkManager-nm-properties-changed-signal.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-properties-changed-signal.o `test -f 'nm-properties-changed-signal.c' || echo '$(srcdir)/'`nm-properties-changed-signal.c + +NetworkManager-nm-properties-changed-signal.obj: nm-properties-changed-signal.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-properties-changed-signal.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-properties-changed-signal.Tpo -c -o NetworkManager-nm-properties-changed-signal.obj `if test -f 'nm-properties-changed-signal.c'; then $(CYGPATH_W) 'nm-properties-changed-signal.c'; else $(CYGPATH_W) '$(srcdir)/nm-properties-changed-signal.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-properties-changed-signal.Tpo $(DEPDIR)/NetworkManager-nm-properties-changed-signal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-properties-changed-signal.c' object='NetworkManager-nm-properties-changed-signal.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-properties-changed-signal.obj `if test -f 'nm-properties-changed-signal.c'; then $(CYGPATH_W) 'nm-properties-changed-signal.c'; else $(CYGPATH_W) '$(srcdir)/nm-properties-changed-signal.c'; fi` + +NetworkManager-wpa.o: wpa.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-wpa.o -MD -MP -MF $(DEPDIR)/NetworkManager-wpa.Tpo -c -o NetworkManager-wpa.o `test -f 'wpa.c' || echo '$(srcdir)/'`wpa.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-wpa.Tpo $(DEPDIR)/NetworkManager-wpa.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wpa.c' object='NetworkManager-wpa.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-wpa.o `test -f 'wpa.c' || echo '$(srcdir)/'`wpa.c + +NetworkManager-wpa.obj: wpa.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-wpa.obj -MD -MP -MF $(DEPDIR)/NetworkManager-wpa.Tpo -c -o NetworkManager-wpa.obj `if test -f 'wpa.c'; then $(CYGPATH_W) 'wpa.c'; else $(CYGPATH_W) '$(srcdir)/wpa.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-wpa.Tpo $(DEPDIR)/NetworkManager-wpa.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wpa.c' object='NetworkManager-wpa.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-wpa.obj `if test -f 'wpa.c'; then $(CYGPATH_W) 'wpa.c'; else $(CYGPATH_W) '$(srcdir)/wpa.c'; fi` + +NetworkManager-nm-dhcp4-config.o: nm-dhcp4-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-dhcp4-config.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-dhcp4-config.Tpo -c -o NetworkManager-nm-dhcp4-config.o `test -f 'nm-dhcp4-config.c' || echo '$(srcdir)/'`nm-dhcp4-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-dhcp4-config.Tpo $(DEPDIR)/NetworkManager-nm-dhcp4-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp4-config.c' object='NetworkManager-nm-dhcp4-config.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-dhcp4-config.o `test -f 'nm-dhcp4-config.c' || echo '$(srcdir)/'`nm-dhcp4-config.c + +NetworkManager-nm-dhcp4-config.obj: nm-dhcp4-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-dhcp4-config.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-dhcp4-config.Tpo -c -o NetworkManager-nm-dhcp4-config.obj `if test -f 'nm-dhcp4-config.c'; then $(CYGPATH_W) 'nm-dhcp4-config.c'; else $(CYGPATH_W) '$(srcdir)/nm-dhcp4-config.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-dhcp4-config.Tpo $(DEPDIR)/NetworkManager-nm-dhcp4-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp4-config.c' object='NetworkManager-nm-dhcp4-config.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-dhcp4-config.obj `if test -f 'nm-dhcp4-config.c'; then $(CYGPATH_W) 'nm-dhcp4-config.c'; else $(CYGPATH_W) '$(srcdir)/nm-dhcp4-config.c'; fi` + +NetworkManager-nm-dhcp6-config.o: nm-dhcp6-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-dhcp6-config.o -MD -MP -MF $(DEPDIR)/NetworkManager-nm-dhcp6-config.Tpo -c -o NetworkManager-nm-dhcp6-config.o `test -f 'nm-dhcp6-config.c' || echo '$(srcdir)/'`nm-dhcp6-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-dhcp6-config.Tpo $(DEPDIR)/NetworkManager-nm-dhcp6-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp6-config.c' object='NetworkManager-nm-dhcp6-config.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-dhcp6-config.o `test -f 'nm-dhcp6-config.c' || echo '$(srcdir)/'`nm-dhcp6-config.c + +NetworkManager-nm-dhcp6-config.obj: nm-dhcp6-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT NetworkManager-nm-dhcp6-config.obj -MD -MP -MF $(DEPDIR)/NetworkManager-nm-dhcp6-config.Tpo -c -o NetworkManager-nm-dhcp6-config.obj `if test -f 'nm-dhcp6-config.c'; then $(CYGPATH_W) 'nm-dhcp6-config.c'; else $(CYGPATH_W) '$(srcdir)/nm-dhcp6-config.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/NetworkManager-nm-dhcp6-config.Tpo $(DEPDIR)/NetworkManager-nm-dhcp6-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp6-config.c' object='NetworkManager-nm-dhcp6-config.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NetworkManager_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o NetworkManager-nm-dhcp6-config.obj `if test -f 'nm-dhcp6-config.c'; then $(CYGPATH_W) 'nm-dhcp6-config.c'; else $(CYGPATH_W) '$(srcdir)/nm-dhcp6-config.c'; fi` + +nm_crash_logger-nm-crash-logger.o: nm-crash-logger.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_crash_logger_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_crash_logger-nm-crash-logger.o -MD -MP -MF $(DEPDIR)/nm_crash_logger-nm-crash-logger.Tpo -c -o nm_crash_logger-nm-crash-logger.o `test -f 'nm-crash-logger.c' || echo '$(srcdir)/'`nm-crash-logger.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_crash_logger-nm-crash-logger.Tpo $(DEPDIR)/nm_crash_logger-nm-crash-logger.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-crash-logger.c' object='nm_crash_logger-nm-crash-logger.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_crash_logger_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_crash_logger-nm-crash-logger.o `test -f 'nm-crash-logger.c' || echo '$(srcdir)/'`nm-crash-logger.c + +nm_crash_logger-nm-crash-logger.obj: nm-crash-logger.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_crash_logger_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_crash_logger-nm-crash-logger.obj -MD -MP -MF $(DEPDIR)/nm_crash_logger-nm-crash-logger.Tpo -c -o nm_crash_logger-nm-crash-logger.obj `if test -f 'nm-crash-logger.c'; then $(CYGPATH_W) 'nm-crash-logger.c'; else $(CYGPATH_W) '$(srcdir)/nm-crash-logger.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_crash_logger-nm-crash-logger.Tpo $(DEPDIR)/nm_crash_logger-nm-crash-logger.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-crash-logger.c' object='nm_crash_logger-nm-crash-logger.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_crash_logger_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_crash_logger-nm-crash-logger.obj `if test -f 'nm-crash-logger.c'; then $(CYGPATH_W) 'nm-crash-logger.c'; else $(CYGPATH_W) '$(srcdir)/nm-crash-logger.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-NetworkManagerDATA: $(NetworkManager_DATA) + @$(NORMAL_INSTALL) + test -z "$(NetworkManagerdir)" || $(MKDIR_P) "$(DESTDIR)$(NetworkManagerdir)" + @list='$(NetworkManager_DATA)'; test -n "$(NetworkManagerdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(NetworkManagerdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(NetworkManagerdir)" || exit $$?; \ + done + +uninstall-NetworkManagerDATA: + @$(NORMAL_UNINSTALL) + @list='$(NetworkManager_DATA)'; test -n "$(NetworkManagerdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(NetworkManagerdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(NetworkManagerdir)" && rm -f $$files +install-dbusserviceDATA: $(dbusservice_DATA) + @$(NORMAL_INSTALL) + test -z "$(dbusservicedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusservicedir)" + @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusservicedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusservicedir)" || exit $$?; \ + done + +uninstall-dbusserviceDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(dbusservicedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(dbusservicedir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(NetworkManagerdir)" "$(DESTDIR)$(dbusservicedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-recursive + +clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ + clean-noinstLTLIBRARIES clean-sbinPROGRAMS mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-NetworkManagerDATA install-dbusserviceDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libexecPROGRAMS install-sbinPROGRAMS + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-NetworkManagerDATA uninstall-dbusserviceDATA \ + uninstall-libexecPROGRAMS uninstall-sbinPROGRAMS + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-data-am \ + install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libexecPROGRAMS clean-libtool clean-noinstLTLIBRARIES \ + clean-sbinPROGRAMS ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-NetworkManagerDATA install-am install-data \ + install-data-am install-data-hook install-dbusserviceDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-libexecPROGRAMS install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-sbinPROGRAMS install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall \ + uninstall-NetworkManagerDATA uninstall-am \ + uninstall-dbusserviceDATA uninstall-libexecPROGRAMS \ + uninstall-sbinPROGRAMS + + +nm-access-point-glue.h: $(top_srcdir)/introspection/nm-access-point.xml + dbus-binding-tool --prefix=nm_access_point --mode=glib-server --output=$@ $< + +nm-manager-glue.h: $(top_srcdir)/introspection/nm-manager.xml + dbus-binding-tool --prefix=nm_manager --mode=glib-server --output=$@ $< + +nm-device-interface-glue.h: $(top_srcdir)/introspection/nm-device.xml + dbus-binding-tool --prefix=nm_device_interface --mode=glib-server --output=$@ $< + +nm-device-ethernet-glue.h: $(top_srcdir)/introspection/nm-device-ethernet.xml + dbus-binding-tool --prefix=nm_device_ethernet --mode=glib-server --output=$@ $< + +nm-device-wifi-glue.h: $(top_srcdir)/introspection/nm-device-wifi.xml + dbus-binding-tool --prefix=nm_device_wifi --mode=glib-server --output=$@ $< + +nm-device-bt-glue.h: $(top_srcdir)/introspection/nm-device-bt.xml + dbus-binding-tool --prefix=nm_device_bt --mode=glib-server --output=$@ $< + +nm-device-olpc-mesh-glue.h: $(top_srcdir)/introspection/nm-device-olpc-mesh.xml + dbus-binding-tool --prefix=nm_device_olpc_mesh --mode=glib-server --output=$@ $< + +nm-ip4-config-glue.h: $(top_srcdir)/introspection/nm-ip4-config.xml + dbus-binding-tool --prefix=nm_ip4_config --mode=glib-server --output=$@ $< + +nm-ip6-config-glue.h: $(top_srcdir)/introspection/nm-ip6-config.xml + dbus-binding-tool --prefix=nm_ip6_config --mode=glib-server --output=$@ $< + +nm-active-connection-glue.h: $(top_srcdir)/introspection/nm-active-connection.xml + dbus-binding-tool --prefix=nm_active_connection --mode=glib-server --output=$@ $< + +nm-dhcp4-config-glue.h: $(top_srcdir)/introspection/nm-dhcp4-config.xml + dbus-binding-tool --prefix=nm_dhcp4_config --mode=glib-server --output=$@ $< + +nm-dhcp6-config-glue.h: $(top_srcdir)/introspection/nm-dhcp6-config.xml + dbus-binding-tool --prefix=nm_dhcp6_config --mode=glib-server --output=$@ $< + +nm-device-cdma-glue.h: $(top_srcdir)/introspection/nm-device-cdma.xml + dbus-binding-tool --prefix=nm_device_cdma --mode=glib-server --output=$@ $< + +nm-device-gsm-glue.h: $(top_srcdir)/introspection/nm-device-gsm.xml + dbus-binding-tool --prefix=nm_device_gsm --mode=glib-server --output=$@ $< +install-data-hook: + $(mkinstalldirs) -m 0700 $(DESTDIR)$(rundir) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/NetworkManager.conf b/src/NetworkManager.conf new file mode 100644 index 00000000..8d083140 --- /dev/null +++ b/src/NetworkManager.conf @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 512 + + diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c new file mode 100644 index 00000000..22cf2fa0 --- /dev/null +++ b/src/NetworkManagerUtils.c @@ -0,0 +1,625 @@ +/* -*- 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 - 2010 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include +#include + +#include "NetworkManagerUtils.h" +#include "nm-utils.h" +#include "nm-logging.h" +#include "nm-device.h" +#include "nm-device-wifi.h" +#include "nm-device-ethernet.h" +#include "nm-dbus-manager.h" +#include "nm-dispatcher-action.h" +#include "nm-dbus-glib-types.h" + +#include +#include + +/* + * nm_ethernet_address_is_valid + * + * Compares an Ethernet address against known invalid addresses. + * + */ +gboolean +nm_ethernet_address_is_valid (const struct ether_addr *test_addr) +{ + guint8 invalid_addr1[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + guint8 invalid_addr2[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + guint8 invalid_addr3[ETH_ALEN] = {0x44, 0x44, 0x44, 0x44, 0x44, 0x44}; + guint8 invalid_addr4[ETH_ALEN] = {0x00, 0x30, 0xb4, 0x00, 0x00, 0x00}; /* prism54 dummy MAC */ + + g_return_val_if_fail (test_addr != NULL, FALSE); + + /* Compare the AP address the card has with invalid ethernet MAC addresses. */ + if (!memcmp (test_addr->ether_addr_octet, &invalid_addr1, ETH_ALEN)) + return FALSE; + + if (!memcmp (test_addr->ether_addr_octet, &invalid_addr2, ETH_ALEN)) + return FALSE; + + if (!memcmp (test_addr->ether_addr_octet, &invalid_addr3, ETH_ALEN)) + return FALSE; + + if (!memcmp (test_addr->ether_addr_octet, &invalid_addr4, ETH_ALEN)) + return FALSE; + + if (test_addr->ether_addr_octet[0] & 1) /* Multicast addresses */ + return FALSE; + + return TRUE; +} + + +int +nm_spawn_process (const char *args) +{ + gint num_args; + char **argv = NULL; + int status = -1; + GError *error = NULL; + + g_return_val_if_fail (args != NULL, -1); + + if (!g_shell_parse_argv (args, &num_args, &argv, &error)) { + nm_log_warn (LOGD_CORE, "could not parse arguments for '%s': %s", args, error->message); + g_error_free (error); + return -1; + } + + 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); + } + + g_strfreev (argv); + return status; +} + +/* + * nm_utils_ip4_netmask_to_prefix + * + * Figure out the network prefix from a netmask. Netmask + * MUST be in network byte order. + * + */ +guint32 +nm_utils_ip4_netmask_to_prefix (guint32 netmask) +{ + guchar *p, *end; + guint32 prefix = 0; + + p = (guchar *) &netmask; + end = p + sizeof (guint32); + + while ((*p == 0xFF) && p < end) { + prefix += 8; + p++; + } + + if (p < end) { + guchar v = *p; + + while (v) { + prefix++; + v <<= 1; + } + } + + return prefix; +} + +/* + * nm_utils_ip4_prefix_to_netmask + * + * Figure out the netmask from a prefix. + * + */ +guint32 +nm_utils_ip4_prefix_to_netmask (guint32 prefix) +{ + guint32 msk = 0x80000000; + guint32 netmask = 0; + + while (prefix > 0) { + netmask |= msk; + msk >>= 1; + prefix--; + } + + return (guint32) htonl (netmask); +} + +char * +nm_ether_ntop (const struct ether_addr *mac) +{ + /* we like leading zeros and all-caps, instead + * of what glibc's ether_ntop() gives us + */ + return g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + mac->ether_addr_octet[0], mac->ether_addr_octet[1], + mac->ether_addr_octet[2], mac->ether_addr_octet[3], + mac->ether_addr_octet[4], mac->ether_addr_octet[5]); +} + +void +nm_utils_merge_ip4_config (NMIP4Config *ip4_config, NMSettingIP4Config *setting) +{ + int i, j; + + if (!setting) + return; /* Defaults are just fine */ + + if (nm_setting_ip4_config_get_ignore_auto_dns (setting)) { + nm_ip4_config_reset_nameservers (ip4_config); + nm_ip4_config_reset_domains (ip4_config); + nm_ip4_config_reset_searches (ip4_config); + } + + if (nm_setting_ip4_config_get_ignore_auto_routes (setting)) + nm_ip4_config_reset_routes (ip4_config); + + for (i = 0; i < nm_setting_ip4_config_get_num_dns (setting); i++) { + guint32 ns; + gboolean found = FALSE; + + /* Avoid dupes */ + ns = nm_setting_ip4_config_get_dns (setting, i); + for (j = 0; j < nm_ip4_config_get_num_nameservers (ip4_config); j++) { + if (nm_ip4_config_get_nameserver (ip4_config, j) == ns) { + found = TRUE; + break; + } + } + + if (!found) + nm_ip4_config_add_nameserver (ip4_config, ns); + } + + /* DNS search domains */ + for (i = 0; i < nm_setting_ip4_config_get_num_dns_searches (setting); i++) { + const char *search = nm_setting_ip4_config_get_dns_search (setting, i); + gboolean found = FALSE; + + /* Avoid dupes */ + for (j = 0; j < nm_ip4_config_get_num_searches (ip4_config); j++) { + if (!strcmp (search, nm_ip4_config_get_search (ip4_config, j))) { + found = TRUE; + break; + } + } + + if (!found) + nm_ip4_config_add_search (ip4_config, search); + } + + /* IPv4 addresses */ + for (i = 0; i < nm_setting_ip4_config_get_num_addresses (setting); i++) { + NMIP4Address *setting_addr = nm_setting_ip4_config_get_address (setting, i); + guint32 num; + + num = nm_ip4_config_get_num_addresses (ip4_config); + for (j = 0; j < num; j++) { + NMIP4Address *cfg_addr = nm_ip4_config_get_address (ip4_config, j); + + /* Dupe, override with user-specified address */ + if (nm_ip4_address_get_address (cfg_addr) == nm_ip4_address_get_address (setting_addr)) { + nm_ip4_config_replace_address (ip4_config, j, setting_addr); + break; + } + } + + if (j == num) + nm_ip4_config_add_address (ip4_config, setting_addr); + } + + /* IPv4 routes */ + for (i = 0; i < nm_setting_ip4_config_get_num_routes (setting); i++) { + NMIP4Route *setting_route = nm_setting_ip4_config_get_route (setting, i); + guint32 num; + + num = nm_ip4_config_get_num_routes (ip4_config); + for (j = 0; j < num; j++) { + NMIP4Route *cfg_route = nm_ip4_config_get_route (ip4_config, j); + + /* Dupe, override with user-specified route */ + if ( (nm_ip4_route_get_dest (cfg_route) == nm_ip4_route_get_dest (setting_route)) + && (nm_ip4_route_get_prefix (cfg_route) == nm_ip4_route_get_prefix (setting_route)) + && (nm_ip4_route_get_next_hop (cfg_route) == nm_ip4_route_get_next_hop (setting_route))) { + nm_ip4_config_replace_route (ip4_config, j, setting_route); + break; + } + } + + if (j == num) + nm_ip4_config_add_route (ip4_config, setting_route); + } + + if (nm_setting_ip4_config_get_never_default (setting)) + nm_ip4_config_set_never_default (ip4_config, TRUE); +} + +static inline gboolean +ip6_addresses_equal (const struct in6_addr *a, const struct in6_addr *b) +{ + return memcmp (a, b, sizeof (struct in6_addr)) == 0; +} + +/* This is exactly identical to nm_utils_merge_ip4_config, with s/4/6/, + * except that we can't compare addresses with ==. + */ +void +nm_utils_merge_ip6_config (NMIP6Config *ip6_config, NMSettingIP6Config *setting) +{ + int i, j; + + if (!setting) + return; /* Defaults are just fine */ + + if (nm_setting_ip6_config_get_ignore_auto_dns (setting)) { + nm_ip6_config_reset_nameservers (ip6_config); + nm_ip6_config_reset_domains (ip6_config); + nm_ip6_config_reset_searches (ip6_config); + } + + if (nm_setting_ip6_config_get_ignore_auto_routes (setting)) + nm_ip6_config_reset_routes (ip6_config); + + for (i = 0; i < nm_setting_ip6_config_get_num_dns (setting); i++) { + const struct in6_addr *ns; + gboolean found = FALSE; + + /* Avoid dupes */ + ns = nm_setting_ip6_config_get_dns (setting, i); + for (j = 0; j < nm_ip6_config_get_num_nameservers (ip6_config); j++) { + if (ip6_addresses_equal (nm_ip6_config_get_nameserver (ip6_config, j), ns)) { + found = TRUE; + break; + } + } + + if (!found) + nm_ip6_config_add_nameserver (ip6_config, ns); + } + + /* DNS search domains */ + for (i = 0; i < nm_setting_ip6_config_get_num_dns_searches (setting); i++) { + const char *search = nm_setting_ip6_config_get_dns_search (setting, i); + gboolean found = FALSE; + + /* Avoid dupes */ + for (j = 0; j < nm_ip6_config_get_num_searches (ip6_config); j++) { + if (!strcmp (search, nm_ip6_config_get_search (ip6_config, j))) { + found = TRUE; + break; + } + } + + if (!found) + nm_ip6_config_add_search (ip6_config, search); + } + + /* IPv6 addresses */ + for (i = 0; i < nm_setting_ip6_config_get_num_addresses (setting); i++) { + NMIP6Address *setting_addr = nm_setting_ip6_config_get_address (setting, i); + guint32 num; + + num = nm_ip6_config_get_num_addresses (ip6_config); + for (j = 0; j < num; j++) { + NMIP6Address *cfg_addr = nm_ip6_config_get_address (ip6_config, j); + + /* Dupe, override with user-specified address */ + if (ip6_addresses_equal (nm_ip6_address_get_address (cfg_addr), nm_ip6_address_get_address (setting_addr))) { + nm_ip6_config_replace_address (ip6_config, j, setting_addr); + break; + } + } + + if (j == num) + nm_ip6_config_add_address (ip6_config, setting_addr); + } + + /* IPv6 routes */ + for (i = 0; i < nm_setting_ip6_config_get_num_routes (setting); i++) { + NMIP6Route *setting_route = nm_setting_ip6_config_get_route (setting, i); + guint32 num; + + num = nm_ip6_config_get_num_routes (ip6_config); + for (j = 0; j < num; j++) { + NMIP6Route *cfg_route = nm_ip6_config_get_route (ip6_config, j); + + /* Dupe, override with user-specified route */ + if ( ip6_addresses_equal (nm_ip6_route_get_dest (cfg_route), nm_ip6_route_get_dest (setting_route)) + && (nm_ip6_route_get_prefix (cfg_route) == nm_ip6_route_get_prefix (setting_route)) + && ip6_addresses_equal (nm_ip6_route_get_next_hop (cfg_route), nm_ip6_route_get_next_hop (setting_route))) { + nm_ip6_config_replace_route (ip6_config, j, setting_route); + break; + } + } + + if (j == num) + nm_ip6_config_add_route (ip6_config, setting_route); + } + + if (nm_setting_ip6_config_get_never_default (setting)) + nm_ip6_config_set_never_default (ip6_config, TRUE); +} + +void +nm_utils_call_dispatcher (const char *action, + NMConnection *connection, + NMDevice *device, + const char *vpn_iface) +{ + NMDBusManager *dbus_mgr; + DBusGProxy *proxy; + DBusGConnection *g_connection; + GHashTable *connection_hash; + GHashTable *connection_props; + GHashTable *device_props; + + g_return_if_fail (action != NULL); + + /* All actions except 'hostname' require a device */ + if (strcmp (action, "hostname")) + g_return_if_fail (NM_IS_DEVICE (device)); + + dbus_mgr = nm_dbus_manager_get (); + g_connection = nm_dbus_manager_get_connection (dbus_mgr); + proxy = dbus_g_proxy_new_for_name (g_connection, + NM_DISPATCHER_DBUS_SERVICE, + NM_DISPATCHER_DBUS_PATH, + NM_DISPATCHER_DBUS_IFACE); + if (!proxy) { + nm_log_err (LOGD_CORE, "could not get dispatcher proxy!"); + g_object_unref (dbus_mgr); + return; + } + + if (connection) { + connection_hash = nm_connection_to_hash (connection); + + connection_props = value_hash_create (); + + /* Service name */ + if (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_USER) { + value_hash_add_str (connection_props, + NMD_CONNECTION_PROPS_SERVICE_NAME, + NM_DBUS_SERVICE_USER_SETTINGS); + } else if (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM) { + value_hash_add_str (connection_props, + NMD_CONNECTION_PROPS_SERVICE_NAME, + NM_DBUS_SERVICE_SYSTEM_SETTINGS); + } + + /* path */ + value_hash_add_object_path (connection_props, + NMD_CONNECTION_PROPS_PATH, + nm_connection_get_path (connection)); + } else { + connection_hash = value_hash_create (); + connection_props = value_hash_create (); + } + + device_props = value_hash_create (); + + /* Hostname actions do not require a device */ + if (strcmp (action, "hostname")) { + /* interface */ + value_hash_add_str (device_props, NMD_DEVICE_PROPS_INTERFACE, nm_device_get_iface (device)); + + /* IP interface */ + if (vpn_iface) { + value_hash_add_str (device_props, NMD_DEVICE_PROPS_IP_INTERFACE, vpn_iface); + } else if (nm_device_get_ip_iface (device)) { + value_hash_add_str (device_props, NMD_DEVICE_PROPS_IP_INTERFACE, nm_device_get_ip_iface (device)); + } + + /* type */ + value_hash_add_uint (device_props, NMD_DEVICE_PROPS_TYPE, nm_device_get_device_type (device)); + + /* state */ + value_hash_add_uint (device_props, NMD_DEVICE_PROPS_STATE, nm_device_get_state (device)); + value_hash_add_object_path (device_props, NMD_DEVICE_PROPS_PATH, nm_device_get_path (device)); + } + + dbus_g_proxy_call_no_reply (proxy, "Action", + G_TYPE_STRING, action, + DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, connection_hash, + DBUS_TYPE_G_MAP_OF_VARIANT, connection_props, + DBUS_TYPE_G_MAP_OF_VARIANT, device_props, + G_TYPE_INVALID); + + g_object_unref (proxy); + g_hash_table_destroy (connection_hash); + g_hash_table_destroy (connection_props); + g_hash_table_destroy (device_props); + g_object_unref (dbus_mgr); +} + +gboolean +nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr) +{ + const GSList *iter; + char *hwaddr_match, *p; + + g_return_val_if_fail (hwaddr != NULL, FALSE); + + p = hwaddr_match = g_strdup_printf ("mac:%s", hwaddr); + + while (*p) { + *p = g_ascii_tolower (*p); + p++; + } + + for (iter = specs; iter; iter = g_slist_next (iter)) { + if (!strcmp ((const char *) iter->data, hwaddr_match)) { + g_free (hwaddr_match); + return TRUE; + } + } + + g_free (hwaddr_match); + return FALSE; +} + +/*********************************/ + +static void +nm_gvalue_destroy (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +GHashTable * +value_hash_create (void) +{ + return g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy); +} + +void +value_hash_add (GHashTable *hash, + const char *key, + GValue *value) +{ + g_hash_table_insert (hash, g_strdup (key), value); +} + +void +value_hash_add_str (GHashTable *hash, + const char *key, + const char *str) +{ + GValue *value; + + value = g_slice_new0 (GValue); + g_value_init (value, G_TYPE_STRING); + g_value_set_string (value, str); + + value_hash_add (hash, key, value); +} + +void +value_hash_add_object_path (GHashTable *hash, + const char *key, + const char *op) +{ + GValue *value; + + value = g_slice_new0 (GValue); + g_value_init (value, DBUS_TYPE_G_OBJECT_PATH); + g_value_set_boxed (value, op); + + value_hash_add (hash, key, value); +} + +void +value_hash_add_uint (GHashTable *hash, + const char *key, + guint32 val) +{ + GValue *value; + + value = g_slice_new0 (GValue); + g_value_init (value, G_TYPE_UINT); + g_value_set_uint (value, val); + + value_hash_add (hash, key, value); +} + +void +value_hash_add_bool (GHashTable *hash, + const char *key, + gboolean val) +{ + GValue *value; + + value = g_slice_new0 (GValue); + g_value_init (value, G_TYPE_BOOLEAN); + g_value_set_boolean (value, val); + + value_hash_add (hash, key, value); +} + +gboolean +nm_utils_do_sysctl (const char *path, const char *value) +{ + int fd, len, nwrote, total; + + fd = open (path, O_WRONLY | O_TRUNC); + if (fd == -1) + return FALSE; + + len = strlen (value); + total = 0; + do { + nwrote = write (fd, value + total, len - total); + if (nwrote == -1) { + if (errno == EINTR) + continue; + close (fd); + return FALSE; + } + total += nwrote; + } while (total < len); + + close (fd); + return TRUE; +} + +gboolean +nm_utils_get_proc_sys_net_value (const char *path, + const char *iface, + guint32 *out_value) +{ + GError *error = NULL; + char *contents = NULL; + gboolean success = FALSE; + long int tmp; + + if (!g_file_get_contents (path, &contents, NULL, &error)) { + nm_log_dbg (LOGD_DEVICE, "(%s): error reading %s: (%d) %s", + iface, path, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } else { + errno = 0; + tmp = strtol (contents, NULL, 10); + if ((errno == 0) && (tmp == 0 || tmp == 1)) { + *out_value = (guint32) tmp; + success = TRUE; + } + g_free (contents); + } + + return success; +} + diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h new file mode 100644 index 00000000..e3d1793b --- /dev/null +++ b/src/NetworkManagerUtils.h @@ -0,0 +1,80 @@ +/* -*- 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 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + */ + +#ifndef NETWORK_MANAGER_UTILS_H +#define NETWORK_MANAGER_UTILS_H + +#include +#include +#include + +#include "nm-device.h" +#include "nm-ip4-config.h" +#include "nm-setting-ip4-config.h" +#include "nm-ip6-config.h" +#include "nm-setting-ip6-config.h" +#include "nm-connection.h" + +gboolean nm_ethernet_address_is_valid (const struct ether_addr *test_addr); + +int nm_spawn_process (const char *args); + +char *nm_ether_ntop (const struct ether_addr *mac); + +void nm_utils_merge_ip4_config (NMIP4Config *ip4_config, NMSettingIP4Config *setting); +void nm_utils_merge_ip6_config (NMIP6Config *ip6_config, NMSettingIP6Config *setting); + +void nm_utils_call_dispatcher (const char *action, + NMConnection *connection, + NMDevice *device, + const char *vpn_iface); + +gboolean nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr); + + +GHashTable *value_hash_create (void); +void value_hash_add (GHashTable *hash, + const char *key, + GValue *value); + +void value_hash_add_str (GHashTable *hash, + const char *key, + const char *str); + +void value_hash_add_object_path (GHashTable *hash, + const char *key, + const char *op); + +void value_hash_add_uint (GHashTable *hash, + const char *key, + guint32 val); + +void value_hash_add_bool (GHashTable *hash, + const char *key, + gboolean val); + +gboolean nm_utils_do_sysctl (const char *path, const char *value); + +gboolean nm_utils_get_proc_sys_net_value (const char *path, + const char *iface, + guint32 *out_value); + +#endif /* NETWORK_MANAGER_UTILS_H */ diff --git a/src/backends/Makefile.am b/src/backends/Makefile.am new file mode 100644 index 00000000..c3485e5f --- /dev/null +++ b/src/backends/Makefile.am @@ -0,0 +1,70 @@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/include \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/vpn-manager \ + -I${top_srcdir}/src/named-manager \ + -I${top_srcdir}/libnm-util + +noinst_LTLIBRARIES = libnmbackend.la + +libnmbackend_la_SOURCES = NetworkManagerGeneric.c \ + NetworkManagerGeneric.h + +libnmbackend_la_LIBADD = + +if TARGET_REDHAT +libnmbackend_la_SOURCES += NetworkManagerRedHat.c +endif + +if TARGET_SUSE +libnmbackend_la_SOURCES += NetworkManagerSuSE.c +endif + +if TARGET_GENTOO +libnmbackend_la_SOURCES += NetworkManagerGentoo.c +endif + +if TARGET_DEBIAN +libnmbackend_la_SOURCES += NetworkManagerDebian.c +endif + +if TARGET_SLACKWARE +libnmbackend_la_SOURCES += NetworkManagerSlackware.c +endif + +if TARGET_ARCH +libnmbackend_la_SOURCES += NetworkManagerArch.c +endif + +if TARGET_PALDO +libnmbackend_la_SOURCES += NetworkManagerPaldo.c +endif + +if TARGET_FRUGALWARE +libnmbackend_la_SOURCES += NetworkManagerFrugalware.c +libnmbackend_la_LIBADD += -lfwnetconfig -lfwutil +endif + +if TARGET_MANDRIVA +libnmbackend_la_SOURCES += NetworkManagerMandriva.c +endif + +if TARGET_PARDUS +libnmbackend_la_SOURCES += NetworkManagerPardus.c +endif + +libnmbackend_la_LIBADD += \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +libnmbackend_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" + diff --git a/src/backends/Makefile.in b/src/backends/Makefile.in new file mode 100644 index 00000000..9e3b8735 --- /dev/null +++ b/src/backends/Makefile.in @@ -0,0 +1,689 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@TARGET_REDHAT_TRUE@am__append_1 = NetworkManagerRedHat.c +@TARGET_SUSE_TRUE@am__append_2 = NetworkManagerSuSE.c +@TARGET_GENTOO_TRUE@am__append_3 = NetworkManagerGentoo.c +@TARGET_DEBIAN_TRUE@am__append_4 = NetworkManagerDebian.c +@TARGET_SLACKWARE_TRUE@am__append_5 = NetworkManagerSlackware.c +@TARGET_ARCH_TRUE@am__append_6 = NetworkManagerArch.c +@TARGET_PALDO_TRUE@am__append_7 = NetworkManagerPaldo.c +@TARGET_FRUGALWARE_TRUE@am__append_8 = NetworkManagerFrugalware.c +@TARGET_FRUGALWARE_TRUE@am__append_9 = -lfwnetconfig -lfwutil +@TARGET_MANDRIVA_TRUE@am__append_10 = NetworkManagerMandriva.c +@TARGET_PARDUS_TRUE@am__append_11 = NetworkManagerPardus.c +subdir = src/backends +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libnmbackend_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__libnmbackend_la_SOURCES_DIST = NetworkManagerGeneric.c \ + NetworkManagerGeneric.h NetworkManagerRedHat.c \ + NetworkManagerSuSE.c NetworkManagerGentoo.c \ + NetworkManagerDebian.c NetworkManagerSlackware.c \ + NetworkManagerArch.c NetworkManagerPaldo.c \ + NetworkManagerFrugalware.c NetworkManagerMandriva.c \ + NetworkManagerPardus.c +@TARGET_REDHAT_TRUE@am__objects_1 = \ +@TARGET_REDHAT_TRUE@ libnmbackend_la-NetworkManagerRedHat.lo +@TARGET_SUSE_TRUE@am__objects_2 = \ +@TARGET_SUSE_TRUE@ libnmbackend_la-NetworkManagerSuSE.lo +@TARGET_GENTOO_TRUE@am__objects_3 = \ +@TARGET_GENTOO_TRUE@ libnmbackend_la-NetworkManagerGentoo.lo +@TARGET_DEBIAN_TRUE@am__objects_4 = \ +@TARGET_DEBIAN_TRUE@ libnmbackend_la-NetworkManagerDebian.lo +@TARGET_SLACKWARE_TRUE@am__objects_5 = libnmbackend_la-NetworkManagerSlackware.lo +@TARGET_ARCH_TRUE@am__objects_6 = \ +@TARGET_ARCH_TRUE@ libnmbackend_la-NetworkManagerArch.lo +@TARGET_PALDO_TRUE@am__objects_7 = \ +@TARGET_PALDO_TRUE@ libnmbackend_la-NetworkManagerPaldo.lo +@TARGET_FRUGALWARE_TRUE@am__objects_8 = libnmbackend_la-NetworkManagerFrugalware.lo +@TARGET_MANDRIVA_TRUE@am__objects_9 = libnmbackend_la-NetworkManagerMandriva.lo +@TARGET_PARDUS_TRUE@am__objects_10 = \ +@TARGET_PARDUS_TRUE@ libnmbackend_la-NetworkManagerPardus.lo +am_libnmbackend_la_OBJECTS = libnmbackend_la-NetworkManagerGeneric.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) $(am__objects_6) \ + $(am__objects_7) $(am__objects_8) $(am__objects_9) \ + $(am__objects_10) +libnmbackend_la_OBJECTS = $(am_libnmbackend_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnmbackend_la_SOURCES) +DIST_SOURCES = $(am__libnmbackend_la_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/include \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/vpn-manager \ + -I${top_srcdir}/src/named-manager \ + -I${top_srcdir}/libnm-util + +noinst_LTLIBRARIES = libnmbackend.la +libnmbackend_la_SOURCES = NetworkManagerGeneric.c \ + NetworkManagerGeneric.h $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) \ + $(am__append_6) $(am__append_7) $(am__append_8) \ + $(am__append_10) $(am__append_11) +libnmbackend_la_LIBADD = $(am__append_9) \ + $(top_builddir)/src/logging/libnm-logging.la $(DBUS_LIBS) \ + $(GLIB_LIBS) +libnmbackend_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/backends/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/backends/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnmbackend.la: $(libnmbackend_la_OBJECTS) $(libnmbackend_la_DEPENDENCIES) + $(LINK) $(libnmbackend_la_OBJECTS) $(libnmbackend_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerArch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerDebian.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerFrugalware.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerGeneric.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerGentoo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerMandriva.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerPaldo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerPardus.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerRedHat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerSlackware.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmbackend_la-NetworkManagerSuSE.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnmbackend_la-NetworkManagerGeneric.lo: NetworkManagerGeneric.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerGeneric.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerGeneric.Tpo -c -o libnmbackend_la-NetworkManagerGeneric.lo `test -f 'NetworkManagerGeneric.c' || echo '$(srcdir)/'`NetworkManagerGeneric.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerGeneric.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerGeneric.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerGeneric.c' object='libnmbackend_la-NetworkManagerGeneric.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerGeneric.lo `test -f 'NetworkManagerGeneric.c' || echo '$(srcdir)/'`NetworkManagerGeneric.c + +libnmbackend_la-NetworkManagerRedHat.lo: NetworkManagerRedHat.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerRedHat.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerRedHat.Tpo -c -o libnmbackend_la-NetworkManagerRedHat.lo `test -f 'NetworkManagerRedHat.c' || echo '$(srcdir)/'`NetworkManagerRedHat.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerRedHat.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerRedHat.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerRedHat.c' object='libnmbackend_la-NetworkManagerRedHat.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerRedHat.lo `test -f 'NetworkManagerRedHat.c' || echo '$(srcdir)/'`NetworkManagerRedHat.c + +libnmbackend_la-NetworkManagerSuSE.lo: NetworkManagerSuSE.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerSuSE.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerSuSE.Tpo -c -o libnmbackend_la-NetworkManagerSuSE.lo `test -f 'NetworkManagerSuSE.c' || echo '$(srcdir)/'`NetworkManagerSuSE.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerSuSE.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerSuSE.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerSuSE.c' object='libnmbackend_la-NetworkManagerSuSE.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerSuSE.lo `test -f 'NetworkManagerSuSE.c' || echo '$(srcdir)/'`NetworkManagerSuSE.c + +libnmbackend_la-NetworkManagerGentoo.lo: NetworkManagerGentoo.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerGentoo.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerGentoo.Tpo -c -o libnmbackend_la-NetworkManagerGentoo.lo `test -f 'NetworkManagerGentoo.c' || echo '$(srcdir)/'`NetworkManagerGentoo.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerGentoo.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerGentoo.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerGentoo.c' object='libnmbackend_la-NetworkManagerGentoo.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerGentoo.lo `test -f 'NetworkManagerGentoo.c' || echo '$(srcdir)/'`NetworkManagerGentoo.c + +libnmbackend_la-NetworkManagerDebian.lo: NetworkManagerDebian.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerDebian.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerDebian.Tpo -c -o libnmbackend_la-NetworkManagerDebian.lo `test -f 'NetworkManagerDebian.c' || echo '$(srcdir)/'`NetworkManagerDebian.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerDebian.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerDebian.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerDebian.c' object='libnmbackend_la-NetworkManagerDebian.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerDebian.lo `test -f 'NetworkManagerDebian.c' || echo '$(srcdir)/'`NetworkManagerDebian.c + +libnmbackend_la-NetworkManagerSlackware.lo: NetworkManagerSlackware.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerSlackware.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerSlackware.Tpo -c -o libnmbackend_la-NetworkManagerSlackware.lo `test -f 'NetworkManagerSlackware.c' || echo '$(srcdir)/'`NetworkManagerSlackware.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerSlackware.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerSlackware.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerSlackware.c' object='libnmbackend_la-NetworkManagerSlackware.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerSlackware.lo `test -f 'NetworkManagerSlackware.c' || echo '$(srcdir)/'`NetworkManagerSlackware.c + +libnmbackend_la-NetworkManagerArch.lo: NetworkManagerArch.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerArch.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerArch.Tpo -c -o libnmbackend_la-NetworkManagerArch.lo `test -f 'NetworkManagerArch.c' || echo '$(srcdir)/'`NetworkManagerArch.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerArch.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerArch.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerArch.c' object='libnmbackend_la-NetworkManagerArch.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerArch.lo `test -f 'NetworkManagerArch.c' || echo '$(srcdir)/'`NetworkManagerArch.c + +libnmbackend_la-NetworkManagerPaldo.lo: NetworkManagerPaldo.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerPaldo.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerPaldo.Tpo -c -o libnmbackend_la-NetworkManagerPaldo.lo `test -f 'NetworkManagerPaldo.c' || echo '$(srcdir)/'`NetworkManagerPaldo.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerPaldo.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerPaldo.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerPaldo.c' object='libnmbackend_la-NetworkManagerPaldo.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerPaldo.lo `test -f 'NetworkManagerPaldo.c' || echo '$(srcdir)/'`NetworkManagerPaldo.c + +libnmbackend_la-NetworkManagerFrugalware.lo: NetworkManagerFrugalware.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerFrugalware.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerFrugalware.Tpo -c -o libnmbackend_la-NetworkManagerFrugalware.lo `test -f 'NetworkManagerFrugalware.c' || echo '$(srcdir)/'`NetworkManagerFrugalware.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerFrugalware.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerFrugalware.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerFrugalware.c' object='libnmbackend_la-NetworkManagerFrugalware.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerFrugalware.lo `test -f 'NetworkManagerFrugalware.c' || echo '$(srcdir)/'`NetworkManagerFrugalware.c + +libnmbackend_la-NetworkManagerMandriva.lo: NetworkManagerMandriva.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerMandriva.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerMandriva.Tpo -c -o libnmbackend_la-NetworkManagerMandriva.lo `test -f 'NetworkManagerMandriva.c' || echo '$(srcdir)/'`NetworkManagerMandriva.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerMandriva.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerMandriva.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerMandriva.c' object='libnmbackend_la-NetworkManagerMandriva.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerMandriva.lo `test -f 'NetworkManagerMandriva.c' || echo '$(srcdir)/'`NetworkManagerMandriva.c + +libnmbackend_la-NetworkManagerPardus.lo: NetworkManagerPardus.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnmbackend_la-NetworkManagerPardus.lo -MD -MP -MF $(DEPDIR)/libnmbackend_la-NetworkManagerPardus.Tpo -c -o libnmbackend_la-NetworkManagerPardus.lo `test -f 'NetworkManagerPardus.c' || echo '$(srcdir)/'`NetworkManagerPardus.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnmbackend_la-NetworkManagerPardus.Tpo $(DEPDIR)/libnmbackend_la-NetworkManagerPardus.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='NetworkManagerPardus.c' object='libnmbackend_la-NetworkManagerPardus.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnmbackend_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnmbackend_la-NetworkManagerPardus.lo `test -f 'NetworkManagerPardus.c' || echo '$(srcdir)/'`NetworkManagerPardus.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/backends/NetworkManagerArch.c b/src/backends/NetworkManagerArch.c new file mode 100644 index 00000000..c70e2459 --- /dev/null +++ b/src/backends/NetworkManagerArch.c @@ -0,0 +1,70 @@ +/* NetworkManager -- Network link manager + * + * Backend implementation for the Arch Linux distribution http://www.archlinux.org + * + * Tor Krill and Will Rea + * + * Updated by Wael Nasreddine + * + * Updated by Valentine Sinitsyn + * + * Heavily based on NetworkManagerDebian.c by Matthew Garrett + * + * Heavily based on NetworkManagerRedhat.c by Dan Williams + * + * 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 2004 Tom Parker + * (C) Copyright 2004 Matthew Garrett + * (C) Copyright 2004 Red Hat, Inc. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + +/* + * nm_system_update_dns + * + * Make glibc/nscd aware of any changes to the resolv.conf file by + * restarting nscd. + * + */ +void nm_system_update_dns (void) +{ + /* Check if the daemon was already running - do not start a new instance */ + if (g_file_test("/var/run/daemons/nscd", G_FILE_TEST_EXISTS)) + nm_spawn_process ("/etc/rc.d/nscd restart"); +} + diff --git a/src/backends/NetworkManagerDebian.c b/src/backends/NetworkManagerDebian.c new file mode 100644 index 00000000..ef9475af --- /dev/null +++ b/src/backends/NetworkManagerDebian.c @@ -0,0 +1,64 @@ +/* NetworkManager -- Network link manager + * + * Matthew Garrett + * + * Heavily based on NetworkManagerRedhat.c by Dan Williams + * + * 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 2004 Tom Parker + * (C) Copyright 2004 Matthew Garrett + * (C) Copyright 2004 Red Hat, Inc. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" +#include "nm-logging.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_spawn_process ("/sbin/ifup lo"); +} + +/* + * nm_system_update_dns + * + * Invalidate the nscd host cache, if it exists, since + * we changed resolv.conf. + * + */ +void nm_system_update_dns (void) +{ + if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); + } +} + diff --git a/src/backends/NetworkManagerFrugalware.c b/src/backends/NetworkManagerFrugalware.c new file mode 100644 index 00000000..dfe62921 --- /dev/null +++ b/src/backends/NetworkManagerFrugalware.c @@ -0,0 +1,58 @@ +/* NetworkManager -- Network link manager + * + * Implementation for the Frugalware Linux distro - http://www.frugalware.org + * + * Alex Smith + * + * Based on NetworkManagerSlackware.c by Narayan Newton + * + * 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 2006 Alex Smith + */ + +#include +#include +#include + +#include "nm-system.h" + +/* Provided by the frugalwareutils package on Frugalware */ +#include + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + fwnet_loup (); +} + + +/* + * nm_system_update_dns + * + * Make glibc/nscd aware of any changes to the resolv.conf file by + * restarting nscd. + * + */ +void nm_system_update_dns (void) +{ + /* I'm not running nscd */ +} + diff --git a/src/backends/NetworkManagerGeneric.c b/src/backends/NetworkManagerGeneric.c new file mode 100644 index 00000000..8f16066f --- /dev/null +++ b/src/backends/NetworkManagerGeneric.c @@ -0,0 +1,113 @@ +/* -*- 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 2004 - 2010 Red Hat, Inc. + * (C) Copyright 2006 Timothee Lecomte + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" +#include "nm-logging.h" +#include "nm-netlink-monitor.h" + +/* Because of a bug in libnl, rtnl.h should be included before route.h */ +#include + +#include +#include + +/* + * nm_generic_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_generic_enable_loopback (void) +{ + struct nl_handle * nlh = NULL; + struct rtnl_addr * addr = NULL; + struct nl_addr * nl_addr = NULL; + guint32 binaddr = 0; + int iface_idx = -1; + int err; + + nm_system_device_set_up_down_with_iface ("lo", TRUE, NULL); + + nlh = nm_netlink_get_default_handle (); + if (!nlh) + return; + + iface_idx = nm_netlink_iface_to_index ("lo"); + if (iface_idx < 0) + return; + + addr = rtnl_addr_alloc (); + if (!addr) + return; + + binaddr = htonl (0x7f000001); /* 127.0.0.1 */ + nl_addr = nl_addr_build (AF_INET, &binaddr, sizeof(binaddr)); + if (!nl_addr) + goto out; + rtnl_addr_set_local (addr, nl_addr); + nl_addr_put (nl_addr); + + binaddr = htonl (0x7fffffff); /* 127.255.255.255 */ + nl_addr = nl_addr_build (AF_INET, &binaddr, sizeof(binaddr)); + if (!nl_addr) + goto out; + rtnl_addr_set_broadcast (addr, nl_addr); + nl_addr_put (nl_addr); + + rtnl_addr_set_prefixlen (addr, 8); + rtnl_addr_set_ifindex (addr, iface_idx); + rtnl_addr_set_scope (addr, RT_SCOPE_HOST); + rtnl_addr_set_label (addr, "lo"); + + if ((err = rtnl_addr_add (nlh, addr, 0)) < 0) { + if (err != -EEXIST) { + nm_log_warn (LOGD_CORE, "error %d returned from rtnl_addr_add():\n%s", err, nl_geterror()); + } + } +out: + if (addr) + rtnl_addr_put (addr); +} + +/* + * nm_generic_update_dns + * + * Make glibc/nscd aware of any changes to the resolv.conf file by + * restarting nscd. + * + */ +void nm_generic_update_dns (void) +{ +} + diff --git a/src/backends/NetworkManagerGeneric.h b/src/backends/NetworkManagerGeneric.h new file mode 100644 index 00000000..0a0a88a2 --- /dev/null +++ b/src/backends/NetworkManagerGeneric.h @@ -0,0 +1,30 @@ +/* NetworkManager -- Network link manager + * + * Timothee Lecomte + * + * Heavily based on NetworkManagerSystem.h by Dan Williams + * + * 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 2004 Red Hat, Inc. + */ + +#ifndef NETWORK_MANAGER_GENERIC_H +#define NETWORK_MANAGER_GENERIC_H + +void nm_generic_enable_loopback (void); +void nm_generic_update_dns (void); + +#endif diff --git a/src/backends/NetworkManagerGentoo.c b/src/backends/NetworkManagerGentoo.c new file mode 100644 index 00000000..8d9e68c5 --- /dev/null +++ b/src/backends/NetworkManagerGentoo.c @@ -0,0 +1,66 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * Dan Willemsen + * Robert Paskowitz + * + * 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 2004 Red Hat, Inc. + * (C) Copyright 2004 Dan Willemsen + * (C) Copyright 2004 Robert Paskowitz + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" +#include "nm-logging.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + /* No need to run net.lo if it is already running */ + if (nm_spawn_process ("/etc/init.d/net.lo status") != 0) + nm_spawn_process("/etc/init.d/net.lo start"); +} + +/* + * nm_system_update_dns + * + * Make glibc/nscd aware of any changes to the resolv.conf file by + * restarting nscd. Only restart if already running. + * + */ +void nm_system_update_dns (void) +{ + if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_IS_EXECUTABLE)) { + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); + } +} + diff --git a/src/backends/NetworkManagerMandriva.c b/src/backends/NetworkManagerMandriva.c new file mode 100644 index 00000000..8209ff4f --- /dev/null +++ b/src/backends/NetworkManagerMandriva.c @@ -0,0 +1,61 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * Per Øyvind Karlsen + * + * 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 2004 Red Hat, Inc. + * (C) Copyright 2008 Per Øyvind Karlsen + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + +/* + * nm_system_update_dns + * + * Invalidate the nscd host cache, if it exists, since + * we changed resolv.conf. + * + */ +void nm_system_update_dns (void) +{ + if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE | G_FILE_TEST_IS_REGULAR)) { + nm_spawn_process ("/etc/init.d/nscd condrestart"); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); + } +} + diff --git a/src/backends/NetworkManagerPaldo.c b/src/backends/NetworkManagerPaldo.c new file mode 100644 index 00000000..0c67e5bd --- /dev/null +++ b/src/backends/NetworkManagerPaldo.c @@ -0,0 +1,61 @@ +/* NetworkManager -- Network link manager + * + * Jürg Billeter + * + * Heavily based on NetworkManagerRedhat.c by Dan Williams + * + * 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 2004 Red Hat, Inc. + * (C) Copyright 2006 Jürg Billeter + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" +#include "nm-logging.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + +/* + * nm_system_update_dns + * + * Invalidate the nscd host cache, if it exists, since + * we changed resolv.conf. + * + */ +void nm_system_update_dns (void) +{ + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); +} + diff --git a/src/backends/NetworkManagerPardus.c b/src/backends/NetworkManagerPardus.c new file mode 100644 index 00000000..d952cf36 --- /dev/null +++ b/src/backends/NetworkManagerPardus.c @@ -0,0 +1,57 @@ +/* NetworkManager -- Network link manager + * + * Ozan Caglayan + * + * 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 2004 RedHat, Inc. + * (C) Copyright 2009 TUBITAK/UEKAE + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + + +/* + * nm_system_update_dns + * + * Make glibc/nscd aware of any changes to the resolv.conf file by + * restarting nscd. + * + */ +void nm_system_update_dns (void) +{ + /* I'm not running nscd */ +} + diff --git a/src/backends/NetworkManagerRedHat.c b/src/backends/NetworkManagerRedHat.c new file mode 100644 index 00000000..954e58a8 --- /dev/null +++ b/src/backends/NetworkManagerRedHat.c @@ -0,0 +1,59 @@ +/* NetworkManager -- Network link manager + * + * Dan Williams + * + * 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 2004 Red Hat, Inc. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + +/* + * nm_system_update_dns + * + * Invalidate the nscd host cache, if it exists, since + * we changed resolv.conf. + * + */ +void nm_system_update_dns (void) +{ + if (g_file_test ("/usr/sbin/nscd", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE | G_FILE_TEST_IS_REGULAR)) { + nm_spawn_process ("/etc/init.d/nscd condrestart"); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); + } +} + diff --git a/src/backends/NetworkManagerSlackware.c b/src/backends/NetworkManagerSlackware.c new file mode 100644 index 00000000..a35e1bb6 --- /dev/null +++ b/src/backends/NetworkManagerSlackware.c @@ -0,0 +1,57 @@ +/* NetworkManager -- Network link manager + * + * Narayan Newton + * + * 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 2004 RedHat, Inc. + * (C) Copyright 2004 Narayan Newton + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + + +/* + * nm_system_update_dns + * + * Make glibc/nscd aware of any changes to the resolv.conf file by + * restarting nscd. + * + */ +void nm_system_update_dns (void) +{ + /* I'm not running nscd */ +} + diff --git a/src/backends/NetworkManagerSuSE.c b/src/backends/NetworkManagerSuSE.c new file mode 100644 index 00000000..6c8ec1a5 --- /dev/null +++ b/src/backends/NetworkManagerSuSE.c @@ -0,0 +1,62 @@ +/* + * NetworkManager -- Network link manager + * + * Dan Williams + * Kay Sievers + * Robert Love + * + * 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 2004 Red Hat, Inc. + * (C) Copyright 2005-2006 SuSE GmbH + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "NetworkManagerGeneric.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" +#include "nm-logging.h" + +/* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ +void nm_system_enable_loopback (void) +{ + nm_generic_enable_loopback (); +} + +/* + * nm_system_update_dns + * + * Invalidate the nscd host cache, if it exists, since + * we changed resolv.conf. + * + */ +void nm_system_update_dns (void) +{ + nm_log_info (LOGD_DNS, "Clearing nscd hosts cache."); + nm_spawn_process ("/usr/sbin/nscd -i hosts"); +} + diff --git a/src/bluez-manager/Makefile.am b/src/bluez-manager/Makefile.am new file mode 100644 index 00000000..6c199e8c --- /dev/null +++ b/src/bluez-manager/Makefile.am @@ -0,0 +1,38 @@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ + -I${top_builddir}/marshallers \ + -I$(top_srcdir)/src/nm-bluez-manager + +noinst_LTLIBRARIES = libbluez-manager.la + +libbluez_manager_la_SOURCES = \ + nm-bluez-manager.c \ + nm-bluez-manager.h \ + nm-bluez-adapter.c \ + nm-bluez-adapter.h \ + nm-bluez-device.c \ + nm-bluez-device.h \ + nm-bluez-common.h + +libbluez_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(BLUEZ_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" + +libbluez_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(BLUEZ_LIBS) + diff --git a/src/bluez-manager/Makefile.in b/src/bluez-manager/Makefile.in new file mode 100644 index 00000000..037f9fc9 --- /dev/null +++ b/src/bluez-manager/Makefile.in @@ -0,0 +1,601 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/bluez-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libbluez_manager_la_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libbluez_manager_la_OBJECTS = \ + libbluez_manager_la-nm-bluez-manager.lo \ + libbluez_manager_la-nm-bluez-adapter.lo \ + libbluez_manager_la-nm-bluez-device.lo +libbluez_manager_la_OBJECTS = $(am_libbluez_manager_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libbluez_manager_la_SOURCES) +DIST_SOURCES = $(libbluez_manager_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ + -I${top_builddir}/marshallers \ + -I$(top_srcdir)/src/nm-bluez-manager + +noinst_LTLIBRARIES = libbluez-manager.la +libbluez_manager_la_SOURCES = \ + nm-bluez-manager.c \ + nm-bluez-manager.h \ + nm-bluez-adapter.c \ + nm-bluez-adapter.h \ + nm-bluez-device.c \ + nm-bluez-device.h \ + nm-bluez-common.h + +libbluez_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(BLUEZ_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" + +libbluez_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(BLUEZ_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bluez-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/bluez-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libbluez-manager.la: $(libbluez_manager_la_OBJECTS) $(libbluez_manager_la_DEPENDENCIES) + $(LINK) $(libbluez_manager_la_OBJECTS) $(libbluez_manager_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbluez_manager_la-nm-bluez-adapter.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbluez_manager_la-nm-bluez-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbluez_manager_la-nm-bluez-manager.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libbluez_manager_la-nm-bluez-manager.lo: nm-bluez-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbluez_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libbluez_manager_la-nm-bluez-manager.lo -MD -MP -MF $(DEPDIR)/libbluez_manager_la-nm-bluez-manager.Tpo -c -o libbluez_manager_la-nm-bluez-manager.lo `test -f 'nm-bluez-manager.c' || echo '$(srcdir)/'`nm-bluez-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbluez_manager_la-nm-bluez-manager.Tpo $(DEPDIR)/libbluez_manager_la-nm-bluez-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-bluez-manager.c' object='libbluez_manager_la-nm-bluez-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbluez_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libbluez_manager_la-nm-bluez-manager.lo `test -f 'nm-bluez-manager.c' || echo '$(srcdir)/'`nm-bluez-manager.c + +libbluez_manager_la-nm-bluez-adapter.lo: nm-bluez-adapter.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbluez_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libbluez_manager_la-nm-bluez-adapter.lo -MD -MP -MF $(DEPDIR)/libbluez_manager_la-nm-bluez-adapter.Tpo -c -o libbluez_manager_la-nm-bluez-adapter.lo `test -f 'nm-bluez-adapter.c' || echo '$(srcdir)/'`nm-bluez-adapter.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbluez_manager_la-nm-bluez-adapter.Tpo $(DEPDIR)/libbluez_manager_la-nm-bluez-adapter.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-bluez-adapter.c' object='libbluez_manager_la-nm-bluez-adapter.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbluez_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libbluez_manager_la-nm-bluez-adapter.lo `test -f 'nm-bluez-adapter.c' || echo '$(srcdir)/'`nm-bluez-adapter.c + +libbluez_manager_la-nm-bluez-device.lo: nm-bluez-device.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbluez_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libbluez_manager_la-nm-bluez-device.lo -MD -MP -MF $(DEPDIR)/libbluez_manager_la-nm-bluez-device.Tpo -c -o libbluez_manager_la-nm-bluez-device.lo `test -f 'nm-bluez-device.c' || echo '$(srcdir)/'`nm-bluez-device.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libbluez_manager_la-nm-bluez-device.Tpo $(DEPDIR)/libbluez_manager_la-nm-bluez-device.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-bluez-device.c' object='libbluez_manager_la-nm-bluez-device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbluez_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libbluez_manager_la-nm-bluez-device.lo `test -f 'nm-bluez-device.c' || echo '$(srcdir)/'`nm-bluez-device.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/bluez-manager/nm-bluez-adapter.c b/src/bluez-manager/nm-bluez-adapter.c new file mode 100644 index 00000000..27a85e78 --- /dev/null +++ b/src/bluez-manager/nm-bluez-adapter.c @@ -0,0 +1,367 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + */ + +#include +#include + +#include "NetworkManager.h" +#include "nm-dbus-manager.h" +#include "nm-bluez-adapter.h" +#include "nm-bluez-device.h" +#include "nm-bluez-common.h" +#include "nm-dbus-glib-types.h" +#include "nm-logging.h" + + +G_DEFINE_TYPE (NMBluezAdapter, nm_bluez_adapter, G_TYPE_OBJECT) + +#define NM_BLUEZ_ADAPTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_BLUEZ_ADAPTER, NMBluezAdapterPrivate)) + +typedef struct { + char *path; + DBusGProxy *proxy; + gboolean initialized; + + char *address; + GHashTable *devices; +} NMBluezAdapterPrivate; + + +enum { + PROP_0, + PROP_PATH, + PROP_ADDRESS, + + LAST_PROP +}; + +/* Signals */ +enum { + INITIALIZED, + DEVICE_ADDED, + DEVICE_REMOVED, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + +const char * +nm_bluez_adapter_get_path (NMBluezAdapter *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_ADAPTER (self), NULL); + + return NM_BLUEZ_ADAPTER_GET_PRIVATE (self)->path; +} + +const char * +nm_bluez_adapter_get_address (NMBluezAdapter *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_ADAPTER (self), NULL); + + return NM_BLUEZ_ADAPTER_GET_PRIVATE (self)->address; +} + +gboolean +nm_bluez_adapter_get_initialized (NMBluezAdapter *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_ADAPTER (self), FALSE); + + return NM_BLUEZ_ADAPTER_GET_PRIVATE (self)->initialized; +} + +static void +devices_to_list (gpointer key, gpointer data, gpointer user_data) +{ + NMBluezDevice *device = NM_BLUEZ_DEVICE (data); + GSList **list = user_data; + + if (nm_bluez_device_get_usable (device)) + *list = g_slist_append (*list, data); +} + +GSList * +nm_bluez_adapter_get_devices (NMBluezAdapter *self) +{ + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + GSList *devices = NULL; + + g_hash_table_foreach (priv->devices, devices_to_list, &devices); + return devices; +} + +static void +device_usable (NMBluezDevice *device, GParamSpec *pspec, gpointer user_data) +{ + NMBluezAdapter *self = NM_BLUEZ_ADAPTER (user_data); + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + + if (nm_bluez_device_get_usable (device)) + g_signal_emit (self, signals[DEVICE_ADDED], 0, device); + else { + g_object_ref (device); + g_hash_table_remove (priv->devices, nm_bluez_device_get_path (device)); + g_signal_emit (self, signals[DEVICE_REMOVED], 0, device); + g_object_unref (device); + } +} + +static void +device_initialized (NMBluezDevice *device, gboolean success, gpointer user_data) +{ + NMBluezAdapter *self = NM_BLUEZ_ADAPTER (user_data); + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + + if (!success) + g_hash_table_remove (priv->devices, nm_bluez_device_get_path (device)); +} + +static void +device_created (DBusGProxy *proxy, const char *path, gpointer user_data) +{ + NMBluezAdapter *self = NM_BLUEZ_ADAPTER (user_data); + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + NMBluezDevice *device; + + device = nm_bluez_device_new (path); + g_signal_connect (device, "initialized", G_CALLBACK (device_initialized), self); + g_signal_connect (device, "notify::usable", G_CALLBACK (device_usable), self); + g_hash_table_insert (priv->devices, g_strdup (path), device); +} + +static void +device_removed (DBusGProxy *proxy, const char *path, gpointer user_data) +{ + NMBluezAdapter *self = NM_BLUEZ_ADAPTER (user_data); + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + NMBluezDevice *device; + + device = g_hash_table_lookup (priv->devices, path); + if (device) { + g_object_ref (device); + g_hash_table_remove (priv->devices, path); + g_signal_emit (self, signals[DEVICE_REMOVED], 0, device); + g_object_unref (device); + } +} + + +static void +get_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) +{ + NMBluezAdapter *self = NM_BLUEZ_ADAPTER (user_data); + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + GHashTable *properties = NULL; + GError *err = NULL; + GValue *value; + GPtrArray *devices; + int i; + + if (!dbus_g_proxy_end_call (proxy, call, &err, + DBUS_TYPE_G_MAP_OF_VARIANT, &properties, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_BT, "bluez error getting adapter properties: %s", + err && err->message ? err->message : "(unknown)"); + g_error_free (err); + goto done; + } + + value = g_hash_table_lookup (properties, "Address"); + priv->address = value ? g_value_dup_string (value) : NULL; + + value = g_hash_table_lookup (properties, "Devices"); + devices = value ? g_value_get_boxed (value) : NULL; + + for (i = 0; devices && i < devices->len; i++) + device_created (priv->proxy, g_ptr_array_index (devices, i), self); + + g_hash_table_unref (properties); + + priv->initialized = TRUE; + +done: + g_signal_emit (self, signals[INITIALIZED], 0, priv->initialized); +} + +static void +query_properties (NMBluezAdapter *self) +{ + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + DBusGProxyCall *call; + + call = dbus_g_proxy_begin_call (priv->proxy, "GetProperties", + get_properties_cb, + self, + NULL, G_TYPE_INVALID); + if (!call) { + nm_log_warn (LOGD_BT, "failed to request Bluetooth adapter properties for %s.", + priv->path); + } +} + +NMBluezAdapter * +nm_bluez_adapter_new (const char *path) +{ + NMBluezAdapter *self; + NMBluezAdapterPrivate *priv; + NMDBusManager *dbus_mgr; + DBusGConnection *connection; + + self = (NMBluezAdapter *) g_object_new (NM_TYPE_BLUEZ_ADAPTER, + NM_BLUEZ_ADAPTER_PATH, path, + NULL); + if (!self) + return NULL; + + priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + dbus_mgr = nm_dbus_manager_get (); + connection = nm_dbus_manager_get_connection (dbus_mgr); + + priv->proxy = dbus_g_proxy_new_for_name (connection, + BLUEZ_SERVICE, + priv->path, + BLUEZ_ADAPTER_INTERFACE); + g_object_unref (dbus_mgr); + + dbus_g_proxy_add_signal (priv->proxy, "DeviceCreated", + DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "DeviceCreated", + G_CALLBACK (device_created), self, NULL); + + dbus_g_proxy_add_signal (priv->proxy, "DeviceRemoved", + DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "DeviceRemoved", + G_CALLBACK (device_removed), self, NULL); + + query_properties (self); + return self; +} + +static void +nm_bluez_adapter_init (NMBluezAdapter *self) +{ + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (self); + + priv->devices = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, g_object_unref); +} + +static void +finalize (GObject *object) +{ + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (object); + + g_hash_table_destroy (priv->devices); + g_free (priv->address); + g_free (priv->path); + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_bluez_adapter_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PATH: + g_value_set_string (value, priv->path); + break; + case PROP_ADDRESS: + g_value_set_string (value, priv->address); + 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) +{ + NMBluezAdapterPrivate *priv = NM_BLUEZ_ADAPTER_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PATH: + /* construct only */ + priv->path = g_value_dup_string (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_bluez_adapter_class_init (NMBluezAdapterClass *config_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (config_class); + + g_type_class_add_private (config_class, sizeof (NMBluezAdapterPrivate)); + + /* virtual methods */ + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->finalize = finalize; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_PATH, + g_param_spec_string (NM_BLUEZ_ADAPTER_PATH, + "DBus Path", + "DBus Path", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_ADDRESS, + g_param_spec_string (NM_BLUEZ_ADAPTER_ADDRESS, + "Address", + "Address", + NULL, + G_PARAM_READABLE)); + + /* Signals */ + signals[INITIALIZED] = g_signal_new ("initialized", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMBluezAdapterClass, initialized), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); + + signals[DEVICE_ADDED] = g_signal_new ("device-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMBluezAdapterClass, device_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_OBJECT); + + signals[DEVICE_REMOVED] = g_signal_new ("device-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMBluezAdapterClass, device_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_OBJECT); +} + diff --git a/src/bluez-manager/nm-bluez-adapter.h b/src/bluez-manager/nm-bluez-adapter.h new file mode 100644 index 00000000..c552e989 --- /dev/null +++ b/src/bluez-manager/nm-bluez-adapter.h @@ -0,0 +1,67 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#ifndef NM_BLUEZ_ADAPTER_H +#define NM_BLUEZ_ADAPTER_H + +#include +#include + +#include "nm-bluez-device.h" + +#define NM_TYPE_BLUEZ_ADAPTER (nm_bluez_adapter_get_type ()) +#define NM_BLUEZ_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_BLUEZ_ADAPTER, NMBluezAdapter)) +#define NM_BLUEZ_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_BLUEZ_ADAPTER, NMBluezAdapterClass)) +#define NM_IS_BLUEZ_ADAPTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_BLUEZ_ADAPTER)) +#define NM_IS_BLUEZ_ADAPTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_BLUEZ_ADAPTER)) +#define NM_BLUEZ_ADAPTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_BLUEZ_ADAPTER, NMBluezAdapterClass)) + +#define NM_BLUEZ_ADAPTER_PATH "path" +#define NM_BLUEZ_ADAPTER_ADDRESS "address" + +typedef struct { + GObject parent; +} NMBluezAdapter; + +typedef struct { + GObjectClass parent; + + /* virtual functions */ + void (*initialized) (NMBluezAdapter *self, gboolean success); + + void (*device_added) (NMBluezAdapter *self, NMBluezDevice *device); + + void (*device_removed) (NMBluezAdapter *self, NMBluezDevice *device); +} NMBluezAdapterClass; + +GType nm_bluez_adapter_get_type (void); + +NMBluezAdapter *nm_bluez_adapter_new (const char *path); + +const char *nm_bluez_adapter_get_path (NMBluezAdapter *self); + +const char *nm_bluez_adapter_get_address (NMBluezAdapter *self); + +gboolean nm_bluez_adapter_get_initialized (NMBluezAdapter *self); + +GSList *nm_bluez_adapter_get_devices (NMBluezAdapter *self); + +#endif /* NM_BLUEZ_ADAPTER_H */ + diff --git a/src/bluez-manager/nm-bluez-common.h b/src/bluez-manager/nm-bluez-common.h new file mode 100644 index 00000000..61296255 --- /dev/null +++ b/src/bluez-manager/nm-bluez-common.h @@ -0,0 +1,34 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#ifndef NM_BLUEZ_COMMON_H +#define NM_BLUEZ_COMMON_H + +#define BLUEZ_SERVICE "org.bluez" + +#define BLUEZ_MANAGER_PATH "/" +#define BLUEZ_MANAGER_INTERFACE "org.bluez.Manager" +#define BLUEZ_ADAPTER_INTERFACE "org.bluez.Adapter" +#define BLUEZ_DEVICE_INTERFACE "org.bluez.Device" +#define BLUEZ_SERIAL_INTERFACE "org.bluez.Serial" +#define BLUEZ_NETWORK_INTERFACE "org.bluez.Network" + +#endif /* NM_BLUEZ_COMMON_H */ + diff --git a/src/bluez-manager/nm-bluez-device.c b/src/bluez-manager/nm-bluez-device.c new file mode 100644 index 00000000..72acaa69 --- /dev/null +++ b/src/bluez-manager/nm-bluez-device.c @@ -0,0 +1,452 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + */ + +#include +#include + +#include "NetworkManager.h" +#include "nm-dbus-manager.h" +#include "nm-bluez-device.h" +#include "nm-bluez-common.h" +#include "nm-dbus-glib-types.h" +#include "nm-logging.h" +#include "nm-marshal.h" + + +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)) + +typedef struct { + char *path; + DBusGProxy *proxy; + gboolean initialized; + gboolean usable; + + char *address; + char *name; + guint32 capabilities; + gint rssi; +} NMBluezDevicePrivate; + + +enum { + PROP_0, + PROP_PATH, + PROP_ADDRESS, + PROP_NAME, + PROP_CAPABILITIES, + PROP_RSSI, + PROP_USABLE, + + LAST_PROP +}; + +/* Signals */ +enum { + INITIALIZED, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + +const char * +nm_bluez_device_get_path (NMBluezDevice *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_DEVICE (self), NULL); + + return NM_BLUEZ_DEVICE_GET_PRIVATE (self)->path; +} + +const char * +nm_bluez_device_get_address (NMBluezDevice *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_DEVICE (self), NULL); + + return NM_BLUEZ_DEVICE_GET_PRIVATE (self)->address; +} + +gboolean +nm_bluez_device_get_initialized (NMBluezDevice *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_DEVICE (self), FALSE); + + return NM_BLUEZ_DEVICE_GET_PRIVATE (self)->initialized; +} + +gboolean +nm_bluez_device_get_usable (NMBluezDevice *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_DEVICE (self), FALSE); + + return NM_BLUEZ_DEVICE_GET_PRIVATE (self)->usable; +} + +const char * +nm_bluez_device_get_name (NMBluezDevice *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_DEVICE (self), NULL); + + return NM_BLUEZ_DEVICE_GET_PRIVATE (self)->name; +} + +guint32 +nm_bluez_device_get_capabilities (NMBluezDevice *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_DEVICE (self), 0); + + return NM_BLUEZ_DEVICE_GET_PRIVATE (self)->capabilities; +} + +gint +nm_bluez_device_get_rssi (NMBluezDevice *self) +{ + g_return_val_if_fail (NM_IS_BLUEZ_DEVICE (self), 0); + + return NM_BLUEZ_DEVICE_GET_PRIVATE (self)->rssi; +} + +static guint32 +convert_uuids_to_capabilities (const char **strings) +{ + const char **iter; + guint32 capabilities = 0; + + for (iter = strings; iter && *iter; iter++) { + char **parts; + guint uuid16; + + parts = g_strsplit (*iter, "-", -1); + if (parts == NULL || parts[0] == NULL) { + g_strfreev (parts); + continue; + } + + uuid16 = g_ascii_strtoull (parts[0], NULL, 16); + g_strfreev (parts); + + switch (uuid16) { + case 0x1103: + capabilities |= NM_BT_CAPABILITY_DUN; + break; + case 0x1116: + capabilities |= NM_BT_CAPABILITY_NAP; + break; + default: + break; + } + } + + return capabilities; +} + +static void +check_emit_usable (NMBluezDevice *self) +{ + NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self); + + if ( priv->initialized + && priv->capabilities + && priv->name + && priv->address) { + if (!priv->usable) { + priv->usable = TRUE; + g_object_notify (G_OBJECT (self), NM_BLUEZ_DEVICE_USABLE); + } + } else { + if (priv->usable) { + priv->usable = FALSE; + g_object_notify (G_OBJECT (self), NM_BLUEZ_DEVICE_USABLE); + } + } +} + +static void +property_changed (DBusGProxy *proxy, + const char *property, + GValue *value, + gpointer user_data) +{ + NMBluezDevice *self = NM_BLUEZ_DEVICE (user_data); + NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self); + const char *str; + guint32 uint_val; + gint int_val; + + if (!strcmp (property, "Name")) { + str = g_value_get_string (value); + if ( (!priv->name && str) + || (priv->name && !str) + || (priv->name && str && strcmp (priv->name, str))) { + g_free (priv->name); + priv->name = str ? g_strdup (str) : NULL; + g_object_notify (G_OBJECT (self), NM_BLUEZ_DEVICE_NAME); + } + } else if (!strcmp (property, "RSSI")) { + int_val = g_value_get_int (value); + if (priv->rssi != int_val) { + priv->rssi = int_val; + g_object_notify (G_OBJECT (self), NM_BLUEZ_DEVICE_RSSI); + } + } else if (!strcmp (property, "UUIDs")) { + uint_val = convert_uuids_to_capabilities ((const char **) g_value_get_boxed (value)); + if (priv->capabilities != uint_val) { + priv->capabilities = uint_val; + g_object_notify (G_OBJECT (self), NM_BLUEZ_DEVICE_CAPABILITIES); + } + } + + check_emit_usable (self); +} + +static void +get_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) +{ + NMBluezDevice *self = NM_BLUEZ_DEVICE (user_data); + NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self); + GHashTable *properties = NULL; + GError *err = NULL; + GValue *value; + const char **uuids; + + if (!dbus_g_proxy_end_call (proxy, call, &err, + DBUS_TYPE_G_MAP_OF_VARIANT, &properties, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_BT, "bluez error getting device properties: %s", + err && err->message ? err->message : "(unknown)"); + g_error_free (err); + g_signal_emit (self, signals[INITIALIZED], 0, FALSE); + return; + } + + value = g_hash_table_lookup (properties, "Address"); + priv->address = value ? g_value_dup_string (value) : NULL; + + value = g_hash_table_lookup (properties, "Name"); + priv->name = value ? g_value_dup_string (value) : NULL; + + value = g_hash_table_lookup (properties, "RSSI"); + priv->rssi = value ? g_value_get_int (value) : 0; + + value = g_hash_table_lookup (properties, "UUIDs"); + if (value) { + uuids = (const char **) g_value_get_boxed (value); + priv->capabilities = convert_uuids_to_capabilities (uuids); + } else + priv->capabilities = NM_BT_CAPABILITY_NONE; + + g_hash_table_unref (properties); + + priv->initialized = TRUE; + g_signal_emit (self, signals[INITIALIZED], 0, TRUE); + + check_emit_usable (self); +} + +static void +query_properties (NMBluezDevice *self) +{ + NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self); + DBusGProxyCall *call; + + call = dbus_g_proxy_begin_call (priv->proxy, "GetProperties", + get_properties_cb, + self, + NULL, G_TYPE_INVALID); + if (!call) { + nm_log_warn (LOGD_BT, "failed to request Bluetooth device properties for %s.", + priv->path); + } +} + +NMBluezDevice * +nm_bluez_device_new (const char *path) +{ + NMBluezDevice *self; + NMBluezDevicePrivate *priv; + NMDBusManager *dbus_mgr; + DBusGConnection *connection; + + + self = (NMBluezDevice *) g_object_new (NM_TYPE_BLUEZ_DEVICE, + NM_BLUEZ_DEVICE_PATH, path, + NULL); + if (!self) + return NULL; + + priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self); + dbus_mgr = nm_dbus_manager_get (); + connection = nm_dbus_manager_get_connection (dbus_mgr); + + priv->proxy = dbus_g_proxy_new_for_name (connection, + BLUEZ_SERVICE, + priv->path, + BLUEZ_DEVICE_INTERFACE); + g_object_unref (dbus_mgr); + + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_VALUE, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->proxy, "PropertyChanged", + G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "PropertyChanged", + G_CALLBACK (property_changed), self, NULL); + + query_properties (self); + return self; +} + +static void +nm_bluez_device_init (NMBluezDevice *self) +{ +} + +static void +finalize (GObject *object) +{ + NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (object); + + g_free (priv->path); + g_free (priv->address); + g_free (priv->name); + g_object_unref (priv->proxy); + + G_OBJECT_CLASS (nm_bluez_device_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PATH: + g_value_set_string (value, priv->path); + break; + case PROP_ADDRESS: + g_value_set_string (value, priv->address); + break; + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_CAPABILITIES: + g_value_set_uint (value, priv->capabilities); + break; + case PROP_RSSI: + g_value_set_int (value, priv->rssi); + break; + case PROP_USABLE: + g_value_set_boolean (value, priv->usable); + 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) +{ + NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PATH: + /* construct only */ + priv->path = g_value_dup_string (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_bluez_device_class_init (NMBluezDeviceClass *config_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (config_class); + + g_type_class_add_private (config_class, sizeof (NMBluezDevicePrivate)); + + /* virtual methods */ + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->finalize = finalize; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_PATH, + g_param_spec_string (NM_BLUEZ_DEVICE_PATH, + "DBus Path", + "DBus Path", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_ADDRESS, + g_param_spec_string (NM_BLUEZ_DEVICE_ADDRESS, + "Address", + "Address", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_NAME, + g_param_spec_string (NM_BLUEZ_DEVICE_NAME, + "Name", + "Name", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_CAPABILITIES, + g_param_spec_uint (NM_BLUEZ_DEVICE_CAPABILITIES, + "Capabilities", + "Capabilities", + 0, G_MAXUINT, 0, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_RSSI, + g_param_spec_int (NM_BLUEZ_DEVICE_RSSI, + "RSSI", + "RSSI", + G_MININT, G_MAXINT, 0, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_USABLE, + g_param_spec_boolean (NM_BLUEZ_DEVICE_USABLE, + "Usable", + "Usable", + FALSE, + G_PARAM_READABLE)); + + /* Signals */ + signals[INITIALIZED] = g_signal_new ("initialized", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMBluezDeviceClass, initialized), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); +} + diff --git a/src/bluez-manager/nm-bluez-device.h b/src/bluez-manager/nm-bluez-device.h new file mode 100644 index 00000000..8a6b3597 --- /dev/null +++ b/src/bluez-manager/nm-bluez-device.h @@ -0,0 +1,75 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#ifndef NM_BLUEZ_DEVICE_H +#define NM_BLUEZ_DEVICE_H + +#include +#include + +#define NM_TYPE_BLUEZ_DEVICE (nm_bluez_device_get_type ()) +#define NM_BLUEZ_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_BLUEZ_DEVICE, NMBluezDevice)) +#define NM_BLUEZ_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_BLUEZ_DEVICE, NMBluezDeviceClass)) +#define NM_IS_BLUEZ_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_BLUEZ_DEVICE)) +#define NM_IS_BLUEZ_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_BLUEZ_DEVICE)) +#define NM_BLUEZ_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_BLUEZ_DEVICE, NMBluezDeviceClass)) + +#define NM_BLUEZ_DEVICE_PATH "path" +#define NM_BLUEZ_DEVICE_ADDRESS "address" +#define NM_BLUEZ_DEVICE_NAME "name" +#define NM_BLUEZ_DEVICE_CAPABILITIES "capabilities" +#define NM_BLUEZ_DEVICE_RSSI "rssi" +#define NM_BLUEZ_DEVICE_USABLE "usable" + +typedef struct { + GObject parent; +} NMBluezDevice; + +typedef struct { + GObjectClass parent; + + /* virtual functions */ + void (*initialized) (NMBluezDevice *self, gboolean success); + + void (*invalid) (NMBluezDevice *self); +} NMBluezDeviceClass; + +GType nm_bluez_device_get_type (void); + +NMBluezDevice *nm_bluez_device_new (const char *path); + +const char *nm_bluez_device_get_path (NMBluezDevice *self); + +gboolean nm_bluez_device_get_initialized (NMBluezDevice *self); + +gboolean nm_bluez_device_get_usable (NMBluezDevice *self); + +const char *nm_bluez_device_get_address (NMBluezDevice *self); + +const char *nm_bluez_device_get_name (NMBluezDevice *self); + +guint32 nm_bluez_device_get_class (NMBluezDevice *self); + +guint32 nm_bluez_device_get_capabilities (NMBluezDevice *self); + +gint nm_bluez_device_get_rssi (NMBluezDevice *self); + +#endif /* NM_BLUEZ_DEVICE_H */ + diff --git a/src/bluez-manager/nm-bluez-manager.c b/src/bluez-manager/nm-bluez-manager.c new file mode 100644 index 00000000..fe027c4f --- /dev/null +++ b/src/bluez-manager/nm-bluez-manager.c @@ -0,0 +1,369 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include "nm-logging.h" +#include "nm-dbus-glib-types.h" +#include "nm-marshal.h" +#include "nm-bluez-manager.h" +#include "nm-bluez-adapter.h" +#include "nm-dbus-manager.h" +#include "nm-bluez-common.h" + + +typedef struct { + NMDBusManager *dbus_mgr; + gulong name_owner_changed_id; + + DBusGProxy *proxy; + + NMBluezAdapter *adapter; +} NMBluezManagerPrivate; + +#define NM_BLUEZ_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_BLUEZ_MANAGER, NMBluezManagerPrivate)) + +G_DEFINE_TYPE (NMBluezManager, nm_bluez_manager, G_TYPE_OBJECT) + +enum { + BDADDR_ADDED, + BDADDR_REMOVED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static void + +emit_bdaddr_added (NMBluezManager *self, NMBluezDevice *device) +{ + g_signal_emit (self, signals[BDADDR_ADDED], 0, + nm_bluez_device_get_address (device), + nm_bluez_device_get_name (device), + nm_bluez_device_get_path (device), + nm_bluez_device_get_capabilities (device)); +} + +void +nm_bluez_manager_query_devices (NMBluezManager *self) +{ + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + GSList *devices, *iter; + + if (!priv->adapter) + return; + + devices = nm_bluez_adapter_get_devices (priv->adapter); + for (iter = devices; iter; iter = g_slist_next (iter)) + emit_bdaddr_added (self, NM_BLUEZ_DEVICE (iter->data)); + g_slist_free (devices); +} + +static void +device_added (NMBluezAdapter *adapter, NMBluezDevice *device, gpointer user_data) +{ + emit_bdaddr_added (NM_BLUEZ_MANAGER (user_data), device); +} + +static void +device_removed (NMBluezAdapter *adapter, NMBluezDevice *device, gpointer user_data) +{ + NMBluezManager *self = NM_BLUEZ_MANAGER (user_data); + + g_signal_emit (self, signals[BDADDR_REMOVED], 0, + nm_bluez_device_get_address (device), + nm_bluez_device_get_path (device)); +} + +static void +adapter_initialized (NMBluezAdapter *adapter, gboolean success, gpointer user_data) +{ + NMBluezManager *self = NM_BLUEZ_MANAGER (user_data); + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + + if (success) { + GSList *devices, *iter; + + devices = nm_bluez_adapter_get_devices (adapter); + for (iter = devices; iter; iter = g_slist_next (iter)) + emit_bdaddr_added (self, NM_BLUEZ_DEVICE (iter->data)); + g_slist_free (devices); + + g_signal_connect (adapter, "device-added", G_CALLBACK (device_added), self); + g_signal_connect (adapter, "device-removed", G_CALLBACK (device_removed), self); + } else { + g_object_unref (priv->adapter); + priv->adapter = NULL; + } +} + +static void +adapter_removed (DBusGProxy *proxy, const char *path, NMBluezManager *self) +{ + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + + if (priv->adapter && !strcmp (path, nm_bluez_adapter_get_path (priv->adapter))) { + if (nm_bluez_adapter_get_initialized (priv->adapter)) { + GSList *devices, *iter; + + devices = nm_bluez_adapter_get_devices (priv->adapter); + for (iter = devices; iter; iter = g_slist_next (iter)) { + NMBluezDevice *device = NM_BLUEZ_DEVICE (iter->data); + + g_signal_emit (self, signals[BDADDR_REMOVED], 0, + nm_bluez_device_get_address (device), + nm_bluez_device_get_path (device)); + } + g_slist_free (devices); + } + + g_object_unref (priv->adapter); + priv->adapter = NULL; + } +} + +static void +default_adapter_changed (DBusGProxy *proxy, const char *path, NMBluezManager *self) +{ + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + const char *cur_path = NULL; + + if (priv->adapter) + cur_path = nm_bluez_adapter_get_path (priv->adapter); + + if (cur_path) { + if (!path || strcmp (path, cur_path)) { + /* Default adapter changed */ + adapter_removed (priv->proxy, cur_path, self); + } else { + /* This adapter is already the default */ + return; + } + } + + /* Add the new default adapter */ + if (path) { + priv->adapter = nm_bluez_adapter_new (path); + g_signal_connect (priv->adapter, "initialized", G_CALLBACK (adapter_initialized), self); + } +} + +static void +default_adapter_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) +{ + NMBluezManager *self = NM_BLUEZ_MANAGER (user_data); + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + const char *default_adapter = NULL; + GError *err = NULL; + + if (!dbus_g_proxy_end_call (proxy, call, &err, + DBUS_TYPE_G_OBJECT_PATH, &default_adapter, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_BT, "bluez error getting default adapter: %s", + err && err->message ? err->message : "(unknown)"); + g_error_free (err); + return; + } + + default_adapter_changed (priv->proxy, default_adapter, self); +} + +static void +query_default_adapter (NMBluezManager *self) +{ + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + DBusGProxyCall *call; + + call = dbus_g_proxy_begin_call (priv->proxy, "DefaultAdapter", + default_adapter_cb, + self, + NULL, G_TYPE_INVALID); + if (!call) + nm_log_warn (LOGD_BT, "failed to request default Bluetooth adapter."); +} + +static void +bluez_connect (NMBluezManager *self) +{ + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + DBusGConnection *connection; + + g_return_if_fail (priv->proxy == NULL); + + connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + if (!connection) + return; + + priv->proxy = dbus_g_proxy_new_for_name (connection, + BLUEZ_SERVICE, + BLUEZ_MANAGER_PATH, + BLUEZ_MANAGER_INTERFACE); + + dbus_g_proxy_add_signal (priv->proxy, "AdapterRemoved", + DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "AdapterRemoved", + G_CALLBACK (adapter_removed), self, NULL); + + dbus_g_proxy_add_signal (priv->proxy, "DefaultAdapterChanged", + DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "DefaultAdapterChanged", + G_CALLBACK (default_adapter_changed), self, NULL); + + query_default_adapter (self); +} + +static void +remove_all_devices (NMBluezManager *self, gboolean do_signal) +{ + /* FIXME: do something */ +} + +static void +name_owner_changed_cb (NMDBusManager *dbus_mgr, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + NMBluezManager *self = NM_BLUEZ_MANAGER (user_data); + gboolean old_owner_good = (old_owner && strlen (old_owner)); + gboolean new_owner_good = (new_owner && strlen (new_owner)); + + /* Can't handle the signal if its not from the supplicant service */ + if (strcmp (BLUEZ_SERVICE, name)) + return; + + if (old_owner_good && !new_owner_good) + remove_all_devices (self, TRUE); +} + +static void +bluez_cleanup (NMBluezManager *self, gboolean do_signal) +{ + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + + if (priv->proxy) { + g_object_unref (priv->proxy); + priv->proxy = NULL; + } + + remove_all_devices (self, do_signal); +} + +static void +dbus_connection_changed_cb (NMDBusManager *dbus_mgr, + DBusGConnection *connection, + gpointer user_data) +{ + NMBluezManager *self = NM_BLUEZ_MANAGER (user_data); + + if (!connection) + bluez_cleanup (self, TRUE); + else + bluez_connect (self); +} + + +NMBluezManager * +nm_bluez_manager_new (void) +{ + return NM_BLUEZ_MANAGER (g_object_new (NM_TYPE_BLUEZ_MANAGER, NULL)); +} + +NMBluezManager * +nm_bluez_manager_get (void) +{ + static NMBluezManager *singleton = NULL; + + if (!singleton) + singleton = nm_bluez_manager_new (); + else + g_object_ref (singleton); + + g_assert (singleton); + return singleton; +} + +static void +nm_bluez_manager_init (NMBluezManager *self) +{ + NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self); + + priv->dbus_mgr = nm_dbus_manager_get (); + g_assert (priv->dbus_mgr); + + g_signal_connect (priv->dbus_mgr, + "name-owner-changed", + G_CALLBACK (name_owner_changed_cb), + self); + + g_signal_connect (priv->dbus_mgr, + "dbus-connection-changed", + G_CALLBACK (dbus_connection_changed_cb), + self); + + bluez_connect (self); +} + +static void +finalize (GObject *object) +{ + NMBluezManager *self = NM_BLUEZ_MANAGER (object); + + bluez_cleanup (self, FALSE); + + G_OBJECT_CLASS (nm_bluez_manager_parent_class)->finalize (object); +} + +static void +nm_bluez_manager_class_init (NMBluezManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (NMBluezManagerPrivate)); + + /* virtual methods */ + object_class->finalize = finalize; + + /* Signals */ + signals[BDADDR_ADDED] = + g_signal_new ("bdaddr-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMBluezManagerClass, bdaddr_added), + NULL, NULL, + _nm_marshal_VOID__STRING_STRING_STRING_UINT, + G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); + + signals[BDADDR_REMOVED] = + g_signal_new ("bdaddr-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMBluezManagerClass, bdaddr_removed), + NULL, NULL, + _nm_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); +} + diff --git a/src/bluez-manager/nm-bluez-manager.h b/src/bluez-manager/nm-bluez-manager.h new file mode 100644 index 00000000..9cfab1b7 --- /dev/null +++ b/src/bluez-manager/nm-bluez-manager.h @@ -0,0 +1,63 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2009 Red Hat, Inc. + */ + +#ifndef NM_BLUEZ_MANAGER_H +#define NM_BLUEZ_MANAGER_H + +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_BLUEZ_MANAGER (nm_bluez_manager_get_type ()) +#define NM_BLUEZ_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_BLUEZ_MANAGER, NMBluezManager)) +#define NM_BLUEZ_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_BLUEZ_MANAGER, NMBluezManagerClass)) +#define NM_IS_BLUEZ_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_BLUEZ_MANAGER)) +#define NM_IS_BLUEZ_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_BLUEZ_MANAGER)) +#define NM_BLUEZ_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_BLUEZ_MANAGER, NMBluezManagerClass)) + +typedef struct { + GObject parent; +} NMBluezManager; + +typedef struct { + GObjectClass parent; + + /* Virtual functions */ + void (*bdaddr_added) (NMBluezManager *manager, + const char *bdaddr, + const char *name, + const char *object_path, + guint uuids); + + void (*bdaddr_removed) (NMBluezManager *manager, + const char *bdaddr, + const char *object_path); +} NMBluezManagerClass; + +GType nm_bluez_manager_get_type (void); + +NMBluezManager *nm_bluez_manager_new (void); +NMBluezManager *nm_bluez_manager_get (void); +void nm_bluez_manager_query_devices (NMBluezManager *manager); + +#endif /* NM_BLUEZ_MANAGER_H */ + diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am new file mode 100644 index 00000000..f75e6b3d --- /dev/null +++ b/src/dhcp-manager/Makefile.am @@ -0,0 +1,39 @@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/named-manager + +noinst_LTLIBRARIES = libdhcp-manager.la + +libdhcp_manager_la_SOURCES = \ + nm-dhcp-client.c \ + nm-dhcp-client.h \ + nm-dhcp-manager.c \ + nm-dhcp-manager.h \ + nm-dhcp-dhclient.h \ + nm-dhcp-dhclient.c \ + nm-dhcp-dhcpcd.h \ + nm-dhcp-dhcpcd.c + +libdhcp_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" + +libdhcp_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + diff --git a/src/dhcp-manager/Makefile.in b/src/dhcp-manager/Makefile.in new file mode 100644 index 00000000..07b9be9d --- /dev/null +++ b/src/dhcp-manager/Makefile.in @@ -0,0 +1,610 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/dhcp-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libdhcp_manager_la_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libdhcp_manager_la_OBJECTS = libdhcp_manager_la-nm-dhcp-client.lo \ + libdhcp_manager_la-nm-dhcp-manager.lo \ + libdhcp_manager_la-nm-dhcp-dhclient.lo \ + libdhcp_manager_la-nm-dhcp-dhcpcd.lo +libdhcp_manager_la_OBJECTS = $(am_libdhcp_manager_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libdhcp_manager_la_SOURCES) +DIST_SOURCES = $(libdhcp_manager_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/named-manager + +noinst_LTLIBRARIES = libdhcp-manager.la +libdhcp_manager_la_SOURCES = \ + nm-dhcp-client.c \ + nm-dhcp-client.h \ + nm-dhcp-manager.c \ + nm-dhcp-manager.h \ + nm-dhcp-dhclient.h \ + nm-dhcp-dhclient.c \ + nm-dhcp-dhcpcd.h \ + nm-dhcp-dhcpcd.c + +libdhcp_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" + +libdhcp_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/dhcp-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/dhcp-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libdhcp-manager.la: $(libdhcp_manager_la_OBJECTS) $(libdhcp_manager_la_DEPENDENCIES) + $(LINK) $(libdhcp_manager_la_OBJECTS) $(libdhcp_manager_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdhcp_manager_la-nm-dhcp-client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdhcp_manager_la-nm-dhcp-dhclient.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdhcp_manager_la-nm-dhcp-dhcpcd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdhcp_manager_la-nm-dhcp-manager.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libdhcp_manager_la-nm-dhcp-client.lo: nm-dhcp-client.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdhcp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdhcp_manager_la-nm-dhcp-client.lo -MD -MP -MF $(DEPDIR)/libdhcp_manager_la-nm-dhcp-client.Tpo -c -o libdhcp_manager_la-nm-dhcp-client.lo `test -f 'nm-dhcp-client.c' || echo '$(srcdir)/'`nm-dhcp-client.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdhcp_manager_la-nm-dhcp-client.Tpo $(DEPDIR)/libdhcp_manager_la-nm-dhcp-client.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp-client.c' object='libdhcp_manager_la-nm-dhcp-client.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdhcp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdhcp_manager_la-nm-dhcp-client.lo `test -f 'nm-dhcp-client.c' || echo '$(srcdir)/'`nm-dhcp-client.c + +libdhcp_manager_la-nm-dhcp-manager.lo: nm-dhcp-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdhcp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdhcp_manager_la-nm-dhcp-manager.lo -MD -MP -MF $(DEPDIR)/libdhcp_manager_la-nm-dhcp-manager.Tpo -c -o libdhcp_manager_la-nm-dhcp-manager.lo `test -f 'nm-dhcp-manager.c' || echo '$(srcdir)/'`nm-dhcp-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdhcp_manager_la-nm-dhcp-manager.Tpo $(DEPDIR)/libdhcp_manager_la-nm-dhcp-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp-manager.c' object='libdhcp_manager_la-nm-dhcp-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdhcp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdhcp_manager_la-nm-dhcp-manager.lo `test -f 'nm-dhcp-manager.c' || echo '$(srcdir)/'`nm-dhcp-manager.c + +libdhcp_manager_la-nm-dhcp-dhclient.lo: nm-dhcp-dhclient.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdhcp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdhcp_manager_la-nm-dhcp-dhclient.lo -MD -MP -MF $(DEPDIR)/libdhcp_manager_la-nm-dhcp-dhclient.Tpo -c -o libdhcp_manager_la-nm-dhcp-dhclient.lo `test -f 'nm-dhcp-dhclient.c' || echo '$(srcdir)/'`nm-dhcp-dhclient.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdhcp_manager_la-nm-dhcp-dhclient.Tpo $(DEPDIR)/libdhcp_manager_la-nm-dhcp-dhclient.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp-dhclient.c' object='libdhcp_manager_la-nm-dhcp-dhclient.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdhcp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdhcp_manager_la-nm-dhcp-dhclient.lo `test -f 'nm-dhcp-dhclient.c' || echo '$(srcdir)/'`nm-dhcp-dhclient.c + +libdhcp_manager_la-nm-dhcp-dhcpcd.lo: nm-dhcp-dhcpcd.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdhcp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdhcp_manager_la-nm-dhcp-dhcpcd.lo -MD -MP -MF $(DEPDIR)/libdhcp_manager_la-nm-dhcp-dhcpcd.Tpo -c -o libdhcp_manager_la-nm-dhcp-dhcpcd.lo `test -f 'nm-dhcp-dhcpcd.c' || echo '$(srcdir)/'`nm-dhcp-dhcpcd.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdhcp_manager_la-nm-dhcp-dhcpcd.Tpo $(DEPDIR)/libdhcp_manager_la-nm-dhcp-dhcpcd.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dhcp-dhcpcd.c' object='libdhcp_manager_la-nm-dhcp-dhcpcd.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdhcp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdhcp_manager_la-nm-dhcp-dhcpcd.lo `test -f 'nm-dhcp-dhcpcd.c' || echo '$(srcdir)/'`nm-dhcp-dhcpcd.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c new file mode 100644 index 00000000..31a6f83c --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -0,0 +1,1243 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-utils.h" +#include "nm-logging.h" +#include "nm-dbus-glib-types.h" +#include "nm-dhcp-client.h" + +typedef struct { + char * iface; + gboolean ipv6; + char * uuid; + guint32 timeout; + + guchar state; + GPid pid; + gboolean dead; + guint timeout_id; + guint watch_id; + guint32 remove_id; + GHashTable * options; + gboolean info_only; + +} NMDHCPClientPrivate; + +#define NM_DHCP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_CLIENT, NMDHCPClientPrivate)) + +G_DEFINE_TYPE_EXTENDED (NMDHCPClient, nm_dhcp_client, G_TYPE_OBJECT, G_TYPE_FLAG_ABSTRACT, {}) + +enum { + STATE_CHANGED, + TIMEOUT, + REMOVE, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_IFACE, + PROP_IPV6, + PROP_UUID, + PROP_TIMEOUT, + LAST_PROP +}; + +/********************************************/ + +GPid +nm_dhcp_client_get_pid (NMDHCPClient *self) +{ + g_return_val_if_fail (self != NULL, -1); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), -1); + + return NM_DHCP_CLIENT_GET_PRIVATE (self)->pid; +} + +const char * +nm_dhcp_client_get_iface (NMDHCPClient *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + return NM_DHCP_CLIENT_GET_PRIVATE (self)->iface; +} + +gboolean +nm_dhcp_client_get_ipv6 (NMDHCPClient *self) +{ + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); + + return NM_DHCP_CLIENT_GET_PRIVATE (self)->ipv6; +} + +const char * +nm_dhcp_client_get_uuid (NMDHCPClient *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + return NM_DHCP_CLIENT_GET_PRIVATE (self)->uuid; +} + +/********************************************/ + +static void +timeout_cleanup (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } +} + +static void +watch_cleanup (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (priv->watch_id) { + g_source_remove (priv->watch_id); + priv->watch_id = 0; + } +} + +static void +stop_process (GPid pid, const char *iface) +{ + int i = 15; /* 3 seconds */ + + g_return_if_fail (pid > 0); + + /* Tell it to quit; maybe it wants to send out a RELEASE message */ + kill (pid, SIGTERM); + + while (i-- > 0) { + gint child_status; + int ret; + + ret = waitpid (pid, &child_status, WNOHANG); + if (ret > 0) + break; + + if (ret == -1) { + /* Child already exited */ + if (errno == ECHILD) + break; + /* Took too long; shoot it in the head */ + i = 0; + break; + } + g_usleep (G_USEC_PER_SEC / 5); + } + + if (i <= 0) { + if (iface) { + nm_log_warn (LOGD_DHCP, "(%s): DHCP client pid %d didn't exit, will kill it.", + iface, pid); + } + kill (pid, SIGKILL); + + nm_log_dbg (LOGD_DHCP, "waiting for DHCP client pid %d to exit", pid); + waitpid (pid, NULL, 0); + nm_log_dbg (LOGD_DHCP, "DHCP client pid %d cleaned up", pid); + } +} + +static void +real_stop (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DHCP_CLIENT (self)); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_if_fail (priv->pid > 0); + + /* Clean up the watch handler since we're explicitly killing the daemon */ + watch_cleanup (self); + + stop_process (priv->pid, priv->iface); + + priv->info_only = FALSE; +} + +static gboolean +daemon_timeout (gpointer user_data) +{ + NMDHCPClient *self = NM_DHCP_CLIENT (user_data); + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (priv->ipv6) { + nm_log_warn (LOGD_DHCP6, "(%s): DHCPv6 request timed out.", priv->iface); + } else { + nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 request timed out.", priv->iface); + } + g_signal_emit (G_OBJECT (self), signals[TIMEOUT], 0); + return FALSE; +} + +static gboolean +signal_remove (gpointer user_data) +{ + NMDHCPClient *self = NM_DHCP_CLIENT (user_data); + + NM_DHCP_CLIENT_GET_PRIVATE (self)->remove_id = 0; + g_signal_emit (G_OBJECT (self), signals[REMOVE], 0); + return FALSE; +} + +static void +dhcp_client_set_state (NMDHCPClient *self, + NMDHCPState state, + gboolean emit_state, + gboolean remove_now) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + priv->state = state; + + if (emit_state) + g_signal_emit (G_OBJECT (self), signals[STATE_CHANGED], 0, priv->state); + + if (state == DHC_END || state == DHC_ABEND) { + /* Start the remove signal timer */ + if (remove_now) { + g_signal_emit (G_OBJECT (self), signals[REMOVE], 0); + } else { + if (!priv->remove_id) + priv->remove_id = g_timeout_add_seconds (5, signal_remove, self); + } + } +} + +static void +daemon_watch_cb (GPid pid, gint status, gpointer user_data) +{ + NMDHCPClient *self = NM_DHCP_CLIENT (user_data); + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + NMDHCPState new_state; + + if (priv->ipv6) { + nm_log_info (LOGD_DHCP6, "(%s): DHCPv6 client pid %d exited with status %d", + priv->iface, pid, + WIFEXITED (status) ? WEXITSTATUS (status) : -1); + } else { + nm_log_info (LOGD_DHCP6, "(%s): DHCPv4 client pid %d exited with status %d", + priv->iface, pid, + WIFEXITED (status) ? WEXITSTATUS (status) : -1); + } + + if (!WIFEXITED (status)) { + new_state = DHC_ABEND; + nm_log_warn (LOGD_DHCP, "DHCP client died abnormally"); + } else + new_state = DHC_END; + + watch_cleanup (self); + timeout_cleanup (self); + priv->dead = TRUE; + + dhcp_client_set_state (self, new_state, TRUE, FALSE); +} + +static void +start_monitor (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + g_return_if_fail (priv->pid > 0); + + /* Set up a timeout on the transaction to kill it after the timeout */ + priv->timeout_id = g_timeout_add_seconds (priv->timeout, + daemon_timeout, + self); + priv->watch_id = g_child_watch_add (priv->pid, + (GChildWatchFunc) daemon_watch_cb, + self); +} + +gboolean +nm_dhcp_client_start_ip4 (NMDHCPClient *self, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) +{ + NMDHCPClientPrivate *priv; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_val_if_fail (priv->pid == -1, FALSE); + g_return_val_if_fail (priv->ipv6 == FALSE, FALSE); + g_return_val_if_fail (priv->uuid != NULL, FALSE); + + nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv4 transaction (timeout in %d seconds)", + priv->iface, priv->timeout); + + priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_start (self, s_ip4, dhcp_anycast_addr); + if (priv->pid) + start_monitor (self); + + return priv->pid ? TRUE : FALSE; +} + +gboolean +nm_dhcp_client_start_ip6 (NMDHCPClient *self, + NMSettingIP6Config *s_ip6, + guint8 *dhcp_anycast_addr, + gboolean info_only) +{ + NMDHCPClientPrivate *priv; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_val_if_fail (priv->pid == -1, FALSE); + g_return_val_if_fail (priv->ipv6 == TRUE, FALSE); + g_return_val_if_fail (priv->uuid != NULL, FALSE); + + priv->info_only = info_only; + + nm_log_info (LOGD_DHCP, "Activation (%s) Beginning DHCPv6 transaction (timeout in %d seconds)", + priv->iface, priv->timeout); + + priv->pid = NM_DHCP_CLIENT_GET_CLASS (self)->ip6_start (self, s_ip6, dhcp_anycast_addr, info_only); + if (priv->pid > 0) + start_monitor (self); + + return priv->pid ? TRUE : FALSE; +} + +void +nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name) +{ + char *pid_contents = NULL, *proc_contents = NULL, *proc_path = NULL; + long int tmp; + + /* Check for an existing instance and stop it */ + if (!g_file_get_contents (pid_file, &pid_contents, NULL, NULL)) + return; + + errno = 0; + tmp = strtol (pid_contents, NULL, 10); + if ((errno == 0) && (tmp > 1)) { + const char *exe; + + /* Ensure the process is a DHCP client */ + proc_path = g_strdup_printf ("/proc/%ld/cmdline", tmp); + if (g_file_get_contents (proc_path, &proc_contents, NULL, NULL)) { + exe = strrchr (proc_contents, '/'); + if (exe) + exe++; + else + exe = proc_contents; + + if (!strcmp (exe, binary_name)) + stop_process ((GPid) tmp, NULL); + } + } + + remove (pid_file); + g_free (proc_path); + g_free (pid_contents); + g_free (proc_contents); +} + +void +nm_dhcp_client_stop (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DHCP_CLIENT (self)); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + /* Kill the DHCP client */ + if (!priv->dead) { + NM_DHCP_CLIENT_GET_CLASS (self)->stop (self); + priv->dead = TRUE; + + nm_log_info (LOGD_DHCP, "(%s): canceled DHCP transaction, DHCP client pid %d", + priv->iface, priv->pid); + } + + /* And clean stuff up */ + + priv->pid = -1; + dhcp_client_set_state (self, DHC_END, FALSE, TRUE); + + g_hash_table_remove_all (priv->options); + + timeout_cleanup (self); + watch_cleanup (self); +} + +/********************************************/ + +static gboolean +state_is_bound (guint32 state) +{ + if ( (state == DHC_BOUND4) + || (state == DHC_BOUND6) + || (state == DHC_RENEW4) + || (state == DHC_RENEW6) + || (state == DHC_REBOOT) + || (state == DHC_REBIND4) + || (state == DHC_REBIND6) + || (state == DHC_IPV4LL)) + return TRUE; + + return FALSE; +} + +typedef struct { + NMDHCPState state; + const char *name; +} DhcState; + +#define STATE_TABLE_SIZE (sizeof (state_table) / sizeof (state_table[0])) + +static DhcState state_table[] = { + { DHC_NBI, "nbi" }, + { DHC_PREINIT, "preinit" }, + { DHC_PREINIT6,"preinit6" }, + { DHC_BOUND4, "bound" }, + { DHC_BOUND6, "bound6" }, + { DHC_IPV4LL, "ipv4ll" }, + { DHC_RENEW4, "renew" }, + { DHC_RENEW6, "renew6" }, + { DHC_REBOOT, "reboot" }, + { DHC_REBIND4, "rebind" }, + { DHC_REBIND6, "rebind6" }, + { DHC_STOP, "stop" }, + { DHC_STOP6, "stop6" }, + { DHC_MEDIUM, "medium" }, + { DHC_TIMEOUT, "timeout" }, + { DHC_FAIL, "fail" }, + { DHC_EXPIRE, "expire" }, + { DHC_EXPIRE6, "expire6" }, + { DHC_RELEASE, "release" }, + { DHC_RELEASE6,"release6" }, + { DHC_START, "start" }, + { DHC_ABEND, "abend" }, + { DHC_END, "end" }, + { DHC_DEPREF6, "depref6" }, +}; + +static inline const char * +state_to_string (guint32 state) +{ + int i; + + for (i = 0; i < STATE_TABLE_SIZE; i++) { + if (state == state_table[i].state) + return state_table[i].name; + } + + return NULL; +} + +static inline NMDHCPState +string_to_state (const char *name) +{ + int i; + + for (i = 0; i < STATE_TABLE_SIZE; i++) { + if (!strcasecmp (name, state_table[i].name)) + return state_table[i].state; + } + + return 255; +} + +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 void +copy_option (gpointer key, + gpointer value, + gpointer user_data) +{ + GHashTable *hash = user_data; + const char *str_key = (const char *) key; + char *str_value = 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", + str_key); + return; + } + + str_value = garray_to_string ((GArray *) g_value_get_boxed (value), str_key); + if (str_value) + g_hash_table_insert (hash, g_strdup (str_key), str_value); +} + +void +nm_dhcp_client_new_options (NMDHCPClient *self, + GHashTable *options, + const char *reason) +{ + NMDHCPClientPrivate *priv; + guint32 old_state; + guint32 new_state; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DHCP_CLIENT (self)); + g_return_if_fail (options != NULL); + g_return_if_fail (reason != NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + old_state = priv->state; + new_state = string_to_state (reason); + + /* Clear old and save new DHCP options */ + g_hash_table_remove_all (priv->options); + g_hash_table_foreach (options, copy_option, priv->options); + + if (old_state == new_state) + return; + + /* Handle changed device state */ + if (state_is_bound (new_state)) { + /* Cancel the timeout if the DHCP client is now bound */ + timeout_cleanup (self); + } + + if (priv->ipv6) { + nm_log_info (LOGD_DHCP6, "(%s): DHCPv6 state changed %s -> %s", + priv->iface, + state_to_string (old_state), + state_to_string (new_state)); + } else { + nm_log_info (LOGD_DHCP4, "(%s): DHCPv4 state changed %s -> %s", + priv->iface, + state_to_string (old_state), + state_to_string (new_state)); + } + + dhcp_client_set_state (self, new_state, TRUE, FALSE); +} + +#define NEW_TAG "new_" +#define OLD_TAG "old_" + +gboolean +nm_dhcp_client_foreach_option (NMDHCPClient *self, + GHFunc func, + gpointer user_data) +{ + NMDHCPClientPrivate *priv; + GHashTableIter iter; + gpointer iterkey, itervalue; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); + g_return_val_if_fail (func != NULL, FALSE); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (!state_is_bound (priv->state)) { + if (priv->ipv6) { + nm_log_warn (LOGD_DHCP6, "(%s): DHCPv6 client didn't bind to a lease.", priv->iface); + } else { + nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 client didn't bind to a lease.", priv->iface); + } + } + + g_hash_table_iter_init (&iter, priv->options); + while (g_hash_table_iter_next (&iter, &iterkey, &itervalue)) { + const char *key = iterkey, *value = itervalue; + const char **p; + static const char *filter_options[] = { + "interface", "pid", "reason", "dhcp_message_type", NULL + }; + gboolean ignore = FALSE; + + /* Filter out stuff that's not actually new DHCP options */ + for (p = filter_options; *p; p++) { + if (!strcmp (*p, key) || !strncmp (key, OLD_TAG, strlen (OLD_TAG))) { + ignore = TRUE; + break; + } + } + + if (!ignore) { + const char *tmp_key = value; + + /* Remove the "new_" prefix that dhclient passes back */ + if (!strncmp (key, NEW_TAG, strlen (NEW_TAG))) + tmp_key = key + strlen (NEW_TAG); + + func ((gpointer) tmp_key, (gpointer) value, user_data); + } + } + return TRUE; +} + +/********************************************/ + +static void +process_classful_routes (GHashTable *options, NMIP4Config *ip4_config) +{ + const char *str; + char **searches, **s; + + str = g_hash_table_lookup (options, "new_static_routes"); + if (!str) + return; + + searches = g_strsplit (str, " ", 0); + if ((g_strv_length (searches) % 2)) { + nm_log_info (LOGD_DHCP, " static routes provided, but invalid"); + goto out; + } + + for (s = searches; *s; s += 2) { + NMIP4Route *route; + struct in_addr rt_addr; + struct in_addr rt_route; + + if (inet_pton (AF_INET, *s, &rt_addr) <= 0) { + nm_log_warn (LOGD_DHCP, "DHCP provided invalid static route address: '%s'", *s); + continue; + } + if (inet_pton (AF_INET, *(s + 1), &rt_route) <= 0) { + nm_log_warn (LOGD_DHCP, "DHCP provided invalid static route gateway: '%s'", *(s + 1)); + continue; + } + + // FIXME: ensure the IP addresse and route are sane + + route = nm_ip4_route_new (); + nm_ip4_route_set_dest (route, (guint32) rt_addr.s_addr); + nm_ip4_route_set_prefix (route, 32); /* 255.255.255.255 */ + nm_ip4_route_set_next_hop (route, (guint32) rt_route.s_addr); + + nm_ip4_config_take_route (ip4_config, route); + nm_log_info (LOGD_DHCP, " static route %s gw %s", *s, *(s + 1)); + } + +out: + g_strfreev (searches); +} + +static void +process_domain_search (const char *str, GFunc add_func, gpointer user_data) +{ + char **searches, **s; + char *unescaped, *p; + int i; + + g_return_if_fail (str != NULL); + g_return_if_fail (add_func != NULL); + + p = unescaped = g_strdup (str); + do { + p = strstr (p, "\\032"); + if (!p) + break; + + /* Clear the escaped space with real spaces */ + for (i = 0; i < 4; i++) + *p++ = ' '; + } while (*p++); + + if (strchr (unescaped, '\\')) { + nm_log_warn (LOGD_DHCP, " invalid domain search: '%s'", unescaped); + goto out; + } + + searches = g_strsplit (unescaped, " ", 0); + for (s = searches; *s; s++) { + if (strlen (*s)) { + nm_log_info (LOGD_DHCP, " domain search '%s'", *s); + add_func (*s, user_data); + } + } + g_strfreev (searches); + +out: + g_free (unescaped); +} + +static void +ip4_add_domain_search (gpointer data, gpointer user_data) +{ + nm_ip4_config_add_search (NM_IP4_CONFIG (user_data), (const char *) data); +} + +/* Given a table of DHCP options from the client, convert into an IP4Config */ +static NMIP4Config * +ip4_options_to_config (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv; + NMIP4Config *ip4_config = NULL; + struct in_addr tmp_addr; + NMIP4Address *addr = NULL; + char *str = NULL; + guint32 gwaddr = 0, prefix = 0; + gboolean have_classless = FALSE; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_val_if_fail (priv->options != NULL, NULL); + + ip4_config = nm_ip4_config_new (); + if (!ip4_config) { + nm_log_warn (LOGD_DHCP4, "(%s): couldn't allocate memory for an IP4Config!", priv->iface); + return NULL; + } + + addr = nm_ip4_address_new (); + if (!addr) { + nm_log_warn (LOGD_DHCP4, "(%s): couldn't allocate memory for an IP4 Address!", priv->iface); + goto error; + } + + str = g_hash_table_lookup (priv->options, "new_ip_address"); + if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { + nm_ip4_address_set_address (addr, tmp_addr.s_addr); + nm_log_info (LOGD_DHCP4, " address %s", str); + } else + goto error; + + str = g_hash_table_lookup (priv->options, "new_subnet_mask"); + if (str && (inet_pton (AF_INET, str, &tmp_addr) > 0)) { + prefix = nm_utils_ip4_netmask_to_prefix (tmp_addr.s_addr); + nm_log_info (LOGD_DHCP4, " prefix %d (%s)", prefix, str); + } else { + /* Get default netmask for the IP according to appropriate class. */ + prefix = nm_utils_ip4_get_default_prefix (nm_ip4_address_get_address (addr)); + nm_log_info (LOGD_DHCP4, " prefix %d (default)", prefix); + } + nm_ip4_address_set_prefix (addr, prefix); + + /* Routes: if the server returns classless static routes, we MUST ignore + * the 'static_routes' option. + */ + if (NM_DHCP_CLIENT_GET_CLASS (self)->ip4_process_classless_routes) { + have_classless = NM_DHCP_CLIENT_GET_CLASS (self)->ip4_process_classless_routes (self, + priv->options, + ip4_config, + &gwaddr); + } + + if (!have_classless) { + gwaddr = 0; /* Ensure client code doesn't lie */ + process_classful_routes (priv->options, ip4_config); + } + + if (gwaddr) { + char buf[INET_ADDRSTRLEN + 1]; + + inet_ntop (AF_INET, &gwaddr, buf, sizeof (buf)); + nm_log_info (LOGD_DHCP4, " gateway %s", buf); + nm_ip4_address_set_gateway (addr, gwaddr); + } else { + /* If the gateway wasn't provided as a classless static route with a + * subnet length of 0, try to find it using the old-style 'routers' option. + */ + str = g_hash_table_lookup (priv->options, "new_routers"); + if (str) { + char **routers = g_strsplit (str, " ", 0); + char **s; + + for (s = routers; *s; s++) { + /* FIXME: how to handle multiple routers? */ + if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { + nm_ip4_address_set_gateway (addr, tmp_addr.s_addr); + nm_log_info (LOGD_DHCP4, " gateway %s", *s); + break; + } else + nm_log_warn (LOGD_DHCP4, "ignoring invalid gateway '%s'", *s); + } + g_strfreev (routers); + } + } + + nm_ip4_config_take_address (ip4_config, addr); + addr = NULL; + + str = g_hash_table_lookup (priv->options, "new_host_name"); + if (str) + nm_log_info (LOGD_DHCP4, " hostname '%s'", str); + + str = g_hash_table_lookup (priv->options, "new_domain_name_servers"); + if (str) { + char **searches = g_strsplit (str, " ", 0); + char **s; + + for (s = searches; *s; s++) { + if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { + nm_ip4_config_add_nameserver (ip4_config, tmp_addr.s_addr); + nm_log_info (LOGD_DHCP4, " nameserver '%s'", *s); + } else + nm_log_warn (LOGD_DHCP4, "ignoring invalid nameserver '%s'", *s); + } + g_strfreev (searches); + } + + str = g_hash_table_lookup (priv->options, "new_domain_name"); + if (str) { + char **domains = g_strsplit (str, " ", 0); + char **s; + + for (s = domains; *s; s++) { + nm_log_info (LOGD_DHCP4, " domain name '%s'", *s); + nm_ip4_config_add_domain (ip4_config, *s); + } + g_strfreev (domains); + } + + str = g_hash_table_lookup (priv->options, "new_domain_search"); + if (str) + process_domain_search (str, ip4_add_domain_search, ip4_config); + + str = g_hash_table_lookup (priv->options, "new_netbios_name_servers"); + if (str) { + char **searches = g_strsplit (str, " ", 0); + char **s; + + for (s = searches; *s; s++) { + if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { + nm_ip4_config_add_wins (ip4_config, tmp_addr.s_addr); + nm_log_info (LOGD_DHCP4, " wins '%s'", *s); + } else + nm_log_warn (LOGD_DHCP4, "ignoring invalid WINS server '%s'", *s); + } + g_strfreev (searches); + } + + str = g_hash_table_lookup (priv->options, "new_interface_mtu"); + if (str) { + int int_mtu; + + errno = 0; + int_mtu = strtol (str, NULL, 10); + if ((errno == EINVAL) || (errno == ERANGE)) + goto error; + + if (int_mtu > 576) + nm_ip4_config_set_mtu (ip4_config, int_mtu); + } + + str = g_hash_table_lookup (priv->options, "new_nis_domain"); + if (str) { + nm_log_info (LOGD_DHCP4, " NIS domain '%s'", str); + nm_ip4_config_set_nis_domain (ip4_config, str); + } + + str = g_hash_table_lookup (priv->options, "new_nis_servers"); + if (str) { + char **searches = g_strsplit (str, " ", 0); + char **s; + + for (s = searches; *s; s++) { + if (inet_pton (AF_INET, *s, &tmp_addr) > 0) { + nm_ip4_config_add_nis_server (ip4_config, tmp_addr.s_addr); + nm_log_info (LOGD_DHCP4, " nis '%s'", *s); + } else + nm_log_warn (LOGD_DHCP4, "ignoring invalid NIS server '%s'", *s); + } + g_strfreev (searches); + } + + return ip4_config; + +error: + if (addr) + nm_ip4_address_unref (addr); + g_object_unref (ip4_config); + return NULL; +} + +NMIP4Config * +nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test) +{ + NMDHCPClientPrivate *priv; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (test && !state_is_bound (priv->state)) { + nm_log_warn (LOGD_DHCP4, "(%s): DHCPv4 client didn't bind to a lease.", priv->iface); + return NULL; + } + + if (!g_hash_table_size (priv->options)) { + /* We never got a response from the DHCP client */ + return NULL; + } + + return ip4_options_to_config (self); +} + +/********************************************/ + +static void +ip6_add_domain_search (gpointer data, gpointer user_data) +{ + nm_ip6_config_add_search (NM_IP6_CONFIG (user_data), (const char *) data); +} + +/* Given a table of DHCP options from the client, convert into an IP6Config */ +static NMIP6Config * +ip6_options_to_config (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv; + NMIP6Config *ip6_config = NULL; + struct in6_addr tmp_addr; + NMIP6Address *addr = NULL; + char *str = NULL; + GHashTableIter iter; + gpointer key, value; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + g_return_val_if_fail (priv->options != NULL, NULL); + + g_hash_table_iter_init (&iter, priv->options); + while (g_hash_table_iter_next (&iter, &key, &value)) { + nm_log_dbg (LOGD_DHCP6, "(%s): option '%s'=>'%s'", + priv->iface, (const char *) key, (const char *) value); + } + + ip6_config = nm_ip6_config_new (); + if (!ip6_config) { + nm_log_warn (LOGD_DHCP6, "(%s): couldn't allocate memory for an IP6Config!", priv->iface); + return NULL; + } + + addr = nm_ip6_address_new (); + if (!addr) { + nm_log_warn (LOGD_DHCP6, "(%s): couldn't allocate memory for an IP6 Address!", priv->iface); + goto error; + } + + str = g_hash_table_lookup (priv->options, "new_ip6_address"); + if (str) { + if (!inet_pton (AF_INET6, str, &tmp_addr)) { + nm_log_warn (LOGD_DHCP6, "(%s): DHCP returned invalid address '%s'", + priv->iface); + goto error; + } + + nm_ip6_address_set_address (addr, &tmp_addr); + nm_log_info (LOGD_DHCP6, " address %s", str); + } else { + /* No address in managed mode is a hard error */ + if (priv->info_only == FALSE) + goto error; + + /* But "info-only" setups don't necessarily need an address */ + nm_ip6_address_unref (addr); + addr = NULL; + } + + /* Only care about prefix if we got an address */ + if (addr) { + str = g_hash_table_lookup (priv->options, "new_ip6_prefixlen"); + if (str) { + long unsigned int prefix; + + errno = 0; + prefix = strtoul (str, NULL, 10); + if (errno != 0 || prefix > 128) + goto error; + + nm_ip6_address_set_prefix (addr, (guint32) prefix); + nm_log_info (LOGD_DHCP6, " prefix %lu", prefix); + } + + nm_ip6_config_take_address (ip6_config, addr); + addr = NULL; + } + + str = g_hash_table_lookup (priv->options, "new_host_name"); + if (str) + nm_log_info (LOGD_DHCP6, " hostname '%s'", str); + + str = g_hash_table_lookup (priv->options, "new_dhcp6_name_servers"); + if (str) { + char **searches = g_strsplit (str, " ", 0); + char **s; + + for (s = searches; *s; s++) { + if (inet_pton (AF_INET6, *s, &tmp_addr) > 0) { + nm_ip6_config_add_nameserver (ip6_config, &tmp_addr); + nm_log_info (LOGD_DHCP6, " nameserver '%s'", *s); + } else + nm_log_warn (LOGD_DHCP6, "ignoring invalid nameserver '%s'", *s); + } + g_strfreev (searches); + } + + str = g_hash_table_lookup (priv->options, "new_dhcp6_domain_search"); + if (str) + process_domain_search (str, ip6_add_domain_search, ip6_config); + + return ip6_config; + +error: + if (addr) + nm_ip6_address_unref (addr); + g_object_unref (ip6_config); + return NULL; +} + +NMIP6Config * +nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test) +{ + NMDHCPClientPrivate *priv; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); + + priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + if (test && !state_is_bound (priv->state)) { + nm_log_warn (LOGD_DHCP6, "(%s): DHCPv6 client didn't bind to a lease.", priv->iface); + return NULL; + } + + if (!g_hash_table_size (priv->options)) { + /* We never got a response from the DHCP client */ + return NULL; + } + + return ip6_options_to_config (self); +} + +/********************************************/ + +static void +nm_dhcp_client_init (NMDHCPClient *self) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + priv->pid = -1; +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_IFACE: + g_value_set_string (value, priv->iface); + break; + case PROP_IPV6: + g_value_set_boolean (value, priv->ipv6); + break; + case PROP_UUID: + g_value_set_string (value, priv->uuid); + break; + case PROP_TIMEOUT: + g_value_set_uint (value, priv->timeout); + 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) +{ + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_IFACE: + /* construct-only */ + priv->iface = g_strdup (g_value_get_string (value)); + break; + case PROP_IPV6: + /* construct-only */ + priv->ipv6 = g_value_get_boolean (value); + break; + case PROP_UUID: + /* construct-only */ + priv->uuid = g_value_dup_string (value); + break; + case PROP_TIMEOUT: + priv->timeout = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMDHCPClient *self = NM_DHCP_CLIENT (object); + NMDHCPClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (self); + + /* Stopping the client is left up to the controlling device + * explicitly since we may want to quit NetworkManager but not terminate + * the DHCP client. + */ + + if (priv->remove_id) + g_source_remove (priv->remove_id); + + g_hash_table_destroy (priv->options); + g_free (priv->iface); + + G_OBJECT_CLASS (nm_dhcp_client_parent_class)->dispose (object); +} + +static void +nm_dhcp_client_class_init (NMDHCPClientClass *client_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (client_class); + + g_type_class_add_private (client_class, sizeof (NMDHCPClientPrivate)); + + /* virtual methods */ + object_class->dispose = dispose; + object_class->get_property = get_property; + object_class->set_property = set_property; + + client_class->stop = real_stop; + + g_object_class_install_property + (object_class, PROP_IFACE, + g_param_spec_string (NM_DHCP_CLIENT_INTERFACE, + "iface", + "Interface", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_IPV6, + g_param_spec_boolean (NM_DHCP_CLIENT_IPV6, + "ipv6", + "IPv6", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_UUID, + g_param_spec_string (NM_DHCP_CLIENT_UUID, + "uuid", + "UUID", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_TIMEOUT, + g_param_spec_uint (NM_DHCP_CLIENT_TIMEOUT, + "timeout", + "Timeout", + 0, G_MAXUINT, 45, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /* signals */ + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDHCPClientClass, state_changed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + signals[TIMEOUT] = + g_signal_new ("timeout", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDHCPClientClass, timeout), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[REMOVE] = + g_signal_new ("remove", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDHCPClientClass, remove), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h new file mode 100644 index 00000000..92b2b8fe --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -0,0 +1,142 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + */ + +#ifndef NM_DHCP_CLIENT_H +#define NM_DHCP_CLIENT_H + +#include +#include + +#include +#include +#include +#include + +#define NM_TYPE_DHCP_CLIENT (nm_dhcp_client_get_type ()) +#define NM_DHCP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_CLIENT, NMDHCPClient)) +#define NM_DHCP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_CLIENT, NMDHCPClientClass)) +#define NM_IS_DHCP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_CLIENT)) +#define NM_IS_DHCP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP_CLIENT)) +#define NM_DHCP_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_CLIENT, NMDHCPClientClass)) + +#define NM_DHCP_CLIENT_INTERFACE "iface" +#define NM_DHCP_CLIENT_IPV6 "ipv6" +#define NM_DHCP_CLIENT_UUID "uuid" +#define NM_DHCP_CLIENT_TIMEOUT "timeout" + +typedef enum { + DHC_NBI = 0, /* no broadcast interfaces found */ + DHC_PREINIT, /* configuration started */ + DHC_PREINIT6, /* configuration started */ + DHC_BOUND4, /* IPv4 lease obtained */ + DHC_BOUND6, /* IPv6 lease obtained */ + DHC_IPV4LL, /* IPv4LL address obtained */ + DHC_RENEW4, /* IPv4 lease renewed */ + DHC_RENEW6, /* IPv6 lease renewed */ + DHC_REBOOT, /* have valid lease, but now obtained a different one */ + DHC_REBIND4, /* IPv4 new/different lease */ + DHC_REBIND6, /* IPv6 new/different lease */ + DHC_DEPREF6, /* IPv6 lease depreferred */ + DHC_STOP, /* remove old lease */ + DHC_STOP6, /* remove old lease */ + DHC_MEDIUM, /* media selection begun */ + DHC_TIMEOUT, /* timed out contacting DHCP server */ + DHC_FAIL, /* all attempts to contact server timed out, sleeping */ + DHC_EXPIRE, /* lease has expired, renewing */ + DHC_EXPIRE6, /* lease has expired, renewing */ + DHC_RELEASE, /* releasing lease */ + DHC_RELEASE6, /* releasing lease */ + DHC_START, /* sent when dhclient started OK */ + DHC_ABEND, /* dhclient exited abnormally */ + DHC_END, /* dhclient exited normally */ + DHC_END_OPTIONS, /* last option in subscription sent */ +} NMDHCPState; + +typedef struct { + GObject parent; +} NMDHCPClient; + +typedef struct { + GObjectClass parent; + + /* Methods */ + + /* Given the options table, extract any classless routes, add them to + * the IP4 config and return TRUE if any existed. If a gateway was sent + * as a classless route return that in out_gwaddr. + */ + gboolean (*ip4_process_classless_routes) (NMDHCPClient *self, + GHashTable *options, + NMIP4Config *ip4_config, + guint32 *out_gwaddr); + + GPid (*ip4_start) (NMDHCPClient *self, + NMSettingIP4Config *s_ip4, + guint8 *anycast_addr); + + GPid (*ip6_start) (NMDHCPClient *self, + NMSettingIP6Config *s_ip6, + guint8 *anycast_addr, + gboolean info_only); + + void (*stop) (NMDHCPClient *self); + + /* Signals */ + void (*state_changed) (NMDHCPClient *self, NMDHCPState state); + void (*timeout) (NMDHCPClient *self); + void (*remove) (NMDHCPClient *self); +} NMDHCPClientClass; + +GType nm_dhcp_client_get_type (void); + +GPid nm_dhcp_client_get_pid (NMDHCPClient *self); + +const char *nm_dhcp_client_get_iface (NMDHCPClient *self); + +gboolean nm_dhcp_client_get_ipv6 (NMDHCPClient *self); + +const char *nm_dhcp_client_get_uuid (NMDHCPClient *self); + +gboolean nm_dhcp_client_start_ip4 (NMDHCPClient *self, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr); + +gboolean nm_dhcp_client_start_ip6 (NMDHCPClient *self, + NMSettingIP6Config *s_ip6, + guint8 *dhcp_anycast_addr, + gboolean info_only); + +void nm_dhcp_client_stop (NMDHCPClient *self); + +void nm_dhcp_client_new_options (NMDHCPClient *self, + GHashTable *options, + const char *reason); + +gboolean nm_dhcp_client_foreach_option (NMDHCPClient *self, + GHFunc func, + gpointer user_data); + +NMIP4Config *nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test); + +NMIP6Config *nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test); + +/* Backend helpers */ +void nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name); + +#endif /* NM_DHCP_CLIENT_H */ + diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c new file mode 100644 index 00000000..bb5cd2e8 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -0,0 +1,786 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* nm-dhcp-dhclient.c - dhclient specific hooks for 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, 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) 2005 - 2010 Red Hat, Inc. + */ + +#define _XOPEN_SOURCE +#include +#undef _XOPEN_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "nm-dhcp-dhclient.h" +#include "nm-utils.h" +#include "nm-logging.h" + +G_DEFINE_TYPE (NMDHCPDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT) + +#define NM_DHCP_DHCLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientPrivate)) + +#if defined(TARGET_DEBIAN) || defined(TARGET_SUSE) || defined(TARGET_MANDRIVA) +#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhcp" +#else +#define NM_DHCLIENT_LEASE_DIR LOCALSTATEDIR "/lib/dhclient" +#endif + +#define ACTION_SCRIPT_PATH LIBEXECDIR "/nm-dhcp-client.action" + +typedef struct { + const char *path; + char *conf_file; + char *lease_file; + char *pid_file; +} NMDHCPDhclientPrivate; + +const char * +nm_dhcp_dhclient_get_path (const char *try_first) +{ + static const char *dhclient_paths[] = { + "/sbin/dhclient", + "/usr/sbin/dhclient", + "/usr/pkg/sbin/dhclient", + "/usr/local/sbin/dhclient", + NULL + }; + const char **path = dhclient_paths; + + if (strlen (try_first) && g_file_test (try_first, G_FILE_TEST_EXISTS)) + return try_first; + + while (*path != NULL) { + if (g_file_test (*path, G_FILE_TEST_EXISTS)) + break; + path++; + } + + return *path; +} + +static char * +get_leasefile_for_iface (const char * iface, const char *uuid, gboolean ipv6) +{ + return g_strdup_printf ("%s/dhclient%s-%s-%s.lease", + NM_DHCLIENT_LEASE_DIR, + ipv6 ? "6" : "", + uuid, + iface); +} + +static void +add_lease_option (GHashTable *hash, char *line) +{ + char *spc; + + spc = strchr (line, ' '); + if (!spc) { + nm_log_warn (LOGD_DHCP, "DHCP lease file line '%s' did not contain a space", line); + return; + } + + /* If it's an 'option' line, split at second space */ + if (g_str_has_prefix (line, "option ")) { + spc = strchr (spc + 1, ' '); + if (!spc) { + nm_log_warn (LOGD_DHCP, "DHCP lease file option line '%s' did not contain a second space", + line); + return; + } + } + + /* Split the line at the space */ + *spc = '\0'; + spc++; + + /* Kill the ';' at the end of the line, if any */ + if (*(spc + strlen (spc) - 1) == ';') + *(spc + strlen (spc) - 1) = '\0'; + + /* Treat 'interface' specially */ + if (g_str_has_prefix (line, "interface")) { + if (*(spc) == '"') + spc++; /* Jump past the " */ + if (*(spc + strlen (spc) - 1) == '"') + *(spc + strlen (spc) - 1) = '\0'; /* Kill trailing " */ + } + + g_hash_table_insert (hash, g_strdup (line), g_strdup (spc)); +} + +GSList * +nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid) +{ + GSList *parsed = NULL, *iter, *leases = NULL; + char *contents = NULL; + char *leasefile; + char **line, **split = NULL; + GHashTable *hash = NULL; + + leasefile = get_leasefile_for_iface (iface, uuid, FALSE); + if (!leasefile) + return NULL; + + if (!g_file_test (leasefile, G_FILE_TEST_EXISTS)) + goto out; + + if (!g_file_get_contents (leasefile, &contents, NULL, NULL)) + goto out; + + split = g_strsplit_set (contents, "\n\r", -1); + g_free (contents); + if (!split) + goto out; + + for (line = split; line && *line; line++) { + *line = g_strstrip (*line); + + if (!strcmp (*line, "}")) { + /* Lease ends */ + parsed = g_slist_append (parsed, hash); + hash = NULL; + } else if (!strcmp (*line, "lease {")) { + /* Beginning of a new lease */ + if (hash) { + nm_log_warn (LOGD_DHCP, "DHCP lease file %s malformed; new lease started " + "without ending previous lease", + leasefile); + g_hash_table_destroy (hash); + } + + hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + } else if (strlen (*line)) + add_lease_option (hash, *line); + } + g_strfreev (split); + + /* Check if the last lease in the file was properly ended */ + if (hash) { + nm_log_warn (LOGD_DHCP, "DHCP lease file %s malformed; new lease started " + "without ending previous lease", + leasefile); + g_hash_table_destroy (hash); + hash = NULL; + } + + for (iter = parsed; iter; iter = g_slist_next (iter)) { + NMIP4Config *ip4; + NMIP4Address *addr; + const char *data; + struct in_addr tmp; + guint32 prefix; + struct tm expire; + + hash = iter->data; + + /* Make sure this lease is for the interface we want */ + data = g_hash_table_lookup (hash, "interface"); + if (!data || strcmp (data, iface)) + continue; + + data = g_hash_table_lookup (hash, "expire"); + if (data) { + time_t now_tt; + struct tm *now; + + /* Read lease expiration (in UTC) */ + if (!strptime (data, "%w %Y/%m/%d %H:%M:%S", &expire)) { + nm_log_warn (LOGD_DHCP, "couldn't parse DHCP lease file expire time '%s'", + data); + continue; + } + + now_tt = time (NULL); + now = gmtime(&now_tt); + + /* Ignore this lease if it's already expired */ + if (expire.tm_year < now->tm_year) + continue; + else if (expire.tm_year == now->tm_year) { + if (expire.tm_mon < now->tm_mon) + continue; + else if (expire.tm_mon == now->tm_mon) { + if (expire.tm_mday < now->tm_mday) + continue; + else if (expire.tm_mday == now->tm_mday) { + if (expire.tm_hour < now->tm_hour) + continue; + else if (expire.tm_hour == now->tm_hour) { + if (expire.tm_min < now->tm_min) + continue; + else if (expire.tm_min == now->tm_min) { + if (expire.tm_sec <= now->tm_sec) + continue; + } + } + } + } + } + /* If we get this far, the lease hasn't expired */ + } + + data = g_hash_table_lookup (hash, "fixed-address"); + if (!data) + continue; + + ip4 = nm_ip4_config_new (); + addr = nm_ip4_address_new (); + + /* IP4 address */ + if (!inet_pton (AF_INET, data, &tmp)) { + nm_log_warn (LOGD_DHCP, "couldn't parse DHCP lease file IP4 address '%s'", data); + goto error; + } + nm_ip4_address_set_address (addr, tmp.s_addr); + + /* Netmask */ + data = g_hash_table_lookup (hash, "option subnet-mask"); + if (data) { + if (!inet_pton (AF_INET, data, &tmp)) { + nm_log_warn (LOGD_DHCP, "couldn't parse DHCP lease file IP4 subnet mask '%s'", data); + goto error; + } + prefix = nm_utils_ip4_netmask_to_prefix (tmp.s_addr); + } else { + /* Get default netmask for the IP according to appropriate class. */ + prefix = nm_utils_ip4_get_default_prefix (nm_ip4_address_get_address (addr)); + } + nm_ip4_address_set_prefix (addr, prefix); + + /* Gateway */ + data = g_hash_table_lookup (hash, "option routers"); + if (data) { + if (!inet_pton (AF_INET, data, &tmp)) { + nm_log_warn (LOGD_DHCP, "couldn't parse DHCP lease file IP4 gateway '%s'", data); + goto error; + } + nm_ip4_address_set_gateway (addr, tmp.s_addr); + } + + nm_ip4_config_take_address (ip4, addr); + leases = g_slist_append (leases, ip4); + continue; + + error: + nm_ip4_address_unref (addr); + g_object_unref (ip4); + } + +out: + g_slist_foreach (parsed, (GFunc) g_hash_table_destroy, NULL); + g_free (leasefile); + return leases; +} + + +#define DHCP_CLIENT_ID_TAG "send dhcp-client-identifier" +#define DHCP_CLIENT_ID_FORMAT DHCP_CLIENT_ID_TAG " \"%s\"; # added by NetworkManager" +#define DHCP_CLIENT_ID_FORMAT_OCTETS DHCP_CLIENT_ID_TAG " %s; # added by NetworkManager" + +#define DHCP_HOSTNAME_TAG "send host-name" +#define DHCP_HOSTNAME_FORMAT DHCP_HOSTNAME_TAG " \"%s\"; # added by NetworkManager" + +static gboolean +merge_dhclient_config (const char *iface, + const char *conf_file, + NMSettingIP4Config *s_ip4, + guint8 *anycast_addr, + const char *orig_path, + GError **error) +{ + GString *new_contents; + char *orig_contents = NULL; + gboolean success = FALSE; + + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (conf_file != NULL, FALSE); + + new_contents = g_string_new (_("# Created by NetworkManager\n")); + + if (g_file_test (orig_path, G_FILE_TEST_EXISTS)) { + GError *read_error = NULL; + + if (!g_file_get_contents (orig_path, &orig_contents, NULL, &read_error)) { + nm_log_warn (LOGD_DHCP, "(%s): error reading dhclient configuration %s: %s", + iface, orig_path, read_error->message); + g_error_free (read_error); + } + } + + /* Add existing options, if any, but ignore stuff NM will replace. */ + if (orig_contents) { + char **lines = NULL, **line; + + g_string_append_printf (new_contents, _("# Merged from %s\n\n"), orig_path); + + lines = g_strsplit_set (orig_contents, "\n\r", 0); + for (line = lines; lines && *line; line++) { + gboolean ignore = FALSE; + + if (!strlen (g_strstrip (*line))) + continue; + + if ( s_ip4 + && nm_setting_ip4_config_get_dhcp_client_id (s_ip4) + && !strncmp (*line, DHCP_CLIENT_ID_TAG, strlen (DHCP_CLIENT_ID_TAG))) + ignore = TRUE; + + if ( s_ip4 + && nm_setting_ip4_config_get_dhcp_hostname (s_ip4) + && !strncmp (*line, DHCP_HOSTNAME_TAG, strlen (DHCP_HOSTNAME_TAG))) + ignore = TRUE; + + if (!ignore) { + g_string_append (new_contents, *line); + g_string_append_c (new_contents, '\n'); + } + } + + if (lines) + g_strfreev (lines); + g_free (orig_contents); + } else + g_string_append_c (new_contents, '\n'); + + /* Add NM options from connection */ + if (s_ip4) { + const char *tmp; + + tmp = nm_setting_ip4_config_get_dhcp_client_id (s_ip4); + if (tmp) { + gboolean is_octets = TRUE; + const char *p = tmp; + + while (*p) { + if (!isxdigit (*p) && (*p != ':')) { + is_octets = FALSE; + break; + } + p++; + } + + /* If the client ID is just hex digits and : then don't use quotes, + * becuase dhclient expects either a quoted ASCII string, or a byte + * array formated as hex octets separated by : + */ + if (is_octets) + g_string_append_printf (new_contents, DHCP_CLIENT_ID_FORMAT_OCTETS "\n", tmp); + else + g_string_append_printf (new_contents, DHCP_CLIENT_ID_FORMAT "\n", tmp); + } + + tmp = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); + if (tmp) + g_string_append_printf (new_contents, DHCP_HOSTNAME_FORMAT "\n", tmp); + } + + if (anycast_addr) { + g_string_append_printf (new_contents, "interface \"%s\" {\n" + " initial-interval 1; \n" + " anycast-mac ethernet %02x:%02x:%02x:%02x:%02x:%02x;\n" + "}\n", + iface, + anycast_addr[0], anycast_addr[1], + anycast_addr[2], anycast_addr[3], + anycast_addr[4], anycast_addr[5]); + } + + success = g_file_set_contents (conf_file, new_contents->str, -1, error); + + g_string_free (new_contents, TRUE); + return success; +} + +/* NM provides interface-specific options; thus the same dhclient config + * file cannot be used since DHCP transactions can happen in parallel. + * Since some distros don't have default per-interface dhclient config files, + * read their single config file and merge that into a custom per-interface + * config file along with the NM options. + */ +static char * +create_dhclient_config (const char *iface, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) +{ + char *orig = NULL, *tmp, *conf_file = NULL; + GError *error = NULL; + gboolean success = FALSE; + + g_return_val_if_fail (iface != NULL, FALSE); + +#if defined(TARGET_SUSE) + orig = g_strdup (SYSCONFDIR "/dhclient.conf"); +#elif defined(TARGET_DEBIAN) || defined(TARGET_GENTOO) + orig = g_strdup (SYSCONFDIR "/dhcp/dhclient.conf"); +#else + orig = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", iface); +#endif + + if (!orig) { + nm_log_warn (LOGD_DHCP, "(%s): not enough memory for dhclient options.", iface); + return FALSE; + } + +#if !defined(TARGET_SUSE) && !defined(TARGET_DEBIAN) && !defined(TARGET_GENTOO) + /* Try /etc/dhcp/ too (rh #607759) */ + if (!g_file_test (orig, G_FILE_TEST_EXISTS)) { + g_free (orig); + orig = g_strdup_printf (SYSCONFDIR "/dhcp/dhclient-%s.conf", iface); + if (!orig) { + nm_log_warn (LOGD_DHCP, "(%s): not enough memory for dhclient options.", iface); + return FALSE; + } + } +#endif + + tmp = g_strdup_printf ("nm-dhclient-%s.conf", iface); + conf_file = g_build_filename ("/var", "run", tmp, NULL); + g_free (tmp); + + error = NULL; + success = merge_dhclient_config (iface, conf_file, s_ip4, dhcp_anycast_addr, orig, &error); + if (!success) { + nm_log_warn (LOGD_DHCP, "(%s): error creating dhclient configuration: %s", + iface, error->message); + g_error_free (error); + } + + g_free (orig); + return conf_file; +} + + +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); +} + +static GPid +dhclient_start (NMDHCPClient *client, + const char *ip_opt, + const char *mode_opt) +{ + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); + GPtrArray *argv = NULL; + GPid pid = -1; + GError *error = NULL; + const char *iface, *uuid; + char *binary_name, *cmd_str; + gboolean ipv6; + guint log_domain; + + g_return_val_if_fail (priv->pid_file == NULL, -1); + g_return_val_if_fail (ip_opt != NULL, -1); + + iface = nm_dhcp_client_get_iface (client); + uuid = nm_dhcp_client_get_uuid (client); + ipv6 = nm_dhcp_client_get_ipv6 (client); + + log_domain = ipv6 ? LOGD_DHCP6 : LOGD_DHCP4; + + priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhclient%s-%s.pid", + ipv6 ? "6" : "", + iface); + if (!priv->pid_file) { + nm_log_warn (log_domain, "(%s): not enough memory for dhcpcd options.", iface); + return -1; + } + + if (!g_file_test (priv->path, G_FILE_TEST_EXISTS)) { + nm_log_warn (log_domain, "%s does not exist.", priv->path); + return -1; + } + + /* Kill any existing dhclient from the pidfile */ + binary_name = g_path_get_basename (priv->path); + nm_dhcp_client_stop_existing (priv->pid_file, binary_name); + g_free (binary_name); + + priv->lease_file = get_leasefile_for_iface (iface, uuid, ipv6); + if (!priv->lease_file) { + nm_log_warn (log_domain, "(%s): not enough memory for dhclient options.", iface); + return -1; + } + + argv = g_ptr_array_new (); + g_ptr_array_add (argv, (gpointer) priv->path); + + g_ptr_array_add (argv, (gpointer) "-d"); + + g_ptr_array_add (argv, (gpointer) ip_opt); + + if (mode_opt) + g_ptr_array_add (argv, (gpointer) mode_opt); + + g_ptr_array_add (argv, (gpointer) "-sf"); /* Set script file */ + g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); + + g_ptr_array_add (argv, (gpointer) "-pf"); /* Set pid file */ + g_ptr_array_add (argv, (gpointer) priv->pid_file); + + g_ptr_array_add (argv, (gpointer) "-lf"); /* Set lease file */ + g_ptr_array_add (argv, (gpointer) priv->lease_file); + + if (priv->conf_file) { + g_ptr_array_add (argv, (gpointer) "-cf"); /* Set interface config file */ + g_ptr_array_add (argv, (gpointer) priv->conf_file); + } + + g_ptr_array_add (argv, (gpointer) iface); + g_ptr_array_add (argv, NULL); + + cmd_str = g_strjoinv (" ", (gchar **) argv->pdata); + nm_log_dbg (log_domain, "running: %s", cmd_str); + g_free (cmd_str); + + if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, + &dhclient_child_setup, NULL, &pid, &error)) { + nm_log_warn (log_domain, "dhclient failed to start: '%s'", error->message); + g_error_free (error); + pid = -1; + } else + nm_log_info (log_domain, "dhclient started with pid %d", pid); + + g_ptr_array_free (argv, TRUE); + return pid; +} + +static GPid +real_ip4_start (NMDHCPClient *client, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) +{ + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); + const char *iface; + + iface = nm_dhcp_client_get_iface (client); + + priv->conf_file = create_dhclient_config (iface, s_ip4, dhcp_anycast_addr); + if (!priv->conf_file) { + nm_log_warn (LOGD_DHCP4, "(%s): error creating dhclient configuration file.", iface); + return -1; + } + + return dhclient_start (client, "-4", NULL); +} + +static GPid +real_ip6_start (NMDHCPClient *client, + NMSettingIP6Config *s_ip6, + guint8 *dhcp_anycast_addr, + gboolean info_only) +{ + return dhclient_start (client, "-6", info_only ? "-S" : "-N"); +} + +static void +real_stop (NMDHCPClient *client) +{ + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client); + + /* Chain up to parent */ + NM_DHCP_CLIENT_CLASS (nm_dhcp_dhclient_parent_class)->stop (client); + + if (priv->conf_file) + remove (priv->conf_file); + if (priv->pid_file) + remove (priv->pid_file); +} + +static const char ** +process_rfc3442_route (const char **octets, NMIP4Route **out_route) +{ + const char **o = octets; + int addr_len = 0, i = 0; + long int tmp; + NMIP4Route *route; + char *next_hop; + struct in_addr tmp_addr; + + if (!*o) + return o; /* no prefix */ + + tmp = strtol (*o, NULL, 10); + if (tmp < 0 || tmp > 32) /* 32 == max IP4 prefix length */ + return o; + + route = nm_ip4_route_new (); + nm_ip4_route_set_prefix (route, (guint32) tmp); + o++; + + if (tmp > 0) + addr_len = ((tmp - 1) / 8) + 1; + + /* ensure there's at least the address + next hop left */ + if (g_strv_length ((char **) o) < addr_len + 4) + goto error; + + if (tmp) { + const char *addr[4] = { "0", "0", "0", "0" }; + char *str_addr; + + for (i = 0; i < addr_len; i++) + addr[i] = *o++; + + str_addr = g_strjoin (".", addr[0], addr[1], addr[2], addr[3], NULL); + if (inet_pton (AF_INET, str_addr, &tmp_addr) <= 0) { + g_free (str_addr); + goto error; + } + tmp_addr.s_addr &= nm_utils_ip4_prefix_to_netmask ((guint32) tmp); + nm_ip4_route_set_dest (route, tmp_addr.s_addr); + } + + /* Handle next hop */ + next_hop = g_strjoin (".", o[0], o[1], o[2], o[3], NULL); + if (inet_pton (AF_INET, next_hop, &tmp_addr) <= 0) { + g_free (next_hop); + goto error; + } + nm_ip4_route_set_next_hop (route, tmp_addr.s_addr); + g_free (next_hop); + + *out_route = route; + return o + 4; /* advance to past the next hop */ + +error: + nm_ip4_route_unref (route); + return o; +} + +static gboolean +real_ip4_process_classless_routes (NMDHCPClient *client, + GHashTable *options, + NMIP4Config *ip4_config, + guint32 *gwaddr) +{ + const char *str; + char **octets, **o; + gboolean have_routes = FALSE; + NMIP4Route *route = NULL; + + /* dhclient doesn't have actual support for rfc3442 classless static routes + * upstream. Thus, people resort to defining the option in dhclient.conf + * and using arbitrary formats like so: + * + * option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; + * + * See https://lists.isc.org/pipermail/dhcp-users/2008-December/007629.html + */ + + str = g_hash_table_lookup (options, "new_rfc3442_classless_static_routes"); + /* Microsoft version; same as rfc3442 but with a different option # (249) */ + if (!str) + str = g_hash_table_lookup (options, "new_ms_classless_static_routes"); + + if (!str || !strlen (str)) + return FALSE; + + o = octets = g_strsplit (str, " ", 0); + if (g_strv_length (octets) < 5) { + nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes '%s'", str); + goto out; + } + + while (*o) { + route = NULL; + o = (char **) process_rfc3442_route ((const char **) o, &route); + if (!route) { + nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes"); + break; + } + + have_routes = TRUE; + if (nm_ip4_route_get_prefix (route) == 0) { + /* gateway passed as classless static route */ + *gwaddr = nm_ip4_route_get_next_hop (route); + nm_ip4_route_unref (route); + } else { + char addr[INET_ADDRSTRLEN + 1]; + char nh[INET_ADDRSTRLEN + 1]; + struct in_addr tmp; + + /* normal route */ + nm_ip4_config_take_route (ip4_config, route); + + tmp.s_addr = nm_ip4_route_get_dest (route); + inet_ntop (AF_INET, &tmp, addr, sizeof (addr)); + tmp.s_addr = nm_ip4_route_get_next_hop (route); + inet_ntop (AF_INET, &tmp, nh, sizeof (nh)); + nm_log_info (LOGD_DHCP4, " classless static route %s/%d gw %s", + addr, nm_ip4_route_get_prefix (route), nh); + } + } + +out: + g_strfreev (octets); + return have_routes; +} + +/***************************************************/ + +static void +nm_dhcp_dhclient_init (NMDHCPDhclient *self) +{ + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (self); + + priv->path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH); +} + +static void +dispose (GObject *object) +{ + NMDHCPDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (object); + + g_free (priv->pid_file); + g_free (priv->conf_file); + g_free (priv->lease_file); + + G_OBJECT_CLASS (nm_dhcp_dhclient_parent_class)->dispose (object); +} + +static void +nm_dhcp_dhclient_class_init (NMDHCPDhclientClass *dhclient_class) +{ + NMDHCPClientClass *client_class = NM_DHCP_CLIENT_CLASS (dhclient_class); + GObjectClass *object_class = G_OBJECT_CLASS (dhclient_class); + + g_type_class_add_private (dhclient_class, sizeof (NMDHCPDhclientPrivate)); + + /* virtual methods */ + object_class->dispose = dispose; + + client_class->ip4_start = real_ip4_start; + client_class->ip6_start = real_ip6_start; + client_class->stop = real_stop; + client_class->ip4_process_classless_routes = real_ip4_process_classless_routes; +} + diff --git a/src/dhcp-manager/nm-dhcp-dhclient.h b/src/dhcp-manager/nm-dhcp-dhclient.h new file mode 100644 index 00000000..be242de0 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-dhclient.h @@ -0,0 +1,49 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + */ + +#ifndef NM_DHCP_DHCLIENT_H +#define NM_DHCP_DHCLIENT_H + +#include +#include + +#include "nm-dhcp-client.h" + +#define NM_TYPE_DHCP_DHCLIENT (nm_dhcp_dhclient_get_type ()) +#define NM_DHCP_DHCLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclient)) +#define NM_DHCP_DHCLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientClass)) +#define NM_IS_DHCP_DHCLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_DHCLIENT)) +#define NM_IS_DHCP_DHCLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP_DHCLIENT)) +#define NM_DHCP_DHCLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_DHCLIENT, NMDHCPDhclientClass)) + +typedef struct { + NMDHCPClient parent; +} NMDHCPDhclient; + +typedef struct { + NMDHCPClientClass parent; +} NMDHCPDhclientClass; + +GType nm_dhcp_dhclient_get_type (void); + +GSList *nm_dhcp_dhclient_get_lease_config (const char *iface, const char *uuid); + +const char *nm_dhcp_dhclient_get_path (const char *try_first); + +#endif /* NM_DHCP_DHCLIENT_H */ + diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c new file mode 100644 index 00000000..403431fc --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -0,0 +1,294 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* nm-dhcp-dhcpcd.c - dhcpcd specific hooks for NetworkManager + * + * Copyright (C) 2008 Roy Marples + * Copyright (C) 2010 Dan Williams + * + * 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. + * + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-dhcp-dhcpcd.h" +#include "nm-utils.h" +#include "nm-logging.h" + +G_DEFINE_TYPE (NMDHCPDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_CLIENT) + +#define NM_DHCP_DHCPCD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcdPrivate)) + +#define ACTION_SCRIPT_PATH LIBEXECDIR "/nm-dhcp-client.action" + +typedef struct { + const char *path; + char *pid_file; +} NMDHCPDhcpcdPrivate; + +const char * +nm_dhcp_dhcpcd_get_path (const char *try_first) +{ + static const char *dhcpcd_paths[] = { + "/sbin/dhcpcd", + "/usr/sbin/dhcpcd", + "/usr/pkg/sbin/dhcpcd", + "/usr/local/sbin/dhcpcd", + NULL + }; + const char **path = dhcpcd_paths; + + if (strlen (try_first) && g_file_test (try_first, G_FILE_TEST_EXISTS)) + return try_first; + + while (*path != NULL) { + if (g_file_test (*path, G_FILE_TEST_EXISTS)) + break; + path++; + } + + return *path; +} + +GSList * +nm_dhcp_dhcpcd_get_lease_config (const char *iface, const char *uuid) +{ + return NULL; +} + +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); +} + +static GPid +real_ip4_start (NMDHCPClient *client, + NMSettingIP4Config *s_ip4, + guint8 *dhcp_anycast_addr) +{ + NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (client); + GPtrArray *argv = NULL; + GPid pid = -1; + GError *error = NULL; + char *pid_contents = NULL, *binary_name, *cmd_str; + const char *iface, *uuid, *hostname; + + g_return_val_if_fail (priv->pid_file == NULL, -1); + + iface = nm_dhcp_client_get_iface (client); + uuid = nm_dhcp_client_get_uuid (client); + + priv->pid_file = g_strdup_printf (LOCALSTATEDIR "/run/dhcpcd-%s.pid", iface); + if (!priv->pid_file) { + nm_log_warn (LOGD_DHCP4, "(%s): not enough memory for dhcpcd options.", iface); + return -1; + } + + if (!g_file_test (priv->path, G_FILE_TEST_EXISTS)) { + nm_log_warn (LOGD_DHCP4, "%s does not exist.", priv->path); + return -1; + } + + /* Kill any existing dhcpcd from the pidfile */ + binary_name = g_path_get_basename (priv->path); + nm_dhcp_client_stop_existing (priv->pid_file, binary_name); + g_free (binary_name); + + argv = g_ptr_array_new (); + g_ptr_array_add (argv, (gpointer) priv->path); + + g_ptr_array_add (argv, (gpointer) "-B"); /* Don't background on lease (disable fork()) */ + + g_ptr_array_add (argv, (gpointer) "-K"); /* Disable built-in carrier detection */ + + g_ptr_array_add (argv, (gpointer) "-L"); /* Disable built-in IPv4LL since we use avahi-autoipd */ + + g_ptr_array_add (argv, (gpointer) "-c"); /* Set script file */ + g_ptr_array_add (argv, (gpointer) ACTION_SCRIPT_PATH ); + + hostname = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); + if (hostname && strlen (hostname)) { + g_ptr_array_add (argv, (gpointer) "-h"); /* Send hostname to DHCP server */ + g_ptr_array_add (argv, (gpointer) hostname ); + } + + g_ptr_array_add (argv, (gpointer) iface); + g_ptr_array_add (argv, NULL); + + cmd_str = g_strjoinv (" ", (gchar **) argv->pdata); + nm_log_dbg (LOGD_DHCP4, "running: %s", cmd_str); + g_free (cmd_str); + + if (!g_spawn_async (NULL, (char **) argv->pdata, NULL, G_SPAWN_DO_NOT_REAP_CHILD, + &dhcpcd_child_setup, NULL, &pid, &error)) { + nm_log_warn (LOGD_DHCP4, "dhcpcd failed to start. error: '%s'", error->message); + g_error_free (error); + pid = -1; + } else + nm_log_info (LOGD_DHCP4, "dhcpcd started with pid %d", pid); + + g_free (pid_contents); + g_ptr_array_free (argv, TRUE); + return pid; +} + +static GPid +real_ip6_start (NMDHCPClient *client, + NMSettingIP6Config *s_ip6, + guint8 *dhcp_anycast_addr, + gboolean info_only) +{ + nm_log_warn (LOGD_DHCP6, "the dhcpcd backend does not support IPv6."); + return -1; +} + +static void +real_stop (NMDHCPClient *client) +{ + NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (client); + + /* Chain up to parent */ + NM_DHCP_CLIENT_CLASS (nm_dhcp_dhcpcd_parent_class)->stop (client); + + if (priv->pid_file) + remove (priv->pid_file); +} + +static gboolean +real_ip4_process_classless_routes (NMDHCPClient *client, + GHashTable *options, + NMIP4Config *ip4_config, + guint32 *gwaddr) +{ + const char *str; + char **routes, **r; + gboolean have_routes = FALSE; + + /* Classless static routes over-ride any static routes and routers + * provided. We should also check for MS classless static routes as + * they implemented the draft RFC using their own code. + */ + str = g_hash_table_lookup (options, "new_classless_static_routes"); + if (!str) + str = g_hash_table_lookup (options, "new_ms_classless_static_routes"); + + if (!str || !strlen (str)) + return FALSE; + + routes = g_strsplit (str, " ", 0); + if (g_strv_length (routes) == 0) + goto out; + + if ((g_strv_length (routes) % 2) != 0) { + nm_log_warn (LOGD_DHCP4, " classless static routes provided, but invalid"); + goto out; + } + + for (r = routes; *r; r += 2) { + char *slash; + NMIP4Route *route; + int rt_cidr = 32; + struct in_addr rt_addr; + struct in_addr rt_route; + + slash = strchr(*r, '/'); + if (slash) { + *slash = '\0'; + errno = 0; + rt_cidr = strtol (slash + 1, NULL, 10); + if ((errno == EINVAL) || (errno == ERANGE)) { + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route cidr: '%s'", slash + 1); + continue; + } + } + if (inet_pton (AF_INET, *r, &rt_addr) <= 0) { + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route address: '%s'", *r); + continue; + } + if (inet_pton (AF_INET, *(r + 1), &rt_route) <= 0) { + nm_log_warn (LOGD_DHCP4, "DHCP provided invalid classless static route gateway: '%s'", *(r + 1)); + continue; + } + + have_routes = TRUE; + if (rt_cidr == 0 && rt_addr.s_addr == 0) { + /* FIXME: how to handle multiple routers? */ + *gwaddr = rt_addr.s_addr; + } else { + route = nm_ip4_route_new (); + nm_ip4_route_set_dest (route, (guint32) rt_addr.s_addr); + nm_ip4_route_set_prefix (route, rt_cidr); + nm_ip4_route_set_next_hop (route, (guint32) rt_route.s_addr); + + + nm_ip4_config_take_route (ip4_config, route); + nm_log_info (LOGD_DHCP4, " classless static route %s/%d gw %s", *r, rt_cidr, *(r + 1)); + } + } + +out: + g_strfreev (routes); + return have_routes; +} + +/***************************************************/ + +static void +nm_dhcp_dhcpcd_init (NMDHCPDhcpcd *self) +{ + NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (self); + + priv->path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH); +} + +static void +dispose (GObject *object) +{ + NMDHCPDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (object); + + g_free (priv->pid_file); + + G_OBJECT_CLASS (nm_dhcp_dhcpcd_parent_class)->dispose (object); +} + +static void +nm_dhcp_dhcpcd_class_init (NMDHCPDhcpcdClass *dhcpcd_class) +{ + NMDHCPClientClass *client_class = NM_DHCP_CLIENT_CLASS (dhcpcd_class); + GObjectClass *object_class = G_OBJECT_CLASS (dhcpcd_class); + + g_type_class_add_private (dhcpcd_class, sizeof (NMDHCPDhcpcdPrivate)); + + /* virtual methods */ + object_class->dispose = dispose; + + client_class->ip4_start = real_ip4_start; + client_class->ip6_start = real_ip6_start; + client_class->stop = real_stop; + client_class->ip4_process_classless_routes = real_ip4_process_classless_routes; +} + diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.h b/src/dhcp-manager/nm-dhcp-dhcpcd.h new file mode 100644 index 00000000..586c5697 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.h @@ -0,0 +1,49 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + */ + +#ifndef NM_DHCP_DHCPCD_H +#define NM_DHCP_DHCPCD_H + +#include +#include + +#include "nm-dhcp-client.h" + +#define NM_TYPE_DHCP_DHCPCD (nm_dhcp_dhcpcd_get_type ()) +#define NM_DHCP_DHCPCD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcd)) +#define NM_DHCP_DHCPCD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcdClass)) +#define NM_IS_DHCP_DHCPCD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_DHCPCD)) +#define NM_IS_DHCP_DHCPCD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP_DHCPCD)) +#define NM_DHCP_DHCPCD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_DHCPCD, NMDHCPDhcpcdClass)) + +typedef struct { + NMDHCPClient parent; +} NMDHCPDhcpcd; + +typedef struct { + NMDHCPClientClass parent; +} NMDHCPDhcpcdClass; + +GType nm_dhcp_dhcpcd_get_type (void); + +GSList *nm_dhcp_dhcpcd_get_lease_config (const char *iface, const char *uuid); + +const char *nm_dhcp_dhcpcd_get_path (const char *try_first); + +#endif /* NM_DHCP_DHCPCD_H */ + diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c new file mode 100644 index 00000000..7b110fb2 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-manager.c @@ -0,0 +1,647 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* nm-dhcp-manager.c - Handle the DHCP daemon for 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, 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + * + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-dhcp-manager.h" +#include "nm-dhcp-dhclient.h" +#include "nm-dhcp-dhcpcd.h" +#include "nm-marshal.h" +#include "nm-logging.h" +#include "nm-dbus-manager.h" +#include "nm-hostname-provider.h" +#include "nm-dbus-glib-types.h" +#include "nm-glib-compat.h" + +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GQuark +nm_dhcp_manager_error_quark (void) +{ + static GQuark ret = 0; + + if (ret == 0) + ret = g_quark_from_static_string ("nm_dhcp_manager_error"); + + return ret; +} + +GType +nm_dhcp_manager_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_DHCP_MANAGER_ERROR_BAD_CLIENT, "BadClient"), + ENUM_ENTRY (NM_DHCP_MANAGER_ERROR_INTERNAL, "InternalError"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMDhcpManagerError", values); + } + return etype; +} + +#define NM_DHCP_CLIENT_DBUS_SERVICE "org.freedesktop.nm_dhcp_client" +#define NM_DHCP_CLIENT_DBUS_IFACE "org.freedesktop.nm_dhcp_client" + +#define DHCP_TIMEOUT 45 /* default DHCP timeout, in seconds */ + +static NMDHCPManager *singleton = NULL; + +typedef GSList * (*GetLeaseConfigFunc) (const char *iface, const char *uuid); + +typedef struct { + GType client_type; + GetLeaseConfigFunc get_lease_config_func; + + NMDBusManager * dbus_mgr; + GHashTable * clients; + DBusGProxy * proxy; + NMHostnameProvider *hostname_provider; +} 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) +{ + 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 NMDHCPClient * +get_client_for_pid (NMDHCPManager *manager, GPid pid) +{ + NMDHCPManagerPrivate *priv; + GHashTableIter iter; + gpointer value; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); + + priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + + g_hash_table_iter_init (&iter, priv->clients); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + NMDHCPClient *candidate = NM_DHCP_CLIENT (value); + + if (nm_dhcp_client_get_pid (candidate) == pid) + return candidate; + } + + return NULL; +} + +static NMDHCPClient * +get_client_for_iface (NMDHCPManager *manager, + const char *iface, + gboolean ip6) +{ + NMDHCPManagerPrivate *priv; + GHashTableIter iter; + gpointer value; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); + g_return_val_if_fail (iface, NULL); + + priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + + g_hash_table_iter_init (&iter, priv->clients); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + NMDHCPClient *candidate = NM_DHCP_CLIENT (value); + + if ( !strcmp (iface, nm_dhcp_client_get_iface (candidate)) + && (nm_dhcp_client_get_ipv6 (candidate) == ip6)) + return candidate; + } + + 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; + NMDHCPManagerPrivate *priv; + NMDHCPClient *client; + char *iface = NULL; + char *pid_str = NULL; + char *reason = NULL; + unsigned long temp; + + manager = NM_DHCP_MANAGER (user_data); + priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + + 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"); + if (pid_str == NULL) { + nm_log_warn (LOGD_DHCP, "DHCP event didn't have associated PID."); + goto out; + } + + temp = strtoul (pid_str, NULL, 10); + if ((temp == ULONG_MAX) && (errno == ERANGE)) { + nm_log_warn (LOGD_DHCP, "couldn't convert PID"); + goto out; + } + + client = get_client_for_pid (manager, (GPid) temp); + if (client == NULL) { + nm_log_warn (LOGD_DHCP, "(pid %d) unhandled DHCP event for interface %s", temp, iface); + goto out; + } + + if (strcmp (iface, nm_dhcp_client_get_iface (client))) { + nm_log_warn (LOGD_DHCP, "(pid %d) received DHCP event from unexpected interface '%s' (expected '%s')", + temp, iface, nm_dhcp_client_get_iface (client)); + goto out; + } + + reason = get_option (options, "reason"); + if (reason == NULL) { + nm_log_warn (LOGD_DHCP, "(pid %d) DHCP event didn't have a reason", temp); + goto out; + } + + nm_dhcp_client_new_options (client, options, reason); + +out: + g_free (iface); + g_free (pid_str); + g_free (reason); +} + +static GType +get_client_type (const char *client, GError **error) +{ + const char *dhclient_path = NULL; + const char *dhcpcd_path = NULL; + + dhclient_path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH); + dhcpcd_path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH); + + if (!client) { + if (dhclient_path) + return NM_TYPE_DHCP_DHCLIENT; + else if (dhcpcd_path) + return NM_TYPE_DHCP_DHCPCD; + else { + g_set_error_literal (error, + NM_DHCP_MANAGER_ERROR, NM_DHCP_MANAGER_ERROR_BAD_CLIENT, + _("no usable DHCP client could be found.")); + return 0; + } + } + + if (!strcmp (client, "dhclient")) { + if (!dhclient_path) { + g_set_error_literal (error, + NM_DHCP_MANAGER_ERROR, NM_DHCP_MANAGER_ERROR_BAD_CLIENT, + _("'dhclient' could be found.")); + return 0; + } + return NM_TYPE_DHCP_DHCLIENT; + } + + if (!strcmp (client, "dhcpcd")) { + if (!dhcpcd_path) { + g_set_error_literal (error, + NM_DHCP_MANAGER_ERROR, NM_DHCP_MANAGER_ERROR_BAD_CLIENT, + _("'dhcpcd' could be found.")); + return 0; + } + return NM_TYPE_DHCP_DHCPCD; + } + + g_set_error (error, + NM_DHCP_MANAGER_ERROR, NM_DHCP_MANAGER_ERROR_BAD_CLIENT, + _("unsupported DHCP client '%s'"), client); + return 0; +} + +NMDHCPManager * +nm_dhcp_manager_new (const char *client, GError **error) +{ + NMDHCPManagerPrivate *priv; + DBusGConnection *g_connection; + GType client_type; + + client_type = get_client_type (client, error); + if (!client_type) + return NULL; + + g_warn_if_fail (singleton == NULL); + + singleton = g_object_new (NM_TYPE_DHCP_MANAGER, NULL); + priv = NM_DHCP_MANAGER_GET_PRIVATE (singleton); + + /* Client-specific setup */ + priv->client_type = client_type; + if (priv->client_type == NM_TYPE_DHCP_DHCLIENT) + priv->get_lease_config_func = nm_dhcp_dhclient_get_lease_config; + else if (priv->client_type == NM_TYPE_DHCP_DHCPCD) + priv->get_lease_config_func = nm_dhcp_dhcpcd_get_lease_config; + else + g_assert_not_reached (); + + 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 (); + g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + priv->proxy = dbus_g_proxy_new_for_name (g_connection, + NM_DHCP_CLIENT_DBUS_SERVICE, + "/", + 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), + singleton, + NULL); + + return singleton; +} + +#define REMOVE_ID_TAG "remove-id" +#define TIMEOUT_ID_TAG "timeout-id" + +static void +remove_client (NMDHCPManager *self, NMDHCPClient *client) +{ + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self); + guint id; + + id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (client), REMOVE_ID_TAG)); + if (id) + g_signal_handler_disconnect (client, id); + + id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (client), TIMEOUT_ID_TAG)); + if (id) + g_signal_handler_disconnect (client, id); + + /* Stopping the client is left up to the controlling device + * explicitly since we may want to quit NetworkManager but not terminate + * the DHCP client. + */ + + g_hash_table_remove (priv->clients, client); +} + +static void +add_client (NMDHCPManager *self, NMDHCPClient *client) +{ + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self); + guint id; + + id = g_signal_connect_swapped (client, "remove", G_CALLBACK (remove_client), self); + g_object_set_data (G_OBJECT (client), REMOVE_ID_TAG, GUINT_TO_POINTER (id)); + + id = g_signal_connect_swapped (client, "timeout", G_CALLBACK (remove_client), self); + g_object_set_data (G_OBJECT (client), TIMEOUT_ID_TAG, GUINT_TO_POINTER (id)); + + g_hash_table_insert (priv->clients, client, g_object_ref (client)); +} + +static NMDHCPClient * +client_start (NMDHCPManager *self, + const char *iface, + const char *uuid, + gboolean ipv6, + NMSettingIP4Config *s_ip4, + NMSettingIP6Config *s_ip6, + guint32 timeout, + guint8 *dhcp_anycast_addr, + gboolean info_only) +{ + NMDHCPManagerPrivate *priv; + NMDHCPClient *client; + gboolean success = FALSE; + + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); + g_return_val_if_fail (iface != NULL, NULL); + g_return_val_if_fail (uuid != NULL, NULL); + + priv = NM_DHCP_MANAGER_GET_PRIVATE (self); + + /* Kill any old client instance */ + client = get_client_for_iface (self, iface, ipv6); + if (client) { + nm_dhcp_client_stop (client); + remove_client (self, client); + } + + /* And make a new one */ + client = g_object_new (priv->client_type, + NM_DHCP_CLIENT_INTERFACE, iface, + NM_DHCP_CLIENT_IPV6, ipv6, + NM_DHCP_CLIENT_UUID, uuid, + NM_DHCP_CLIENT_TIMEOUT, timeout ? timeout : DHCP_TIMEOUT, + NULL); + g_return_val_if_fail (client != NULL, NULL); + add_client (self, client); + + if (ipv6) + success = nm_dhcp_client_start_ip6 (client, s_ip6, dhcp_anycast_addr, info_only); + else + success = nm_dhcp_client_start_ip4 (client, s_ip4, dhcp_anycast_addr); + + if (!success) { + remove_client (self, client); + g_object_unref (client); + client = NULL; + } + + return client; +} + +/* Caller owns a reference to the NMDHCPClient on return */ +NMDHCPClient * +nm_dhcp_manager_start_ip4 (NMDHCPManager *self, + const char *iface, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout, + guint8 *dhcp_anycast_addr) +{ + NMDHCPManagerPrivate *priv; + NMDHCPClient *client = NULL; + + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); + + priv = NM_DHCP_MANAGER_GET_PRIVATE (self); + + if (s_ip4) { + const char *method = nm_setting_ip4_config_get_method (s_ip4); + + if (method) { + /* Method must be 'auto' */ + g_return_val_if_fail (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0, NULL); + } + + if ( nm_setting_ip4_config_get_dhcp_send_hostname (s_ip4) + && (nm_setting_ip4_config_get_dhcp_hostname (s_ip4) == NULL) + && priv->hostname_provider != NULL) { + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_duplicate (NM_SETTING (s_ip4))); + + /* We're asked to send the hostname to DHCP server, the hostname + * isn't specified, and a hostname provider is registered: use that + */ + g_object_set (G_OBJECT (s_ip4), + NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, + nm_hostname_provider_get_hostname (priv->hostname_provider), + NULL); + } else + g_object_ref (s_ip4); + } + + client = client_start (self, iface, uuid, FALSE, s_ip4, NULL, timeout, dhcp_anycast_addr, FALSE); + + if (s_ip4) + g_object_unref (s_ip4); + + return client; +} + +/* Caller owns a reference to the NMDHCPClient on return */ +NMDHCPClient * +nm_dhcp_manager_start_ip6 (NMDHCPManager *self, + const char *iface, + const char *uuid, + NMSettingIP6Config *s_ip6, + guint32 timeout, + guint8 *dhcp_anycast_addr, + gboolean info_only) +{ + return client_start (self, iface, uuid, TRUE, NULL, s_ip6, timeout, dhcp_anycast_addr, info_only); +} + +static void +hostname_provider_destroyed (gpointer data, GObject *destroyed_object) +{ + NM_DHCP_MANAGER_GET_PRIVATE (data)->hostname_provider = NULL; +} + +void +nm_dhcp_manager_set_hostname_provider (NMDHCPManager *manager, + NMHostnameProvider *provider) +{ + NMDHCPManagerPrivate *priv; + + g_return_if_fail (NM_IS_DHCP_MANAGER (manager)); + + priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); + + if (priv->hostname_provider) { + g_object_weak_unref (G_OBJECT (priv->hostname_provider), hostname_provider_destroyed, manager); + priv->hostname_provider = NULL; + } + + if (provider) { + priv->hostname_provider = provider; + g_object_weak_ref (G_OBJECT (provider), hostname_provider_destroyed, manager); + } +} + +GSList * +nm_dhcp_manager_get_lease_config (NMDHCPManager *self, + const char *iface, + const char *uuid) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); + g_return_val_if_fail (iface != NULL, NULL); + g_return_val_if_fail (uuid != NULL, NULL); + + return NM_DHCP_MANAGER_GET_PRIVATE (self)->get_lease_config_func (iface, uuid); +} + +NMIP4Config * +nm_dhcp_manager_test_ip4_options_to_config (const char *dhcp_client, + const char *iface, + GHashTable *options, + const char *reason) +{ + NMDHCPClient *client; + NMIP4Config *config; + GType client_type; + GError *error = NULL; + + client_type = get_client_type (dhcp_client, &error); + if (!client_type) { + nm_log_err (LOGD_DHCP4, "error: %s", error ? error->message : "(unknown)"); + g_clear_error (&error); + return NULL; + } + + client = (NMDHCPClient *) g_object_new (client_type, + NM_DHCP_CLIENT_INTERFACE, iface, + NULL); + g_return_val_if_fail (client != NULL, NULL); + nm_dhcp_client_new_options (client, options, reason); + config = nm_dhcp_client_get_ip4_config (client, TRUE); + g_object_unref (client); + + return config; +} + +/***************************************************/ + +NMDHCPManager * +nm_dhcp_manager_get (void) +{ + g_warn_if_fail (singleton != NULL); + return g_object_ref (singleton); +} + +static void +nm_dhcp_manager_init (NMDHCPManager *manager) +{ +} + +static void +dispose (GObject *object) +{ + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object); + GList *values, *iter; + + if (priv->clients) { + values = g_hash_table_get_values (priv->clients); + for (iter = values; iter; iter = g_list_next (iter)) + remove_client (NM_DHCP_MANAGER (object), NM_DHCP_CLIENT (iter->data)); + g_list_free (values); + } + + G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object); + + if (priv->hostname_provider) { + g_object_weak_unref (G_OBJECT (priv->hostname_provider), hostname_provider_destroyed, object); + priv->hostname_provider = NULL; + } + + if (priv->clients) + g_hash_table_destroy (priv->clients); + if (priv->proxy) + g_object_unref (priv->proxy); + if (priv->dbus_mgr) + g_object_unref (priv->dbus_mgr); + + G_OBJECT_CLASS (nm_dhcp_manager_parent_class)->finalize (object); +} + +static void +nm_dhcp_manager_class_init (NMDHCPManagerClass *manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (manager_class); + + g_type_class_add_private (manager_class, sizeof (NMDHCPManagerPrivate)); + + /* virtual methods */ + object_class->finalize = finalize; + object_class->dispose = dispose; +} + diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h new file mode 100644 index 00000000..9d83d096 --- /dev/null +++ b/src/dhcp-manager/nm-dhcp-manager.h @@ -0,0 +1,98 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* nm-dhcp-manager.c - Handle the DHCP daemon for 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, 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef NM_DHCP_MANAGER_H +#define NM_DHCP_MANAGER_H + +#include +#include + +#include +#include + +#include "nm-dhcp-client.h" +#include "nm-ip4-config.h" +#include "nm-dhcp4-config.h" +#include "nm-hostname-provider.h" + +enum { + NM_DHCP_MANAGER_ERROR_BAD_CLIENT = 0, + NM_DHCP_MANAGER_ERROR_INTERNAL = 1, +}; + +#define NM_DHCP_MANAGER_ERROR (nm_dhcp_manager_error_quark ()) +#define NN_TYPE_DHCP_MANAGER_ERROR (nm_dhcp_manager_error_get_type ()) + +GQuark nm_dhcp_manager_error_quark (void); +GType nm_dhcp_manager_error_get_type (void); + + +#define NM_TYPE_DHCP_MANAGER (nm_dhcp_manager_get_type ()) +#define NM_DHCP_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP_MANAGER, NMDHCPManager)) +#define NM_DHCP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP_MANAGER, NMDHCPManagerClass)) +#define NM_IS_DHCP_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DHCP_MANAGER)) +#define NM_IS_DHCP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DHCP_MANAGER)) +#define NM_DHCP_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_MANAGER, NMDHCPManagerClass)) + +typedef struct { + GObject parent; +} NMDHCPManager; + +typedef struct { + GObjectClass parent; +} NMDHCPManagerClass; + +GType nm_dhcp_manager_get_type (void); + +NMDHCPManager *nm_dhcp_manager_get (void); + +void nm_dhcp_manager_set_hostname_provider(NMDHCPManager *manager, + NMHostnameProvider *provider); + +NMDHCPClient * nm_dhcp_manager_start_ip4 (NMDHCPManager *manager, + const char *iface, + const char *uuid, + NMSettingIP4Config *s_ip4, + guint32 timeout, + guint8 *dhcp_anycast_addr); + +NMDHCPClient * nm_dhcp_manager_start_ip6 (NMDHCPManager *manager, + const char *iface, + const char *uuid, + NMSettingIP6Config *s_ip6, + guint32 timeout, + guint8 *dhcp_anycast_addr, + gboolean info_only); + +GSList * nm_dhcp_manager_get_lease_config (NMDHCPManager *self, + const char *iface, + const char *uuid); + +/* For testing only */ +NMIP4Config *nm_dhcp_manager_test_ip4_options_to_config (const char *dhcp_client, + const char *iface, + GHashTable *options, + const char *reason); + +/* Only for main.c */ +NMDHCPManager *nm_dhcp_manager_new (const char *client, GError **error); + +#endif /* NM_DHCP_MANAGER_H */ diff --git a/src/dnsmasq-manager/Makefile.am b/src/dnsmasq-manager/Makefile.am new file mode 100644 index 00000000..66bbdd83 --- /dev/null +++ b/src/dnsmasq-manager/Makefile.am @@ -0,0 +1,19 @@ +INCLUDES = \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src \ + -I${top_srcdir}/include + +noinst_LTLIBRARIES = libdnsmasq-manager.la + +libdnsmasq_manager_la_SOURCES = \ + nm-dnsmasq-manager.h \ + nm-dnsmasq-manager.c + +libdnsmasq_manager_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DLOCALSTATEDIR=\"$(localstatedir)\" + +libdnsmasq_manager_la_LIBADD = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(GLIB_LIBS) diff --git a/src/dnsmasq-manager/Makefile.in b/src/dnsmasq-manager/Makefile.in new file mode 100644 index 00000000..c71621a8 --- /dev/null +++ b/src/dnsmasq-manager/Makefile.in @@ -0,0 +1,564 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/dnsmasq-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libdnsmasq_manager_la_DEPENDENCIES = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) +am_libdnsmasq_manager_la_OBJECTS = \ + libdnsmasq_manager_la-nm-dnsmasq-manager.lo +libdnsmasq_manager_la_OBJECTS = $(am_libdnsmasq_manager_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libdnsmasq_manager_la_SOURCES) +DIST_SOURCES = $(libdnsmasq_manager_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src \ + -I${top_srcdir}/include + +noinst_LTLIBRARIES = libdnsmasq-manager.la +libdnsmasq_manager_la_SOURCES = \ + nm-dnsmasq-manager.h \ + nm-dnsmasq-manager.c + +libdnsmasq_manager_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DLOCALSTATEDIR=\"$(localstatedir)\" + +libdnsmasq_manager_la_LIBADD = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(GLIB_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/dnsmasq-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/dnsmasq-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libdnsmasq-manager.la: $(libdnsmasq_manager_la_OBJECTS) $(libdnsmasq_manager_la_DEPENDENCIES) + $(LINK) $(libdnsmasq_manager_la_OBJECTS) $(libdnsmasq_manager_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdnsmasq_manager_la-nm-dnsmasq-manager.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libdnsmasq_manager_la-nm-dnsmasq-manager.lo: nm-dnsmasq-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdnsmasq_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdnsmasq_manager_la-nm-dnsmasq-manager.lo -MD -MP -MF $(DEPDIR)/libdnsmasq_manager_la-nm-dnsmasq-manager.Tpo -c -o libdnsmasq_manager_la-nm-dnsmasq-manager.lo `test -f 'nm-dnsmasq-manager.c' || echo '$(srcdir)/'`nm-dnsmasq-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libdnsmasq_manager_la-nm-dnsmasq-manager.Tpo $(DEPDIR)/libdnsmasq_manager_la-nm-dnsmasq-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-dnsmasq-manager.c' object='libdnsmasq_manager_la-nm-dnsmasq-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdnsmasq_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdnsmasq_manager_la-nm-dnsmasq-manager.lo `test -f 'nm-dnsmasq-manager.c' || echo '$(srcdir)/'`nm-dnsmasq-manager.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.c b/src/dnsmasq-manager/nm-dnsmasq-manager.c new file mode 100644 index 00000000..e6c67a1e --- /dev/null +++ b/src/dnsmasq-manager/nm-dnsmasq-manager.c @@ -0,0 +1,495 @@ +/* -*- 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) 2008 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "nm-dnsmasq-manager.h" +#include "nm-logging.h" +#include "nm-glib-compat.h" + +typedef struct { + char *iface; + char *pidfile; + GPid pid; + guint32 dm_watch_id; +} NMDnsMasqManagerPrivate; + +#define NM_DNSMASQ_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DNSMASQ_MANAGER, NMDnsMasqManagerPrivate)) + +G_DEFINE_TYPE (NMDnsMasqManager, nm_dnsmasq_manager, G_TYPE_OBJECT) + +enum { + STATE_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +typedef enum { + NM_DNSMASQ_MANAGER_ERROR_NOT_FOUND, +} NMDnsMasqManagerError; + +GQuark +nm_dnsmasq_manager_error_quark (void) +{ + static GQuark quark; + + if (!quark) + quark = g_quark_from_static_string ("nm_dnsmasq_manager_error"); + + return quark; +} + +static void +nm_dnsmasq_manager_init (NMDnsMasqManager *manager) +{ +} + +static void +finalize (GObject *object) +{ + NMDnsMasqManagerPrivate *priv = NM_DNSMASQ_MANAGER_GET_PRIVATE (object); + + nm_dnsmasq_manager_stop (NM_DNSMASQ_MANAGER (object)); + + g_free (priv->iface); + g_free (priv->pidfile); + + G_OBJECT_CLASS (nm_dnsmasq_manager_parent_class)->finalize (object); +} + +static void +nm_dnsmasq_manager_class_init (NMDnsMasqManagerClass *manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (manager_class); + + g_type_class_add_private (manager_class, sizeof (NMDnsMasqManagerPrivate)); + + object_class->finalize = finalize; + + /* signals */ + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDnsMasqManagerClass, state_changed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, + G_TYPE_UINT); +} + +NMDnsMasqManager * +nm_dnsmasq_manager_new (const char *iface) +{ + NMDnsMasqManager *manager; + NMDnsMasqManagerPrivate *priv; + + manager = (NMDnsMasqManager *) g_object_new (NM_TYPE_DNSMASQ_MANAGER, NULL); + if (!manager) + return NULL; + + priv = NM_DNSMASQ_MANAGER_GET_PRIVATE (manager); + priv->iface = g_strdup (iface); + priv->pidfile = g_strdup_printf (LOCALSTATEDIR "/run/nm-dnsmasq-%s.pid", iface); + + return manager; +} + +typedef struct { + GPtrArray *array; + GStringChunk *chunk; +} NMCmdLine; + +static NMCmdLine * +nm_cmd_line_new (void) +{ + NMCmdLine *cmd; + + cmd = g_slice_new (NMCmdLine); + cmd->array = g_ptr_array_new (); + cmd->chunk = g_string_chunk_new (1024); + + return cmd; +} + +static void +nm_cmd_line_destroy (NMCmdLine *cmd) +{ + g_ptr_array_free (cmd->array, TRUE); + g_string_chunk_free (cmd->chunk); + g_slice_free (NMCmdLine, cmd); +} + +static char * +nm_cmd_line_to_str (NMCmdLine *cmd) +{ + char *str; + + g_ptr_array_add (cmd->array, NULL); + str = g_strjoinv (" ", (gchar **) cmd->array->pdata); + g_ptr_array_remove_index (cmd->array, cmd->array->len - 1); + + return str; +} + +static void +nm_cmd_line_add_string (NMCmdLine *cmd, const char *str) +{ + g_ptr_array_add (cmd->array, g_string_chunk_insert (cmd->chunk, str)); +} + +/*******************************************/ + +static inline const char * +nm_find_dnsmasq (void) +{ + static const char *dnsmasq_binary_paths[] = { + "/usr/local/sbin/dnsmasq", + "/usr/sbin/dnsmasq", + "/sbin/dnsmasq", + NULL + }; + + const char **dnsmasq_binary = dnsmasq_binary_paths; + + while (*dnsmasq_binary != NULL) { + if (g_file_test (*dnsmasq_binary, G_FILE_TEST_EXISTS)) + break; + dnsmasq_binary++; + } + + return *dnsmasq_binary; +} + +static void +dm_exit_code (guint dm_exit_status) +{ + char *msg = "Unknown error"; + + switch (dm_exit_status) { + case 1: + msg = "Configuration problem"; + break; + case 2: + msg = "Network access problem (address in use; permissions; etc)"; + break; + case 3: + msg = "Filesystem problem (missing file/directory; permissions; etc)"; + break; + case 4: + msg = "Memory allocation failure"; + break; + case 5: + msg = "Other problem"; + break; + default: + if (dm_exit_status >= 11) + msg = "Lease-script 'init' process failure"; + break; + } + + nm_log_warn (LOGD_SHARING, "dnsmasq exited with error: %s (%d)", msg, dm_exit_status); +} + +static void +dm_watch_cb (GPid pid, gint status, gpointer user_data) +{ + NMDnsMasqManager *manager = NM_DNSMASQ_MANAGER (user_data); + NMDnsMasqManagerPrivate *priv = NM_DNSMASQ_MANAGER_GET_PRIVATE (manager); + guint err; + + if (WIFEXITED (status)) { + err = WEXITSTATUS (status); + if (err != 0) + dm_exit_code (err); + } else if (WIFSTOPPED (status)) { + nm_log_warn (LOGD_SHARING, "dnsmasq stopped unexpectedly with signal %d", WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_warn (LOGD_SHARING, "dnsmasq died with signal %d", WTERMSIG (status)); + } else { + nm_log_warn (LOGD_SHARING, "dnsmasq died from an unknown cause"); + } + + priv->pid = 0; + + g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_DNSMASQ_STATUS_DEAD); +} + +static NMCmdLine * +create_dm_cmd_line (const char *iface, + NMIP4Config *ip4_config, + const char *pidfile, + GError **error) +{ + const char *dm_binary; + NMCmdLine *cmd; + GString *s; + NMIP4Address *tmp; + struct in_addr addr; + char buf[INET_ADDRSTRLEN + 15]; + char localaddr[INET_ADDRSTRLEN + 1]; + int i; + + dm_binary = nm_find_dnsmasq (); + if (!dm_binary) { + g_set_error (error, NM_DNSMASQ_MANAGER_ERROR, NM_DNSMASQ_MANAGER_ERROR_NOT_FOUND, + "Could not find dnsmasq binary."); + return NULL; + } + + /* Find the IP4 address to use */ + tmp = nm_ip4_config_get_address (ip4_config, 0); + + /* Create dnsmasq command line */ + cmd = nm_cmd_line_new (); + nm_cmd_line_add_string (cmd, dm_binary); + + if (getenv ("NM_DNSMASQ_DEBUG")) { + nm_cmd_line_add_string (cmd, "--log-dhcp"); + nm_cmd_line_add_string (cmd, "--log-queries"); + } + + /* dnsmasq may read from it's default config file location, which if that + * location is a valid config file, it will combine with the options here + * and cause undesirable side-effects. Like sending bogus IP addresses + * as the gateway or whatever. So give dnsmasq a bogus config file + * location to avoid screwing up the configuration we're passing to it. + */ + memset (buf, 0, sizeof (buf)); + strcpy (buf, "/tmp/"); + for (i = 5; i < 15; i++) + buf[i] = (char) (g_random_int_range ((guint32) 'a', (guint32) 'z') & 0xFF); + strcat (buf, ".conf"); + + nm_cmd_line_add_string (cmd, "--conf-file"); + nm_cmd_line_add_string (cmd, buf); + + nm_cmd_line_add_string (cmd, "--no-hosts"); + nm_cmd_line_add_string (cmd, "--keep-in-foreground"); + nm_cmd_line_add_string (cmd, "--bind-interfaces"); + nm_cmd_line_add_string (cmd, "--except-interface=lo"); + nm_cmd_line_add_string (cmd, "--clear-on-reload"); + + /* Use strict order since in the case of VPN connections, the VPN's + * nameservers will be first in resolv.conf, and those need to be tried + * first by dnsmasq to successfully resolve names from the VPN. + */ + nm_cmd_line_add_string (cmd, "--strict-order"); + + s = g_string_new ("--listen-address="); + addr.s_addr = nm_ip4_address_get_address (tmp); + if (!inet_ntop (AF_INET, &addr, &localaddr[0], INET_ADDRSTRLEN)) { + nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X", + ntohl (addr.s_addr)); + goto error; + } + g_string_append (s, localaddr); + nm_cmd_line_add_string (cmd, s->str); + g_string_free (s, TRUE); + + s = g_string_new ("--dhcp-range="); + + /* Add start of address range */ + addr.s_addr = nm_ip4_address_get_address (tmp) + htonl (9); + if (!inet_ntop (AF_INET, &addr, &buf[0], INET_ADDRSTRLEN)) { + nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X", + ntohl (addr.s_addr)); + goto error; + } + g_string_append (s, buf); + + g_string_append_c (s, ','); + + /* Add end of address range */ + addr.s_addr = nm_ip4_address_get_address (tmp) + htonl (99); + if (!inet_ntop (AF_INET, &addr, &buf[0], INET_ADDRSTRLEN)) { + nm_log_warn (LOGD_SHARING, "error converting IP4 address 0x%X", + ntohl (addr.s_addr)); + goto error; + } + g_string_append (s, buf); + + g_string_append (s, ",60m"); + nm_cmd_line_add_string (cmd, s->str); + g_string_free (s, TRUE); + + s = g_string_new ("--dhcp-option=option:router,"); + g_string_append (s, localaddr); + nm_cmd_line_add_string (cmd, s->str); + g_string_free (s, TRUE); + + nm_cmd_line_add_string (cmd, "--dhcp-lease-max=50"); + + s = g_string_new ("--pid-file="); + g_string_append (s, pidfile); + nm_cmd_line_add_string (cmd, s->str); + g_string_free (s, TRUE); + + return cmd; + +error: + nm_cmd_line_destroy (cmd); + return NULL; +} + +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); +} + +static void +kill_existing_for_iface (const char *iface, const char *pidfile) +{ + char *contents = NULL; + glong pid; + char *proc_path = NULL; + char *cmdline_contents = NULL; + + if (!g_file_get_contents (pidfile, &contents, NULL, NULL)) + goto out; + + pid = strtol (contents, NULL, 10); + if (pid < 1 || pid > INT_MAX) + goto out; + + proc_path = g_strdup_printf ("/proc/%ld/cmdline", pid); + if (!g_file_get_contents (proc_path, &cmdline_contents, NULL, NULL)) + goto out; + + if (strstr (cmdline_contents, "bin/dnsmasq")) { + if (kill (pid, 0)) { + nm_log_dbg (LOGD_SHARING, "Killing stale dnsmasq process %ld", pid); + kill (pid, SIGKILL); + } + unlink (pidfile); + } + +out: + g_free (cmdline_contents); + g_free (proc_path); + g_free (contents); +} + +gboolean +nm_dnsmasq_manager_start (NMDnsMasqManager *manager, + NMIP4Config *ip4_config, + GError **error) +{ + NMDnsMasqManagerPrivate *priv; + NMCmdLine *dm_cmd; + char *cmd_str; + + g_return_val_if_fail (NM_IS_DNSMASQ_MANAGER (manager), FALSE); + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + priv = NM_DNSMASQ_MANAGER_GET_PRIVATE (manager); + + kill_existing_for_iface (priv->iface, priv->pidfile); + + dm_cmd = create_dm_cmd_line (priv->iface, ip4_config, priv->pidfile, error); + if (!dm_cmd) + return FALSE; + + g_ptr_array_add (dm_cmd->array, NULL); + + nm_log_info (LOGD_SHARING, "Starting dnsmasq..."); + + cmd_str = nm_cmd_line_to_str (dm_cmd); + nm_log_dbg (LOGD_SHARING, "Command line: %s", cmd_str); + g_free (cmd_str); + + 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)) { + goto out; + } + + nm_log_dbg (LOGD_SHARING, "dnsmasq started with pid %d", priv->pid); + + priv->dm_watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) dm_watch_cb, manager); + + out: + if (dm_cmd) + nm_cmd_line_destroy (dm_cmd); + + return priv->pid > 0; +} + +static gboolean +ensure_killed (gpointer data) +{ + int pid = GPOINTER_TO_INT (data); + + if (kill (pid, 0) == 0) + kill (pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_SHARING, "waiting for dnsmasq pid %d to exit", pid); + waitpid (pid, NULL, 0); + nm_log_dbg (LOGD_SHARING, "dnsmasq pid %d cleaned up", pid); + + return FALSE; +} + +void +nm_dnsmasq_manager_stop (NMDnsMasqManager *manager) +{ + NMDnsMasqManagerPrivate *priv; + + g_return_if_fail (NM_IS_DNSMASQ_MANAGER (manager)); + + priv = NM_DNSMASQ_MANAGER_GET_PRIVATE (manager); + + if (priv->dm_watch_id) { + g_source_remove (priv->dm_watch_id); + priv->dm_watch_id = 0; + } + + if (priv->pid) { + if (kill (priv->pid, SIGTERM) == 0) + g_timeout_add_seconds (2, ensure_killed, GINT_TO_POINTER (priv->pid)); + else { + kill (priv->pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_SHARING, "waiting for dnsmasq pid %d to exit", priv->pid); + waitpid (priv->pid, NULL, 0); + nm_log_dbg (LOGD_SHARING, "dnsmasq pid %d cleaned up", priv->pid); + } + + priv->pid = 0; + } + + unlink (priv->pidfile); +} diff --git a/src/dnsmasq-manager/nm-dnsmasq-manager.h b/src/dnsmasq-manager/nm-dnsmasq-manager.h new file mode 100644 index 00000000..1214d06b --- /dev/null +++ b/src/dnsmasq-manager/nm-dnsmasq-manager.h @@ -0,0 +1,69 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#ifndef NM_DNSMASQ_MANAGER_H +#define NM_DNSMASQ_MANAGER_H + +#include +#include + +#include "nm-ip4-config.h" + +#define NM_TYPE_DNSMASQ_MANAGER (nm_dnsmasq_manager_get_type ()) +#define NM_DNSMASQ_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DNSMASQ_MANAGER, NMDnsMasqManager)) +#define NM_DNSMASQ_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DNSMASQ_MANAGER, NMDnsMasqManagerClass)) +#define NM_IS_DNSMASQ_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DNSMASQ_MANAGER)) +#define NM_IS_DNSMASQ_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DNSMASQ_MANAGER)) +#define NM_DNSMASQ_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DNSMASQ_MANAGER, NMDnsMasqManagerClass)) + +typedef enum { + NM_DNSMASQ_STATUS_UNKNOWN, + + NM_DNSMASQ_STATUS_DEAD, + NM_DNSMASQ_STATUS_RUNNING, +} NMDnsMasqStatus; + +typedef struct { + GObject parent; +} NMDnsMasqManager; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*state_changed) (NMDnsMasqManager *manager, NMDnsMasqStatus status); +} NMDnsMasqManagerClass; + +GType nm_dnsmasq_manager_get_type (void); + +NMDnsMasqManager *nm_dnsmasq_manager_new (const char *iface); + +gboolean nm_dnsmasq_manager_start (NMDnsMasqManager *manager, + NMIP4Config *ip4_config, + GError **error); + +void nm_dnsmasq_manager_stop (NMDnsMasqManager *manager); + +#define NM_DNSMASQ_MANAGER_ERROR nm_dnsmasq_manager_error_quark() +#define NM_TYPE_DNSMASQ_MANAGER_ERROR (nm_dnsmasq_manager_error_get_type ()) + +GQuark nm_dnsmasq_manager_error_quark (void); + +#endif /* NM_DNSMASQ_MANAGER_H */ diff --git a/src/gdb-cmd b/src/gdb-cmd new file mode 100644 index 00000000..aea32eb0 --- /dev/null +++ b/src/gdb-cmd @@ -0,0 +1,3 @@ +bt +thread apply all bt full +q diff --git a/src/ip6-manager/Makefile.am b/src/ip6-manager/Makefile.am new file mode 100644 index 00000000..c2f55914 --- /dev/null +++ b/src/ip6-manager/Makefile.am @@ -0,0 +1,26 @@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/named-manager + +noinst_LTLIBRARIES = libip6-manager.la + +libip6_manager_la_SOURCES = \ + nm-ip6-manager.c \ + nm-ip6-manager.h + +libip6_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED + +libip6_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + diff --git a/src/ip6-manager/Makefile.in b/src/ip6-manager/Makefile.in new file mode 100644 index 00000000..ddb90e0d --- /dev/null +++ b/src/ip6-manager/Makefile.in @@ -0,0 +1,570 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/ip6-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libip6_manager_la_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libip6_manager_la_OBJECTS = libip6_manager_la-nm-ip6-manager.lo +libip6_manager_la_OBJECTS = $(am_libip6_manager_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libip6_manager_la_SOURCES) +DIST_SOURCES = $(libip6_manager_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/named-manager + +noinst_LTLIBRARIES = libip6-manager.la +libip6_manager_la_SOURCES = \ + nm-ip6-manager.c \ + nm-ip6-manager.h + +libip6_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED + +libip6_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ip6-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/ip6-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libip6-manager.la: $(libip6_manager_la_OBJECTS) $(libip6_manager_la_DEPENDENCIES) + $(LINK) $(libip6_manager_la_OBJECTS) $(libip6_manager_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libip6_manager_la-nm-ip6-manager.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libip6_manager_la-nm-ip6-manager.lo: nm-ip6-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libip6_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libip6_manager_la-nm-ip6-manager.lo -MD -MP -MF $(DEPDIR)/libip6_manager_la-nm-ip6-manager.Tpo -c -o libip6_manager_la-nm-ip6-manager.lo `test -f 'nm-ip6-manager.c' || echo '$(srcdir)/'`nm-ip6-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libip6_manager_la-nm-ip6-manager.Tpo $(DEPDIR)/libip6_manager_la-nm-ip6-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ip6-manager.c' object='libip6_manager_la-nm-ip6-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libip6_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libip6_manager_la-nm-ip6-manager.lo `test -f 'nm-ip6-manager.c' || echo '$(srcdir)/'`nm-ip6-manager.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c new file mode 100644 index 00000000..f6f6127c --- /dev/null +++ b/src/ip6-manager/nm-ip6-manager.c @@ -0,0 +1,1123 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* nm-ip6-manager.c - Handle IPv6 address configuration for 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, 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) 2009 - 2010 Red Hat, Inc. + */ + +#include +#include + +#include +#include +#include + +#include "nm-ip6-manager.h" +#include "nm-netlink-monitor.h" +#include "NetworkManagerUtils.h" +#include "nm-marshal.h" +#include "nm-logging.h" +#include "nm-system.h" + +/* Pre-DHCP addrconf timeout, in seconds */ +#define NM_IP6_TIMEOUT 20 + +/* FIXME? Stolen from the kernel sources */ +#define IF_RA_OTHERCONF 0x80 +#define IF_RA_MANAGED 0x40 +#define IF_RA_RCVD 0x20 +#define IF_RS_SENT 0x10 + +typedef struct { + NMNetlinkMonitor *monitor; + GHashTable *devices; + + struct nl_handle *nlh; + struct nl_cache *addr_cache, *route_cache; + + guint netlink_id; +} NMIP6ManagerPrivate; + +#define NM_IP6_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP6_MANAGER, NMIP6ManagerPrivate)) + +G_DEFINE_TYPE (NMIP6Manager, nm_ip6_manager, G_TYPE_OBJECT) + +enum { + ADDRCONF_COMPLETE, + CONFIG_CHANGED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +typedef enum { + NM_IP6_DEVICE_UNCONFIGURED, + NM_IP6_DEVICE_GOT_LINK_LOCAL, + NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT, + NM_IP6_DEVICE_GOT_ADDRESS, + NM_IP6_DEVICE_TIMED_OUT +} NMIP6DeviceState; + +typedef struct { + struct in6_addr addr; + time_t expires; +} NMIP6RDNSS; + +/******************************************************************/ + +typedef struct { + NMIP6Manager *manager; + char *iface; + int ifindex; + + char *disable_ip6_path; + gboolean disable_ip6_save_valid; + guint32 disable_ip6_save; + + guint finish_addrconf_id; + guint config_changed_id; + + NMIP6DeviceState state; + NMIP6DeviceState target_state; + gboolean addrconf_complete; + + GArray *rdnss_servers; + guint rdnss_timeout_id; + + guint ip6flags_poll_id; + + guint32 ra_flags; +} NMIP6Device; + +static void +nm_ip6_device_destroy (NMIP6Device *device) +{ + g_return_if_fail (device != NULL); + + /* reset the saved IPv6 value */ + if (device->disable_ip6_save_valid) { + nm_utils_do_sysctl (device->disable_ip6_path, + device->disable_ip6_save ? "1\n" : "0\n"); + } + + if (device->finish_addrconf_id) + g_source_remove (device->finish_addrconf_id); + if (device->config_changed_id) + g_source_remove (device->config_changed_id); + g_free (device->iface); + if (device->rdnss_servers) + g_array_free (device->rdnss_servers, TRUE); + if (device->rdnss_timeout_id) + g_source_remove (device->rdnss_timeout_id); + if (device->ip6flags_poll_id) + g_source_remove (device->ip6flags_poll_id); + + g_slice_free (NMIP6Device, device); +} + +static NMIP6Device * +nm_ip6_device_new (NMIP6Manager *manager, int ifindex) +{ + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + NMIP6Device *device; + + g_return_val_if_fail (ifindex > 0, NULL); + + device = g_slice_new0 (NMIP6Device); + if (!device) { + nm_log_err (LOGD_IP6, "(%d): out of memory creating IP6 addrconf object.", + ifindex); + return NULL; + } + + device->ifindex = ifindex; + device->iface = g_strdup (nm_netlink_index_to_iface (ifindex)); + if (!device->iface) { + nm_log_err (LOGD_IP6, "(%d): could not find interface name from index.", + ifindex); + goto error; + } + + device->manager = manager; + + device->rdnss_servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); + + g_hash_table_replace (priv->devices, GINT_TO_POINTER (device->ifindex), device); + + /* and the original value of IPv6 enable/disable */ + device->disable_ip6_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/disable_ipv6", + device->iface); + g_assert (device->disable_ip6_path); + device->disable_ip6_save_valid = nm_utils_get_proc_sys_net_value (device->disable_ip6_path, + device->iface, + &device->disable_ip6_save); + + return device; + +error: + nm_ip6_device_destroy (device); + return NULL; +} + +static NMIP6Device * +nm_ip6_manager_get_device (NMIP6Manager *manager, int ifindex) +{ + NMIP6ManagerPrivate *priv; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_IP6_MANAGER (manager), NULL); + + priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + return g_hash_table_lookup (priv->devices, GINT_TO_POINTER (ifindex)); +} + +/******************************************************************/ + +typedef struct { + NMIP6Device *device; + guint dhcp_opts; + gboolean success; +} CallbackInfo; + +static gboolean +finish_addrconf (gpointer user_data) +{ + CallbackInfo *info = user_data; + NMIP6Device *device = info->device; + NMIP6Manager *manager = device->manager; + int ifindex; + + device->finish_addrconf_id = 0; + device->addrconf_complete = TRUE; + ifindex = device->ifindex; + + /* We're done, stop polling IPv6 flags */ + if (device->ip6flags_poll_id) { + g_source_remove (device->ip6flags_poll_id); + device->ip6flags_poll_id = 0; + } + + /* And tell listeners that addrconf is complete */ + if (info->success) { + g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, + ifindex, info->dhcp_opts, TRUE); + } else { + nm_log_info (LOGD_IP6, "(%s): IP6 addrconf timed out or failed.", + device->iface); + + nm_ip6_manager_cancel_addrconf (manager, ifindex); + g_signal_emit (manager, signals[ADDRCONF_COMPLETE], 0, + ifindex, info->dhcp_opts, FALSE); + } + + return FALSE; +} + +static gboolean +emit_config_changed (gpointer user_data) +{ + CallbackInfo *info = user_data; + NMIP6Device *device = info->device; + NMIP6Manager *manager = device->manager; + + device->config_changed_id = 0; + g_signal_emit (manager, signals[CONFIG_CHANGED], 0, + device->ifindex, + info->dhcp_opts, + info->success); + return FALSE; +} + +static void set_rdnss_timeout (NMIP6Device *device); + +static gboolean +rdnss_expired (gpointer user_data) +{ + NMIP6Device *device = user_data; + CallbackInfo info = { device, IP6_DHCP_OPT_NONE }; + + nm_log_dbg (LOGD_IP6, "(%s): IPv6 RDNSS information expired", device->iface); + + set_rdnss_timeout (device); + emit_config_changed (&info); + return FALSE; +} + +static void +set_rdnss_timeout (NMIP6Device *device) +{ + time_t expires = 0, now = time (NULL); + NMIP6RDNSS *rdnss; + int i; + + if (device->rdnss_timeout_id) { + g_source_remove (device->rdnss_timeout_id); + device->rdnss_timeout_id = 0; + } + + /* Find the soonest expiration time. */ + for (i = 0; i < device->rdnss_servers->len; i++) { + rdnss = &g_array_index (device->rdnss_servers, NMIP6RDNSS, i); + if (rdnss->expires == 0) + continue; + + /* If the entry has already expired, remove it; the "+ 1" is + * because g_timeout_add_seconds() might fudge the timing a + * bit. + */ + if (rdnss->expires <= now + 1) { + char buf[INET6_ADDRSTRLEN + 1]; + + if (inet_ntop (AF_INET6, &(rdnss->addr), buf, sizeof (buf)) > 0) { + nm_log_dbg (LOGD_IP6, "(%s): removing expired RA-provided nameserver %s", + device->iface, buf); + } + g_array_remove_index_fast (device->rdnss_servers, i--); + continue; + } + + if (!expires || rdnss->expires < expires) + expires = rdnss->expires; + } + + if (expires) { + device->rdnss_timeout_id = g_timeout_add_seconds (expires - now, + rdnss_expired, + device); + } +} + +static CallbackInfo * +callback_info_new (NMIP6Device *device, guint dhcp_opts, gboolean success) +{ + CallbackInfo *info; + + info = g_malloc0 (sizeof (CallbackInfo)); + info->device = device; + info->dhcp_opts = dhcp_opts; + info->success = success; + return info; +} + +static const char * +state_to_string (NMIP6DeviceState state) +{ + switch (state) { + case NM_IP6_DEVICE_UNCONFIGURED: + return "unconfigured"; + case NM_IP6_DEVICE_GOT_LINK_LOCAL: + return "got-link-local"; + case NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT: + return "got-ra"; + case NM_IP6_DEVICE_GOT_ADDRESS: + return "got-address"; + case NM_IP6_DEVICE_TIMED_OUT: + return "timed-out"; + default: + return "unknown"; + } +} + +static void +nm_ip6_device_sync_from_netlink (NMIP6Device *device, gboolean config_changed) +{ + NMIP6Manager *manager = device->manager; + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + struct rtnl_addr *rtnladdr; + struct nl_addr *nladdr; + struct in6_addr *addr; + CallbackInfo *info; + guint dhcp_opts = IP6_DHCP_OPT_NONE; + gboolean found_linklocal = FALSE, found_other = FALSE; + + nm_log_dbg (LOGD_IP6, "(%s): syncing with netlink (ra_flags 0x%X) (state/target '%s'/'%s')", + device->iface, device->ra_flags, + state_to_string (device->state), + state_to_string (device->target_state)); + + /* Look for any IPv6 addresses the kernel may have set for the device */ + for (rtnladdr = (struct rtnl_addr *) nl_cache_get_first (priv->addr_cache); + rtnladdr; + rtnladdr = (struct rtnl_addr *) nl_cache_get_next ((struct nl_object *) rtnladdr)) { + char buf[INET6_ADDRSTRLEN]; + + if (rtnl_addr_get_ifindex (rtnladdr) != device->ifindex) + continue; + + nladdr = rtnl_addr_get_local (rtnladdr); + if (!nladdr || nl_addr_get_family (nladdr) != AF_INET6) + continue; + + addr = nl_addr_get_binary_addr (nladdr); + + if (inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN) > 0) { + nm_log_dbg (LOGD_IP6, "(%s): netlink address: %s", + device->iface, buf); + } + + if (IN6_IS_ADDR_LINKLOCAL (addr)) { + if (device->state == NM_IP6_DEVICE_UNCONFIGURED) + device->state = NM_IP6_DEVICE_GOT_LINK_LOCAL; + found_linklocal = TRUE; + } else { + if (device->state < NM_IP6_DEVICE_GOT_ADDRESS) + device->state = NM_IP6_DEVICE_GOT_ADDRESS; + found_other = TRUE; + } + } + + /* There might be a LL address hanging around on the interface from + * before in the initial run, but if it goes away later, make sure we + * regress from GOT_LINK_LOCAL back to UNCONFIGURED. + */ + if ((device->state == NM_IP6_DEVICE_GOT_LINK_LOCAL) && !found_linklocal) + device->state = NM_IP6_DEVICE_UNCONFIGURED; + + nm_log_dbg (LOGD_IP6, "(%s): addresses synced (state %s)", + device->iface, state_to_string (device->state)); + + /* We only care about router advertisements if we want a real IPv6 address */ + if ( (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS) + && (device->ra_flags & IF_RA_RCVD)) { + + if (device->state < NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT) + device->state = NM_IP6_DEVICE_GOT_ROUTER_ADVERTISEMENT; + + if (device->ra_flags & IF_RA_MANAGED) { + dhcp_opts = IP6_DHCP_OPT_MANAGED; + nm_log_dbg (LOGD_IP6, "router advertisement deferred to DHCPv6"); + } else if (device->ra_flags & IF_RA_OTHERCONF) { + dhcp_opts = IP6_DHCP_OPT_OTHERCONF; + nm_log_dbg (LOGD_IP6, "router advertisement requests parallel DHCPv6"); + } + } + + if (!device->addrconf_complete) { + /* Managed mode (ie DHCP only) short-circuits automatic addrconf, so + * we don't bother waiting for the device's target state to be reached + * when the RA requests managed mode. + */ + if ( (device->state >= device->target_state) + || (dhcp_opts == IP6_DHCP_OPT_MANAGED)) { + /* device->finish_addrconf_id may currently be a timeout + * rather than an idle, so we remove the existing source. + */ + if (device->finish_addrconf_id) + g_source_remove (device->finish_addrconf_id); + + nm_log_dbg (LOGD_IP6, "(%s): reached target state or Managed-mode requested (state '%s') (dhcp opts 0x%X)", + device->iface, state_to_string (device->state), + dhcp_opts); + + info = callback_info_new (device, dhcp_opts, TRUE); + device->finish_addrconf_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, + finish_addrconf, + info, + (GDestroyNotify) g_free); + } + } else if (config_changed) { + if (!device->config_changed_id) { + gboolean success = TRUE; + + /* If for some reason an RA-provided address disappeared, we need + * to make sure we fail the connection as it's no longer valid. + */ + if ( (device->state == NM_IP6_DEVICE_GOT_ADDRESS) + && (device->target_state == NM_IP6_DEVICE_GOT_ADDRESS) + && !found_other) { + nm_log_dbg (LOGD_IP6, "(%s): RA-provided address no longer valid", + device->iface); + success = FALSE; + } + + info = callback_info_new (device, dhcp_opts, success); + device->config_changed_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, + emit_config_changed, + info, + (GDestroyNotify) g_free); + } + } +} + +static void +ref_object (struct nl_object *obj, void *data) +{ + struct nl_object **out = data; + + nl_object_get (obj); + *out = obj; +} + +static NMIP6Device * +process_addr (NMIP6Manager *manager, struct nl_msg *msg) +{ + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + NMIP6Device *device; + struct rtnl_addr *rtnladdr; + int old_size; + + nm_log_dbg (LOGD_IP6, "processing netlink new/del address message"); + + rtnladdr = NULL; + nl_msg_parse (msg, ref_object, &rtnladdr); + if (!rtnladdr) { + nm_log_dbg (LOGD_IP6, "error processing netlink new/del address message"); + return NULL; + } + + device = nm_ip6_manager_get_device (manager, rtnl_addr_get_ifindex (rtnladdr)); + if (!device) { + nm_log_dbg (LOGD_IP6, "ignoring message for unknown device"); + return NULL; + } + + old_size = nl_cache_nitems (priv->addr_cache); + nl_cache_include (priv->addr_cache, (struct nl_object *)rtnladdr, NULL); + rtnl_addr_put (rtnladdr); + + /* The kernel will re-notify us of automatically-added addresses + * every time it gets another router advertisement. We only want + * to notify higher levels if we actually changed something. + */ + if (nl_cache_nitems (priv->addr_cache) == old_size) { + nm_log_dbg (LOGD_IP6, "(%s): address cache unchanged, ignoring message", + device->iface); + return NULL; + } + + return device; +} + +static NMIP6Device * +process_route (NMIP6Manager *manager, struct nl_msg *msg) +{ + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + NMIP6Device *device; + struct rtnl_route *rtnlroute; + int old_size; + + nm_log_dbg (LOGD_IP6, "processing netlink new/del route message"); + + rtnlroute = NULL; + nl_msg_parse (msg, ref_object, &rtnlroute); + if (!rtnlroute) { + nm_log_dbg (LOGD_IP6, "error processing netlink new/del route message"); + return NULL; + } + + device = nm_ip6_manager_get_device (manager, rtnl_route_get_oif (rtnlroute)); + if (!device) { + nm_log_dbg (LOGD_IP6, "ignoring message for unknown device"); + return NULL; + } + + old_size = nl_cache_nitems (priv->route_cache); + nl_cache_include (priv->route_cache, (struct nl_object *)rtnlroute, NULL); + rtnl_route_put (rtnlroute); + + /* As above in process_addr */ + if (nl_cache_nitems (priv->route_cache) == old_size) { + nm_log_dbg (LOGD_IP6, "(%s): route cache unchanged, ignoring message", + device->iface); + return NULL; + } + + return device; +} + +static NMIP6Device * +process_prefix (NMIP6Manager *manager, struct nl_msg *msg) +{ + struct prefixmsg *pmsg; + NMIP6Device *device; + + /* We don't care about the prefix itself, but if we receive a + * router advertisement telling us to use DHCP, we might not + * get any RTM_NEWADDRs or RTM_NEWROUTEs, so this is our only + * way to notice immediately that an RA was received. + */ + + nm_log_dbg (LOGD_IP6, "processing netlink new prefix message"); + + pmsg = (struct prefixmsg *) NLMSG_DATA (nlmsg_hdr (msg)); + device = nm_ip6_manager_get_device (manager, pmsg->prefix_ifindex); + + if (!device || device->addrconf_complete) { + nm_log_dbg (LOGD_IP6, "(%s): ignoring unknown or completed device", + device ? device->iface : "(none)"); + return NULL; + } + + return device; +} + +/* RDNSS parsing code based on rdnssd, Copyright 2007 Pierre Ynard, + * Rémi Denis-Courmont. GPLv2/3 + */ + +#define ND_OPT_RDNSS 25 +struct nd_opt_rdnss { + uint8_t nd_opt_rdnss_type; + uint8_t nd_opt_rdnss_len; + uint16_t nd_opt_rdnss_reserved1; + uint32_t nd_opt_rdnss_lifetime; + /* followed by one or more IPv6 addresses */ +}; + +static NMIP6Device * +process_nduseropt (NMIP6Manager *manager, struct nl_msg *msg) +{ + NMIP6Device *device; + struct nduseroptmsg *ndmsg; + struct nd_opt_hdr *opt; + guint opts_len, i; + time_t now = time (NULL); + struct nd_opt_rdnss *rdnss_opt; + struct in6_addr *addr; + GArray *servers; + NMIP6RDNSS server, *sa, *sb; + gboolean changed; + + nm_log_dbg (LOGD_IP6, "processing netlink nduseropt message"); + + ndmsg = (struct nduseroptmsg *) NLMSG_DATA (nlmsg_hdr (msg)); + + if (ndmsg->nduseropt_family != AF_INET6 || + ndmsg->nduseropt_icmp_type != ND_ROUTER_ADVERT || + ndmsg->nduseropt_icmp_code != 0) { + nm_log_dbg (LOGD_IP6, "ignoring non-Router Advertisement message"); + return NULL; + } + + device = nm_ip6_manager_get_device (manager, ndmsg->nduseropt_ifindex); + if (!device) { + nm_log_dbg (LOGD_IP6, "ignoring message for unknown device"); + return NULL; + } + + servers = g_array_new (FALSE, FALSE, sizeof (NMIP6RDNSS)); + + opt = (struct nd_opt_hdr *) (ndmsg + 1); + opts_len = ndmsg->nduseropt_opts_len; + + while (opts_len >= sizeof (struct nd_opt_hdr)) { + size_t nd_opt_len = opt->nd_opt_len; + + if (nd_opt_len == 0 || opts_len < (nd_opt_len << 3)) + break; + + if (opt->nd_opt_type != ND_OPT_RDNSS) + goto next; + + if (nd_opt_len < 3 || (nd_opt_len & 1) == 0) + goto next; + + rdnss_opt = (struct nd_opt_rdnss *) opt; + + /* Pad the DNS server expiry somewhat to give a bit of slack in cases + * where one RA gets lost or something (which can happen on unreliable + * links like wifi where certain types of frames are not retransmitted). + */ + server.expires = now + ntohl (rdnss_opt->nd_opt_rdnss_lifetime) + 10; + + for (addr = (struct in6_addr *) (rdnss_opt + 1); nd_opt_len >= 2; addr++, nd_opt_len -= 2) { + char buf[INET6_ADDRSTRLEN + 1]; + + if (inet_ntop (AF_INET6, addr, buf, sizeof (buf))) { + nm_log_dbg (LOGD_IP6, "(%s): found RA-provided nameserver %s (expires in %d seconds)", + device->iface, buf, + ntohl (rdnss_opt->nd_opt_rdnss_lifetime)); + } + + server.addr = *addr; + g_array_append_val (servers, server); + } + + next: + opts_len -= opt->nd_opt_len << 3; + opt = (struct nd_opt_hdr *) ((uint8_t *) opt + (opt->nd_opt_len << 3)); + } + + /* See if anything (other than expiration time) changed */ + if (servers->len != device->rdnss_servers->len) + changed = TRUE; + else { + for (i = 0; i < servers->len; i++) { + sa = &(g_array_index (servers, NMIP6RDNSS, i)); + sb = &(g_array_index (device->rdnss_servers, NMIP6RDNSS, i)); + if (IN6_ARE_ADDR_EQUAL (&sa->addr, &sb->addr) == FALSE) { + changed = TRUE; + break; + } + } + changed = FALSE; + } + + if (changed) { + nm_log_dbg (LOGD_IP6, "(%s): RA-provided nameservers changed", device->iface); + } + + /* Always copy in new servers (even if unchanged) to get their updated + * expiration times. + */ + g_array_free (device->rdnss_servers, TRUE); + device->rdnss_servers = servers; + + /* Timeouts may have changed even if IPs didn't */ + set_rdnss_timeout (device); + + if (changed) + return device; + else + return NULL; +} + +static struct nla_policy link_policy[IFLA_MAX + 1] = { + [IFLA_PROTINFO] = { .type = NLA_NESTED }, +}; + +static struct nla_policy link_prot_policy[IFLA_INET6_MAX + 1] = { + [IFLA_INET6_FLAGS] = { .type = NLA_U32 }, +}; + +static NMIP6Device * +process_newlink (NMIP6Manager *manager, struct nl_msg *msg) +{ + struct nlmsghdr *hdr = nlmsg_hdr (msg); + struct ifinfomsg *ifi; + NMIP6Device *device; + struct nlattr *tb[IFLA_MAX + 1]; + struct nlattr *pi[IFLA_INET6_MAX + 1]; + int err; + + ifi = nlmsg_data (hdr); + if (ifi->ifi_family != AF_INET6) { + nm_log_dbg (LOGD_IP6, "ignoring netlink message family %d", ifi->ifi_family); + return NULL; + } + + device = nm_ip6_manager_get_device (manager, ifi->ifi_index); + if (!device || device->addrconf_complete) { + nm_log_dbg (LOGD_IP6, "(%s): ignoring unknown or completed device", + device ? device->iface : "(none)"); + return NULL; + } + + /* FIXME: we have to do this manually for now since libnl doesn't yet + * support the IFLA_PROTINFO attribute of NEWLINK messages. When it does, + * we can get rid of this function and just grab IFLA_PROTINFO from + * nm_ip6_device_sync_from_netlink(), then get the IFLA_INET6_FLAGS out of + * the PROTINFO. + */ + + err = nlmsg_parse (hdr, sizeof (*ifi), tb, IFLA_MAX, link_policy); + if (err < 0) { + nm_log_dbg (LOGD_IP6, "(%s): error parsing PROTINFO attribute", device->iface); + return NULL; + } + if (!tb[IFLA_PROTINFO]) { + nm_log_dbg (LOGD_IP6, "(%s): message had no PROTINFO attribute", device->iface); + return NULL; + } + + err = nla_parse_nested (pi, IFLA_INET6_MAX, tb[IFLA_PROTINFO], link_prot_policy); + if (err < 0) { + nm_log_dbg (LOGD_IP6, "(%s): error parsing PROTINFO flags", device->iface); + return NULL; + } + if (!pi[IFLA_INET6_FLAGS]) { + nm_log_dbg (LOGD_IP6, "(%s): message had no PROTINFO flags", device->iface); + return NULL; + } + + device->ra_flags = nla_get_u32 (pi[IFLA_INET6_FLAGS]); + nm_log_dbg (LOGD_IP6, "(%s): got IPv6 flags 0x%X", device->iface, device->ra_flags); + + return device; +} + +static void +netlink_notification (NMNetlinkMonitor *monitor, struct nl_msg *msg, gpointer user_data) +{ + NMIP6Manager *manager = (NMIP6Manager *) user_data; + NMIP6Device *device; + struct nlmsghdr *hdr; + gboolean config_changed = FALSE; + + hdr = nlmsg_hdr (msg); + nm_log_dbg (LOGD_HW, "netlink notificate type %d", hdr->nlmsg_type); + switch (hdr->nlmsg_type) { + case RTM_NEWADDR: + case RTM_DELADDR: + device = process_addr (manager, msg); + config_changed = TRUE; + break; + case RTM_NEWROUTE: + case RTM_DELROUTE: + device = process_route (manager, msg); + config_changed = TRUE; + break; + case RTM_NEWPREFIX: + device = process_prefix (manager, msg); + break; + case RTM_NEWNDUSEROPT: + device = process_nduseropt (manager, msg); + config_changed = TRUE; + break; + case RTM_NEWLINK: + device = process_newlink (manager, msg); + config_changed = TRUE; + break; + default: + return; + } + + if (device) { + nm_log_dbg (LOGD_IP6, "(%s): syncing device with netlink changes", device->iface); + nm_ip6_device_sync_from_netlink (device, config_changed); + } +} + +void +nm_ip6_manager_prepare_interface (NMIP6Manager *manager, + int ifindex, + NMSettingIP6Config *s_ip6, + const char *accept_ra_path) +{ + NMIP6ManagerPrivate *priv; + NMIP6Device *device; + const char *method = NULL; + + g_return_if_fail (NM_IS_IP6_MANAGER (manager)); + g_return_if_fail (ifindex > 0); + + priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + + device = nm_ip6_device_new (manager, ifindex); + g_return_if_fail (device != NULL); + g_return_if_fail ( strchr (device->iface, '/') == NULL + && strcmp (device->iface, "all") != 0 + && strcmp (device->iface, "default") != 0); + + if (s_ip6) + method = nm_setting_ip6_config_get_method (s_ip6); + if (!method) + method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + + /* Establish target state and turn router advertisement acceptance on or off */ + if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + device->target_state = NM_IP6_DEVICE_GOT_LINK_LOCAL; + nm_utils_do_sysctl (accept_ra_path, "0\n"); + } else { + device->target_state = NM_IP6_DEVICE_GOT_ADDRESS; + nm_utils_do_sysctl (accept_ra_path, "1\n"); + } +} + +static gboolean +poll_ip6_flags (gpointer user_data) +{ + nm_netlink_monitor_request_ip6_info (NM_NETLINK_MONITOR (user_data), NULL); + return TRUE; +} + +void +nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, int ifindex) +{ + NMIP6ManagerPrivate *priv; + NMIP6Device *device; + CallbackInfo *info; + + g_return_if_fail (NM_IS_IP6_MANAGER (manager)); + g_return_if_fail (ifindex > 0); + + priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + + device = (NMIP6Device *) g_hash_table_lookup (priv->devices, GINT_TO_POINTER (ifindex)); + g_return_if_fail (device != NULL); + + nm_log_info (LOGD_IP6, "Activation (%s) Beginning IP6 addrconf.", device->iface); + + device->addrconf_complete = FALSE; + device->ra_flags = 0; + + /* Set up a timeout on the transaction to kill it after the timeout */ + info = callback_info_new (device, 0, FALSE); + device->finish_addrconf_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, + NM_IP6_TIMEOUT, + finish_addrconf, + info, + (GDestroyNotify) g_free); + + /* Bounce IPv6 on the interface to ensure the kernel will start looking for + * new RAs; there doesn't seem to be a better way to do this right now. + */ + if (device->target_state >= NM_IP6_DEVICE_GOT_ADDRESS) { + nm_utils_do_sysctl (device->disable_ip6_path, "1\n"); + g_usleep (200); + nm_utils_do_sysctl (device->disable_ip6_path, "0\n"); + } + + device->ip6flags_poll_id = g_timeout_add_seconds (1, poll_ip6_flags, priv->monitor); + + /* Kick off the initial IPv6 flags request */ + nm_netlink_monitor_request_ip6_info (priv->monitor, NULL); + + /* Sync flags, etc, from netlink; this will also notice if the + * device is already fully configured and schedule the + * ADDRCONF_COMPLETE signal in that case. + */ + nm_ip6_device_sync_from_netlink (device, FALSE); +} + +void +nm_ip6_manager_cancel_addrconf (NMIP6Manager *manager, int ifindex) +{ + g_return_if_fail (NM_IS_IP6_MANAGER (manager)); + g_return_if_fail (ifindex > 0); + + g_hash_table_remove (NM_IP6_MANAGER_GET_PRIVATE (manager)->devices, + GINT_TO_POINTER (ifindex)); +} + +#define FIRST_ROUTE(m) ((struct rtnl_route *) nl_cache_get_first (m)) +#define NEXT_ROUTE(m) ((struct rtnl_route *) nl_cache_get_next ((struct nl_object *) m)) + +#define FIRST_ADDR(m) ((struct rtnl_addr *) nl_cache_get_first (m)) +#define NEXT_ADDR(m) ((struct rtnl_addr *) nl_cache_get_next ((struct nl_object *) m)) + +NMIP6Config * +nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) +{ + NMIP6ManagerPrivate *priv; + NMIP6Device *device; + NMIP6Config *config; + struct rtnl_addr *rtnladdr; + struct nl_addr *nladdr; + struct in6_addr *addr; + NMIP6Address *ip6addr; + struct rtnl_route *rtnlroute; + struct nl_addr *nldest, *nlgateway; + struct in6_addr *dest, *gateway; + gboolean defgw_set = FALSE; + struct in6_addr defgw; + uint32_t metric; + NMIP6Route *ip6route; + int i; + + g_return_val_if_fail (NM_IS_IP6_MANAGER (manager), NULL); + g_return_val_if_fail (ifindex > 0, NULL); + + priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + + device = (NMIP6Device *) g_hash_table_lookup (priv->devices, + GINT_TO_POINTER (ifindex)); + if (!device) { + nm_log_warn (LOGD_IP6, "(%d): addrconf not started.", ifindex); + return NULL; + } + + config = nm_ip6_config_new (); + if (!config) { + nm_log_err (LOGD_IP6, "(%s): out of memory creating IP6 config object.", + device->iface); + return NULL; + } + + /* Make sure we refill the route and address caches, otherwise we won't get + * up-to-date information here since the netlink route/addr change messages + * may be lagging a bit. + */ + nl_cache_refill (priv->nlh, priv->route_cache); + nl_cache_refill (priv->nlh, priv->addr_cache); + + /* Add routes */ + for (rtnlroute = FIRST_ROUTE (priv->route_cache); rtnlroute; rtnlroute = NEXT_ROUTE (rtnlroute)) { + /* Make sure it's an IPv6 route for this device */ + if (rtnl_route_get_oif (rtnlroute) != device->ifindex) + continue; + if (rtnl_route_get_family (rtnlroute) != AF_INET6) + continue; + + nldest = rtnl_route_get_dst (rtnlroute); + if (!nldest || nl_addr_get_family (nldest) != AF_INET6) + continue; + dest = nl_addr_get_binary_addr (nldest); + + nlgateway = rtnl_route_get_gateway (rtnlroute); + if (!nlgateway || nl_addr_get_family (nlgateway) != AF_INET6) + continue; + gateway = nl_addr_get_binary_addr (nlgateway); + + if (rtnl_route_get_dst_len (rtnlroute) == 0) { + /* Default gateway route; don't add to normal routes but to each address */ + if (!defgw_set) { + memcpy (&defgw, gateway, sizeof (defgw)); + defgw_set = TRUE; + } + continue; + } + + /* Also ignore link-local routes where the destination and gateway are + * the same, which apparently get added by the kernel but return -EINVAL + * when we try to add them via netlink. + */ + if (gateway && IN6_ARE_ADDR_EQUAL (dest, gateway)) + continue; + + ip6route = nm_ip6_route_new (); + nm_ip6_route_set_dest (ip6route, dest); + nm_ip6_route_set_prefix (ip6route, rtnl_route_get_dst_len (rtnlroute)); + nm_ip6_route_set_next_hop (ip6route, gateway); + metric = rtnl_route_get_metric (rtnlroute, 1); + if (metric != UINT_MAX) + nm_ip6_route_set_metric (ip6route, metric); + nm_ip6_config_take_route (config, ip6route); + } + + /* Add addresses */ + for (rtnladdr = FIRST_ADDR (priv->addr_cache); rtnladdr; rtnladdr = NEXT_ADDR (rtnladdr)) { + if (rtnl_addr_get_ifindex (rtnladdr) != device->ifindex) + continue; + + nladdr = rtnl_addr_get_local (rtnladdr); + if (!nladdr || nl_addr_get_family (nladdr) != AF_INET6) + continue; + + addr = nl_addr_get_binary_addr (nladdr); + ip6addr = nm_ip6_address_new (); + nm_ip6_address_set_prefix (ip6addr, rtnl_addr_get_prefixlen (rtnladdr)); + nm_ip6_address_set_address (ip6addr, addr); + nm_ip6_config_take_address (config, ip6addr); + if (defgw_set) + nm_ip6_address_set_gateway (ip6addr, &defgw); + } + + /* Add DNS servers */ + if (device->rdnss_servers) { + NMIP6RDNSS *rdnss = (NMIP6RDNSS *)(device->rdnss_servers->data); + + for (i = 0; i < device->rdnss_servers->len; i++) + nm_ip6_config_add_nameserver (config, &rdnss[i].addr); + } + + return config; +} + +/******************************************************************/ + +static NMIP6Manager * +nm_ip6_manager_new (void) +{ + NMIP6Manager *manager; + NMIP6ManagerPrivate *priv; + + manager = g_object_new (NM_TYPE_IP6_MANAGER, NULL); + priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + + if (!priv->devices) { + nm_log_err (LOGD_IP6, "not enough memory to initialize IP6 manager tables"); + g_object_unref (manager); + manager = NULL; + } + + return manager; +} + +static NMIP6Manager *singleton = NULL; + +NMIP6Manager * +nm_ip6_manager_get (void) +{ + if (!singleton) { + singleton = nm_ip6_manager_new (); + g_assert (singleton); + } else + g_object_ref (singleton); + + return singleton; +} + +static void +nm_ip6_manager_init (NMIP6Manager *manager) +{ + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (manager); + + priv->devices = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, + (GDestroyNotify) nm_ip6_device_destroy); + + priv->monitor = nm_netlink_monitor_get (); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_IFADDR, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_IPV6_PREFIX, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_ND_USEROPT, NULL); + nm_netlink_monitor_subscribe (priv->monitor, RTNLGRP_LINK, NULL); + + priv->netlink_id = g_signal_connect (priv->monitor, "notification", + G_CALLBACK (netlink_notification), manager); + + priv->nlh = nm_netlink_get_default_handle (); + priv->addr_cache = rtnl_addr_alloc_cache (priv->nlh); + priv->route_cache = rtnl_route_alloc_cache (priv->nlh); +} + +static void +finalize (GObject *object) +{ + NMIP6ManagerPrivate *priv = NM_IP6_MANAGER_GET_PRIVATE (object); + + g_signal_handler_disconnect (priv->monitor, priv->netlink_id); + + g_hash_table_destroy (priv->devices); + g_object_unref (priv->monitor); + nl_cache_free (priv->addr_cache); + nl_cache_free (priv->route_cache); + + singleton = NULL; + + G_OBJECT_CLASS (nm_ip6_manager_parent_class)->finalize (object); +} + +static void +nm_ip6_manager_class_init (NMIP6ManagerClass *manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (manager_class); + + g_type_class_add_private (manager_class, sizeof (NMIP6ManagerPrivate)); + + /* virtual methods */ + object_class->finalize = finalize; + + /* signals */ + signals[ADDRCONF_COMPLETE] = + g_signal_new ("addrconf-complete", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMIP6ManagerClass, addrconf_complete), + NULL, NULL, + _nm_marshal_VOID__INT_UINT_BOOLEAN, + G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_BOOLEAN); + + signals[CONFIG_CHANGED] = + g_signal_new ("config-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMIP6ManagerClass, config_changed), + NULL, NULL, + _nm_marshal_VOID__INT_UINT_BOOLEAN, + G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_BOOLEAN); +} + diff --git a/src/ip6-manager/nm-ip6-manager.h b/src/ip6-manager/nm-ip6-manager.h new file mode 100644 index 00000000..77c11068 --- /dev/null +++ b/src/ip6-manager/nm-ip6-manager.h @@ -0,0 +1,86 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* nm-ip6-manager.c - Handle IPv6 address configuration for 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, 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) 2009 - 2010 Red Hat, Inc. + */ + +#ifndef NM_IP6_MANAGER_H +#define NM_IP6_MANAGER_H + +#include +#include + +#include + +#include "nm-ip6-config.h" + +#define NM_TYPE_IP6_MANAGER (nm_ip6_manager_get_type ()) +#define NM_IP6_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP6_MANAGER, NMIP6Manager)) +#define NM_IP6_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IP6_MANAGER, NMIP6ManagerClass)) +#define NM_IS_IP6_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IP6_MANAGER)) +#define NM_IS_IP6_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IP6_MANAGER)) +#define NM_IP6_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP6_MANAGER, NMIP6ManagerClass)) + +enum { + IP6_DHCP_OPT_NONE = 0, + IP6_DHCP_OPT_OTHERCONF, + IP6_DHCP_OPT_MANAGED +}; + +typedef struct { + GObject parent; +} NMIP6Manager; + +typedef struct { + GObjectClass parent; + + /* Signals */ + + /* addrconf_complete is emitted only during initial configuration to indicate + * that the initial configuration is complete. + */ + void (*addrconf_complete) (NMIP6Manager *manager, + guint32 ifindex, + guint dhcp_opts, + gboolean success); + + /* config_changed gets emitted only *after* initial configuration is + * complete; it's like DHCP renew and indicates that the existing config + * of the interface has changed. + */ + void (*config_changed) (NMIP6Manager *manager, + guint32 ifindex, + guint dhcp_opts, + gboolean success); +} NMIP6ManagerClass; + +GType nm_ip6_manager_get_type (void); + +NMIP6Manager *nm_ip6_manager_get (void); +void nm_ip6_manager_prepare_interface (NMIP6Manager *manager, + int ifindex, + NMSettingIP6Config *s_ip6, + const char *accept_ra_path); +void nm_ip6_manager_begin_addrconf (NMIP6Manager *manager, + int ifindex); +void nm_ip6_manager_cancel_addrconf (NMIP6Manager *manager, + int ifindex); + +NMIP6Config * nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, + int ifindex); + +#endif /* NM_IP6_MANAGER_H */ diff --git a/src/logging/Makefile.am b/src/logging/Makefile.am new file mode 100644 index 00000000..51a6b25d --- /dev/null +++ b/src/logging/Makefile.am @@ -0,0 +1,15 @@ +noinst_LTLIBRARIES = libnm-logging.la + +libnm_logging_la_SOURCES = \ + nm-logging.c \ + nm-logging.h + +libnm_logging_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DG_DISABLE_DEPRECATED + +libnm_logging_la_LIBADD = \ + -ldl \ + $(GLIB_LIBS) + diff --git a/src/logging/Makefile.in b/src/logging/Makefile.in new file mode 100644 index 00000000..8cbe2922 --- /dev/null +++ b/src/logging/Makefile.in @@ -0,0 +1,556 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/logging +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libnm_logging_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libnm_logging_la_OBJECTS = libnm_logging_la-nm-logging.lo +libnm_logging_la_OBJECTS = $(am_libnm_logging_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnm_logging_la_SOURCES) +DIST_SOURCES = $(libnm_logging_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libnm-logging.la +libnm_logging_la_SOURCES = \ + nm-logging.c \ + nm-logging.h + +libnm_logging_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DG_DISABLE_DEPRECATED + +libnm_logging_la_LIBADD = \ + -ldl \ + $(GLIB_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/logging/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/logging/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnm-logging.la: $(libnm_logging_la_OBJECTS) $(libnm_logging_la_DEPENDENCIES) + $(LINK) $(libnm_logging_la_OBJECTS) $(libnm_logging_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_logging_la-nm-logging.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnm_logging_la-nm-logging.lo: nm-logging.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_logging_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_logging_la-nm-logging.lo -MD -MP -MF $(DEPDIR)/libnm_logging_la-nm-logging.Tpo -c -o libnm_logging_la-nm-logging.lo `test -f 'nm-logging.c' || echo '$(srcdir)/'`nm-logging.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_logging_la-nm-logging.Tpo $(DEPDIR)/libnm_logging_la-nm-logging.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-logging.c' object='libnm_logging_la-nm-logging.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_logging_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_logging_la-nm-logging.lo `test -f 'nm-logging.c' || echo '$(srcdir)/'`nm-logging.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c new file mode 100644 index 00000000..9d1905da --- /dev/null +++ b/src/logging/nm-logging.c @@ -0,0 +1,377 @@ +/* -*- 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) 2006 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "nm-logging.h" + +static guint32 log_level = LOGL_INFO | LOGL_WARN | LOGL_ERR; +static guint32 log_domains = \ + LOGD_HW | LOGD_RFKILL | LOGD_ETHER | LOGD_WIFI | LOGD_BT | LOGD_MB | \ + LOGD_DHCP4 | LOGD_DHCP6 | LOGD_PPP | LOGD_IP4 | LOGD_IP6 | LOGD_AUTOIP4 | \ + LOGD_DNS | LOGD_VPN | LOGD_SHARING | LOGD_SUPPLICANT | LOGD_USER_SET | \ + LOGD_SYS_SET | LOGD_SUSPEND | LOGD_CORE | LOGD_DEVICE | LOGD_OLPC_MESH; + +typedef struct { + guint32 num; + const char *name; +} LogDesc; + +static const LogDesc level_descs[] = { + { LOGL_ERR, "ERR" }, + { LOGL_WARN | LOGL_ERR, "WARN" }, + { LOGL_INFO | LOGL_WARN | LOGL_ERR, "INFO" }, + { LOGL_DEBUG | LOGL_INFO | LOGL_WARN | LOGL_ERR, "DEBUG" }, + { 0, NULL } +}; + +static const LogDesc domain_descs[] = { + { LOGD_NONE, "NONE" }, + { LOGD_HW, "HW" }, + { LOGD_RFKILL, "RFKILL" }, + { LOGD_ETHER, "ETHER" }, + { LOGD_WIFI, "WIFI" }, + { LOGD_BT, "BT" }, + { LOGD_MB, "MB" }, + { LOGD_DHCP4, "DHCP4" }, + { LOGD_DHCP6, "DHCP6" }, + { LOGD_PPP, "PPP" }, + { LOGD_WIFI_SCAN, "WIFI_SCAN" }, + { LOGD_IP4, "IP4" }, + { LOGD_IP6, "IP6" }, + { LOGD_AUTOIP4, "AUTOIP4" }, + { LOGD_DNS, "DNS" }, + { LOGD_VPN, "VPN" }, + { LOGD_SHARING, "SHARING" }, + { LOGD_SUPPLICANT,"SUPPLICANT" }, + { LOGD_USER_SET, "USER_SET" }, + { LOGD_SYS_SET, "SYS_SET" }, + { LOGD_SUSPEND, "SUSPEND" }, + { LOGD_CORE, "CORE" }, + { LOGD_DEVICE, "DEVICE" }, + { LOGD_OLPC_MESH, "OLPC" }, + { 0, NULL } +}; + +/************************************************************************/ + +enum { + NM_LOGGING_ERROR_UNKNOWN_LEVEL = 0, + NM_LOGGING_ERROR_UNKNOWN_DOMAIN = 1, +}; + +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GQuark +nm_logging_error_quark (void) +{ + static GQuark ret = 0; + + if (ret == 0) + ret = g_quark_from_static_string ("nm_logging_error"); + return ret; +} + +GType +nm_logging_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_LOGGING_ERROR_UNKNOWN_LEVEL, "UnknownLevel"), + ENUM_ENTRY (NM_LOGGING_ERROR_UNKNOWN_DOMAIN, "UnknownDomain"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMLoggingError", values); + } + return etype; +} + +/************************************************************************/ + +gboolean +nm_logging_setup (const char *level, const char *domains, GError **error) +{ + char **tmp, **iter; + guint32 new_domains = 0; + + /* levels */ + if (level && strlen (level)) { + gboolean found = FALSE; + const LogDesc *diter; + + for (diter = &level_descs[0]; diter->name; diter++) { + if (!strcasecmp (diter->name, level)) { + log_level = diter->num; + found = TRUE; + break; + } + } + + if (!found) { + g_set_error (error, NM_LOGGING_ERROR, NM_LOGGING_ERROR_UNKNOWN_LEVEL, + _("Unknown log level '%s'"), level); + return FALSE; + } + } + + /* domains */ + if (domains && strlen (domains)) { + tmp = g_strsplit_set (domains, ", ", 0); + for (iter = tmp; iter && *iter; iter++) { + const LogDesc *diter; + gboolean found = FALSE; + + if (!strlen (*iter)) + continue; + + for (diter = &domain_descs[0]; diter->name; diter++) { + if (!strcasecmp (diter->name, *iter)) { + new_domains |= diter->num; + found = TRUE; + break; + } + } + + if (!found) { + g_set_error (error, NM_LOGGING_ERROR, NM_LOGGING_ERROR_UNKNOWN_DOMAIN, + _("Unknown log domain '%s'"), *iter); + return FALSE; + } + } + g_strfreev (tmp); + log_domains = new_domains; + } + + return TRUE; +} + +const char * +nm_logging_level_to_string (void) +{ + const LogDesc *diter; + + for (diter = &level_descs[0]; diter->name; diter++) { + if (diter->num == log_level) + return diter->name; + } + g_warn_if_reached (); + return ""; +} + +char * +nm_logging_domains_to_string (void) +{ + const LogDesc *diter; + GString *str; + + str = g_string_sized_new (75); + for (diter = &domain_descs[0]; diter->name; diter++) { + if (diter->num & log_domains) { + if (str->len) + g_string_append_c (str, ','); + g_string_append (str, diter->name); + } + } + return g_string_free (str, FALSE); +} + +void _nm_log (const char *loc, + const char *func, + guint32 domain, + guint32 level, + const char *fmt, + ...) +{ + va_list args; + char *msg; + GTimeVal tv; + + if (!(log_level & level) || !(log_domains & domain)) + return; + + va_start (args, fmt); + msg = g_strdup_vprintf (fmt, args); + va_end (args); + + if ((log_level & LOGL_DEBUG) && (level == LOGL_DEBUG)) { + g_get_current_time (&tv); + syslog (LOG_INFO, " [%ld.%ld] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); + } else if ((log_level & LOGL_INFO) && (level == LOGL_INFO)) + syslog (LOG_INFO, " %s\n", msg); + else if ((log_level & LOGL_WARN) && (level == LOGL_WARN)) + syslog (LOG_WARNING, " %s\n", msg); + else if ((log_level & LOGL_ERR) && (level == LOGL_ERR)) { + g_get_current_time (&tv); + syslog (LOG_ERR, " [%ld.%ld] [%s] %s(): %s\n", tv.tv_sec, tv.tv_usec, loc, func, msg); + } + g_free (msg); +} + +/************************************************************************/ + +static void +fallback_get_backtrace (void) +{ + void *frames[64]; + Dl_info info; + size_t size; + guint32 i; + const char *name; + + size = backtrace (frames, G_N_ELEMENTS (frames)); + + syslog (LOG_CRIT, "******************* START **********************************"); + for (i = 0; i < size; i++) { + dladdr (frames[i], &info); + name = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)"; + if (info.dli_saddr) { + syslog (LOG_CRIT, "Frame %d: %s (%s+0x%lx) [%p]", + i, name, + info.dli_sname, + (gulong)(frames[i] - info.dli_saddr), + frames[i]); + } else { + syslog (LOG_CRIT, "Frame %d: %s (%p+0x%lx) [%p]", + i, name, + info.dli_fbase, + (gulong)(frames[i] - info.dli_saddr), + frames[i]); + } + } + syslog (LOG_CRIT, "******************* END **********************************"); +} + + +static gboolean +crashlogger_get_backtrace (void) +{ + gboolean success = FALSE; + int pid; + + pid = fork(); + if (pid > 0) + { + /* Wait for the child to finish */ + int estatus; + if (waitpid (pid, &estatus, 0) != -1) + { + /* Only succeed if the crashlogger succeeded */ + if (WIFEXITED (estatus) && (WEXITSTATUS (estatus) == 0)) + success = TRUE; + } + } + else if (pid == 0) + { + /* Child process */ + execl (LIBEXECDIR"/nm-crash-logger", + LIBEXECDIR"/nm-crash-logger", NULL); + } + + return success; +} + + +void +nm_logging_backtrace (void) +{ + struct stat s; + gboolean fallback = TRUE; + + /* Try to use gdb via nm-crash-logger if it exists, since + * we get much better information out of it. Otherwise + * fall back to execinfo. + */ + if (stat (LIBEXECDIR"/nm-crash-logger", &s) == 0) + fallback = crashlogger_get_backtrace () ? FALSE : TRUE; + + if (fallback) + fallback_get_backtrace (); +} + + +static void +nm_log_handler (const gchar *log_domain, + GLogLevelFlags level, + const gchar *message, + gpointer ignored) +{ + int syslog_priority; + + switch (level) { + case G_LOG_LEVEL_ERROR: + syslog_priority = LOG_CRIT; + break; + case G_LOG_LEVEL_CRITICAL: + syslog_priority = LOG_ERR; + break; + case G_LOG_LEVEL_WARNING: + syslog_priority = LOG_WARNING; + break; + case G_LOG_LEVEL_MESSAGE: + syslog_priority = LOG_NOTICE; + break; + case G_LOG_LEVEL_DEBUG: + syslog_priority = LOG_DEBUG; + break; + case G_LOG_LEVEL_INFO: + default: + syslog_priority = LOG_INFO; + break; + } + + syslog (syslog_priority, "%s", message); +} + +void +nm_logging_start (gboolean become_daemon) +{ + if (become_daemon) + openlog (G_LOG_DOMAIN, LOG_PID, LOG_DAEMON); + else + openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR | LOG_PID, LOG_USER); + + g_log_set_handler (G_LOG_DOMAIN, + G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, + nm_log_handler, + NULL); +} + +void +nm_logging_shutdown (void) +{ + closelog (); +} diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h new file mode 100644 index 00000000..2eedf5ff --- /dev/null +++ b/src/logging/nm-logging.h @@ -0,0 +1,111 @@ +/* -*- 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) 2006 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef NM_LOGGING_H +#define NM_LOGGING_H + +#include +#include + +/* Log domains */ +enum { + LOGD_NONE = 0x00000000, + LOGD_HW = 0x00000001, /* Hardware detection and info */ + LOGD_RFKILL = 0x00000002, + LOGD_ETHER = 0x00000004, + LOGD_WIFI = 0x00000008, + LOGD_BT = 0x00000010, + LOGD_MB = 0x00000020, /* mobile broadband */ + LOGD_DHCP4 = 0x00000040, + LOGD_DHCP6 = 0x00000080, + LOGD_PPP = 0x00000100, + LOGD_WIFI_SCAN = 0x00000200, + LOGD_IP4 = 0x00000400, + LOGD_IP6 = 0x00000800, + LOGD_AUTOIP4 = 0x00001000, + LOGD_DNS = 0x00002000, + LOGD_VPN = 0x00004000, + LOGD_SHARING = 0x00008000, /* Connection sharing/dnsmasq */ + LOGD_SUPPLICANT = 0x00010000, /* WiFi and 802.1x */ + LOGD_USER_SET = 0x00020000, /* User settings */ + LOGD_SYS_SET = 0x00040000, /* System settings */ + LOGD_SUSPEND = 0x00080000, /* Suspend/Resume */ + LOGD_CORE = 0x00100000, /* Core daemon and policy stuff */ + LOGD_DEVICE = 0x00200000, /* Device state and activation */ + LOGD_OLPC_MESH = 0x00400000, +}; + +#define LOGD_DHCP (LOGD_DHCP4 | LOGD_DHCP6) + +/* Log levels */ +enum { + LOGL_ERR = 0x00000001, + LOGL_WARN = 0x00000002, + LOGL_INFO = 0x00000004, + LOGL_DEBUG = 0x00000008 +}; + +#define NM_LOGGING_ERROR (nm_logging_error_quark ()) +#define NM_TYPE_LOGGING_ERROR (nm_logging_error_get_type ()) +GQuark nm_logging_error_quark (void); +GType nm_logging_error_get_type (void); + + +#define nm_log_err(domain, fmt, args...) \ + { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_ERR, fmt, ##args); } + +#define nm_log_warn(domain, fmt, args...) \ + { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_WARN, fmt, ##args); } + +#define nm_log_info(domain, fmt, args...) \ + { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_INFO, fmt, ##args); } + +#define nm_log_dbg(domain, fmt, args...) \ + { _nm_log (G_STRLOC, G_STRFUNC, domain, LOGL_DEBUG, fmt, ##args); } + +#define nm_log(domain, level, fmt, args...) \ + { _nm_log (G_STRLOC, G_STRFUNC, domain, level, fmt, ##args); } + +void _nm_log (const char *loc, const char *func, + guint32 domain, guint32 level, + const char *fmt, ...); + +const char *nm_logging_level_to_string (void); +char *nm_logging_domains_to_string (void); + +/* Undefine the nm-utils.h logging stuff to ensure errors */ +#undef nm_print_backtrace +#undef nm_get_timestamp +#undef nm_info +#undef nm_info_str +#undef nm_debug +#undef nm_debug_str +#undef nm_warning +#undef nm_warning_str +#undef nm_error +#undef nm_error_str + +gboolean nm_logging_setup (const char *level, const char *domains, GError **error); +void nm_logging_start (gboolean become_daemon); +void nm_logging_backtrace (void); +void nm_logging_shutdown (void); + +#endif /* NM_LOGGING_H */ diff --git a/src/main.c b/src/main.c new file mode 100644 index 00000000..c2fb58be --- /dev/null +++ b/src/main.c @@ -0,0 +1,758 @@ +/* -*- 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 - 2010 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "NetworkManager.h" +#include "NetworkManagerUtils.h" +#include "nm-manager.h" +#include "nm-policy.h" +#include "nm-system.h" +#include "nm-named-manager.h" +#include "nm-dbus-manager.h" +#include "nm-supplicant-manager.h" +#include "nm-dhcp-manager.h" +#include "nm-hostname-provider.h" +#include "nm-netlink-monitor.h" +#include "nm-vpn-manager.h" +#include "nm-logging.h" + +#if !defined(NM_DIST_VERSION) +# define NM_DIST_VERSION VERSION +#endif + +#define NM_DEFAULT_PID_FILE LOCALSTATEDIR"/run/NetworkManager.pid" +#define NM_DEFAULT_SYSTEM_CONF_FILE SYSCONFDIR"/NetworkManager/NetworkManager.conf" +#define NM_OLD_SYSTEM_CONF_FILE SYSCONFDIR"/NetworkManager/nm-system-settings.conf" +#define NM_DEFAULT_SYSTEM_STATE_FILE LOCALSTATEDIR"/lib/NetworkManager/NetworkManager.state" + +/* + * Globals + */ +static NMManager *manager = NULL; +static GMainLoop *main_loop = NULL; + +typedef struct { + time_t time; + GQuark domain; + guint32 code; + guint32 count; +} MonitorInfo; + +static gboolean +detach_monitor (gpointer data) +{ + nm_log_warn (LOGD_HW, "detaching netlink event monitor"); + nm_netlink_monitor_detach (NM_NETLINK_MONITOR (data)); + return FALSE; +} + +static void +nm_error_monitoring_device_link_state (NMNetlinkMonitor *monitor, + GError *error, + gpointer user_data) +{ + MonitorInfo *info = (MonitorInfo *) user_data; + time_t now; + + now = time (NULL); + + if ( (info->domain != error->domain) + || (info->code != error->code) + || (info->time && now > info->time + 10)) { + /* FIXME: Try to handle the error instead of just printing it. */ + nm_log_warn (LOGD_HW, "error monitoring device for netlink events: %s\n", error->message); + + info->time = now; + info->domain = error->domain; + info->code = error->code; + info->count = 0; + } + + info->count++; + if (info->count > 100) { + /* Broken drivers will sometimes cause a flood of netlink errors. + * rh #459205, novell #443429, lp #284507 + */ + nm_log_warn (LOGD_HW, "excessive netlink errors ocurred, disabling netlink monitor."); + nm_log_warn (LOGD_HW, "link change events will not be processed."); + g_idle_add_full (G_PRIORITY_HIGH, detach_monitor, monitor, NULL); + } +} + +static gboolean +nm_monitor_setup (GError **error) +{ + NMNetlinkMonitor *monitor; + MonitorInfo *info; + + monitor = nm_netlink_monitor_get (); + if (!nm_netlink_monitor_open_connection (monitor, error)) { + g_object_unref (monitor); + return FALSE; + } + + info = g_new0 (MonitorInfo, 1); + g_signal_connect_data (G_OBJECT (monitor), "error", + G_CALLBACK (nm_error_monitoring_device_link_state), + info, + (GClosureNotify) g_free, + 0); + nm_netlink_monitor_attach (monitor); + + /* Request initial status of cards */ + nm_netlink_monitor_request_status (monitor, NULL); + + return TRUE; +} + +static gboolean quit_early = FALSE; + +static void +nm_signal_handler (int signo) +{ + static int in_fatal = 0; + + /* avoid loops */ + if (in_fatal > 0) + return; + ++in_fatal; + + switch (signo) + { + case SIGSEGV: + case SIGBUS: + case SIGILL: + case SIGABRT: + nm_log_warn (LOGD_CORE, "caught signal %d. Generating backtrace...", signo); + nm_logging_backtrace (); + exit (1); + break; + + case SIGFPE: + case SIGPIPE: + /* let the fatal signals interrupt us */ + --in_fatal; + + nm_log_warn (LOGD_CORE, "caught signal %d, shutting down abnormally. Generating backtrace...", signo); + nm_logging_backtrace (); + g_main_loop_quit (main_loop); + break; + + case SIGINT: + case SIGTERM: + /* let the fatal signals interrupt us */ + --in_fatal; + + nm_log_info (LOGD_CORE, "caught signal %d, shutting down normally.", signo); + quit_early = TRUE; + g_main_loop_quit (main_loop); + break; + + case SIGHUP: + --in_fatal; + /* FIXME: + * Reread config stuff like system config files, VPN service files, etc + */ + break; + + case SIGUSR1: + --in_fatal; + /* FIXME: + * Play with log levels or something + */ + break; + + default: + signal (signo, nm_signal_handler); + break; + } +} + +static void +setup_signals (void) +{ + struct sigaction action; + sigset_t mask; + + sigemptyset (&mask); + action.sa_handler = nm_signal_handler; + action.sa_mask = mask; + action.sa_flags = 0; + sigaction (SIGTERM, &action, NULL); + sigaction (SIGINT, &action, NULL); + sigaction (SIGILL, &action, NULL); + sigaction (SIGBUS, &action, NULL); + sigaction (SIGFPE, &action, NULL); + sigaction (SIGHUP, &action, NULL); + sigaction (SIGSEGV, &action, NULL); + sigaction (SIGABRT, &action, NULL); + sigaction (SIGUSR1, &action, NULL); +} + +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; + } + + 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 +parse_config_file (const char *filename, + char **plugins, + char **dhcp_client, + char **log_level, + char **log_domains, + GError **error) +{ + GKeyFile *config; + + config = g_key_file_new (); + if (!config) { + g_set_error (error, 0, 0, + "Not enough memory to load config file."); + return FALSE; + } + + g_key_file_set_list_separator (config, ','); + if (!g_key_file_load_from_file (config, filename, G_KEY_FILE_NONE, error)) + return FALSE; + + *plugins = g_key_file_get_value (config, "main", "plugins", error); + if (*error) + return FALSE; + + *dhcp_client = g_key_file_get_value (config, "main", "dhcp", NULL); + + *log_level = g_key_file_get_value (config, "logging", "level", NULL); + *log_domains = g_key_file_get_value (config, "logging", "domains", NULL); + + g_key_file_free (config); + return TRUE; +} + +static gboolean +parse_state_file (const char *filename, + gboolean *net_enabled, + gboolean *wifi_enabled, + gboolean *wwan_enabled, + GError **error) +{ + GKeyFile *state_file; + GError *tmp_error = NULL; + gboolean wifi, net, wwan; + + g_return_val_if_fail (net_enabled != NULL, FALSE); + g_return_val_if_fail (wifi_enabled != NULL, FALSE); + g_return_val_if_fail (wwan_enabled != NULL, FALSE); + + state_file = g_key_file_new (); + if (!state_file) { + g_set_error (error, 0, 0, + "Not enough memory to load state file."); + return FALSE; + } + + g_key_file_set_list_separator (state_file, ','); + if (!g_key_file_load_from_file (state_file, filename, G_KEY_FILE_KEEP_COMMENTS, &tmp_error)) { + /* This is kinda ugly; create the file and directory if it doesn't + * exist yet. We can't rely on distros necessarily creating the + * /var/lib/NetworkManager for us since we have to ensure that + * users upgrading NM get this working too. + */ + if ( tmp_error->domain == G_FILE_ERROR + && tmp_error->code == G_FILE_ERROR_NOENT) { + char *data, *dirname; + gsize len = 0; + gboolean ret = FALSE; + + /* try to create the directory if it doesn't exist */ + dirname = g_path_get_dirname (filename); + errno = 0; + if (mkdir (dirname, 0755) != 0) { + if (errno != EEXIST) { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_ACCES, + "Error creating state directory %s: %d", dirname, errno); + g_free (dirname); + return FALSE; + } + } + g_free (dirname); + + /* Write out the initial state to the state file */ + g_key_file_set_boolean (state_file, "main", "NetworkingEnabled", *net_enabled); + g_key_file_set_boolean (state_file, "main", "WirelessEnabled", *wifi_enabled); + g_key_file_set_boolean (state_file, "main", "WWANEnabled", *wwan_enabled); + + data = g_key_file_to_data (state_file, &len, NULL); + if (data) + ret = g_file_set_contents (filename, data, len, error); + g_free (data); + + return ret; + } else { + g_set_error_literal (error, tmp_error->domain, tmp_error->code, tmp_error->message); + g_clear_error (&tmp_error); + } + + /* Otherwise, file probably corrupt or inaccessible */ + return FALSE; + } + + /* Reading state bits of NetworkManager; an error leaves the passed-in state + * value unchanged. + */ + net = g_key_file_get_boolean (state_file, "main", "NetworkingEnabled", &tmp_error); + if (tmp_error) + g_set_error_literal (error, tmp_error->domain, tmp_error->code, tmp_error->message); + else + *net_enabled = net; + g_clear_error (&tmp_error); + + wifi = g_key_file_get_boolean (state_file, "main", "WirelessEnabled", &tmp_error); + if (tmp_error) { + g_clear_error (error); + g_set_error_literal (error, tmp_error->domain, tmp_error->code, tmp_error->message); + } else + *wifi_enabled = wifi; + g_clear_error (&tmp_error); + + wwan = g_key_file_get_boolean (state_file, "main", "WWANEnabled", &tmp_error); + if (tmp_error) { + g_clear_error (error); + g_set_error_literal (error, tmp_error->domain, tmp_error->code, tmp_error->message); + } else + *wwan_enabled = wwan; + g_clear_error (&tmp_error); + + g_key_file_free (state_file); + + return TRUE; +} + +/* + * main + * + */ +int +main (int argc, char *argv[]) +{ + GOptionContext *opt_ctx = NULL; + gboolean become_daemon = FALSE; + gboolean g_fatal_warnings = FALSE; + char *pidfile = NULL, *state_file = NULL, *dhcp = NULL; + char *config = NULL, *plugins = NULL, *conf_plugins = NULL; + char *log_level = NULL, *log_domains = NULL; + gboolean wifi_enabled = TRUE, net_enabled = TRUE, wwan_enabled = TRUE; + gboolean success; + NMPolicy *policy = NULL; + NMVPNManager *vpn_manager = NULL; + NMNamedManager *named_mgr = NULL; + NMDBusManager *dbus_mgr = NULL; + NMSupplicantManager *sup_mgr = NULL; + NMDHCPManager *dhcp_mgr = NULL; + GError *error = NULL; + gboolean wrote_pidfile = FALSE; + char *cfg_log_level = NULL, *cfg_log_domains = NULL; + + GOptionEntry options[] = { + { "no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, "Don't become a daemon", NULL }, + { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &g_fatal_warnings, "Make all warnings fatal", NULL }, + { "pid-file", 0, 0, G_OPTION_ARG_FILENAME, &pidfile, "Specify the location of a PID file", "filename" }, + { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &state_file, "State file location", "/path/to/state.file" }, + { "config", 0, 0, G_OPTION_ARG_FILENAME, &config, "Config file location", "/path/to/config.file" }, + { "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ','", "plugin1,plugin2" }, + { "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of [ERR, WARN, INFO, DEBUG]", "INFO" }, + { "log-domains", 0, 0, G_OPTION_ARG_STRING, &log_domains, + "Log domains separated by ',': any combination of [NONE,HW,RKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,USER_SET,SYS_SET,SUSPEND,CORE,DEVICE,OLPC]", + "HW,RFKILL,WIFI" }, + {NULL} + }; + + if (getuid () != 0) { + fprintf (stderr, "You must be root to run NetworkManager!\n"); + exit (1); + } + + if (!g_module_supported ()) { + fprintf (stderr, "GModules are not supported on your platform!\n"); + exit (1); + } + + bindtextdomain (GETTEXT_PACKAGE, NMLOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + /* Parse options */ + opt_ctx = g_option_context_new (""); + g_option_context_set_translation_domain (opt_ctx, "UTF-8"); + 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, + "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."); + + success = g_option_context_parse (opt_ctx, &argc, &argv, NULL); + g_option_context_free (opt_ctx); + + if (!success) { + fprintf (stderr, _("Invalid option. Please use --help to see a list of valid options.\n")); + exit (1); + } + + /* 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); + + 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); + + /* Parse the config file */ + if (config) { + if (!parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error)) { + fprintf (stderr, "Config file %s invalid: (%d) %s\n", + config, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + exit (1); + } + } else { + gboolean parsed = FALSE; + + /* Even though we prefer NetworkManager.conf, we need to check the + * old nm-system-settings.conf first to preserve compat with older + * setups. In package managed systems dropping a NetworkManager.conf + * onto the system would make NM use it instead of nm-system-settings.conf, + * changing behavior during an upgrade. We don't want that. + */ + + /* Try deprecated nm-system-settings.conf first */ + if (g_file_test (NM_OLD_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { + config = g_strdup (NM_OLD_SYSTEM_CONF_FILE); + parsed = parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error); + if (!parsed) { + fprintf (stderr, "Default config file %s invalid: (%d) %s\n", + config, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + g_free (config); + config = NULL; + g_clear_error (&error); + } + } + + /* Try the preferred NetworkManager.conf last */ + if (!parsed && g_file_test (NM_DEFAULT_SYSTEM_CONF_FILE, G_FILE_TEST_EXISTS)) { + config = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); + parsed = parse_config_file (config, &conf_plugins, &dhcp, &cfg_log_level, &cfg_log_domains, &error); + if (!parsed) { + fprintf (stderr, "Default config file %s invalid: (%d) %s\n", + config, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + g_free (config); + config = NULL; + g_clear_error (&error); + } + } + } + /* Logging setup */ + if (!nm_logging_setup (log_level ? log_level : cfg_log_level, + log_domains ? log_domains : cfg_log_domains, + &error)) { + fprintf (stderr, + _("%s. Please use --help to see a list of valid options.\n"), + error->message); + exit (1); + } + + /* Plugins specified with '--plugins' override those of config file */ + plugins = plugins ? plugins : g_strdup (conf_plugins); + g_free (conf_plugins); + + /* Parse the state file */ + if (!parse_state_file (state_file, &net_enabled, &wifi_enabled, &wwan_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); + + /* Tricky: become_daemon is FALSE by default, so unless it's TRUE because + * of a CLI option, it'll become TRUE after this + */ + become_daemon = !become_daemon; + if (become_daemon) { + 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 (write_pidfile (pidfile)) + wrote_pidfile = TRUE; + } + + if (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); + } + + /* + * 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); + + g_type_init (); + if (!g_thread_supported ()) + g_thread_init (NULL); + dbus_g_thread_init (); + + setup_signals (); + + nm_logging_start (become_daemon); + + nm_log_info (LOGD_CORE, "NetworkManager (version " NM_DIST_VERSION ") is starting..."); + success = FALSE; + + if (config) + nm_log_info (LOGD_CORE, "Read config file %s", config); + + main_loop = g_main_loop_new (NULL, FALSE); + + /* Create watch functions that monitor cards for link status. */ + if (!nm_monitor_setup (&error)) { + nm_log_err (LOGD_CORE, "failed to start monitoring devices: %s.", + error && error->message ? error->message : "(unknown)"); + goto done; + } + + /* Initialize our DBus service & connection */ + dbus_mgr = nm_dbus_manager_get (); + + vpn_manager = nm_vpn_manager_get (); + if (!vpn_manager) { + nm_log_err (LOGD_CORE, "failed to start the VPN manager."); + goto done; + } + + named_mgr = nm_named_manager_get (); + if (!named_mgr) { + nm_log_err (LOGD_CORE, "failed to start the named manager."); + goto done; + } + + manager = nm_manager_get (config, + plugins, + state_file, + net_enabled, + wifi_enabled, + wwan_enabled, + &error); + if (manager == NULL) { + nm_log_err (LOGD_CORE, "failed to initialize the network manager: %s", + error && error->message ? error->message : "(unknown)"); + goto done; + } + + policy = nm_policy_new (manager, vpn_manager); + if (policy == NULL) { + nm_log_err (LOGD_CORE, "failed to initialize the policy."); + goto done; + } + + /* Initialize the supplicant manager */ + sup_mgr = nm_supplicant_manager_get (); + if (!sup_mgr) { + nm_log_err (LOGD_CORE, "failed to initialize the supplicant manager."); + goto done; + } + + /* Initialize DHCP manager */ + dhcp_mgr = nm_dhcp_manager_new (dhcp, &error); + if (!dhcp_mgr) { + nm_log_err (LOGD_CORE, "failed to start the DHCP manager: %s.", error->message); + goto done; + } + + nm_dhcp_manager_set_hostname_provider (dhcp_mgr, NM_HOSTNAME_PROVIDER (manager)); + + /* 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; + } + + nm_manager_start (manager); + + /* Bring up the loopback interface. */ + nm_system_enable_loopback (); + + success = TRUE; + + /* Told to quit before getting to the mainloop by the signal handler */ + if (quit_early == TRUE) + goto done; + + g_main_loop_run (main_loop); + +done: + if (policy) + nm_policy_destroy (policy); + + if (manager) + g_object_unref (manager); + + if (vpn_manager) + g_object_unref (vpn_manager); + + if (named_mgr) + g_object_unref (named_mgr); + + if (dhcp_mgr) + g_object_unref (dhcp_mgr); + + if (sup_mgr) + g_object_unref (sup_mgr); + + if (dbus_mgr) + g_object_unref (dbus_mgr); + + nm_logging_shutdown (); + + if (pidfile && wrote_pidfile) + unlink (pidfile); + + /* Free options */ + g_free (pidfile); + g_free (state_file); + g_free (config); + g_free (plugins); + g_free (dhcp); + g_free (log_level); + g_free (log_domains); + g_free (cfg_log_level); + g_free (cfg_log_domains); + + nm_log_info (LOGD_CORE, "exiting (%s)", success ? "success" : "error"); + exit (success ? 0 : 1); +} diff --git a/src/modem-manager/Makefile.am b/src/modem-manager/Makefile.am new file mode 100644 index 00000000..a0f65c1b --- /dev/null +++ b/src/modem-manager/Makefile.am @@ -0,0 +1,35 @@ +INCLUDES = \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_builddir}/marshallers + +noinst_LTLIBRARIES = libmodem-manager.la + +libmodem_manager_la_SOURCES = \ + nm-modem.c \ + nm-modem.h \ + nm-modem-cdma.c \ + nm-modem-cdma.h \ + nm-modem-gsm.c \ + nm-modem-gsm.h \ + nm-modem-manager.h \ + nm-modem-manager.c \ + nm-modem-types.h + +libmodem_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) + +libmodem_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) + +nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml + dbus-binding-tool --prefix=nm_serial_device --mode=glib-server --output=$@ $< + +BUILT_SOURCES = \ + nm-serial-device-glue.h + +CLEANFILES = $(BUILT_SOURCES) diff --git a/src/modem-manager/Makefile.in b/src/modem-manager/Makefile.in new file mode 100644 index 00000000..26e67a1d --- /dev/null +++ b/src/modem-manager/Makefile.in @@ -0,0 +1,611 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/modem-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libmodem_manager_la_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) +am_libmodem_manager_la_OBJECTS = libmodem_manager_la-nm-modem.lo \ + libmodem_manager_la-nm-modem-cdma.lo \ + libmodem_manager_la-nm-modem-gsm.lo \ + libmodem_manager_la-nm-modem-manager.lo +libmodem_manager_la_OBJECTS = $(am_libmodem_manager_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libmodem_manager_la_SOURCES) +DIST_SOURCES = $(libmodem_manager_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_builddir}/marshallers + +noinst_LTLIBRARIES = libmodem-manager.la +libmodem_manager_la_SOURCES = \ + nm-modem.c \ + nm-modem.h \ + nm-modem-cdma.c \ + nm-modem-cdma.h \ + nm-modem-gsm.c \ + nm-modem-gsm.h \ + nm-modem-manager.h \ + nm-modem-manager.c \ + nm-modem-types.h + +libmodem_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) + +libmodem_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) + +BUILT_SOURCES = \ + nm-serial-device-glue.h + +CLEANFILES = $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modem-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/modem-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmodem-manager.la: $(libmodem_manager_la_OBJECTS) $(libmodem_manager_la_DEPENDENCIES) + $(LINK) $(libmodem_manager_la_OBJECTS) $(libmodem_manager_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodem_manager_la-nm-modem-cdma.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodem_manager_la-nm-modem-gsm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodem_manager_la-nm-modem-manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodem_manager_la-nm-modem.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libmodem_manager_la-nm-modem.lo: nm-modem.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodem_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmodem_manager_la-nm-modem.lo -MD -MP -MF $(DEPDIR)/libmodem_manager_la-nm-modem.Tpo -c -o libmodem_manager_la-nm-modem.lo `test -f 'nm-modem.c' || echo '$(srcdir)/'`nm-modem.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmodem_manager_la-nm-modem.Tpo $(DEPDIR)/libmodem_manager_la-nm-modem.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-modem.c' object='libmodem_manager_la-nm-modem.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodem_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmodem_manager_la-nm-modem.lo `test -f 'nm-modem.c' || echo '$(srcdir)/'`nm-modem.c + +libmodem_manager_la-nm-modem-cdma.lo: nm-modem-cdma.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodem_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmodem_manager_la-nm-modem-cdma.lo -MD -MP -MF $(DEPDIR)/libmodem_manager_la-nm-modem-cdma.Tpo -c -o libmodem_manager_la-nm-modem-cdma.lo `test -f 'nm-modem-cdma.c' || echo '$(srcdir)/'`nm-modem-cdma.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmodem_manager_la-nm-modem-cdma.Tpo $(DEPDIR)/libmodem_manager_la-nm-modem-cdma.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-modem-cdma.c' object='libmodem_manager_la-nm-modem-cdma.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodem_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmodem_manager_la-nm-modem-cdma.lo `test -f 'nm-modem-cdma.c' || echo '$(srcdir)/'`nm-modem-cdma.c + +libmodem_manager_la-nm-modem-gsm.lo: nm-modem-gsm.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodem_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmodem_manager_la-nm-modem-gsm.lo -MD -MP -MF $(DEPDIR)/libmodem_manager_la-nm-modem-gsm.Tpo -c -o libmodem_manager_la-nm-modem-gsm.lo `test -f 'nm-modem-gsm.c' || echo '$(srcdir)/'`nm-modem-gsm.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmodem_manager_la-nm-modem-gsm.Tpo $(DEPDIR)/libmodem_manager_la-nm-modem-gsm.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-modem-gsm.c' object='libmodem_manager_la-nm-modem-gsm.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodem_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmodem_manager_la-nm-modem-gsm.lo `test -f 'nm-modem-gsm.c' || echo '$(srcdir)/'`nm-modem-gsm.c + +libmodem_manager_la-nm-modem-manager.lo: nm-modem-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodem_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmodem_manager_la-nm-modem-manager.lo -MD -MP -MF $(DEPDIR)/libmodem_manager_la-nm-modem-manager.Tpo -c -o libmodem_manager_la-nm-modem-manager.lo `test -f 'nm-modem-manager.c' || echo '$(srcdir)/'`nm-modem-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libmodem_manager_la-nm-modem-manager.Tpo $(DEPDIR)/libmodem_manager_la-nm-modem-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-modem-manager.c' object='libmodem_manager_la-nm-modem-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodem_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmodem_manager_la-nm-modem-manager.lo `test -f 'nm-modem-manager.c' || echo '$(srcdir)/'`nm-modem-manager.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml + dbus-binding-tool --prefix=nm_serial_device --mode=glib-server --output=$@ $< + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c new file mode 100644 index 00000000..c32c1822 --- /dev/null +++ b/src/modem-manager/nm-modem-cdma.c @@ -0,0 +1,351 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ + +#include + +#include "nm-dbus-glib-types.h" +#include "nm-modem-cdma.h" +#include "nm-modem-types.h" +#include "nm-device.h" +#include "nm-dbus-manager.h" +#include "nm-setting-connection.h" +#include "nm-setting-cdma.h" +#include "NetworkManagerUtils.h" +#include "nm-logging.h" + +G_DEFINE_TYPE (NMModemCdma, nm_modem_cdma, NM_TYPE_MODEM) + +#define NM_MODEM_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_CDMA, NMModemCdmaPrivate)) + +typedef struct { + DBusGProxyCall *call; + + GHashTable *connect_properties; +} NMModemCdmaPrivate; + + +typedef enum { + NM_CDMA_ERROR_CONNECTION_NOT_CDMA = 0, + NM_CDMA_ERROR_CONNECTION_INVALID, + NM_CDMA_ERROR_CONNECTION_INCOMPATIBLE, +} NMCdmaError; + +#define NM_CDMA_ERROR (nm_cdma_error_quark ()) +#define NM_TYPE_CDMA_ERROR (nm_cdma_error_get_type ()) + +static GQuark +nm_cdma_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-cdma-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +static GType +nm_cdma_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Connection was not a CDMA connection. */ + ENUM_ENTRY (NM_CDMA_ERROR_CONNECTION_NOT_CDMA, "ConnectionNotCdma"), + /* Connection was not a valid CDMA connection. */ + ENUM_ENTRY (NM_CDMA_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + /* Connection does not apply to this device. */ + ENUM_ENTRY (NM_CDMA_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMCdmaError", values); + } + return etype; +} + + +NMModem * +nm_modem_cdma_new (const char *path, + const char *device, + const char *data_device, + guint32 ip_method) +{ + g_return_val_if_fail (path != NULL, NULL); + g_return_val_if_fail (device != NULL, NULL); + g_return_val_if_fail (data_device != NULL, NULL); + + return (NMModem *) g_object_new (NM_TYPE_MODEM_CDMA, + NM_MODEM_PATH, path, + NM_MODEM_DEVICE, device, + NM_MODEM_IFACE, data_device, + NM_MODEM_IP_METHOD, ip_method, + NULL); +} + +static void +stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) +{ + NMModemCdma *self = NM_MODEM_CDMA (user_data); + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); + GError *error = NULL; + + priv->call = NULL; + + if (priv->connect_properties) { + g_hash_table_destroy (priv->connect_properties); + priv->connect_properties = NULL; + } + + if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE); + else { + nm_log_warn (LOGD_MB, "CDMA connection failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_NONE); + } +} + +static void +do_connect (NMModemCdma *self) +{ + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (NM_MODEM (self), MM_DBUS_INTERFACE_MODEM_SIMPLE); + priv->call = dbus_g_proxy_begin_call_with_timeout (proxy, + "Connect", stage1_prepare_done, + self, NULL, 120000, + DBUS_TYPE_G_MAP_OF_VARIANT, priv->connect_properties, + G_TYPE_INVALID); +} + +static void +stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMModemCdma *self = NM_MODEM_CDMA (user_data); + GError *error = NULL; + + if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) + do_connect (self); + else { + nm_log_warn (LOGD_MB, "CDMA modem enable failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); + } +} + +static GHashTable * +create_connect_properties (NMConnection *connection) +{ + NMSettingCdma *setting; + GHashTable *properties; + const char *str; + + setting = NM_SETTING_CDMA (nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA)); + properties = value_hash_create (); + + str = nm_setting_cdma_get_number (setting); + if (str) + value_hash_add_str (properties, "number", str); + + return properties; +} + +static NMActStageReturn +real_act_stage1_prepare (NMModem *modem, + NMActRequest *req, + GPtrArray **out_hints, + const char **out_setting_name, + NMDeviceStateReason *reason) +{ + NMModemCdma *self = NM_MODEM_CDMA (modem); + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); + NMConnection *connection; + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + *out_setting_name = nm_connection_need_secrets (connection, out_hints); + if (!*out_setting_name) { + gboolean enabled = nm_modem_get_mm_enabled (modem); + DBusGProxy *proxy; + + if (priv->connect_properties) + g_hash_table_destroy (priv->connect_properties); + priv->connect_properties = create_connect_properties (connection); + + if (enabled) + do_connect (self); + else { + proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM); + dbus_g_proxy_begin_call_with_timeout (proxy, + "Enable", stage1_enable_done, + modem, NULL, 20000, + G_TYPE_BOOLEAN, TRUE, + G_TYPE_INVALID); + } + } else { + /* NMModem will handle requesting secrets... */ + } + + return NM_ACT_STAGE_RETURN_POSTPONE; +} + +static NMConnection * +real_get_best_auto_connection (NMModem *modem, + GSList *connections, + char **specific_object) +{ + GSList *iter; + + for (iter = connections; iter; iter = g_slist_next (iter)) { + NMConnection *connection = NM_CONNECTION (iter->data); + NMSettingConnection *s_con; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + + if (!nm_setting_connection_get_autoconnect (s_con)) + continue; + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_CDMA_SETTING_NAME)) + continue; + + return connection; + } + return NULL; +} + +static gboolean +real_check_connection_compatible (NMModem *modem, + NMConnection *connection, + GError **error) +{ + NMSettingConnection *s_con; + NMSettingCdma *s_cdma; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_CDMA_SETTING_NAME)) { + g_set_error (error, + NM_CDMA_ERROR, NM_CDMA_ERROR_CONNECTION_NOT_CDMA, + "The connection was not a CDMA connection."); + return FALSE; + } + + s_cdma = NM_SETTING_CDMA (nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA)); + if (!s_cdma) { + g_set_error (error, + NM_CDMA_ERROR, NM_CDMA_ERROR_CONNECTION_INVALID, + "The connection was not a valid CDMA connection."); + return FALSE; + } + + return TRUE; +} + +static gboolean +real_get_user_pass (NMModem *modem, + NMConnection *connection, + const char **user, + const char **pass) +{ + NMSettingCdma *s_cdma; + + s_cdma = (NMSettingCdma *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA); + if (!s_cdma) + return FALSE; + + if (user) + *user = nm_setting_cdma_get_username (s_cdma); + if (pass) + *pass = nm_setting_cdma_get_password (s_cdma); + + return TRUE; +} + +static const char * +real_get_setting_name (NMModem *modem) +{ + return NM_SETTING_CDMA_SETTING_NAME; +} + +static void +real_deactivate_quickly (NMModem *modem, NMDevice *device) +{ + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (modem); + + if (priv->call) { + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_SIMPLE); + dbus_g_proxy_cancel_call (proxy, priv->call); + priv->call = NULL; + } + + NM_MODEM_CLASS (nm_modem_cdma_parent_class)->deactivate_quickly (modem, device); +} + +/*****************************************************************************/ + +static void +nm_modem_cdma_init (NMModemCdma *self) +{ +} + +static void +dispose (GObject *object) +{ + NMModemCdma *self = NM_MODEM_CDMA (object); + NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self); + + if (priv->connect_properties) + g_hash_table_destroy (priv->connect_properties); + + G_OBJECT_CLASS (nm_modem_cdma_parent_class)->dispose (object); +} + +static void +nm_modem_cdma_class_init (NMModemCdmaClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMModemClass *modem_class = NM_MODEM_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMModemCdmaPrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + modem_class->get_user_pass = real_get_user_pass; + modem_class->get_setting_name = real_get_setting_name; + modem_class->get_best_auto_connection = real_get_best_auto_connection; + modem_class->check_connection_compatible = real_check_connection_compatible; + modem_class->act_stage1_prepare = real_act_stage1_prepare; + modem_class->deactivate_quickly = real_deactivate_quickly; + + dbus_g_error_domain_register (NM_CDMA_ERROR, NULL, NM_TYPE_CDMA_ERROR); +} diff --git a/src/modem-manager/nm-modem-cdma.h b/src/modem-manager/nm-modem-cdma.h new file mode 100644 index 00000000..0abe4e0c --- /dev/null +++ b/src/modem-manager/nm-modem-cdma.h @@ -0,0 +1,56 @@ +/* -*- 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) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ + +#ifndef NM_MODEM_CDMA_H +#define NM_MODEM_CDMA_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_MODEM_CDMA (nm_modem_cdma_get_type ()) +#define NM_MODEM_CDMA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_CDMA, NMModemCdma)) +#define NM_MODEM_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM_CDMA, NMModemCdmaClass)) +#define NM_IS_MODEM_CDMA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MODEM_CDMA)) +#define NM_IS_MODEM_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_CDMA)) +#define NM_MODEM_CDMA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_CDMA, NMModemCdmaClass)) + +typedef struct { + NMModem parent; +} NMModemCdma; + +typedef struct { + NMModemClass parent; + + /* Signals */ + void (*signal_quality) (NMModemCdma *self, guint32 quality); +} NMModemCdmaClass; + +GType nm_modem_cdma_get_type (void); + +NMModem *nm_modem_cdma_new (const char *path, + const char *device, + const char *data_device, + guint32 ip_method); + +G_END_DECLS + +#endif /* NM_MODEM_CDMA_H */ diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c new file mode 100644 index 00000000..abb96db1 --- /dev/null +++ b/src/modem-manager/nm-modem-gsm.c @@ -0,0 +1,554 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ + +#include +#include "nm-dbus-glib-types.h" +#include "nm-modem-gsm.h" +#include "nm-device.h" +#include "nm-setting-connection.h" +#include "nm-setting-gsm.h" +#include "nm-modem-types.h" +#include "nm-logging.h" +#include "NetworkManagerUtils.h" + +typedef enum { + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_ANY = 0, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_GPRS, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_EDGE, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_UMTS, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSDPA, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_PREFERRED, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_PREFERRED, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_ONLY, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_ONLY, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSUPA, + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSPA, + + MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_LAST = MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_HSPA +} MMModemDeprecatedMode; + +typedef enum { + MM_MODEM_GSM_ALLOWED_MODE_ANY = 0, + MM_MODEM_GSM_ALLOWED_MODE_2G_PREFERRED = 1, + MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED = 2, + MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY = 3, + MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY = 4, + + MM_MODEM_GSM_ALLOWED_MODE_LAST = MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY +} MMModemGsmAllowedMode; + + +G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM) + +#define NM_MODEM_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_GSM, NMModemGsmPrivate)) + +typedef struct { + DBusGProxyCall *call; + + GHashTable *connect_properties; + guint32 pin_tries; +} NMModemGsmPrivate; + + +typedef enum { + NM_GSM_ERROR_CONNECTION_NOT_GSM = 0, + NM_GSM_ERROR_CONNECTION_INVALID, + NM_GSM_ERROR_CONNECTION_INCOMPATIBLE, +} NMGsmError; + +#define NM_GSM_ERROR (nm_gsm_error_quark ()) +#define NM_TYPE_GSM_ERROR (nm_gsm_error_get_type ()) + +static GQuark +nm_gsm_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-gsm-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +static GType +nm_gsm_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Connection was not a GSM connection. */ + ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_NOT_GSM, "ConnectionNotGsm"), + /* Connection was not a valid GSM connection. */ + ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + /* Connection does not apply to this device. */ + ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMGsmError", values); + } + return etype; +} + + +NMModem * +nm_modem_gsm_new (const char *path, + const char *device, + const char *data_device, + guint32 ip_method) +{ + g_return_val_if_fail (path != NULL, NULL); + g_return_val_if_fail (device != NULL, NULL); + g_return_val_if_fail (data_device != NULL, NULL); + + return (NMModem *) g_object_new (NM_TYPE_MODEM_GSM, + NM_MODEM_PATH, path, + NM_MODEM_DEVICE, device, + NM_MODEM_IFACE, data_device, + NM_MODEM_IP_METHOD, ip_method, + NULL); +} + +static NMDeviceStateReason +translate_mm_error (GError *error) +{ + NMDeviceStateReason reason; + + if (dbus_g_error_has_name (error, MM_MODEM_CONNECT_ERROR_NO_CARRIER)) + reason = NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER; + if (dbus_g_error_has_name (error, MM_MODEM_CONNECT_ERROR_NO_DIALTONE)) + reason = NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT; + if (dbus_g_error_has_name (error, MM_MODEM_CONNECT_ERROR_BUSY)) + reason = NM_DEVICE_STATE_REASON_MODEM_BUSY; + if (dbus_g_error_has_name (error, MM_MODEM_CONNECT_ERROR_NO_ANSWER)) + reason = NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT; + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_NETWORK_NOT_ALLOWED)) + reason = NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED; + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_NETWORK_TIMEOUT)) + reason = NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT; + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_NO_NETWORK)) + reason = NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING; + + /* FIXME: We have only GSM error messages here, and we have no idea which + activation state failed. Reasons like: + NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED, + NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED, + NM_DEVICE_STATE_REASON_GSM_APN_FAILED, + NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED, + NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED + are not used. + */ + else + reason = NM_DEVICE_STATE_REASON_UNKNOWN; + + return reason; +} + +static void +ask_for_pin (NMModemGsm *self, gboolean always_ask) +{ + NMModemGsmPrivate *priv; + guint32 tries = 0; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_MODEM_GSM (self)); + + priv = NM_MODEM_GSM_GET_PRIVATE (self); + + if (!always_ask) + tries = priv->pin_tries++; + + g_signal_emit_by_name (self, NM_MODEM_NEED_AUTH, + NM_SETTING_GSM_SETTING_NAME, + (tries || always_ask) ? TRUE : FALSE, + SECRETS_CALLER_MOBILE_BROADBAND, + NM_SETTING_GSM_PIN, + NULL); +} + +static void +stage1_prepare_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) +{ + NMModemGsm *self = NM_MODEM_GSM (user_data); + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); + GError *error = NULL; + + priv->call = NULL; + + if (priv->connect_properties) { + g_hash_table_destroy (priv->connect_properties); + priv->connect_properties = NULL; + } + + if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, TRUE, NM_DEVICE_STATE_REASON_NONE); + else { + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) + ask_for_pin (self, FALSE); + else if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_WRONG)) + ask_for_pin (self, TRUE); + else { + nm_log_warn (LOGD_MB, "GSM connection failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, translate_mm_error (error)); + } + + g_error_free (error); + } +} + +static void +do_connect (NMModemGsm *self) +{ + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (NM_MODEM (self), MM_DBUS_INTERFACE_MODEM_SIMPLE); + dbus_g_proxy_begin_call_with_timeout (proxy, + "Connect", stage1_prepare_done, + self, NULL, 120000, + DBUS_TYPE_G_MAP_OF_VARIANT, priv->connect_properties, + G_TYPE_INVALID); +} + +static void stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data); + +static void +do_enable (NMModemGsm *self) +{ + DBusGProxy *proxy; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_MODEM_GSM (self)); + + proxy = nm_modem_get_proxy (NM_MODEM (self), MM_DBUS_INTERFACE_MODEM); + dbus_g_proxy_begin_call_with_timeout (proxy, + "Enable", stage1_enable_done, + self, NULL, 20000, + G_TYPE_BOOLEAN, TRUE, + G_TYPE_INVALID); +} + +static void +stage1_pin_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMModemGsm *self = NM_MODEM_GSM (user_data); + GError *error = NULL; + + if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) { + /* Success; go back and try the enable again */ + do_enable (self); + } else { + nm_log_warn (LOGD_MB, "GSM PIN unlock failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); + } +} + +static void +handle_enable_pin_required (NMModemGsm *self) +{ + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); + const char *pin = NULL; + GValue *value; + DBusGProxy *proxy; + + /* See if we have a PIN already */ + value = g_hash_table_lookup (priv->connect_properties, "pin"); + if (value && G_VALUE_HOLDS_STRING (value)) + pin = g_value_get_string (value); + + /* If we do, send it */ + if (pin) { + proxy = nm_modem_get_proxy (NM_MODEM (self), MM_DBUS_INTERFACE_MODEM_GSM_CARD); + dbus_g_proxy_begin_call_with_timeout (proxy, + "SendPin", stage1_pin_done, + self, NULL, 10000, + G_TYPE_STRING, pin, + G_TYPE_INVALID); + } else + ask_for_pin (self, FALSE); +} + +static void +stage1_enable_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMModemGsm *self = NM_MODEM_GSM (user_data); + GError *error = NULL; + + if (dbus_g_proxy_end_call (proxy, call_id, &error, G_TYPE_INVALID)) + do_connect (self); + else { + nm_log_warn (LOGD_MB, "GSM modem enable failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + if (dbus_g_error_has_name (error, MM_MODEM_ERROR_SIM_PIN)) + handle_enable_pin_required (self); + else + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED); + + g_error_free (error); + } +} + + +static GHashTable * +create_connect_properties (NMConnection *connection) +{ + NMSettingGsm *setting; + GHashTable *properties; + const char *str; + + setting = NM_SETTING_GSM (nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM)); + properties = value_hash_create (); + + str = nm_setting_gsm_get_number (setting); + if (str) + value_hash_add_str (properties, "number", str); + + str = nm_setting_gsm_get_apn (setting); + if (str) + value_hash_add_str (properties, "apn", str); + + str = nm_setting_gsm_get_network_id (setting); + if (str) + value_hash_add_str (properties, "network_id", str); + + str = nm_setting_gsm_get_pin (setting); + if (str) + value_hash_add_str (properties, "pin", str); + + str = nm_setting_gsm_get_username (setting); + if (str) + value_hash_add_str (properties, "username", str); + + str = nm_setting_gsm_get_password (setting); + if (str) + value_hash_add_str (properties, "password", str); + + /* Add both old and new preferred modes */ + switch (nm_setting_gsm_get_network_type (setting)) { + case NM_SETTING_GSM_NETWORK_TYPE_UMTS_HSPA: + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_ONLY); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY); + break; + case NM_SETTING_GSM_NETWORK_TYPE_GPRS_EDGE: + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_ONLY); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY); + break; + case NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA: + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_3G_PREFERRED); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED); + break; + case NM_SETTING_GSM_NETWORK_TYPE_PREFER_GPRS_EDGE: + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_2G_PREFERRED); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_2G_PREFERRED); + break; + default: + value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_DEPRECATED_MODE_ANY); + value_hash_add_uint (properties, "allowed_mode", MM_MODEM_GSM_ALLOWED_MODE_ANY); + break; + } + + /* Roaming */ + if (nm_setting_gsm_get_home_only (setting)) + value_hash_add_bool (properties, "home_only", TRUE); + + return properties; +} + +static NMActStageReturn +real_act_stage1_prepare (NMModem *modem, + NMActRequest *req, + GPtrArray **out_hints, + const char **out_setting_name, + NMDeviceStateReason *reason) +{ + NMModemGsm *self = NM_MODEM_GSM (modem); + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); + NMConnection *connection; + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + *out_setting_name = nm_connection_need_secrets (connection, out_hints); + if (!*out_setting_name) { + gboolean enabled = nm_modem_get_mm_enabled (modem); + + if (priv->connect_properties) + g_hash_table_destroy (priv->connect_properties); + priv->connect_properties = create_connect_properties (connection); + + if (enabled) + do_connect (self); + else + do_enable (self); + } else { + /* NMModem will handle requesting secrets... */ + } + + return NM_ACT_STAGE_RETURN_POSTPONE; +} + +static NMConnection * +real_get_best_auto_connection (NMModem *modem, + GSList *connections, + char **specific_object) +{ + GSList *iter; + + for (iter = connections; iter; iter = g_slist_next (iter)) { + NMConnection *connection = NM_CONNECTION (iter->data); + NMSettingConnection *s_con; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + + if (!nm_setting_connection_get_autoconnect (s_con)) + continue; + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_GSM_SETTING_NAME)) + continue; + + return connection; + } + return NULL; +} + +static gboolean +real_check_connection_compatible (NMModem *modem, + NMConnection *connection, + GError **error) +{ + NMSettingConnection *s_con; + NMSettingGsm *s_gsm; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_GSM_SETTING_NAME)) { + g_set_error (error, + NM_GSM_ERROR, NM_GSM_ERROR_CONNECTION_NOT_GSM, + "The connection was not a GSM connection."); + return FALSE; + } + + s_gsm = NM_SETTING_GSM (nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM)); + if (!s_gsm) { + g_set_error (error, + NM_GSM_ERROR, NM_GSM_ERROR_CONNECTION_INVALID, + "The connection was not a valid GSM connection."); + return FALSE; + } + + return TRUE; +} + +static gboolean +real_get_user_pass (NMModem *modem, + NMConnection *connection, + const char **user, + const char **pass) +{ + NMSettingGsm *s_gsm; + + s_gsm = (NMSettingGsm *) nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); + if (!s_gsm) + return FALSE; + + if (user) + *user = nm_setting_gsm_get_username (s_gsm); + if (pass) + *pass = nm_setting_gsm_get_password (s_gsm); + + return TRUE; +} + +static const char * +real_get_setting_name (NMModem *modem) +{ + return NM_SETTING_GSM_SETTING_NAME; +} + +static void +real_deactivate_quickly (NMModem *modem, NMDevice *device) +{ + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (modem); + + if (priv->call) { + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (modem, MM_DBUS_INTERFACE_MODEM_SIMPLE); + dbus_g_proxy_cancel_call (proxy, priv->call); + priv->call = NULL; + } + + priv->pin_tries = 0; + + NM_MODEM_CLASS (nm_modem_gsm_parent_class)->deactivate_quickly (modem, device); +} + + +/*****************************************************************************/ + +static void +nm_modem_gsm_init (NMModemGsm *self) +{ +} + +static void +dispose (GObject *object) +{ + NMModemGsm *self = NM_MODEM_GSM (object); + NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self); + + if (priv->connect_properties) + g_hash_table_destroy (priv->connect_properties); + + G_OBJECT_CLASS (nm_modem_gsm_parent_class)->dispose (object); +} + +static void +nm_modem_gsm_class_init (NMModemGsmClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMModemClass *modem_class = NM_MODEM_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMModemGsmPrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + modem_class->get_user_pass = real_get_user_pass; + modem_class->get_setting_name = real_get_setting_name; + modem_class->get_best_auto_connection = real_get_best_auto_connection; + modem_class->check_connection_compatible = real_check_connection_compatible; + modem_class->act_stage1_prepare = real_act_stage1_prepare; + modem_class->deactivate_quickly = real_deactivate_quickly; + + dbus_g_error_domain_register (NM_GSM_ERROR, NULL, NM_TYPE_GSM_ERROR); +} diff --git a/src/modem-manager/nm-modem-gsm.h b/src/modem-manager/nm-modem-gsm.h new file mode 100644 index 00000000..f481bdb8 --- /dev/null +++ b/src/modem-manager/nm-modem-gsm.h @@ -0,0 +1,56 @@ +/* -*- 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) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ + +#ifndef NM_MODEM_GSM_H +#define NM_MODEM_GSM_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_MODEM_GSM (nm_modem_gsm_get_type ()) +#define NM_MODEM_GSM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_GSM, NMModemGsm)) +#define NM_MODEM_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM_GSM, NMModemGsmClass)) +#define NM_IS_MODEM_GSM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MODEM_GSM)) +#define NM_IS_MODEM_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_GSM)) +#define NM_MODEM_GSM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_GSM, NMModemGsmClass)) + +typedef struct { + NMModem parent; +} NMModemGsm; + +typedef struct { + NMModemClass parent; + + /* Signals */ + void (*signal_quality) (NMModemGsm *self, guint32 quality); +} NMModemGsmClass; + +GType nm_modem_gsm_get_type (void); + +NMModem *nm_modem_gsm_new (const char *path, + const char *device, + const char *data_device, + guint32 ip_method); + +G_END_DECLS + +#endif /* NM_MODEM_GSM_H */ diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c new file mode 100644 index 00000000..28f7b94d --- /dev/null +++ b/src/modem-manager/nm-modem-manager.c @@ -0,0 +1,443 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + * Copyright (C) 2009 Canonical Ltd. + */ + +#include +#include "nm-modem-manager.h" +#include "nm-logging.h" +#include "nm-modem.h" +#include "nm-modem-gsm.h" +#include "nm-modem-cdma.h" +#include "nm-dbus-manager.h" +#include "nm-modem-types.h" +#include "nm-marshal.h" + +#define MODEM_POKE_INTERVAL 120 + +G_DEFINE_TYPE (NMModemManager, nm_modem_manager, G_TYPE_OBJECT) + +#define NM_MODEM_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM_MANAGER, NMModemManagerPrivate)) + +typedef struct { + NMDBusManager *dbus_mgr; + DBusGProxy *proxy; + GHashTable *modems; + gboolean disposed; + guint poke_id; +} NMModemManagerPrivate; + +enum { + MODEM_ADDED, + MODEM_REMOVED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + +NMModemManager * +nm_modem_manager_get (void) +{ + static NMModemManager *singleton = NULL; + + if (!singleton) + singleton = NM_MODEM_MANAGER (g_object_new (NM_TYPE_MODEM_MANAGER, NULL)); + else + g_object_ref (singleton); + + g_assert (singleton); + return singleton; +} + +static gboolean +get_modem_properties (DBusGConnection *connection, + const char *path, + char **device, + char **data_device, + char **driver, + guint32 *type, + guint32 *ip_method) +{ + DBusGProxy *proxy; + GValue value = { 0 }; + GError *err = NULL; + + proxy = dbus_g_proxy_new_for_name (connection, + MM_DBUS_SERVICE, + path, + "org.freedesktop.DBus.Properties"); + + if (dbus_g_proxy_call_with_timeout (proxy, "Get", 15000, &err, + G_TYPE_STRING, MM_DBUS_INTERFACE_MODEM, + G_TYPE_STRING, "Type", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + *type = g_value_get_uint (&value); + g_value_unset (&value); + } else { + nm_log_warn (LOGD_MB, "could not get device type: %s", err->message); + goto out; + } + + if (dbus_g_proxy_call_with_timeout (proxy, "Get", 15000, &err, + G_TYPE_STRING, MM_DBUS_INTERFACE_MODEM, + G_TYPE_STRING, "MasterDevice", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + *device = g_value_dup_string (&value); + g_value_unset (&value); + } else { + nm_log_warn (LOGD_MB, "could not get device: %s", err->message); + goto out; + } + + if (dbus_g_proxy_call_with_timeout (proxy, "Get", 15000, &err, + G_TYPE_STRING, MM_DBUS_INTERFACE_MODEM, + G_TYPE_STRING, "IpMethod", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + *ip_method = g_value_get_uint (&value); + g_value_unset (&value); + } else { + nm_log_warn (LOGD_MB, "could not get IP method: %s", err->message); + goto out; + } + + if (dbus_g_proxy_call_with_timeout (proxy, "Get", 15000, &err, + G_TYPE_STRING, MM_DBUS_INTERFACE_MODEM, + G_TYPE_STRING, "Device", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + *data_device = g_value_dup_string (&value); + g_value_unset (&value); + } else { + nm_log_warn (LOGD_MB, "could not get modem data device: %s", err->message); + goto out; + } + + if (dbus_g_proxy_call_with_timeout (proxy, "Get", 15000, &err, + G_TYPE_STRING, MM_DBUS_INTERFACE_MODEM, + G_TYPE_STRING, "Driver", + G_TYPE_INVALID, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + *driver = g_value_dup_string (&value); + g_value_unset (&value); + } else { + nm_log_warn (LOGD_MB, "could not get modem driver: %s", err->message); + goto out; + } + + out: + if (err) + g_error_free (err); + + g_object_unref (proxy); + + return *data_device && *driver; +} + +static void +create_modem (NMModemManager *manager, const char *path) +{ + NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (manager); + NMModem *modem = NULL; + char *data_device = NULL, *driver = NULL, *master_device = NULL; + uint modem_type = MM_MODEM_TYPE_UNKNOWN; + uint ip_method = MM_MODEM_IP_METHOD_PPP; + + if (g_hash_table_lookup (priv->modems, path)) { + nm_log_warn (LOGD_MB, "modem with path %s already exists, ignoring", path); + return; + } + + if (!get_modem_properties (nm_dbus_manager_get_connection (priv->dbus_mgr), + path, &master_device, &data_device, &driver, + &modem_type, &ip_method)) + return; + + if (modem_type == MM_MODEM_TYPE_UNKNOWN) { + nm_log_warn (LOGD_MB, "modem with path %s has unknown type, ignoring", path); + return; + } + + if (!master_device || !strlen (master_device)) { + nm_log_warn (LOGD_MB, "modem with path %s has unknown device, ignoring", path); + return; + } + + if (!driver || !strlen (driver)) { + nm_log_warn (LOGD_MB, "modem with path %s has unknown driver, ignoring", path); + return; + } + + if (!data_device || !strlen (data_device)) { + nm_log_warn (LOGD_MB, "modem with path %s has unknown data device, ignoring", path); + return; + } + + if (modem_type == MM_MODEM_TYPE_GSM) + modem = nm_modem_gsm_new (path, master_device, data_device, ip_method); + else if (modem_type == MM_MODEM_TYPE_CDMA) + modem = nm_modem_cdma_new (path, master_device, data_device, ip_method); + else + nm_log_warn (LOGD_MB, "unknown modem type '%d'", modem_type); + + g_free (data_device); + + if (modem) { + g_hash_table_insert (priv->modems, g_strdup (path), modem); + g_signal_emit (manager, signals[MODEM_ADDED], 0, modem, driver); + } + + g_free (driver); +} + +static void +modem_added (DBusGProxy *proxy, const char *path, gpointer user_data) +{ + create_modem (NM_MODEM_MANAGER (user_data), path); +} + +static void +modem_removed (DBusGProxy *proxy, const char *path, gpointer user_data) +{ + NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (user_data); + NMModem *modem; + + modem = (NMModem *) g_hash_table_lookup (priv->modems, path); + if (modem) { + g_signal_emit (user_data, signals[MODEM_REMOVED], 0, modem); + g_hash_table_remove (priv->modems, path); + } +} + +static gboolean +poke_modem_cb (gpointer user_data) +{ + NMModemManager *self = NM_MODEM_MANAGER (user_data); + NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (self); + DBusGConnection *g_connection; + DBusGProxy *proxy; + + g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + proxy = dbus_g_proxy_new_for_name (g_connection, + MM_DBUS_SERVICE, + MM_DBUS_PATH, + MM_DBUS_INTERFACE); + + dbus_g_proxy_call_no_reply (proxy, "EnumerateDevices", G_TYPE_INVALID); + g_object_unref (proxy); + + return TRUE; +} + +static void +enumerate_devices_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer data) +{ + NMModemManager *manager = NM_MODEM_MANAGER (data); + GPtrArray *modems; + GError *error = NULL; + + if (!dbus_g_proxy_end_call (proxy, call_id, &error, + dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), &modems, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_MB, "could not get modem list: %s", error->message); + g_error_free (error); + } else { + int i; + + for (i = 0; i < modems->len; i++) { + char *path = (char *) g_ptr_array_index (modems, i); + + create_modem (manager, path); + g_free (path); + } + + g_ptr_array_free (modems, TRUE); + } +} + +static void +modem_manager_appeared (NMModemManager *self, gboolean enumerate_devices) +{ + NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (self); + + if (priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + + nm_log_info (LOGD_MB, "modem-manager is now available"); + + priv->proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + MM_DBUS_SERVICE, MM_DBUS_PATH, MM_DBUS_INTERFACE); + + dbus_g_proxy_add_signal (priv->proxy, "DeviceAdded", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "DeviceAdded", + G_CALLBACK (modem_added), self, + NULL); + + dbus_g_proxy_add_signal (priv->proxy, "DeviceRemoved", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, "DeviceRemoved", + G_CALLBACK (modem_removed), self, + NULL); + + if (enumerate_devices) + dbus_g_proxy_begin_call (priv->proxy, "EnumerateDevices", enumerate_devices_done, self, NULL, G_TYPE_INVALID); +} + +static gboolean +remove_one_modem (gpointer key, gpointer value, gpointer user_data) +{ + g_signal_emit (user_data, signals[MODEM_REMOVED], 0, value); + + return TRUE; +} + +static void +modem_manager_disappeared (NMModemManager *self) +{ + NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (self); + + g_hash_table_foreach_remove (priv->modems, remove_one_modem, self); + + if (priv->proxy) { + g_object_unref (priv->proxy); + priv->proxy = NULL; + } + + /* Try to activate the modem-manager */ + nm_log_info (LOGD_MB, "trying to start the modem manager..."); + poke_modem_cb (self); + priv->poke_id = g_timeout_add_seconds (MODEM_POKE_INTERVAL, poke_modem_cb, self); +} + +static void +nm_modem_manager_name_owner_changed (NMDBusManager *dbus_mgr, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + gboolean old_owner_good; + gboolean new_owner_good; + + /* Can't handle the signal if its not from the modem service */ + if (strcmp (MM_DBUS_SERVICE, name) != 0) + return; + + old_owner_good = (old_owner && strlen (old_owner)); + new_owner_good = (new_owner && strlen (new_owner)); + + if (!old_owner_good && new_owner_good) { + modem_manager_appeared (NM_MODEM_MANAGER (user_data), FALSE); + } else if (old_owner_good && !new_owner_good) { + nm_log_info (LOGD_MB, "the modem manager disappeared"); + modem_manager_disappeared (NM_MODEM_MANAGER (user_data)); + } +} + +/*******************************************************/ + +static void +nm_modem_manager_init (NMModemManager *self) +{ + NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (self); + + priv->modems = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + priv->dbus_mgr = nm_dbus_manager_get (); + + g_signal_connect (priv->dbus_mgr, "name-owner-changed", + G_CALLBACK (nm_modem_manager_name_owner_changed), + self); + + if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, MM_DBUS_SERVICE)) + modem_manager_appeared (self, TRUE); + else + modem_manager_disappeared (self); +} + +static void +dispose (GObject *object) +{ + NMModemManagerPrivate *priv = NM_MODEM_MANAGER_GET_PRIVATE (object); + + if (priv->disposed) + return; + + priv->disposed = TRUE; + + if (priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + + g_hash_table_foreach_remove (priv->modems, remove_one_modem, object); + g_hash_table_destroy (priv->modems); + + if (priv->proxy) { + g_object_unref (priv->proxy); + priv->proxy = NULL; + } + + if (priv->dbus_mgr) { + g_object_unref (priv->dbus_mgr); + priv->dbus_mgr = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_modem_manager_parent_class)->dispose (object); +} + +static void +nm_modem_manager_class_init (NMModemManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMModemManagerPrivate)); + + object_class->dispose = dispose; + + /* signals */ + signals[MODEM_ADDED] = + g_signal_new ("modem-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemManagerClass, modem_added), + NULL, NULL, + _nm_marshal_VOID__OBJECT_STRING, + G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_STRING); + + signals[MODEM_REMOVED] = + g_signal_new ("modem-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemManagerClass, modem_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_OBJECT); +} diff --git a/src/modem-manager/nm-modem-manager.h b/src/modem-manager/nm-modem-manager.h new file mode 100644 index 00000000..56427baf --- /dev/null +++ b/src/modem-manager/nm-modem-manager.h @@ -0,0 +1,53 @@ +/* -*- 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) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + * Copyright (C) 2009 Canonical Ltd. + */ + +#ifndef NM_MODEM_MANAGER_H +#define NM_MODEM_MANAGER_H + +#include +#include "nm-modem.h" + +#define NM_TYPE_MODEM_MANAGER (nm_modem_manager_get_type ()) +#define NM_MODEM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_MANAGER, NMModemManager)) +#define NM_MODEM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM_MANAGER, NMModemManagerClass)) +#define NM_IS_MODEM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MODEM_MANAGER)) +#define NM_IS_MODEM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_MANAGER)) +#define NM_MODEM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_MANAGER, NMModemManagerClass)) + +typedef struct { + GObject parent; +} NMModemManager; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*modem_added) (NMModemManager *manager, NMModem *modem, const char *driver); + + void (*modem_removed) (NMModemManager *manager, NMModem *modem); +} NMModemManagerClass; + +GType nm_modem_manager_get_type (void); + +NMModemManager *nm_modem_manager_get (void); + +#endif /* NM_MODEM_MANAGER_H */ diff --git a/src/modem-manager/nm-modem-types.h b/src/modem-manager/nm-modem-types.h new file mode 100644 index 00000000..e805cb21 --- /dev/null +++ b/src/modem-manager/nm-modem-types.h @@ -0,0 +1,111 @@ +/* -*- 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) 2009 Novell, Inc. + */ + +#ifndef NM_MODEM_TYPES_H +#define NM_MODEM_TYPES_H + +#define MM_DBUS_SERVICE "org.freedesktop.ModemManager" +#define MM_DBUS_PATH "/org/freedesktop/ModemManager" +#define MM_DBUS_INTERFACE "org.freedesktop.ModemManager" +#define MM_DBUS_INTERFACE_MODEM "org.freedesktop.ModemManager.Modem" +#define MM_DBUS_INTERFACE_MODEM_SIMPLE "org.freedesktop.ModemManager.Modem.Simple" +#define MM_DBUS_INTERFACE_MODEM_CDMA "org.freedesktop.ModemManager.Modem.Cdma" + +#define MM_DBUS_INTERFACE_MODEM_GSM_CARD "org.freedesktop.ModemManager.Modem.Gsm.Card" +#define MM_DBUS_INTERFACE_MODEM_GSM_NETWORK "org.freedesktop.ModemManager.Modem.Gsm.Network" + +#define MM_MODEM_TYPE_UNKNOWN 0 +#define MM_MODEM_TYPE_GSM 1 +#define MM_MODEM_TYPE_CDMA 2 + +#define MM_MODEM_IP_METHOD_PPP 0 +#define MM_MODEM_IP_METHOD_STATIC 1 +#define MM_MODEM_IP_METHOD_DHCP 2 + +/* Errors */ + +#define MM_SERIAL_OPEN_FAILED MM_DBUS_INTERFACE_MODEM ".SerialOpenFailed" +#define MM_SERIAL_SEND_FAILED MM_DBUS_INTERFACE_MODEM ".SerialSendFailed" +#define MM_SERIAL_RESPONSE_TIMEOUT MM_DBUS_INTERFACE_MODEM ".SerialResponseTimeout" + +#define MM_MODEM_ERROR_GENERAL MM_DBUS_INTERFACE_MODEM ".General" +#define MM_MODEM_ERROR_OPERATION_NOT_SUPPORTED MM_DBUS_INTERFACE_MODEM ".OperationNotSupported" + +#define MM_MODEM_CONNECT_ERROR_NO_CARRIER MM_DBUS_INTERFACE_MODEM ".NoCarrier" +#define MM_MODEM_CONNECT_ERROR_NO_DIALTONE MM_DBUS_INTERFACE_MODEM ".NoDialtone" +#define MM_MODEM_CONNECT_ERROR_BUSY MM_DBUS_INTERFACE_MODEM ".Busy" +#define MM_MODEM_CONNECT_ERROR_NO_ANSWER MM_DBUS_INTERFACE_MODEM ".NoAnswer" + +#define MM_MODEM_ERROR "org.freedesktop.ModemManager.Modem.Gsm" + +#define MM_MODEM_ERROR_PHONE_FAILURE MM_MODEM_ERROR ".PhoneFailure" +#define MM_MODEM_ERROR_NO_CONNECTION MM_MODEM_ERROR ".NoConnection" +#define MM_MODEM_ERROR_LINK_RESERVED MM_MODEM_ERROR ".LinkReserved" +#define MM_MODEM_ERROR_NOT_ALLOWED MM_MODEM_ERROR ".OperationNotAllowed" +#define MM_MODEM_ERROR_NOT_SUPPORTED MM_MODEM_ERROR ".OperationNotSupported" +#define MM_MODEM_ERROR_PH_SIM_PIN MM_MODEM_ERROR ".PhSimPinRequired" +#define MM_MODEM_ERROR_PH_FSIM_PIN MM_MODEM_ERROR ".PhFSimPinRequired" +#define MM_MODEM_ERROR_PH_FSIM_PUK MM_MODEM_ERROR ".PhFPukRequired" +#define MM_MODEM_ERROR_SIM_NOT_INSERTED MM_MODEM_ERROR ".SimNotInserted" +#define MM_MODEM_ERROR_SIM_PIN MM_MODEM_ERROR ".SimPinRequired" +#define MM_MODEM_ERROR_SIM_PUK MM_MODEM_ERROR ".SimPukRequired" +#define MM_MODEM_ERROR_SIM_FAILURE MM_MODEM_ERROR ".SimFailure" +#define MM_MODEM_ERROR_SIM_BUSY MM_MODEM_ERROR ".SimBusy" +#define MM_MODEM_ERROR_SIM_WRONG MM_MODEM_ERROR ".SimWrong" +#define MM_MODEM_ERROR_WRONG_PASSWORD MM_MODEM_ERROR ".IncorrectPassword" +#define MM_MODEM_ERROR_SIM_PIN2 MM_MODEM_ERROR ".SimPin2Required" +#define MM_MODEM_ERROR_SIM_PUK2 MM_MODEM_ERROR ".SimPuk2Required" +#define MM_MODEM_ERROR_MEMORY_FULL MM_MODEM_ERROR ".MemoryFull" +#define MM_MODEM_ERROR_INVALID_INDEX MM_MODEM_ERROR ".InvalidIndex" +#define MM_MODEM_ERROR_NOT_FOUND MM_MODEM_ERROR ".NotFound" +#define MM_MODEM_ERROR_MEMORY_FAILURE MM_MODEM_ERROR ".MemoryFailure" +#define MM_MODEM_ERROR_TEXT_TOO_LONG MM_MODEM_ERROR ".TextTooLong" +#define MM_MODEM_ERROR_INVALID_CHARS MM_MODEM_ERROR ".InvalidChars" +#define MM_MODEM_ERROR_DIAL_STRING_TOO_LONG MM_MODEM_ERROR ".DialStringTooLong" +#define MM_MODEM_ERROR_DIAL_STRING_INVALID MM_MODEM_ERROR ".InvalidDialString" +#define MM_MODEM_ERROR_NO_NETWORK MM_MODEM_ERROR ".NoNetwork" +#define MM_MODEM_ERROR_NETWORK_TIMEOUT MM_MODEM_ERROR ".NetworkTimeout" +#define MM_MODEM_ERROR_NETWORK_NOT_ALLOWED MM_MODEM_ERROR ".NetworkNotAllowed" +#define MM_MODEM_ERROR_NETWORK_PIN MM_MODEM_ERROR ".NetworkPinRequired" +#define MM_MODEM_ERROR_NETWORK_PUK MM_MODEM_ERROR ".NetworkPukRequired" +#define MM_MODEM_ERROR_NETWORK_SUBSET_PIN MM_MODEM_ERROR ".NetworkSubsetPinRequired" +#define MM_MODEM_ERROR_NETWORK_SUBSET_PUK MM_MODEM_ERROR ".NetworkSubsetPukRequired" +#define MM_MODEM_ERROR_SERVICE_PIN MM_MODEM_ERROR ".ServicePinRequired" +#define MM_MODEM_ERROR_SERVICE_PUK MM_MODEM_ERROR ".ServicePukRequired" +#define MM_MODEM_ERROR_CORP_PIN MM_MODEM_ERROR ".CorporatePinRequired" +#define MM_MODEM_ERROR_CORP_PUK MM_MODEM_ERROR ".CorporatePukRequired" +#define MM_MODEM_ERROR_HIDDEN_KEY MM_MODEM_ERROR ".HiddenKeyRequired" +#define MM_MODEM_ERROR_EAP_NOT_SUPPORTED MM_MODEM_ERROR ".EapMethodNotSupported" +#define MM_MODEM_ERROR_INCORRECT_PARAMS MM_MODEM_ERROR ".IncorrectParams" +#define MM_MODEM_ERROR_UNKNOWN MM_MODEM_ERROR ".Unknown" +#define MM_MODEM_ERROR_GPRS_ILLEGAL_MS MM_MODEM_ERROR ".GprsIllegalMs" +#define MM_MODEM_ERROR_GPRS_ILLEGAL_ME MM_MODEM_ERROR ".GprsIllegalMe" +#define MM_MODEM_ERROR_GPRS_SERVICE_NOT_ALLOWED MM_MODEM_ERROR ".GprsServiceNotAllowed" +#define MM_MODEM_ERROR_GPRS_PLMN_NOT_ALLOWED MM_MODEM_ERROR ".GprsPlmnNotAllowed" +#define MM_MODEM_ERROR_GPRS_LOCATION_NOT_ALLOWED MM_MODEM_ERROR ".GprsLocationNotAllowed" +#define MM_MODEM_ERROR_GPRS_ROAMING_NOT_ALLOWED MM_MODEM_ERROR ".GprsRoamingNotAllowed" +#define MM_MODEM_ERROR_GPRS_OPTION_NOT_SUPPORTED MM_MODEM_ERROR ".GprsOptionNotSupported" +#define MM_MODEM_ERROR_GPRS_NOT_SUBSCRIBED MM_MODEM_ERROR ".GprsNotSubscribed" +#define MM_MODEM_ERROR_GPRS_OUT_OF_ORDER MM_MODEM_ERROR ".GprsOutOfOrder" +#define MM_MODEM_ERROR_GPRS_PDP_AUTH_FAILURE MM_MODEM_ERROR ".GprsPdpAuthFailure" +#define MM_MODEM_ERROR_GPRS_UNKNOWN MM_MODEM_ERROR ".GprsUnspecified" +#define MM_MODEM_ERROR_GPRS_INVALID_CLASS MM_MODEM_ERROR ".GprsInvalidClass" + +#endif /* NM_MODEM_TYPES_H */ diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c new file mode 100644 index 00000000..e07b818b --- /dev/null +++ b/src/modem-manager/nm-modem.c @@ -0,0 +1,1147 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ + +#include +#include "nm-modem.h" +#include "nm-system.h" +#include "nm-dbus-manager.h" +#include "nm-setting-connection.h" +#include "nm-marshal.h" +#include "nm-properties-changed-signal.h" +#include "nm-modem-types.h" +#include "nm-logging.h" +#include "NetworkManagerUtils.h" +#include "nm-device-private.h" +#include "nm-device-interface.h" +#include "nm-dbus-glib-types.h" + +#include "nm-serial-device-glue.h" + +G_DEFINE_TYPE (NMModem, nm_modem, G_TYPE_OBJECT) + +#define NM_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MODEM, NMModemPrivate)) + +enum { + PROP_0, + PROP_DEVICE, + PROP_IFACE, + PROP_PATH, + PROP_IP_METHOD, + PROP_ENABLED, + + LAST_PROP +}; + +typedef struct { + NMDBusManager *dbus_mgr; + DBusGProxy *proxy; + DBusGProxy *props_proxy; + + char *path; + NMPPPManager *ppp_manager; + NMIP4Config *pending_ip4_config; + guint32 ip_method; + char *device; + char *iface; + + guint32 secrets_tries; + + DBusGProxyCall *call; + + gboolean mm_enabled; + + /* PPP stats */ + guint32 in_bytes; + guint32 out_bytes; +} NMModemPrivate; + +enum { + PPP_STATS, + PPP_FAILED, + PREPARE_RESULT, + IP4_CONFIG_RESULT, + NEED_AUTH, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +NMPPPManager * +nm_modem_get_ppp_manager (NMModem *self) +{ + g_return_val_if_fail (NM_IS_MODEM (self), NULL); + + return NM_MODEM_GET_PRIVATE (self)->ppp_manager; +} + +gboolean +nm_modem_get_mm_enabled (NMModem *self) +{ + g_return_val_if_fail (NM_IS_MODEM (self), TRUE); + + return NM_MODEM_GET_PRIVATE (self)->mm_enabled; +} + +DBusGProxy * +nm_modem_get_proxy (NMModem *self, + const char *interface) +{ + + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + const char *current_iface; + + g_return_val_if_fail (NM_IS_MODEM (self), NULL); + + /* Default to the default interface. */ + if (interface == NULL) + interface = MM_DBUS_INTERFACE_MODEM; + + if (interface && !strcmp (interface, DBUS_INTERFACE_PROPERTIES)) + return priv->props_proxy; + + current_iface = dbus_g_proxy_get_interface (priv->proxy); + if (!current_iface || strcmp (current_iface, interface)) + dbus_g_proxy_set_interface (priv->proxy, interface); + + return priv->proxy; +} + +static void +merge_ip4_config (NMActRequest *req, NMIP4Config *config) +{ + NMConnection *connection; + NMSettingIP4Config *s_ip4; + + /* Merge user-defined overrides into the IP4Config to be applied */ + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + nm_utils_merge_ip4_config (config, s_ip4); +} + +/*****************************************************************************/ +/* IP method PPP */ + +static void +ppp_state_changed (NMPPPManager *ppp_manager, NMPPPStatus status, gpointer user_data) +{ + switch (status) { + case NM_PPP_STATUS_DISCONNECT: + g_signal_emit (NM_MODEM (user_data), signals[PPP_FAILED], 0, NM_DEVICE_STATE_REASON_PPP_DISCONNECT); + break; + case NM_PPP_STATUS_DEAD: + g_signal_emit (NM_MODEM (user_data), signals[PPP_FAILED], 0, NM_DEVICE_STATE_REASON_PPP_FAILED); + break; + default: + break; + } +} + +static void +ppp_ip4_config (NMPPPManager *ppp_manager, + const char *iface, + NMIP4Config *config, + gpointer user_data) +{ + NMModem *self = NM_MODEM (user_data); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + guint32 i, num; + guint32 bad_dns1 = htonl (0x0A0B0C0D); + guint32 good_dns1 = htonl (0x04020201); /* GTE nameserver */ + guint32 bad_dns2 = htonl (0x0A0B0C0E); + guint32 good_dns2 = htonl (0x04020202); /* GTE nameserver */ + gboolean dns_workaround = FALSE; + + /* Work around a PPP bug (#1732) which causes many mobile broadband + * providers to return 10.11.12.13 and 10.11.12.14 for the DNS servers. + * Apparently fixed in ppp-2.4.5 but we've had some reports that this is + * not the case. + * + * http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=2e09ef6886bbf00bc5a9a641110f801e372ffde6 + * http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=f8191bf07df374f119a07910a79217c7618f113e + */ + + num = nm_ip4_config_get_num_nameservers (config); + if (num == 2) { + gboolean found1 = FALSE, found2 = FALSE; + + for (i = 0; i < num; i++) { + guint32 ns = nm_ip4_config_get_nameserver (config, i); + + if (ns == bad_dns1) + found1 = TRUE; + else if (ns == bad_dns2) + found2 = TRUE; + } + + /* Be somewhat conservative about substitutions; the "bad" nameservers + * could actually be valid in some cases, so only substitute if ppp + * returns *only* the two bad nameservers. + */ + dns_workaround = (found1 && found2); + } + + if (!num || dns_workaround) { + nm_log_warn (LOGD_PPP, "compensating for invalid PPP-provided nameservers"); + nm_ip4_config_reset_nameservers (config); + nm_ip4_config_add_nameserver (config, good_dns1); + nm_ip4_config_add_nameserver (config, good_dns2); + } + + priv->pending_ip4_config = g_object_ref (config); + g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, iface, config, NULL); +} + +static void +ppp_stats (NMPPPManager *ppp_manager, + guint32 in_bytes, + guint32 out_bytes, + gpointer user_data) +{ + NMModem *self = NM_MODEM (user_data); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + + if (priv->in_bytes != in_bytes || priv->out_bytes != out_bytes) { + priv->in_bytes = in_bytes; + priv->out_bytes = out_bytes; + + g_signal_emit (self, signals[PPP_STATS], 0, in_bytes, out_bytes); + } +} + +static NMActStageReturn +ppp_stage3_ip4_config_start (NMModem *self, + NMActRequest *req, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + const char *ppp_name = NULL; + GError *error = NULL; + NMActStageReturn ret; + + g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + if (NM_MODEM_GET_CLASS (self)->get_user_pass) { + NMConnection *connection = nm_act_request_get_connection (req); + + g_assert (connection); + if (!NM_MODEM_GET_CLASS (self)->get_user_pass (self, connection, &ppp_name, NULL)) + return NM_ACT_STAGE_RETURN_FAILURE; + } + + priv->ppp_manager = nm_ppp_manager_new (priv->iface); + if (nm_ppp_manager_start (priv->ppp_manager, req, ppp_name, 20, &error)) { + g_signal_connect (priv->ppp_manager, "state-changed", + G_CALLBACK (ppp_state_changed), + self); + g_signal_connect (priv->ppp_manager, "ip4-config", + G_CALLBACK (ppp_ip4_config), + self); + g_signal_connect (priv->ppp_manager, "stats", + G_CALLBACK (ppp_stats), + self); + + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else { + nm_log_err (LOGD_PPP, "error starting PPP: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + + g_object_unref (priv->ppp_manager); + priv->ppp_manager = NULL; + + *reason = NM_DEVICE_STATE_REASON_PPP_START_FAILED; + ret = NM_ACT_STAGE_RETURN_FAILURE; + } + + return ret; +} + +static NMActStageReturn +ppp_stage4 (NMModem *self, + NMActRequest *req, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + + *config = priv->pending_ip4_config; + priv->pending_ip4_config = NULL; + + merge_ip4_config (req, *config); + + return NM_ACT_STAGE_RETURN_SUCCESS; +} + +/*****************************************************************************/ +/* IP method static */ + +static void +static_stage3_done (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) +{ + NMModem *self = NM_MODEM (user_data); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + GValueArray *ret_array = NULL; + GError *error = NULL; + NMIP4Config *config = NULL; + + priv->call = NULL; + + if (dbus_g_proxy_end_call (proxy, call, &error, + G_TYPE_VALUE_ARRAY, &ret_array, + G_TYPE_INVALID)) { + NMIP4Address *addr; + int i; + + config = nm_ip4_config_new (); + + addr = nm_ip4_address_new (); + nm_ip4_address_set_address (addr, g_value_get_uint (g_value_array_get_nth (ret_array, 0))); + nm_ip4_address_set_prefix (addr, 32); + nm_ip4_config_take_address (config, addr); + + for (i = 0; i < ret_array->n_values; i++) { + GValue *value = g_value_array_get_nth (ret_array, i); + + nm_ip4_config_add_nameserver (config, g_value_get_uint (value)); + } + g_value_array_free (ret_array); + + priv->pending_ip4_config = g_object_ref (config); + g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, NULL, config, NULL); + } + + g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, NULL, config, error); + g_clear_error (&error); +} + +static NMActStageReturn +static_stage3_ip4_config_start (NMModem *self, + NMActRequest *req, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv; + + g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + priv = NM_MODEM_GET_PRIVATE (self); + + priv->call = dbus_g_proxy_begin_call (nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM), + "GetIP4Config", static_stage3_done, + self, NULL, + G_TYPE_INVALID); + + return NM_ACT_STAGE_RETURN_POSTPONE; +} + +static NMActStageReturn +static_stage4 (NMModem *self, + NMActRequest *req, + NMDevice *device, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + gboolean no_firmware = FALSE; + + if (!nm_device_hw_bring_up (device, TRUE, &no_firmware)) { + if (no_firmware) + *reason = NM_DEVICE_STATE_REASON_FIRMWARE_MISSING; + else + *reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED; + return NM_ACT_STAGE_RETURN_FAILURE; + } + + *config = priv->pending_ip4_config; + priv->pending_ip4_config = NULL; + + merge_ip4_config (req, *config); + + return NM_ACT_STAGE_RETURN_SUCCESS; +} + +/*****************************************************************************/ + +NMActStageReturn +nm_modem_stage3_ip4_config_start (NMModem *self, + NMDevice *device, + NMDeviceClass *device_class, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv; + NMActRequest *req; + NMActStageReturn ret; + + g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (device != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_DEVICE (device), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (device_class != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_DEVICE_CLASS (device_class), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + req = nm_device_get_act_request (device); + g_assert (req); + + priv = NM_MODEM_GET_PRIVATE (self); + switch (priv->ip_method) { + case MM_MODEM_IP_METHOD_PPP: + ret = ppp_stage3_ip4_config_start (self, req, reason); + break; + case MM_MODEM_IP_METHOD_STATIC: + ret = static_stage3_ip4_config_start (self, req, reason); + break; + case MM_MODEM_IP_METHOD_DHCP: + ret = device_class->act_stage3_ip4_config_start (device, reason); + break; + default: + nm_log_err (LOGD_MB, "unknown IP method %d", priv->ip_method); + ret = NM_ACT_STAGE_RETURN_FAILURE; + break; + } + + return ret; +} + +NMActStageReturn +nm_modem_stage4_get_ip4_config (NMModem *self, + NMDevice *device, + NMDeviceClass *device_class, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv; + NMActRequest *req; + NMActStageReturn ret; + + g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (device != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_DEVICE (device), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (device_class != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (NM_IS_DEVICE_CLASS (device_class), NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + req = nm_device_get_act_request (device); + g_assert (req); + + priv = NM_MODEM_GET_PRIVATE (self); + switch (priv->ip_method) { + case MM_MODEM_IP_METHOD_PPP: + ret = ppp_stage4 (self, req, config, reason); + break; + case MM_MODEM_IP_METHOD_STATIC: + ret = static_stage4 (self, req, device, config, reason); + break; + case MM_MODEM_IP_METHOD_DHCP: + ret = device_class->act_stage4_get_ip4_config (device, config, reason); + break; + default: + nm_log_err (LOGD_MB, "unknown IP method %d", priv->ip_method); + ret = NM_ACT_STAGE_RETURN_FAILURE; + break; + } + + return ret; +} + +gboolean +nm_modem_connection_secrets_updated (NMModem *self, + NMActRequest *req, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) +{ + NMModemPrivate *priv; + gboolean found = FALSE; + const char *setting_name; + GSList *iter; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_MODEM (self), FALSE); + g_return_val_if_fail (req != NULL, FALSE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + priv = NM_MODEM_GET_PRIVATE (self); + + if (caller == SECRETS_CALLER_PPP) { + const char *user = NULL; + const char *pass = NULL; + + g_return_val_if_fail (priv->ppp_manager != NULL, FALSE); + + if (!NM_MODEM_GET_CLASS (self)->get_user_pass (self, connection, &user, &pass)) { + /* Shouldn't ever happen */ + nm_ppp_manager_update_secrets (priv->ppp_manager, + priv->iface, + NULL, + NULL, + "missing GSM/CDMA setting; no secrets could be found."); + } else { + nm_ppp_manager_update_secrets (priv->ppp_manager, + priv->iface, + user ? user : "", + pass ? pass : "", + NULL); + } + return TRUE; + } + + g_return_val_if_fail (caller == SECRETS_CALLER_MOBILE_BROADBAND, FALSE); + + g_assert (NM_MODEM_GET_CLASS (self)->get_setting_name); + setting_name = NM_MODEM_GET_CLASS (self)->get_setting_name (self); + + for (iter = updated_settings; iter; iter = g_slist_next (iter)) { + const char *candidate_setting_name = (const char *) iter->data; + + if (!strcmp (candidate_setting_name, setting_name)) + found = TRUE; + else { + nm_log_warn (LOGD_MB, "ignoring updated secrets for setting '%s'.", + candidate_setting_name); + } + } + + return found; +} + +static NMActStageReturn +real_act_stage1_prepare (NMModem *modem, + NMActRequest *req, + GPtrArray **out_hints, + const char **out_setting_name, + NMDeviceStateReason *reason) +{ + *reason = NM_DEVICE_STATE_REASON_UNKNOWN; + return NM_ACT_STAGE_RETURN_FAILURE; +} + +NMActStageReturn +nm_modem_act_stage1_prepare (NMModem *self, + NMActRequest *req, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + NMActStageReturn ret; + GPtrArray *hints = NULL; + const char *setting_name = NULL; + + ret = NM_MODEM_GET_CLASS (self)->act_stage1_prepare (self, + req, + &hints, + &setting_name, + reason); + if ((ret == NM_ACT_STAGE_RETURN_POSTPONE) && setting_name) { + const char *hint1 = NULL, *hint2 = NULL; + + /* Need some secrets */ + if (hints) { + if (hints->len > 0) + hint1 = g_ptr_array_index (hints, 0); + if (hints->len > 1) + hint2 = g_ptr_array_index (hints, 1); + } + + g_signal_emit (self, signals[NEED_AUTH], 0, + setting_name, + priv->secrets_tries++ ? TRUE : FALSE, + SECRETS_CALLER_MOBILE_BROADBAND, + hint1, + hint2); + + if (hints) + g_ptr_array_free (hints, TRUE); + } + + return ret; +} + +NMActStageReturn +nm_modem_act_stage2_config (NMModem *self, + NMActRequest *req, + NMDeviceStateReason *reason) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + + /* Clear secrets tries counter since secrets were successfully used + * already if we get here. + */ + priv->secrets_tries = 0; + + return NM_ACT_STAGE_RETURN_SUCCESS; +} + +NMConnection * +nm_modem_get_best_auto_connection (NMModem *self, + GSList *connections, + char **specific_object) +{ + if (NM_MODEM_GET_CLASS (self)->get_best_auto_connection) + return NM_MODEM_GET_CLASS (self)->get_best_auto_connection (self, connections, specific_object); + return NULL; +} + +gboolean +nm_modem_check_connection_compatible (NMModem *self, + NMConnection *connection, + GError **error) +{ + if (NM_MODEM_GET_CLASS (self)->check_connection_compatible) + return NM_MODEM_GET_CLASS (self)->check_connection_compatible (self, connection, error); + return FALSE; +} + +static void +real_deactivate_quickly (NMModem *self, NMDevice *device) +{ + NMModemPrivate *priv; + const char *iface; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_MODEM (self)); + g_return_if_fail (device != NULL); + g_return_if_fail (NM_IS_DEVICE (device)); + + priv = NM_MODEM_GET_PRIVATE (self); + + priv->secrets_tries = 0; + + if (priv->call) { + dbus_g_proxy_cancel_call (priv->proxy, priv->call); + priv->call = NULL; + } + + if (priv->pending_ip4_config) { + g_object_unref (priv->pending_ip4_config); + priv->pending_ip4_config = NULL; + } + + priv->in_bytes = priv->out_bytes = 0; + + switch (priv->ip_method) { + case MM_MODEM_IP_METHOD_PPP: + if (priv->ppp_manager) { + g_object_unref (priv->ppp_manager); + priv->ppp_manager = NULL; + } + break; + case MM_MODEM_IP_METHOD_STATIC: + case MM_MODEM_IP_METHOD_DHCP: + iface = nm_device_get_ip_iface (device); + /* FIXME: use AF_UNSPEC here when we have IPv6 support */ + nm_system_device_flush_routes_with_iface (iface, AF_INET); + nm_system_device_flush_addresses_with_iface (iface); + nm_system_device_set_up_down_with_iface (iface, FALSE, NULL); + break; + default: + nm_log_err (LOGD_MB, "unknown IP method %d", priv->ip_method); + break; + } +} + +void +nm_modem_deactivate_quickly (NMModem *self, NMDevice *device) +{ + NM_MODEM_GET_CLASS (self)->deactivate_quickly (self, device); +} + +static void +disconnect_done (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_info (LOGD_MB, "disconnect failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } +} + +void +nm_modem_device_state_changed (NMModem *self, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason) +{ + gboolean was_connected = FALSE; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_MODEM (self)); + + if (IS_ACTIVATING_STATE (old_state) || (old_state == NM_DEVICE_STATE_ACTIVATED)) + was_connected = TRUE; + + /* Make sure we don't leave the serial device open */ + switch (new_state) { + case NM_DEVICE_STATE_NEED_AUTH: + if (NM_MODEM_GET_PRIVATE (self)->ppp_manager) + break; + /* else fall through */ + case NM_DEVICE_STATE_UNMANAGED: + case NM_DEVICE_STATE_UNAVAILABLE: + case NM_DEVICE_STATE_FAILED: + case NM_DEVICE_STATE_DISCONNECTED: + if (was_connected) { + dbus_g_proxy_begin_call (nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM), + "Disconnect", + disconnect_done, + self, + NULL, + G_TYPE_INVALID); + } + break; + default: + break; + } +} + +gboolean +nm_modem_hw_is_up (NMModem *self, NMDevice *device) +{ + guint32 ip_method = NM_MODEM_GET_PRIVATE (self)->ip_method; + + if (ip_method == MM_MODEM_IP_METHOD_STATIC || ip_method == MM_MODEM_IP_METHOD_DHCP) { + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + if (priv->pending_ip4_config || state == NM_DEVICE_STATE_IP_CONFIG || state == NM_DEVICE_STATE_ACTIVATED) + return nm_system_device_is_up (device); + } + + return TRUE; +} + +gboolean +nm_modem_hw_bring_up (NMModem *self, NMDevice *device, gboolean *no_firmware) +{ + guint32 ip_method = NM_MODEM_GET_PRIVATE (self)->ip_method; + + if (ip_method == MM_MODEM_IP_METHOD_STATIC || ip_method == MM_MODEM_IP_METHOD_DHCP) { + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + if (priv->pending_ip4_config || state == NM_DEVICE_STATE_IP_CONFIG || state == NM_DEVICE_STATE_ACTIVATED) + return nm_system_device_set_up_down (device, TRUE, no_firmware); + } + + return TRUE; +} + +const char * +nm_modem_get_iface (NMModem *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_MODEM (self), NULL); + + return NM_MODEM_GET_PRIVATE (self)->iface; +} + +const char * +nm_modem_get_path (NMModem *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_MODEM (self), NULL); + + return NM_MODEM_GET_PRIVATE (self)->path; +} + +static void +get_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMModem *self = NM_MODEM (user_data); + GError *error = NULL; + GValue value = { 0, }; + + if (!dbus_g_proxy_end_call (proxy, call_id, &error, + G_TYPE_VALUE, &value, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_MB, "failed get modem enabled state: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + return; + } + + if (G_VALUE_HOLDS_BOOLEAN (&value)) { + NM_MODEM_GET_PRIVATE (self)->mm_enabled = g_value_get_boolean (&value); + g_object_notify (G_OBJECT (self), NM_MODEM_ENABLED); + } else + nm_log_warn (LOGD_MB, "failed get modem enabled state: unexpected reply type"); + + g_value_unset (&value); +} + +static void +query_mm_enabled (NMModem *self) +{ + dbus_g_proxy_begin_call (NM_MODEM_GET_PRIVATE (self)->props_proxy, + "Get", get_mm_enabled_done, + self, NULL, + G_TYPE_STRING, MM_DBUS_INTERFACE_MODEM, + G_TYPE_STRING, "Enabled", + G_TYPE_INVALID); +} + +static void +set_mm_enabled_done (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_warn (LOGD_MB, "failed to enable/disable modem: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } + + /* Update enabled/disabled state again */ + query_mm_enabled (NM_MODEM (user_data)); +} + +void +nm_modem_set_mm_enabled (NMModem *self, gboolean enabled) +{ + NMModemPrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_MODEM (self)); + + priv = NM_MODEM_GET_PRIVATE (self); + + /* FIXME: For now this just toggles the ModemManager enabled state. In the + * future we want to tie this into rfkill state instead so that the user can + * toggle rfkill status of the WWAN modem. + */ + + if (priv->mm_enabled != enabled) { + DBusGProxy *proxy; + + proxy = nm_modem_get_proxy (self, MM_DBUS_INTERFACE_MODEM); + dbus_g_proxy_begin_call (proxy, + "Enable", set_mm_enabled_done, + self, NULL, + G_TYPE_BOOLEAN, enabled, + G_TYPE_INVALID); + } +} + +static void +modem_properties_changed (DBusGProxy *proxy, + const char *interface, + GHashTable *props, + gpointer user_data) +{ + NMModem *self = NM_MODEM (user_data); + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + GValue *value; + + if (strcmp (interface, MM_DBUS_INTERFACE_MODEM)) + return; + + value = g_hash_table_lookup (props, "Enabled"); + if (value && G_VALUE_HOLDS_BOOLEAN (value)) { + priv->mm_enabled = g_value_get_boolean (value); + g_object_notify (G_OBJECT (self), NM_MODEM_ENABLED); + } +} + +/*****************************************************************************/ + +static void +nm_modem_init (NMModem *self) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self); + + priv->dbus_mgr = nm_dbus_manager_get (); +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMModemPrivate *priv; + DBusGConnection *bus; + + object = G_OBJECT_CLASS (nm_modem_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_MODEM_GET_PRIVATE (object); + + if (!priv->device) { + nm_log_err (LOGD_HW, "modem parent device not provided"); + goto err; + } + + if (!priv->device) { + nm_log_err (LOGD_HW, "modem command interface not provided"); + goto err; + } + + if (!priv->path) { + nm_log_err (LOGD_HW, "D-Bus path not provided"); + goto err; + } + + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + priv->proxy = dbus_g_proxy_new_for_name (bus, + MM_DBUS_SERVICE, + priv->path, + MM_DBUS_INTERFACE_MODEM); + + priv->props_proxy = dbus_g_proxy_new_for_name (bus, + MM_DBUS_SERVICE, + priv->path, + DBUS_INTERFACE_PROPERTIES); + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED, + G_TYPE_NONE, + G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->props_proxy, "MmPropertiesChanged", + G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->props_proxy, "MmPropertiesChanged", + G_CALLBACK (modem_properties_changed), + object, + NULL); + + query_mm_enabled (NM_MODEM (object)); + + return object; + + err: + g_object_unref (object); + return NULL; +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PATH: + g_value_set_string (value, priv->path); + break; + case PROP_DEVICE: + g_value_set_string (value, priv->device); + break; + case PROP_IFACE: + g_value_set_string (value, priv->iface); + break; + case PROP_IP_METHOD: + g_value_set_uint (value, priv->ip_method); + break; + case PROP_ENABLED: + g_value_set_boolean (value, priv->mm_enabled); + 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) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PATH: + /* Construct only */ + priv->path = g_value_dup_string (value); + break; + case PROP_DEVICE: + /* Construct only */ + priv->device = g_value_dup_string (value); + break; + case PROP_IFACE: + /* Construct only */ + priv->iface = g_value_dup_string (value); + break; + case PROP_IP_METHOD: + /* Construct only */ + priv->ip_method = g_value_get_uint (value); + break; + case PROP_ENABLED: + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (object); + + if (priv->proxy) + g_object_unref (priv->proxy); + + if (priv->props_proxy) + g_object_unref (priv->props_proxy); + + g_object_unref (priv->dbus_mgr); + + g_free (priv->iface); + g_free (priv->path); + g_free (priv->device); + + G_OBJECT_CLASS (nm_modem_parent_class)->finalize (object); +} + +static void +nm_modem_class_init (NMModemClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMModemPrivate)); + + /* Virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + klass->act_stage1_prepare = real_act_stage1_prepare; + klass->deactivate_quickly = real_deactivate_quickly; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_PATH, + g_param_spec_string (NM_MODEM_PATH, + "DBus path", + "DBus path", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_DEVICE, + g_param_spec_string (NM_MODEM_DEVICE, + "Device", + "Master modem parent device", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_IFACE, + g_param_spec_string (NM_MODEM_IFACE, + "Interface", + "Modem command interface", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_IP_METHOD, + g_param_spec_uint (NM_MODEM_IP_METHOD, + "IP method", + "IP method", + MM_MODEM_IP_METHOD_PPP, + MM_MODEM_IP_METHOD_DHCP, + MM_MODEM_IP_METHOD_PPP, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_ENABLED, + g_param_spec_boolean (NM_MODEM_ENABLED, + "Enabled", + "Enabled", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + + /* Signals */ + signals[PPP_STATS] = + g_signal_new ("ppp-stats", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, ppp_stats), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); + + signals[PPP_FAILED] = + g_signal_new ("ppp-failed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, ppp_failed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + signals[IP4_CONFIG_RESULT] = + g_signal_new (NM_MODEM_IP4_CONFIG_RESULT, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, ip4_config_result), + NULL, NULL, + _nm_marshal_VOID__STRING_OBJECT_POINTER, + G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_OBJECT, G_TYPE_POINTER); + + signals[PREPARE_RESULT] = + g_signal_new (NM_MODEM_PREPARE_RESULT, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, prepare_result), + NULL, NULL, + _nm_marshal_VOID__BOOLEAN_UINT, + G_TYPE_NONE, 2, G_TYPE_BOOLEAN, G_TYPE_UINT); + + signals[NEED_AUTH] = + g_signal_new (NM_MODEM_NEED_AUTH, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMModemClass, need_auth), + NULL, NULL, + _nm_marshal_VOID__STRING_BOOLEAN_UINT_STRING_STRING, + G_TYPE_NONE, 5, + G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); +} + +const DBusGObjectInfo * +nm_modem_get_serial_dbus_info (void) +{ + return &dbus_glib_nm_serial_device_object_info; +} + diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h new file mode 100644 index 00000000..a2aed57e --- /dev/null +++ b/src/modem-manager/nm-modem.h @@ -0,0 +1,157 @@ +/* -*- 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) 2009 Red Hat, Inc. + * Copyright (C) 2009 Novell, Inc. + */ + +#ifndef NM_MODEM_H +#define NM_MODEM_H + +#include +#include +#include "ppp-manager/nm-ppp-manager.h" +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_MODEM (nm_modem_get_type ()) +#define NM_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM, NMModem)) +#define NM_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM, NMModemClass)) +#define NM_IS_MODEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MODEM)) +#define NM_IS_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM)) +#define NM_MODEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM, NMModemClass)) + +#define NM_MODEM_PATH "path" +#define NM_MODEM_DEVICE "device" +#define NM_MODEM_IFACE "iface" +#define NM_MODEM_IP_METHOD "ip-method" +#define NM_MODEM_ENABLED "enabled" + +#define NM_MODEM_PPP_STATS "ppp-stats" +#define NM_MODEM_PPP_FAILED "ppp-failed" +#define NM_MODEM_PREPARE_RESULT "prepare-result" +#define NM_MODEM_IP4_CONFIG_RESULT "ip4-config-result" +#define NM_MODEM_NEED_AUTH "need-auth" + +typedef struct { + GObject parent; +} NMModem; + +typedef struct { + GObjectClass parent; + + gboolean (*get_user_pass) (NMModem *modem, + NMConnection *connection, + const char **user, + const char **pass); + + const char * (*get_setting_name) (NMModem *modem); + + gboolean (*check_connection_compatible) (NMModem *modem, + NMConnection *connection, + GError **error); + + NMConnection * (*get_best_auto_connection) (NMModem *modem, + GSList *connections, + char **specific_object); + + NMActStageReturn (*act_stage1_prepare) (NMModem *modem, + NMActRequest *req, + GPtrArray **out_hints, + const char **out_setting_name, + NMDeviceStateReason *reason); + + void (*deactivate_quickly) (NMModem *self, NMDevice *device); + + /* Signals */ + void (*ppp_stats) (NMModem *self, guint32 in_bytes, guint32 out_bytes); + void (*ppp_failed) (NMModem *self, NMDeviceStateReason reason); + + void (*prepare_result) (NMModem *self, gboolean success, NMDeviceStateReason reason); + void (*ip4_config_result) (NMModem *self, const char *iface, NMIP4Config *config, GError *error); + + void (*need_auth) (NMModem *self, + const char *setting_name, + gboolean retry, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2); +} NMModemClass; + +GType nm_modem_get_type (void); + +/* Protected */ + +NMPPPManager *nm_modem_get_ppp_manager (NMModem *modem); +DBusGProxy * nm_modem_get_proxy (NMModem *modem, const char *interface); +const char * nm_modem_get_iface (NMModem *modem); +const char * nm_modem_get_path (NMModem *modem); + +NMConnection *nm_modem_get_best_auto_connection (NMModem *self, + GSList *connections, + char **specific_object); + +gboolean nm_modem_check_connection_compatible (NMModem *self, + NMConnection *connection, + GError **error); + +NMActStageReturn nm_modem_act_stage1_prepare (NMModem *modem, + NMActRequest *req, + NMDeviceStateReason *reason); + +NMActStageReturn nm_modem_act_stage2_config (NMModem *modem, + NMActRequest *req, + NMDeviceStateReason *reason); + +NMActStageReturn nm_modem_stage3_ip4_config_start (NMModem *modem, + NMDevice *device, + NMDeviceClass *device_class, + NMDeviceStateReason *reason); + +NMActStageReturn nm_modem_stage4_get_ip4_config (NMModem *modem, + NMDevice *device, + NMDeviceClass *device_class, + NMIP4Config **config, + NMDeviceStateReason *reason); + +void nm_modem_deactivate_quickly (NMModem *modem, NMDevice *device); + +void nm_modem_device_state_changed (NMModem *modem, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason); + +gboolean nm_modem_hw_is_up (NMModem *modem, NMDevice *device); + +gboolean nm_modem_hw_bring_up (NMModem *modem, NMDevice *device, gboolean *no_firmware); + +gboolean nm_modem_connection_secrets_updated (NMModem *modem, + NMActRequest *req, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller); + +const DBusGObjectInfo *nm_modem_get_serial_dbus_info (void); + +gboolean nm_modem_get_mm_enabled (NMModem *self); + +void nm_modem_set_mm_enabled (NMModem *self, gboolean enabled); + +G_END_DECLS + +#endif /* NM_MODEM_H */ diff --git a/src/named-manager/Makefile.am b/src/named-manager/Makefile.am new file mode 100644 index 00000000..a33f7d50 --- /dev/null +++ b/src/named-manager/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/include + +noinst_LTLIBRARIES = libnamed-manager.la + +libnamed_manager_la_SOURCES = nm-named-manager.h nm-named-manager.c + +libnamed_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ + -DNM_LOCALSTATEDIR=\"$(localstatedir)\" + +libnamed_manager_la_LIBADD = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + diff --git a/src/named-manager/Makefile.in b/src/named-manager/Makefile.in new file mode 100644 index 00000000..50fb770a --- /dev/null +++ b/src/named-manager/Makefile.in @@ -0,0 +1,564 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/named-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libnamed_manager_la_DEPENDENCIES = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libnamed_manager_la_OBJECTS = \ + libnamed_manager_la-nm-named-manager.lo +libnamed_manager_la_OBJECTS = $(am_libnamed_manager_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnamed_manager_la_SOURCES) +DIST_SOURCES = $(libnamed_manager_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/include + +noinst_LTLIBRARIES = libnamed-manager.la +libnamed_manager_la_SOURCES = nm-named-manager.h nm-named-manager.c +libnamed_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ + -DNM_LOCALSTATEDIR=\"$(localstatedir)\" + +libnamed_manager_la_LIBADD = \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/named-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/named-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnamed-manager.la: $(libnamed_manager_la_OBJECTS) $(libnamed_manager_la_DEPENDENCIES) + $(LINK) $(libnamed_manager_la_OBJECTS) $(libnamed_manager_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnamed_manager_la-nm-named-manager.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnamed_manager_la-nm-named-manager.lo: nm-named-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnamed_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnamed_manager_la-nm-named-manager.lo -MD -MP -MF $(DEPDIR)/libnamed_manager_la-nm-named-manager.Tpo -c -o libnamed_manager_la-nm-named-manager.lo `test -f 'nm-named-manager.c' || echo '$(srcdir)/'`nm-named-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnamed_manager_la-nm-named-manager.Tpo $(DEPDIR)/libnamed_manager_la-nm-named-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-named-manager.c' object='libnamed_manager_la-nm-named-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnamed_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnamed_manager_la-nm-named-manager.lo `test -f 'nm-named-manager.c' || echo '$(srcdir)/'`nm-named-manager.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/named-manager/nm-named-manager.c b/src/named-manager/nm-named-manager.c new file mode 100644 index 00000000..ba89ce42 --- /dev/null +++ b/src/named-manager/nm-named-manager.c @@ -0,0 +1,821 @@ +/* -*- 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 - 2005 Colin Walters + * Copyright (C) 2004 - 2010 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + * and others + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "nm-named-manager.h" +#include "nm-ip4-config.h" +#include "nm-ip6-config.h" +#include "nm-logging.h" +#include "nm-system.h" +#include "NetworkManagerUtils.h" + +#ifdef HAVE_SELINUX +#include +#endif + +#ifndef RESOLV_CONF +#define RESOLV_CONF "/etc/resolv.conf" +#endif + +#define ADDR_BUF_LEN 50 + +G_DEFINE_TYPE(NMNamedManager, nm_named_manager, G_TYPE_OBJECT) + +#define NM_NAMED_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_NAMED_MANAGER, \ + NMNamedManagerPrivate)) + + +struct NMNamedManagerPrivate { + NMIP4Config *ip4_vpn_config; + NMIP4Config *ip4_device_config; + NMIP6Config *ip6_vpn_config; + NMIP6Config *ip6_device_config; + GSList *configs; +}; + + +NMNamedManager * +nm_named_manager_get (void) +{ + static NMNamedManager * singleton = NULL; + + if (!singleton) + singleton = NM_NAMED_MANAGER (g_object_new (NM_TYPE_NAMED_MANAGER, NULL)); + else + g_object_ref (singleton); + + g_assert (singleton); + return singleton; +} + + +GQuark +nm_named_manager_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm_named_manager_error"); + + return quark; +} + +typedef struct { + GPtrArray *nameservers; + const char *domain; + GPtrArray *searches; + const char *nis_domain; + GPtrArray *nis_servers; +} NMResolvConfData; + +static void +add_string_item (GPtrArray *array, const char *str) +{ + int i; + + g_return_if_fail (array != NULL); + g_return_if_fail (str != NULL); + + /* Check for dupes before adding */ + for (i = 0; i < array->len; i++) { + const char *candidate = g_ptr_array_index (array, i); + + if (candidate && !strcmp (candidate, str)) + return; + } + + /* No dupes, add the new item */ + g_ptr_array_add (array, g_strdup (str)); +} + +static void +merge_one_ip4_config (NMResolvConfData *rc, NMIP4Config *src) +{ + guint32 num, i; + + num = nm_ip4_config_get_num_nameservers (src); + for (i = 0; i < num; i++) { + struct in_addr addr; + char buf[INET_ADDRSTRLEN]; + + addr.s_addr = nm_ip4_config_get_nameserver (src, i); + if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0) + add_string_item (rc->nameservers, buf); + } + + num = nm_ip4_config_get_num_domains (src); + for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_ip4_config_get_domain (src, i); + if (!rc->domain) + rc->domain = domain; + add_string_item (rc->searches, domain); + } + + num = nm_ip4_config_get_num_searches (src); + for (i = 0; i < num; i++) + add_string_item (rc->searches, nm_ip4_config_get_search (src, i)); + + /* NIS stuff */ + num = nm_ip4_config_get_num_nis_servers (src); + for (i = 0; i < num; i++) { + struct in_addr addr; + char buf[INET_ADDRSTRLEN]; + + addr.s_addr = nm_ip4_config_get_nis_server (src, i); + if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0) + add_string_item (rc->nis_servers, buf); + } + + if (nm_ip4_config_get_nis_domain (src)) { + /* FIXME: handle multiple domains */ + if (!rc->nis_domain) + rc->nis_domain = nm_ip4_config_get_nis_domain (src); + } +} + +static void +merge_one_ip6_config (NMResolvConfData *rc, NMIP6Config *src) +{ + guint32 num, i; + + num = nm_ip6_config_get_num_nameservers (src); + for (i = 0; i < num; i++) { + const struct in6_addr *addr; + char buf[INET6_ADDRSTRLEN]; + + addr = nm_ip6_config_get_nameserver (src, i); + + /* inet_ntop is probably supposed to do this for us, but it doesn't */ + if (IN6_IS_ADDR_V4MAPPED (addr)) { + if (inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, INET_ADDRSTRLEN) > 0) + add_string_item (rc->nameservers, buf); + } else { + if (inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN) > 0) + add_string_item (rc->nameservers, buf); + } + } + + num = nm_ip6_config_get_num_domains (src); + for (i = 0; i < num; i++) { + const char *domain; + + domain = nm_ip6_config_get_domain (src, i); + if (!rc->domain) + rc->domain = domain; + add_string_item (rc->searches, domain); + } + + num = nm_ip6_config_get_num_searches (src); + for (i = 0; i < num; i++) + add_string_item (rc->searches, nm_ip6_config_get_search (src, i)); +} + + +#if defined(TARGET_SUSE) +/**********************************/ +/* SUSE */ + +static void +netconfig_child_setup (gpointer user_data G_GNUC_UNUSED) +{ + pid_t pid = getpid (); + setpgid (pid, pid); +} + +static GPid +run_netconfig (GError **error, gint *stdin_fd) +{ + char *argv[5]; + char *tmp; + GPid pid = -1; + + argv[0] = "/sbin/netconfig"; + argv[1] = "modify"; + argv[2] = "--service"; + argv[3] = "NetworkManager"; + argv[4] = NULL; + + tmp = g_strjoinv (" ", argv); + nm_log_dbg (LOGD_DNS, "spawning '%s'", tmp); + g_free (tmp); + + if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, netconfig_child_setup, + NULL, &pid, stdin_fd, NULL, NULL, error)) + return -1; + + return pid; +} + +static void +write_to_netconfig (gint fd, const char *key, const char *value) +{ + char *str; + int x; + + str = g_strdup_printf ("%s='%s'\n", key, value); + nm_log_dbg (LOGD_DNS, "writing to netconfig: %s", str); + x = write (fd, str, strlen (str)); + g_free (str); +} + +static gboolean +dispatch_netconfig (const char *domain, + char **searches, + char **nameservers, + const char *nis_domain, + char **nis_servers, + const char *iface, + GError **error) +{ + char *str; + GPid pid; + gint fd; + int ret; + + pid = run_netconfig (error, &fd); + if (pid < 0) + return FALSE; + + // FIXME: this is wrong. We are not writing out the iface-specific + // resolv.conf data, we are writing out an already-fully-merged + // resolv.conf. Assuming netconfig works in the obvious way, then + // there are various failure modes, such as, eg, bringing up a VPN on + // eth0, then bringing up wlan0, then bringing down the VPN. Because + // NMNamedManager would have claimed that the VPN DNS server was also + // part of the wlan0 config, it will remain in resolv.conf after the + // VPN goes down, even though it is presumably no longer reachable + // at that point. + write_to_netconfig (fd, "INTERFACE", iface); + + if (searches) { + str = g_strjoinv (" ", searches); + + if (domain) { + char *tmp; + + tmp = g_strconcat (domain, " ", str, NULL); + g_free (str); + str = tmp; + } + + write_to_netconfig (fd, "DNSSEARCH", str); + g_free (str); + } + + if (nameservers) { + str = g_strjoinv (" ", nameservers); + write_to_netconfig (fd, "DNSSERVERS", str); + g_free (str); + } + + if (nis_domain) + write_to_netconfig (fd, "NISDOMAIN", nis_domain); + + if (nis_servers) { + str = g_strjoinv (" ", nis_servers); + write_to_netconfig (fd, "NISSERVERS", str); + g_free (str); + } + + close (fd); + + /* Wait until the process exits */ + + again: + + ret = waitpid (pid, NULL, 0); + if (ret < 0 && errno == EINTR) + goto again; + else if (ret < 0 && errno == ECHILD) { + /* When the netconfig exist, the errno is ECHILD, it should return TRUE */ + return TRUE; + } + + return ret > 0; +} +#endif + + +static gboolean +write_resolv_conf (FILE *f, const char *domain, + char **searches, + char **nameservers, + GError **error) +{ + char *domain_str = NULL; + char *searches_str = NULL; + char *nameservers_str = NULL; + int i; + gboolean retval = FALSE; + + if (fprintf (f, "%s","# Generated by NetworkManager\n") < 0) { + g_set_error (error, + NM_NAMED_MANAGER_ERROR, + NM_NAMED_MANAGER_ERROR_SYSTEM, + "Could not write " RESOLV_CONF ": %s\n", + g_strerror (errno)); + return FALSE; + } + + if (domain) + domain_str = g_strconcat ("domain ", domain, "\n", NULL); + + if (searches) { + char *tmp_str; + + tmp_str = g_strjoinv (" ", searches); + searches_str = g_strconcat ("search ", tmp_str, "\n", NULL); + g_free (tmp_str); + } + + if (nameservers) { + GString *str; + int num; + + str = g_string_new (""); + num = g_strv_length (nameservers); + + for (i = 0; i < num; i++) { + if (i == 3) { + g_string_append (str, "# "); + g_string_append (str, _("NOTE: the libc resolver may not support more than 3 nameservers.")); + g_string_append (str, "\n# "); + g_string_append (str, _("The nameservers listed below may not be recognized.")); + g_string_append_c (str, '\n'); + } + + g_string_append (str, "nameserver "); + g_string_append (str, nameservers[i]); + g_string_append_c (str, '\n'); + } + + nameservers_str = g_string_free (str, FALSE); + } + + if (fprintf (f, "%s%s%s", + domain_str ? domain_str : "", + searches_str ? searches_str : "", + nameservers_str ? nameservers_str : "") != -1) + retval = TRUE; + + g_free (domain_str); + g_free (searches_str); + g_free (nameservers_str); + + return retval; +} + +#ifdef RESOLVCONF_PATH +static gboolean +dispatch_resolvconf (const char *domain, + char **searches, + char **nameservers, + const char *iface, + GError **error) +{ + char *cmd; + FILE *f; + gboolean retval = FALSE; + + if (! g_file_test (RESOLVCONF_PATH, G_FILE_TEST_IS_EXECUTABLE)) + return FALSE; + + if (domain || searches || nameservers) { + cmd = g_strconcat (RESOLVCONF_PATH, " -a ", "NetworkManager", NULL); + nm_log_info (LOGD_DNS, "(%s): writing resolv.conf to %s", iface, RESOLVCONF_PATH); + if ((f = popen (cmd, "w")) == NULL) + g_set_error (error, + NM_NAMED_MANAGER_ERROR, + NM_NAMED_MANAGER_ERROR_SYSTEM, + "Could not write to %s: %s\n", + RESOLVCONF_PATH, + g_strerror (errno)); + else { + retval = write_resolv_conf (f, domain, searches, nameservers, error); + retval &= (pclose (f) == 0); + } + } else { + cmd = g_strconcat (RESOLVCONF_PATH, " -d ", "NetworkManager", NULL); + nm_log_info (LOGD_DNS, "(%s): removing resolv.conf from %s", iface, RESOLVCONF_PATH); + if (nm_spawn_process (cmd) == 0) + retval = TRUE; + } + + g_free (cmd); + + return retval; +} +#endif + +static gboolean +update_resolv_conf (const char *domain, + char **searches, + char **nameservers, + const char *iface, + 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; + + 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 (RESOLV_CONF, NULL); + if (!resolv_conf_realpath) + resolv_conf_realpath = strdup (RESOLV_CONF); + + /* 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 (RESOLV_CONF, "w")) == NULL) { + g_set_error (error, + NM_NAMED_MANAGER_ERROR, + NM_NAMED_MANAGER_ERROR_SYSTEM, + "Could not open %s: %s\nCould not open %s: %s\n", + tmp_resolv_conf_realpath, + g_strerror (old_errno), + RESOLV_CONF, + 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, RESOLV_CONF); + } + + write_resolv_conf (f, domain, searches, nameservers, error); + + if (fclose (f) < 0) { + if (*error == NULL) { + /* only set an error here if write_resolv_conf() was successful, + * since its error is more important. + */ + g_set_error (error, + NM_NAMED_MANAGER_ERROR, + NM_NAMED_MANAGER_ERROR_SYSTEM, + "Could not close %s: %s\n", + tmp_resolv_conf_realpath, + 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_NAMED_MANAGER_ERROR, + NM_NAMED_MANAGER_ERROR_SYSTEM, + "Could not replace " RESOLV_CONF ": %s\n", + g_strerror (errno)); + } + } + +out: + free (tmp_resolv_conf_realpath); + free (resolv_conf_realpath); + return *error ? FALSE : TRUE; +} + +static gboolean +rewrite_resolv_conf (NMNamedManager *mgr, const char *iface, GError **error) +{ + NMNamedManagerPrivate *priv; + NMResolvConfData rc; + GSList *iter; + const char *domain = NULL; + const char *nis_domain = NULL; + char **searches = NULL; + char **nameservers = NULL; + char **nis_servers = NULL; + int num, i, len; + gboolean success = FALSE; + + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); + + rc.nameservers = g_ptr_array_new (); + rc.domain = NULL; + rc.searches = g_ptr_array_new (); + rc.nis_servers = g_ptr_array_new (); + + if (priv->ip4_vpn_config) + merge_one_ip4_config (&rc, priv->ip4_vpn_config); + if (priv->ip4_device_config) + merge_one_ip4_config (&rc, priv->ip4_device_config); + + if (priv->ip6_vpn_config) + merge_one_ip6_config (&rc, priv->ip6_vpn_config); + if (priv->ip6_device_config) + merge_one_ip6_config (&rc, priv->ip6_device_config); + + for (iter = priv->configs; iter; iter = g_slist_next (iter)) { + if ( (iter->data == priv->ip4_vpn_config) + || (iter->data == priv->ip4_device_config) + || (iter->data == priv->ip6_vpn_config) + || (iter->data == priv->ip6_device_config)) + continue; + + if (NM_IS_IP4_CONFIG (iter->data)) { + NMIP4Config *config = NM_IP4_CONFIG (iter->data); + + merge_one_ip4_config (&rc, config); + } else if (NM_IS_IP6_CONFIG (iter->data)) { + NMIP6Config *config = NM_IP6_CONFIG (iter->data); + + merge_one_ip6_config (&rc, config); + } else + g_assert_not_reached (); + } + + domain = rc.domain; + + /* Per 'man resolv.conf', the search list is limited to 6 domains + * totalling 256 characters. + */ + num = MIN (rc.searches->len, 6); + for (i = 0, len = 0; i < num; i++) { + len += strlen (rc.searches->pdata[i]) + 1; /* +1 for spaces */ + if (len > 256) + break; + } + g_ptr_array_set_size (rc.searches, i); + if (rc.searches->len) { + g_ptr_array_add (rc.searches, NULL); + searches = (char **) g_ptr_array_free (rc.searches, FALSE); + } else + g_ptr_array_free (rc.searches, TRUE); + + if (rc.nameservers->len) { + g_ptr_array_add (rc.nameservers, NULL); + nameservers = (char **) g_ptr_array_free (rc.nameservers, FALSE); + } else + g_ptr_array_free (rc.nameservers, TRUE); + + if (rc.nis_servers->len) { + g_ptr_array_add (rc.nis_servers, NULL); + nis_servers = (char **) g_ptr_array_free (rc.nis_servers, FALSE); + } else + g_ptr_array_free (rc.nis_servers, TRUE); + + nis_domain = rc.nis_domain; + +#ifdef RESOLVCONF_PATH + success = dispatch_resolvconf (domain, searches, nameservers, iface, error); +#endif + +#ifdef TARGET_SUSE + if (success == FALSE) { + success = dispatch_netconfig (domain, searches, nameservers, + nis_domain, nis_servers, + iface, error); + } +#endif + + if (success == FALSE) + success = update_resolv_conf (domain, searches, nameservers, iface, error); + + if (success) + nm_system_update_dns (); + + if (searches) + g_strfreev (searches); + if (nameservers) + g_strfreev (nameservers); + if (nis_servers) + g_strfreev (nis_servers); + + return success; +} + +gboolean +nm_named_manager_add_ip4_config (NMNamedManager *mgr, + const char *iface, + NMIP4Config *config, + NMNamedIPConfigType cfg_type) +{ + NMNamedManagerPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (mgr != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); + + switch (cfg_type) { + case NM_NAMED_IP_CONFIG_TYPE_VPN: + priv->ip4_vpn_config = config; + break; + case NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE: + priv->ip4_device_config = config; + break; + default: + break; + } + + /* Don't allow the same zone added twice */ + if (!g_slist_find (priv->configs, config)) + priv->configs = g_slist_append (priv->configs, g_object_ref (config)); + + if (!rewrite_resolv_conf (mgr, iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + g_error_free (error); + } + + return TRUE; +} + +gboolean +nm_named_manager_remove_ip4_config (NMNamedManager *mgr, + const char *iface, + NMIP4Config *config) +{ + NMNamedManagerPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (mgr != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); + + /* Can't remove it if it wasn't in the list to begin with */ + if (!g_slist_find (priv->configs, config)) + return FALSE; + + priv->configs = g_slist_remove (priv->configs, config); + + if (config == priv->ip4_vpn_config) + priv->ip4_vpn_config = NULL; + if (config == priv->ip4_device_config) + priv->ip4_device_config = NULL; + + g_object_unref (config); + + if (!rewrite_resolv_conf (mgr, iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + if (error) + g_error_free (error); + } + + return TRUE; +} + +gboolean +nm_named_manager_add_ip6_config (NMNamedManager *mgr, + const char *iface, + NMIP6Config *config, + NMNamedIPConfigType cfg_type) +{ + NMNamedManagerPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (mgr != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); + + switch (cfg_type) { + case NM_NAMED_IP_CONFIG_TYPE_VPN: + /* FIXME: not quite yet... */ + g_return_val_if_fail (cfg_type != NM_NAMED_IP_CONFIG_TYPE_VPN, FALSE); + priv->ip6_vpn_config = config; + break; + case NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE: + priv->ip6_device_config = config; + break; + default: + break; + } + + /* Don't allow the same zone added twice */ + if (!g_slist_find (priv->configs, config)) + priv->configs = g_slist_append (priv->configs, g_object_ref (config)); + + if (!rewrite_resolv_conf (mgr, iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + g_error_free (error); + } + + return TRUE; +} + +gboolean +nm_named_manager_remove_ip6_config (NMNamedManager *mgr, + const char *iface, + NMIP6Config *config) +{ + NMNamedManagerPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (mgr != NULL, FALSE); + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr); + + /* Can't remove it if it wasn't in the list to begin with */ + if (!g_slist_find (priv->configs, config)) + return FALSE; + + priv->configs = g_slist_remove (priv->configs, config); + + if (config == priv->ip6_vpn_config) + priv->ip6_vpn_config = NULL; + if (config == priv->ip6_device_config) + priv->ip6_device_config = NULL; + + g_object_unref (config); + + if (!rewrite_resolv_conf (mgr, iface, &error)) { + nm_log_warn (LOGD_DNS, "could not commit DNS changes: '%s'", error ? error->message : "(none)"); + if (error) + g_error_free (error); + } + + return TRUE; +} + + +static void +nm_named_manager_init (NMNamedManager *mgr) +{ +} + +static void +nm_named_manager_finalize (GObject *object) +{ + NMNamedManagerPrivate *priv = NM_NAMED_MANAGER_GET_PRIVATE (object); + + g_slist_foreach (priv->configs, (GFunc) g_object_unref, NULL); + g_slist_free (priv->configs); + + G_OBJECT_CLASS (nm_named_manager_parent_class)->finalize (object); +} + +static void +nm_named_manager_class_init (NMNamedManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = nm_named_manager_finalize; + + g_type_class_add_private (object_class, sizeof (NMNamedManagerPrivate)); +} + diff --git a/src/named-manager/nm-named-manager.h b/src/named-manager/nm-named-manager.h new file mode 100644 index 00000000..47c8e711 --- /dev/null +++ b/src/named-manager/nm-named-manager.h @@ -0,0 +1,92 @@ +/* -*- 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 - 2005 Colin Walters + * Copyright (C) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + * and others + */ + +#ifndef __NM_NAMED_MANAGER_H__ +#define __NM_NAMED_MANAGER_H__ + +#include "config.h" +#include +#include +#include "nm-ip4-config.h" +#include "nm-ip6-config.h" + +typedef enum { + NM_NAMED_MANAGER_ERROR_SYSTEM, + NM_NAMED_MANAGER_ERROR_INVALID_NAMESERVER, + NM_NAMED_MANAGER_ERROR_INVALID_HOST, + NM_NAMED_MANAGER_ERROR_INVALID_ID +} NMNamedManagerError; + +typedef enum { + NM_NAMED_IP_CONFIG_TYPE_DEFAULT = 0, + NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE, + NM_NAMED_IP_CONFIG_TYPE_VPN +} NMNamedIPConfigType; + +#define NM_NAMED_MANAGER_ERROR nm_named_manager_error_quark () +GQuark nm_named_manager_error_quark (void); + +G_BEGIN_DECLS + +#define NM_TYPE_NAMED_MANAGER (nm_named_manager_get_type ()) +#define NM_NAMED_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_NAMED_MANAGER, NMNamedManager)) +#define NM_NAMED_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NM_TYPE_NAMED_MANAGER, NMNamedManagerClass)) +#define NM_IS_NAMED_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NM_TYPE_NAMED_MANAGER)) +#define NM_IS_NAMED_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NM_TYPE_NAMED_MANAGER)) +#define NM_NAMED_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NM_TYPE_NAMED_MANAGER, NMNamedManagerClass)) + +typedef struct NMNamedManagerPrivate NMNamedManagerPrivate; + +typedef struct { + GObject parent; +} NMNamedManager; + +typedef struct { + GObjectClass parent; +} NMNamedManagerClass; + +GType nm_named_manager_get_type (void); + +NMNamedManager * nm_named_manager_get (void); + +gboolean nm_named_manager_add_ip4_config (NMNamedManager *mgr, + const char *iface, + NMIP4Config *config, + NMNamedIPConfigType cfg_type); + +gboolean nm_named_manager_remove_ip4_config (NMNamedManager *mgr, + const char *iface, + NMIP4Config *config); + +gboolean nm_named_manager_add_ip6_config (NMNamedManager *mgr, + const char *iface, + NMIP6Config *config, + NMNamedIPConfigType cfg_type); + +gboolean nm_named_manager_remove_ip6_config (NMNamedManager *mgr, + const char *iface, + NMIP6Config *config); + +G_END_DECLS + +#endif /* __NM_NAMED_MANAGER_H__ */ diff --git a/src/nm-activation-request.c b/src/nm-activation-request.c new file mode 100644 index 00000000..2529e77f --- /dev/null +++ b/src/nm-activation-request.c @@ -0,0 +1,700 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include + +#include "nm-activation-request.h" +#include "nm-marshal.h" +#include "nm-logging.h" +#include "nm-setting-wireless-security.h" +#include "nm-setting-8021x.h" +#include "nm-dbus-manager.h" +#include "nm-device.h" +#include "nm-properties-changed-signal.h" +#include "nm-active-connection.h" +#include "nm-dbus-glib-types.h" + + +static void secrets_provider_interface_init (NMSecretsProviderInterface *sp_interface_class); + +G_DEFINE_TYPE_EXTENDED (NMActRequest, nm_act_request, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SECRETS_PROVIDER_INTERFACE, + secrets_provider_interface_init)) + +#define NM_ACT_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACT_REQUEST, NMActRequestPrivate)) + +enum { + CONNECTION_SECRETS_UPDATED, + CONNECTION_SECRETS_FAILED, + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +typedef struct { + char *table; + char *rule; +} ShareRule; + +typedef struct { + gboolean disposed; + + NMConnection *connection; + guint32 secrets_call_id; + + char *specific_object; + NMDevice *device; + gboolean user_requested; + + NMActiveConnectionState state; + gboolean is_default; + gboolean is_default6; + gboolean shared; + GSList *share_rules; + + char *ac_path; + + gboolean assumed; +} NMActRequestPrivate; + +enum { + PROP_0, + PROP_SERVICE_NAME, + PROP_CONNECTION, + PROP_SPECIFIC_OBJECT, + PROP_DEVICES, + PROP_STATE, + PROP_DEFAULT, + PROP_DEFAULT6, + PROP_VPN, + + LAST_PROP +}; + + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMActRequest *self = NM_ACT_REQUEST (user_data); + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (self); + NMActiveConnectionState new_ac_state; + gboolean new_default = FALSE, new_default6 = FALSE; + + /* Set NMActiveConnection state based on the device's state */ + switch (new_state) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + new_ac_state = NM_ACTIVE_CONNECTION_STATE_ACTIVATING; + break; + case NM_DEVICE_STATE_ACTIVATED: + new_ac_state = NM_ACTIVE_CONNECTION_STATE_ACTIVATED; + new_default = priv->is_default; + new_default6 = priv->is_default6; + break; + default: + new_ac_state = NM_ACTIVE_CONNECTION_STATE_UNKNOWN; + break; + } + + if (new_ac_state != priv->state) { + priv->state = new_ac_state; + g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_STATE); + } + + if (new_default != priv->is_default) { + priv->is_default = new_default; + g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_DEFAULT); + } + + if (new_default6 != priv->is_default6) { + priv->is_default6 = new_default6; + g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_DEFAULT6); + } +} + +NMActRequest * +nm_act_request_new (NMConnection *connection, + const char *specific_object, + gboolean user_requested, + gboolean assumed, + gpointer *device) +{ + GObject *object; + NMActRequestPrivate *priv; + + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + g_return_val_if_fail (NM_DEVICE (device), NULL); + + object = g_object_new (NM_TYPE_ACT_REQUEST, NULL); + if (!object) + return NULL; + + priv = NM_ACT_REQUEST_GET_PRIVATE (object); + + priv->connection = g_object_ref (connection); + if (specific_object) + priv->specific_object = g_strdup (specific_object); + + priv->device = NM_DEVICE (device); + g_signal_connect (device, "state-changed", + G_CALLBACK (device_state_changed), + NM_ACT_REQUEST (object)); + + priv->user_requested = user_requested; + priv->assumed = assumed; + + return NM_ACT_REQUEST (object); +} + +static void +nm_act_request_init (NMActRequest *req) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (req); + NMDBusManager *dbus_mgr; + + priv->ac_path = nm_active_connection_get_next_object_path (); + priv->state = NM_ACTIVE_CONNECTION_STATE_UNKNOWN; + + dbus_mgr = nm_dbus_manager_get (); + dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (dbus_mgr), + priv->ac_path, + G_OBJECT (req)); + g_object_unref (dbus_mgr); +} + +static void +dispose (GObject *object) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_act_request_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + g_assert (priv->connection); + + g_signal_handlers_disconnect_by_func (G_OBJECT (priv->device), + G_CALLBACK (device_state_changed), + NM_ACT_REQUEST (object)); + + /* Clear any share rules */ + nm_act_request_set_shared (NM_ACT_REQUEST (object), FALSE); + + g_object_unref (priv->connection); + + G_OBJECT_CLASS (nm_act_request_parent_class)->dispose (object); +} + +static void +clear_share_rules (NMActRequest *req) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (req); + GSList *iter; + + for (iter = priv->share_rules; iter; iter = g_slist_next (iter)) { + ShareRule *rule = (ShareRule *) iter->data; + + g_free (rule->table); + g_free (rule->rule); + g_free (rule); + } + + g_slist_free (priv->share_rules); + priv->share_rules = NULL; +} + +static void +finalize (GObject *object) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (object); + + g_free (priv->specific_object); + g_free (priv->ac_path); + + clear_share_rules (NM_ACT_REQUEST (object)); + + G_OBJECT_CLASS (nm_act_request_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (object); + GPtrArray *devices; + + switch (prop_id) { + case PROP_SERVICE_NAME: + nm_active_connection_scope_to_value (priv->connection, value); + break; + case PROP_CONNECTION: + g_value_set_boxed (value, nm_connection_get_path (priv->connection)); + break; + case PROP_SPECIFIC_OBJECT: + if (priv->specific_object) + g_value_set_boxed (value, priv->specific_object); + else + g_value_set_boxed (value, "/"); + break; + case PROP_DEVICES: + devices = g_ptr_array_sized_new (1); + g_ptr_array_add (devices, g_strdup (nm_device_get_path (priv->device))); + g_value_take_boxed (value, devices); + break; + case PROP_STATE: + g_value_set_uint (value, priv->state); + break; + case PROP_DEFAULT: + g_value_set_boolean (value, priv->is_default); + break; + case PROP_DEFAULT6: + g_value_set_boolean (value, priv->is_default6); + break; + case PROP_VPN: + g_value_set_boolean (value, FALSE); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_act_request_class_init (NMActRequestClass *req_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (req_class); + + g_type_class_add_private (req_class, sizeof (NMActRequestPrivate)); + + /* virtual methods */ + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + /* properties */ + g_object_class_install_property + (object_class, PROP_SERVICE_NAME, + g_param_spec_string (NM_ACTIVE_CONNECTION_SERVICE_NAME, + "Service name", + "Service name", + NULL, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_CONNECTION, + g_param_spec_boxed (NM_ACTIVE_CONNECTION_CONNECTION, + "Connection", + "Connection", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_SPECIFIC_OBJECT, + g_param_spec_boxed (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, + "Specific object", + "Specific object", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DEVICES, + g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, + "Devices", + "Devices", + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_STATE, + g_param_spec_uint (NM_ACTIVE_CONNECTION_STATE, + "State", + "State", + NM_ACTIVE_CONNECTION_STATE_UNKNOWN, + NM_ACTIVE_CONNECTION_STATE_ACTIVATED, + NM_ACTIVE_CONNECTION_STATE_UNKNOWN, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DEFAULT, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, + "Default", + "Is the default IPv4 active connection", + FALSE, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DEFAULT6, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, + "Default6", + "Is the default IPv6 active connection", + FALSE, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_VPN, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN, + "VPN", + "Is a VPN connection", + FALSE, + G_PARAM_READABLE)); + + /* Signals */ + signals[CONNECTION_SECRETS_UPDATED] = + g_signal_new ("connection-secrets-updated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMActRequestClass, secrets_updated), + NULL, NULL, + _nm_marshal_VOID__OBJECT_POINTER_UINT, + G_TYPE_NONE, 3, + G_TYPE_OBJECT, G_TYPE_POINTER, G_TYPE_UINT); + + signals[CONNECTION_SECRETS_FAILED] = + g_signal_new ("connection-secrets-failed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMActRequestClass, secrets_failed), + NULL, NULL, + _nm_marshal_VOID__OBJECT_STRING_UINT, + G_TYPE_NONE, 3, + G_TYPE_OBJECT, G_TYPE_STRING, G_TYPE_UINT); + + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMActRequestClass, properties_changed)); + + nm_active_connection_install_type_info (object_class); +} + +static gboolean +secrets_update_setting (NMSecretsProviderInterface *interface, + const char *setting_name, + GHashTable *new) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (interface); + NMSetting *setting = NULL; + GError *error = NULL; + GType type; + + g_return_val_if_fail (priv->connection != NULL, FALSE); + + /* Check whether a complete & valid NMSetting object was returned. If + * yes, replace the setting object in the connection. If not, just try + * updating the secrets. + */ + type = nm_connection_lookup_setting_type (setting_name); + if (type == 0) + return FALSE; + + setting = nm_setting_new_from_hash (type, new); + if (setting) { + NMSetting *s_8021x = NULL; + GSList *all_settings = NULL; + + /* The wireless-security setting might need the 802.1x setting in + * the all_settings argument of the verify function. Ugh. + */ + s_8021x = nm_connection_get_setting (priv->connection, NM_TYPE_SETTING_802_1X); + if (s_8021x) + all_settings = g_slist_append (all_settings, s_8021x); + + if (!nm_setting_verify (setting, all_settings, NULL)) { + /* Just try updating secrets */ + g_object_unref (setting); + setting = NULL; + } + + g_slist_free (all_settings); + } + + if (setting) + nm_connection_add_setting (priv->connection, setting); + else { + if (!nm_connection_update_secrets (priv->connection, setting_name, new, &error)) { + nm_log_warn (LOGD_DEVICE, "Failed to update connection secrets: %d %s", + error ? error->code : -1, + error && error->message ? error->message : "(none)"); + g_clear_error (&error); + } + } + + return TRUE; +} + +static void +secrets_result (NMSecretsProviderInterface *interface, + const char *setting_name, + RequestSecretsCaller caller, + const GSList *updated, + GError *error) +{ + NMActRequest *self = NM_ACT_REQUEST (interface); + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (self); + + g_return_if_fail (priv->connection != NULL); + + if (error) { + g_signal_emit (self, signals[CONNECTION_SECRETS_FAILED], 0, + priv->connection, setting_name, caller); + } else { + g_signal_emit (self, signals[CONNECTION_SECRETS_UPDATED], 0, + priv->connection, updated, caller); + } +} + +static void +secrets_provider_interface_init (NMSecretsProviderInterface *sp_interface_class) +{ + /* interface implementation */ + sp_interface_class->update_setting = secrets_update_setting; + sp_interface_class->result = secrets_result; +} + +gboolean +nm_act_request_get_secrets (NMActRequest *self, + const char *setting_name, + gboolean request_new, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2) +{ + g_return_val_if_fail (self, FALSE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (self), FALSE); + + return nm_secrets_provider_interface_get_secrets (NM_SECRETS_PROVIDER_INTERFACE (self), + nm_act_request_get_connection (self), + setting_name, + request_new, + caller, + hint1, + hint2); +} + +NMConnection * +nm_act_request_get_connection (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NULL); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->connection; +} + +const char * +nm_act_request_get_specific_object (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NULL); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->specific_object; +} + +void +nm_act_request_set_specific_object (NMActRequest *req, + const char *specific_object) +{ + NMActRequestPrivate *priv; + + g_return_if_fail (NM_IS_ACT_REQUEST (req)); + g_return_if_fail (specific_object != NULL); + + priv = NM_ACT_REQUEST_GET_PRIVATE (req); + + if (priv->specific_object) + g_free (priv->specific_object); + priv->specific_object = g_strdup (specific_object); +} + +gboolean +nm_act_request_get_user_requested (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->user_requested; +} + +const char * +nm_act_request_get_active_connection_path (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NULL); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->ac_path; +} + +void +nm_act_request_set_default (NMActRequest *req, gboolean is_default) +{ + NMActRequestPrivate *priv; + + g_return_if_fail (NM_IS_ACT_REQUEST (req)); + + priv = NM_ACT_REQUEST_GET_PRIVATE (req); + if (priv->is_default == is_default) + return; + + priv->is_default = is_default; + g_object_notify (G_OBJECT (req), NM_ACTIVE_CONNECTION_DEFAULT); +} + +gboolean +nm_act_request_get_default (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->is_default; +} + +void +nm_act_request_set_default6 (NMActRequest *req, gboolean is_default6) +{ + NMActRequestPrivate *priv; + + g_return_if_fail (NM_IS_ACT_REQUEST (req)); + + priv = NM_ACT_REQUEST_GET_PRIVATE (req); + if (priv->is_default6 == is_default6) + return; + + priv->is_default6 = is_default6; + g_object_notify (G_OBJECT (req), NM_ACTIVE_CONNECTION_DEFAULT6); +} + +gboolean +nm_act_request_get_default6 (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->is_default6; +} + +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); +} + +void +nm_act_request_set_shared (NMActRequest *req, gboolean shared) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (req); + GSList *list, *iter; + + g_return_if_fail (NM_IS_ACT_REQUEST (req)); + + NM_ACT_REQUEST_GET_PRIVATE (req)->shared = shared; + + /* Tear the rules down in reverse order when sharing is stopped */ + list = g_slist_copy (priv->share_rules); + if (!shared) + list = g_slist_reverse (list); + + /* Send the rules to iptables */ + for (iter = list; iter; iter = g_slist_next (iter)) { + ShareRule *rule = (ShareRule *) iter->data; + char *envp[1] = { NULL }; + char **argv; + char *cmd; + + cmd = g_strdup_printf ("%s --table %s %s %s", + IPTABLES_PATH, + rule->table, + shared ? "--insert" : "--delete", + rule->rule); + if (!cmd) + continue; + + argv = g_strsplit (cmd, " ", 0); + if (argv && argv[0]) { + int status; + GError *error = NULL; + + 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)) { + nm_log_warn (LOGD_SHARING, "Error executing command: (%d) %s", + error ? error->code : -1, + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + } else if (WEXITSTATUS (status)) { + nm_log_warn (LOGD_SHARING, "** Command returned exit status %d.", + WEXITSTATUS (status)); + } + } + g_free (cmd); + if (argv) + g_strfreev (argv); + } + + g_slist_free (list); + + /* Clear the share rule list when sharing is stopped */ + if (!shared) + clear_share_rules (req); +} + +gboolean +nm_act_request_get_shared (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->shared; +} + +void +nm_act_request_add_share_rule (NMActRequest *req, + const char *table, + const char *table_rule) +{ + NMActRequestPrivate *priv = NM_ACT_REQUEST_GET_PRIVATE (req); + ShareRule *rule; + + g_return_if_fail (NM_IS_ACT_REQUEST (req)); + g_return_if_fail (table != NULL); + g_return_if_fail (table_rule != NULL); + + rule = g_malloc0 (sizeof (ShareRule)); + rule->table = g_strdup (table); + rule->rule = g_strdup (table_rule); + priv->share_rules = g_slist_append (priv->share_rules, rule); +} + +GObject * +nm_act_request_get_device (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + return G_OBJECT (NM_ACT_REQUEST_GET_PRIVATE (req)->device); +} + +gboolean +nm_act_request_get_assumed (NMActRequest *req) +{ + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + return NM_ACT_REQUEST_GET_PRIVATE (req)->assumed; +} + diff --git a/src/nm-activation-request.h b/src/nm-activation-request.h new file mode 100644 index 00000000..a2436945 --- /dev/null +++ b/src/nm-activation-request.h @@ -0,0 +1,103 @@ +/* -*- 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 2005 - 2010 Red Hat, Inc. + */ + +#ifndef NM_ACTIVATION_REQUEST_H +#define NM_ACTIVATION_REQUEST_H + +#include +#include +#include "nm-connection.h" +#include "nm-active-connection.h" +#include "nm-secrets-provider-interface.h" + +#define NM_TYPE_ACT_REQUEST (nm_act_request_get_type ()) +#define NM_ACT_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ACT_REQUEST, NMActRequest)) +#define NM_ACT_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ACT_REQUEST, NMActRequestClass)) +#define NM_IS_ACT_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_ACT_REQUEST)) +#define NM_IS_ACT_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_ACT_REQUEST)) +#define NM_ACT_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_ACT_REQUEST, NMActRequestClass)) + +typedef struct { + GObject parent; +} NMActRequest; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*secrets_updated) (NMActRequest *req, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller); + void (*secrets_failed) (NMActRequest *req, + NMConnection *connection, + const char *setting, + RequestSecretsCaller caller); + + void (*properties_changed) (NMActRequest *req, GHashTable *properties); +} NMActRequestClass; + +GType nm_act_request_get_type (void); + +NMActRequest *nm_act_request_new (NMConnection *connection, + const char *specific_object, + gboolean user_requested, + gboolean assumed, + gpointer *device); /* An NMDevice */ + +NMConnection *nm_act_request_get_connection (NMActRequest *req); +const char * nm_act_request_get_specific_object (NMActRequest *req); + +void nm_act_request_set_specific_object (NMActRequest *req, + const char *specific_object); + +gboolean nm_act_request_get_user_requested (NMActRequest *req); + +const char * nm_act_request_get_active_connection_path (NMActRequest *req); + +void nm_act_request_set_default (NMActRequest *req, gboolean is_default); + +gboolean nm_act_request_get_default (NMActRequest *req); + +void nm_act_request_set_default6 (NMActRequest *req, gboolean is_default6); + +gboolean nm_act_request_get_default6 (NMActRequest *req); + +gboolean nm_act_request_get_shared (NMActRequest *req); + +void nm_act_request_set_shared (NMActRequest *req, gboolean shared); + +void nm_act_request_add_share_rule (NMActRequest *req, + const char *table, + const char *rule); + +GObject * nm_act_request_get_device (NMActRequest *req); + +gboolean nm_act_request_get_assumed (NMActRequest *req); + +gboolean nm_act_request_get_secrets (NMActRequest *req, + const char *setting_name, + gboolean request_new, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2); + +#endif /* NM_ACTIVATION_REQUEST_H */ + diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c new file mode 100644 index 00000000..4207e145 --- /dev/null +++ b/src/nm-active-connection.c @@ -0,0 +1,63 @@ +/* -*- 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) 2008 - 2010 Red Hat, Inc. + */ + +#include +#include "nm-active-connection.h" +#include "NetworkManager.h" +#include "nm-active-connection-glue.h" +#include "nm-logging.h" + +char * +nm_active_connection_get_next_object_path (void) +{ + static guint32 counter = 0; + + return g_strdup_printf (NM_DBUS_PATH "/ActiveConnection/%d", counter++); +} + +void +nm_active_connection_install_type_info (GObjectClass *klass) +{ + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_active_connection_object_info); +} + +void +nm_active_connection_scope_to_value (NMConnection *connection, GValue *value) +{ + if (!connection) { + g_value_set_string (value, ""); + return; + } + + switch (nm_connection_get_scope (connection)) { + case NM_CONNECTION_SCOPE_SYSTEM: + g_value_set_string (value, NM_DBUS_SERVICE_SYSTEM_SETTINGS); + break; + case NM_CONNECTION_SCOPE_USER: + g_value_set_string (value, NM_DBUS_SERVICE_USER_SETTINGS); + break; + default: + nm_log_err (LOGD_CORE, "unknown connection scope!"); + break; + } +} + + diff --git a/src/nm-active-connection.h b/src/nm-active-connection.h new file mode 100644 index 00000000..6a463cb2 --- /dev/null +++ b/src/nm-active-connection.h @@ -0,0 +1,42 @@ +/* -*- 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) 2008 - 2010 Red Hat, Inc. + */ + +#ifndef NM_ACTIVE_CONNECTION_H +#define NM_ACTIVE_CONNECTION_H + +#include +#include "nm-connection.h" + +#define NM_ACTIVE_CONNECTION_SERVICE_NAME "service-name" +#define NM_ACTIVE_CONNECTION_CONNECTION "connection" +#define NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT "specific-object" +#define NM_ACTIVE_CONNECTION_DEVICES "devices" +#define NM_ACTIVE_CONNECTION_STATE "state" +#define NM_ACTIVE_CONNECTION_DEFAULT "default" +#define NM_ACTIVE_CONNECTION_DEFAULT6 "default6" +#define NM_ACTIVE_CONNECTION_VPN "vpn" + +char *nm_active_connection_get_next_object_path (void); + +void nm_active_connection_install_type_info (GObjectClass *klass); + +void nm_active_connection_scope_to_value (NMConnection *connection, GValue *value); + +#endif /* NM_ACTIVE_CONNECTION_H */ diff --git a/src/nm-call-store.c b/src/nm-call-store.c new file mode 100644 index 00000000..df400d0f --- /dev/null +++ b/src/nm-call-store.c @@ -0,0 +1,209 @@ +/* -*- 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) +{ + return g_hash_table_new_full (NULL, NULL, NULL, + (GDestroyNotify) g_hash_table_destroy); +} + +static void +object_destroyed_cb (gpointer data, GObject *object) +{ + g_hash_table_remove ((NMCallStore *) data, object); +} + +void +nm_call_store_add (NMCallStore *store, + GObject *object, + gpointer *call_id) +{ + GHashTable *call_ids_hash; + + g_return_if_fail (store != NULL); + g_return_if_fail (object != NULL); + g_return_if_fail (call_id != NULL); + + call_ids_hash = g_hash_table_lookup (store, object); + if (!call_ids_hash) { + call_ids_hash = g_hash_table_new (NULL, NULL); + g_hash_table_insert (store, object, call_ids_hash); + g_object_weak_ref (object, object_destroyed_cb, store); + } + + g_hash_table_insert (call_ids_hash, call_id, NULL); +} + +void +nm_call_store_remove (NMCallStore *store, + GObject *object, + gpointer call_id) +{ + GHashTable *call_ids_hash; + + g_return_if_fail (store != NULL); + g_return_if_fail (object != NULL); + g_return_if_fail (call_id != NULL); + + call_ids_hash = g_hash_table_lookup (store, object); + if (!call_ids_hash) { + nm_log_warn (LOGD_CORE, "Trying to remove a non-existant call id."); + return; + } + + if (!g_hash_table_remove (call_ids_hash, call_id)) + nm_log_warn (LOGD_CORE, "Trying to remove a non-existant call id."); + + if (g_hash_table_size (call_ids_hash) == 0) { + g_hash_table_remove (store, object); + g_object_weak_unref (object, object_destroyed_cb, store); + } +} + +typedef struct { + GObject *object; + gint count; + NMCallStoreFunc callback; + gpointer user_data; +} StoreForeachInfo; + +static void +call_callback (gpointer call_id, gpointer user_data) +{ + StoreForeachInfo *info = (StoreForeachInfo *) user_data; + + if (info->count >= 0) { + if (info->callback (info->object, call_id, info->user_data)) + info->count++; + else + info->count = -1; + } +} + +static void +prepend_id (gpointer key, gpointer value, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + + *list = g_slist_prepend (*list, key); +} + +static GSList * +get_call_ids (GHashTable *hash) +{ + GSList *ids = NULL; + + g_hash_table_foreach (hash, prepend_id, &ids); + + return ids; +} + +static void +call_all_callbacks (gpointer key, gpointer value, gpointer user_data) +{ + StoreForeachInfo *info = (StoreForeachInfo *) user_data; + GSList *ids; + + info->object = G_OBJECT (key); + + /* Create a copy of the hash keys (call_ids) so that the callback is + free to modify the store */ + ids = get_call_ids ((GHashTable *) value); + g_slist_foreach (ids, call_callback, info); + g_slist_free (ids); +} + +static void +duplicate_hash (gpointer key, gpointer value, gpointer user_data) +{ + g_hash_table_insert ((GHashTable *) user_data, key, value); +} + +int +nm_call_store_foreach (NMCallStore *store, + GObject *object, + NMCallStoreFunc callback, + gpointer user_data) +{ + StoreForeachInfo info; + + g_return_val_if_fail (store != NULL, -1); + g_return_val_if_fail (callback != NULL, -1); + + info.object = object; + info.count = 0; + info.callback = callback; + info.user_data = user_data; + + if (object) { + GHashTable *call_ids_hash; + GSList *ids; + + call_ids_hash = g_hash_table_lookup (store, object); + if (!call_ids_hash) { + nm_log_warn (LOGD_CORE, "Object not in store"); + return -1; + } + + /* Create a copy of the hash keys (call_ids) so that the callback is + free to modify the store */ + ids = get_call_ids (call_ids_hash); + g_slist_foreach (ids, call_callback, &info); + g_slist_free (ids); + } else { + GHashTable *copy; + + /* Create a copy of the main store so that callbacks can modify it */ + copy = g_hash_table_new (NULL, NULL); + g_hash_table_foreach (store, duplicate_hash, copy); + g_hash_table_foreach (copy, call_all_callbacks, &info); + g_hash_table_destroy (copy); + } + + return info.count; +} + +static void +remove_weakref (gpointer key, gpointer value, gpointer user_data) +{ + g_object_weak_unref (G_OBJECT (key), object_destroyed_cb, user_data); +} + +void +nm_call_store_clear (NMCallStore *store) +{ + g_return_if_fail (store); + + g_hash_table_foreach (store, remove_weakref, store); + g_hash_table_remove_all (store); +} + +void +nm_call_store_destroy (NMCallStore *store) +{ + g_return_if_fail (store); + + g_hash_table_destroy (store); +} diff --git a/src/nm-call-store.h b/src/nm-call-store.h new file mode 100644 index 00000000..0ae5a769 --- /dev/null +++ b/src/nm-call-store.h @@ -0,0 +1,47 @@ +/* -*- 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 NM_CALLBACK_STORE_H +#define NM_CALLBACK_STORE_H + +#include + +typedef GHashTable NMCallStore; + +typedef gboolean (*NMCallStoreFunc) (GObject *object, gpointer call_id, gpointer user_data); + +NMCallStore *nm_call_store_new (void); +void nm_call_store_add (NMCallStore *store, + GObject *object, + gpointer *call_id); + +void nm_call_store_remove (NMCallStore *store, + GObject *object, + gpointer call_id); + +int nm_call_store_foreach (NMCallStore *store, + GObject *object, + NMCallStoreFunc callback, + gpointer user_data); + +void nm_call_store_clear (NMCallStore *store); +void nm_call_store_destroy (NMCallStore *store); + +#endif /* NM_CALLBACK_STORE_H */ diff --git a/src/nm-crash-logger.c b/src/nm-crash-logger.c new file mode 100644 index 00000000..9ad0412d --- /dev/null +++ b/src/nm-crash-logger.c @@ -0,0 +1,86 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + */ + + +#include +#include +#include +#include +#include +#include +#include + +int main (int argc, char ** argv) +{ + GPid gdb_pid; + int out; + char nm_pid[16]; + char line[256]; + int gdb_stat; + int bytes_read; + gboolean done = FALSE; + char * args[] = { BINDIR "/gdb", + "--batch", + "--quiet", + "--command=" DATADIR "/NetworkManager/gdb-cmd", + SBINDIR "/NetworkManager", + NULL, NULL }; + + snprintf (nm_pid, sizeof (nm_pid), "%d", getppid ()); + args[5] = &nm_pid[0]; + if (!g_spawn_async_with_pipes (NULL, args, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, + &gdb_pid, NULL, &out, NULL, NULL)) + { + exit (1); + } + + openlog ("NetworkManager", LOG_CONS | LOG_PERROR, LOG_DAEMON); + syslog (LOG_CRIT, "******************* START **********************************"); + while (!done) + { + bytes_read = read (out, line, sizeof (line) - 1); + if (bytes_read > 0) + { + char *end = &line[0]; + char *start = &line[0]; + + /* Can't just funnel the output to syslog, have to do a separate + * syslog () for each line in the output. + */ + line[bytes_read] = '\0'; + while (*end != '\0') + { + if (*end == '\n') + { + *end = '\0'; + syslog (LOG_CRIT, "%s", start); + start = end + 1; + } + end++; + } + } + else if ((bytes_read <= 0) || ((errno != EINTR) && (errno != EAGAIN))) + done = TRUE; + } + syslog (LOG_CRIT, "******************* END **********************************"); + close (out); + waitpid (gdb_pid, &gdb_stat, 0); + exit (0); +} diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c new file mode 100644 index 00000000..9b621b42 --- /dev/null +++ b/src/nm-dbus-manager.c @@ -0,0 +1,378 @@ +/* -*- 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) 2006 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include "config.h" +#include "NetworkManager.h" +#include "nm-dbus-manager.h" +#include "nm-marshal.h" +#include "nm-glib-compat.h" + +#include +#include +#include +#include +#include "nm-logging.h" + +enum { + DBUS_CONNECTION_CHANGED = 0, + NAME_OWNER_CHANGED, + NUMBER_OF_SIGNALS +}; + +static guint signals[NUMBER_OF_SIGNALS]; + +G_DEFINE_TYPE(NMDBusManager, nm_dbus_manager, G_TYPE_OBJECT) + +#define NM_DBUS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_DBUS_MANAGER, \ + NMDBusManagerPrivate)) + +typedef struct { + DBusConnection *connection; + DBusGConnection *g_connection; + gboolean started; + + DBusGProxy *proxy; + guint proxy_destroy_id; + + guint reconnect_id; +} NMDBusManagerPrivate; + +static gboolean nm_dbus_manager_init_bus (NMDBusManager *self); +static void nm_dbus_manager_cleanup (NMDBusManager *self, gboolean dispose); +static void start_reconnection_timeout (NMDBusManager *self); + +NMDBusManager * +nm_dbus_manager_get (void) +{ + static NMDBusManager *singleton = NULL; + + if (!singleton) { + singleton = NM_DBUS_MANAGER (g_object_new (NM_TYPE_DBUS_MANAGER, NULL)); + if (!nm_dbus_manager_init_bus (singleton)) + start_reconnection_timeout (singleton); + } else { + g_object_ref (singleton); + } + + g_assert (singleton); + return singleton; +} + +static void +nm_dbus_manager_init (NMDBusManager *self) +{ +} + +static void +nm_dbus_manager_dispose (GObject *object) +{ + NMDBusManagerPrivate *priv = NM_DBUS_MANAGER_GET_PRIVATE (object); + + nm_dbus_manager_cleanup (NM_DBUS_MANAGER (object), TRUE); + + if (priv->reconnect_id) { + g_source_remove (priv->reconnect_id); + priv->reconnect_id = 0; + } + + G_OBJECT_CLASS (nm_dbus_manager_parent_class)->dispose (object); +} + +static void +nm_dbus_manager_class_init (NMDBusManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->dispose = nm_dbus_manager_dispose; + + signals[DBUS_CONNECTION_CHANGED] = + g_signal_new ("dbus-connection-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMDBusManagerClass, dbus_connection_changed), + NULL, NULL, _nm_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + signals[NAME_OWNER_CHANGED] = + g_signal_new ("name-owner-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMDBusManagerClass, name_owner_changed), + NULL, NULL, _nm_marshal_VOID__STRING_STRING_STRING, + G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); + + g_type_class_add_private (klass, sizeof (NMDBusManagerPrivate)); +} + + +/* Only cleanup a specific dbus connection, not all our private data */ +static void +nm_dbus_manager_cleanup (NMDBusManager *self, gboolean dispose) +{ + NMDBusManagerPrivate *priv = NM_DBUS_MANAGER_GET_PRIVATE (self); + + if (priv->proxy) { + if (dispose) { + g_signal_handler_disconnect (priv->proxy, priv->proxy_destroy_id); + priv->proxy_destroy_id = 0; + } + g_object_unref (priv->proxy); + priv->proxy = NULL; + } + + if (priv->g_connection) { + dbus_g_connection_unref (priv->g_connection); + priv->g_connection = NULL; + priv->connection = NULL; + } + + priv->started = FALSE; +} + +static gboolean +nm_dbus_manager_reconnect (gpointer user_data) +{ + NMDBusManager *self = NM_DBUS_MANAGER (user_data); + NMDBusManagerPrivate *priv = NM_DBUS_MANAGER_GET_PRIVATE (self); + + g_assert (self != NULL); + + if (nm_dbus_manager_init_bus (self)) { + if (nm_dbus_manager_start_service (self)) { + nm_log_info (LOGD_CORE, "reconnected to the system bus."); + g_signal_emit (self, signals[DBUS_CONNECTION_CHANGED], + 0, priv->connection); + priv->reconnect_id = 0; + return FALSE; + } + } + + /* Try again */ + nm_dbus_manager_cleanup (self, FALSE); + return TRUE; +} + +static void +start_reconnection_timeout (NMDBusManager *self) +{ + NMDBusManagerPrivate *priv = NM_DBUS_MANAGER_GET_PRIVATE (self); + + if (priv->reconnect_id) + g_source_remove (priv->reconnect_id); + + /* Schedule timeout for reconnection attempts */ + priv->reconnect_id = g_timeout_add_seconds (3, nm_dbus_manager_reconnect, self); +} + +char * +nm_dbus_manager_get_name_owner (NMDBusManager *self, + const char *name, + GError **error) +{ + char *owner = NULL; + + g_return_val_if_fail (NM_IS_DBUS_MANAGER (self), NULL); + g_return_val_if_fail (name != NULL, NULL); + if (error) + g_return_val_if_fail (*error == NULL, NULL); + + if (!dbus_g_proxy_call_with_timeout (NM_DBUS_MANAGER_GET_PRIVATE (self)->proxy, + "GetNameOwner", 2000, error, + G_TYPE_STRING, name, + G_TYPE_INVALID, + G_TYPE_STRING, &owner, + G_TYPE_INVALID)) { + return NULL; + } + + return owner; +} + +gboolean +nm_dbus_manager_name_has_owner (NMDBusManager *self, + const char *name) +{ + gboolean has_owner = FALSE; + GError *err = NULL; + + g_return_val_if_fail (NM_IS_DBUS_MANAGER (self), FALSE); + g_return_val_if_fail (name != NULL, FALSE); + + if (!dbus_g_proxy_call (NM_DBUS_MANAGER_GET_PRIVATE (self)->proxy, + "NameHasOwner", &err, + G_TYPE_STRING, name, + G_TYPE_INVALID, + G_TYPE_BOOLEAN, &has_owner, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_CORE, "NameHasOwner request failed: %s", + (err && err->message) ? err->message : "(unknown)"); + g_clear_error (&err); + } + + return has_owner; +} + +static void +proxy_name_owner_changed (DBusGProxy *proxy, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + g_signal_emit (G_OBJECT (user_data), signals[NAME_OWNER_CHANGED], + 0, name, old_owner, new_owner); +} + +static void +destroy_cb (DBusGProxy *proxy, gpointer user_data) +{ + NMDBusManager *self = NM_DBUS_MANAGER (user_data); + + /* Clean up existing connection */ + nm_log_warn (LOGD_CORE, "disconnected by the system bus."); + NM_DBUS_MANAGER_GET_PRIVATE (self)->proxy = NULL; + + nm_dbus_manager_cleanup (self, FALSE); + + g_signal_emit (G_OBJECT (self), signals[DBUS_CONNECTION_CHANGED], 0, NULL); + + start_reconnection_timeout (self); +} + +static gboolean +nm_dbus_manager_init_bus (NMDBusManager *self) +{ + NMDBusManagerPrivate *priv = NM_DBUS_MANAGER_GET_PRIVATE (self); + GError *err = NULL; + + if (priv->connection) { + nm_log_warn (LOGD_CORE, "DBus Manager already has a valid connection."); + return FALSE; + } + + dbus_connection_set_change_sigpipe (TRUE); + + priv->g_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); + if (!priv->g_connection) { + nm_log_err (LOGD_CORE, "Could not get the system bus. Make sure " + "the message bus daemon is running! Message: %s", + err->message); + g_error_free (err); + return FALSE; + } + + priv->connection = dbus_g_connection_get_connection (priv->g_connection); + dbus_connection_set_exit_on_disconnect (priv->connection, FALSE); + + priv->proxy = dbus_g_proxy_new_for_name (priv->g_connection, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + + priv->proxy_destroy_id = g_signal_connect (priv->proxy, "destroy", + G_CALLBACK (destroy_cb), self); + + dbus_g_proxy_add_signal (priv->proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->proxy, + "NameOwnerChanged", + G_CALLBACK (proxy_name_owner_changed), + self, NULL); + return TRUE; +} + +/* Register our service on the bus; shouldn't be called until + * all necessary message handlers have been registered, because + * when we register on the bus, clients may start to call. + */ +gboolean +nm_dbus_manager_start_service (NMDBusManager *self) +{ + NMDBusManagerPrivate *priv; + int result; + GError *err = NULL; + + g_return_val_if_fail (NM_IS_DBUS_MANAGER (self), FALSE); + + priv = NM_DBUS_MANAGER_GET_PRIVATE (self); + + if (priv->started) { + nm_log_err (LOGD_CORE, "Service has already started."); + return FALSE; + } + + if (!dbus_g_proxy_call (priv->proxy, "RequestName", &err, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE, + G_TYPE_INVALID, + G_TYPE_UINT, &result, + G_TYPE_INVALID)) { + nm_log_err (LOGD_CORE, "Could not acquire the NetworkManager service.\n" + " Error: '%s'", + (err && err->message) ? err->message : "(unknown)"); + g_error_free (err); + return FALSE; + } + + if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + nm_log_err (LOGD_CORE, "Could not acquire the NetworkManager service as it is already taken."); + return FALSE; + } + + if (!dbus_g_proxy_call (priv->proxy, "RequestName", &err, + G_TYPE_STRING, NM_DBUS_SERVICE_SYSTEM_SETTINGS, + G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE, + G_TYPE_INVALID, + G_TYPE_UINT, &result, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_CORE, "Could not acquire the NetworkManagerSystemSettings service.\n" + " Message: '%s'", err->message); + g_error_free (err); + return FALSE; + } + + if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + nm_log_warn (LOGD_CORE, "Could not acquire the NetworkManagerSystemSettings service " + "as it is already taken."); + return FALSE; + } + + priv->started = TRUE; + return priv->started; +} + +DBusConnection * +nm_dbus_manager_get_dbus_connection (NMDBusManager *self) +{ + g_return_val_if_fail (NM_IS_DBUS_MANAGER (self), NULL); + + return NM_DBUS_MANAGER_GET_PRIVATE (self)->connection; +} + +DBusGConnection * +nm_dbus_manager_get_connection (NMDBusManager *self) +{ + g_return_val_if_fail (NM_IS_DBUS_MANAGER (self), NULL); + + return NM_DBUS_MANAGER_GET_PRIVATE (self)->g_connection; +} diff --git a/src/nm-dbus-manager.h b/src/nm-dbus-manager.h new file mode 100644 index 00000000..275ae4e0 --- /dev/null +++ b/src/nm-dbus-manager.h @@ -0,0 +1,78 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef __NM_DBUS_MANAGER_H__ +#define __NM_DBUS_MANAGER_H__ + +#include "config.h" +#include +#include +#include + +G_BEGIN_DECLS + +typedef gboolean (* NMDBusSignalHandlerFunc) (DBusConnection * connection, + DBusMessage * message, + gpointer user_data); + +#define NM_TYPE_DBUS_MANAGER (nm_dbus_manager_get_type ()) +#define NM_DBUS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_DBUS_MANAGER, NMDBusManager)) +#define NM_DBUS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NM_TYPE_DBUS_MANAGER, NMDBusManagerClass)) +#define NM_IS_DBUS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NM_TYPE_DBUS_MANAGER)) +#define NM_IS_DBUS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NM_TYPE_DBUS_MANAGER)) +#define NM_DBUS_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NM_TYPE_DBUS_MANAGER, NMDBusManagerClass)) + +typedef struct { + GObject parent; +} NMDBusManager; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*dbus_connection_changed) (NMDBusManager *mgr, + DBusConnection *connection); + + void (*name_owner_changed) (NMDBusManager *mgr, + const char *name, + const char *old_owner, + const char *new_owner); +} NMDBusManagerClass; + +GType nm_dbus_manager_get_type (void); + +NMDBusManager * nm_dbus_manager_get (void); + +char * nm_dbus_manager_get_name_owner (NMDBusManager *self, + const char *name, + GError **error); + +gboolean nm_dbus_manager_start_service (NMDBusManager *self); + +gboolean nm_dbus_manager_name_has_owner (NMDBusManager *self, + const char *name); + +DBusConnection * nm_dbus_manager_get_dbus_connection (NMDBusManager *self); +DBusGConnection * nm_dbus_manager_get_connection (NMDBusManager *self); + +G_END_DECLS + +#endif /* __NM_DBUS_MANAGER_H__ */ diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c new file mode 100644 index 00000000..3ef08de8 --- /dev/null +++ b/src/nm-device-bt.c @@ -0,0 +1,1073 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + */ + +#include +#include +#include + +#include "nm-glib-compat.h" +#include "nm-bluez-common.h" +#include "nm-dbus-manager.h" +#include "nm-device-bt.h" +#include "nm-device-interface.h" +#include "nm-device-private.h" +#include "nm-logging.h" +#include "nm-marshal.h" +#include "ppp-manager/nm-ppp-manager.h" +#include "nm-properties-changed-signal.h" +#include "nm-setting-connection.h" +#include "nm-setting-bluetooth.h" +#include "nm-setting-cdma.h" +#include "nm-setting-gsm.h" +#include "nm-device-bt-glue.h" +#include "NetworkManagerUtils.h" + +#define BLUETOOTH_DUN_UUID "dun" +#define BLUETOOTH_NAP_UUID "nap" + +G_DEFINE_TYPE (NMDeviceBt, nm_device_bt, NM_TYPE_DEVICE) + +#define NM_DEVICE_BT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BT, NMDeviceBtPrivate)) + +typedef struct { + char *bdaddr; + char *name; + guint32 capabilities; + + gboolean connected; + gboolean have_iface; + + DBusGProxy *type_proxy; + DBusGProxy *dev_proxy; + + char *rfcomm_iface; + NMModem *modem; + guint32 timeout_id; + + guint32 bt_type; /* BT type of the current connection */ +} NMDeviceBtPrivate; + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_BT_NAME, + PROP_BT_CAPABILITIES, + + LAST_PROP +}; + +enum { + PPP_STATS, + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + + +typedef enum { + NM_BT_ERROR_CONNECTION_NOT_BT = 0, + NM_BT_ERROR_CONNECTION_INVALID, + NM_BT_ERROR_CONNECTION_INCOMPATIBLE, +} NMBtError; + +#define NM_BT_ERROR (nm_bt_error_quark ()) +#define NM_TYPE_BT_ERROR (nm_bt_error_get_type ()) + +static GQuark +nm_bt_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-bt-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +static GType +nm_bt_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Connection was not a BT connection. */ + ENUM_ENTRY (NM_BT_ERROR_CONNECTION_NOT_BT, "ConnectionNotBt"), + /* Connection was not a valid BT connection. */ + ENUM_ENTRY (NM_BT_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + /* Connection does not apply to this device. */ + ENUM_ENTRY (NM_BT_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMBtError", values); + } + return etype; +} + + +guint32 nm_device_bt_get_capabilities (NMDeviceBt *self) +{ + g_return_val_if_fail (self != NULL, NM_BT_CAPABILITY_NONE); + g_return_val_if_fail (NM_IS_DEVICE_BT (self), NM_BT_CAPABILITY_NONE); + + return NM_DEVICE_BT_GET_PRIVATE (self)->capabilities; +} + +const char *nm_device_bt_get_hw_address (NMDeviceBt *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE_BT (self), NULL); + + return NM_DEVICE_BT_GET_PRIVATE (self)->bdaddr; +} + +static guint32 +get_connection_bt_type (NMConnection *connection) +{ + NMSettingBluetooth *s_bt; + const char *bt_type; + + s_bt = (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + if (!s_bt) + return NM_BT_CAPABILITY_NONE; + + bt_type = nm_setting_bluetooth_get_connection_type (s_bt); + g_assert (bt_type); + + if (!strcmp (bt_type, NM_SETTING_BLUETOOTH_TYPE_DUN)) + return NM_BT_CAPABILITY_DUN; + else if (!strcmp (bt_type, NM_SETTING_BLUETOOTH_TYPE_PANU)) + return NM_BT_CAPABILITY_NAP; + + return NM_BT_CAPABILITY_NONE; +} + +static NMConnection * +real_get_best_auto_connection (NMDevice *device, + GSList *connections, + char **specific_object) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + GSList *iter; + + for (iter = connections; iter; iter = g_slist_next (iter)) { + NMConnection *connection = NM_CONNECTION (iter->data); + NMSettingConnection *s_con; + guint32 bt_type; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + + if (!nm_setting_connection_get_autoconnect (s_con)) + continue; + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_BLUETOOTH_SETTING_NAME)) + continue; + + bt_type = get_connection_bt_type (connection); + if (!(bt_type & priv->capabilities)) + continue; + + return connection; + } + return NULL; +} + +static gboolean +real_check_connection_compatible (NMDevice *device, + NMConnection *connection, + GError **error) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + const GByteArray *array; + char *str; + int addr_match = FALSE; + guint32 bt_type; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_BLUETOOTH_SETTING_NAME)) { + g_set_error (error, + NM_BT_ERROR, NM_BT_ERROR_CONNECTION_NOT_BT, + "The connection was not a Bluetooth connection."); + return FALSE; + } + + s_bt = NM_SETTING_BLUETOOTH (nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH)); + if (!s_bt) { + g_set_error (error, + NM_BT_ERROR, NM_BT_ERROR_CONNECTION_INVALID, + "The connection was not a valid Bluetooth connection."); + return FALSE; + } + + array = nm_setting_bluetooth_get_bdaddr (s_bt); + if (!array || (array->len != ETH_ALEN)) { + g_set_error (error, + NM_BT_ERROR, NM_BT_ERROR_CONNECTION_INVALID, + "The connection did not contain a valid Bluetooth address."); + return FALSE; + } + + bt_type = get_connection_bt_type (connection); + if (!(bt_type & priv->capabilities)) { + g_set_error (error, + NM_BT_ERROR, NM_BT_ERROR_CONNECTION_INCOMPATIBLE, + "The connection was not compatible with the device's capabilities."); + return FALSE; + } + + str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + array->data[0], array->data[1], array->data[2], + array->data[3], array->data[4], array->data[5]); + addr_match = !strcmp (priv->bdaddr, str); + g_free (str); + + return addr_match; +} + +static guint32 +real_get_generic_capabilities (NMDevice *dev) +{ + return NM_DEVICE_CAP_NM_SUPPORTED; +} + +/*****************************************************************************/ +/* IP method PPP */ + +static void +ppp_stats (NMModem *modem, + guint32 in_bytes, + guint32 out_bytes, + gpointer user_data) +{ + g_signal_emit (NM_DEVICE_BT (user_data), signals[PPP_STATS], 0, in_bytes, out_bytes); +} + +static void +ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + switch (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_ACTIVATED: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + break; + case NM_DEVICE_STATE_IP_CONFIG: + if (nm_device_ip_config_should_fail (device, FALSE)) { + nm_device_state_changed (device, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } + break; + default: + break; + } +} + +static void +modem_need_auth (NMModem *modem, + const char *setting_name, + gboolean retry, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2, + gpointer user_data) +{ + NMDeviceBt *self = NM_DEVICE_BT (user_data); + NMActRequest *req; + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + nm_act_request_get_secrets (req, setting_name, retry, caller, hint1, hint2); +} + +static void +modem_prepare_result (NMModem *modem, + gboolean success, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_CONFIG || state == NM_DEVICE_STATE_NEED_AUTH); + + if (success) { + NMActRequest *req; + NMActStageReturn ret; + NMDeviceStateReason stage2_reason = NM_DEVICE_STATE_REASON_NONE; + + req = nm_device_get_act_request (device); + g_assert (req); + + ret = nm_modem_act_stage2_config (modem, req, &stage2_reason); + switch (ret) { + case NM_ACT_STAGE_RETURN_POSTPONE: + break; + case NM_ACT_STAGE_RETURN_SUCCESS: + nm_device_activate_schedule_stage3_ip_config_start (device); + break; + case NM_ACT_STAGE_RETURN_FAILURE: + default: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, stage2_reason); + break; + } + } else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); +} + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + + if (priv->modem) + nm_modem_device_state_changed (priv->modem, new_state, old_state, reason); +} + +static void +modem_ip4_config_result (NMModem *self, + const char *iface, + NMIP4Config *config, + GError *error, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); + + if (error) { + nm_log_warn (LOGD_MB | LOGD_IP4 | LOGD_BT, + "(%s): retrieving IP4 configuration failed: (%d) %s", + nm_device_get_ip_iface (device), + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } else { + if (iface) + nm_device_set_ip_iface (device, iface); + + nm_device_activate_schedule_stage4_ip4_config_get (device); + } +} + +static gboolean +modem_stage1 (NMDeviceBt *self, NMModem *modem, NMDeviceStateReason *reason) +{ + NMActRequest *req; + NMActStageReturn ret; + + g_return_val_if_fail (reason != NULL, FALSE); + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + + ret = nm_modem_act_stage1_prepare (modem, req, reason); + switch (ret) { + case NM_ACT_STAGE_RETURN_POSTPONE: + case NM_ACT_STAGE_RETURN_SUCCESS: + /* Success, wait for the 'prepare-result' signal */ + return TRUE; + case NM_ACT_STAGE_RETURN_FAILURE: + default: + break; + } + + return FALSE; +} + +static void +real_connection_secrets_updated (NMDevice *device, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) +{ + NMDeviceBt *self = NM_DEVICE_BT (device); + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); + NMActRequest *req; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + g_return_if_fail (IS_ACTIVATING_STATE (nm_device_get_state (device))); + + req = nm_device_get_act_request (device); + g_assert (req); + + if (!nm_modem_connection_secrets_updated (priv->modem, + req, + connection, + updated_settings, + caller)) { + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); + return; + } + + /* PPP handles stuff itself... */ + if (caller == SECRETS_CALLER_PPP) + return; + + /* Otherwise, on success for GSM/CDMA secrets we need to schedule modem stage1 again */ + g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH); + if (!modem_stage1 (self, priv->modem, &reason)) + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, reason); +} + +/*****************************************************************************/ + +gboolean +nm_device_bt_modem_added (NMDeviceBt *self, + NMModem *modem, + const char *driver) +{ + NMDeviceBtPrivate *priv; + const char *modem_iface; + char *base; + NMDeviceState state; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DEVICE_BT (self), FALSE); + g_return_val_if_fail (modem != NULL, FALSE); + g_return_val_if_fail (NM_IS_MODEM (modem), FALSE); + + priv = NM_DEVICE_BT_GET_PRIVATE (self); + modem_iface = nm_modem_get_iface (modem); + g_return_val_if_fail (modem_iface != NULL, FALSE); + + if (!priv->rfcomm_iface) + return FALSE; + + base = g_path_get_basename (priv->rfcomm_iface); + if (strcmp (base, modem_iface)) { + g_free (base); + return FALSE; + } + g_free (base); + + /* Got the modem */ + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + + /* Can only accept the modem in stage2, but since the interface matched + * what we were expecting, don't let anything else claim the modem either. + */ + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); + if (state != NM_DEVICE_STATE_CONFIG) { + nm_log_warn (LOGD_BT | LOGD_MB, + "(%s): modem found but device not in correct state (%d)", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_state (NM_DEVICE (self))); + return TRUE; + } + + nm_log_info (LOGD_BT | LOGD_MB, + "Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) modem found.", + nm_device_get_iface (NM_DEVICE (self))); + + if (priv->modem) { + g_warn_if_reached (); + g_object_unref (priv->modem); + } + + priv->modem = g_object_ref (modem); + g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), self); + g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), self); + g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), self); + g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), self); + g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), self); + + /* Kick off the modem connection */ + if (!modem_stage1 (self, modem, &reason)) + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, reason); + + return TRUE; +} + +gboolean +nm_device_bt_modem_removed (NMDeviceBt *self, NMModem *modem) +{ + NMDeviceBtPrivate *priv; + NMDeviceState state; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_DEVICE_BT (self), FALSE); + g_return_val_if_fail (modem != NULL, FALSE); + g_return_val_if_fail (NM_IS_MODEM (modem), FALSE); + + priv = NM_DEVICE_BT_GET_PRIVATE (self); + + if (modem != priv->modem) + return FALSE; + + state = nm_device_get_state (NM_DEVICE (self)); + nm_modem_device_state_changed (priv->modem, + NM_DEVICE_STATE_DISCONNECTED, + state, + NM_DEVICE_STATE_REASON_USER_REQUESTED); + + g_object_unref (priv->modem); + priv->modem = NULL; + return TRUE; +} + +static gboolean +modem_find_timeout (gpointer user_data) +{ + NMDeviceBt *self = NM_DEVICE_BT (user_data); + + NM_DEVICE_BT_GET_PRIVATE (self)->timeout_id = 0; + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND); + return FALSE; +} + +static void +check_connect_continue (NMDeviceBt *self) +{ + NMDevice *device = NM_DEVICE (self); + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); + gboolean pan = (priv->bt_type == NM_BT_CAPABILITY_NAP); + gboolean dun = (priv->bt_type == NM_BT_CAPABILITY_DUN); + + if (!priv->connected || !priv->have_iface) + return; + + nm_log_info (LOGD_BT, "Activation (%s %s/bluetooth) Stage 2 of 5 (Device Configure) " + "successful. Will connect via %s.", + nm_device_get_iface (device), + nm_device_get_ip_iface (device), + dun ? "DUN" : (pan ? "PAN" : "unknown")); + + /* Kill the connect timeout since we're connected now */ + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + + if (pan) { + /* Bluez says we're connected now. Start IP config. */ + nm_device_activate_schedule_stage3_ip_config_start (device); + } else if (dun) { + /* Wait for ModemManager to find the modem */ + priv->timeout_id = g_timeout_add_seconds (30, modem_find_timeout, self); + + nm_log_info (LOGD_BT | LOGD_MB, "Activation (%s/bluetooth) Stage 2 of 5 (Device Configure) " + "waiting for modem to appear.", + nm_device_get_iface (device)); + } else + g_assert_not_reached (); +} + +static void +bluez_connect_cb (DBusGProxy *proxy, + DBusGProxyCall *call_id, + void *user_data) +{ + NMDeviceBt *self = NM_DEVICE_BT (user_data); + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); + GError *error = NULL; + char *device; + + if (dbus_g_proxy_end_call (proxy, call_id, &error, + G_TYPE_STRING, &device, + G_TYPE_INVALID) == FALSE) { + nm_log_warn (LOGD_BT, "Error connecting with bluez: %s", + error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); + + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_BT_FAILED); + return; + } + + if (!device || !strlen (device)) { + nm_log_warn (LOGD_BT, "Invalid network device returned by bluez"); + + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_BT_FAILED); + } + + if (priv->bt_type == NM_BT_CAPABILITY_DUN) { + g_free (priv->rfcomm_iface); + priv->rfcomm_iface = device; + } else if (priv->bt_type == NM_BT_CAPABILITY_NAP) { + nm_device_set_ip_iface (NM_DEVICE (self), device); + g_free (device); + } + + nm_log_dbg (LOGD_BT, "(%s): connect request successful", + nm_device_get_iface (NM_DEVICE (self))); + + /* Stage 3 gets scheduled when Bluez says we're connected */ + priv->have_iface = TRUE; + check_connect_continue (self); +} + +static void +bluez_property_changed (DBusGProxy *proxy, + const char *property, + GValue *value, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceBt *self = NM_DEVICE_BT (user_data); + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (self); + gboolean connected; + NMDeviceState state; + const char *prop_str = "(unknown)"; + + if (G_VALUE_HOLDS_STRING (value)) + prop_str = g_value_get_string (value); + else if (G_VALUE_HOLDS_BOOLEAN (value)) + prop_str = g_value_get_boolean (value) ? "true" : "false"; + + nm_log_dbg (LOGD_BT, "(%s): bluez property '%s' changed to '%s'", + nm_device_get_iface (device), + property, + prop_str); + + if (strcmp (property, "Connected")) + return; + + state = nm_device_get_state (device); + connected = g_value_get_boolean (value); + if (connected) { + if (state == NM_DEVICE_STATE_CONFIG) { + nm_log_dbg (LOGD_BT, "(%s): connected to the device", + nm_device_get_iface (device)); + + priv->connected = TRUE; + check_connect_continue (self); + } + } else { + gboolean fail = FALSE; + + /* Bluez says we're disconnected from the device. Suck. */ + + if (nm_device_is_activating (device)) { + nm_log_info (LOGD_BT, + "Activation (%s/bluetooth): bluetooth link disconnected.", + nm_device_get_iface (device)); + fail = TRUE; + } else if (state == NM_DEVICE_STATE_ACTIVATED) { + nm_log_info (LOGD_BT, "(%s): bluetooth link disconnected.", + nm_device_get_iface (device)); + fail = TRUE; + } + + if (fail) { + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_CARRIER); + priv->connected = FALSE; + } + } +} + +static gboolean +bt_connect_timeout (gpointer user_data) +{ + NMDeviceBt *self = NM_DEVICE_BT (user_data); + + nm_log_dbg (LOGD_BT, "(%s): initial connection timed out", + nm_device_get_iface (NM_DEVICE (self))); + + NM_DEVICE_BT_GET_PRIVATE (self)->timeout_id = 0; + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_BT_FAILED); + return FALSE; +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + NMActRequest *req; + NMDBusManager *dbus_mgr; + DBusGConnection *g_connection; + gboolean dun = FALSE; + + req = nm_device_get_act_request (device); + g_assert (req); + + priv->bt_type = get_connection_bt_type (nm_act_request_get_connection (req)); + if (priv->bt_type == NM_BT_CAPABILITY_NONE) { + // FIXME: set a reason code + return NM_ACT_STAGE_RETURN_FAILURE; + } + + dbus_mgr = nm_dbus_manager_get (); + g_connection = nm_dbus_manager_get_connection (dbus_mgr); + g_object_unref (dbus_mgr); + + if (priv->bt_type == NM_BT_CAPABILITY_DUN) + dun = TRUE; + else if (priv->bt_type == NM_BT_CAPABILITY_NAP) + dun = FALSE; + else + g_assert_not_reached (); + + priv->dev_proxy = dbus_g_proxy_new_for_name (g_connection, + BLUEZ_SERVICE, + nm_device_get_udi (device), + BLUEZ_DEVICE_INTERFACE); + if (!priv->dev_proxy) { + // FIXME: set a reason code + return NM_ACT_STAGE_RETURN_FAILURE; + } + + /* Watch for BT device property changes */ + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_VALUE, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->dev_proxy, "PropertyChanged", + G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->dev_proxy, "PropertyChanged", + G_CALLBACK (bluez_property_changed), device, NULL); + + priv->type_proxy = dbus_g_proxy_new_for_name (g_connection, + BLUEZ_SERVICE, + nm_device_get_udi (device), + dun ? BLUEZ_SERIAL_INTERFACE : BLUEZ_NETWORK_INTERFACE); + if (!priv->type_proxy) { + // FIXME: set a reason code + return NM_ACT_STAGE_RETURN_FAILURE; + } + + nm_log_dbg (LOGD_BT, "(%s): requesting connection to the device", + nm_device_get_iface (device)); + + /* Connect to the BT device */ + dbus_g_proxy_begin_call_with_timeout (priv->type_proxy, "Connect", + bluez_connect_cb, + device, + NULL, + 20000, + G_TYPE_STRING, dun ? BLUETOOTH_DUN_UUID : BLUETOOTH_NAP_UUID, + G_TYPE_INVALID); + + if (priv->timeout_id) + g_source_remove (priv->timeout_id); + priv->timeout_id = g_timeout_add_seconds (30, bt_connect_timeout, device); + + return NM_ACT_STAGE_RETURN_POSTPONE; +} + +static NMActStageReturn +real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + NMActStageReturn ret; + + if (priv->bt_type == NM_BT_CAPABILITY_DUN) { + ret = nm_modem_stage3_ip4_config_start (NM_DEVICE_BT_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_bt_parent_class), + reason); + } else + ret = NM_DEVICE_CLASS (nm_device_bt_parent_class)->act_stage3_ip4_config_start (device, reason); + + return ret; +} + +static NMActStageReturn +real_act_stage4_get_ip4_config (NMDevice *device, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + NMActStageReturn ret; + + if (priv->bt_type == NM_BT_CAPABILITY_DUN) { + ret = nm_modem_stage4_get_ip4_config (NM_DEVICE_BT_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_bt_parent_class), + config, + reason); + } else + ret = NM_DEVICE_CLASS (nm_device_bt_parent_class)->act_stage4_get_ip4_config (device, config, reason); + + return ret; +} + +static void +real_deactivate_quickly (NMDevice *device) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device); + + priv->have_iface = FALSE; + priv->connected = FALSE; + + if (priv->bt_type == NM_BT_CAPABILITY_DUN) { + + if (priv->modem) { + nm_modem_deactivate_quickly (priv->modem, device); + + /* Since we're killing the Modem object before it'll get the + * state change signal, simulate the state change here. + */ + nm_modem_device_state_changed (priv->modem, + NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_ACTIVATED, + NM_DEVICE_STATE_REASON_USER_REQUESTED); + g_object_unref (priv->modem); + priv->modem = NULL; + } + + if (priv->type_proxy) { + /* Don't ever pass NULL through dbus; rfcomm_iface + * might happen to be NULL for some reason. + */ + if (priv->rfcomm_iface) { + dbus_g_proxy_call_no_reply (priv->type_proxy, "Disconnect", + G_TYPE_STRING, priv->rfcomm_iface, + G_TYPE_INVALID); + } + g_object_unref (priv->type_proxy); + priv->type_proxy = NULL; + } + } else if (priv->bt_type == NM_BT_CAPABILITY_NAP) { + if (priv->type_proxy) { + dbus_g_proxy_call_no_reply (priv->type_proxy, "Disconnect", + G_TYPE_INVALID); + g_object_unref (priv->type_proxy); + priv->type_proxy = NULL; + } + } + + if (priv->dev_proxy) { + g_object_unref (priv->dev_proxy); + priv->dev_proxy = NULL; + } + + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + + priv->bt_type = NM_BT_CAPABILITY_NONE; + + g_free (priv->rfcomm_iface); + priv->rfcomm_iface = NULL; + + if (NM_DEVICE_CLASS (nm_device_bt_parent_class)->deactivate_quickly) + NM_DEVICE_CLASS (nm_device_bt_parent_class)->deactivate_quickly (device); +} + +/*****************************************************************************/ + +NMDevice * +nm_device_bt_new (const char *udi, + const char *bdaddr, + const char *name, + guint32 capabilities, + gboolean managed) +{ + NMDevice *device; + + g_return_val_if_fail (udi != NULL, NULL); + g_return_val_if_fail (bdaddr != NULL, NULL); + g_return_val_if_fail (name != NULL, NULL); + g_return_val_if_fail (capabilities != NM_BT_CAPABILITY_NONE, NULL); + + device = (NMDevice *) g_object_new (NM_TYPE_DEVICE_BT, + NM_DEVICE_INTERFACE_UDI, udi, + NM_DEVICE_INTERFACE_IFACE, bdaddr, + NM_DEVICE_INTERFACE_DRIVER, "bluez", + NM_DEVICE_BT_HW_ADDRESS, bdaddr, + NM_DEVICE_BT_NAME, name, + NM_DEVICE_BT_CAPABILITIES, capabilities, + NM_DEVICE_INTERFACE_MANAGED, managed, + NM_DEVICE_INTERFACE_TYPE_DESC, "Bluetooth", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_BT, + NULL); + if (device) + g_signal_connect (device, "state-changed", G_CALLBACK (device_state_changed), device); + + return device; +} + +static void +nm_device_bt_init (NMDeviceBt *self) +{ +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_HW_ADDRESS: + /* Construct only */ + priv->bdaddr = g_ascii_strup (g_value_get_string (value), -1); + break; + case PROP_BT_NAME: + /* Construct only */ + priv->name = g_value_dup_string (value); + break; + case PROP_BT_CAPABILITIES: + /* Construct only */ + priv->capabilities = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_HW_ADDRESS: + g_value_set_string (value, priv->bdaddr); + break; + case PROP_BT_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_BT_CAPABILITIES: + g_value_set_uint (value, priv->capabilities); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object); + + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + + if (priv->type_proxy) + g_object_unref (priv->type_proxy); + + if (priv->dev_proxy) + g_object_unref (priv->dev_proxy); + + if (priv->modem) + g_object_unref (priv->modem); + + g_free (priv->rfcomm_iface); + g_free (priv->bdaddr); + g_free (priv->name); + + G_OBJECT_CLASS (nm_device_bt_parent_class)->finalize (object); +} + +static void +nm_device_bt_class_init (NMDeviceBtClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMDeviceBtPrivate)); + + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->finalize = finalize; + + device_class->get_best_auto_connection = real_get_best_auto_connection; + device_class->get_generic_capabilities = real_get_generic_capabilities; + device_class->connection_secrets_updated = real_connection_secrets_updated; + device_class->deactivate_quickly = real_deactivate_quickly; + device_class->act_stage2_config = real_act_stage2_config; + device_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; + device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; + device_class->check_connection_compatible = real_check_connection_compatible; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_BT_HW_ADDRESS, + "Bluetooth address", + "Bluetooth address", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_BT_NAME, + g_param_spec_string (NM_DEVICE_BT_NAME, + "Bluetooth device name", + "Bluetooth device name", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_BT_CAPABILITIES, + g_param_spec_uint (NM_DEVICE_BT_CAPABILITIES, + "Bluetooth device capabilities", + "Bluetooth device capabilities", + NM_BT_CAPABILITY_NONE, G_MAXUINT, NM_BT_CAPABILITY_NONE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /* Signals */ + signals[PPP_STATS] = + g_signal_new ("ppp-stats", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceBtClass, ppp_stats), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); + + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDeviceBtClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_device_bt_object_info); + + dbus_g_error_domain_register (NM_BT_ERROR, NULL, NM_TYPE_BT_ERROR); +} diff --git a/src/nm-device-bt.h b/src/nm-device-bt.h new file mode 100644 index 00000000..d3187d76 --- /dev/null +++ b/src/nm-device-bt.h @@ -0,0 +1,72 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_BT_H +#define NM_DEVICE_BT_H + +#include +#include "nm-modem.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_BT (nm_device_bt_get_type ()) +#define NM_DEVICE_BT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BT, NMDeviceBt)) +#define NM_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BT, NMDeviceBtClass)) +#define NM_IS_DEVICE_BT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_BT)) +#define NM_IS_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_BT)) +#define NM_DEVICE_BT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BT, NMDeviceBtClass)) + +#define NM_DEVICE_BT_HW_ADDRESS "hw-address" +#define NM_DEVICE_BT_NAME "name" +#define NM_DEVICE_BT_CAPABILITIES "bt-capabilities" + +typedef struct { + NMDevice parent; +} NMDeviceBt; + +typedef struct { + NMDeviceClass parent; + + /* Signals */ + void (*ppp_stats) (NMDeviceBt *device, guint32 in_bytes, guint32 out_bytes); + void (*properties_changed) (NMDeviceBt *device, GHashTable *properties); +} NMDeviceBtClass; + +GType nm_device_bt_get_type (void); + +NMDevice *nm_device_bt_new (const char *udi, + const char *bdaddr, + const char *name, + guint32 capabilities, + gboolean managed); + +guint32 nm_device_bt_get_capabilities (NMDeviceBt *device); + +const char *nm_device_bt_get_hw_address (NMDeviceBt *device); + +gboolean nm_device_bt_modem_added (NMDeviceBt *device, + NMModem *modem, + const char *driver); + +gboolean nm_device_bt_modem_removed (NMDeviceBt *device, NMModem *modem); + +G_END_DECLS + +#endif /* NM_GSM_DEVICE_H */ diff --git a/src/nm-device-cdma.c b/src/nm-device-cdma.c new file mode 100644 index 00000000..45771f42 --- /dev/null +++ b/src/nm-device-cdma.c @@ -0,0 +1,75 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + */ + +#include + +#include "nm-modem-cdma.h" +#include "nm-device-interface.h" +#include "nm-device-cdma.h" +#include "nm-properties-changed-signal.h" +#include "nm-rfkill.h" + +#include "nm-device-cdma-glue.h" + +G_DEFINE_TYPE (NMDeviceCdma, nm_device_cdma, NM_TYPE_DEVICE_MODEM) + +enum { + PROPERTIES_CHANGED, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + +NMDevice * +nm_device_cdma_new (NMModemCdma *modem, const char *driver) +{ + g_return_val_if_fail (modem != NULL, NULL); + g_return_val_if_fail (NM_IS_MODEM_CDMA (modem), NULL); + g_return_val_if_fail (driver != NULL, NULL); + + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_CDMA, + NM_DEVICE_INTERFACE_UDI, nm_modem_get_path (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_IFACE, nm_modem_get_iface (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "CDMA", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_CDMA, + NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WWAN, + NM_DEVICE_MODEM_MODEM, modem, + NULL); +} + +static void +nm_device_cdma_init (NMDeviceCdma *self) +{ +} + +static void +nm_device_cdma_class_init (NMDeviceCdmaClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDeviceCdmaClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_device_cdma_object_info); +} + diff --git a/src/nm-device-cdma.h b/src/nm-device-cdma.h new file mode 100644 index 00000000..f0bf3456 --- /dev/null +++ b/src/nm-device-cdma.h @@ -0,0 +1,55 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_CDMA_H +#define NM_DEVICE_CDMA_H + +#include "nm-device-modem.h" +#include "nm-modem-cdma.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_CDMA (nm_device_cdma_get_type ()) +#define NM_DEVICE_CDMA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_CDMA, NMDeviceCdma)) +#define NM_DEVICE_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaClass)) +#define NM_IS_DEVICE_CDMA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_CDMA)) +#define NM_IS_DEVICE_CDMA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_CDMA)) +#define NM_DEVICE_CDMA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_CDMA, NMDeviceCdmaClass)) + +typedef struct { + NMDeviceModem parent; +} NMDeviceCdma; + +typedef struct { + NMDeviceModemClass parent; + + /* Signals */ + void (*signal_quality) (NMDeviceCdma *self, guint32 quality); + + void (*properties_changed) (NMDeviceCdma *self, GHashTable *properties); +} NMDeviceCdmaClass; + +GType nm_device_cdma_get_type (void); + +NMDevice *nm_device_cdma_new (NMModemCdma *modem, const char *driver); + +G_END_DECLS + +#endif /* NM_DEVICE_CDMA_H */ diff --git a/src/nm-device-ethernet.c b/src/nm-device-ethernet.c new file mode 100644 index 00000000..be6d4e2f --- /dev/null +++ b/src/nm-device-ethernet.c @@ -0,0 +1,1975 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "nm-glib-compat.h" +#include "nm-device-ethernet.h" +#include "nm-device-interface.h" +#include "nm-device-private.h" +#include "nm-activation-request.h" +#include "NetworkManagerUtils.h" +#include "nm-supplicant-manager.h" +#include "nm-supplicant-interface.h" +#include "nm-supplicant-config.h" +#include "nm-netlink-monitor.h" +#include "nm-system.h" +#include "nm-setting-connection.h" +#include "nm-setting-wired.h" +#include "nm-setting-8021x.h" +#include "nm-setting-pppoe.h" +#include "ppp-manager/nm-ppp-manager.h" +#include "nm-logging.h" +#include "nm-properties-changed-signal.h" +#include "nm-dhcp-manager.h" + +#include "nm-device-ethernet-glue.h" + + +G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE) + +#define NM_DEVICE_ETHERNET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetPrivate)) + +#define WIRED_SECRETS_TRIES "wired-secrets-tries" + +typedef enum +{ + NM_ETHERNET_ERROR_CONNECTION_NOT_WIRED = 0, + NM_ETHERNET_ERROR_CONNECTION_INVALID, + NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE, +} NMEthernetError; + +#define NM_ETHERNET_ERROR (nm_ethernet_error_quark ()) +#define NM_TYPE_ETHERNET_ERROR (nm_ethernet_error_get_type ()) + +typedef struct SupplicantStateTask { + NMDeviceEthernet *self; + guint32 new_state; + guint32 old_state; + gboolean mgr_task; + guint source_id; +} SupplicantStateTask; + +typedef struct Supplicant { + NMSupplicantManager *mgr; + NMSupplicantInterface *iface; + + /* signal handler ids */ + guint mgr_state_id; + guint iface_error_id; + guint iface_state_id; + guint iface_con_state_id; + + /* Timeouts and idles */ + guint iface_con_error_cb_id; + guint con_timeout_id; + + GSList *iface_tasks; + GSList *mgr_tasks; +} Supplicant; + +typedef struct { + gboolean disposed; + + struct ether_addr hw_addr; + gboolean carrier; + + NMNetlinkMonitor * monitor; + gulong link_connected_id; + gulong link_disconnected_id; + guint carrier_action_defer_id; + + Supplicant supplicant; + guint supplicant_timeout_id; + + /* PPPoE */ + NMPPPManager *ppp_manager; + NMIP4Config *pending_ip4_config; +} NMDeviceEthernetPrivate; + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_SPEED, + PROP_CARRIER, + + LAST_PROP +}; + + +static gboolean supports_mii_carrier_detect (NMDeviceEthernet *dev); +static gboolean supports_ethtool_carrier_detect (NMDeviceEthernet *dev); + +static GQuark +nm_ethernet_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-ethernet-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +static GType +nm_ethernet_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Connection was not a wired connection. */ + ENUM_ENTRY (NM_ETHERNET_ERROR_CONNECTION_NOT_WIRED, "ConnectionNotWired"), + /* Connection was not a valid wired connection. */ + ENUM_ENTRY (NM_ETHERNET_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + /* Connection does not apply to this device. */ + ENUM_ENTRY (NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMEthernetError", values); + } + return etype; +} + +static void +carrier_action_defer_clear (NMDeviceEthernet *self) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + if (priv->carrier_action_defer_id) { + g_source_remove (priv->carrier_action_defer_id); + priv->carrier_action_defer_id = 0; + } +} + +static gboolean +carrier_action_defer_cb (gpointer user_data) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (user_data); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + NMDeviceState state; + + priv->carrier_action_defer_id = 0; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); + if (state == NM_DEVICE_STATE_UNAVAILABLE) { + if (priv->carrier) + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_CARRIER); + } else if (state >= NM_DEVICE_STATE_DISCONNECTED) { + if (!priv->carrier) + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_UNAVAILABLE, NM_DEVICE_STATE_REASON_CARRIER); + } + + return FALSE; +} + +static void +set_carrier (NMDeviceEthernet *self, + const gboolean carrier, + const gboolean defer_action) +{ + NMDeviceEthernetPrivate *priv; + NMDeviceState state; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + if (priv->carrier == carrier) + return; + + /* Clear any previous deferred action */ + carrier_action_defer_clear (self); + + priv->carrier = carrier; + g_object_notify (G_OBJECT (self), NM_DEVICE_ETHERNET_CARRIER); + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); + nm_log_info (LOGD_HW | LOGD_ETHER, "(%s): carrier now %s (device state %d%s)", + nm_device_get_iface (NM_DEVICE (self)), + carrier ? "ON" : "OFF", + state, + defer_action ? ", deferring action for 4 seconds" : ""); + + if (defer_action) + priv->carrier_action_defer_id = g_timeout_add_seconds (4, carrier_action_defer_cb, self); + else + carrier_action_defer_cb (self); +} + +static void +carrier_on (NMNetlinkMonitor *monitor, + int idx, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (device); + guint32 caps; + + /* Make sure signal is for us */ + if (idx == nm_device_get_ifindex (device)) { + /* Ignore spurious netlink messages */ + caps = nm_device_get_capabilities (device); + if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT)) + return; + + set_carrier (self, TRUE, FALSE); + } +} + +static void +carrier_off (NMNetlinkMonitor *monitor, + int idx, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (device); + guint32 caps; + + /* Make sure signal is for us */ + if (idx == nm_device_get_ifindex (device)) { + NMDeviceState state; + gboolean defer = FALSE; + + /* Ignore spurious netlink messages */ + caps = nm_device_get_capabilities (device); + if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT)) + return; + + /* Defer carrier-off event actions while connected by a few seconds + * so that tripping over a cable, power-cycling a switch, or breaking + * off the RJ45 locking tab isn't so catastrophic. + */ + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); + if (state > NM_DEVICE_STATE_DISCONNECTED) + defer = TRUE; + + set_carrier (self, FALSE, defer); + } +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMDeviceEthernetPrivate *priv; + NMDevice *self; + guint32 caps; + + object = G_OBJECT_CLASS (nm_device_ethernet_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + self = NM_DEVICE (object); + priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + nm_log_dbg (LOGD_HW | LOGD_OLPC_MESH, "(%s): kernel ifindex %d", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_ifindex (NM_DEVICE (self))); + + caps = nm_device_get_capabilities (self); + if (caps & NM_DEVICE_CAP_CARRIER_DETECT) { + GError *error = NULL; + guint32 ifflags = 0; + + /* Only listen to netlink for cards that support carrier detect */ + priv->monitor = nm_netlink_monitor_get (); + + priv->link_connected_id = g_signal_connect (priv->monitor, "carrier-on", + G_CALLBACK (carrier_on), + self); + priv->link_disconnected_id = g_signal_connect (priv->monitor, "carrier-off", + G_CALLBACK (carrier_off), + self); + + /* Get initial link state */ + if (!nm_netlink_monitor_get_flags_sync (priv->monitor, + nm_device_get_ifindex (NM_DEVICE (self)), + &ifflags, + &error)) { + nm_log_warn (LOGD_HW | LOGD_ETHER, + "(%s): couldn't get initial carrier state: (%d) %s", + nm_device_get_iface (NM_DEVICE (self)), + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + g_clear_error (&error); + } else + priv->carrier = !!(ifflags & IFF_LOWER_UP); + + nm_log_info (LOGD_HW | LOGD_ETHER, + "(%s): carrier is %s", + nm_device_get_iface (NM_DEVICE (self)), + priv->carrier ? "ON" : "OFF"); + + /* Request link state again just in case an error occurred getting the + * initial link state. + */ + if (!nm_netlink_monitor_request_status (priv->monitor, &error)) { + nm_log_warn (LOGD_HW | LOGD_ETHER, + "(%s): couldn't request carrier state: (%d) %s", + nm_device_get_iface (NM_DEVICE (self)), + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + g_clear_error (&error); + } + } else { + nm_log_info (LOGD_HW | LOGD_ETHER, + "(%s): driver '%s' does not support carrier detection.", + nm_device_get_iface (self), + nm_device_get_driver (self)); + priv->carrier = TRUE; + } + + return object; +} + +static void +nm_device_ethernet_init (NMDeviceEthernet * self) +{ +} + +static gboolean +real_is_up (NMDevice *device) +{ + if (!NM_DEVICE_ETHERNET_GET_PRIVATE (device)->supplicant.mgr) + return FALSE; + + return TRUE; +} + +static gboolean +real_bring_up (NMDevice *dev) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (dev); + + priv->supplicant.mgr = nm_supplicant_manager_get (); + + return priv->supplicant.mgr ? TRUE : FALSE; +} + +static void +real_take_down (NMDevice *dev) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (dev); + + if (priv->supplicant.mgr) { + g_object_unref (priv->supplicant.mgr); + priv->supplicant.mgr = NULL; + } +} + +static gboolean +real_hw_is_up (NMDevice *device) +{ + return nm_system_device_is_up (device); +} + +static gboolean +real_hw_bring_up (NMDevice *dev, gboolean *no_firmware) +{ + return nm_system_device_set_up_down (dev, TRUE, no_firmware); +} + +static void +real_hw_take_down (NMDevice *dev) +{ + nm_system_device_set_up_down (dev, FALSE, NULL); +} + +NMDevice * +nm_device_ethernet_new (const char *udi, + const char *iface, + const char *driver) +{ + g_return_val_if_fail (udi != NULL, NULL); + g_return_val_if_fail (iface != NULL, NULL); + g_return_val_if_fail (driver != NULL, NULL); + + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_ETHERNET, + NM_DEVICE_INTERFACE_UDI, udi, + NM_DEVICE_INTERFACE_IFACE, iface, + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "Ethernet", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_ETHERNET, + NULL); +} + + +/* + * nm_device_ethernet_get_address + * + * Get a device's hardware address + * + */ +void +nm_device_ethernet_get_address (NMDeviceEthernet *self, struct ether_addr *addr) +{ + g_return_if_fail (self != NULL); + g_return_if_fail (addr != NULL); + + memcpy (addr, &(NM_DEVICE_ETHERNET_GET_PRIVATE (self)->hw_addr), sizeof (struct ether_addr)); +} + +/* Returns speed in Mb/s */ +static guint32 +nm_device_ethernet_get_speed (NMDeviceEthernet *self) +{ + int fd; + struct ifreq ifr; + struct ethtool_cmd edata = { + .cmd = ETHTOOL_GSET, + }; + guint32 speed = 0; + + g_return_val_if_fail (self != NULL, 0); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_warn (LOGD_HW, "couldn't open control socket."); + return 0; + } + + memset (&ifr, 0, sizeof (struct ifreq)); + strncpy (ifr.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); + ifr.ifr_data = (char *) &edata; + + if (ioctl (fd, SIOCETHTOOL, &ifr) < 0) + goto out; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) + speed = edata.speed; +#else + speed = ethtool_cmd_speed (&edata); +#endif + + if (speed == G_MAXUINT16 || speed == G_MAXUINT32) + speed = 0; + +out: + close (fd); + return speed; +} + +static void +real_update_hw_address (NMDevice *dev) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + struct ifreq req; + int fd; + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_warn (LOGD_HW, "couldn't open control socket."); + return; + } + + memset (&req, 0, sizeof (struct ifreq)); + strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); + if (ioctl (fd, SIOCGIFHWADDR, &req) < 0) { + nm_log_err (LOGD_HW | LOGD_ETHER, + "(%s) error getting hardware address: %d", + nm_device_get_iface (dev), errno); + goto out; + } + + if (memcmp (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr))) { + memcpy (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr)); + g_object_notify (G_OBJECT (dev), NM_DEVICE_ETHERNET_HW_ADDRESS); + } + +out: + close (fd); +} + +static guint32 +real_get_generic_capabilities (NMDevice *dev) +{ + NMDeviceEthernet * self = NM_DEVICE_ETHERNET (dev); + guint32 caps = NM_DEVICE_CAP_NONE; + + /* cipsec devices are also explicitly unsupported at this time */ + if (strstr (nm_device_get_iface (dev), "cipsec")) + return NM_DEVICE_CAP_NONE; + + if (supports_ethtool_carrier_detect (self) || supports_mii_carrier_detect (self)) + caps |= NM_DEVICE_CAP_CARRIER_DETECT; + + caps |= NM_DEVICE_CAP_NM_SUPPORTED; + + return caps; +} + +static gboolean +real_can_interrupt_activation (NMDevice *dev) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); + gboolean interrupt = FALSE; + + /* Devices that support carrier detect can interrupt activation + * if the link becomes inactive. + */ + if (nm_device_get_capabilities (dev) & NM_DEVICE_CAP_CARRIER_DETECT) { + if (NM_DEVICE_ETHERNET_GET_PRIVATE (self)->carrier == FALSE) + interrupt = TRUE; + } + return interrupt; +} + +static gboolean +real_is_available (NMDevice *dev) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); + + /* Can't do anything if there isn't a carrier */ + if (!NM_DEVICE_ETHERNET_GET_PRIVATE (self)->carrier) + return FALSE; + + return TRUE; +} + +static NMConnection * +real_get_best_auto_connection (NMDevice *dev, + GSList *connections, + char **specific_object) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + GSList *iter; + + for (iter = connections; iter; iter = g_slist_next (iter)) { + NMConnection *connection = NM_CONNECTION (iter->data); + NMSettingConnection *s_con; + NMSettingWired *s_wired; + const char *connection_type; + gboolean is_pppoe = FALSE; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + + connection_type = nm_setting_connection_get_connection_type (s_con); + if (!strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) + is_pppoe = TRUE; + + if (!is_pppoe && strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME)) + continue; + if (!nm_setting_connection_get_autoconnect (s_con)) + continue; + + s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + /* Wired setting optional for PPPoE */ + if (!is_pppoe && !s_wired) + continue; + + if (s_wired) { + const GByteArray *mac; + + mac = nm_setting_wired_get_mac_address (s_wired); + if (mac && memcmp (mac->data, priv->hw_addr.ether_addr_octet, ETH_ALEN)) + continue; + } + + return connection; + } + return NULL; +} + +static void +real_connection_secrets_updated (NMDevice *dev, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (dev); + NMActRequest *req; + gboolean valid = FALSE; + GSList *iter; + + g_return_if_fail (IS_ACTIVATING_STATE (nm_device_get_state (dev))); + + /* PPPoE? */ + if (caller == SECRETS_CALLER_PPP) { + NMSettingPPPOE *s_pppoe; + + g_assert (priv->ppp_manager); + + s_pppoe = (NMSettingPPPOE *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE); + if (!s_pppoe) { + nm_ppp_manager_update_secrets (priv->ppp_manager, + nm_device_get_iface (dev), + NULL, + NULL, + "missing PPPoE setting; no secrets could be found."); + } else { + const char *pppoe_username = nm_setting_pppoe_get_username (s_pppoe); + const char *pppoe_password = nm_setting_pppoe_get_password (s_pppoe); + + nm_ppp_manager_update_secrets (priv->ppp_manager, + nm_device_get_iface (dev), + pppoe_username ? pppoe_username : "", + pppoe_password ? pppoe_password : "", + NULL); + } + return; + } + + /* Only caller could be ourselves for 802.1x */ + g_return_if_fail (caller == SECRETS_CALLER_ETHERNET); + g_return_if_fail (nm_device_get_state (dev) == NM_DEVICE_STATE_NEED_AUTH); + + for (iter = updated_settings; iter; iter = g_slist_next (iter)) { + const char *setting_name = (const char *) iter->data; + + if (!strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME)) { + valid = TRUE; + } else { + nm_log_warn (LOGD_DEVICE, "Ignoring updated secrets for setting '%s'.", + setting_name); + } + } + + req = nm_device_get_act_request (dev); + g_assert (req); + + g_return_if_fail (nm_act_request_get_connection (req) == connection); + nm_device_activate_schedule_stage1_device_prepare (dev); +} + +/* FIXME: Move it to nm-device.c and then get rid of all foo_device_get_setting() all around. + It's here now to keep the patch short. */ +static NMSetting * +device_get_setting (NMDevice *device, GType setting_type) +{ + NMActRequest *req; + NMSetting *setting = NULL; + + req = nm_device_get_act_request (device); + if (req) { + NMConnection *connection; + + connection = nm_act_request_get_connection (req); + if (connection) + setting = nm_connection_get_setting (connection, setting_type); + } + + return setting; +} + +/*****************************************************************************/ +/* 802.1X */ + +static void +remove_supplicant_timeouts (NMDeviceEthernet *self) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + if (priv->supplicant.con_timeout_id) { + g_source_remove (priv->supplicant.con_timeout_id); + priv->supplicant.con_timeout_id = 0; + } + + if (priv->supplicant_timeout_id) { + g_source_remove (priv->supplicant_timeout_id); + priv->supplicant_timeout_id = 0; + } +} + +static void +finish_supplicant_task (SupplicantStateTask *task, gboolean remove_source) +{ + NMDeviceEthernet *self = task->self; + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + /* idle/timeout handlers should pass FALSE for remove_source, since they + * will tell glib to remove their source from the mainloop by returning + * FALSE when they exit. When called from this NMDevice's dispose handler, + * remove_source should be TRUE to cancel all outstanding idle/timeout + * handlers asynchronously. + */ + if (task->source_id && remove_source) + g_source_remove (task->source_id); + + if (task->mgr_task) + priv->supplicant.mgr_tasks = g_slist_remove (priv->supplicant.mgr_tasks, task); + else + priv->supplicant.iface_tasks = g_slist_remove (priv->supplicant.iface_tasks, task); + + memset (task, 0, sizeof (SupplicantStateTask)); + g_slice_free (SupplicantStateTask, task); +} + +static void +remove_supplicant_interface_error_handler (NMDeviceEthernet *self) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + if (priv->supplicant.iface_error_id != 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_error_id); + priv->supplicant.iface_error_id = 0; + } + + if (priv->supplicant.iface_con_error_cb_id > 0) { + g_source_remove (priv->supplicant.iface_con_error_cb_id); + priv->supplicant.iface_con_error_cb_id = 0; + } +} + +static void +supplicant_interface_release (NMDeviceEthernet *self) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + remove_supplicant_timeouts (self); + remove_supplicant_interface_error_handler (self); + + /* Clean up all pending supplicant interface state idle tasks */ + while (priv->supplicant.iface_tasks) + finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.iface_tasks->data, TRUE); + + if (priv->supplicant.iface_con_state_id) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_con_state_id); + priv->supplicant.iface_con_state_id = 0; + } + + if (priv->supplicant.iface_state_id > 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_state_id); + priv->supplicant.iface_state_id = 0; + } + + if (priv->supplicant.mgr_state_id) { + g_signal_handler_disconnect (priv->supplicant.mgr, priv->supplicant.mgr_state_id); + priv->supplicant.mgr_state_id = 0; + } + + if (priv->supplicant.iface) { + nm_supplicant_interface_disconnect (priv->supplicant.iface); + nm_supplicant_manager_release_iface (priv->supplicant.mgr, priv->supplicant.iface); + priv->supplicant.iface = NULL; + } +} + +static gboolean +link_timeout_cb (gpointer user_data) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (user_data); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + NMDevice *dev = NM_DEVICE (self); + NMActRequest *req; + NMConnection *connection; + const char *setting_name; + + priv->supplicant_timeout_id = 0; + + req = nm_device_get_act_request (dev); + + if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) { + nm_device_state_changed (dev, NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT); + return FALSE; + } + + /* Disconnect event during initial authentication and credentials + * ARE checked - we are likely to have wrong key. Ask the user for + * another one. + */ + if (nm_device_get_state (dev) != NM_DEVICE_STATE_CONFIG) + goto time_out; + + connection = nm_act_request_get_connection (req); + nm_connection_clear_secrets (connection); + setting_name = nm_connection_need_secrets (connection, NULL); + if (!setting_name) + goto time_out; + + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): disconnected during authentication," + " asking for new key.", + nm_device_get_iface (dev)); + supplicant_interface_release (self); + + nm_device_state_changed (dev, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT); + nm_act_request_get_secrets (req, + setting_name, + TRUE, + SECRETS_CALLER_ETHERNET, + NULL, + NULL); + + return FALSE; + +time_out: + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, + "(%s): link timed out.", nm_device_get_iface (dev)); + nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT); + + return FALSE; +} + +static gboolean +schedule_state_handler (NMDeviceEthernet *self, + GSourceFunc handler, + guint32 new_state, + guint32 old_state, + gboolean mgr_task) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + SupplicantStateTask *task; + + if (new_state == old_state) + return TRUE; + + task = g_slice_new0 (SupplicantStateTask); + if (!task) { + nm_log_err (LOGD_DEVICE, "Not enough memory to process supplicant manager state change."); + return FALSE; + } + + task->self = self; + task->new_state = new_state; + task->old_state = old_state; + task->mgr_task = mgr_task; + + task->source_id = g_idle_add (handler, task); + if (mgr_task) + priv->supplicant.mgr_tasks = g_slist_append (priv->supplicant.mgr_tasks, task); + else + priv->supplicant.iface_tasks = g_slist_append (priv->supplicant.iface_tasks, task); + return TRUE; +} + +static gboolean +supplicant_mgr_state_cb_handler (gpointer user_data) +{ + SupplicantStateTask *task = (SupplicantStateTask *) user_data; + NMDevice *device = NM_DEVICE (task->self); + + /* If the supplicant went away, release the supplicant interface */ + if (task->new_state == NM_SUPPLICANT_MANAGER_STATE_DOWN) { + supplicant_interface_release (task->self); + + if (nm_device_get_state (device) > NM_DEVICE_STATE_UNAVAILABLE) { + nm_device_state_changed (device, NM_DEVICE_STATE_UNAVAILABLE, + NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); + } + } + + finish_supplicant_task (task, FALSE); + return FALSE; +} + +static void +supplicant_mgr_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + gpointer user_data) +{ + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "(%s): supplicant manager state: %s -> %s", + nm_device_get_iface (NM_DEVICE (user_data)), + nm_supplicant_manager_state_to_string (old_state), + nm_supplicant_manager_state_to_string (new_state)); + + schedule_state_handler (NM_DEVICE_ETHERNET (user_data), + supplicant_mgr_state_cb_handler, + new_state, + old_state, + TRUE); +} + +static NMSupplicantConfig * +build_supplicant_config (NMDeviceEthernet *self) +{ + const char *con_path; + NMSupplicantConfig *config = NULL; + NMSetting8021x *security; + NMConnection *connection; + + connection = nm_act_request_get_connection (nm_device_get_act_request (NM_DEVICE (self))); + g_return_val_if_fail (connection, NULL); + con_path = nm_connection_get_path (connection); + + config = nm_supplicant_config_new (); + if (!config) + return NULL; + + security = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); + if (!nm_supplicant_config_add_setting_8021x (config, security, con_path, TRUE)) { + nm_log_warn (LOGD_DEVICE, "Couldn't add 802.1X security setting to supplicant config."); + g_object_unref (config); + config = NULL; + } + + return config; +} + +static gboolean +supplicant_iface_state_cb_handler (gpointer user_data) +{ + SupplicantStateTask *task = (SupplicantStateTask *) user_data; + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (task->self); + NMDevice *device = NM_DEVICE (task->self); + + if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) { + NMSupplicantConfig *config; + const char *iface; + gboolean success = FALSE; + + iface = nm_device_get_iface (device); + config = build_supplicant_config (task->self); + if (config) { + success = nm_supplicant_interface_set_config (priv->supplicant.iface, config); + g_object_unref (config); + + if (!success) { + nm_log_err (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): couldn't send security " + "configuration to the supplicant.", + iface); + } + } else { + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): couldn't build security configuration.", + iface); + } + + if (!success) + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED); + } else if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { + NMDeviceState state = nm_device_get_state (device); + + supplicant_interface_release (task->self); + + if (nm_device_is_activating (device) || state == NM_DEVICE_STATE_ACTIVATED) + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); + } + + finish_supplicant_task (task, FALSE); + return FALSE; +} + +static void +supplicant_iface_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + gpointer user_data) +{ + + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "(%s): supplicant interface state: %s -> %s", + nm_device_get_iface (NM_DEVICE (user_data)), + nm_supplicant_interface_state_to_string (old_state), + nm_supplicant_interface_state_to_string (new_state)); + + schedule_state_handler (NM_DEVICE_ETHERNET (user_data), + supplicant_iface_state_cb_handler, + new_state, + old_state, + FALSE); +} + +static gboolean +supplicant_iface_connection_state_cb_handler (gpointer user_data) +{ + SupplicantStateTask *task = (SupplicantStateTask *) user_data; + NMDevice *dev = NM_DEVICE (task->self); + + if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED) { + remove_supplicant_interface_error_handler (task->self); + remove_supplicant_timeouts (task->self); + + /* If this is the initial association during device activation, + * schedule the next activation stage. + */ + if (nm_device_get_state (dev) == NM_DEVICE_STATE_CONFIG) { + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired) Stage 2 of 5 (Device Configure) successful.", + nm_device_get_iface (dev)); + nm_device_activate_schedule_stage3_ip_config_start (dev); + } + } else if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED) { + if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED || nm_device_is_activating (dev)) { + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (task->self); + + /* Start the link timeout so we allow some time for reauthentication */ + if (!priv->supplicant_timeout_id) + priv->supplicant_timeout_id = g_timeout_add_seconds (15, link_timeout_cb, dev); + } + } + + finish_supplicant_task (task, FALSE); + return FALSE; +} + +static void +supplicant_iface_connection_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + gpointer user_data) +{ + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "(%s) supplicant connection state: %s -> %s", + nm_device_get_iface (NM_DEVICE (user_data)), + nm_supplicant_interface_connection_state_to_string (old_state), + nm_supplicant_interface_connection_state_to_string (new_state)); + + schedule_state_handler (NM_DEVICE_ETHERNET (user_data), + supplicant_iface_connection_state_cb_handler, + new_state, + old_state, + FALSE); +} + +static gboolean +supplicant_iface_connection_error_cb_handler (gpointer user_data) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (user_data); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + supplicant_interface_release (self); + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED); + + priv->supplicant.iface_con_error_cb_id = 0; + return FALSE; +} + +static void +supplicant_iface_connection_error_cb (NMSupplicantInterface *iface, + const char *name, + const char *message, + gpointer user_data) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (user_data); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + guint id; + + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): association request to the supplicant failed: %s - %s", + nm_device_get_iface (NM_DEVICE (self)), name, message); + + if (priv->supplicant.iface_con_error_cb_id) + g_source_remove (priv->supplicant.iface_con_error_cb_id); + + id = g_idle_add (supplicant_iface_connection_error_cb_handler, self); + priv->supplicant.iface_con_error_cb_id = id; +} + +static NMActStageReturn +handle_auth_or_fail (NMDeviceEthernet *self, + NMActRequest *req, + gboolean new_secrets) +{ + const char *setting_name; + guint32 tries; + NMConnection *connection; + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), WIRED_SECRETS_TRIES)); + if (tries > 3) + return NM_ACT_STAGE_RETURN_FAILURE; + + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + + nm_connection_clear_secrets (connection); + setting_name = nm_connection_need_secrets (connection, NULL); + if (setting_name) { + gboolean get_new; + + /* If the caller doesn't necessarily want completely new secrets, + * only ask for new secrets after the first failure. + */ + get_new = new_secrets ? TRUE : (tries ? TRUE : FALSE); + nm_act_request_get_secrets (req, + setting_name, + get_new, + SECRETS_CALLER_ETHERNET, + NULL, + NULL); + + g_object_set_data (G_OBJECT (connection), WIRED_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); + } else { + nm_log_info (LOGD_DEVICE, "Cleared secrets, but setting didn't need any secrets."); + } + + return NM_ACT_STAGE_RETURN_POSTPONE; +} + +static gboolean +supplicant_connection_timeout_cb (gpointer user_data) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (user_data); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + NMDevice *device = NM_DEVICE (self); + NMActRequest *req; + const char *iface; + + priv->supplicant.con_timeout_id = 0; + + iface = nm_device_get_iface (device); + + /* Authentication failed, encryption key is probably bad */ + nm_log_warn (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): association took too long.", iface); + + supplicant_interface_release (self); + req = nm_device_get_act_request (device); + g_assert (req); + + if (handle_auth_or_fail (self, req, TRUE) == NM_ACT_STAGE_RETURN_POSTPONE) { + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): asking for new secrets", iface); + } else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); + + return FALSE; +} + +static gboolean +supplicant_interface_init (NMDeviceEthernet *self) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + const char *iface; + + iface = nm_device_get_iface (NM_DEVICE (self)); + + /* Create supplicant interface */ + priv->supplicant.iface = nm_supplicant_manager_get_iface (priv->supplicant.mgr, iface, FALSE); + if (!priv->supplicant.iface) { + nm_log_err (LOGD_DEVICE | LOGD_ETHER, + "Couldn't initialize supplicant interface for %s.", + iface); + supplicant_interface_release (self); + + return FALSE; + } + + /* Listen for it's state signals */ + priv->supplicant.iface_state_id = g_signal_connect (priv->supplicant.iface, + "state", + G_CALLBACK (supplicant_iface_state_cb), + self); + + /* Hook up error signal handler to capture association errors */ + priv->supplicant.iface_error_id = g_signal_connect (priv->supplicant.iface, + "connection-error", + G_CALLBACK (supplicant_iface_connection_error_cb), + self); + + priv->supplicant.iface_con_state_id = g_signal_connect (priv->supplicant.iface, + "connection-state", + G_CALLBACK (supplicant_iface_connection_state_cb), + self); + + /* Listen for supplicant manager state changes */ + priv->supplicant.mgr_state_id = g_signal_connect (priv->supplicant.mgr, + "state", + G_CALLBACK (supplicant_mgr_state_cb), + self); + + /* Set up a timeout on the connection attempt to fail it after 25 seconds */ + priv->supplicant.con_timeout_id = g_timeout_add_seconds (25, supplicant_connection_timeout_cb, self); + + return TRUE; +} + +static NMActStageReturn +nm_8021x_stage2_config (NMDeviceEthernet *self, NMDeviceStateReason *reason) +{ + NMConnection *connection; + NMSetting8021x *security; + NMSettingConnection *s_connection; + const char *setting_name; + const char *iface; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + + connection = nm_act_request_get_connection (nm_device_get_act_request (NM_DEVICE (self))); + security = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); + if (!security) { + nm_log_err (LOGD_DEVICE, "Invalid or missing 802.1X security"); + *reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED; + return ret; + } + + iface = nm_device_get_iface (NM_DEVICE (self)); + s_connection = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + + /* If we need secrets, get them */ + setting_name = nm_connection_need_secrets (connection, NULL); + if (setting_name) { + NMActRequest *req = nm_device_get_act_request (NM_DEVICE (self)); + + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): connection '%s' has security, but secrets are required.", + iface, nm_setting_connection_get_id (s_connection)); + + ret = handle_auth_or_fail (self, req, FALSE); + if (ret != NM_ACT_STAGE_RETURN_POSTPONE) + *reason = NM_DEVICE_STATE_REASON_NO_SECRETS; + } else { + nm_log_info (LOGD_DEVICE | LOGD_ETHER, + "Activation (%s/wired): connection '%s' requires no security. No secrets needed.", + iface, nm_setting_connection_get_id (s_connection)); + + if (supplicant_interface_init (self)) + ret = NM_ACT_STAGE_RETURN_POSTPONE; + else + *reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED; + } + + return ret; +} + +/*****************************************************************************/ +/* PPPoE */ + +static void +ppp_state_changed (NMPPPManager *ppp_manager, NMPPPStatus status, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + switch (status) { + case NM_PPP_STATUS_DISCONNECT: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_PPP_DISCONNECT); + break; + case NM_PPP_STATUS_DEAD: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_PPP_FAILED); + break; + default: + break; + } +} + +static void +ppp_ip4_config (NMPPPManager *ppp_manager, + const char *iface, + NMIP4Config *config, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + /* Ignore PPP IP4 events that come in after initial configuration */ + if (nm_device_get_state (device) != NM_DEVICE_STATE_IP_CONFIG) + return; + + nm_device_set_ip_iface (device, iface); + NM_DEVICE_ETHERNET_GET_PRIVATE (device)->pending_ip4_config = g_object_ref (config); + nm_device_activate_schedule_stage4_ip4_config_get (device); +} + +static NMActStageReturn +pppoe_stage3_ip4_config_start (NMDeviceEthernet *self, NMDeviceStateReason *reason) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + NMConnection *connection; + NMSettingPPPOE *s_pppoe; + NMActRequest *req; + GError *err = NULL; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + + connection = nm_act_request_get_connection (req); + g_assert (req); + + s_pppoe = (NMSettingPPPOE *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE); + g_assert (s_pppoe); + + priv->ppp_manager = nm_ppp_manager_new (nm_device_get_iface (NM_DEVICE (self))); + if (nm_ppp_manager_start (priv->ppp_manager, req, nm_setting_pppoe_get_username (s_pppoe), 30, &err)) { + g_signal_connect (priv->ppp_manager, "state-changed", + G_CALLBACK (ppp_state_changed), + self); + g_signal_connect (priv->ppp_manager, "ip4-config", + G_CALLBACK (ppp_ip4_config), + self); + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else { + nm_log_warn (LOGD_DEVICE, "(%s): PPPoE failed to start: %s", + nm_device_get_iface (NM_DEVICE (self)), err->message); + g_error_free (err); + + g_object_unref (priv->ppp_manager); + priv->ppp_manager = NULL; + + *reason = NM_DEVICE_STATE_REASON_PPP_START_FAILED; + } + + return ret; +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) +{ + NMSettingConnection *s_con; + const char *connection_type; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; + + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + s_con = NM_SETTING_CONNECTION (device_get_setting (device, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + /* 802.1x has to run before any IP configuration since the 802.1x auth + * process opens the port up for normal traffic. + */ + connection_type = nm_setting_connection_get_connection_type (s_con); + if (!strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME)) { + NMSetting8021x *security; + + security = (NMSetting8021x *) device_get_setting (device, NM_TYPE_SETTING_802_1X); + if (security) + ret = nm_8021x_stage2_config (NM_DEVICE_ETHERNET (device), reason); + } + + return ret; +} + +static NMActStageReturn +real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +{ + NMSettingConnection *s_con; + const char *connection_type; + + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + s_con = NM_SETTING_CONNECTION (device_get_setting (device, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + connection_type = nm_setting_connection_get_connection_type (s_con); + if (!strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) + return pppoe_stage3_ip4_config_start (NM_DEVICE_ETHERNET (device), reason); + + return NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->act_stage3_ip4_config_start (device, reason); +} + +static NMActStageReturn +real_act_stage4_get_ip4_config (NMDevice *device, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (device); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + NMActStageReturn ret; + + g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + if (!priv->ppp_manager) { + /* Regular ethernet connection. */ + + /* Chain up to parent */ + ret = NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->act_stage4_get_ip4_config (device, config, reason); + + if (ret == NM_ACT_STAGE_RETURN_SUCCESS) { + NMConnection *connection; + NMSettingWired *s_wired; + guint32 mtu; + + connection = nm_act_request_get_connection (nm_device_get_act_request (device)); + g_assert (connection); + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + g_assert (s_wired); + + /* MTU override */ + mtu = nm_setting_wired_get_mtu (s_wired); + if (mtu) + nm_ip4_config_set_mtu (*config, mtu); + } + } else { + NMConnection *connection; + NMSettingIP4Config *s_ip4; + + /* PPPoE */ + *config = priv->pending_ip4_config; + priv->pending_ip4_config = NULL; + + /* Merge user-defined overrides into the IP4Config to be applied */ + connection = nm_act_request_get_connection (nm_device_get_act_request (device)); + g_assert (connection); + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + nm_utils_merge_ip4_config (*config, s_ip4); + + ret = NM_ACT_STAGE_RETURN_SUCCESS; + } + + return ret; +} + +static void +real_deactivate_quickly (NMDevice *device) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); + + nm_device_set_ip_iface (device, NULL); + + if (priv->pending_ip4_config) { + g_object_unref (priv->pending_ip4_config); + priv->pending_ip4_config = NULL; + } + + if (priv->ppp_manager) { + g_object_unref (priv->ppp_manager); + priv->ppp_manager = NULL; + } + + supplicant_interface_release (NM_DEVICE_ETHERNET (device)); +} + +static gboolean +real_check_connection_compatible (NMDevice *device, + NMConnection *connection, + GError **error) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (device); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + NMSettingConnection *s_con; + NMSettingWired *s_wired; + const char *connection_type; + gboolean is_pppoe = FALSE; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + connection_type = nm_setting_connection_get_connection_type (s_con); + if ( strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME) + && strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) { + g_set_error (error, + NM_ETHERNET_ERROR, NM_ETHERNET_ERROR_CONNECTION_NOT_WIRED, + "The connection was not a wired or PPPoE connection."); + return FALSE; + } + + if (!strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) + is_pppoe = TRUE; + + s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + /* Wired setting is optional for PPPoE */ + if (!is_pppoe && !s_wired) { + g_set_error (error, + NM_ETHERNET_ERROR, NM_ETHERNET_ERROR_CONNECTION_INVALID, + "The connection was not a valid wired connection."); + return FALSE; + } + + if (s_wired) { + const GByteArray *mac; + + mac = nm_setting_wired_get_mac_address (s_wired); + if (mac && memcmp (mac->data, &(priv->hw_addr.ether_addr_octet), ETH_ALEN)) { + g_set_error (error, + NM_ETHERNET_ERROR, NM_ETHERNET_ERROR_CONNECTION_INCOMPATIBLE, + "The connection's MAC address did not match this device."); + return FALSE; + } + } + + // FIXME: check bitrate against device capabilities + + return TRUE; +} + +static gboolean +spec_match_list (NMDevice *device, const GSList *specs) +{ + struct ether_addr ether; + char *hwaddr; + gboolean matched; + + nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (device), ðer); + hwaddr = nm_ether_ntop (ðer); + matched = nm_match_spec_hwaddr (specs, hwaddr); + g_free (hwaddr); + + return matched; +} + +static gboolean +wired_match_config (NMDevice *self, NMConnection *connection) +{ + NMSettingWired *s_wired; + struct ether_addr ether; + const GByteArray *s_ether; + + s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + if (!s_wired) + return FALSE; + + /* MAC address check */ + s_ether = nm_setting_wired_get_mac_address (s_wired); + if (s_ether) { + nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (self), ðer); + + if (memcmp (s_ether->data, ether.ether_addr_octet, ETH_ALEN)) + return FALSE; + } + + return TRUE; +} + +typedef struct { + int ifindex; + NMIP4Address *addr; + gboolean found; +} AddrData; + +static void +check_one_address (struct nl_object *object, void *user_data) +{ + AddrData *data = user_data; + struct rtnl_addr *addr = (struct rtnl_addr *) object; + struct nl_addr *local; + struct in_addr tmp; + + if (rtnl_addr_get_ifindex (addr) != data->ifindex) + return; + if (rtnl_addr_get_family (addr) != AF_INET) + return; + + if (nm_ip4_address_get_prefix (data->addr) != rtnl_addr_get_prefixlen (addr)) + return; + + local = rtnl_addr_get_local (addr); + if (nl_addr_get_family (local) != AF_INET) + return; + if (nl_addr_get_len (local) != sizeof (struct in_addr)) + return; + if (!nl_addr_get_binary_addr (local)) + return; + + memcpy (&tmp, nl_addr_get_binary_addr (local), nl_addr_get_len (local)); + if (tmp.s_addr != nm_ip4_address_get_address (data->addr)) + return; + + /* Yay, found it */ + data->found = TRUE; +} + +static gboolean +ip4_match_config (NMDevice *self, NMConnection *connection) +{ + NMSettingIP4Config *s_ip4; + NMSettingConnection *s_con; + struct nl_handle *nlh = NULL; + struct nl_cache *addr_cache = NULL; + int i, num; + GSList *leases, *iter; + NMDHCPManager *dhcp_mgr; + const char *method; + int ifindex; + AddrData check_data; + + ifindex = nm_device_get_ifindex (self); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + g_assert (nm_setting_connection_get_uuid (s_con)); + + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (!s_ip4) + return FALSE; + + /* Read all the device's IP addresses */ + nlh = nm_netlink_get_default_handle (); + if (!nlh) + return FALSE; + + addr_cache = rtnl_addr_alloc_cache (nlh); + if (!addr_cache) + return FALSE; + nl_cache_mngt_provide (addr_cache); + + /* Get any saved leases that apply to this connection */ + dhcp_mgr = nm_dhcp_manager_get (); + leases = nm_dhcp_manager_get_lease_config (dhcp_mgr, + nm_device_get_iface (self), + nm_setting_connection_get_uuid (s_con)); + g_object_unref (dhcp_mgr); + + method = nm_setting_ip4_config_get_method (s_ip4); + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { + gboolean found = FALSE; + + /* Find at least one lease's address on the device */ + for (iter = leases; iter; iter = g_slist_next (iter)) { + NMIP4Config *addr = iter->data; + + memset (&check_data, 0, sizeof (check_data)); + check_data.ifindex = ifindex; + check_data.found = FALSE; + check_data.addr = nm_ip4_config_get_address (addr, 0); + + nl_cache_foreach (addr_cache, check_one_address, &check_data); + if (check_data.found) { + found = TRUE; /* Yay, device has same address as a lease */ + break; + } + } + g_slist_foreach (leases, (GFunc) g_object_unref, NULL); + g_slist_free (leases); + return found; + } else { + /* Maybe the connection used to be DHCP and there are stale leases; ignore them */ + g_slist_foreach (leases, (GFunc) g_object_unref, NULL); + g_slist_free (leases); + } + + /* 'shared' and 'link-local' aren't supported methods because 'shared' + * requires too much iptables and dnsmasq state to be reclaimed, and + * avahi-autoipd isn't smart enough to allow the link-local address to be + * determined at any point other than when it was first assigned. + */ + if (strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) + return FALSE; + + /* Everything below for static addressing */ + + /* Find all IP4 addresses of this connection in the device's address list */ + num = nm_setting_ip4_config_get_num_addresses (s_ip4); + for (i = 0; i < num; i++) { + memset (&check_data, 0, sizeof (check_data)); + check_data.ifindex = ifindex; + check_data.found = FALSE; + check_data.addr = nm_setting_ip4_config_get_address (s_ip4, i); + + nl_cache_foreach (addr_cache, check_one_address, &check_data); + if (!check_data.found) + return FALSE; + } + + /* Success; all the connection's static IP addresses are assigned to the device */ + return TRUE; +} + +static NMConnection * +connection_match_config (NMDevice *self, const GSList *connections) +{ + GSList *iter; + NMSettingConnection *s_con; + + for (iter = (GSList *) connections; iter; iter = g_slist_next (iter)) { + NMConnection *candidate = NM_CONNECTION (iter->data); + + s_con = (NMSettingConnection *) nm_connection_get_setting (candidate, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_WIRED_SETTING_NAME)) + continue; + + /* Can't assume 802.1x or PPPoE connections; they have too much state + * that's impossible to get on-the-fly from PPPoE or the supplicant. + */ + if ( nm_connection_get_setting (candidate, NM_TYPE_SETTING_802_1X) + || nm_connection_get_setting (candidate, NM_TYPE_SETTING_PPPOE)) + continue; + + if (!wired_match_config (self, candidate)) + continue; + + if (!ip4_match_config (self, candidate)) + continue; + + return candidate; + } + + return NULL; +} + +static void +dispose (GObject *object) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (object); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + /* Clean up all pending supplicant tasks */ + while (priv->supplicant.iface_tasks) + finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.iface_tasks->data, TRUE); + while (priv->supplicant.mgr_tasks) + finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.mgr_tasks->data, TRUE); + + if (priv->link_connected_id) { + g_signal_handler_disconnect (priv->monitor, priv->link_connected_id); + priv->link_connected_id = 0; + } + if (priv->link_disconnected_id) { + g_signal_handler_disconnect (priv->monitor, priv->link_disconnected_id); + priv->link_disconnected_id = 0; + } + + carrier_action_defer_clear (self); + + if (priv->monitor) { + g_object_unref (priv->monitor); + priv->monitor = NULL; + } + + G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDeviceEthernet *self = NM_DEVICE_ETHERNET (object); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + struct ether_addr hw_addr; + + switch (prop_id) { + case PROP_HW_ADDRESS: + nm_device_ethernet_get_address (self, &hw_addr); + g_value_take_string (value, nm_ether_ntop (&hw_addr)); + break; + case PROP_SPEED: + g_value_set_uint (value, nm_device_ethernet_get_speed (self)); + break; + case PROP_CARRIER: + g_value_set_boolean (value, priv->carrier); + 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) +{ + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMDeviceEthernetPrivate)); + + /* virtual methods */ + object_class->constructor = constructor; + object_class->dispose = dispose; + object_class->get_property = get_property; + object_class->set_property = set_property; + + parent_class->get_generic_capabilities = real_get_generic_capabilities; + parent_class->hw_is_up = real_hw_is_up; + parent_class->hw_bring_up = real_hw_bring_up; + parent_class->hw_take_down = real_hw_take_down; + parent_class->is_up = real_is_up; + parent_class->bring_up = real_bring_up; + parent_class->take_down = real_take_down; + parent_class->can_interrupt_activation = real_can_interrupt_activation; + parent_class->update_hw_address = real_update_hw_address; + parent_class->get_best_auto_connection = real_get_best_auto_connection; + parent_class->is_available = real_is_available; + parent_class->connection_secrets_updated = real_connection_secrets_updated; + parent_class->check_connection_compatible = real_check_connection_compatible; + + parent_class->act_stage2_config = real_act_stage2_config; + parent_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; + parent_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; + parent_class->deactivate_quickly = real_deactivate_quickly; + parent_class->spec_match_list = spec_match_list; + parent_class->connection_match_config = connection_match_config; + + /* properties */ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS, + "MAC Address", + "Hardware MAC address", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_SPEED, + g_param_spec_uint (NM_DEVICE_ETHERNET_SPEED, + "Speed", + "Speed", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_CARRIER, + g_param_spec_boolean (NM_DEVICE_ETHERNET_CARRIER, + "Carrier", + "Carrier", + FALSE, + G_PARAM_READABLE)); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDeviceEthernetClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_device_ethernet_object_info); + + dbus_g_error_domain_register (NM_ETHERNET_ERROR, NULL, NM_TYPE_ETHERNET_ERROR); +} + + +/**************************************/ +/* Ethtool capability detection */ +/**************************************/ + +static gboolean +supports_ethtool_carrier_detect (NMDeviceEthernet *self) +{ + int fd; + struct ifreq ifr; + gboolean supports_ethtool = FALSE; + struct ethtool_cmd edata; + + g_return_val_if_fail (self != NULL, FALSE); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_HW, "couldn't open control socket."); + return FALSE; + } + + memset (&ifr, 0, sizeof (struct ifreq)); + strncpy (ifr.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); + + edata.cmd = ETHTOOL_GLINK; + ifr.ifr_data = (char *) &edata; + + errno = 0; + if (ioctl (fd, SIOCETHTOOL, &ifr) < 0) { + nm_log_dbg (LOGD_HW | LOGD_ETHER, "SIOCETHTOOL failed: %d", errno); + goto out; + } + + supports_ethtool = TRUE; + +out: + close (fd); + nm_log_dbg (LOGD_HW | LOGD_ETHER, "ethtool %s supported", + supports_ethtool ? "is" : "not"); + return supports_ethtool; +} + + +/**************************************/ +/* MII capability detection */ +/**************************************/ +#define _LINUX_IF_H +#include +#undef _LINUX_IF_H + +static int +mdio_read (NMDeviceEthernet *self, int fd, struct ifreq *ifr, int location) +{ + struct mii_ioctl_data *mii; + int val = -1; + + g_return_val_if_fail (fd >= 0, -1); + g_return_val_if_fail (ifr != NULL, -1); + + mii = (struct mii_ioctl_data *) &ifr->ifr_ifru; + mii->reg_num = location; + + errno = 0; + if (ioctl (fd, SIOCGMIIREG, ifr) == 0) { + nm_log_dbg (LOGD_HW | LOGD_ETHER, "SIOCGMIIREG result 0x%X", mii->val_out); + val = mii->val_out; + } else { + nm_log_dbg (LOGD_HW | LOGD_ETHER, "SIOCGMIIREG failed: %d", errno); + } + + return val; +} + +static gboolean +supports_mii_carrier_detect (NMDeviceEthernet *self) +{ + int fd, bmsr; + struct ifreq ifr; + gboolean supports_mii = FALSE; + + g_return_val_if_fail (self != NULL, FALSE); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_HW, "couldn't open control socket."); + return 0; + } + + memset (&ifr, 0, sizeof (struct ifreq)); + strncpy (ifr.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); + + errno = 0; + if (ioctl (fd, SIOCGMIIPHY, &ifr) < 0) { + nm_log_dbg (LOGD_HW | LOGD_ETHER, "SIOCGMIIPHY failed: %d", errno); + goto out; + } + + /* If we can read the BMSR register, we assume that the card supports MII link detection */ + bmsr = mdio_read (self, fd, &ifr, MII_BMSR); + supports_mii = (bmsr != -1) ? TRUE : FALSE; + nm_log_dbg (LOGD_HW | LOGD_ETHER, "MII %s supported", + supports_mii ? "is" : "not"); + +out: + close (fd); + return supports_mii; +} diff --git a/src/nm-device-ethernet.h b/src/nm-device-ethernet.h new file mode 100644 index 00000000..7bb3db00 --- /dev/null +++ b/src/nm-device-ethernet.h @@ -0,0 +1,67 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef NM_DEVICE_ETHERNET_H +#define NM_DEVICE_ETHERNET_H + +#include +#include + +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_ETHERNET (nm_device_ethernet_get_type ()) +#define NM_DEVICE_ETHERNET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernet)) +#define NM_DEVICE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass)) +#define NM_IS_DEVICE_ETHERNET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_ETHERNET)) +#define NM_IS_DEVICE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_ETHERNET)) +#define NM_DEVICE_ETHERNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass)) + +#define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address" +#define NM_DEVICE_ETHERNET_SPEED "speed" +#define NM_DEVICE_ETHERNET_CARRIER "carrier" + +typedef struct { + NMDevice parent; +} NMDeviceEthernet; + +typedef struct { + NMDeviceClass parent; + + /* Signals */ + void (*properties_changed) (NMDeviceEthernet *device, GHashTable *properties); +} NMDeviceEthernetClass; + + +GType nm_device_ethernet_get_type (void); + + +NMDevice *nm_device_ethernet_new (const char *udi, + const char *iface, + const char *driver); + +void nm_device_ethernet_get_address (NMDeviceEthernet *dev, + struct ether_addr *addr); + +G_END_DECLS + +#endif /* NM_DEVICE_ETHERNET_H */ diff --git a/src/nm-device-gsm.c b/src/nm-device-gsm.c new file mode 100644 index 00000000..2a98a41f --- /dev/null +++ b/src/nm-device-gsm.c @@ -0,0 +1,75 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + */ + +#include + +#include "nm-modem-gsm.h" +#include "nm-device-interface.h" +#include "nm-device-gsm.h" +#include "nm-properties-changed-signal.h" +#include "nm-rfkill.h" + +#include "nm-device-gsm-glue.h" + +G_DEFINE_TYPE (NMDeviceGsm, nm_device_gsm, NM_TYPE_DEVICE_MODEM) + +enum { + PROPERTIES_CHANGED, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + +NMDevice * +nm_device_gsm_new (NMModemGsm *modem, const char *driver) +{ + g_return_val_if_fail (modem != NULL, NULL); + g_return_val_if_fail (NM_IS_MODEM_GSM (modem), NULL); + g_return_val_if_fail (driver != NULL, NULL); + + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_GSM, + NM_DEVICE_INTERFACE_UDI, nm_modem_get_path (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_IFACE, nm_modem_get_iface (NM_MODEM (modem)), + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "GSM", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_GSM, + NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WWAN, + NM_DEVICE_MODEM_MODEM, modem, + NULL); +} + +static void +nm_device_gsm_init (NMDeviceGsm *self) +{ +} + +static void +nm_device_gsm_class_init (NMDeviceGsmClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDeviceGsmClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_device_gsm_object_info); +} + diff --git a/src/nm-device-gsm.h b/src/nm-device-gsm.h new file mode 100644 index 00000000..9b403c63 --- /dev/null +++ b/src/nm-device-gsm.h @@ -0,0 +1,55 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_GSM_H +#define NM_DEVICE_GSM_H + +#include "nm-device-modem.h" +#include "nm-modem-gsm.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_GSM (nm_device_gsm_get_type ()) +#define NM_DEVICE_GSM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_GSM, NMDeviceGsm)) +#define NM_DEVICE_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_GSM, NMDeviceGsmClass)) +#define NM_IS_DEVICE_GSM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_GSM)) +#define NM_IS_DEVICE_GSM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_GSM)) +#define NM_DEVICE_GSM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_GSM, NMDeviceGsmClass)) + +typedef struct { + NMDeviceModem parent; +} NMDeviceGsm; + +typedef struct { + NMDeviceModemClass parent; + + /* Signals */ + void (*signal_quality) (NMDeviceGsm *self, guint32 quality); + + void (*properties_changed) (NMDeviceGsm *self, GHashTable *properties); +} NMDeviceGsmClass; + +GType nm_device_gsm_get_type (void); + +NMDevice *nm_device_gsm_new (NMModemGsm *modem, const char *driver); + +G_END_DECLS + +#endif /* NM_DEVICE_GSM_H */ diff --git a/src/nm-device-interface.c b/src/nm-device-interface.c new file mode 100644 index 00000000..85f58d55 --- /dev/null +++ b/src/nm-device-interface.c @@ -0,0 +1,402 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#include "nm-marshal.h" +#include "nm-setting-connection.h" +#include "nm-device-interface.h" +#include "nm-logging.h" +#include "nm-properties-changed-signal.h" +#include "nm-rfkill.h" + +static gboolean impl_device_disconnect (NMDeviceInterface *device, + GError **error); + +#include "nm-device-interface-glue.h" + +GQuark +nm_device_interface_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-device-interface-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_device_interface_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Connection is already activating. */ + ENUM_ENTRY (NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING, "ConnectionActivating"), + /* Connection is invalid for this device. */ + ENUM_ENTRY (NM_DEVICE_INTERFACE_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + /* Operation could not be performed because the device is not active. */ + ENUM_ENTRY (NM_DEVICE_INTERFACE_ERROR_NOT_ACTIVE, "NotActive"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMDeviceInterfaceError", values); + } + return etype; +} + + +static void +nm_device_interface_init (gpointer g_iface) +{ + GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); + static gboolean initialized = FALSE; + + if (initialized) + return; + + /* Properties */ + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_DEVICE_INTERFACE_UDI, + "UDI", + "Unique Device Identifier", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_DEVICE_INTERFACE_IFACE, + "Interface", + "Interface", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_DEVICE_INTERFACE_DRIVER, + "Driver", + "Driver", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_interface_install_property + (g_iface, + g_param_spec_uint (NM_DEVICE_INTERFACE_CAPABILITIES, + "Capabilities", + "Capabilities", + 0, G_MAXUINT32, NM_DEVICE_CAP_NONE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_interface_install_property + (g_iface, + g_param_spec_uint (NM_DEVICE_INTERFACE_IP4_ADDRESS, + "IP4 address", + "IP4 address", + 0, G_MAXUINT32, 0, /* FIXME */ + G_PARAM_READWRITE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_boxed (NM_DEVICE_INTERFACE_IP4_CONFIG, + "IP4 Config", + "IP4 Config", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READWRITE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_boxed (NM_DEVICE_INTERFACE_DHCP4_CONFIG, + "DHCP4 Config", + "DHCP4 Config", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READWRITE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_boxed (NM_DEVICE_INTERFACE_IP6_CONFIG, + "IP6 Config", + "IP6 Config", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READWRITE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_boxed (NM_DEVICE_INTERFACE_DHCP6_CONFIG, + "DHCP6 Config", + "DHCP6 Config", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READWRITE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_uint (NM_DEVICE_INTERFACE_STATE, + "State", + "State", + 0, G_MAXUINT32, NM_DEVICE_STATE_UNKNOWN, + G_PARAM_READABLE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_uint (NM_DEVICE_INTERFACE_DEVICE_TYPE, + "DeviceType", + "DeviceType", + 0, G_MAXUINT32, NM_DEVICE_TYPE_UNKNOWN, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + + g_object_interface_install_property + (g_iface, g_param_spec_boolean (NM_DEVICE_INTERFACE_MANAGED, + "Managed", + "Managed", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_DEVICE_INTERFACE_TYPE_DESC, + "Type Description", + "Device type description", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + + g_object_interface_install_property + (g_iface, g_param_spec_uint (NM_DEVICE_INTERFACE_RFKILL_TYPE, + "Rfkill Type", + "Type of rfkill switch (if any) supported by this device", + RFKILL_TYPE_WLAN, + RFKILL_TYPE_MAX, + RFKILL_TYPE_UNKNOWN, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + + g_object_interface_install_property + (g_iface, + g_param_spec_int (NM_DEVICE_INTERFACE_IFINDEX, + "Ifindex", + "Ifindex", + 0, G_MAXINT, 0, + G_PARAM_READABLE | NM_PROPERTY_PARAM_NO_EXPORT)); + + /* Signals */ + g_signal_new ("state-changed", + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceInterface, state_changed), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT_UINT, + G_TYPE_NONE, 3, + G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT); + + dbus_g_object_type_install_info (iface_type, + &dbus_glib_nm_device_interface_object_info); + + dbus_g_error_domain_register (NM_DEVICE_INTERFACE_ERROR, + NULL, + NM_TYPE_DEVICE_INTERFACE_ERROR); + + initialized = TRUE; +} + + +GType +nm_device_interface_get_type (void) +{ + static GType device_interface_type = 0; + + if (!device_interface_type) { + const GTypeInfo device_interface_info = { + sizeof (NMDeviceInterface), /* class_size */ + nm_device_interface_init, /* base_init */ + NULL, /* base_finalize */ + NULL, + NULL, /* class_finalize */ + NULL, /* class_data */ + 0, + 0, /* n_preallocs */ + NULL + }; + + device_interface_type = g_type_register_static (G_TYPE_INTERFACE, + "NMDeviceInterface", + &device_interface_info, 0); + + g_type_interface_add_prerequisite (device_interface_type, G_TYPE_OBJECT); + } + + return device_interface_type; +} + +/* FIXME: This should be public and nm_device_get_iface() should be removed. */ +static char * +nm_device_interface_get_iface (NMDeviceInterface *device) +{ + char *iface = NULL; + + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), NULL); + + g_object_get (device, NM_DEVICE_INTERFACE_IFACE, &iface, NULL); + + return iface; +} + +gboolean +nm_device_interface_check_connection_compatible (NMDeviceInterface *device, + NMConnection *connection, + GError **error) +{ + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->check_connection_compatible) + return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->check_connection_compatible (device, connection, error); + return TRUE; +} + +gboolean +nm_device_interface_activate (NMDeviceInterface *device, + NMActRequest *req, + GError **error) +{ + gboolean success; + NMConnection *connection; + NMSettingConnection *s_con; + char *iface; + + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); + g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE); + + connection = nm_act_request_get_connection (req); + g_assert (connection); + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + iface = nm_device_interface_get_iface (device); + nm_log_info (LOGD_DEVICE, "Activation (%s) starting connection '%s'", iface, + nm_setting_connection_get_id (s_con)); + g_free (iface); + + success = NM_DEVICE_INTERFACE_GET_INTERFACE (device)->activate (device, req, error); + if (!success) + g_assert (*error); + + return success; +} + +gboolean +nm_device_interface_disconnect (NMDeviceInterface *device, + GError **error) +{ + gboolean success = FALSE; + + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); + + switch (nm_device_interface_get_state (device)) { + case NM_DEVICE_STATE_UNKNOWN: + case NM_DEVICE_STATE_UNMANAGED: + case NM_DEVICE_STATE_UNAVAILABLE: + case NM_DEVICE_STATE_DISCONNECTED: + g_set_error_literal (error, + NM_DEVICE_INTERFACE_ERROR, + NM_DEVICE_INTERFACE_ERROR_NOT_ACTIVE, + "Cannot disconnect an inactive device."); + break; + default: + success = NM_DEVICE_INTERFACE_GET_INTERFACE (device)->disconnect (device, error); + break; + } + + return success; +} + +static gboolean +impl_device_disconnect (NMDeviceInterface *device, + GError **error) +{ + return nm_device_interface_disconnect (device, error); +} + +void +nm_device_interface_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason) +{ + g_return_if_fail (NM_IS_DEVICE_INTERFACE (device)); + + NM_DEVICE_INTERFACE_GET_INTERFACE (device)->deactivate (device, reason); +} + +NMDeviceState +nm_device_interface_get_state (NMDeviceInterface *device) +{ + NMDeviceState state; + + g_object_get (G_OBJECT (device), "state", &state, NULL); + return state; +} + +gboolean +nm_device_interface_spec_match_list (NMDeviceInterface *device, + const GSList *specs) +{ + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); + + if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->spec_match_list) + return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->spec_match_list (device, specs); + return FALSE; +} + +NMConnection * +nm_device_interface_connection_match_config (NMDeviceInterface *device, + const GSList *connections) +{ + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), NULL); + + if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config) + return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config (device, connections); + return NULL; +} + +gboolean +nm_device_interface_can_assume_connection (NMDeviceInterface *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); + + return !!NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config; +} + +void +nm_device_interface_set_enabled (NMDeviceInterface *device, gboolean enabled) +{ + g_return_if_fail (NM_IS_DEVICE_INTERFACE (device)); + + if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->set_enabled) + NM_DEVICE_INTERFACE_GET_INTERFACE (device)->set_enabled (device, enabled); +} + +gboolean +nm_device_interface_get_enabled (NMDeviceInterface *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE); + + if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->get_enabled) + return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->get_enabled (device); + return TRUE; +} + diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h new file mode 100644 index 00000000..ec27f6e8 --- /dev/null +++ b/src/nm-device-interface.h @@ -0,0 +1,148 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_INTERFACE_H +#define NM_DEVICE_INTERFACE_H + +#include +#include "NetworkManager.h" +#include "nm-connection.h" +#include "nm-activation-request.h" + +#define NM_TYPE_DEVICE_INTERFACE (nm_device_interface_get_type ()) +#define NM_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface)) +#define NM_IS_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INTERFACE)) +#define NM_DEVICE_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface)) + +#define IS_ACTIVATING_STATE(state) \ + (state > NM_DEVICE_STATE_DISCONNECTED && state < NM_DEVICE_STATE_ACTIVATED) + +typedef enum +{ + NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING = 0, + NM_DEVICE_INTERFACE_ERROR_CONNECTION_INVALID, + NM_DEVICE_INTERFACE_ERROR_NOT_ACTIVE, +} NMDeviceInterfaceError; + +#define NM_DEVICE_INTERFACE_ERROR (nm_device_interface_error_quark ()) +#define NM_TYPE_DEVICE_INTERFACE_ERROR (nm_device_interface_error_get_type ()) + +#define NM_DEVICE_INTERFACE_UDI "udi" +#define NM_DEVICE_INTERFACE_IFACE "interface" +#define NM_DEVICE_INTERFACE_DRIVER "driver" +#define NM_DEVICE_INTERFACE_CAPABILITIES "capabilities" +#define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4-address" +#define NM_DEVICE_INTERFACE_IP4_CONFIG "ip4-config" +#define NM_DEVICE_INTERFACE_DHCP4_CONFIG "dhcp4-config" +#define NM_DEVICE_INTERFACE_IP6_CONFIG "ip6-config" +#define NM_DEVICE_INTERFACE_DHCP6_CONFIG "dhcp6-config" +#define NM_DEVICE_INTERFACE_STATE "state" +#define NM_DEVICE_INTERFACE_DEVICE_TYPE "device-type" /* ugh */ +#define NM_DEVICE_INTERFACE_MANAGED "managed" +#define NM_DEVICE_INTERFACE_TYPE_DESC "type-desc" /* Internal only */ +#define NM_DEVICE_INTERFACE_RFKILL_TYPE "rfkill-type" /* Internal only */ +#define NM_DEVICE_INTERFACE_IFINDEX "ifindex" /* Internal only */ + +typedef enum { + NM_DEVICE_INTERFACE_PROP_FIRST = 0x1000, + + NM_DEVICE_INTERFACE_PROP_UDI = NM_DEVICE_INTERFACE_PROP_FIRST, + NM_DEVICE_INTERFACE_PROP_IFACE, + NM_DEVICE_INTERFACE_PROP_DRIVER, + NM_DEVICE_INTERFACE_PROP_CAPABILITIES, + NM_DEVICE_INTERFACE_PROP_IP4_ADDRESS, + NM_DEVICE_INTERFACE_PROP_IP4_CONFIG, + NM_DEVICE_INTERFACE_PROP_DHCP4_CONFIG, + NM_DEVICE_INTERFACE_PROP_IP6_CONFIG, + NM_DEVICE_INTERFACE_PROP_DHCP6_CONFIG, + NM_DEVICE_INTERFACE_PROP_STATE, + NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE, + NM_DEVICE_INTERFACE_PROP_MANAGED, + NM_DEVICE_INTERFACE_PROP_TYPE_DESC, + NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE, + NM_DEVICE_INTERFACE_PROP_IFINDEX, +} NMDeviceInterfaceProp; + + +typedef struct _NMDeviceInterface NMDeviceInterface; + +struct _NMDeviceInterface { + GTypeInterface g_iface; + + /* Methods */ + gboolean (*check_connection_compatible) (NMDeviceInterface *device, + NMConnection *connection, + GError **error); + + gboolean (*activate) (NMDeviceInterface *device, + NMActRequest *req, + GError **error); + + void (*deactivate) (NMDeviceInterface *device, NMDeviceStateReason reason); + gboolean (*disconnect) (NMDeviceInterface *device, GError **error); + + gboolean (*spec_match_list) (NMDeviceInterface *device, const GSList *specs); + + NMConnection * (*connection_match_config) (NMDeviceInterface *device, const GSList *specs); + + void (*set_enabled) (NMDeviceInterface *device, gboolean enabled); + + gboolean (*get_enabled) (NMDeviceInterface *device); + + /* Signals */ + void (*state_changed) (NMDeviceInterface *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason); +}; + +GQuark nm_device_interface_error_quark (void); +GType nm_device_interface_error_get_type (void); + +gboolean nm_device_interface_disconnect (NMDeviceInterface *device, GError **error); + +GType nm_device_interface_get_type (void); + +gboolean nm_device_interface_check_connection_compatible (NMDeviceInterface *device, + NMConnection *connection, + GError **error); + +gboolean nm_device_interface_activate (NMDeviceInterface *device, + NMActRequest *req, + GError **error); + +void nm_device_interface_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason); + +NMDeviceState nm_device_interface_get_state (NMDeviceInterface *device); + +gboolean nm_device_interface_spec_match_list (NMDeviceInterface *device, + const GSList *specs); + +NMConnection * nm_device_interface_connection_match_config (NMDeviceInterface *device, + const GSList *connections); + +gboolean nm_device_interface_can_assume_connection (NMDeviceInterface *device); + +gboolean nm_device_interface_get_enabled (NMDeviceInterface *device); + +void nm_device_interface_set_enabled (NMDeviceInterface *device, gboolean enabled); + +#endif /* NM_DEVICE_INTERFACE_H */ diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c new file mode 100644 index 00000000..441f92ce --- /dev/null +++ b/src/nm-device-modem.c @@ -0,0 +1,471 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + */ + +#include + +#include "nm-device-modem.h" +#include "nm-device-interface.h" +#include "nm-modem.h" +#include "nm-device-private.h" +#include "nm-properties-changed-signal.h" +#include "nm-marshal.h" +#include "nm-logging.h" + +static void device_interface_init (NMDeviceInterface *iface_class); + +G_DEFINE_TYPE_EXTENDED (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE, G_TYPE_FLAG_ABSTRACT, + G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) + +#define NM_DEVICE_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_MODEM, NMDeviceModemPrivate)) + +typedef struct { + NMModem *modem; +} NMDeviceModemPrivate; + +enum { + PROP_0, + PROP_MODEM +}; + +enum { + PPP_STATS, + ENABLE_CHANGED, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + +static void real_set_enabled (NMDeviceInterface *device, gboolean enabled); + +/*****************************************************************************/ + +static void +ppp_stats (NMModem *modem, + guint32 in_bytes, + guint32 out_bytes, + gpointer user_data) +{ + g_signal_emit (G_OBJECT (user_data), signals[PPP_STATS], 0, in_bytes, out_bytes); +} + +static void +ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + switch (nm_device_interface_get_state (NM_DEVICE_INTERFACE (device))) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_ACTIVATED: + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + break; + case NM_DEVICE_STATE_IP_CONFIG: + if (nm_device_ip_config_should_fail (device, FALSE)) { + nm_device_state_changed (device, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } + break; + default: + break; + } +} + +static void +modem_prepare_result (NMModem *modem, + gboolean success, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_PREPARE); + + if (success) + nm_device_activate_schedule_stage2_device_config (device); + else + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); +} + +static void +modem_need_auth (NMModem *modem, + const char *setting_name, + gboolean retry, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2, + gpointer user_data) +{ + NMDeviceModem *self = NM_DEVICE_MODEM (user_data); + NMActRequest *req; + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + nm_act_request_get_secrets (req, setting_name, retry, caller, hint1, hint2); +} + +static void +modem_ip4_config_result (NMModem *self, + const char *iface, + NMIP4Config *config, + GError *error, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDeviceState state; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + g_return_if_fail (state == NM_DEVICE_STATE_IP_CONFIG); + + if (error) { + nm_log_warn (LOGD_MB | LOGD_IP4, "retrieving IP4 configuration failed: (%d) %s", + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + } else { + if (iface) + nm_device_set_ip_iface (device, iface); + + nm_device_activate_schedule_stage4_ip4_config_get (device); + } +} + +static void +modem_enabled_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data) +{ + NMDeviceModem *self = NM_DEVICE_MODEM (user_data); + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self); + + real_set_enabled (NM_DEVICE_INTERFACE (self), nm_modem_get_mm_enabled (priv->modem)); + + g_signal_emit (G_OBJECT (self), signals[ENABLE_CHANGED], 0); +} + +/*****************************************************************************/ + +NMModem * +nm_device_modem_get_modem (NMDeviceModem *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NULL); + + return NM_DEVICE_MODEM_GET_PRIVATE (self)->modem; +} + +/*****************************************************************************/ + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + nm_modem_device_state_changed (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, + new_state, + old_state, + reason); +} + +static guint32 +real_get_generic_capabilities (NMDevice *device) +{ + return NM_DEVICE_CAP_NM_SUPPORTED; +} + +static NMConnection * +real_get_best_auto_connection (NMDevice *device, + GSList *connections, + char **specific_object) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device); + + return nm_modem_get_best_auto_connection (priv->modem, connections, specific_object); +} + +static void +real_connection_secrets_updated (NMDevice *device, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device); + NMActRequest *req; + + g_return_if_fail (IS_ACTIVATING_STATE (nm_device_get_state (device))); + + req = nm_device_get_act_request (device); + g_assert (req); + + if (!nm_modem_connection_secrets_updated (priv->modem, + req, + connection, + updated_settings, + caller)) { + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); + return; + } + + /* PPP handles stuff itself... */ + if (caller == SECRETS_CALLER_PPP) + return; + + /* Otherwise, on success for modem secrets we need to schedule stage1 again */ + g_return_if_fail (nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH); + nm_device_activate_schedule_stage1_device_prepare (device); +} + +static gboolean +real_check_connection_compatible (NMDevice *device, + NMConnection *connection, + GError **error) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device); + + return nm_modem_check_connection_compatible (priv->modem, connection, error); +} + +static gboolean +real_hw_is_up (NMDevice *device) +{ + return nm_modem_hw_is_up (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device); +} + +static gboolean +real_hw_bring_up (NMDevice *device, gboolean *no_firmware) +{ + return nm_modem_hw_bring_up (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device, no_firmware); +} + +static void +real_deactivate_quickly (NMDevice *device) +{ + nm_modem_deactivate_quickly (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device); +} + +static NMActStageReturn +real_act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + return nm_modem_act_stage1_prepare (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, req, reason); +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *device, NMDeviceStateReason *reason) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + g_assert (req); + + return nm_modem_act_stage2_config (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, req, reason); +} + +static NMActStageReturn +real_act_stage3_ip4_config_start (NMDevice *device, NMDeviceStateReason *reason) +{ + return nm_modem_stage3_ip4_config_start (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_modem_parent_class), + reason); +} + +static NMActStageReturn +real_act_stage4_get_ip4_config (NMDevice *device, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + return nm_modem_stage4_get_ip4_config (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, + device, + NM_DEVICE_CLASS (nm_device_modem_parent_class), + config, + reason); +} + +/*****************************************************************************/ + +static gboolean +real_get_enabled (NMDeviceInterface *device) +{ + return nm_modem_get_mm_enabled (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem); +} + +static void +real_set_enabled (NMDeviceInterface *device, gboolean enabled) +{ + NMDeviceModem *self = NM_DEVICE_MODEM (device); + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self); + NMDeviceState state; + + if (priv->modem) { + nm_modem_set_mm_enabled (priv->modem, enabled); + + if (enabled == FALSE) { + state = nm_device_interface_get_state (device); + if (state == NM_DEVICE_STATE_ACTIVATED) { + nm_device_state_changed (NM_DEVICE (device), + NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_REASON_NONE); + } + } + } +} + +/*****************************************************************************/ + +static void +device_interface_init (NMDeviceInterface *iface_class) +{ + iface_class->get_enabled = real_get_enabled; + iface_class->set_enabled = real_set_enabled; +} + +static void +nm_device_modem_init (NMDeviceModem *self) +{ + g_signal_connect (self, "state-changed", G_CALLBACK (device_state_changed), self); +} + +static void +set_modem (NMDeviceModem *self, NMModem *modem) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self); + + g_return_if_fail (modem != NULL); + + priv->modem = g_object_ref (modem); + + g_signal_connect (modem, NM_MODEM_PPP_STATS, G_CALLBACK (ppp_stats), self); + g_signal_connect (modem, NM_MODEM_PPP_FAILED, G_CALLBACK (ppp_failed), self); + g_signal_connect (modem, NM_MODEM_PREPARE_RESULT, G_CALLBACK (modem_prepare_result), self); + g_signal_connect (modem, NM_MODEM_IP4_CONFIG_RESULT, G_CALLBACK (modem_ip4_config_result), self); + g_signal_connect (modem, NM_MODEM_NEED_AUTH, G_CALLBACK (modem_need_auth), self); + g_signal_connect (modem, "notify::" NM_MODEM_ENABLED, G_CALLBACK (modem_enabled_cb), self); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + switch (prop_id) { + case PROP_MODEM: + /* construct-only */ + set_modem (NM_DEVICE_MODEM (object), g_value_get_object (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) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_MODEM: + g_value_set_object (value, priv->modem); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object); + + g_object_unref (priv->modem); + priv->modem = NULL; + + G_OBJECT_CLASS (nm_device_modem_parent_class)->finalize (object); +} + +static void +nm_device_modem_class_init (NMDeviceModemClass *mclass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (mclass); + NMDeviceClass *device_class = NM_DEVICE_CLASS (mclass); + + g_type_class_add_private (object_class, sizeof (NMDeviceModemPrivate)); + + /* Virtual methods */ + object_class->finalize = finalize; + object_class->get_property = get_property; + object_class->set_property = set_property; + + device_class->get_generic_capabilities = real_get_generic_capabilities; + device_class->get_best_auto_connection = real_get_best_auto_connection; + device_class->connection_secrets_updated = real_connection_secrets_updated; + device_class->check_connection_compatible = real_check_connection_compatible; + device_class->hw_is_up = real_hw_is_up; + device_class->hw_bring_up = real_hw_bring_up; + device_class->deactivate_quickly = real_deactivate_quickly; + device_class->act_stage1_prepare = real_act_stage1_prepare; + device_class->act_stage2_config = real_act_stage2_config; + device_class->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; + device_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_MODEM, + g_param_spec_object (NM_DEVICE_MODEM_MODEM, + "Modem", + "Modem", + NM_TYPE_MODEM, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + + /* Signals */ + signals[PPP_STATS] = + g_signal_new ("ppp-stats", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceModemClass, ppp_stats), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); + + signals[ENABLE_CHANGED] = + g_signal_new (NM_DEVICE_MODEM_ENABLE_CHANGED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (mclass), + nm_modem_get_serial_dbus_info ()); +} + diff --git a/src/nm-device-modem.h b/src/nm-device-modem.h new file mode 100644 index 00000000..c6ef4d21 --- /dev/null +++ b/src/nm-device-modem.h @@ -0,0 +1,56 @@ +/* -*- 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) 2010 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_MODEM_H +#define NM_DEVICE_MODEM_H + +#include +#include + +#include "nm-device.h" +#include "nm-modem.h" + +#define NM_TYPE_DEVICE_MODEM (nm_device_modem_get_type ()) +#define NM_DEVICE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModem)) +#define NM_DEVICE_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass)) +#define NM_IS_DEVICE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_MODEM)) +#define NM_IS_DEVICE_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE_MODEM)) +#define NM_DEVICE_MODEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass)) + +#define NM_DEVICE_MODEM_MODEM "modem" + +#define NM_DEVICE_MODEM_ENABLE_CHANGED "enable-changed" + +typedef struct { + NMDevice parent; +} NMDeviceModem; + +typedef struct { + NMDeviceClass parent; + + void (*ppp_stats) (NMDeviceModem *self, guint32 in_bytes, guint32 out_bytes); +} NMDeviceModemClass; + +GType nm_device_modem_get_type (void); + +/* Private for subclases */ +NMModem *nm_device_modem_get_modem (NMDeviceModem *self); + +#endif /* NM_DEVICE_MODEM_H */ diff --git a/src/nm-device-olpc-mesh.c b/src/nm-device-olpc-mesh.c new file mode 100644 index 00000000..546ecfaf --- /dev/null +++ b/src/nm-device-olpc-mesh.c @@ -0,0 +1,974 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager -- Network link manager + * + * Dan Williams + * Sjoerd Simons + * Daniel Drake + * + * 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 2005 - 2010 Red Hat, Inc. + * (C) Copyright 2008 Collabora Ltd. + * (C) Copyright 2009 One Laptop per Child + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-device.h" +#include "nm-device-wifi.h" +#include "nm-device-olpc-mesh.h" +#include "nm-device-interface.h" +#include "nm-device-private.h" +#include "nm-utils.h" +#include "nm-logging.h" +#include "NetworkManagerUtils.h" +#include "nm-activation-request.h" +#include "nm-properties-changed-signal.h" +#include "nm-setting-connection.h" +#include "nm-setting-olpc-mesh.h" +#include "nm-system.h" +#include "nm-manager.h" + +/* This is a bug; but we can't really change API now... */ +#include "NetworkManagerVPN.h" + + +#include "nm-device-olpc-mesh-glue.h" + +static void nm_device_olpc_mesh_set_ssid (NMDeviceOlpcMesh *self, const GByteArray * ssid); + +G_DEFINE_TYPE (NMDeviceOlpcMesh, nm_device_olpc_mesh, NM_TYPE_DEVICE) + +#define NM_DEVICE_OLPC_MESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshPrivate)) + + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_COMPANION, + PROP_ACTIVE_CHANNEL, + + LAST_PROP +}; + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +typedef enum +{ + NM_OLPC_MESH_ERROR_CONNECTION_NOT_MESH = 0, + NM_OLPC_MESH_ERROR_CONNECTION_INVALID, + NM_OLPC_MESH_ERROR_CONNECTION_INCOMPATIBLE, +} NMOlpcMeshError; + +#define NM_OLPC_MESH_ERROR (nm_olpc_mesh_error_quark ()) +#define NM_TYPE_OLPC_MESH_ERROR (nm_olpc_mesh_error_get_type ()) + + +struct _NMDeviceOlpcMeshPrivate +{ + gboolean dispose_has_run; + + struct ether_addr hw_addr; + + GByteArray * ssid; + + gint8 num_freqs; + guint32 freqs[IW_MAX_FREQUENCIES]; + + guint8 we_version; + gboolean up; + + NMDevice * companion; + gboolean stage1_waiting; + guint device_added_id; +}; + +static GQuark +nm_olpc_mesh_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-mesh-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +static GType +nm_olpc_mesh_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Connection was not a wireless connection. */ + ENUM_ENTRY (NM_OLPC_MESH_ERROR_CONNECTION_NOT_MESH, "ConnectionNotMesh"), + /* Connection was not a valid wireless connection. */ + ENUM_ENTRY (NM_OLPC_MESH_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + /* Connection does not apply to this device. */ + ENUM_ENTRY (NM_OLPC_MESH_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMOlpcMeshError", values); + } + return etype; +} + +static guint32 +real_get_generic_capabilities (NMDevice *dev) +{ + int fd; + guint32 caps = NM_DEVICE_CAP_NONE; + struct iw_range range; + struct iwreq wrq; + const char *iface = nm_device_get_iface (dev); + + /* Check for Wireless Extensions support >= 16 for wireless devices */ + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_warn (LOGD_OLPC_MESH, "couldn't open control socket."); + goto out; + } + + memset (&wrq, 0, sizeof (struct iwreq)); + memset (&range, 0, sizeof (struct iw_range)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + wrq.u.data.pointer = (caddr_t) ⦥ + wrq.u.data.length = sizeof (struct iw_range); + + if (ioctl (fd, SIOCGIWRANGE, &wrq) < 0) { + nm_log_warn (LOGD_OLPC_MESH, "couldn't get driver range information."); + goto out; + } + + if ((wrq.u.data.length < 300) || (range.we_version_compiled < 16)) { + nm_log_warn (LOGD_OLPC_MESH, + "(%s): driver's Wireless Extensions version (%d) is too old.", + iface, range.we_version_compiled); + goto out; + } else { + caps |= NM_DEVICE_CAP_NM_SUPPORTED; + } + +out: + if (fd >= 0) + close (fd); + return caps; +} + +static void +nm_device_olpc_mesh_init (NMDeviceOlpcMesh * self) +{ + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + + priv->dispose_has_run = FALSE; + priv->we_version = 0; + priv->companion = NULL; + priv->stage1_waiting = FALSE; + + memset (&(priv->hw_addr), 0, sizeof (struct ether_addr)); +} + +static guint32 iw_freq_to_uint32 (struct iw_freq *freq) +{ + if (freq->e == 0) { + /* Some drivers report channel not frequency. Convert to a + * frequency; but this assumes that the device is in b/g mode. + */ + if ((freq->m >= 1) && (freq->m <= 13)) + return 2407 + (5 * freq->m); + else if (freq->m == 14) + return 2484; + } + + return (guint32) (((double) freq->m) * pow (10, freq->e) / 1000000); +} + + +/* Until a new wireless-tools comes out that has the defs and the structure, + * need to copy them here. + */ +/* Scan capability flags - in (struct iw_range *)->scan_capa */ +#define NM_IW_SCAN_CAPA_NONE 0x00 +#define NM_IW_SCAN_CAPA_ESSID 0x01 + +struct iw_range_with_scan_capa +{ + guint32 throughput; + guint32 min_nwid; + guint32 max_nwid; + guint16 old_num_channels; + guint8 old_num_frequency; + + guint8 scan_capa; +/* don't need the rest... */ +}; + + + + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + GObjectClass *klass; + NMDeviceOlpcMesh *self; + NMDeviceOlpcMeshPrivate *priv; + const char *iface; + int fd; + struct iw_range range; + struct iwreq wrq; + int i; + + klass = G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class); + object = klass->constructor (type, n_construct_params, construct_params); + if (!object) + return NULL; + + self = NM_DEVICE_OLPC_MESH (object); + priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + + nm_log_dbg (LOGD_HW | LOGD_OLPC_MESH, "(%s): kernel ifindex %d", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_ifindex (NM_DEVICE (self))); + + iface = nm_device_get_iface (NM_DEVICE (self)); + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) + goto error; + + memset (&wrq, 0, sizeof (struct iwreq)); + memset (&range, 0, sizeof (struct iw_range)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + wrq.u.data.pointer = (caddr_t) ⦥ + wrq.u.data.length = sizeof (struct iw_range); + + if (ioctl (fd, SIOCGIWRANGE, &wrq) < 0) + goto error; + + priv->num_freqs = MIN (range.num_frequency, IW_MAX_FREQUENCIES); + for (i = 0; i < priv->num_freqs; i++) + priv->freqs[i] = iw_freq_to_uint32 (&range.freq[i]); + + priv->we_version = range.we_version_compiled; + + close (fd); + + /* shorter timeout for mesh connectivity */ + nm_device_set_dhcp_timeout (NM_DEVICE (self), 20); + return object; + +error: + if (fd >= 0) + close (fd); + g_object_unref (object); + return NULL; +} + +static gboolean +real_hw_is_up (NMDevice *device) +{ + return nm_system_device_is_up (device); +} + +static gboolean +real_hw_bring_up (NMDevice *dev, gboolean *no_firmware) +{ + return nm_system_device_set_up_down (dev, TRUE, no_firmware); +} + +static void +real_hw_take_down (NMDevice *dev) +{ + nm_system_device_set_up_down (dev, FALSE, NULL); +} + +static gboolean +real_is_up (NMDevice *device) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (device); + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + + return priv->up; +} + +static gboolean +real_bring_up (NMDevice *dev) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (dev); + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + + priv->up = TRUE; + return TRUE; +} + +static void +device_cleanup (NMDeviceOlpcMesh *self) +{ + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + + if (priv->ssid) { + g_byte_array_free (priv->ssid, TRUE); + priv->ssid = NULL; + } + priv->up = FALSE; +} + +static void +real_take_down (NMDevice *dev) +{ + device_cleanup (NM_DEVICE_OLPC_MESH (dev)); +} + +static gboolean +real_check_connection_compatible (NMDevice *device, + NMConnection *connection, + GError **error) +{ + NMSettingConnection *s_con; + NMSettingOlpcMesh *s_mesh; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_OLPC_MESH_SETTING_NAME)) { + g_set_error (error, + NM_OLPC_MESH_ERROR, NM_OLPC_MESH_ERROR_CONNECTION_NOT_MESH, + "The connection was not a Mesh connection."); + return FALSE; + } + + s_mesh = NM_SETTING_OLPC_MESH (nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH)); + if (!s_mesh) { + g_set_error (error, + NM_OLPC_MESH_ERROR, NM_OLPC_MESH_ERROR_CONNECTION_INVALID, + "The connection was not a valid Mesh connection."); + return FALSE; + } + + return TRUE; +} + +/* + * nm_device_olpc_mesh_get_address + * + * Get a device's hardware address + * + */ +static void +nm_device_olpc_mesh_get_address (NMDeviceOlpcMesh *self, + struct ether_addr *addr) +{ + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + g_return_if_fail (self != NULL); + g_return_if_fail (addr != NULL); + + memcpy (addr, &(priv->hw_addr), sizeof (struct ether_addr)); +} + +static int +create_socket_with_request (NMDevice *self, struct iwreq *req) +{ + int sk; + const char * iface; + + g_return_val_if_fail (self != NULL, -1); + + sk = socket (AF_INET, SOCK_DGRAM, 0); + if (!sk) { + nm_log_err (LOGD_OLPC_MESH, "Couldn't create socket: %d.", errno); + return -1; + } + + memset (req, 0, sizeof (struct iwreq)); + iface = nm_device_get_iface (NM_DEVICE (self)); + strncpy (req->ifr_name, iface, IFNAMSIZ); + + return sk; +} + +static guint32 +nm_device_olpc_mesh_get_channel (NMDeviceOlpcMesh *self) +{ + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + int sk; + struct iwreq req; + int ret = 0; + int i; + guint32 freq; + + sk = create_socket_with_request (NM_DEVICE (self), &req); + if (sk == -1) + return 0; + + if ((ioctl (sk, SIOCGIWFREQ, &req)) != 0) { + nm_log_warn (LOGD_OLPC_MESH, "(%s): failed to get channel (errno: %d)", + nm_device_get_iface (NM_DEVICE (self)), errno); + goto out; + } + + freq = iw_freq_to_uint32 (&req.u.freq); + + for (i = 0 ; i < priv->num_freqs; i++) { + if (freq == priv->freqs[i]) + break; + } + if (i < priv->num_freqs) + ret = i + 1; + +out: + if (sk >= 0) + close (sk); + return ret; +} + +static void +nm_device_olpc_mesh_set_channel (NMDeviceOlpcMesh *self, guint32 channel) +{ + int sk; + struct iwreq req; + + if (nm_device_olpc_mesh_get_channel (self) == channel) + return; + + sk = create_socket_with_request (NM_DEVICE (self), &req); + if (sk < 0) + return; + + if (channel > 0) { + req.u.freq.flags = IW_FREQ_FIXED; + req.u.freq.e = 0; + req.u.freq.m = channel; + } + + if (ioctl (sk, SIOCSIWFREQ, &req) != 0) { + nm_log_warn (LOGD_OLPC_MESH, "(%s): failed to set to channel %d (errno: %d)", + nm_device_get_iface (NM_DEVICE (self)), channel, errno); + } else + g_object_notify (G_OBJECT (self), NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL); + + close (sk); +} + +static void +nm_device_olpc_mesh_set_ssid (NMDeviceOlpcMesh *self, const GByteArray * ssid) +{ + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + int sk; + struct iwreq wrq; + const char * iface; + guint32 len = 0; + char buf[IW_ESSID_MAX_SIZE + 1]; + + g_return_if_fail (self != NULL); + + sk = socket (AF_INET, SOCK_DGRAM, 0); + if (!sk) { + nm_log_err (LOGD_OLPC_MESH, "Couldn't create socket: %d.", errno); + return; + } + + iface = nm_device_get_iface (NM_DEVICE (self)); + + memset (buf, 0, sizeof (buf)); + if (ssid) { + len = ssid->len; + memcpy (buf, ssid->data, MIN (sizeof (buf) - 1, len)); + } + wrq.u.essid.pointer = (caddr_t) buf; + + if (priv->we_version < 21) { + /* For historic reasons, set SSID length to include one extra + * character, C string nul termination, even though SSID is + * really an octet string that should not be presented as a C + * string. Some Linux drivers decrement the length by one and + * can thus end up missing the last octet of the SSID if the + * length is not incremented here. WE-21 changes this to + * explicitly require the length _not_ to include nul + * termination. */ + if (len) + len++; + } + wrq.u.essid.length = len; + wrq.u.essid.flags = (len > 0) ? 1 : 0; /* 1=enable SSID, 0=disable/any */ + + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + + if (ioctl (sk, SIOCSIWESSID, &wrq) < 0) { + if (errno != ENODEV) { + nm_log_err (LOGD_OLPC_MESH, "(%s): error setting SSID to '%s': %s", + iface, + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(null)", + strerror (errno)); + } + } + + close (sk); +} + +/****************************************************************************/ + +static void +real_update_hw_address (NMDevice *dev) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (dev); + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + struct ifreq req; + int ret, fd; + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_warn (LOGD_OLPC_MESH, "could not open control socket."); + return; + } + + memset (&req, 0, sizeof (struct ifreq)); + strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); + ret = ioctl (fd, SIOCGIFHWADDR, &req); + if (ret) { + nm_log_warn (LOGD_OLPC_MESH, "(%s): error getting hardware address: %d", + nm_device_get_iface (dev), errno); + goto out; + } + + if (memcmp (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr))) { + memcpy (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr)); + g_object_notify (G_OBJECT (dev), NM_DEVICE_OLPC_MESH_HW_ADDRESS); + } + +out: + close (fd); +} + + +static NMActStageReturn +real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) +{ + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (dev); + gboolean scanning; + + /* disconnect companion device, if it is connected */ + if (nm_device_get_act_request (NM_DEVICE (priv->companion))) { + nm_log_info (LOGD_OLPC_MESH, "(%s): disconnecting companion device %s", + nm_device_get_iface (dev), + nm_device_get_iface (priv->companion)); + /* FIXME: VPN stuff here is a bug; but we can't really change API now... */ + nm_device_state_changed (NM_DEVICE (priv->companion), + NM_DEVICE_STATE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED); + nm_log_info (LOGD_OLPC_MESH, "(%s): companion %s disconnected", + nm_device_get_iface (dev), + nm_device_get_iface (priv->companion)); + } + + + /* wait with continuing configuration untill the companion device is done scanning */ + g_object_get (priv->companion, "scanning", &scanning, NULL); + if (scanning) { + priv->stage1_waiting = TRUE; + return NM_ACT_STAGE_RETURN_POSTPONE; + } + + return NM_ACT_STAGE_RETURN_SUCCESS; +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (dev); + NMConnection *connection; + NMSettingOlpcMesh *s_mesh; + NMActRequest *req; + guint32 channel; + const GByteArray *anycast_addr_array; + guint8 *anycast_addr = NULL; + + req = nm_device_get_act_request (dev); + g_assert (req); + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_mesh = NM_SETTING_OLPC_MESH (nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH)); + g_assert (s_mesh); + + channel = nm_setting_olpc_mesh_get_channel (s_mesh); + if (channel != 0) + nm_device_olpc_mesh_set_channel (self, channel); + nm_device_olpc_mesh_set_ssid (self, nm_setting_olpc_mesh_get_ssid (s_mesh)); + + anycast_addr_array = nm_setting_olpc_mesh_get_dhcp_anycast_address (s_mesh); + if (anycast_addr_array) + anycast_addr = anycast_addr_array->data; + + nm_device_set_dhcp_anycast_address (dev, anycast_addr); + return NM_ACT_STAGE_RETURN_SUCCESS; +} + +static void +dispose (GObject *object) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (object); + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + NMManager *manager; + + if (priv->dispose_has_run) { + G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->dispose (object); + return; + } + priv->dispose_has_run = TRUE; + + device_cleanup (self); + + manager = nm_manager_get (NULL, NULL, NULL, FALSE, FALSE, FALSE, NULL); + if (priv->device_added_id) + g_signal_handler_disconnect (manager, priv->device_added_id); + g_object_unref (manager); + + G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->dispose (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDeviceOlpcMesh *device = NM_DEVICE_OLPC_MESH (object); + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (device); + struct ether_addr hw_addr; + + switch (prop_id) { + case PROP_HW_ADDRESS: + nm_device_olpc_mesh_get_address (device, &hw_addr); + g_value_take_string (value, nm_ether_ntop (&hw_addr)); + break; + case PROP_COMPANION: + if (priv->companion) + g_value_set_boxed (value, nm_device_get_path (priv->companion)); + else + g_value_set_boxed (value, "/"); + break; + case PROP_ACTIVE_CHANNEL: + g_value_set_uint (value, nm_device_olpc_mesh_get_channel (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMDeviceOlpcMeshPrivate)); + + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->dispose = dispose; + + parent_class->get_type_capabilities = NULL; + parent_class->get_generic_capabilities = real_get_generic_capabilities; + parent_class->hw_is_up = real_hw_is_up; + parent_class->hw_bring_up = real_hw_bring_up; + parent_class->hw_take_down = real_hw_take_down; + parent_class->is_up = real_is_up; + parent_class->bring_up = real_bring_up; + parent_class->take_down = real_take_down; + parent_class->update_hw_address = real_update_hw_address; + parent_class->check_connection_compatible = real_check_connection_compatible; + + parent_class->act_stage1_prepare = real_act_stage1_prepare; + parent_class->act_stage2_config = real_act_stage2_config; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_OLPC_MESH_HW_ADDRESS, + "MAC Address", + "Hardware MAC address", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_COMPANION, + g_param_spec_boxed (NM_DEVICE_OLPC_MESH_COMPANION, + "Companion device", + "Companion device object path", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_ACTIVE_CHANNEL, + g_param_spec_uint (NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL, + "Active channel", + "Active channel", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDeviceOlpcMeshClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_nm_device_olpc_mesh_object_info); + + dbus_g_error_domain_register (NM_OLPC_MESH_ERROR, NULL, + NM_TYPE_OLPC_MESH_ERROR); +} + +static void +companion_notify_cb (NMDeviceWifi *companion, GParamSpec *pspec, gpointer user_data) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (user_data); + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + gboolean scanning; + + if (!priv->stage1_waiting) + return; + + g_object_get (companion, "scanning", &scanning, NULL); + + if (!scanning) { + priv->stage1_waiting = FALSE; + nm_device_activate_schedule_stage2_device_config (NM_DEVICE (self)); + } +} + +/* disconnect from mesh if someone starts using the companion */ +static void +companion_state_changed_cb (NMDeviceWifi *companion, + NMDeviceState state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (user_data); + NMDeviceState self_state = nm_device_get_state (NM_DEVICE (self)); + + if ( self_state < NM_DEVICE_STATE_PREPARE + || self_state > NM_DEVICE_STATE_ACTIVATED + || state < NM_DEVICE_STATE_PREPARE + || state > NM_DEVICE_STATE_ACTIVATED) + return; + + nm_log_dbg (LOGD_OLPC_MESH, "(%s): disconnecting mesh due to companion connectivity", + nm_device_get_iface (NM_DEVICE (self))); + /* FIXME: VPN stuff here is a bug; but we can't really change API now... */ + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED); +} + +static gboolean +companion_scan_allowed_cb (NMDeviceWifi *companion, gpointer user_data) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (user_data); + NMDeviceState state; + + g_object_get (G_OBJECT (self), NM_DEVICE_INTERFACE_STATE, &state, NULL); + + /* Don't allow the companion to scan while configure the mesh interface */ + return (state < NM_DEVICE_STATE_PREPARE) || (state > NM_DEVICE_STATE_IP_CONFIG); +} + +static gboolean +companion_autoconnect_allowed_cb (NMDeviceWifi *companion, gpointer user_data) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (user_data); + NMDeviceState state; + + g_object_get (G_OBJECT (self), NM_DEVICE_INTERFACE_STATE, &state, NULL); + + /* Don't allow the companion to autoconnect while a mesh connection is + * active */ + return (state < NM_DEVICE_STATE_PREPARE) || (state > NM_DEVICE_STATE_ACTIVATED); +} + +static gboolean +is_companion (NMDeviceOlpcMesh *self, NMDevice *other) +{ + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + struct ether_addr their_addr; + NMManager *manager; + + if (!NM_IS_DEVICE_WIFI (other)) + return FALSE; + + nm_device_wifi_get_address (NM_DEVICE_WIFI (other), &their_addr); + + if (memcmp (priv->hw_addr.ether_addr_octet, + their_addr.ether_addr_octet, ETH_ALEN) != 0) { + return FALSE; + } + + /* FIXME detect when our companion leaves */ + priv->companion = other; + + /* When we've found the companion, stop listening for other devices */ + manager = nm_manager_get (NULL, NULL, NULL, FALSE, FALSE, FALSE, NULL); + if (priv->device_added_id) { + g_signal_handler_disconnect (manager, priv->device_added_id); + priv->device_added_id = 0; + } + g_object_unref (manager); + + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_REASON_NONE); + + nm_log_info (LOGD_OLPC_MESH, "(%s): found companion WiFi device %s", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_iface (other)); + + g_signal_connect (G_OBJECT (other), "state-changed", + G_CALLBACK (companion_state_changed_cb), self); + g_signal_connect (G_OBJECT (other), "notify::scanning", + G_CALLBACK (companion_notify_cb), self); + g_signal_connect (G_OBJECT (other), "scanning-allowed", + G_CALLBACK (companion_scan_allowed_cb), self); + g_signal_connect (G_OBJECT (other), "autoconnect-allowed", + G_CALLBACK (companion_autoconnect_allowed_cb), self); + + g_object_notify (G_OBJECT (self), NM_DEVICE_OLPC_MESH_COMPANION); + + return TRUE; +} + +static void +device_added_cb (NMManager *manager, NMDevice *other, gpointer user_data) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (user_data); + + is_companion (self, other); +} + +static gboolean +check_companion_cb (gpointer user_data) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (user_data); + NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self); + NMManager *manager; + GSList *list; + + if (priv->companion != NULL) { + nm_device_state_changed (NM_DEVICE (user_data), + NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_REASON_NONE); + return FALSE; + } + + if (priv->device_added_id != 0) + return FALSE; + + manager = nm_manager_get (NULL, NULL, NULL, FALSE, FALSE, FALSE, NULL); + + priv->device_added_id = g_signal_connect (manager, "device-added", + G_CALLBACK (device_added_cb), self); + + /* Try to find the companion if it's already known to the NMManager */ + for (list = nm_manager_get_devices (manager); list ; list = g_slist_next (list)) { + if (is_companion (self, NM_DEVICE (list->data))) + break; + } + + g_object_unref (manager); + + return FALSE; +} + +static void +state_changed_cb (NMDevice *device, NMDeviceState state, gpointer user_data) +{ + NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (device); + + switch (state) { + case NM_DEVICE_STATE_UNMANAGED: + break; + case NM_DEVICE_STATE_UNAVAILABLE: + /* If transitioning to UNAVAILBLE and the companion device is known then + * transition to DISCONNECTED otherwise wait for our companion. + */ + g_idle_add (check_companion_cb, self); + break; + case NM_DEVICE_STATE_ACTIVATED: + break; + case NM_DEVICE_STATE_FAILED: + break; + case NM_DEVICE_STATE_DISCONNECTED: + break; + default: + break; + } +} + + +NMDevice * +nm_device_olpc_mesh_new (const char *udi, + const char *iface, + const char *driver) +{ + GObject *obj; + + g_return_val_if_fail (udi != NULL, NULL); + g_return_val_if_fail (iface != NULL, NULL); + g_return_val_if_fail (driver != NULL, NULL); + + obj = g_object_new (NM_TYPE_DEVICE_OLPC_MESH, + NM_DEVICE_INTERFACE_UDI, udi, + NM_DEVICE_INTERFACE_IFACE, iface, + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "802.11 OLPC Mesh", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_OLPC_MESH, + NULL); + if (obj == NULL) + return NULL; + + g_signal_connect (obj, "state-changed", G_CALLBACK (state_changed_cb), NULL); + + return NM_DEVICE (obj); +} diff --git a/src/nm-device-olpc-mesh.h b/src/nm-device-olpc-mesh.h new file mode 100644 index 00000000..bcc03e57 --- /dev/null +++ b/src/nm-device-olpc-mesh.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* NetworkManager -- Network link manager + * + * Dan Williams + * Sjoerd Simons + * Daniel Drake + * + * 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 2005 Red Hat, Inc. + * (C) Copyright 2008 Collabora Ltd. + * (C) Copyright 2009 One Laptop per Child + */ + +#ifndef NM_DEVICE_OLPC_MESH_H +#define NM_DEVICE_OLPC_MESH_H + +#include +#include + +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_OLPC_MESH (nm_device_olpc_mesh_get_type ()) +#define NM_DEVICE_OLPC_MESH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMesh)) +#define NM_DEVICE_OLPC_MESH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshClass)) +#define NM_IS_DEVICE_OLPC_MESH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_OLPC_MESH)) +#define NM_IS_DEVICE_OLPC_MESH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_OLPC_MESH)) +#define NM_DEVICE_OLPC_MESH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshClass)) + +#define NM_DEVICE_OLPC_MESH_HW_ADDRESS "hw-address" +#define NM_DEVICE_OLPC_MESH_COMPANION "companion" +#define NM_DEVICE_OLPC_MESH_BITRATE "bitrate" +#define NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL "active-channel" + +#ifndef NM_DEVICE_OLPC_MESH_DEFINED +#define NM_DEVICE_OLPC_MESH_DEFINED +typedef struct _NMDeviceOlpcMesh NMDeviceOlpcMesh; +#endif + +typedef struct _NMDeviceOlpcMeshClass NMDeviceOlpcMeshClass; +typedef struct _NMDeviceOlpcMeshPrivate NMDeviceOlpcMeshPrivate; + +struct _NMDeviceOlpcMesh +{ + NMDevice parent; +}; + +struct _NMDeviceOlpcMeshClass +{ + NMDeviceClass parent; + + /* Signals */ + void (*properties_changed) (NMDeviceOlpcMesh *device, + GHashTable *properties); +}; + + +GType nm_device_olpc_mesh_get_type (void); + +NMDevice *nm_device_olpc_mesh_new (const char *udi, + const char *iface, + const char *driver); + +G_END_DECLS + +#endif /* NM_DEVICE_OLPC_MESH_H */ diff --git a/src/nm-device-private.h b/src/nm-device-private.h new file mode 100644 index 00000000..371f17f1 --- /dev/null +++ b/src/nm-device-private.h @@ -0,0 +1,45 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_DEVICE_PRIVATE_H +#define NM_DEVICE_PRIVATE_H + +#include "nm-device.h" + +void nm_device_set_ip_iface (NMDevice *self, const char *iface); + +void nm_device_activate_schedule_stage3_ip_config_start (NMDevice *device); + +void nm_device_state_changed (NMDevice *device, + NMDeviceState state, + NMDeviceStateReason reason); + +gboolean nm_device_hw_bring_up (NMDevice *self, gboolean wait, gboolean *no_firmware); + +void nm_device_hw_take_down (NMDevice *self, gboolean block); + +void nm_device_handle_autoip4_event (NMDevice *self, + const char *event, + const char *address); + +gboolean nm_device_ip_config_should_fail (NMDevice *self, gboolean ip6); + +#endif /* NM_DEVICE_PRIVATE_H */ diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c new file mode 100644 index 00000000..36be9e3e --- /dev/null +++ b/src/nm-device-wifi.c @@ -0,0 +1,3936 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-glib-compat.h" +#include "nm-device.h" +#include "nm-device-wifi.h" +#include "nm-device-interface.h" +#include "nm-device-private.h" +#include "nm-utils.h" +#include "nm-logging.h" +#include "nm-marshal.h" +#include "NetworkManagerUtils.h" +#include "nm-activation-request.h" +#include "nm-supplicant-manager.h" +#include "nm-supplicant-interface.h" +#include "nm-supplicant-config.h" +#include "nm-properties-changed-signal.h" +#include "nm-setting-connection.h" +#include "nm-setting-wireless.h" +#include "nm-setting-wireless-security.h" +#include "nm-setting-8021x.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-ip6-config.h" +#include "nm-system.h" + +static gboolean impl_device_get_access_points (NMDeviceWifi *device, + GPtrArray **aps, + GError **err); + +#include "nm-device-wifi-glue.h" + + +/* All of these are in seconds */ +#define SCAN_INTERVAL_MIN 0 +#define SCAN_INTERVAL_STEP 20 +#define SCAN_INTERVAL_MAX 120 + +#define WIRELESS_SECRETS_TRIES "wireless-secrets-tries" + +static void device_interface_init (NMDeviceInterface *iface_class); + +G_DEFINE_TYPE_EXTENDED (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) + +#define NM_DEVICE_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WIFI, NMDeviceWifiPrivate)) + + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_MODE, + PROP_BITRATE, + PROP_ACTIVE_ACCESS_POINT, + PROP_CAPABILITIES, + PROP_SCANNING, + PROP_IPW_RFKILL_STATE, + + LAST_PROP +}; + +enum { + ACCESS_POINT_ADDED, + ACCESS_POINT_REMOVED, + HIDDEN_AP_FOUND, + PROPERTIES_CHANGED, + SCANNING_ALLOWED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +typedef enum { + NM_WIFI_ERROR_CONNECTION_NOT_WIRELESS = 0, + NM_WIFI_ERROR_CONNECTION_INVALID, + NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE, +} NMWifiError; + +#define NM_WIFI_ERROR (nm_wifi_error_quark ()) +#define NM_TYPE_WIFI_ERROR (nm_wifi_error_get_type ()) + +typedef struct SupplicantStateTask { + NMDeviceWifi *self; + guint32 new_state; + guint32 old_state; + gboolean mgr_task; + guint source_id; +} SupplicantStateTask; + +typedef struct Supplicant { + NMSupplicantManager *mgr; + NMSupplicantInterface *iface; + + /* signal handler ids */ + guint mgr_state_id; + guint iface_error_id; + guint iface_state_id; + guint iface_scanned_ap_id; + guint iface_scan_request_result_id; + guint iface_scan_results_id; + guint iface_con_state_id; + guint iface_notify_scanning_id; + + /* Timeouts and idles */ + guint iface_con_error_cb_id; + guint con_timeout_id; + + GSList *mgr_tasks; + GSList *iface_tasks; +} Supplicant; + +struct _NMDeviceWifiPrivate { + gboolean disposed; + + struct ether_addr hw_addr; + + /* Legacy rfkill for ipw2x00; will be fixed with 2.6.33 kernel */ + char * ipw_rfkill_path; + guint ipw_rfkill_id; + RfKillState ipw_rfkill_state; + + GByteArray * ssid; + gint8 invalid_strength_counter; + iwqual max_qual; + + gint8 num_freqs; + guint32 freqs[IW_MAX_FREQUENCIES]; + + GSList * ap_list; + NMAccessPoint * current_ap; + guint32 rate; + gboolean enabled; /* rfkilled or not */ + + glong scheduled_scan_time; + guint8 scan_interval; /* seconds */ + guint pending_scan_id; + + Supplicant supplicant; + + guint32 failed_link_count; + guint periodic_source_id; + guint link_timeout_id; + + /* Static options from driver */ + guint8 we_version; + guint32 capabilities; + gboolean has_scan_capa_ssid; +}; + +static guint32 nm_device_wifi_get_frequency (NMDeviceWifi *self); + +static gboolean request_wireless_scan (gpointer user_data); + +static void schedule_scan (NMDeviceWifi *self, gboolean backoff); + +static void cancel_pending_scan (NMDeviceWifi *self); + +static int wireless_qual_to_percent (const struct iw_quality *qual, + const struct iw_quality *max_qual); + +static void cleanup_association_attempt (NMDeviceWifi * self, + gboolean disconnect); + +static void remove_supplicant_timeouts (NMDeviceWifi *self); + +static void supplicant_iface_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + NMDeviceWifi *self); + +static void supplicant_iface_connection_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + NMDeviceWifi *self); + +static void supplicant_iface_scanned_ap_cb (NMSupplicantInterface * iface, + GHashTable *properties, + NMDeviceWifi * self); + +static void supplicant_iface_scan_request_result_cb (NMSupplicantInterface * iface, + gboolean success, + NMDeviceWifi * self); + +static void supplicant_iface_scan_results_cb (NMSupplicantInterface * iface, + guint32 num_bssids, + NMDeviceWifi * self); + +static void supplicant_mgr_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + NMDeviceWifi *self); + +static void supplicant_iface_notify_scanning_cb (NMSupplicantInterface * iface, + GParamSpec * pspec, + NMDeviceWifi * self); + +static guint32 nm_device_wifi_get_bitrate (NMDeviceWifi *self); + +static void cull_scan_list (NMDeviceWifi *self); + +static GQuark +nm_wifi_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-wifi-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +static GType +nm_wifi_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Connection was not a wireless connection. */ + ENUM_ENTRY (NM_WIFI_ERROR_CONNECTION_NOT_WIRELESS, "ConnectionNotWireless"), + /* Connection was not a valid wireless connection. */ + ENUM_ENTRY (NM_WIFI_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + /* Connection does not apply to this device. */ + ENUM_ENTRY (NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMWifiError", values); + } + return etype; +} + +/* IPW rfkill handling (until 2.6.33) */ +RfKillState +nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + char *contents = NULL; + RfKillState state = RFKILL_UNBLOCKED; + const char *str_state = NULL; + + if ( priv->ipw_rfkill_path + && g_file_get_contents (priv->ipw_rfkill_path, &contents, NULL, NULL)) { + contents = g_strstrip (contents); + + /* 0 - RF kill not enabled + * 1 - SW based RF kill active (sysfs) + * 2 - HW based RF kill active + * 3 - Both HW and SW baed RF kill active + */ + switch (contents[0]) { + case '1': + state = RFKILL_SOFT_BLOCKED; + str_state = "soft-blocked"; + break; + case '2': + case '3': + state = RFKILL_HARD_BLOCKED; + str_state = "hard-blocked"; + break; + case '0': + str_state = "unblocked"; + default: + break; + } + g_free (contents); + + nm_log_dbg (LOGD_RFKILL, "(%s): ipw rfkill state '%s'", + nm_device_get_iface (NM_DEVICE (self)), + str_state ? str_state : "(unknown)"); + } + + return state; +} + +static gboolean +ipw_rfkill_state_work (gpointer user_data) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (user_data); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + RfKillState old_state; + + old_state = priv->ipw_rfkill_state; + priv->ipw_rfkill_state = nm_device_wifi_get_ipw_rfkill_state (self); + if (priv->ipw_rfkill_state != old_state) + g_object_notify (G_OBJECT (self), NM_DEVICE_WIFI_IPW_RFKILL_STATE); + + return TRUE; +} + +/* + * nm_device_wifi_update_signal_strength + * + * Update the device's idea of the strength of its connection to the + * current access point. + * + */ +static void +nm_device_wifi_update_signal_strength (NMDeviceWifi *self, + NMAccessPoint *ap) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + const char *iface = nm_device_get_iface (NM_DEVICE (self)); + int fd, percent = -1; + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd >= 0) { + struct iwreq wrq; + struct iw_statistics stats; + + memset (&stats, 0, sizeof (stats)); + + wrq.u.data.pointer = &stats; + wrq.u.data.length = sizeof (stats); + wrq.u.data.flags = 1; /* Clear updated flag */ + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + + if (ioctl (fd, SIOCGIWSTATS, &wrq) == 0) + percent = wireless_qual_to_percent (&stats.qual, &priv->max_qual); + close (fd); + } + + /* Try to smooth out the strength. Atmel cards, for example, will give no strength + * one second and normal strength the next. + */ + if (percent >= 0 || ++priv->invalid_strength_counter > 3) { + nm_ap_set_strength (ap, (gint8) percent); + priv->invalid_strength_counter = 0; + } +} + + +static gboolean +wireless_get_range (NMDeviceWifi *self, + struct iw_range *range, + guint32 *response_len) +{ + int fd, i = 26; + gboolean success = FALSE; + const char *iface; + struct iwreq wrq; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (self), FALSE); + g_return_val_if_fail (range != NULL, FALSE); + + iface = nm_device_get_iface (NM_DEVICE (self)); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_HW, "(%s): couldn't open control socket.", iface); + return FALSE; + } + + memset (&wrq, 0, sizeof (struct iwreq)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + wrq.u.data.pointer = (caddr_t) range; + wrq.u.data.length = sizeof (struct iw_range); + + /* Need to give some drivers time to recover after suspend/resume + * (ex ipw3945 takes a few seconds to talk to its regulatory daemon; + * see rh bz#362421) + */ + while (i-- > 0) { + if (ioctl (fd, SIOCGIWRANGE, &wrq) == 0) { + if (response_len) + *response_len = wrq.u.data.length; + success = TRUE; + break; + } else if (errno != EAGAIN) { + nm_log_err (LOGD_HW | LOGD_WIFI, + "(%s): couldn't get driver range information (%d).", + iface, errno); + break; + } + + g_usleep (G_USEC_PER_SEC / 4); + } + + if (i <= 0) { + nm_log_warn (LOGD_HW | LOGD_WIFI, + "(%s): driver took too long to respond to IWRANGE query.", + iface); + } + + close (fd); + return success; +} + +static guint32 +real_get_generic_capabilities (NMDevice *dev) +{ + int fd, err; + guint32 caps = NM_DEVICE_CAP_NONE, response_len = 0; + struct iwreq wrq; + struct iw_range range; + const char *iface = nm_device_get_iface (dev); + gboolean success; + + memset (&range, 0, sizeof (struct iw_range)); + success = wireless_get_range (NM_DEVICE_WIFI (dev), &range, &response_len); + if (!success) + return NM_DEVICE_CAP_NONE; + + /* Check for Wireless Extensions support >= 16 for wireless devices */ + if ((response_len < 300) || (range.we_version_compiled < 16)) { + nm_log_err (LOGD_HW | LOGD_WIFI, + "(%s): driver's Wireless Extensions version (%d) is too old.", + iface, range.we_version_compiled); + return NM_DEVICE_CAP_NONE; + } + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_HW, "(%s): couldn't open control socket.", iface); + goto out; + } + + /* Cards that don't scan aren't supported */ + memset (&wrq, 0, sizeof (struct iwreq)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + err = ioctl (fd, SIOCSIWSCAN, &wrq); + close (fd); + if ((err < 0) && (errno == EOPNOTSUPP)) + caps = NM_DEVICE_CAP_NONE; + else + caps |= NM_DEVICE_CAP_NM_SUPPORTED; + +out: + return caps; +} + +#define WPA_CAPS (NM_WIFI_DEVICE_CAP_CIPHER_TKIP | \ + NM_WIFI_DEVICE_CAP_CIPHER_CCMP | \ + NM_WIFI_DEVICE_CAP_WPA | \ + NM_WIFI_DEVICE_CAP_RSN) + +static guint32 +get_wireless_capabilities (NMDeviceWifi *self, + iwrange * range, + guint32 data_len) +{ + guint32 minlen; + guint32 caps = NM_WIFI_DEVICE_CAP_NONE; + const char * iface; + + g_return_val_if_fail (self != NULL, NM_WIFI_DEVICE_CAP_NONE); + g_return_val_if_fail (range != NULL, NM_WIFI_DEVICE_CAP_NONE); + + iface = nm_device_get_iface (NM_DEVICE (self)); + + minlen = ((char *) &range->enc_capa) - (char *) range + sizeof (range->enc_capa); + + /* All drivers should support WEP by default */ + caps |= NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104; + + if ((data_len >= minlen) && range->we_version_compiled >= 18) { + if (range->enc_capa & IW_ENC_CAPA_CIPHER_TKIP) + caps |= NM_WIFI_DEVICE_CAP_CIPHER_TKIP; + + if (range->enc_capa & IW_ENC_CAPA_CIPHER_CCMP) + caps |= NM_WIFI_DEVICE_CAP_CIPHER_CCMP; + + if (range->enc_capa & IW_ENC_CAPA_WPA) + caps |= NM_WIFI_DEVICE_CAP_WPA; + + if (range->enc_capa & IW_ENC_CAPA_WPA2) + caps |= NM_WIFI_DEVICE_CAP_RSN; + + /* Check for cipher support but not WPA support */ + if ( (caps & (NM_WIFI_DEVICE_CAP_CIPHER_TKIP | NM_WIFI_DEVICE_CAP_CIPHER_CCMP)) + && !(caps & (NM_WIFI_DEVICE_CAP_WPA | NM_WIFI_DEVICE_CAP_RSN))) { + nm_log_warn (LOGD_WIFI, "%s: device supports WPA ciphers but not WPA protocol; " + "WPA unavailable.", iface); + caps &= ~WPA_CAPS; + } + + /* Check for WPA support but not cipher support */ + if ( (caps & (NM_WIFI_DEVICE_CAP_WPA | NM_WIFI_DEVICE_CAP_RSN)) + && !(caps & (NM_WIFI_DEVICE_CAP_CIPHER_TKIP | NM_WIFI_DEVICE_CAP_CIPHER_CCMP))) { + nm_log_warn (LOGD_WIFI, "%s: device supports WPA protocol but not WPA ciphers; " + "WPA unavailable.", iface); + caps &= ~WPA_CAPS; + } + } + + return caps; +} + + +static guint32 iw_freq_to_uint32 (struct iw_freq *freq) +{ + if (freq->e == 0) { + /* Some drivers report channel not frequency. Convert to a + * frequency; but this assumes that the device is in b/g mode. + */ + if ((freq->m >= 1) && (freq->m <= 13)) + return 2407 + (5 * freq->m); + else if (freq->m == 14) + return 2484; + } + + return (guint32) (((double) freq->m) * pow (10, freq->e) / 1000000); +} + + +/* Until a new wireless-tools comes out that has the defs and the structure, + * need to copy them here. + */ +/* Scan capability flags - in (struct iw_range *)->scan_capa */ +#define NM_IW_SCAN_CAPA_NONE 0x00 +#define NM_IW_SCAN_CAPA_ESSID 0x01 + +struct iw_range_with_scan_capa +{ + guint32 throughput; + guint32 min_nwid; + guint32 max_nwid; + guint16 old_num_channels; + guint8 old_num_frequency; + + guint8 scan_capa; +/* don't need the rest... */ +}; + + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + GObjectClass *klass; + NMDeviceWifi *self; + NMDeviceWifiPrivate *priv; + struct iw_range range; + struct iw_range_with_scan_capa *scan_capa_range; + guint32 response_len = 0; + gboolean success; + int i; + + klass = G_OBJECT_CLASS (nm_device_wifi_parent_class); + object = klass->constructor (type, n_construct_params, construct_params); + if (!object) + return NULL; + + self = NM_DEVICE_WIFI (object); + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + nm_log_dbg (LOGD_HW | LOGD_WIFI, "(%s): kernel ifindex %d", + nm_device_get_iface (NM_DEVICE (self)), + nm_device_get_ifindex (NM_DEVICE (self))); + + memset (&range, 0, sizeof (struct iw_range)); + success = wireless_get_range (NM_DEVICE_WIFI (object), &range, &response_len); + if (!success) + goto error; + + priv->max_qual.qual = range.max_qual.qual; + priv->max_qual.level = range.max_qual.level; + priv->max_qual.noise = range.max_qual.noise; + priv->max_qual.updated = range.max_qual.updated; + + priv->num_freqs = MIN (range.num_frequency, IW_MAX_FREQUENCIES); + for (i = 0; i < priv->num_freqs; i++) + priv->freqs[i] = iw_freq_to_uint32 (&range.freq[i]); + + priv->we_version = range.we_version_compiled; + + /* Check for the ability to scan specific SSIDs. Until the scan_capa + * field gets added to wireless-tools, need to work around that by casting + * to the custom structure. + */ + scan_capa_range = (struct iw_range_with_scan_capa *) ⦥ + if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) { + priv->has_scan_capa_ssid = TRUE; + nm_log_info (LOGD_HW | LOGD_WIFI, + "(%s): driver supports SSID scans (scan_capa 0x%02X).", + nm_device_get_iface (NM_DEVICE (self)), + scan_capa_range->scan_capa); + } else { + nm_log_info (LOGD_HW | LOGD_WIFI, + "(%s): driver does not support SSID scans (scan_capa 0x%02X).", + nm_device_get_iface (NM_DEVICE (self)), + scan_capa_range->scan_capa); + } + + /* 802.11 wireless-specific capabilities */ + priv->capabilities = get_wireless_capabilities (self, &range, response_len); + + /* Connect to the supplicant manager */ + priv->supplicant.mgr = nm_supplicant_manager_get (); + priv->supplicant.mgr_state_id = g_signal_connect (priv->supplicant.mgr, + "state", + G_CALLBACK (supplicant_mgr_state_cb), + self); + + /* The ipw2x00 drivers don't integrate with the kernel rfkill subsystem until + * 2.6.33. Thus all our nice libgudev magic is useless. So we get to poll. + * + * FIXME: when 2.6.33 comes lands, we can do some sysfs parkour to figure out + * if we need to poll or not by matching /sys/class/net/ethX/device to one + * of the /sys/class/rfkill/rfkillX/device links. If there's a match, we + * don't have to poll. + */ + priv->ipw_rfkill_path = g_strdup_printf ("/sys/class/net/%s/device/rf_kill", + nm_device_get_iface (NM_DEVICE (self))); + if (!g_file_test (priv->ipw_rfkill_path, G_FILE_TEST_IS_REGULAR)) { + g_free (priv->ipw_rfkill_path); + priv->ipw_rfkill_path = NULL; + } + priv->ipw_rfkill_state = nm_device_wifi_get_ipw_rfkill_state (self); + + return object; + +error: + g_object_unref (object); + return NULL; +} + +static gboolean +supplicant_interface_acquire (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + guint id, mgr_state; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (priv->supplicant.mgr != NULL, FALSE); + /* interface already acquired? */ + g_return_val_if_fail (priv->supplicant.iface == NULL, TRUE); + + mgr_state = nm_supplicant_manager_get_state (priv->supplicant.mgr); + g_return_val_if_fail (mgr_state == NM_SUPPLICANT_MANAGER_STATE_IDLE, FALSE); + + priv->supplicant.iface = nm_supplicant_manager_get_iface (priv->supplicant.mgr, + nm_device_get_iface (NM_DEVICE (self)), + TRUE); + if (priv->supplicant.iface == NULL) { + nm_log_err (LOGD_WIFI, "Couldn't initialize supplicant interface for %s.", + nm_device_get_iface (NM_DEVICE (self))); + return FALSE; + } + + id = g_signal_connect (priv->supplicant.iface, + "state", + G_CALLBACK (supplicant_iface_state_cb), + self); + priv->supplicant.iface_state_id = id; + + id = g_signal_connect (priv->supplicant.iface, + "scanned-ap", + G_CALLBACK (supplicant_iface_scanned_ap_cb), + self); + priv->supplicant.iface_scanned_ap_id = id; + + id = g_signal_connect (priv->supplicant.iface, + "scan-req-result", + G_CALLBACK (supplicant_iface_scan_request_result_cb), + self); + priv->supplicant.iface_scan_request_result_id = id; + + id = g_signal_connect (priv->supplicant.iface, + "scan-results", + G_CALLBACK (supplicant_iface_scan_results_cb), + self); + priv->supplicant.iface_scan_results_id = id; + + id = g_signal_connect (priv->supplicant.iface, + "connection-state", + G_CALLBACK (supplicant_iface_connection_state_cb), + self); + priv->supplicant.iface_con_state_id = id; + + id = g_signal_connect (priv->supplicant.iface, + "notify::scanning", + G_CALLBACK (supplicant_iface_notify_scanning_cb), + self); + priv->supplicant.iface_notify_scanning_id = id; + + return TRUE; +} + +static void +finish_supplicant_task (SupplicantStateTask *task, gboolean remove_source) +{ + NMDeviceWifi *self = task->self; + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + /* idle/timeout handlers should pass FALSE for remove_source, since they + * will tell glib to remove their source from the mainloop by returning + * FALSE when they exit. When called from this NMDevice's dispose handler, + * remove_source should be TRUE to cancel all outstanding idle/timeout + * handlers asynchronously. + */ + if (task->source_id && remove_source) + g_source_remove (task->source_id); + + if (task->mgr_task) + priv->supplicant.mgr_tasks = g_slist_remove (priv->supplicant.mgr_tasks, task); + else + priv->supplicant.iface_tasks = g_slist_remove (priv->supplicant.iface_tasks, task); + + memset (task, 0, sizeof (SupplicantStateTask)); + g_slice_free (SupplicantStateTask, task); +} + +static void +remove_supplicant_interface_error_handler (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + if (!priv->supplicant.iface) + return; + + if (priv->supplicant.iface_error_id > 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_error_id); + priv->supplicant.iface_error_id = 0; + } + + if (priv->supplicant.iface_con_error_cb_id > 0) { + g_source_remove (priv->supplicant.iface_con_error_cb_id); + priv->supplicant.iface_con_error_cb_id = 0; + } +} + +static void +supplicant_interface_release (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv; + + g_return_if_fail (self != NULL); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + cancel_pending_scan (self); + + /* Reset the scan interval to be pretty frequent when disconnected */ + priv->scan_interval = SCAN_INTERVAL_MIN + SCAN_INTERVAL_STEP; + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): reset scanning interval to %d seconds", + nm_device_get_iface (NM_DEVICE (self))); + + remove_supplicant_interface_error_handler (self); + + /* Clean up all pending supplicant interface state idle tasks */ + while (priv->supplicant.iface_tasks) + finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.iface_tasks->data, TRUE); + + if (priv->supplicant.iface_state_id > 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_state_id); + priv->supplicant.iface_state_id = 0; + } + + if (priv->supplicant.iface_scanned_ap_id > 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_scanned_ap_id); + priv->supplicant.iface_scanned_ap_id = 0; + } + + if (priv->supplicant.iface_scan_request_result_id > 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_scan_request_result_id); + priv->supplicant.iface_scan_request_result_id = 0; + } + + if (priv->supplicant.iface_scan_results_id > 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_scan_results_id); + priv->supplicant.iface_scan_results_id = 0; + } + + if (priv->supplicant.iface_con_state_id > 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_con_state_id); + priv->supplicant.iface_con_state_id = 0; + } + + if (priv->supplicant.iface_notify_scanning_id > 0) { + g_signal_handler_disconnect (priv->supplicant.iface, priv->supplicant.iface_notify_scanning_id); + priv->supplicant.iface_notify_scanning_id = 0; + } + + if (priv->supplicant.iface) { + /* Tell the supplicant to disconnect from the current AP */ + nm_supplicant_interface_disconnect (priv->supplicant.iface); + + nm_supplicant_manager_release_iface (priv->supplicant.mgr, priv->supplicant.iface); + priv->supplicant.iface = NULL; + } +} + +static NMAccessPoint * +get_active_ap (NMDeviceWifi *self, + NMAccessPoint *ignore_ap, + gboolean match_hidden) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + const char *iface = nm_device_get_iface (NM_DEVICE (self)); + struct ether_addr bssid; + const GByteArray *ssid; + GSList *iter; + int i = 0; + NMAccessPoint *match_nofreq = NULL; + gboolean found_a_band = FALSE; + gboolean found_bg_band = FALSE; + NM80211Mode devmode; + guint32 devfreq; + + nm_device_wifi_get_bssid (self, &bssid); + nm_log_dbg (LOGD_WIFI, "(%s): active BSSID: %02x:%02x:%02x:%02x:%02x:%02x", + iface, + bssid.ether_addr_octet[0], bssid.ether_addr_octet[1], + bssid.ether_addr_octet[2], bssid.ether_addr_octet[3], + bssid.ether_addr_octet[4], bssid.ether_addr_octet[5]); + + if (!nm_ethernet_address_is_valid (&bssid)) + return NULL; + + ssid = nm_device_wifi_get_ssid (self); + nm_log_dbg (LOGD_WIFI, "(%s): active SSID: %s%s%s", + iface, + ssid ? "'" : "", + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)", + ssid ? "'" : ""); + + devmode = nm_device_wifi_get_mode (self); + devfreq = nm_device_wifi_get_frequency (self); + + /* When matching hidden APs, do a second pass that ignores the SSID check, + * because NM might not yet know the SSID of the hidden AP in the scan list + * and therefore it won't get matched the first time around. + */ + while (i++ < (match_hidden ? 2 : 1)) { + nm_log_dbg (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)) { + NMAccessPoint *ap = NM_AP (iter->data); + const struct ether_addr *ap_bssid = nm_ap_get_address (ap); + const GByteArray *ap_ssid = nm_ap_get_ssid (ap); + NM80211Mode apmode; + guint32 apfreq; + + nm_log_dbg (LOGD_WIFI, " AP: %s%s%s %02x:%02x:%02x:%02x:%02x:%02x", + ap_ssid ? "'" : "", + ap_ssid ? nm_utils_escape_ssid (ap_ssid->data, ap_ssid->len) : "(none)", + ap_ssid ? "'" : "", + ap_bssid->ether_addr_octet[0], ap_bssid->ether_addr_octet[1], + ap_bssid->ether_addr_octet[2], ap_bssid->ether_addr_octet[3], + ap_bssid->ether_addr_octet[4], ap_bssid->ether_addr_octet[5]); + + if (ignore_ap && (ap == ignore_ap)) { + nm_log_dbg (LOGD_WIFI, " ignored"); + continue; + } + + if (memcmp (bssid.ether_addr_octet, ap_bssid->ether_addr_octet, ETH_ALEN)) { + nm_log_dbg (LOGD_WIFI, " BSSID mismatch"); + continue; + } + + if ((i == 0) && !nm_utils_same_ssid (ssid, ap_ssid, TRUE)) { + nm_log_dbg (LOGD_WIFI, " SSID mismatch"); + continue; + } + + apmode = nm_ap_get_mode (ap); + if (devmode != apmode) { + nm_log_dbg (LOGD_WIFI, " mode mismatch (device %d, ap %d)", + devmode, apmode); + continue; + } + + apfreq = nm_ap_get_freq (ap); + if (devfreq != apfreq) { + nm_log_dbg (LOGD_WIFI, " frequency mismatch (device %u, ap %u)", + devfreq, apfreq); + + if (match_nofreq == NULL) + match_nofreq = ap; + + if (apfreq > 4000) + found_a_band = TRUE; + else if (apfreq > 2000) + found_bg_band = TRUE; + continue; + } + + // FIXME: handle security settings here too + nm_log_dbg (LOGD_WIFI, " matched"); + return ap; + } + } + + /* Some proprietary drivers (wl.o) report tuned frequency (like when + * scanning) instead of the associated AP's frequency. This is a great + * example of how WEXT is underspecified. We use frequency to find the + * active AP in the scan list because some configurations use the same + * SSID/BSSID on the 2GHz and 5GHz bands simultaneously, and we need to + * make sure we get the right AP in the right band. This configuration + * is uncommon though, and the frequency check penalizes closed drivers we + * can't fix. Because we're not total dicks, ignore the frequency condition + * if the associated BSSID/SSID exists only in one band since that's most + * likely the AP we want. + */ + if (match_nofreq && (found_a_band != found_bg_band)) { + const struct ether_addr *ap_bssid = nm_ap_get_address (match_nofreq); + const GByteArray *ap_ssid = nm_ap_get_ssid (match_nofreq); + + nm_log_dbg (LOGD_WIFI, " matched %s%s%s %02x:%02x:%02x:%02x:%02x:%02x", + ap_ssid ? "'" : "", + ap_ssid ? nm_utils_escape_ssid (ap_ssid->data, ap_ssid->len) : "(none)", + ap_ssid ? "'" : "", + ap_bssid->ether_addr_octet[0], ap_bssid->ether_addr_octet[1], + ap_bssid->ether_addr_octet[2], ap_bssid->ether_addr_octet[3], + ap_bssid->ether_addr_octet[4], ap_bssid->ether_addr_octet[5]); + + return match_nofreq; + } + + nm_log_dbg (LOGD_WIFI, " No matching AP found."); + return NULL; +} + +static void +set_current_ap (NMDeviceWifi *self, NMAccessPoint *new_ap) +{ + NMDeviceWifiPrivate *priv; + char *old_path = NULL; + NMAccessPoint *old_ap; + + g_return_if_fail (NM_IS_DEVICE_WIFI (self)); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + old_ap = priv->current_ap; + + if (old_ap) { + old_path = g_strdup (nm_ap_get_dbus_path (old_ap)); + priv->current_ap = NULL; + } + + if (new_ap) { + priv->current_ap = g_object_ref (new_ap); + + /* Move the current AP to the front of the scan list. Since we + * do a lot of searches looking for the current AP, it saves + * time to have it in front. + */ + priv->ap_list = g_slist_remove (priv->ap_list, new_ap); + priv->ap_list = g_slist_prepend (priv->ap_list, new_ap); + } + + /* Unref old AP here to ensure object lives if new_ap == old_ap */ + if (old_ap) + g_object_unref (old_ap); + + /* Only notify if it's really changed */ + if ( (!old_path && new_ap) + || (old_path && !new_ap) + || (old_path && new_ap && strcmp (old_path, nm_ap_get_dbus_path (new_ap)))) + g_object_notify (G_OBJECT (self), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT); + + g_free (old_path); +} + +static void +periodic_update (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMAccessPoint *new_ap; + guint32 new_rate; + + /* In IBSS mode, most newer firmware/drivers do "BSS coalescing" where + * multiple IBSS stations using the same SSID will eventually switch to + * using the same BSSID to avoid network segmentation. When this happens, + * the card's reported BSSID will change, but the the new BSS may not + * be in the scan list, since scanning isn't done in ad-hoc mode for + * various reasons. So pull the BSSID from the card and update the + * current AP with it, if the current AP is adhoc. + */ + if (priv->current_ap && (nm_ap_get_mode (priv->current_ap) == NM_802_11_MODE_ADHOC)) { + struct ether_addr bssid = { {0x0, 0x0, 0x0, 0x0, 0x0, 0x0} }; + + nm_device_wifi_get_bssid (self, &bssid); + /* 0x02 means "locally administered" and should be OR-ed into + * the first byte of IBSS BSSIDs. + */ + if ( (bssid.ether_addr_octet[0] & 0x02) + && nm_ethernet_address_is_valid (&bssid)) + nm_ap_set_address (priv->current_ap, &bssid); + } + + new_ap = get_active_ap (self, NULL, FALSE); + if (new_ap) + nm_device_wifi_update_signal_strength (self, new_ap); + + if ((new_ap || priv->current_ap) && (new_ap != priv->current_ap)) { + const struct ether_addr *new_bssid = NULL; + const GByteArray *new_ssid = NULL; + const struct ether_addr *old_bssid = NULL; + const GByteArray *old_ssid = NULL; + char *old_addr = NULL, *new_addr = NULL; + + if (new_ap) { + new_bssid = nm_ap_get_address (new_ap); + new_addr = nm_ether_ntop (new_bssid); + new_ssid = nm_ap_get_ssid (new_ap); + } + + if (priv->current_ap) { + old_bssid = nm_ap_get_address (priv->current_ap); + old_addr = nm_ether_ntop (old_bssid); + old_ssid = nm_ap_get_ssid (priv->current_ap); + } + + nm_log_info (LOGD_WIFI, "(%s): roamed from BSSID %s (%s) to %s (%s)", + nm_device_get_iface (NM_DEVICE (self)), + old_addr ? old_addr : "(none)", + old_ssid ? nm_utils_escape_ssid (old_ssid->data, old_ssid->len) : "(none)", + new_addr ? new_addr : "(none)", + new_ssid ? nm_utils_escape_ssid (new_ssid->data, new_ssid->len) : "(none)"); + g_free (old_addr); + g_free (new_addr); + + set_current_ap (self, new_ap); + } + + new_rate = nm_device_wifi_get_bitrate (self); + if (new_rate != priv->rate) { + priv->rate = new_rate; + g_object_notify (G_OBJECT (self), NM_DEVICE_WIFI_BITRATE); + } +} + +/* + * nm_device_wifi_periodic_update + * + * Periodically update device statistics. + * + */ +static gboolean +nm_device_wifi_periodic_update (gpointer data) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (data); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMDeviceState state; + + /* BSSID and signal strength have meaningful values only if the device + is activated and not scanning */ + state = nm_device_get_state (NM_DEVICE (self)); + if (state != NM_DEVICE_STATE_ACTIVATED) + goto out; + + if (nm_supplicant_interface_get_scanning (priv->supplicant.iface)) + goto out; + + periodic_update (self); + +out: + return TRUE; +} + +static gboolean +real_hw_is_up (NMDevice *device) +{ + return nm_system_device_is_up (device); +} + +static gboolean +real_hw_bring_up (NMDevice *device, gboolean *no_firmware) +{ + if (!NM_DEVICE_WIFI_GET_PRIVATE (device)->enabled) + return FALSE; + + return nm_system_device_set_up_down (device, TRUE, no_firmware); +} + +static void +real_hw_take_down (NMDevice *dev) +{ + nm_system_device_set_up_down (dev, FALSE, NULL); +} + +static gboolean +real_is_up (NMDevice *device) +{ + if (!NM_DEVICE_WIFI_GET_PRIVATE (device)->periodic_source_id) + return FALSE; + + return TRUE; +} + +static gboolean +real_bring_up (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + priv->periodic_source_id = g_timeout_add_seconds (6, nm_device_wifi_periodic_update, self); + return TRUE; +} + +static void +access_point_removed (NMDeviceWifi *device, NMAccessPoint *ap) +{ + g_signal_emit (device, signals[ACCESS_POINT_REMOVED], 0, ap); +} + +static void +remove_all_aps (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + /* Remove outdated APs */ + while (g_slist_length (priv->ap_list)) { + NMAccessPoint *ap = NM_AP (priv->ap_list->data); + + access_point_removed (self, ap); + priv->ap_list = g_slist_remove (priv->ap_list, ap); + g_object_unref (ap); + } + g_slist_free (priv->ap_list); + priv->ap_list = NULL; +} + +static void +real_take_down (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + if (priv->periodic_source_id) { + g_source_remove (priv->periodic_source_id); + priv->periodic_source_id = 0; + } + + cleanup_association_attempt (self, TRUE); + set_current_ap (self, NULL); + remove_all_aps (self); +} + +static void +real_deactivate_quickly (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMAccessPoint *orig_ap = nm_device_wifi_get_activation_ap (self); + + cleanup_association_attempt (self, TRUE); + + set_current_ap (self, NULL); + priv->rate = 0; + + /* If the AP is 'fake', i.e. it wasn't actually found from + * a scan but the user tried to connect to it manually (maybe it + * was non-broadcasting or something) get rid of it, because 'fake' + * APs should only live for as long as we're connected to them. Fixes + * a bug where user-created Ad-Hoc APs are never removed from the scan + * list, because scanning is disabled while in Ad-Hoc mode (for stability), + * and thus the AP culling never happens. (bgo #569241) + */ + if (orig_ap && nm_ap_get_fake (orig_ap)) { + access_point_removed (self, orig_ap); + priv->ap_list = g_slist_remove (priv->ap_list, orig_ap); + g_object_unref (orig_ap); + } +} + +static void +real_deactivate (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + + nm_device_wifi_set_mode (self, NM_802_11_MODE_INFRA); + /* FIXME: Should we reset the scan interval here? */ +/* nm_device_wifi_set_scan_interval (app_data, self, NM_WIRELESS_SCAN_INTERVAL_ACTIVE); */ +} + +static gboolean +real_check_connection_compatible (NMDevice *device, + NMConnection *connection, + GError **error) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (device); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + const GByteArray *mac; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_WIRELESS_SETTING_NAME)) { + g_set_error (error, + NM_WIFI_ERROR, NM_WIFI_ERROR_CONNECTION_NOT_WIRELESS, + "The connection was not a WiFi connection."); + return FALSE; + } + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + if (!s_wireless) { + g_set_error (error, + NM_WIFI_ERROR, NM_WIFI_ERROR_CONNECTION_INVALID, + "The connection was not a valid WiFi connection."); + return FALSE; + } + + mac = nm_setting_wireless_get_mac_address (s_wireless); + if (mac && memcmp (mac->data, &(priv->hw_addr.ether_addr_octet), ETH_ALEN)) { + g_set_error (error, + NM_WIFI_ERROR, NM_WIFI_ERROR_CONNECTION_INCOMPATIBLE, + "The connection's MAC address did not match this device."); + return FALSE; + } + + // FIXME: check channel/freq/band against bands the hardware supports + // FIXME: check encryption against device capabilities + // FIXME: check bitrate against device capabilities + + return TRUE; +} + +static gboolean +real_is_available (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMSupplicantInterface *sup_iface; + guint32 state; + + if (!priv->enabled) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because not enabled", + nm_device_get_iface (dev)); + return FALSE; + } + + sup_iface = priv->supplicant.iface; + if (!sup_iface) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because supplicant not running", + nm_device_get_iface (dev)); + return FALSE; + } + + state = nm_supplicant_interface_get_state (sup_iface); + if (state != NM_SUPPLICANT_INTERFACE_STATE_READY) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because supplicant interface not ready", + nm_device_get_iface (dev)); + return FALSE; + } + + return TRUE; +} + +static NMConnection * +real_get_best_auto_connection (NMDevice *dev, + GSList *connections, + char **specific_object) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + GSList *iter, *ap_iter; + + for (iter = connections; iter; iter = g_slist_next (iter)) { + NMConnection *connection = NM_CONNECTION (iter->data); + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + const GByteArray *mac; + NMSettingIP4Config *s_ip4; + const char *method = NULL; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con == NULL) + continue; + if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_WIRELESS_SETTING_NAME)) + continue; + if (!nm_setting_connection_get_autoconnect (s_con)) + continue; + + s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + if (!s_wireless) + continue; + + mac = nm_setting_wireless_get_mac_address (s_wireless); + if (mac && memcmp (mac->data, priv->hw_addr.ether_addr_octet, ETH_ALEN)) + continue; + + /* Use the connection if it's a shared connection */ + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + method = nm_setting_ip4_config_get_method (s_ip4); + + if (s_ip4 && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) + return connection; + + for (ap_iter = priv->ap_list; ap_iter; ap_iter = g_slist_next (ap_iter)) { + NMAccessPoint *ap = NM_AP (ap_iter->data); + + if (nm_ap_check_compatible (ap, connection)) { + /* All good; connection is usable */ + *specific_object = (char *) nm_ap_get_dbus_path (ap); + return connection; + } + } + } + return NULL; +} + +/* + * nm_device_wifi_get_address + * + * Get a device's hardware address + * + */ +void +nm_device_wifi_get_address (NMDeviceWifi *self, + struct ether_addr *addr) +{ + NMDeviceWifiPrivate *priv; + + g_return_if_fail (self != NULL); + g_return_if_fail (addr != NULL); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + memcpy (addr, &(priv->hw_addr), sizeof (struct ether_addr)); +} + +static void +nm_device_wifi_ap_list_print (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + GSList * elt; + int i = 0; + + g_return_if_fail (NM_IS_DEVICE_WIFI (self)); + + nm_log_dbg (LOGD_WIFI_SCAN, "Current AP list:"); + for (elt = priv->ap_list; elt; elt = g_slist_next (elt), i++) { + NMAccessPoint * ap = NM_AP (elt->data); + nm_ap_print_self (ap, "AP: "); + } + nm_log_dbg (LOGD_WIFI_SCAN, "Current AP list: done"); +} + +static gboolean +impl_device_get_access_points (NMDeviceWifi *self, + GPtrArray **aps, + GError **err) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + GSList *elt; + + *aps = g_ptr_array_new (); + + for (elt = priv->ap_list; elt; elt = g_slist_next (elt)) { + NMAccessPoint * ap = NM_AP (elt->data); + + if (nm_ap_get_ssid (ap)) + g_ptr_array_add (*aps, g_strdup (nm_ap_get_dbus_path (ap))); + } + return TRUE; +} + +/* + * nm_device_get_mode + * + * Get managed/infrastructure/adhoc mode on a device + * + */ +NM80211Mode +nm_device_wifi_get_mode (NMDeviceWifi *self) +{ + int fd; + NM80211Mode mode = NM_802_11_MODE_UNKNOWN; + const char *iface; + struct iwreq wrq; + + g_return_val_if_fail (self != NULL, NM_802_11_MODE_UNKNOWN); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) + goto out; + + memset (&wrq, 0, sizeof (struct iwreq)); + iface = nm_device_get_iface (NM_DEVICE (self)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + + if (ioctl (fd, SIOCGIWMODE, &wrq) == 0) { + switch (wrq.u.mode) { + case IW_MODE_ADHOC: + mode = NM_802_11_MODE_ADHOC; + break; + case IW_MODE_INFRA: + mode = NM_802_11_MODE_INFRA; + break; + default: + break; + } + } else { + if (errno != ENODEV) { + nm_log_warn (LOGD_HW | LOGD_WIFI, + "(%s): error %d getting card mode", + iface, strerror (errno)); + } + } + close (fd); + +out: + return mode; +} + + +/* + * nm_device_wifi_set_mode + * + * Set managed/infrastructure/adhoc mode on a device + * + */ +gboolean +nm_device_wifi_set_mode (NMDeviceWifi *self, const NM80211Mode mode) +{ + int fd; + const char *iface; + gboolean success = FALSE; + struct iwreq wrq; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail ((mode == NM_802_11_MODE_INFRA) || (mode == NM_802_11_MODE_ADHOC), FALSE); + + if (nm_device_wifi_get_mode (self) == mode) + return TRUE; + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) + goto out; + + memset (&wrq, 0, sizeof (struct iwreq)); + switch (mode) { + case NM_802_11_MODE_ADHOC: + wrq.u.mode = IW_MODE_ADHOC; + break; + case NM_802_11_MODE_INFRA: + wrq.u.mode = IW_MODE_INFRA; + break; + default: + goto out; + } + + iface = nm_device_get_iface (NM_DEVICE (self)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + + if (ioctl (fd, SIOCSIWMODE, &wrq) < 0) { + if (errno != ENODEV) { + nm_log_err (LOGD_HW | LOGD_WIFI, + "(%s): error setting mode %d", + iface, mode, strerror (errno)); + } + } else + success = TRUE; + close (fd); + +out: + return success; +} + + +/* + * nm_device_wifi_get_frequency + * + * Get current frequency + * + */ +static guint32 +nm_device_wifi_get_frequency (NMDeviceWifi *self) +{ + int fd; + guint32 freq = 0; + const char *iface; + struct iwreq wrq; + + g_return_val_if_fail (self != NULL, 0); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) + return 0; + + memset (&wrq, 0, sizeof (struct iwreq)); + iface = nm_device_get_iface (NM_DEVICE (self)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + + if (ioctl (fd, SIOCGIWFREQ, &wrq) < 0) { + nm_log_warn (LOGD_HW | LOGD_WIFI, + "(%s): error getting frequency: %s", + iface, strerror (errno)); + } else + freq = iw_freq_to_uint32 (&wrq.u.freq); + + close (fd); + return freq; +} + +/* + * wireless_stats_to_percent + * + * Convert an iw_stats structure from a scan or the card into + * a magical signal strength percentage. + * + */ +static int +wireless_qual_to_percent (const struct iw_quality *qual, + const struct iw_quality *max_qual) +{ + int percent = -1; + int level_percent = -1; + + g_return_val_if_fail (qual != NULL, -1); + g_return_val_if_fail (max_qual != NULL, -1); + + nm_log_dbg (LOGD_WIFI, + "QL: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X ** MAX: qual %d/%u/0x%X, level %d/%u/0x%X, noise %d/%u/0x%X, updated: 0x%X", + (__s8) qual->qual, qual->qual, qual->qual, + (__s8) qual->level, qual->level, qual->level, + (__s8) qual->noise, qual->noise, qual->noise, + qual->updated, + (__s8) max_qual->qual, max_qual->qual, max_qual->qual, + (__s8) max_qual->level, max_qual->level, max_qual->level, + (__s8) max_qual->noise, max_qual->noise, max_qual->noise, + max_qual->updated); + + /* Try using the card's idea of the signal quality first as long as it tells us what the max quality is. + * Drivers that fill in quality values MUST treat them as percentages, ie the "Link Quality" MUST be + * bounded by 0 and max_qual->qual, and MUST change in a linear fashion. Within those bounds, drivers + * are free to use whatever they want to calculate "Link Quality". + */ + if ((max_qual->qual != 0) && !(max_qual->updated & IW_QUAL_QUAL_INVALID) && !(qual->updated & IW_QUAL_QUAL_INVALID)) + percent = (int)(100 * ((double)qual->qual / (double)max_qual->qual)); + + /* If the driver doesn't specify a complete and valid quality, we have two options: + * + * 1) dBm: driver must specify max_qual->level = 0, and have valid values for + * qual->level and (qual->noise OR max_qual->noise) + * 2) raw RSSI: driver must specify max_qual->level > 0, and have valid values for + * qual->level and max_qual->level + * + * This is the WEXT spec. If this interpretation is wrong, I'll fix it. Otherwise, + * If drivers don't conform to it, they are wrong and need to be fixed. + */ + + if ( (max_qual->level == 0) && !(max_qual->updated & IW_QUAL_LEVEL_INVALID) /* Valid max_qual->level == 0 */ + && !(qual->updated & IW_QUAL_LEVEL_INVALID) /* Must have valid qual->level */ + && ( ((max_qual->noise > 0) && !(max_qual->updated & IW_QUAL_NOISE_INVALID)) /* Must have valid max_qual->noise */ + || ((qual->noise > 0) && !(qual->updated & IW_QUAL_NOISE_INVALID))) /* OR valid qual->noise */ + ) { + /* Absolute power values (dBm) */ + + /* Reasonable fallbacks for dumb drivers that don't specify either level. */ + #define FALLBACK_NOISE_FLOOR_DBM -90 + #define FALLBACK_SIGNAL_MAX_DBM -20 + int max_level = FALLBACK_SIGNAL_MAX_DBM; + int noise = FALLBACK_NOISE_FLOOR_DBM; + int level = qual->level - 0x100; + + level = CLAMP (level, FALLBACK_NOISE_FLOOR_DBM, FALLBACK_SIGNAL_MAX_DBM); + + if ((qual->noise > 0) && !(qual->updated & IW_QUAL_NOISE_INVALID)) + noise = qual->noise - 0x100; + else if ((max_qual->noise > 0) && !(max_qual->updated & IW_QUAL_NOISE_INVALID)) + noise = max_qual->noise - 0x100; + noise = CLAMP (noise, FALLBACK_NOISE_FLOOR_DBM, FALLBACK_SIGNAL_MAX_DBM); + + /* A sort of signal-to-noise ratio calculation */ + level_percent = (int)(100 - 70 *( + ((double)max_level - (double)level) / + ((double)max_level - (double)noise))); + nm_log_dbg (LOGD_WIFI, "QL1: level_percent is %d. max_level %d, level %d, noise_floor %d.", + level_percent, max_level, level, noise); + } else if ( (max_qual->level != 0) + && !(max_qual->updated & IW_QUAL_LEVEL_INVALID) /* Valid max_qual->level as upper bound */ + && !(qual->updated & IW_QUAL_LEVEL_INVALID)) { + /* Relative power values (RSSI) */ + + int level = qual->level; + + /* Signal level is relavtive (0 -> max_qual->level) */ + level = CLAMP (level, 0, max_qual->level); + level_percent = (int)(100 * ((double)level / (double)max_qual->level)); + nm_log_dbg (LOGD_WIFI, "QL2: level_percent is %d. max_level %d, level %d.", + level_percent, max_qual->level, level); + } else if (percent == -1) { + nm_log_dbg (LOGD_WIFI, "QL: Could not get quality %% value from driver. Driver is probably buggy."); + } + + /* If the quality percent was 0 or doesn't exist, then try to use signal levels instead */ + if ((percent < 1) && (level_percent >= 0)) + percent = level_percent; + + nm_log_dbg (LOGD_WIFI, "QL: Final quality percent is %d (%d).", + percent, CLAMP (percent, 0, 100)); + return (CLAMP (percent, 0, 100)); +} + + +/* + * nm_device_wifi_get_ssid + * + * If a device is wireless, return the ssid that it is attempting + * to use. + */ +const GByteArray * +nm_device_wifi_get_ssid (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv; + int sk; + struct iwreq wrq; + char ssid[IW_ESSID_MAX_SIZE + 2]; + guint32 len; + + g_return_val_if_fail (self != NULL, NULL); + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + sk = socket (AF_INET, SOCK_DGRAM, 0); + if (!sk) { + nm_log_err (LOGD_HW, "couldn't create socket: %d.", errno); + return NULL; + } + + memset (ssid, 0, sizeof (ssid)); + wrq.u.essid.pointer = (caddr_t) &ssid; + wrq.u.essid.length = sizeof (ssid); + wrq.u.essid.flags = 0; + strncpy (wrq.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); + + if (ioctl (sk, SIOCGIWESSID, &wrq) < 0) { + nm_log_err (LOGD_HW | LOGD_WIFI, "(%s): couldn't get SSID: %d", + nm_device_get_iface (NM_DEVICE (self)), errno); + goto out; + } + + if (priv->ssid) { + g_byte_array_free (priv->ssid, TRUE); + priv->ssid = NULL; + } + + len = wrq.u.essid.length; + if (!nm_utils_is_empty_ssid ((guint8 *) ssid, len)) { + /* Some drivers include nul termination in the SSID, so let's + * remove it here before further processing. WE-21 changes this + * to explicitly require the length _not_ to include nul + * termination. */ + if (len > 0 && ssid[len - 1] == '\0' && priv->we_version < 21) + len--; + + priv->ssid = g_byte_array_sized_new (len); + g_byte_array_append (priv->ssid, (const guint8 *) ssid, len); + } + +out: + close (sk); + return priv->ssid; +} + + +/* + * nm_device_wifi_get_bitrate + * + * For wireless devices, get the bitrate to broadcast/receive at. + * Returned value is rate in Kb/s. + * + */ +static guint32 +nm_device_wifi_get_bitrate (NMDeviceWifi *self) +{ + int err = -1, fd; + struct iwreq wrq; + + g_return_val_if_fail (self != NULL, 0); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) + return 0; + + memset (&wrq, 0, sizeof (wrq)); + strncpy (wrq.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); + err = ioctl (fd, SIOCGIWRATE, &wrq); + close (fd); + + return ((err == 0) ? wrq.u.bitrate.value / 1000 : 0); +} + +/* + * nm_device_get_bssid + * + * If a device is wireless, get the access point's ethernet address + * that the card is associated with. + */ +void +nm_device_wifi_get_bssid (NMDeviceWifi *self, + struct ether_addr *bssid) +{ + int fd; + struct iwreq wrq; + + g_return_if_fail (self != NULL); + g_return_if_fail (bssid != NULL); + + memset (bssid, 0, sizeof (struct ether_addr)); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_WIFI, "failed to open control socket."); + return; + } + + memset (&wrq, 0, sizeof (wrq)); + strncpy (wrq.ifr_name, nm_device_get_iface (NM_DEVICE (self)), IFNAMSIZ); + if (ioctl (fd, SIOCGIWAP, &wrq) == 0) + memcpy (bssid->ether_addr_octet, &(wrq.u.ap_addr.sa_data), ETH_ALEN); + + close (fd); +} + + +static gboolean +scanning_allowed (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + guint32 sup_state; + NMActRequest *req; + + g_return_val_if_fail (priv->supplicant.iface != NULL, FALSE); + + switch (nm_device_get_state (NM_DEVICE (self))) { + case NM_DEVICE_STATE_UNKNOWN: + case NM_DEVICE_STATE_UNMANAGED: + case NM_DEVICE_STATE_UNAVAILABLE: + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + /* Don't scan when unusable or activating */ + return FALSE; + case NM_DEVICE_STATE_DISCONNECTED: + case NM_DEVICE_STATE_FAILED: + /* Can always scan when disconnected */ + return TRUE; + case NM_DEVICE_STATE_ACTIVATED: + /* Need to do further checks when activated */ + break; + } + + /* Don't scan if the supplicant is busy */ + sup_state = nm_supplicant_interface_get_connection_state (priv->supplicant.iface); + if ( sup_state == NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING + || sup_state == NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED + || sup_state == NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE + || sup_state == NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE + || nm_supplicant_interface_get_scanning (priv->supplicant.iface)) + return FALSE; + + req = nm_device_get_act_request (NM_DEVICE (self)); + if (req) { + NMConnection *connection; + NMSettingIP4Config *s_ip4; + NMSettingWireless *s_wifi; + const char *ip4_method = NULL; + const GByteArray *bssid; + + /* Don't scan when a shared connection is active; it makes drivers mad */ + connection = nm_act_request_get_connection (req); + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + ip4_method = nm_setting_ip4_config_get_method (s_ip4); + + if (s_ip4 && !strcmp (ip4_method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) + return FALSE; + + /* Don't scan when the connection is locked to a specifc AP, since + * intra-ESS roaming (which requires periodic scanning) isn't being + * used due to the specific AP lock. (bgo #513820) + */ + s_wifi = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + g_assert (s_wifi); + bssid = nm_setting_wireless_get_bssid (s_wifi); + if (bssid && bssid->len == ETH_ALEN) + return FALSE; + } + + return TRUE; +} + +static gboolean +scanning_allowed_accumulator (GSignalInvocationHint *ihint, + GValue *return_accu, + const GValue *handler_return, + gpointer data) +{ + if (!g_value_get_boolean (handler_return)) + g_value_set_boolean (return_accu, FALSE); + return TRUE; +} + +static gboolean +check_scanning_allowed (NMDeviceWifi *self) +{ + GValue instance = { 0, }; + GValue retval = { 0, }; + + g_value_init (&instance, G_TYPE_OBJECT); + g_value_take_object (&instance, self); + + g_value_init (&retval, G_TYPE_BOOLEAN); + g_value_set_boolean (&retval, TRUE); + + /* Use g_signal_emitv() rather than g_signal_emit() to avoid the return + * value being changed if no handlers are connected */ + g_signal_emitv (&instance, signals[SCANNING_ALLOWED], 0, &retval); + + return g_value_get_boolean (&retval); +} + +static gboolean +request_wireless_scan (gpointer user_data) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (user_data); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + gboolean backoff = FALSE; + + if (check_scanning_allowed (self)) { + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scanning requested", + nm_device_get_iface (NM_DEVICE (self))); + + if (nm_supplicant_interface_request_scan (priv->supplicant.iface)) { + /* success */ + backoff = TRUE; + } + } else { + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan requested but not allowed at this time", + nm_device_get_iface (NM_DEVICE (self))); + } + + priv->pending_scan_id = 0; + schedule_scan (self, backoff); + return FALSE; +} + + +/* + * schedule_scan + * + * Schedule a wireless scan. + * + */ +static void +schedule_scan (NMDeviceWifi *self, gboolean backoff) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + GTimeVal now; + + g_get_current_time (&now); + + /* Cancel the pending scan if it would happen later than (now + the scan_interval) */ + if (priv->pending_scan_id) { + if (now.tv_sec + priv->scan_interval < priv->scheduled_scan_time) + cancel_pending_scan (self); + } + + if (!priv->pending_scan_id) { + guint factor = 2, next_scan = priv->scan_interval; + + if ( nm_device_is_activating (NM_DEVICE (self)) + || (nm_device_get_state (NM_DEVICE (self)) == NM_DEVICE_STATE_ACTIVATED)) + factor = 1; + + priv->pending_scan_id = g_timeout_add_seconds (next_scan, + request_wireless_scan, + self); + + priv->scheduled_scan_time = now.tv_sec + priv->scan_interval; + if (backoff && (priv->scan_interval < (SCAN_INTERVAL_MAX / factor))) { + priv->scan_interval += (SCAN_INTERVAL_STEP / factor); + /* Ensure the scan interval will never be less than 20s... */ + priv->scan_interval = MAX(priv->scan_interval, SCAN_INTERVAL_MIN + SCAN_INTERVAL_STEP); + /* ... or more than 120s */ + priv->scan_interval = MIN(priv->scan_interval, SCAN_INTERVAL_MAX); + } else if (!backoff && (priv->scan_interval == 0)) { + /* Invalid combination; would cause continual rescheduling of + * the scan and hog CPU. Reset to something minimally sane. + */ + priv->scan_interval = 5; + } + + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scheduled scan in %d seconds (interval now %d seconds)", + nm_device_get_iface (NM_DEVICE (self)), + next_scan, + priv->scan_interval); + + } +} + + +static void +cancel_pending_scan (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + if (priv->pending_scan_id) { + g_source_remove (priv->pending_scan_id); + priv->pending_scan_id = 0; + } +} + + +static void +supplicant_iface_scan_request_result_cb (NMSupplicantInterface *iface, + gboolean success, + NMDeviceWifi *self) +{ + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan request %s", + nm_device_get_iface (NM_DEVICE (self)), + success ? "successful" : "failed"); + + if (check_scanning_allowed (self)) + schedule_scan (self, TRUE); +} + +static void +supplicant_iface_scan_results_cb (NMSupplicantInterface *iface, + guint32 num_results, + NMDeviceWifi *self) +{ + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): scan results available (%d APs found)", + nm_device_get_iface (NM_DEVICE (self)), + num_results); + if (num_results == 0) { + /* ensure that old APs get culled, which otherwise only + * happens when there are actual scan results to process. + */ + cull_scan_list (self); + nm_device_wifi_ap_list_print (self); + } +} + +static gboolean +is_encrypted (guint32 flags, guint32 wpa_flags, guint32 rsn_flags) +{ + if (flags & NM_802_11_AP_FLAGS_PRIVACY) + return TRUE; + if (wpa_flags & (NM_802_11_AP_SEC_KEY_MGMT_PSK | NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + return TRUE; + if (rsn_flags & (NM_802_11_AP_SEC_KEY_MGMT_PSK | NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + return TRUE; + + return FALSE; +} + +/* + * ap_auth_enforced + * + * Checks whether or not there is an encryption key present for + * this connection, and whether or not the authentication method + * in use will result in an authentication rejection if the key + * is wrong. For example, Ad Hoc mode networks don't have a + * master node and therefore nothing exists to reject the station. + * Similarly, Open System WEP access points don't reject a station + * when the key is wrong. Shared Key WEP access points will. + * + */ +static gboolean +ap_auth_enforced (NMConnection *connection, + NMAccessPoint *ap, + gboolean *encrypted) +{ + guint32 flags, wpa_flags, rsn_flags; + gboolean enforced = FALSE; + + g_return_val_if_fail (NM_IS_AP (ap), FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + g_return_val_if_fail (encrypted != NULL, FALSE); + + flags = nm_ap_get_flags (ap); + wpa_flags = nm_ap_get_wpa_flags (ap); + rsn_flags = nm_ap_get_rsn_flags (ap); + + if (nm_ap_get_mode (ap) == NM_802_11_MODE_ADHOC) + goto out; + + /* Static WEP */ + if ( (flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags == NM_802_11_AP_SEC_NONE) + && (rsn_flags == NM_802_11_AP_SEC_NONE)) { + NMSettingWirelessSecurity *s_wireless_sec; + const char *auth_alg; + + /* No way to tell if the key is wrong with Open System + * auth mode in WEP. Auth is not enforced like Shared Key. + */ + s_wireless_sec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_WIRELESS_SECURITY); + if (s_wireless_sec) { + auth_alg = nm_setting_wireless_security_get_auth_alg (s_wireless_sec); + if (!auth_alg || !strcmp (auth_alg, "open")) + goto out; + } + + enforced = TRUE; + } else if (wpa_flags != NM_802_11_AP_SEC_NONE) { /* WPA */ + enforced = TRUE; + } else if (rsn_flags != NM_802_11_AP_SEC_NONE) { /* WPA2 */ + enforced = TRUE; + } + +out: + *encrypted = is_encrypted (flags, wpa_flags, rsn_flags); + return enforced; +} + + +/**************************************************************************** + * WPA Supplicant control stuff + * + */ + +/* + * merge_scanned_ap + * + * If there is already an entry that matches the BSSID and ESSID of the + * AP to merge, replace that entry with the scanned AP. Otherwise, add + * the scanned AP to the list. + * + * TODO: possibly need to differentiate entries based on security too; i.e. if + * there are two scan results with the same BSSID and SSID but different + * security options? + * + */ +static void +merge_scanned_ap (NMDeviceWifi *self, + NMAccessPoint *merge_ap) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMAccessPoint *found_ap = NULL; + const GByteArray *ssid; + gboolean strict_match = TRUE; + NMAccessPoint *current_ap = NULL; + + /* Let the manager try to fill in the SSID from seen-bssids lists + * if it can + */ + ssid = nm_ap_get_ssid (merge_ap); + if (!ssid || nm_utils_is_empty_ssid (ssid->data, ssid->len)) { + g_signal_emit (self, signals[HIDDEN_AP_FOUND], 0, merge_ap); + nm_ap_set_broadcast (merge_ap, FALSE); + } + + /* If the incoming scan result matches the hidden AP that NM is currently + * connected to but hasn't been seen in the scan list yet, don't use + * strict matching. Because the capabilities of the fake AP have to be + * constructed from the NMConnection of the activation request, they won't + * always be the same as the capabilities of the real AP from the scan. + */ + current_ap = nm_device_wifi_get_activation_ap (self); + if (current_ap && nm_ap_get_fake (current_ap)) + strict_match = FALSE; + + found_ap = nm_ap_match_in_list (merge_ap, priv->ap_list, strict_match); + if (found_ap) { + nm_ap_set_flags (found_ap, nm_ap_get_flags (merge_ap)); + nm_ap_set_wpa_flags (found_ap, nm_ap_get_wpa_flags (merge_ap)); + nm_ap_set_rsn_flags (found_ap, nm_ap_get_rsn_flags (merge_ap)); + nm_ap_set_strength (found_ap, nm_ap_get_strength (merge_ap)); + nm_ap_set_last_seen (found_ap, nm_ap_get_last_seen (merge_ap)); + nm_ap_set_broadcast (found_ap, nm_ap_get_broadcast (merge_ap)); + nm_ap_set_freq (found_ap, nm_ap_get_freq (merge_ap)); + nm_ap_set_max_bitrate (found_ap, nm_ap_get_max_bitrate (merge_ap)); + + /* If the AP is noticed in a scan, it's automatically no longer + * fake, since it clearly exists somewhere. + */ + nm_ap_set_fake (found_ap, FALSE); + } else { + /* New entry in the list */ + // FIXME: figure out if reference counts are correct here for AP objects + g_object_ref (merge_ap); + priv->ap_list = g_slist_prepend (priv->ap_list, merge_ap); + nm_ap_export_to_dbus (merge_ap); + g_signal_emit (self, signals[ACCESS_POINT_ADDED], 0, merge_ap); + } +} + +static void +cull_scan_list (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv; + GTimeVal cur_time; + GSList *outdated_list = NULL; + GSList *elt; + NMActRequest *req; + const char *cur_ap_path = NULL; + guint32 removed = 0, total = 0; + + g_return_if_fail (self != NULL); + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + g_get_current_time (&cur_time); + + req = nm_device_get_act_request (NM_DEVICE (self)); + if (req) + cur_ap_path = nm_act_request_get_specific_object (req); + + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): checking scan list for outdated APs", + nm_device_get_iface (NM_DEVICE (self))); + + /* Walk the access point list and remove any access points older than + * three times the inactive scan interval. + */ + for (elt = priv->ap_list; elt; elt = g_slist_next (elt), total++) { + NMAccessPoint * ap = NM_AP (elt->data); + const glong ap_time = nm_ap_get_last_seen (ap); + gboolean keep = FALSE; + const guint prune_interval_s = SCAN_INTERVAL_MAX * 3; + + /* Don't ever prune the AP we're currently associated with */ + if (cur_ap_path && !strcmp (cur_ap_path, nm_ap_get_dbus_path (ap))) + keep = TRUE; + if (nm_ap_get_fake (ap)) + keep = TRUE; + + if (!keep && (ap_time + prune_interval_s < cur_time.tv_sec)) + outdated_list = g_slist_append (outdated_list, ap); + } + + /* Remove outdated APs */ + for (elt = outdated_list; elt; elt = g_slist_next (elt)) { + NMAccessPoint *outdated_ap = NM_AP (elt->data); + const struct ether_addr *bssid; + const GByteArray *ssid; + + bssid = nm_ap_get_address (outdated_ap); + ssid = nm_ap_get_ssid (outdated_ap); + nm_log_dbg (LOGD_WIFI_SCAN, + " removing %02x:%02x:%02x:%02x:%02x:%02x (%s%s%s)", + bssid->ether_addr_octet[0], bssid->ether_addr_octet[1], + bssid->ether_addr_octet[2], bssid->ether_addr_octet[3], + bssid->ether_addr_octet[4], bssid->ether_addr_octet[5], + ssid ? "'" : "", + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)", + ssid ? "'" : ""); + + access_point_removed (self, outdated_ap); + priv->ap_list = g_slist_remove (priv->ap_list, outdated_ap); + g_object_unref (outdated_ap); + removed++; + } + g_slist_free (outdated_list); + + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): removed %d APs (of %d)", + nm_device_get_iface (NM_DEVICE (self)), + removed, total); +} + +#define SET_QUALITY_MEMBER(qual_item, lc_member, uc_member) \ + if (lc_member != -1) { \ + qual_item.lc_member = lc_member; \ + qual_item.updated |= IW_QUAL_##uc_member##_UPDATED; \ + } else { \ + qual_item.updated |= IW_QUAL_##uc_member##_INVALID; \ + } + +static void +set_ap_strength_from_properties (NMDeviceWifi *self, + NMAccessPoint *ap, + GHashTable *properties) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + int qual, level, noise; + struct iw_quality quality; + GValue *value; + gint8 strength; + + value = (GValue *) g_hash_table_lookup (properties, "quality"); + qual = value ? g_value_get_int (value) : -1; + + value = (GValue *) g_hash_table_lookup (properties, "level"); + level = value ? g_value_get_int (value) : -1; + + value = (GValue *) g_hash_table_lookup (properties, "noise"); + noise = value ? g_value_get_int (value) : -1; + + /* Calculate and set the AP's signal quality */ + memset (&quality, 0, sizeof (struct iw_quality)); + SET_QUALITY_MEMBER (quality, qual, QUAL); + SET_QUALITY_MEMBER (quality, level, LEVEL); + SET_QUALITY_MEMBER (quality, noise, NOISE); + + strength = wireless_qual_to_percent (&quality, &priv->max_qual); + nm_ap_set_strength (ap, strength); +} + +static void +supplicant_iface_scanned_ap_cb (NMSupplicantInterface *iface, + GHashTable *properties, + NMDeviceWifi *self) +{ + NMDeviceState state; + NMAccessPoint *ap; + + g_return_if_fail (self != NULL); + g_return_if_fail (properties != NULL); + g_return_if_fail (iface != NULL); + + /* Ignore new APs when unavailable or unamnaged */ + state = nm_device_get_state (NM_DEVICE (self)); + if (state <= NM_DEVICE_STATE_UNAVAILABLE) + return; + + ap = nm_ap_new_from_properties (properties); + if (ap) { + set_ap_strength_from_properties (self, ap, properties); + + nm_ap_print_self (ap, "AP: "); + + /* Add the AP to the device's AP list */ + merge_scanned_ap (self, ap); + g_object_unref (ap); + + /* Remove outdated access points */ + cull_scan_list (self); + + nm_device_wifi_ap_list_print (self); + } else { + nm_log_warn (LOGD_WIFI_SCAN, "(%s): invalid AP properties received", + nm_device_get_iface (NM_DEVICE (self))); + } +} + + +static void +cleanup_association_attempt (NMDeviceWifi *self, gboolean disconnect) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + remove_supplicant_interface_error_handler (self); + remove_supplicant_timeouts (self); + if (disconnect && priv->supplicant.iface) + nm_supplicant_interface_disconnect (priv->supplicant.iface); +} + + +static void +remove_link_timeout (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv; + + g_return_if_fail (self != NULL); + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + if (priv->link_timeout_id) { + g_source_remove (priv->link_timeout_id); + priv->link_timeout_id = 0; + } +} + + +/* + * link_timeout_cb + * + * Called when the link to the access point has been down for a specified + * period of time. + */ +static gboolean +link_timeout_cb (gpointer user_data) +{ + NMDevice * dev = NM_DEVICE (user_data); + NMDeviceWifi * self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMActRequest * req = NULL; + NMAccessPoint * ap = NULL; + NMConnection * connection; + const char * setting_name; + gboolean auth_enforced, encrypted = FALSE; + + g_assert (dev); + + priv->link_timeout_id = 0; + + req = nm_device_get_act_request (dev); + ap = nm_device_wifi_get_activation_ap (self); + if (req == NULL || ap == NULL) { + /* shouldn't ever happen */ + nm_log_err (LOGD_WIFI, "couldn't get activation request or activation AP."); + if (nm_device_is_activating (dev)) { + cleanup_association_attempt (self, TRUE); + nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NONE); + } + return FALSE; + } + + /* Disconnect event while activated; the supplicant hasn't been able + * to reassociate within the timeout period, so the connection must + * fail. + */ + if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) { + nm_device_state_changed (dev, NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT); + return FALSE; + } + + /* Disconnect event during initial authentication and credentials + * ARE checked - we are likely to have wrong key. Ask the user for + * another one. + */ + if (nm_device_get_state (dev) != NM_DEVICE_STATE_CONFIG) + goto time_out; + + connection = nm_act_request_get_connection (req); + if (!connection) + goto time_out; + + auth_enforced = ap_auth_enforced (connection, ap, &encrypted); + if (!encrypted || !auth_enforced) + goto time_out; + + /* Drivers are still just too crappy, and emit too many disassociation + * events during connection. So for now, just let the driver and supplicant + * keep trying to associate, and don't ask for new secrets when we get + * disconnected during association. + */ + if (0) { + nm_connection_clear_secrets (connection); + setting_name = nm_connection_need_secrets (connection, NULL); + if (!setting_name) + goto time_out; + + /* Association/authentication failed during association, probably have a + * bad encryption key and the authenticating entity (AP, RADIUS server, etc) + * denied the association due to bad credentials. + */ + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): disconnected during association," + " asking for new key.", nm_device_get_iface (dev)); + cleanup_association_attempt (self, TRUE); + nm_device_state_changed (dev, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT); + nm_act_request_get_secrets (req, + setting_name, + TRUE, + SECRETS_CALLER_WIFI, + NULL, + NULL); + + return FALSE; + } + +time_out: + nm_log_warn (LOGD_WIFI, "(%s): link timed out.", nm_device_get_iface (dev)); + return FALSE; +} + +static gboolean +schedule_state_handler (NMDeviceWifi *self, + GSourceFunc handler, + guint32 new_state, + guint32 old_state, + gboolean mgr_task) +{ + NMDeviceWifiPrivate *priv; + SupplicantStateTask *task; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (handler != NULL, FALSE); + + if (new_state == old_state) + return TRUE; + + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + task = g_slice_new0 (SupplicantStateTask); + if (!task) { + nm_log_err (LOGD_WIFI, "Not enough memory to process supplicant manager state change."); + return FALSE; + } + + task->self = self; + task->new_state = new_state; + task->old_state = old_state; + task->mgr_task = mgr_task; + + task->source_id = g_idle_add (handler, task); + if (mgr_task) + priv->supplicant.mgr_tasks = g_slist_append (priv->supplicant.mgr_tasks, task); + else + priv->supplicant.iface_tasks = g_slist_append (priv->supplicant.iface_tasks, task); + + return TRUE; +} + +static gboolean +supplicant_iface_state_cb_handler (gpointer user_data) +{ + SupplicantStateTask *task = (SupplicantStateTask *) user_data; + NMDeviceWifi *self; + NMDeviceWifiPrivate *priv; + + g_return_val_if_fail (task != NULL, FALSE); + + self = task->self; + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + nm_log_info (LOGD_WIFI, "(%s): supplicant interface state: %s -> %s", + nm_device_get_iface (NM_DEVICE (self)), + nm_supplicant_interface_state_to_string (task->old_state), + nm_supplicant_interface_state_to_string (task->new_state)); + + if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) { + priv->scan_interval = SCAN_INTERVAL_MIN; + + /* If the interface can now be activated because the supplicant is now + * available, transition to DISCONNECTED. + */ + if ( (nm_device_get_state (NM_DEVICE (self)) == NM_DEVICE_STATE_UNAVAILABLE) + && nm_device_is_available (NM_DEVICE (self))) { + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE); + } + + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): supplicant ready, requesting initial scan", + nm_device_get_iface (NM_DEVICE (self))); + + /* Request a scan to get latest results */ + cancel_pending_scan (self); + request_wireless_scan (self); + } else if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { + cleanup_association_attempt (self, FALSE); + supplicant_interface_release (self); + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_UNAVAILABLE, + NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); + } + + finish_supplicant_task (task, FALSE); + return FALSE; +} + + +static void +supplicant_iface_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + NMDeviceWifi *self) +{ + g_return_if_fail (self != NULL); + + schedule_state_handler (self, + supplicant_iface_state_cb_handler, + new_state, + old_state, + FALSE); +} + + +static gboolean +supplicant_iface_connection_state_cb_handler (gpointer user_data) +{ + SupplicantStateTask *task = (SupplicantStateTask *) user_data; + NMDeviceWifi *self = task->self; + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMDevice *dev = NM_DEVICE (self); + gboolean scanning; + + if (!nm_device_get_act_request (dev)) { + /* The device is not activating or already activated; do nothing. */ + goto out; + } + + nm_log_info (LOGD_WIFI, "(%s): supplicant connection state: %s -> %s", + nm_device_get_iface (dev), + nm_supplicant_interface_connection_state_to_string (task->old_state), + nm_supplicant_interface_connection_state_to_string (task->new_state)); + + scanning = nm_supplicant_interface_get_scanning (priv->supplicant.iface); + + if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED) { + remove_supplicant_interface_error_handler (self); + remove_supplicant_timeouts (self); + + /* If this is the initial association during device activation, + * schedule the next activation stage. + */ + if (nm_device_get_state (dev) == NM_DEVICE_STATE_CONFIG) { + NMAccessPoint *ap = nm_device_wifi_get_activation_ap (self); + const GByteArray * ssid = nm_ap_get_ssid (ap); + + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless) Stage 2 of 5 (Device Configure) " + "successful. Connected to wireless network '%s'.", + nm_device_get_iface (dev), + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); + nm_device_activate_schedule_stage3_ip_config_start (dev); + } + } else if (task->new_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED) { + if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED || nm_device_is_activating (dev)) { + /* Start the link timeout so we allow some time for reauthentication, + * use a longer timeout if we are scanning since some cards take a + * while to scan. + */ + if (!priv->link_timeout_id) { + priv->link_timeout_id = g_timeout_add_seconds (scanning ? 30 : 15, + link_timeout_cb, self); + } + } + } + +out: + finish_supplicant_task (task, FALSE); + return FALSE; +} + + +static void +supplicant_iface_connection_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + NMDeviceWifi *self) +{ + g_return_if_fail (self != NULL); + + schedule_state_handler (self, + supplicant_iface_connection_state_cb_handler, + new_state, + old_state, + FALSE); +} + + +static gboolean +supplicant_mgr_state_cb_handler (gpointer user_data) +{ + SupplicantStateTask *task = (SupplicantStateTask *) user_data; + NMDeviceWifi *self; + NMDeviceWifiPrivate *priv; + NMDevice *dev; + NMDeviceState dev_state; + + g_return_val_if_fail (task != NULL, FALSE); + + self = task->self; + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + dev = NM_DEVICE (self); + + nm_log_info (LOGD_WIFI, "(%s): supplicant manager state: %s -> %s", + nm_device_get_iface (NM_DEVICE (self)), + nm_supplicant_manager_state_to_string (task->old_state), + nm_supplicant_manager_state_to_string (task->new_state)); + + /* If the supplicant went away, release the supplicant interface */ + if (task->new_state == NM_SUPPLICANT_MANAGER_STATE_DOWN) { + if (priv->supplicant.iface) { + cleanup_association_attempt (self, FALSE); + supplicant_interface_release (self); + } + + if (nm_device_get_state (dev) > NM_DEVICE_STATE_UNAVAILABLE) { + nm_device_state_changed (dev, NM_DEVICE_STATE_UNAVAILABLE, + NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); + } + } else if (task->new_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { + dev_state = nm_device_get_state (dev); + if ( priv->enabled + && !priv->supplicant.iface + && (dev_state >= NM_DEVICE_STATE_UNAVAILABLE)) { + /* request a supplicant interface from the supplicant manager */ + supplicant_interface_acquire (self); + + /* if wireless is enabled and we have a supplicant interface, + * we can transition to the DISCONNECTED state. + */ + if (priv->supplicant.iface) { + nm_device_state_changed (dev, NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_REASON_NONE); + } + } + } + + finish_supplicant_task (task, FALSE); + return FALSE; +} + +static void +supplicant_mgr_state_cb (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state, + NMDeviceWifi *self) +{ + g_return_if_fail (self != NULL); + + schedule_state_handler (self, + supplicant_mgr_state_cb_handler, + new_state, + old_state, + TRUE); +} + +struct iface_con_error_cb_data { + NMDeviceWifi *self; + char *name; + char *message; +}; + +static gboolean +supplicant_iface_connection_error_cb_handler (gpointer user_data) +{ + NMDeviceWifi *self; + NMDeviceWifiPrivate *priv; + struct iface_con_error_cb_data * cb_data = (struct iface_con_error_cb_data *) user_data; + + g_return_val_if_fail (cb_data != NULL, FALSE); + + self = cb_data->self; + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + if (!nm_device_is_activating (NM_DEVICE (self))) + goto out; + + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): association request to the supplicant " + "failed: %s - %s", + nm_device_get_iface (NM_DEVICE (self)), + cb_data->name, + cb_data->message); + + cleanup_association_attempt (self, TRUE); + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED); + +out: + priv->supplicant.iface_con_error_cb_id = 0; + g_free (cb_data->name); + g_free (cb_data->message); + g_slice_free (struct iface_con_error_cb_data, cb_data); + return FALSE; +} + + +static void +supplicant_iface_connection_error_cb (NMSupplicantInterface * iface, + const char * name, + const char * message, + NMDeviceWifi * self) +{ + NMDeviceWifiPrivate *priv; + struct iface_con_error_cb_data *cb_data; + guint id; + + g_return_if_fail (self != NULL); + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + cb_data = g_slice_new0 (struct iface_con_error_cb_data); + if (cb_data == NULL) { + nm_log_err (LOGD_WIFI, "Not enough memory to process supplicant connection error."); + return; + } + + cb_data->self = self; + cb_data->name = g_strdup (name); + cb_data->message = g_strdup (message); + + if (priv->supplicant.iface_con_error_cb_id) + g_source_remove (priv->supplicant.iface_con_error_cb_id); + + id = g_idle_add (supplicant_iface_connection_error_cb_handler, cb_data); + priv->supplicant.iface_con_error_cb_id = id; +} + +static void +supplicant_iface_notify_scanning_cb (NMSupplicantInterface *iface, + GParamSpec *pspec, + NMDeviceWifi *self) +{ + gboolean scanning; + + scanning = nm_supplicant_interface_get_scanning (iface); + nm_log_dbg (LOGD_WIFI_SCAN, "(%s): now %s", + nm_device_get_iface (NM_DEVICE (self)), + scanning ? "scanning" : "not scanning"); + + g_object_notify (G_OBJECT (self), "scanning"); +} + +static void +remove_supplicant_connection_timeout (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv; + + g_return_if_fail (self != NULL); + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + /* Remove any pending timeouts on the request */ + if (priv->supplicant.con_timeout_id) { + g_source_remove (priv->supplicant.con_timeout_id); + priv->supplicant.con_timeout_id = 0; + } +} + +static NMActStageReturn +handle_auth_or_fail (NMDeviceWifi *self, + NMActRequest *req, + gboolean new_secrets) +{ + const char *setting_name; + guint32 tries; + NMAccessPoint *ap; + NMConnection *connection; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (self), NM_ACT_STAGE_RETURN_FAILURE); + + if (!req) { + req = nm_device_get_act_request (NM_DEVICE (self)); + g_assert (req); + } + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + ap = nm_device_wifi_get_activation_ap (self); + g_assert (ap); + + tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), WIRELESS_SECRETS_TRIES)); + if (tries > 3) + return NM_ACT_STAGE_RETURN_FAILURE; + + nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE); + + nm_connection_clear_secrets (connection); + setting_name = nm_connection_need_secrets (connection, NULL); + if (setting_name) { + gboolean get_new; + + /* If the caller doesn't necessarily want completely new secrets, + * only ask for new secrets after the first failure. + */ + get_new = new_secrets ? TRUE : (tries ? TRUE : FALSE); + nm_act_request_get_secrets (req, + setting_name, + get_new, + SECRETS_CALLER_WIFI, + NULL, + NULL); + + g_object_set_data (G_OBJECT (connection), WIRELESS_SECRETS_TRIES, GUINT_TO_POINTER (++tries)); + } else { + nm_log_warn (LOGD_DEVICE, "Cleared secrets, but setting didn't need any secrets."); + } + return NM_ACT_STAGE_RETURN_POSTPONE; +} + +/* + * supplicant_connection_timeout_cb + * + * Called when the supplicant has been unable to connect to an access point + * within a specified period of time. + */ +static gboolean +supplicant_connection_timeout_cb (gpointer user_data) +{ + NMDevice * dev = NM_DEVICE (user_data); + NMDeviceWifi * self = NM_DEVICE_WIFI (user_data); + NMAccessPoint * ap; + NMActRequest * req; + gboolean auth_enforced = FALSE, encrypted = FALSE; + NMConnection *connection; + + cleanup_association_attempt (self, TRUE); + + if (!nm_device_is_activating (dev)) + return FALSE; + + /* Timed out waiting for authentication success; if the security in use + * does not require access point side authentication (Open System + * WEP, for example) then we are likely using the wrong authentication + * algorithm or key. Request new one from the user. + */ + + req = nm_device_get_act_request (dev); + g_assert (req); + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + ap = nm_device_wifi_get_activation_ap (self); + g_assert (ap); + + auth_enforced = ap_auth_enforced (connection, ap, &encrypted); + if (!encrypted) { + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): association took too long, " + "failing activation.", + nm_device_get_iface (dev)); + nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT); + } else { + /* Authentication failed, encryption key is probably bad */ + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): association took too long.", + nm_device_get_iface (dev)); + + if (handle_auth_or_fail (self, req, TRUE) == NM_ACT_STAGE_RETURN_POSTPONE) { + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): asking for new secrets", + nm_device_get_iface (dev)); + } else { + nm_device_state_changed (dev, NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_NO_SECRETS); + } + } + + return FALSE; +} + + +static gboolean +start_supplicant_connection_timeout (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv; + guint id; + + g_return_val_if_fail (self != NULL, FALSE); + + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + /* Set up a timeout on the connection attempt to fail it after 25 seconds */ + id = g_timeout_add_seconds (25, supplicant_connection_timeout_cb, self); + if (id == 0) { + nm_log_err (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): couldn't start supplicant " + "timeout timer.", + nm_device_get_iface (NM_DEVICE (self))); + return FALSE; + } + priv->supplicant.con_timeout_id = id; + return TRUE; +} + + +static void +remove_supplicant_timeouts (NMDeviceWifi *self) +{ + g_return_if_fail (self != NULL); + + remove_supplicant_connection_timeout (self); + remove_link_timeout (self); +} + +static guint32 +find_supported_frequency (NMDeviceWifi *self, guint32 *freqs) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + int i; + + for (i = 0; i < priv->num_freqs; i++) { + while (*freqs) { + if (priv->freqs[i] == *freqs) + return *freqs; + freqs++; + } + } + + return 0; +} + +static NMSupplicantConfig * +build_supplicant_config (NMDeviceWifi *self, + NMConnection *connection, + NMAccessPoint *ap) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMSupplicantConfig *config = NULL; + NMSettingWireless *s_wireless; + NMSettingWirelessSecurity *s_wireless_sec; + guint32 adhoc_freq = 0; + + g_return_val_if_fail (self != NULL, NULL); + + s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + g_return_val_if_fail (s_wireless != NULL, NULL); + + config = nm_supplicant_config_new (); + if (!config) + return NULL; + + /* Figure out the Ad-Hoc frequency to use if creating an adhoc network; if + * nothing was specified then pick something usable. + */ + if ((nm_ap_get_mode (ap) == NM_802_11_MODE_ADHOC) && nm_ap_get_user_created (ap)) { + const char *band = nm_setting_wireless_get_band (s_wireless); + + adhoc_freq = nm_ap_get_freq (ap); + if (!adhoc_freq) { + if (band && !strcmp (band, "a")) { + guint32 a_freqs[] = {5180, 5200, 5220, 5745, 5765, 5785, 5805, 0}; + adhoc_freq = find_supported_frequency (self, a_freqs); + } else { + guint32 bg_freqs[] = {2412, 2437, 2462, 2472, 0}; + adhoc_freq = find_supported_frequency (self, bg_freqs); + } + } + + if (!adhoc_freq) { + if (band && !strcmp (band, "a")) + adhoc_freq = 5180; + else + adhoc_freq = 2462; + } + } + + if (!nm_supplicant_config_add_setting_wireless (config, + s_wireless, + nm_ap_get_broadcast (ap), + adhoc_freq, + priv->has_scan_capa_ssid)) { + nm_log_err (LOGD_WIFI, "Couldn't add 802-11-wireless setting to supplicant config."); + goto error; + } + + s_wireless_sec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); + if (s_wireless_sec) { + NMSetting8021x *s_8021x; + const char *con_path = nm_connection_get_path (connection); + + g_assert (con_path); + s_8021x = (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + if (!nm_supplicant_config_add_setting_wireless_security (config, + s_wireless_sec, + s_8021x, + con_path)) { + nm_log_err (LOGD_WIFI, "Couldn't add 802-11-wireless-security setting to " + "supplicant config."); + goto error; + } + } else { + if (!nm_supplicant_config_add_no_security (config)) { + nm_log_err (LOGD_WIFI, "Couldn't add unsecured option to supplicant config."); + goto error; + } + } + + return config; + +error: + g_object_unref (config); + return NULL; +} + +/****************************************************************************/ + +static void +real_update_hw_address (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + struct ifreq req; + int fd; + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_HW, "could not open control socket."); + return; + } + + memset (&req, 0, sizeof (struct ifreq)); + strncpy (req.ifr_name, nm_device_get_iface (dev), IFNAMSIZ); + if (ioctl (fd, SIOCGIFHWADDR, &req) < 0) { + nm_log_err (LOGD_HW | LOGD_WIFI, "(%s) error getting hardware address: %d", + nm_device_get_iface (dev), errno); + goto out; + } + + if (memcmp (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr))) { + memcpy (&priv->hw_addr, &req.ifr_hwaddr.sa_data, sizeof (struct ether_addr)); + g_object_notify (G_OBJECT (dev), NM_DEVICE_WIFI_HW_ADDRESS); + } + +out: + close (fd); +} + + +static NMActStageReturn +real_act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMAccessPoint *ap = NULL; + NMActRequest *req; + NMConnection *connection; + GSList *iter; + + /* If the user is trying to connect to an AP that NM doesn't yet know about + * (hidden network or something), create an fake AP from the security + * settings in the connection to use until the AP is recognized from the + * scan list, which should show up when the connection is successful. + */ + ap = nm_device_wifi_get_activation_ap (self); + if (ap) + goto done; + + req = nm_device_get_act_request (NM_DEVICE (self)); + g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + connection = nm_act_request_get_connection (req); + g_return_val_if_fail (connection != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + /* Find a compatible AP in the scan list */ + for (iter = priv->ap_list; iter; iter = g_slist_next (iter)) { + NMAccessPoint *candidate = NM_AP (iter->data); + + if (nm_ap_check_compatible (candidate, connection)) { + ap = candidate; + break; + } + } + + /* If no compatible AP was found, create a fake AP (network is likely + * hidden) and try to use that. + */ + if (!ap) { + ap = nm_ap_new_fake_from_connection (connection); + g_return_val_if_fail (ap != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + switch (nm_ap_get_mode (ap)) { + case NM_802_11_MODE_ADHOC: + nm_ap_set_user_created (ap, TRUE); + break; + case NM_802_11_MODE_INFRA: + default: + nm_ap_set_broadcast (ap, FALSE); + break; + } + + priv->ap_list = g_slist_prepend (priv->ap_list, ap); + nm_ap_export_to_dbus (ap); + g_signal_emit (self, signals[ACCESS_POINT_ADDED], 0, ap); + } + + nm_act_request_set_specific_object (req, nm_ap_get_dbus_path (ap)); + +done: + set_current_ap (self, ap); + return NM_ACT_STAGE_RETURN_SUCCESS; +} + + +static void +real_connection_secrets_updated (NMDevice *dev, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller) +{ + NMActRequest *req; + gboolean valid = FALSE; + GSList *iter; + + g_return_if_fail (caller == SECRETS_CALLER_WIFI); + + if (nm_device_get_state (dev) != NM_DEVICE_STATE_NEED_AUTH) + return; + + for (iter = updated_settings; iter; iter = g_slist_next (iter)) { + const char *setting_name = (const char *) iter->data; + + if ( !strcmp (setting_name, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) + || !strcmp (setting_name, NM_SETTING_802_1X_SETTING_NAME)) { + valid = TRUE; + } else { + nm_log_warn (LOGD_DEVICE, "Ignoring updated secrets for setting '%s'.", + setting_name); + } + } + + req = nm_device_get_act_request (dev); + g_assert (req); + + g_return_if_fail (nm_act_request_get_connection (req) == connection); + + nm_device_activate_schedule_stage1_device_prepare (dev); +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + const char *iface = nm_device_get_iface (dev); + NMSupplicantConfig *config = NULL; + gulong id = 0; + NMActRequest *req; + NMAccessPoint *ap; + NMConnection *connection; + NMSettingConnection *s_connection; + const char *setting_name; + NMSettingWireless *s_wireless; + + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + remove_supplicant_timeouts (self); + + req = nm_device_get_act_request (dev); + g_assert (req); + + ap = nm_device_wifi_get_activation_ap (self); + g_assert (ap); + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_connection = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_connection); + + s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + g_assert (s_wireless); + + /* If we need secrets, get them */ + setting_name = nm_connection_need_secrets (connection, NULL); + if (setting_name) { + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): access point '%s' has security," + " but secrets are required.", + iface, nm_setting_connection_get_id (s_connection)); + + ret = handle_auth_or_fail (self, req, FALSE); + if (ret == NM_ACT_STAGE_RETURN_FAILURE) + *reason = NM_DEVICE_STATE_REASON_NO_SECRETS; + goto out; + } + + /* have secrets, or no secrets required */ + if (nm_setting_wireless_get_security (s_wireless)) { + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): connection '%s' has security" + ", and secrets exist. No new secrets needed.", + iface, nm_setting_connection_get_id (s_connection)); + } else { + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): connection '%s' requires no " + "security. No secrets needed.", + iface, nm_setting_connection_get_id (s_connection)); + } + + config = build_supplicant_config (self, connection, ap); + if (config == NULL) { + nm_log_err (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): couldn't build wireless configuration.", + iface); + *reason = NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED; + goto out; + } + + /* Hook up error signal handler to capture association errors */ + id = g_signal_connect (priv->supplicant.iface, + "connection-error", + G_CALLBACK (supplicant_iface_connection_error_cb), + self); + priv->supplicant.iface_error_id = id; + + if (!nm_supplicant_interface_set_config (priv->supplicant.iface, config)) { + nm_log_err (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): couldn't send wireless " + "configuration to the supplicant.", iface); + *reason = NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED; + goto out; + } + + if (!start_supplicant_connection_timeout (self)) { + *reason = NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED; + goto out; + } + + /* We'll get stage3 started when the supplicant connects */ + ret = NM_ACT_STAGE_RETURN_POSTPONE; + +out: + if (ret == NM_ACT_STAGE_RETURN_FAILURE) + cleanup_association_attempt (self, TRUE); + + if (config) { + /* Supplicant interface object refs the config; we no longer care about + * it after this function. + */ + g_object_unref (config); + } + return ret; +} + +static NMActStageReturn +real_act_stage4_get_ip4_config (NMDevice *dev, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + NMDeviceClass *parent_class; + + g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); + + /* Chain up to parent */ + parent_class = NM_DEVICE_CLASS (nm_device_wifi_parent_class); + ret = parent_class->act_stage4_get_ip4_config (dev, config, reason); + + if ((ret == NM_ACT_STAGE_RETURN_SUCCESS) && *config) { + NMConnection *connection; + NMSettingWireless *s_wireless; + guint32 mtu; + + connection = nm_act_request_get_connection (nm_device_get_act_request (dev)); + g_assert (connection); + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + g_assert (s_wireless); + + /* MTU override */ + mtu = nm_setting_wireless_get_mtu (s_wireless); + if (mtu) + nm_ip4_config_set_mtu (*config, mtu); + } + + return ret; +} + + +static NMActStageReturn +handle_ip_config_timeout (NMDeviceWifi *self, + NMConnection *connection, + gboolean may_fail, + gboolean *chain_up, + NMDeviceStateReason *reason) +{ + NMAccessPoint *ap; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + gboolean auth_enforced = FALSE, encrypted = FALSE; + + g_return_val_if_fail (connection != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + ap = nm_device_wifi_get_activation_ap (self); + g_assert (ap); + + /* If nothing checks the security authentication information (as in + * Open System WEP for example), and DHCP times out, then + * the encryption key is likely wrong. Ask the user for a new one. + * Otherwise the failure likely happened after a successful authentication. + */ + auth_enforced = ap_auth_enforced (connection, ap, &encrypted); + if (encrypted && !auth_enforced && !may_fail) { + NMSettingConnection *s_con; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + + /* Activation failed, we must have bad encryption key */ + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): could not get IP configuration for " + "connection '%s'.", + nm_device_get_iface (NM_DEVICE (self)), + nm_setting_connection_get_id (s_con)); + + ret = handle_auth_or_fail (self, NULL, TRUE); + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { + nm_log_info (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s/wireless): asking for new secrets", + nm_device_get_iface (NM_DEVICE (self))); + } else { + *reason = NM_DEVICE_STATE_REASON_NO_SECRETS; + } + } else { + /* Non-encrypted network or authentication is enforced by some + * entity (AP, RADIUS server, etc), but IP configure failed. Let the + * superclass handle it. + */ + *chain_up = TRUE; + } + + return ret; +} + + +static NMActStageReturn +real_act_stage4_ip4_config_timeout (NMDevice *dev, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingIP4Config *s_ip4; + gboolean may_fail = FALSE, chain_up = FALSE; + NMActStageReturn ret; + + req = nm_device_get_act_request (dev); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + may_fail = nm_setting_ip4_config_get_may_fail (s_ip4); + + ret = handle_ip_config_timeout (NM_DEVICE_WIFI (dev), connection, may_fail, &chain_up, reason); + if (chain_up) + ret = NM_DEVICE_CLASS (nm_device_wifi_parent_class)->act_stage4_ip4_config_timeout (dev, config, reason); + + return ret; +} + +static NMActStageReturn +real_act_stage4_ip6_config_timeout (NMDevice *dev, + NMIP6Config **config, + NMDeviceStateReason *reason) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingIP6Config *s_ip6; + gboolean may_fail = FALSE, chain_up = FALSE; + NMActStageReturn ret; + + req = nm_device_get_act_request (dev); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) + may_fail = nm_setting_ip6_config_get_may_fail (s_ip6); + + ret = handle_ip_config_timeout (NM_DEVICE_WIFI (dev), connection, may_fail, &chain_up, reason); + if (chain_up) + ret = NM_DEVICE_CLASS (nm_device_wifi_parent_class)->act_stage4_ip6_config_timeout (dev, config, reason); + + return ret; +} + +static void +activation_success_handler (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMAccessPoint *ap; + struct ether_addr bssid = { {0x0, 0x0, 0x0, 0x0, 0x0, 0x0} }; + NMAccessPoint *tmp_ap; + NMActRequest *req; + NMConnection *connection; + + req = nm_device_get_act_request (dev); + g_assert (req); + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* Clear wireless secrets tries on success */ + g_object_set_data (G_OBJECT (connection), WIRELESS_SECRETS_TRIES, NULL); + + ap = nm_device_wifi_get_activation_ap (self); + + /* If the AP isn't fake, it was found in the scan list and all its + * details are known. + */ + if (!nm_ap_get_fake (ap)) + goto done; + + /* If the activate AP was fake, it probably won't have a BSSID at all. + * But if activation was successful, the card will know the BSSID. Grab + * the BSSID off the card and fill in the BSSID of the activation AP. + */ + nm_device_wifi_get_bssid (self, &bssid); + if (!nm_ethernet_address_is_valid (nm_ap_get_address (ap))) + nm_ap_set_address (ap, &bssid); + if (!nm_ap_get_freq (ap)) + nm_ap_set_freq (ap, nm_device_wifi_get_frequency (self)); + if (!nm_ap_get_max_bitrate (ap) && nm_ap_get_user_created (ap)) + nm_ap_set_max_bitrate (ap, nm_device_wifi_get_bitrate (self)); + + tmp_ap = get_active_ap (self, ap, TRUE); + if (tmp_ap) { + const GByteArray *ssid = nm_ap_get_ssid (tmp_ap); + + /* Found a better match in the scan list than the fake AP. Use it + * instead. + */ + + /* If the better match was a hidden AP, update it's SSID */ + if (!ssid || nm_utils_is_empty_ssid (ssid->data, ssid->len)) + nm_ap_set_ssid (tmp_ap, nm_ap_get_ssid (ap)); + + nm_act_request_set_specific_object (req, nm_ap_get_dbus_path (tmp_ap)); + + priv->ap_list = g_slist_remove (priv->ap_list, ap); + g_object_unref (ap); + } + +done: + periodic_update (self); + + /* Reset scan interval to something reasonable */ + priv->scan_interval = SCAN_INTERVAL_MIN + (SCAN_INTERVAL_STEP * 2); +} + + +static void +activation_failure_handler (NMDevice *dev) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (dev); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMAccessPoint *ap; + const GByteArray * ssid; + NMActRequest *req; + NMConnection *connection; + + req = nm_device_get_act_request (dev); + g_assert (req); + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* Clear wireless secrets tries on failure */ + g_object_set_data (G_OBJECT (connection), WIRELESS_SECRETS_TRIES, NULL); + + if ((ap = nm_device_wifi_get_activation_ap (self))) { + if (nm_ap_get_fake (ap)) { + /* Fake APs are ones that don't show up in scans, + * but which the user explicitly attempted to connect to. + * However, if we fail on one of these, remove it from the + * list because we don't have any scan or capability info + * for it, and they are pretty much useless. + */ + access_point_removed (self, ap); + priv->ap_list = g_slist_remove (priv->ap_list, ap); + g_object_unref (ap); + } + } + + ssid = nm_ap_get_ssid (ap); + nm_log_warn (LOGD_DEVICE | LOGD_WIFI, + "Activation (%s) failed for access point (%s)", + nm_device_get_iface (dev), + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); +} + +static gboolean +real_can_interrupt_activation (NMDevice *dev) +{ + if (nm_device_get_state (dev) == NM_DEVICE_STATE_NEED_AUTH) + return TRUE; + + return FALSE; +} + + +static guint32 +real_get_type_capabilities (NMDevice *dev) +{ + return NM_DEVICE_WIFI_GET_PRIVATE (dev)->capabilities; +} + + +static gboolean +spec_match_list (NMDevice *device, const GSList *specs) +{ + struct ether_addr ether; + char *hwaddr; + gboolean matched; + + nm_device_wifi_get_address (NM_DEVICE_WIFI (device), ðer); + hwaddr = nm_ether_ntop (ðer); + matched = nm_match_spec_hwaddr (specs, hwaddr); + g_free (hwaddr); + + return matched; +} + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (device); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + gboolean clear_aps = FALSE; + + if (new_state <= NM_DEVICE_STATE_UNAVAILABLE) { + /* Clean up the supplicant interface because in these states the + * device cannot be used. + */ + if (priv->supplicant.iface) + supplicant_interface_release (self); + } + + /* Start or stop the rfkill poll worker for ipw cards */ + if (priv->ipw_rfkill_path) { + if (new_state > NM_DEVICE_STATE_UNMANAGED) { + if (!priv->ipw_rfkill_id) + priv->ipw_rfkill_id = g_timeout_add_seconds (3, ipw_rfkill_state_work, self); + } else if (new_state <= NM_DEVICE_STATE_UNMANAGED) { + if (priv->ipw_rfkill_id) { + g_source_remove (priv->ipw_rfkill_id); + priv->ipw_rfkill_id = 0; + } + } + } + + switch (new_state) { + case NM_DEVICE_STATE_UNMANAGED: + clear_aps = TRUE; + break; + case NM_DEVICE_STATE_UNAVAILABLE: + /* If the device is enabled and the supplicant manager is ready, + * acquire a supplicant interface and transition to DISCONNECTED because + * the device is now ready to use. + */ + if (priv->enabled) { + gboolean success; + struct iw_range range; + + /* Wait for some drivers like ipw3945 to come back to life */ + success = wireless_get_range (self, &range, NULL); + + if (!priv->supplicant.iface) + supplicant_interface_acquire (self); + } + clear_aps = TRUE; + break; + case NM_DEVICE_STATE_ACTIVATED: + activation_success_handler (device); + break; + case NM_DEVICE_STATE_FAILED: + activation_failure_handler (device); + break; + case NM_DEVICE_STATE_DISCONNECTED: + // FIXME: ensure that the activation request is destroyed + break; + default: + break; + } + + if (clear_aps) + remove_all_aps (self); +} + +NMAccessPoint * +nm_device_wifi_get_activation_ap (NMDeviceWifi *self) +{ + NMDeviceWifiPrivate *priv; + NMActRequest *req; + const char *ap_path; + GSList * elt; + + g_return_val_if_fail (NM_IS_DEVICE_WIFI (self), NULL); + + req = nm_device_get_act_request (NM_DEVICE (self)); + if (!req) + return NULL; + + ap_path = nm_act_request_get_specific_object (req); + if (!ap_path) + return NULL; + + /* Find the AP by it's object path */ + priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + for (elt = priv->ap_list; elt; elt = g_slist_next (elt)) { + NMAccessPoint *ap = NM_AP (elt->data); + + if (!strcmp (ap_path, nm_ap_get_dbus_path (ap))) + return ap; + } + return NULL; +} + +static void +real_set_enabled (NMDeviceInterface *device, gboolean enabled) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (device); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + NMDeviceState state; + + if (priv->enabled == enabled) + return; + + priv->enabled = enabled; + + nm_log_dbg (LOGD_WIFI, "(%s): device now %s", + nm_device_get_iface (NM_DEVICE (device)), + enabled ? "enabled" : "disabled"); + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); + if (state < NM_DEVICE_STATE_UNAVAILABLE) { + nm_log_dbg (LOGD_WIFI, "(%s): %s blocked by UNMANAGED state", + enabled ? "enable" : "disable", + nm_device_get_iface (NM_DEVICE (device))); + return; + } + + if (enabled) { + gboolean no_firmware = FALSE, success; + struct iw_range range; + + if (state != NM_DEVICE_STATE_UNAVAILABLE) + nm_log_warn (LOGD_CORE, "not in expected unavailable state!"); + + if (!nm_device_hw_bring_up (NM_DEVICE (self), TRUE, &no_firmware)) { + nm_log_dbg (LOGD_WIFI, "(%s): enable blocked by failure to bring device up", + nm_device_get_iface (NM_DEVICE (device))); + + /* The device sucks, or HAL was lying to us about the killswitch state */ + priv->enabled = FALSE; + return; + } + + /* Wait for some drivers like ipw3945 to come back to life */ + success = wireless_get_range (self, &range, NULL); + + /* iface should be NULL here, but handle it anyway if it's not */ + g_warn_if_fail (priv->supplicant.iface == NULL); + if (priv->supplicant.iface) + supplicant_interface_release (self); + + supplicant_interface_acquire (self); + nm_log_dbg (LOGD_WIFI, "(%s): enable waiting on supplicant state", + nm_device_get_iface (NM_DEVICE (device))); + } else { + nm_device_state_changed (NM_DEVICE (self), + NM_DEVICE_STATE_UNAVAILABLE, + NM_DEVICE_STATE_REASON_NONE); + nm_device_hw_take_down (NM_DEVICE (self), TRUE); + } +} + +/********************************************************************/ + +NMDevice * +nm_device_wifi_new (const char *udi, + const char *iface, + const char *driver) +{ + g_return_val_if_fail (udi != NULL, NULL); + g_return_val_if_fail (iface != NULL, NULL); + g_return_val_if_fail (driver != NULL, NULL); + + return (NMDevice *) g_object_new (NM_TYPE_DEVICE_WIFI, + NM_DEVICE_INTERFACE_UDI, udi, + NM_DEVICE_INTERFACE_IFACE, iface, + NM_DEVICE_INTERFACE_DRIVER, driver, + NM_DEVICE_INTERFACE_TYPE_DESC, "802.11 WiFi", + NM_DEVICE_INTERFACE_DEVICE_TYPE, NM_DEVICE_TYPE_WIFI, + NM_DEVICE_INTERFACE_RFKILL_TYPE, RFKILL_TYPE_WLAN, + NULL); +} + +static void +device_interface_init (NMDeviceInterface *iface_class) +{ + iface_class->set_enabled = real_set_enabled; +} + +static void +nm_device_wifi_init (NMDeviceWifi * self) +{ + g_signal_connect (self, "state-changed", G_CALLBACK (device_state_changed), NULL); +} + +static void +dispose (GObject *object) +{ + NMDeviceWifi *self = NM_DEVICE_WIFI (object); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object); + return; + } + + priv->disposed = TRUE; + + if (priv->periodic_source_id) { + g_source_remove (priv->periodic_source_id); + priv->periodic_source_id = 0; + } + + /* Clean up all pending supplicant tasks */ + while (priv->supplicant.iface_tasks) + finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.iface_tasks->data, TRUE); + while (priv->supplicant.mgr_tasks) + finish_supplicant_task ((SupplicantStateTask *) priv->supplicant.mgr_tasks->data, TRUE); + + cleanup_association_attempt (self, TRUE); + supplicant_interface_release (self); + + if (priv->supplicant.mgr_state_id) { + g_signal_handler_disconnect (priv->supplicant.mgr, priv->supplicant.mgr_state_id); + priv->supplicant.mgr_state_id = 0; + } + + if (priv->supplicant.mgr) { + g_object_unref (priv->supplicant.mgr); + priv->supplicant.mgr = NULL; + } + + if (priv->ssid) { + g_byte_array_free (priv->ssid, TRUE); + priv->ssid = NULL; + } + + set_current_ap (self, NULL); + remove_all_aps (self); + + g_free (priv->ipw_rfkill_path); + if (priv->ipw_rfkill_id) { + g_source_remove (priv->ipw_rfkill_id); + priv->ipw_rfkill_id = 0; + } + + G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDeviceWifi *device = NM_DEVICE_WIFI (object); + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device); + struct ether_addr hw_addr; + + switch (prop_id) { + case PROP_HW_ADDRESS: + nm_device_wifi_get_address (device, &hw_addr); + g_value_take_string (value, nm_ether_ntop (&hw_addr)); + break; + case PROP_MODE: + g_value_set_uint (value, nm_device_wifi_get_mode (device)); + break; + case PROP_BITRATE: + g_value_set_uint (value, priv->rate); + break; + case PROP_CAPABILITIES: + g_value_set_uint (value, priv->capabilities); + break; + case PROP_ACTIVE_ACCESS_POINT: + if (priv->current_ap) + g_value_set_boxed (value, nm_ap_get_dbus_path (priv->current_ap)); + else + g_value_set_boxed (value, "/"); + break; + case PROP_SCANNING: + g_value_set_boolean (value, nm_supplicant_interface_get_scanning (priv->supplicant.iface)); + break; + case PROP_IPW_RFKILL_STATE: + g_value_set_uint (value, nm_device_wifi_get_ipw_rfkill_state (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_IPW_RFKILL_STATE: + /* construct only */ + priv->ipw_rfkill_state = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + + +static void +nm_device_wifi_class_init (NMDeviceWifiClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMDeviceWifiPrivate)); + + object_class->constructor = constructor; + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->dispose = dispose; + + parent_class->get_type_capabilities = real_get_type_capabilities; + parent_class->get_generic_capabilities = real_get_generic_capabilities; + parent_class->hw_is_up = real_hw_is_up; + parent_class->hw_bring_up = real_hw_bring_up; + parent_class->hw_take_down = real_hw_take_down; + parent_class->is_up = real_is_up; + parent_class->bring_up = real_bring_up; + parent_class->take_down = real_take_down; + parent_class->update_hw_address = real_update_hw_address; + parent_class->get_best_auto_connection = real_get_best_auto_connection; + parent_class->is_available = real_is_available; + parent_class->connection_secrets_updated = real_connection_secrets_updated; + parent_class->check_connection_compatible = real_check_connection_compatible; + + parent_class->act_stage1_prepare = real_act_stage1_prepare; + parent_class->act_stage2_config = real_act_stage2_config; + parent_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; + parent_class->act_stage4_ip4_config_timeout = real_act_stage4_ip4_config_timeout; + parent_class->act_stage4_ip6_config_timeout = real_act_stage4_ip6_config_timeout; + parent_class->deactivate = real_deactivate; + parent_class->deactivate_quickly = real_deactivate_quickly; + parent_class->can_interrupt_activation = real_can_interrupt_activation; + parent_class->spec_match_list = spec_match_list; + + klass->scanning_allowed = scanning_allowed; + + /* Properties */ + g_object_class_install_property (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, + "MAC Address", + "Hardware MAC address", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_MODE, + g_param_spec_uint (NM_DEVICE_WIFI_MODE, + "Mode", + "Mode", + NM_802_11_MODE_UNKNOWN, + NM_802_11_MODE_INFRA, + NM_802_11_MODE_INFRA, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_BITRATE, + g_param_spec_uint (NM_DEVICE_WIFI_BITRATE, + "Bitrate", + "Bitrate", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_ACTIVE_ACCESS_POINT, + g_param_spec_boxed (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, + "Active access point", + "Currently active access point", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_CAPABILITIES, + g_param_spec_uint (NM_DEVICE_WIFI_CAPABILITIES, + "Wireless Capabilities", + "Wireless Capabilities", + 0, G_MAXUINT32, NM_WIFI_DEVICE_CAP_NONE, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_SCANNING, + g_param_spec_boolean (NM_DEVICE_WIFI_SCANNING, + "Scanning", + "Scanning", + FALSE, + G_PARAM_READABLE | NM_PROPERTY_PARAM_NO_EXPORT)); + + g_object_class_install_property (object_class, PROP_IPW_RFKILL_STATE, + g_param_spec_uint (NM_DEVICE_WIFI_IPW_RFKILL_STATE, + "IpwRfkillState", + "ipw rf-kill state", + RFKILL_UNBLOCKED, RFKILL_HARD_BLOCKED, RFKILL_UNBLOCKED, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | NM_PROPERTY_PARAM_NO_EXPORT)); + + /* Signals */ + signals[ACCESS_POINT_ADDED] = + g_signal_new ("access-point-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + + signals[ACCESS_POINT_REMOVED] = + g_signal_new ("access-point-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + + signals[HIDDEN_AP_FOUND] = + g_signal_new ("hidden-ap-found", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMDeviceWifiClass, hidden_ap_found), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDeviceWifiClass, properties_changed)); + + signals[SCANNING_ALLOWED] = + g_signal_new ("scanning-allowed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMDeviceWifiClass, scanning_allowed), + scanning_allowed_accumulator, NULL, + _nm_marshal_BOOLEAN__VOID, + G_TYPE_BOOLEAN, 0); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_nm_device_wifi_object_info); + + dbus_g_error_domain_register (NM_WIFI_ERROR, NULL, NM_TYPE_WIFI_ERROR); +} + + diff --git a/src/nm-device-wifi.h b/src/nm-device-wifi.h new file mode 100644 index 00000000..11ac8857 --- /dev/null +++ b/src/nm-device-wifi.h @@ -0,0 +1,107 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef NM_DEVICE_WIFI_H +#define NM_DEVICE_WIFI_H + +#include +#include +#include + +#include "nm-rfkill.h" +#include "nm-device.h" +#include "nm-wifi-ap.h" + +struct NMAccessPointList; + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_WIFI (nm_device_wifi_get_type ()) +#define NM_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifi)) +#define NM_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass)) +#define NM_IS_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_WIFI)) +#define NM_IS_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_WIFI)) +#define NM_DEVICE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass)) + + +#define NM_DEVICE_WIFI_HW_ADDRESS "hw-address" +#define NM_DEVICE_WIFI_MODE "mode" +#define NM_DEVICE_WIFI_BITRATE "bitrate" +#define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point" +#define NM_DEVICE_WIFI_CAPABILITIES "wireless-capabilities" +#define NM_DEVICE_WIFI_SCANNING "scanning" +#define NM_DEVICE_WIFI_IPW_RFKILL_STATE "ipw-rfkill-state" + +#ifndef NM_DEVICE_WIFI_DEFINED +#define NM_DEVICE_WIFI_DEFINED +typedef struct _NMDeviceWifi NMDeviceWifi; +#endif + +typedef struct _NMDeviceWifiClass NMDeviceWifiClass; +typedef struct _NMDeviceWifiPrivate NMDeviceWifiPrivate; + +struct _NMDeviceWifi +{ + NMDevice parent; + + /*< private >*/ + NMDeviceWifiPrivate *priv; +}; + +struct _NMDeviceWifiClass +{ + NMDeviceClass parent; + + /* Signals */ + void (*access_point_added) (NMDeviceWifi *device, NMAccessPoint *ap); + void (*access_point_removed) (NMDeviceWifi *device, NMAccessPoint *ap); + void (*hidden_ap_found) (NMDeviceWifi *device, NMAccessPoint *ap); + void (*properties_changed) (NMDeviceWifi *device, GHashTable *properties); + gboolean (*scanning_allowed) (NMDeviceWifi *device); +}; + + +GType nm_device_wifi_get_type (void); + +NMDevice *nm_device_wifi_new (const char *udi, + const char *iface, + const char *driver); + +void nm_device_wifi_get_address (NMDeviceWifi *dev, + struct ether_addr *addr); + +void nm_device_wifi_get_bssid (NMDeviceWifi *dev, + struct ether_addr *bssid); + +const GByteArray * nm_device_wifi_get_ssid (NMDeviceWifi *self); + +gboolean nm_device_wifi_set_mode (NMDeviceWifi *self, + const NM80211Mode mode); + +NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *self); + +NMAccessPoint * nm_device_wifi_get_activation_ap (NMDeviceWifi *self); + +RfKillState nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self); + +G_END_DECLS + +#endif /* NM_DEVICE_WIFI_H */ diff --git a/src/nm-device.c b/src/nm-device.c new file mode 100644 index 00000000..176d90f9 --- /dev/null +++ b/src/nm-device.c @@ -0,0 +1,3827 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-glib-compat.h" +#include "nm-device-interface.h" +#include "nm-device.h" +#include "nm-device-private.h" +#include "NetworkManagerUtils.h" +#include "nm-system.h" +#include "nm-dhcp-manager.h" +#include "nm-dbus-manager.h" +#include "nm-named-manager.h" +#include "nm-utils.h" +#include "nm-logging.h" +#include "nm-netlink-monitor.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-ip6-config.h" +#include "nm-setting-connection.h" +#include "nm-dnsmasq-manager.h" +#include "nm-dhcp4-config.h" +#include "nm-ip6-manager.h" +#include "nm-marshal.h" +#include "nm-rfkill.h" + +#define NM_ACT_REQUEST_IP4_CONFIG "nm-act-request-ip4-config" +#define NM_ACT_REQUEST_IP6_CONFIG "nm-act-request-ip6-config" + +static void device_interface_init (NMDeviceInterface *device_interface_class); + +G_DEFINE_TYPE_EXTENDED (NMDevice, nm_device, G_TYPE_OBJECT, G_TYPE_FLAG_ABSTRACT, + G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init)) + +enum { + AUTOCONNECT_ALLOWED, + LAST_SIGNAL, +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +#define NM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE, NMDevicePrivate)) + +typedef struct { + gboolean disposed; + gboolean initialized; + + NMDeviceState state; + guint failed_to_disconnected_id; + guint unavailable_to_disconnected_id; + + char * udi; + char * path; + char * iface; /* may change, could be renamed by user */ + int ifindex; + char * ip_iface; + int ip_ifindex; + NMDeviceType type; + char * type_desc; + guint32 capabilities; + char * driver; + gboolean managed; /* whether managed by NM or not */ + RfKillType rfkill_type; + + guint32 ip4_address; + + NMActRequest * act_request; + guint act_source_id; + gpointer act_source_func; + guint act_source6_id; + gpointer act_source6_func; + gulong secrets_updated_id; + gulong secrets_failed_id; + + gboolean ip4_ready; + gboolean ip6_ready; + + /* Generic DHCP stuff */ + NMDHCPManager * dhcp_manager; + guint32 dhcp_timeout; + GByteArray * dhcp_anycast_address; + + /* IP4 configuration info */ + NMIP4Config * ip4_config; /* Config from DHCP, PPP, or system config files */ + NMDHCPClient * dhcp4_client; + gulong dhcp4_state_sigid; + gulong dhcp4_timeout_sigid; + NMDHCP4Config * dhcp4_config; + + /* dnsmasq stuff for shared connections */ + NMDnsMasqManager *dnsmasq_manager; + gulong dnsmasq_state_id; + + /* avahi-autoipd stuff */ + GPid aipd_pid; + guint aipd_watch; + guint aipd_timeout; + guint32 aipd_addr; + + /* IP6 configuration info */ + NMIP6Config * ip6_config; + NMIP6Manager * ip6_manager; + gulong ip6_addrconf_sigid; + gulong ip6_config_changed_sigid; + gboolean ip6_waiting_for_config; + + char * ip6_accept_ra_path; + guint32 ip6_accept_ra_save; + + NMDHCPClient * dhcp6_client; + guint32 dhcp6_mode; + gulong dhcp6_state_sigid; + gulong dhcp6_timeout_sigid; + NMDHCP6Config * dhcp6_config; + + /* inhibit autoconnect feature */ + gboolean autoconnect_inhibit; +} NMDevicePrivate; + +static gboolean check_connection_compatible (NMDeviceInterface *device, + NMConnection *connection, + GError **error); +static gboolean nm_device_activate (NMDeviceInterface *device, + NMActRequest *req, + GError **error); +static void nm_device_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason); +static gboolean device_disconnect (NMDeviceInterface *device, GError **error); +static gboolean spec_match_list (NMDeviceInterface *device, const GSList *specs); +static NMConnection *connection_match_config (NMDeviceInterface *device, const GSList *connections); + +static void nm_device_activate_schedule_stage5_ip_config_commit (NMDevice *self, int family); + +static void nm_device_take_down (NMDevice *dev, gboolean wait, NMDeviceStateReason reason); + +static gboolean nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware); +static gboolean nm_device_is_up (NMDevice *self); + +static gboolean nm_device_set_ip4_config (NMDevice *dev, + NMIP4Config *config, + gboolean assumed, + NMDeviceStateReason *reason); +static gboolean nm_device_set_ip6_config (NMDevice *dev, + NMIP6Config *config, + gboolean assumed, + NMDeviceStateReason *reason); + +static NMActStageReturn dhcp6_start (NMDevice *self, + NMConnection *connection, + guint32 dhcp_opt, + NMDeviceStateReason *reason); + +static void addrconf6_cleanup (NMDevice *self); +static void dhcp6_cleanup (NMDevice *self, gboolean stop); +static void dhcp4_cleanup (NMDevice *self, gboolean stop); + + +static void +device_interface_init (NMDeviceInterface *device_interface_class) +{ + /* interface implementation */ + device_interface_class->check_connection_compatible = check_connection_compatible; + device_interface_class->activate = nm_device_activate; + device_interface_class->deactivate = nm_device_deactivate; + device_interface_class->disconnect = device_disconnect; + device_interface_class->spec_match_list = spec_match_list; + device_interface_class->connection_match_config = connection_match_config; +} + + +static void +nm_device_init (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + priv->type = NM_DEVICE_TYPE_UNKNOWN; + priv->capabilities = NM_DEVICE_CAP_NONE; + priv->state = NM_DEVICE_STATE_UNMANAGED; + priv->dhcp_timeout = 0; + priv->rfkill_type = RFKILL_TYPE_UNKNOWN; +} + +static void +update_accept_ra_save (NMDevice *self) +{ + NMDevicePrivate *priv; + const char *ip_iface; + char *new_path; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + ip_iface = nm_device_get_ip_iface (self); + + new_path = g_strdup_printf ("/proc/sys/net/ipv6/conf/%s/accept_ra", ip_iface); + g_assert (new_path); + + if (priv->ip6_accept_ra_path) { + /* If the IP iface is different from before, use the new value */ + if (!strcmp (new_path, priv->ip6_accept_ra_path)) { + g_free (new_path); + return; + } + g_free (priv->ip6_accept_ra_path); + } + + /* Grab the original value of "accept_ra" so we can restore it when NM exits */ + priv->ip6_accept_ra_path = new_path; + if (!nm_utils_get_proc_sys_net_value (priv->ip6_accept_ra_path, + ip_iface, + &priv->ip6_accept_ra_save)) { + g_free (priv->ip6_accept_ra_path); + priv->ip6_accept_ra_path = NULL; + } +} + +static GObject* +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMDevice *dev; + NMDevicePrivate *priv; + + object = G_OBJECT_CLASS (nm_device_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + dev = NM_DEVICE (object); + priv = NM_DEVICE_GET_PRIVATE (dev); + + if (!priv->udi) { + nm_log_err (LOGD_DEVICE, "No device udi provided, ignoring"); + goto error; + } + + if (!priv->iface) { + nm_log_err (LOGD_DEVICE, "No device interface provided, ignoring"); + goto error; + } + + priv->capabilities |= NM_DEVICE_GET_CLASS (dev)->get_generic_capabilities (dev); + if (!(priv->capabilities & NM_DEVICE_CAP_NM_SUPPORTED)) { + nm_log_warn (LOGD_DEVICE, "(%s): Device unsupported, ignoring.", priv->iface); + goto error; + } + + if (NM_DEVICE_GET_CLASS (dev)->update_hw_address) + NM_DEVICE_GET_CLASS (dev)->update_hw_address (dev); + + priv->dhcp_manager = nm_dhcp_manager_get (); + + update_accept_ra_save (dev); + + priv->initialized = TRUE; + return object; + +error: + g_object_unref (dev); + return NULL; +} + +static gboolean +nm_device_hw_is_up (NMDevice *self) +{ + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + + if (NM_DEVICE_GET_CLASS (self)->hw_is_up) + return NM_DEVICE_GET_CLASS (self)->hw_is_up (self); + + return TRUE; +} + +static guint32 +real_get_generic_capabilities (NMDevice *dev) +{ + return 0; +} + +void +nm_device_set_path (NMDevice *self, const char *path) +{ + NMDevicePrivate *priv; + + g_return_if_fail (self != NULL); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->path == NULL); + + priv->path = g_strdup (path); +} + +const char * +nm_device_get_path (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + + return NM_DEVICE_GET_PRIVATE (self)->path; +} + +const char * +nm_device_get_udi (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + + return NM_DEVICE_GET_PRIVATE (self)->udi; +} + +/* + * Get/set functions for iface + */ +const char * +nm_device_get_iface (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + + return NM_DEVICE_GET_PRIVATE (self)->iface; +} + +int +nm_device_get_ifindex (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, 0); + + return NM_DEVICE_GET_PRIVATE (self)->ifindex; +} + +const char * +nm_device_get_ip_iface (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (self != NULL, NULL); + + priv = NM_DEVICE_GET_PRIVATE (self); + /* If it's not set, default to iface */ + return priv->ip_iface ? priv->ip_iface : priv->iface; +} + +int +nm_device_get_ip_ifindex (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (self != NULL, 0); + + priv = NM_DEVICE_GET_PRIVATE (self); + /* If it's not set, default to iface */ + return priv->ip_iface ? priv->ip_ifindex : priv->ifindex; +} + +void +nm_device_set_ip_iface (NMDevice *self, const char *iface) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_free (priv->ip_iface); + priv->ip_ifindex = 0; + + priv->ip_iface = g_strdup (iface); + if (priv->ip_iface) { + priv->ip_ifindex = nm_netlink_iface_to_index (priv->ip_iface); + if (!priv->ip_ifindex) { + nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", iface); + } + } +} + + +/* + * Get/set functions for driver + */ +const char * +nm_device_get_driver (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + + return NM_DEVICE_GET_PRIVATE (self)->driver; +} + + +/* + * Get/set functions for type + */ +NMDeviceType +nm_device_get_device_type (NMDevice *self) +{ + g_return_val_if_fail (NM_IS_DEVICE (self), NM_DEVICE_TYPE_UNKNOWN); + + return NM_DEVICE_GET_PRIVATE (self)->type; +} + + +int +nm_device_get_priority (NMDevice *dev) +{ + g_return_val_if_fail (NM_IS_DEVICE (dev), -1); + + return (int) nm_device_get_device_type (dev); +} + + +/* + * Accessor for capabilities + */ +guint32 +nm_device_get_capabilities (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NM_DEVICE_CAP_NONE); + + return NM_DEVICE_GET_PRIVATE (self)->capabilities; +} + +/* + * Accessor for type-specific capabilities + */ +guint32 +nm_device_get_type_capabilities (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NM_DEVICE_CAP_NONE); + + return NM_DEVICE_GET_CLASS (self)->get_type_capabilities (self); +} + +static guint32 +real_get_type_capabilities (NMDevice *self) +{ + return NM_DEVICE_CAP_NONE; +} + + +const char * +nm_device_get_type_desc (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + + return NM_DEVICE_GET_PRIVATE (self)->type_desc; +} + +/* + * nm_device_get_act_request + * + * Return the devices activation request, if any. + * + */ +NMActRequest * +nm_device_get_act_request (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + + return NM_DEVICE_GET_PRIVATE (self)->act_request; +} + + +gboolean +nm_device_is_available (NMDevice *self) +{ + if (NM_DEVICE_GET_CLASS (self)->is_available) + return NM_DEVICE_GET_CLASS (self)->is_available (self); + return TRUE; +} + +static gboolean +autoconnect_allowed_accumulator (GSignalInvocationHint *ihint, + GValue *return_accu, + const GValue *handler_return, gpointer data) +{ + if (!g_value_get_boolean (handler_return)) + g_value_set_boolean (return_accu, FALSE); + return TRUE; +} + +gboolean +nm_device_autoconnect_allowed (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + GValue instance = { 0, }; + GValue retval = { 0, }; + + g_value_init (&instance, G_TYPE_OBJECT); + g_value_take_object (&instance, self); + + g_value_init (&retval, G_TYPE_BOOLEAN); + if (priv->autoconnect_inhibit) + g_value_set_boolean (&retval, FALSE); + else + g_value_set_boolean (&retval, TRUE); + + /* Use g_signal_emitv() rather than g_signal_emit() to avoid the return + * value being changed if no handlers are connected */ + g_signal_emitv (&instance, signals[AUTOCONNECT_ALLOWED], 0, &retval); + return g_value_get_boolean (&retval); +} + +NMConnection * +nm_device_get_best_auto_connection (NMDevice *dev, + GSList *connections, + char **specific_object) +{ + guint32 caps; + + g_return_val_if_fail (NM_IS_DEVICE (dev), NULL); + g_return_val_if_fail (specific_object != NULL, NULL); + g_return_val_if_fail (*specific_object == NULL, NULL); + + caps = nm_device_get_capabilities (dev); + /* Don't use devices that SUCK */ + if (!(caps & NM_DEVICE_CAP_NM_SUPPORTED)) + return NULL; + + if (!NM_DEVICE_GET_CLASS (dev)->get_best_auto_connection) + return NULL; + + return NM_DEVICE_GET_CLASS (dev)->get_best_auto_connection (dev, connections, specific_object); +} + +static void +dnsmasq_state_changed_cb (NMDnsMasqManager *manager, guint32 status, gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + + switch (status) { + case NM_DNSMASQ_STATUS_DEAD: + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SHARED_START_FAILED); + break; + default: + break; + } +} + +static void +activation_source_clear (NMDevice *self, gboolean remove_source, int family) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + guint *act_source_id; + gpointer *act_source_func; + + if (family == AF_INET6) { + act_source_id = &priv->act_source6_id; + act_source_func = &priv->act_source6_func; + } else { + act_source_id = &priv->act_source_id; + act_source_func = &priv->act_source_func; + } + + if (*act_source_id) { + if (remove_source) + g_source_remove (*act_source_id); + *act_source_id = 0; + *act_source_func = NULL; + } +} + +static void +activation_source_schedule (NMDevice *self, GSourceFunc func, int family) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + guint *act_source_id; + gpointer *act_source_func; + + if (family == AF_INET6) { + act_source_id = &priv->act_source6_id; + act_source_func = &priv->act_source6_func; + } else { + act_source_id = &priv->act_source_id; + act_source_func = &priv->act_source_func; + } + + if (*act_source_id) { + nm_log_err (LOGD_DEVICE, "activation stage already scheduled"); + } + + /* Don't bother rescheduling the same function that's about to + * run anyway. Fixes issues with crappy wireless drivers sending + * streams of associate events before NM has had a chance to process + * the first one. + */ + if (!*act_source_id || (*act_source_func != func)) { + activation_source_clear (self, TRUE, family); + *act_source_id = g_idle_add (func, self); + *act_source_func = func; + } +} + +gboolean +nm_device_ip_config_should_fail (NMDevice *self, gboolean ip6) +{ + NMActRequest *req; + NMConnection *connection; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + + g_return_val_if_fail (self != NULL, TRUE); + + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* Fail the connection if the failed IP method is required to complete */ + if (ip6) { + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6 && !nm_setting_ip6_config_get_may_fail (s_ip6)) + return TRUE; + } else { + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4 && !nm_setting_ip4_config_get_may_fail (s_ip4)) + return TRUE; + } + + return FALSE; +} + +static void +ip6_addrconf_complete (NMIP6Manager *ip6_manager, + int ifindex, + guint dhcp_opts, + gboolean success, + gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActRequest *req; + NMConnection *connection; + NMActStageReturn ret; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + NMDeviceState state; + + if (ifindex != nm_device_get_ip_ifindex (self)) + return; + req = nm_device_get_act_request (self); + if (!req) + return; + connection = nm_act_request_get_connection (req); + g_assert (connection); + + if (!priv->ip6_waiting_for_config) + return; + + priv->ip6_waiting_for_config = FALSE; + + if (!success) { + nm_device_activate_schedule_stage4_ip6_config_timeout (self); + return; + } + + priv->dhcp6_mode = dhcp_opts; + + /* If addrconf is all that's required, we're done */ + if (priv->dhcp6_mode == IP6_DHCP_OPT_NONE) { + nm_device_activate_schedule_stage4_ip6_config_get (self); + return; + } + + /* If the router said to use DHCP for managed or otherconf, do it */ + + /* Don't re-start DHCPv6 if it's already in progress */ + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); + if ((state != NM_DEVICE_STATE_IP_CONFIG) || priv->dhcp6_client) + return; + + nm_log_info (LOGD_DEVICE | LOGD_DHCP6, + "Activation (%s) Stage 3 of 5 (IP Configure Start) starting DHCPv6" + " as requested by IPv6 router...", + priv->iface); + + ret = dhcp6_start (self, connection, priv->dhcp6_mode, &reason); + switch (ret) { + case NM_ACT_STAGE_RETURN_SUCCESS: + /* Shouldn't get this, but handle it anyway */ + g_warn_if_reached (); + nm_device_activate_schedule_stage4_ip6_config_get (self); + break; + case NM_ACT_STAGE_RETURN_POSTPONE: + /* Success; wait for DHCPv6 to complete */ + break; + default: + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + break; + } +} + +static void +ip6_config_changed (NMIP6Manager *ip6_manager, + int ifindex, + guint dhcp_opts, + gboolean success, + gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + + if (ifindex != nm_device_get_ip_ifindex (self)) + return; + if (!nm_device_get_act_request (self)) + return; + + /* FIXME: re-run DHCPv6 here to get any new nameservers or whatever */ + + if (!success && (nm_device_get_state (self) == NM_DEVICE_STATE_ACTIVATED)) { + nm_device_state_changed (self, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + return; + } + + nm_device_activate_schedule_stage4_ip6_config_get (self); +} + +static gboolean +ip6_method_matches (NMConnection *connection, const char *match) +{ + NMSettingIP6Config *s_ip6; + const char *method = NULL; + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) { + method = nm_setting_ip6_config_get_method (s_ip6); + g_assert (method); + } + + /* Treat missing IP6 setting as IGNORE */ + if (!s_ip6 && !strcmp (match, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) + return TRUE; + + return method && !strcmp (method, match); +} + +static gboolean +addrconf6_setup (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActRequest *req; + NMConnection *connection; + NMSettingIP6Config *s_ip6; + + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + if (!priv->ip6_manager) { + priv->ip6_manager = nm_ip6_manager_get (); + priv->ip6_addrconf_sigid = g_signal_connect (priv->ip6_manager, + "addrconf-complete", + G_CALLBACK (ip6_addrconf_complete), + self); + priv->ip6_config_changed_sigid = g_signal_connect (priv->ip6_manager, + "config-changed", + G_CALLBACK (ip6_config_changed), + self); + } + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + nm_ip6_manager_prepare_interface (priv->ip6_manager, + nm_device_get_ip_ifindex (self), + s_ip6, + priv->ip6_accept_ra_path); + priv->ip6_waiting_for_config = TRUE; + + return TRUE; +} + +static void +addrconf6_cleanup (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (!priv->ip6_manager) + return; + + if (priv->ip6_addrconf_sigid) { + g_signal_handler_disconnect (priv->ip6_manager, + priv->ip6_addrconf_sigid); + priv->ip6_addrconf_sigid = 0; + } + if (priv->ip6_config_changed_sigid) { + g_signal_handler_disconnect (priv->ip6_manager, + priv->ip6_config_changed_sigid); + priv->ip6_config_changed_sigid = 0; + } + + nm_ip6_manager_cancel_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); + g_object_unref (priv->ip6_manager); + priv->ip6_manager = NULL; +} + +static NMActStageReturn +real_act_stage1_prepare (NMDevice *self, NMDeviceStateReason *reason) +{ + return NM_ACT_STAGE_RETURN_SUCCESS; +} + +/* + * nm_device_activate_stage1_device_prepare + * + * Prepare for device activation + * + */ +static gboolean +nm_device_activate_stage1_device_prepare (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + const char *iface; + NMActStageReturn ret; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, 0); + + priv->ip4_ready = priv->ip6_ready = FALSE; + + iface = nm_device_get_iface (self); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 1 of 5 (Device Prepare) started...", iface); + nm_device_state_changed (self, NM_DEVICE_STATE_PREPARE, NM_DEVICE_STATE_REASON_NONE); + + ret = NM_DEVICE_GET_CLASS (self)->act_stage1_prepare (self, &reason); + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) { + goto out; + } else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } + g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); + + nm_device_activate_schedule_stage2_device_config (self); + +out: + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 1 of 5 (Device Prepare) complete.", iface); + return FALSE; +} + + +/* + * nm_device_activate_schedule_stage1_device_prepare + * + * Prepare a device for activation + * + */ +void +nm_device_activate_schedule_stage1_device_prepare (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + + activation_source_schedule (self, nm_device_activate_stage1_device_prepare, 0); + + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 1 of 5 (Device Prepare) scheduled...", + nm_device_get_iface (self)); +} + +static NMActStageReturn +real_act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason) +{ + /* Nothing to do */ + return NM_ACT_STAGE_RETURN_SUCCESS; +} + +/* + * nm_device_activate_stage2_device_config + * + * Determine device parameters and set those on the device, ie + * for wireless devices, set SSID, keys, etc. + * + */ +static gboolean +nm_device_activate_stage2_device_config (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + const char * iface; + NMActStageReturn ret; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + gboolean no_firmware = FALSE; + + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, 0); + + iface = nm_device_get_iface (self); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 2 of 5 (Device Configure) starting...", iface); + nm_device_state_changed (self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE); + + if (!nm_device_bring_up (self, FALSE, &no_firmware)) { + if (no_firmware) + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_FIRMWARE_MISSING); + else + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_CONFIG_FAILED); + goto out; + } + + ret = NM_DEVICE_GET_CLASS (self)->act_stage2_config (self, &reason); + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) + goto out; + else if (ret == NM_ACT_STAGE_RETURN_FAILURE) + { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } + g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); + + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 2 of 5 (Device Configure) successful.", iface); + + nm_device_activate_schedule_stage3_ip_config_start (self); + +out: + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 2 of 5 (Device Configure) complete.", iface); + return FALSE; +} + + +/* + * nm_device_activate_schedule_stage2_device_config + * + * Schedule setup of the hardware device + * + */ +void +nm_device_activate_schedule_stage2_device_config (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + + activation_source_schedule (self, nm_device_activate_stage2_device_config, 0); + + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 2 of 5 (Device Configure) scheduled...", + nm_device_get_iface (self)); +} + +static void +aipd_timeout_remove (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->aipd_timeout) { + g_source_remove (priv->aipd_timeout); + priv->aipd_timeout = 0; + } +} + +static void +aipd_cleanup (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->aipd_watch) { + g_source_remove (priv->aipd_watch); + priv->aipd_watch = 0; + } + + if (priv->aipd_pid > 0) { + kill (priv->aipd_pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_AUTOIP4, "waiting for avahi-autoipd pid %d to exit", priv->aipd_pid); + waitpid (priv->aipd_pid, NULL, 0); + nm_log_dbg (LOGD_AUTOIP4, "avahi-autoip pid %d cleaned up", priv->aipd_pid); + + priv->aipd_pid = -1; + } + + aipd_timeout_remove (self); + + priv->aipd_addr = 0; +} + +static NMIP4Config * +aipd_get_ip4_config (NMDevice *self, NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMIP4Config *config = NULL; + NMIP4Address *addr; + NMIP4Route *route; + + g_return_val_if_fail (priv->aipd_addr > 0, NULL); + + config = nm_ip4_config_new (); + if (!config) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + return NULL; + } + + addr = nm_ip4_address_new (); + nm_ip4_address_set_address (addr, (guint32) priv->aipd_addr); + nm_ip4_address_set_prefix (addr, 16); + nm_ip4_config_take_address (config, addr); + + /* Add a multicast route for link-local connections: destination= 224.0.0.0, netmask=240.0.0.0 */ + route = nm_ip4_route_new (); + nm_ip4_route_set_dest (route, (guint32) htonl (0xE0000000L)); + nm_ip4_route_set_prefix (route, 4); + nm_ip4_route_set_next_hop (route, (guint32) 0); + nm_ip4_route_set_metric (route, 0); + nm_ip4_config_take_route (config, route); + + return config; +} + +static gboolean +handle_autoip_change (NMDevice *self, NMDeviceStateReason *reason) +{ + NMActRequest *req; + NMConnection *connection; + NMIP4Config *config; + + g_return_val_if_fail (reason != NULL, FALSE); + + config = aipd_get_ip4_config (self, reason); + if (!config) { + nm_log_err (LOGD_AUTOIP4, "failed to get autoip config for rebind"); + return FALSE; + } + + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP4_CONFIG, config); + + if (!nm_device_set_ip4_config (self, config, FALSE, reason)) { + nm_log_err (LOGD_AUTOIP4, "(%s): failed to update IP4 config in response to autoip event.", + nm_device_get_iface (self)); + return FALSE; + } + + return TRUE; +} + +#define IPV4LL_NETWORK (htonl (0xA9FE0000L)) +#define IPV4LL_NETMASK (htonl (0xFFFF0000L)) + +void +nm_device_handle_autoip4_event (NMDevice *self, + const char *event, + const char *address) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActRequest *req; + NMConnection *connection = NULL; + NMSettingIP4Config *s_ip4 = NULL; + NMDeviceState state; + const char *iface, *method = NULL; + + g_return_if_fail (event != NULL); + + req = nm_device_get_act_request (self); + if (!req) + return; + + connection = nm_act_request_get_connection (req); + if (!connection) + return; + + /* Ignore if the connection isn't an AutoIP connection */ + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + method = nm_setting_ip4_config_get_method (s_ip4); + + if (!s_ip4 || !method || strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) + return; + + iface = nm_device_get_iface (self); + state = nm_device_get_state (self); + + if (strcmp (event, "BIND") == 0) { + struct in_addr ip; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + if (inet_pton (AF_INET, address, &ip) <= 0) { + nm_log_err (LOGD_AUTOIP4, "(%s): invalid address %s received from avahi-autoipd.", + iface, address); + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_AUTOIP_ERROR); + return; + } + + if ((ip.s_addr & IPV4LL_NETMASK) != IPV4LL_NETWORK) { + nm_log_err (LOGD_AUTOIP4, "(%s): invalid address %s received from avahi-autoipd (not link-local).", + iface, address); + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_AUTOIP_ERROR); + return; + } + + switch (state) { + case NM_DEVICE_STATE_IP_CONFIG: + if (priv->aipd_addr) { + nm_log_warn (LOGD_AUTOIP4, "(%s): already have autoip address!", iface); + return; + } + + priv->aipd_addr = ip.s_addr; + aipd_timeout_remove (self); + nm_device_activate_schedule_stage4_ip4_config_get (self); + break; + case NM_DEVICE_STATE_ACTIVATED: + priv->aipd_addr = ip.s_addr; + if (!handle_autoip_change (self, &reason)) + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + break; + default: + nm_log_warn (LOGD_AUTOIP4, "(%s): unexpected avahi-autoip event %s for %s.", + iface, event, address); + break; + } + } else { + nm_log_warn (LOGD_AUTOIP4, "(%s): autoip address %s no longer valid because '%s'.", + iface, address, event); + + /* The address is gone; terminate the connection or fail activation */ + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + } +} + +static void +aipd_watch_cb (GPid pid, gint status, gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMDeviceState state; + const char *iface; + + if (!priv->aipd_watch) + return; + priv->aipd_watch = 0; + + iface = nm_device_get_iface (self); + + if (WIFEXITED (status)) { + nm_log_dbg (LOGD_AUTOIP4, "(%s): avahi-autoipd exited with error code %d", + iface, WEXITSTATUS (status)); + } else if (WIFSTOPPED (status)) { + nm_log_warn (LOGD_AUTOIP4, "(%s): avahi-autoipd stopped unexpectedly with signal %d", + iface, WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_warn (LOGD_AUTOIP4, "(%s): avahi-autoipd died with signal %d", + iface, WTERMSIG (status)); + } else { + nm_log_warn (LOGD_AUTOIP4, "(%s): avahi-autoipd died from an unknown cause", iface); + } + + aipd_cleanup (self); + + state = nm_device_get_state (self); + if (nm_device_is_activating (self) || (state == NM_DEVICE_STATE_ACTIVATED)) + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_AUTOIP_FAILED); +} + +static gboolean +aipd_timeout_cb (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (!priv->aipd_timeout) + return FALSE; + priv->aipd_timeout = 0; + + nm_log_info (LOGD_AUTOIP4, "(%s): avahi-autoipd timed out.", nm_device_get_iface (self)); + aipd_cleanup (self); + + if (nm_device_get_state (self) == NM_DEVICE_STATE_IP_CONFIG) + nm_device_activate_schedule_stage4_ip4_config_timeout (self); + + 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); +} + +static gboolean +aipd_exec (NMDevice *self, GError **error) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + char *argv[5]; + gboolean success = FALSE; + const char **aipd_binary = NULL; + static const char *aipd_paths[] = { + "/usr/sbin/avahi-autoipd", + "/usr/local/sbin/avahi-autoipd", + NULL + }; + + aipd_cleanup (self); + + /* Find avahi-autoipd */ + aipd_binary = aipd_paths; + while (*aipd_binary != NULL) { + if (g_file_test (*aipd_binary, G_FILE_TEST_EXISTS)) + break; + aipd_binary++; + } + + if (!*aipd_binary) { + g_set_error (error, 0, 0, "%s", "couldn't find avahi-autoipd"); + return FALSE; + } + + argv[0] = (char *) (*aipd_binary); + argv[1] = "--script"; + argv[2] = LIBEXECDIR "/nm-avahi-autoipd.action"; + argv[3] = (char *) nm_device_get_ip_iface (self); + argv[4] = NULL; + + success = g_spawn_async ("/", argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, + &aipd_child_setup, NULL, &(priv->aipd_pid), error); + if (!success) + return FALSE; + + /* Monitor the child process so we know when it dies */ + priv->aipd_watch = g_child_watch_add (priv->aipd_pid, aipd_watch_cb, self); + + /* Start a timeout to bound the address attempt */ + priv->aipd_timeout = g_timeout_add_seconds (20, aipd_timeout_cb, self); + + return TRUE; +} + +static void +dhcp4_add_option_cb (gpointer key, gpointer value, gpointer user_data) +{ + nm_dhcp4_config_add_option (NM_DHCP4_CONFIG (user_data), + (const char *) key, + (const char *) value); +} + +static void +dhcp6_add_option_cb (gpointer key, gpointer value, gpointer user_data) +{ + nm_dhcp6_config_add_option (NM_DHCP6_CONFIG (user_data), + (const char *) key, + (const char *) value); +} + +static void +handle_dhcp_lease_change (NMDevice *device, gboolean ipv6) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + NMIP4Config *ip4_config; + NMSettingIP4Config *s_ip4; + NMIP6Config *ip6_config; + NMSettingIP6Config *s_ip6; + NMConnection *connection; + NMActRequest *req; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + gboolean assumed; + + req = nm_device_get_act_request (device); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + assumed = nm_act_request_get_assumed (req); + + if (ipv6) { + ip6_config = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); + if (!ip6_config) { + nm_log_warn (LOGD_DHCP6, "(%s): failed to get DHCPv6 config for rebind", + nm_device_get_ip_iface (device)); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + return; + } + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + nm_utils_merge_ip6_config (ip6_config, s_ip6); + + g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP6_CONFIG, ip6_config); + + if (nm_device_set_ip6_config (device, ip6_config, assumed, &reason)) { + nm_dhcp6_config_reset (priv->dhcp6_config); + nm_dhcp_client_foreach_option (priv->dhcp6_client, + dhcp6_add_option_cb, + priv->dhcp6_config); + } else { + nm_log_warn (LOGD_DHCP6, "(%s): failed to update IPv6 config in response to DHCP event.", + nm_device_get_ip_iface (device)); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + } + } else { + ip4_config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); + if (!ip4_config) { + nm_log_warn (LOGD_DHCP6, "(%s): failed to get DHCPv4 config for rebind", + nm_device_get_ip_iface (device)); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + return; + } + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + nm_utils_merge_ip4_config (ip4_config, s_ip4); + + g_object_set_data (G_OBJECT (req), NM_ACT_REQUEST_IP4_CONFIG, ip4_config); + + if (nm_device_set_ip4_config (device, ip4_config, assumed, &reason)) { + nm_dhcp4_config_reset (priv->dhcp4_config); + nm_dhcp_client_foreach_option (priv->dhcp4_client, + dhcp4_add_option_cb, + priv->dhcp4_config); + } else { + nm_log_warn (LOGD_DHCP6, "(%s): failed to update IPv4 config in response to DHCP event.", + nm_device_get_ip_iface (device)); + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, reason); + } + } +} + +static void +dhcp_state_changed (NMDHCPClient *client, + NMDHCPState state, + gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + NMDeviceState dev_state; + gboolean ipv6; + + ipv6 = nm_dhcp_client_get_ipv6 (client); + dev_state = nm_device_get_state (device); + + if (ipv6) { + nm_log_dbg (LOGD_DHCP6, "(%s): new DHCPv6 client state %d", + nm_device_get_iface (device), dev_state); + } else { + nm_log_dbg (LOGD_DHCP4, "(%s): new DHCPv4 client state %d", + nm_device_get_iface (device), dev_state); + } + + switch (state) { + case DHC_BOUND4: /* lease obtained */ + case DHC_BOUND6: + case DHC_RENEW4: /* lease renewed */ + case DHC_RENEW6: /* lease renewed */ + case DHC_REBOOT: /* have valid lease, but now obtained a different one */ + case DHC_REBIND4: /* new, different lease */ + case DHC_REBIND6: /* new, different lease */ + if (dev_state == NM_DEVICE_STATE_IP_CONFIG) { + if (ipv6) + nm_device_activate_schedule_stage4_ip6_config_get (device); + else + nm_device_activate_schedule_stage4_ip4_config_get (device); + } else if (dev_state == NM_DEVICE_STATE_ACTIVATED) + handle_dhcp_lease_change (device, ipv6); + break; + case DHC_TIMEOUT: /* timed out contacting DHCP server */ + if (ipv6) { + nm_dhcp6_config_reset (priv->dhcp6_config); + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) + nm_device_activate_schedule_stage4_ip6_config_timeout (device); + } else { + nm_dhcp4_config_reset (priv->dhcp4_config); + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) + nm_device_activate_schedule_stage4_ip4_config_timeout (device); + } + break; + case DHC_END: /* dhclient exited normally */ + /* 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 + * normal. In that case we just ignore the exit. + */ + if (ipv6 && (priv->dhcp6_mode == IP6_DHCP_OPT_OTHERCONF)) + break; + /* Otherwise, fall through */ + case DHC_FAIL: /* all attempts to contact server timed out, sleeping */ + case DHC_ABEND: /* dhclient exited abnormally */ + if (ipv6) + nm_dhcp6_config_reset (priv->dhcp6_config); + else + nm_dhcp4_config_reset (priv->dhcp4_config); + + /* dhclient quit and can't get/renew a lease; so kill the connection */ + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) { + if (ipv6) + nm_device_activate_schedule_stage4_ip6_config_timeout (device); + else + nm_device_activate_schedule_stage4_ip4_config_timeout (device); + } else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + break; + case DHC_STOP: + case DHC_STOP6: + case DHC_EXPIRE: + case DHC_EXPIRE6: + if (dev_state == NM_DEVICE_STATE_ACTIVATED) { + if (ipv6) + nm_dhcp6_config_reset (priv->dhcp6_config); + else + nm_dhcp4_config_reset (priv->dhcp4_config); + + /* dhclient quit and can't get/renew a lease; so kill the connection */ + nm_device_state_changed (device, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); + } + break; + default: + break; + } +} + +static void +dhcp_timeout (NMDHCPClient *client, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (user_data); + + if (!nm_device_get_act_request (device)) + return; + + nm_dhcp_client_stop (client); + + if (nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) { + if (nm_dhcp_client_get_ipv6 (client)) + nm_device_activate_schedule_stage4_ip6_config_timeout (device); + else + nm_device_activate_schedule_stage4_ip4_config_timeout (device); + } +} + +static NMActStageReturn +real_act_stage3_ip4_config_start (NMDevice *self, NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingIP4Config *s_ip4; + NMActRequest *req; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_SUCCESS; + const char *ip_iface, *method = NULL, *uuid; + + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + /* Use the IP interface (not the control interface) for IP stuff */ + ip_iface = nm_device_get_ip_iface (self); + + /* Make sure the interface is up before trying to do anything with it */ + if (!nm_system_device_is_up_with_iface (ip_iface)) + nm_system_device_set_up_down_with_iface (ip_iface, TRUE, NULL); + + req = nm_device_get_act_request (self); + connection = nm_act_request_get_connection (req); + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + uuid = nm_setting_connection_get_uuid (s_con); + + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + + /* If we did not receive IP4 configuration information, default to DHCP */ + if (s_ip4) + method = nm_setting_ip4_config_get_method (s_ip4); + + if (!s_ip4 || !method || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { + guint8 *anycast = NULL; + + /* Begin a DHCP transaction on the interface */ + + if (priv->dhcp_anycast_address) + anycast = priv->dhcp_anycast_address->data; + + /* Clear old exported DHCP options */ + if (priv->dhcp4_config) + g_object_unref (priv->dhcp4_config); + priv->dhcp4_config = nm_dhcp4_config_new (); + + priv->dhcp4_client = nm_dhcp_manager_start_ip4 (priv->dhcp_manager, + ip_iface, + uuid, + s_ip4, + priv->dhcp_timeout, + anycast); + if (priv->dhcp4_client) { + priv->dhcp4_state_sigid = g_signal_connect (priv->dhcp4_client, + "state-changed", + G_CALLBACK (dhcp_state_changed), + self); + priv->dhcp4_timeout_sigid = g_signal_connect (priv->dhcp4_client, + "timeout", + G_CALLBACK (dhcp_timeout), + self); + + /* DHCP devices will be notified by the DHCP manager when + * stuff happens. + */ + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else { + *reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED; + ret = NM_ACT_STAGE_RETURN_FAILURE; + } + } else if (s_ip4 && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) { + GError *error = NULL; + const char *iface = nm_device_get_iface (self); + + /* Start avahi-autoipd */ + if (aipd_exec (self, &error)) { + nm_log_info (LOGD_DEVICE | LOGD_AUTOIP4, + "Activation (%s) Stage 3 of 5 (IP Configure Start) started" + " avahi-autoipd...", iface); + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else { + nm_log_info (LOGD_DEVICE | LOGD_AUTOIP4, + "Activation (%s) Stage 3 of 5 (IP Configure Start) failed" + " to start avahi-autoipd: %s", iface, error->message); + g_error_free (error); + aipd_cleanup (self); + *reason = NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED; + ret = NM_ACT_STAGE_RETURN_FAILURE; + } + } else if (s_ip4 && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) { + /* Nothing to do... */ + priv->ip4_ready = TRUE; + ret = NM_ACT_STAGE_RETURN_STOP; + } + + return ret; +} + +static NMActStageReturn +dhcp6_start (NMDevice *self, + NMConnection *connection, + guint32 dhcp_opt, + NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + guint8 *anycast = NULL; + NMSettingIP6Config *s_ip6; + NMSettingConnection *s_con; + const char *uuid; + const char *ip_iface; + + if (!connection) { + NMActRequest *req; + + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + } + + /* Begin a DHCP transaction on the interface */ + + if (priv->dhcp_anycast_address) + anycast = priv->dhcp_anycast_address->data; + + /* Clear old exported DHCP options */ + if (priv->dhcp6_config) + g_object_unref (priv->dhcp6_config); + priv->dhcp6_config = nm_dhcp6_config_new (); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + uuid = nm_setting_connection_get_uuid (s_con); + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + + ip_iface = nm_device_get_ip_iface (self); + priv->dhcp6_client = nm_dhcp_manager_start_ip6 (priv->dhcp_manager, + ip_iface, + uuid, + s_ip6, + priv->dhcp_timeout, + anycast, + (dhcp_opt == IP6_DHCP_OPT_OTHERCONF) ? TRUE : FALSE); + if (priv->dhcp6_client) { + priv->dhcp6_state_sigid = g_signal_connect (priv->dhcp6_client, + "state-changed", + G_CALLBACK (dhcp_state_changed), + self); + priv->dhcp6_timeout_sigid = g_signal_connect (priv->dhcp6_client, + "timeout", + G_CALLBACK (dhcp_timeout), + self); + + /* DHCP devices will be notified by the DHCP manager when stuff happens */ + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else { + *reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED; + ret = NM_ACT_STAGE_RETURN_FAILURE; + } + + return ret; +} + +static NMActStageReturn +real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + const char *ip_iface; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + NMActRequest *req; + NMConnection *connection; + + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + req = nm_device_get_act_request (self); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + ip_iface = nm_device_get_ip_iface (self); + + update_accept_ra_save (self); + + priv->dhcp6_mode = IP6_DHCP_OPT_NONE; + + if ( ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO) + || ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + if (!addrconf6_setup (self)) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + goto out; + } + nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self)); + ret = NM_ACT_STAGE_RETURN_POSTPONE; + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { + /* reset the saved RA value when ipv6 is ignored */ + if (priv->ip6_accept_ra_path) { + nm_utils_do_sysctl (priv->ip6_accept_ra_path, + priv->ip6_accept_ra_save ? "1\n" : "0\n"); + } + + priv->ip6_ready = TRUE; + ret = NM_ACT_STAGE_RETURN_STOP; + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + /* Router advertisements shouldn't be used in manual mode */ + if (priv->ip6_accept_ra_path) + nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n"); + ret = NM_ACT_STAGE_RETURN_SUCCESS; + } + + /* Other methods (shared) aren't implemented yet */ + +out: + return ret; +} + + +/* + * nm_device_activate_stage3_ip_config_start + * + * Begin automatic/manual IP configuration + * + */ +static gboolean +nm_device_activate_stage3_ip_config_start (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + const char *iface; + NMActStageReturn ret; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, 0); + + iface = nm_device_get_iface (self); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 3 of 5 (IP Configure Start) started...", iface); + nm_device_state_changed (self, NM_DEVICE_STATE_IP_CONFIG, NM_DEVICE_STATE_REASON_NONE); + + ret = NM_DEVICE_GET_CLASS (self)->act_stage3_ip4_config_start (self, &reason); + if (ret == NM_ACT_STAGE_RETURN_SUCCESS) + nm_device_activate_schedule_stage4_ip4_config_get (self); + else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } else if (ret == NM_ACT_STAGE_RETURN_STOP) { + /* Nothing to do */ + } else + g_assert (ret == NM_ACT_STAGE_RETURN_POSTPONE); + + ret = NM_DEVICE_GET_CLASS (self)->act_stage3_ip6_config_start (self, &reason); + if (ret == NM_ACT_STAGE_RETURN_SUCCESS) + nm_device_activate_schedule_stage4_ip6_config_get (self); + else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } else if (ret == NM_ACT_STAGE_RETURN_STOP) { + /* Nothing to do */ + } else + g_assert (ret == NM_ACT_STAGE_RETURN_POSTPONE); + +out: + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 3 of 5 (IP Configure Start) complete.", iface); + return FALSE; +} + + +/* + * nm_device_activate_schedule_stage3_ip_config_start + * + * Schedule IP configuration start + */ +void +nm_device_activate_schedule_stage3_ip_config_start (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + + activation_source_schedule (self, nm_device_activate_stage3_ip_config_start, 0); + + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 3 of 5 (IP Configure Start) scheduled.", + nm_device_get_iface (self)); +} + +static GHashTable *shared_ips = NULL; + +static void +release_shared_ip (gpointer data) +{ + g_hash_table_remove (shared_ips, data); +} + +static guint32 +reserve_shared_ip (void) +{ + guint32 start = (guint32) ntohl (0x0a2a2b01); /* 10.42.43.1 */ + guint32 count = 0; + + while (g_hash_table_lookup (shared_ips, GUINT_TO_POINTER (start + count))) { + count += ntohl (0x100); + if (count > ntohl (0xFE00)) { + nm_log_err (LOGD_SHARING, "ran out of shared IP addresses!"); + return 0; + } + } + + g_hash_table_insert (shared_ips, GUINT_TO_POINTER (start + count), GUINT_TO_POINTER (TRUE)); + return start + count; +} + +static NMIP4Config * +nm_device_new_ip4_shared_config (NMDevice *self, NMDeviceStateReason *reason) +{ + NMIP4Config *config = NULL; + NMIP4Address *addr; + guint32 tmp_addr; + + g_return_val_if_fail (self != NULL, NULL); + + if (G_UNLIKELY (shared_ips == NULL)) + shared_ips = g_hash_table_new (g_direct_hash, g_direct_equal); + + tmp_addr = reserve_shared_ip (); + if (!tmp_addr) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + return NULL; + } + + config = nm_ip4_config_new (); + addr = nm_ip4_address_new (); + nm_ip4_address_set_address (addr, tmp_addr); + nm_ip4_address_set_prefix (addr, 24); + nm_ip4_config_take_address (config, addr); + + /* Remove the address lock when the object gets disposed */ + g_object_set_data_full (G_OBJECT (config), "shared-ip", + GUINT_TO_POINTER (tmp_addr), release_shared_ip); + + return config; +} + +static NMActStageReturn +real_act_stage4_get_ip4_config (NMDevice *self, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + NMConnection *connection; + NMSettingIP4Config *s_ip4; + const char *ip_iface; + + g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + /* Use the IP interface (not the control interface) for IP stuff */ + ip_iface = nm_device_get_ip_iface (self); + + connection = nm_act_request_get_connection (nm_device_get_act_request (self)); + g_assert (connection); + + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + + if (priv->dhcp4_client) { + /* DHCP */ + *config = nm_dhcp_client_get_ip4_config (priv->dhcp4_client, FALSE); + if (*config) { + /* Merge user-defined overrides into the IP4Config to be applied */ + nm_utils_merge_ip4_config (*config, s_ip4); + + nm_dhcp4_config_reset (priv->dhcp4_config); + nm_dhcp_client_foreach_option (priv->dhcp4_client, + dhcp4_add_option_cb, + priv->dhcp4_config); + + /* Notify of new DHCP4 config */ + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); + } else + *reason = NM_DEVICE_STATE_REASON_DHCP_ERROR; + } else { + /* Not DHCP */ + const char *method; + + g_assert (s_ip4); + + method = nm_setting_ip4_config_get_method (s_ip4); + g_assert (method); + + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) { + *config = aipd_get_ip4_config (self, reason); + } else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) { + *config = nm_ip4_config_new (); + if (*config) { + /* Merge user-defined overrides into the IP4Config to be applied */ + nm_utils_merge_ip4_config (*config, s_ip4); + } else + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + } else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) { + *config = nm_device_new_ip4_shared_config (self, reason); + if (*config) + priv->dnsmasq_manager = nm_dnsmasq_manager_new (ip_iface); + } else if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) + ret = NM_ACT_STAGE_RETURN_SUCCESS; + } + + if (!*config) { + /* Make sure device is up even if config fails */ + nm_device_bring_up (self, FALSE, NULL); + } else + ret = NM_ACT_STAGE_RETURN_SUCCESS; + + return ret; +} + +/* + * nm_device_activate_stage4_ip4_config_get + * + * Retrieve the correct IPv4 config. + * + */ +static gboolean +nm_device_activate_stage4_ip4_config_get (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMIP4Config *ip4_config = NULL; + NMActStageReturn ret; + const char *iface = NULL; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, AF_INET); + + iface = nm_device_get_iface (self); + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Get) started...", + iface); + + ret = NM_DEVICE_GET_CLASS (self)->act_stage4_get_ip4_config (self, &ip4_config, &reason); + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) + goto out; + else if (!ip4_config || (ret == NM_ACT_STAGE_RETURN_FAILURE)) { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } + g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); + + g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), + NM_ACT_REQUEST_IP4_CONFIG, ip4_config); + + nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET); + +out: + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Get) complete.", + iface); + return FALSE; +} + + +/* + * nm_device_activate_schedule_stage4_ip4_config_get + * + * Schedule creation of the IPv4 config + * + */ +void +nm_device_activate_schedule_stage4_ip4_config_get (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + + activation_source_schedule (self, nm_device_activate_stage4_ip4_config_get, AF_INET); + + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Get) scheduled...", + nm_device_get_iface (self)); +} + + +static NMActStageReturn +real_act_stage4_ip4_config_timeout (NMDevice *self, + NMIP4Config **config, + NMDeviceStateReason *reason) +{ + g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); + + /* Notify of invalid DHCP4 config object */ + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); + + if (nm_device_ip_config_should_fail (self, FALSE)) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + return NM_ACT_STAGE_RETURN_FAILURE; + } + + return NM_ACT_STAGE_RETURN_SUCCESS; +} + + +/* + * nm_device_activate_stage4_ip4_config_timeout + * + * Time out on retrieving the IPv4 config. + * + */ +static gboolean +nm_device_activate_stage4_ip4_config_timeout (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMIP4Config *ip4_config = NULL; + const char *iface; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, AF_INET); + + iface = nm_device_get_iface (self); + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) started...", + iface); + + ret = NM_DEVICE_GET_CLASS (self)->act_stage4_ip4_config_timeout (self, &ip4_config, &reason); + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) + goto out; + else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } + g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); + + if (ip4_config) { + g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), + NM_ACT_REQUEST_IP4_CONFIG, ip4_config); + } + + nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET); + +out: + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) complete.", + iface); + return FALSE; +} + + +/* + * nm_device_activate_schedule_stage4_ip4_config_timeout + * + * Deal with a timeout of the IPv4 configuration + * + */ +void +nm_device_activate_schedule_stage4_ip4_config_timeout (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + + activation_source_schedule (self, nm_device_activate_stage4_ip4_config_timeout, AF_INET); + + nm_log_info (LOGD_DEVICE | LOGD_IP4, + "Activation (%s) Stage 4 of 5 (IP4 Configure Timeout) scheduled...", + nm_device_get_iface (self)); +} + +static void +merge_dhcp_config_to_master (NMIP6Config *dst, NMIP6Config *src) +{ + guint32 i; + + g_return_if_fail (src != NULL); + g_return_if_fail (dst != NULL); + + /* addresses */ + for (i = 0; i < nm_ip6_config_get_num_addresses (src); i++) + nm_ip6_config_add_address (dst, nm_ip6_config_get_address (src, i)); + + /* ptp address; only replace if src doesn't have one */ + if (!nm_ip6_config_get_ptp_address (dst)) + nm_ip6_config_set_ptp_address (dst, nm_ip6_config_get_ptp_address (src)); + + /* nameservers */ + for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++) + nm_ip6_config_add_nameserver (dst, nm_ip6_config_get_nameserver (src, i)); + + /* routes */ + for (i = 0; i < nm_ip6_config_get_num_routes (src); i++) + nm_ip6_config_add_route (dst, nm_ip6_config_get_route (src, i)); + + /* domains */ + for (i = 0; i < nm_ip6_config_get_num_domains (src); i++) + nm_ip6_config_add_domain (dst, nm_ip6_config_get_domain (src, i)); + + /* dns searches */ + for (i = 0; i < nm_ip6_config_get_num_searches (src); i++) + nm_ip6_config_add_search (dst, nm_ip6_config_get_search (src, i)); + + if (!nm_ip6_config_get_mss (dst)) + nm_ip6_config_set_mss (dst, nm_ip6_config_get_mss (src)); +} + +static NMActStageReturn +real_act_stage4_get_ip6_config (NMDevice *self, + NMIP6Config **config, + NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMConnection *connection; + NMSettingIP6Config *s_ip6; + const char *ip_iface; + + g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); + + /* Use the IP interface (not the control interface) for IP stuff */ + ip_iface = nm_device_get_ip_iface (self); + + connection = nm_act_request_get_connection (nm_device_get_act_request (self)); + g_assert (connection); + + if ( ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_AUTO) + || ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + *config = nm_ip6_manager_get_ip6_config (priv->ip6_manager, + nm_device_get_ip_ifindex (self)); + if (!*config) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + goto out; + } + } else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + *config = nm_ip6_config_new (); + if (!*config) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + goto out; + } + } + + /* Autoconf might have triggered DHCPv6 too */ + if (priv->dhcp6_client) { + NMIP6Config *dhcp; + + dhcp = nm_dhcp_client_get_ip6_config (priv->dhcp6_client, FALSE); + if (!dhcp) { + *reason = NM_DEVICE_STATE_REASON_DHCP_ERROR; + goto out; + } + + /* For "managed" and DHCP-only setups, we use only the DHCP-supplied + * IPv6 config. But when autoconf is enabled, we have to merge the + * autoconf config and the DHCP-supplied config, then merge the + * user's overrides from the connection to get the final configuration + * that gets applied to the device. + */ + if (*config) { + /* Merge autoconf and DHCP configs */ + merge_dhcp_config_to_master (*config, dhcp); + g_object_unref (dhcp); + dhcp = NULL; + } else { + *config = dhcp; + } + + /* Copy the new DHCPv6 configuration into the DHCP config object that's + * exported over D-Bus to clients. + */ + nm_dhcp6_config_reset (priv->dhcp6_config); + nm_dhcp_client_foreach_option (priv->dhcp6_client, + dhcp6_add_option_cb, + priv->dhcp6_config); + + /* Notify of new DHCP6 config */ + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); + } + + /* Merge user-defined overrides into the IP6Config to be applied */ + if (*config) { + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + nm_utils_merge_ip6_config (*config, s_ip6); + } + +out: + return *config ? NM_ACT_STAGE_RETURN_SUCCESS : NM_ACT_STAGE_RETURN_FAILURE; +} + +/* + * nm_device_activate_stage4_ip6_config_get + * + * Retrieve the correct IPv6 config. + * + */ +static gboolean +nm_device_activate_stage4_ip6_config_get (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMIP6Config *ip6_config = NULL; + NMActStageReturn ret; + const char *iface = NULL; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, AF_INET6); + + iface = nm_device_get_iface (self); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Get) started...", + iface); + + ret = NM_DEVICE_GET_CLASS (self)->act_stage4_get_ip6_config (self, &ip6_config, &reason); + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) + goto out; + else if (ret == NM_ACT_STAGE_RETURN_FAILURE) + { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } + g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); + + g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), + NM_ACT_REQUEST_IP6_CONFIG, ip6_config); + + nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET6); + +out: + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Get) complete.", + iface); + return FALSE; +} + + +/* + * nm_device_activate_schedule_stage4_ip6_config_get + * + * Schedule creation of the IPv6 config + * + */ +void +nm_device_activate_schedule_stage4_ip6_config_get (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + + activation_source_schedule (self, nm_device_activate_stage4_ip6_config_get, AF_INET6); + + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Get) scheduled...", + nm_device_get_iface (self)); +} + + +static NMActStageReturn +real_act_stage4_ip6_config_timeout (NMDevice *self, + NMIP6Config **config, + NMDeviceStateReason *reason) +{ + g_return_val_if_fail (config != NULL, NM_ACT_STAGE_RETURN_FAILURE); + g_return_val_if_fail (*config == NULL, NM_ACT_STAGE_RETURN_FAILURE); + + /* Notify of invalid DHCP4 config object */ + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); + + if (nm_device_ip_config_should_fail (self, TRUE)) { + *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE; + return NM_ACT_STAGE_RETURN_FAILURE; + } + + return NM_ACT_STAGE_RETURN_SUCCESS; +} + + +/* + * nm_device_activate_stage4_ip6_config_timeout + * + * Time out on retrieving the IPv6 config. + * + */ +static gboolean +nm_device_activate_stage4_ip6_config_timeout (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMIP6Config *ip6_config = NULL; + const char *iface; + NMActStageReturn ret = NM_ACT_STAGE_RETURN_FAILURE; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, AF_INET6); + + iface = nm_device_get_iface (self); + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) started...", + iface); + + ret = NM_DEVICE_GET_CLASS (self)->act_stage4_ip6_config_timeout (self, &ip6_config, &reason); + if (ret == NM_ACT_STAGE_RETURN_POSTPONE) + goto out; + else if (ret == NM_ACT_STAGE_RETURN_FAILURE) { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } + g_assert (ret == NM_ACT_STAGE_RETURN_SUCCESS); + + if (ip6_config) { + g_object_set_data (G_OBJECT (nm_device_get_act_request (self)), + NM_ACT_REQUEST_IP6_CONFIG, ip6_config); + } + + nm_device_activate_schedule_stage5_ip_config_commit (self, AF_INET6); + +out: + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) complete.", + iface); + return FALSE; +} + + +/* + * nm_device_activate_schedule_stage4_ip6_config_timeout + * + * Deal with a timeout of the IPv6 configuration + * + */ +void +nm_device_activate_schedule_stage4_ip6_config_timeout (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + + activation_source_schedule (self, nm_device_activate_stage4_ip6_config_timeout, AF_INET6); + + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 4 of 5 (IP6 Configure Timeout) scheduled...", + nm_device_get_iface (self)); +} + +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); +} + +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 }; + char **iter; + + if (!nm_utils_do_sysctl ("/proc/sys/net/ipv4/ip_forward", "1\n")) { + nm_log_err (LOGD_SHARING, "Error starting IP forwarding: (%d) %s", + errno, strerror (errno)); + return FALSE; + } + + if (!nm_utils_do_sysctl ("/proc/sys/net/ipv4/ip_dynaddr", "1\n")) { + nm_log_err (LOGD_SHARING, "error starting IP forwarding: (%d) %s", + errno, strerror (errno)); + } + + 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, "error loading NAT module %s: (%d) %s", + *iter, error ? error->code : 0, + (error && error->message) ? error->message : "unknown"); + if (error) + g_error_free (error); + } + } + + return TRUE; +} + +static void +add_share_rule (NMActRequest *req, const char *table, const char *fmt, ...) +{ + va_list args; + char *cmd; + + va_start (args, fmt); + cmd = g_strdup_vprintf (fmt, args); + va_end (args); + + nm_act_request_add_share_rule (req, table, cmd); + g_free (cmd); +} + +static gboolean +start_sharing (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActRequest *req; + GError *error = NULL; + char str_addr[INET_ADDRSTRLEN + 1]; + char str_mask[INET_ADDRSTRLEN + 1]; + guint32 netmask, network; + NMIP4Config *ip4_config; + NMIP4Address *ip4_addr; + const char *ip_iface; + + ip_iface = nm_device_get_ip_iface (self); + + ip4_config = nm_device_get_ip4_config (self); + if (!ip4_config) + return FALSE; + + ip4_addr = nm_ip4_config_get_address (ip4_config, 0); + if (!ip4_addr || !nm_ip4_address_get_address (ip4_addr)) + return FALSE; + + netmask = nm_utils_ip4_prefix_to_netmask (nm_ip4_address_get_prefix (ip4_addr)); + if (!inet_ntop (AF_INET, &netmask, str_mask, sizeof (str_mask))) + return FALSE; + + network = nm_ip4_address_get_address (ip4_addr) & netmask; + if (!inet_ntop (AF_INET, &network, str_addr, sizeof (str_addr))) + return FALSE; + + if (!share_init ()) + return FALSE; + + req = nm_device_get_act_request (self); + g_assert (req); + + add_share_rule (req, "filter", "INPUT --in-interface %s --protocol tcp --destination-port 53 --jump ACCEPT", ip_iface); + add_share_rule (req, "filter", "INPUT --in-interface %s --protocol udp --destination-port 53 --jump ACCEPT", ip_iface); + add_share_rule (req, "filter", "INPUT --in-interface %s --protocol tcp --destination-port 67 --jump ACCEPT", ip_iface); + add_share_rule (req, "filter", "INPUT --in-interface %s --protocol udp --destination-port 67 --jump ACCEPT", ip_iface); + add_share_rule (req, "filter", "FORWARD --in-interface %s --jump REJECT", ip_iface); + add_share_rule (req, "filter", "FORWARD --out-interface %s --jump REJECT", ip_iface); + add_share_rule (req, "filter", "FORWARD --in-interface %s --out-interface %s --jump ACCEPT", ip_iface, ip_iface); + add_share_rule (req, "filter", "FORWARD --source %s/%s --in-interface %s --jump ACCEPT", str_addr, str_mask, ip_iface); + add_share_rule (req, "filter", "FORWARD --destination %s/%s --out-interface %s --match state --state ESTABLISHED,RELATED --jump ACCEPT", str_addr, str_mask, ip_iface); + add_share_rule (req, "nat", "POSTROUTING --source %s/%s --destination ! %s/%s --jump MASQUERADE", str_addr, str_mask, str_addr, str_mask); + + nm_act_request_set_shared (req, TRUE); + + if (!nm_dnsmasq_manager_start (priv->dnsmasq_manager, ip4_config, &error)) { + nm_log_err (LOGD_SHARING, "(%s/%s): failed to start dnsmasq: %s", + nm_device_get_iface (self), ip_iface, error->message); + g_error_free (error); + nm_act_request_set_shared (req, FALSE); + return FALSE; + } + + priv->dnsmasq_state_id = g_signal_connect (priv->dnsmasq_manager, "state-changed", + G_CALLBACK (dnsmasq_state_changed_cb), + self); + return TRUE; +} + +/* + * nm_device_activate_stage5_ip_config_commit + * + * Commit the IP config on the device + * + */ +static gboolean +nm_device_activate_stage5_ip_config_commit (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMActRequest *act_request; + NMIP4Config *ip4_config = NULL; + NMIP6Config *ip6_config = NULL; + const char *iface, *method = NULL; + NMConnection *connection; + NMSettingIP4Config *s_ip4; + NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; + gboolean assumed; + + /* Get the new IP4 and IP6 configs; since this stage gets rerun + * when automatic configuration changes (DHCP lease renewal, new + * IPv6 router advertisement, etc), it's possible that only one of + * them will be set. + */ + act_request = nm_device_get_act_request (self); + + ip4_config = g_object_get_data (G_OBJECT (act_request), + NM_ACT_REQUEST_IP4_CONFIG); + g_object_set_data (G_OBJECT (act_request), + NM_ACT_REQUEST_IP4_CONFIG, NULL); + + ip6_config = g_object_get_data (G_OBJECT (act_request), + NM_ACT_REQUEST_IP6_CONFIG); + g_object_set_data (G_OBJECT (act_request), + NM_ACT_REQUEST_IP6_CONFIG, NULL); + + /* Clear the activation source ID now that this stage has run */ + activation_source_clear (self, FALSE, 0); + + iface = nm_device_get_iface (self); + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 5 of 5 (IP Configure Commit) started...", + iface); + + assumed = nm_act_request_get_assumed (priv->act_request); + + if (!ip6_config && !ip4_config) { + nm_log_info (LOGD_DEVICE, + "Activation (%s) Stage 5 of 5 (IP Configure Commit) failed (no IP configuration found)", + iface); + nm_device_state_changed (self, + NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); + goto out; + } + + if (ip4_config && !nm_device_set_ip4_config (self, ip4_config, assumed, &reason)) { + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } + + if (ip6_config && !nm_device_set_ip6_config (self, ip6_config, assumed, &reason)) { + nm_log_info (LOGD_DEVICE | LOGD_IP6, + "Activation (%s) Stage 5 of 5 (IP Configure Commit) IPv6 failed", + iface); + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason); + goto out; + } + + connection = nm_act_request_get_connection (nm_device_get_act_request (self)); + + if (ip4_config) { + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + method = nm_setting_ip4_config_get_method (s_ip4); + + if (s_ip4 && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) { + if (!start_sharing (self)) { + nm_log_warn (LOGD_SHARING, "Activation (%s) Stage 5 of 5 (IP Configure Commit) start sharing failed.", iface); + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_SHARED_START_FAILED); + goto out; + } + } + } + + nm_device_state_changed (self, NM_DEVICE_STATE_ACTIVATED, NM_DEVICE_STATE_REASON_NONE); + +out: + nm_log_info (LOGD_DEVICE, "Activation (%s) Stage 5 of 5 (IP Configure Commit) complete.", + iface); + + /* Balance IP config creation; device takes ownership in set_ip*_config() */ + if (ip4_config) + g_object_unref (ip4_config); + if (ip6_config) + g_object_unref (ip6_config); + + return FALSE; +} + + +/* + * nm_device_activate_schedule_stage5_ip_config_commit + * + * Schedule commit of the IP config + */ +static void +nm_device_activate_schedule_stage5_ip_config_commit (NMDevice *self, int family) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_GET_PRIVATE (self); + g_return_if_fail (priv->act_request); + + if (family == AF_INET) + priv->ip4_ready = TRUE; + else if (family == AF_INET6) + priv->ip6_ready = TRUE; + + /* Note that these are only set FALSE at stage3, so once you've + * made it all the way through activation once, you can jump back + * into stage4 (eg, for a DHCP lease change) and not worry about + * needing both IPv4 and IPv6 to complete. + */ + if (!priv->ip4_ready || !priv->ip6_ready) + return; + + activation_source_schedule (self, nm_device_activate_stage5_ip_config_commit, 0); + + nm_log_info (LOGD_DEVICE, + "Activation (%s) Stage 5 of 5 (IP Configure Commit) scheduled...", + nm_device_get_iface (self)); +} + + +static void +clear_act_request (NMDevice *self) +{ + NMDevicePrivate * priv; + + g_return_if_fail (self != NULL); + + priv = NM_DEVICE_GET_PRIVATE (self); + + if (!priv->act_request) + return; + + if (priv->secrets_updated_id) { + g_signal_handler_disconnect (priv->act_request, + priv->secrets_updated_id); + priv->secrets_updated_id = 0; + } + + if (priv->secrets_failed_id) { + g_signal_handler_disconnect (priv->act_request, + priv->secrets_failed_id); + priv->secrets_failed_id = 0; + } + + nm_act_request_set_default (priv->act_request, FALSE); + + g_object_unref (priv->act_request); + priv->act_request = NULL; +} + +static void +delayed_transitions_clear (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->failed_to_disconnected_id) { + nm_log_dbg (LOGD_DEVICE, "(%s): clearing failed->disconnected transition", + nm_device_get_iface (self)); + g_source_remove (priv->failed_to_disconnected_id); + priv->failed_to_disconnected_id = 0; + } + if (priv->unavailable_to_disconnected_id) { + nm_log_dbg (LOGD_DEVICE, "(%s): clearing unavailable->disconnected transition", + nm_device_get_iface (self)); + g_source_remove (priv->unavailable_to_disconnected_id); + priv->unavailable_to_disconnected_id = 0; + } +} + +static void +dhcp4_cleanup (NMDevice *self, gboolean stop) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (priv->dhcp4_config) { + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP4_CONFIG); + g_object_unref (priv->dhcp4_config); + priv->dhcp4_config = NULL; + } + + if (priv->dhcp4_client) { + /* Stop any ongoing DHCP transaction on this device */ + if (priv->dhcp4_state_sigid) { + g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp4_state_sigid); + priv->dhcp4_state_sigid = 0; + } + + if (priv->dhcp4_timeout_sigid) { + g_signal_handler_disconnect (priv->dhcp4_client, priv->dhcp4_timeout_sigid); + priv->dhcp4_timeout_sigid = 0; + } + + if (stop) + nm_dhcp_client_stop (priv->dhcp4_client); + + g_object_unref (priv->dhcp4_client); + priv->dhcp4_client = NULL; + } +} + +static void +dhcp6_cleanup (NMDevice *self, gboolean stop) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + priv->dhcp6_mode = IP6_DHCP_OPT_NONE; + + if (priv->dhcp6_config) { + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_DHCP6_CONFIG); + g_object_unref (priv->dhcp6_config); + priv->dhcp6_config = NULL; + } + + if (priv->dhcp6_client) { + if (priv->dhcp6_state_sigid) { + g_signal_handler_disconnect (priv->dhcp6_client, priv->dhcp6_state_sigid); + priv->dhcp6_state_sigid = 0; + } + + if (priv->dhcp6_timeout_sigid) { + g_signal_handler_disconnect (priv->dhcp6_client, priv->dhcp6_timeout_sigid); + priv->dhcp6_timeout_sigid = 0; + } + + if (stop) + nm_dhcp_client_stop (priv->dhcp6_client); + + g_object_unref (priv->dhcp6_client); + priv->dhcp6_client = NULL; + } +} + +static void +dnsmasq_cleanup (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (!priv->dnsmasq_manager) + return; + + if (priv->dnsmasq_state_id) { + g_signal_handler_disconnect (priv->dnsmasq_manager, priv->dnsmasq_state_id); + priv->dnsmasq_state_id = 0; + } + + nm_dnsmasq_manager_stop (priv->dnsmasq_manager); + g_object_unref (priv->dnsmasq_manager); + priv->dnsmasq_manager = NULL; +} + +/* + * nm_device_deactivate_quickly + * + * Quickly deactivate a device, for things like sleep, etc. Doesn't + * clean much stuff up, and nm_device_deactivate() should be called + * on the device eventually. + * + */ +gboolean +nm_device_deactivate_quickly (NMDevice *self) +{ + NMDevicePrivate *priv; + + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + + priv = NM_DEVICE_GET_PRIVATE (self); + + /* Break the activation chain */ + activation_source_clear (self, TRUE, AF_INET); + activation_source_clear (self, TRUE, AF_INET6); + + /* Clear any delayed transitions */ + delayed_transitions_clear (self); + + dhcp4_cleanup (self, TRUE); + dhcp6_cleanup (self, TRUE); + addrconf6_cleanup (self); + dnsmasq_cleanup (self); + aipd_cleanup (self); + + /* Turn off router advertisements until they are needed */ + if (priv->ip6_accept_ra_path) + nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n"); + + /* Call device type-specific deactivation */ + if (NM_DEVICE_GET_CLASS (self)->deactivate_quickly) + NM_DEVICE_GET_CLASS (self)->deactivate_quickly (self); + + /* Tear down an existing activation request */ + clear_act_request (self); + + return TRUE; +} + +/* + * nm_device_deactivate + * + * Remove a device's routing table entries and IP address. + * + */ +static void +nm_device_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason) +{ + NMDevice *self = NM_DEVICE (device); + NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE; + + g_return_if_fail (self != NULL); + + nm_log_info (LOGD_DEVICE, "(%s): deactivating device (reason: %d).", + nm_device_get_iface (self), reason); + + nm_device_deactivate_quickly (self); + + /* Take out any entries in the routing table and any IP address the device had. */ + nm_system_device_flush_routes (self, nm_device_get_ip6_config (self) ? AF_UNSPEC : AF_INET); + nm_system_device_flush_addresses (self); + nm_device_update_ip4_address (self); + + /* Clean up nameservers and addresses */ + nm_device_set_ip4_config (self, NULL, FALSE, &ignored); + nm_device_set_ip6_config (self, NULL, FALSE, &ignored); + + /* Call device type-specific deactivation */ + if (NM_DEVICE_GET_CLASS (self)->deactivate) + NM_DEVICE_GET_CLASS (self)->deactivate (self); +} + +static gboolean +device_disconnect (NMDeviceInterface *device, + GError **error) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (NM_DEVICE (device)); + + priv->autoconnect_inhibit = TRUE; + nm_device_state_changed (NM_DEVICE (device), NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_USER_REQUESTED); + return TRUE; +} + +static gboolean +check_connection_compatible (NMDeviceInterface *dev_iface, + NMConnection *connection, + GError **error) +{ + NMDeviceClass *klass = NM_DEVICE_GET_CLASS (NM_DEVICE (dev_iface)); + + if (klass->check_connection_compatible) + return klass->check_connection_compatible (NM_DEVICE (dev_iface), connection, error); + + return TRUE; +} + +static void +connection_secrets_updated_cb (NMActRequest *req, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller, + gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + + if (NM_DEVICE_GET_CLASS (self)->connection_secrets_updated) + NM_DEVICE_GET_CLASS (self)->connection_secrets_updated (self, connection, updated_settings, caller); +} + +static void +connection_secrets_failed_cb (NMActRequest *req, + NMConnection *connection, + const char *setting_name, + RequestSecretsCaller caller, + gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + + nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_NO_SECRETS); +} + +static gboolean +device_activation_precheck (NMDevice *self, NMConnection *connection, GError **error) +{ + NMConnection *current_connection; + + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + + if (nm_device_get_state (self) != NM_DEVICE_STATE_ACTIVATED) + return TRUE; + + if (!nm_device_is_activating (self)) + return TRUE; + + // FIXME: why not just check connection path & service? + current_connection = nm_act_request_get_connection (nm_device_get_act_request (self)); + if (nm_connection_compare (connection, current_connection, NM_SETTING_COMPARE_FLAG_EXACT)) { + /* Already activating or activated with the same connection */ + g_set_error (error, + NM_DEVICE_INTERFACE_ERROR, + NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING, + "%s", "Connection is already activating"); + return FALSE; + } + + return TRUE; +} + +static gboolean +nm_device_activate (NMDeviceInterface *device, + NMActRequest *req, + GError **error) +{ + NMDevice *self = NM_DEVICE (device); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + if (!device_activation_precheck (self, nm_act_request_get_connection (req), error)) { + g_assert (*error); + return FALSE; + } + + priv->act_request = g_object_ref (req); + priv->secrets_updated_id = g_signal_connect (req, + "connection-secrets-updated", + G_CALLBACK (connection_secrets_updated_cb), + device); + priv->secrets_failed_id = g_signal_connect (req, + "connection-secrets-failed", + G_CALLBACK (connection_secrets_failed_cb), + device); + + if (!nm_act_request_get_assumed (req)) { + /* HACK: update the state a bit early to avoid a race between the + * scheduled stage1 handler and nm_policy_device_change_check() thinking + * that the activation request isn't deferred because the deferred bit + * gets cleared a bit too early, when the connection becomes valid. + */ + nm_device_state_changed (self, NM_DEVICE_STATE_PREPARE, NM_DEVICE_STATE_REASON_NONE); + nm_device_activate_schedule_stage1_device_prepare (self); + } else { + /* If it's an assumed connection, let the device subclass short-circuit + * the normal connection process and just copy its IP configs from the + * interface. + */ + nm_device_state_changed (self, NM_DEVICE_STATE_IP_CONFIG, NM_DEVICE_STATE_REASON_NONE); + nm_device_activate_schedule_stage3_ip_config_start (self); + } + + return TRUE; +} + +/* + * nm_device_is_activating + * + * Return whether or not the device is currently activating itself. + * + */ +gboolean +nm_device_is_activating (NMDevice *device) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + switch (nm_device_get_state (device)) { + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_CONFIG: + case NM_DEVICE_STATE_NEED_AUTH: + case NM_DEVICE_STATE_IP_CONFIG: + return TRUE; + break; + default: + break; + } + + /* There's a small race between the time when stage 1 is scheduled + * and when the device actually sets STATE_PREPARE when the activation + * handler is actually run. If there's an activation handler scheduled + * we're activating anyway. + */ + if (priv->act_source_id) + return TRUE; + + return FALSE; +} + + +gboolean +nm_device_can_interrupt_activation (NMDevice *self) +{ + gboolean interrupt = FALSE; + + g_return_val_if_fail (self != NULL, FALSE); + + if (NM_DEVICE_GET_CLASS (self)->can_interrupt_activation) + interrupt = NM_DEVICE_GET_CLASS (self)->can_interrupt_activation (self); + return interrupt; +} + +/* IP Configuration stuff */ + +NMDHCP4Config * +nm_device_get_dhcp4_config (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (self), NULL); + + return NM_DEVICE_GET_PRIVATE (self)->dhcp4_config; +} + +NMIP4Config * +nm_device_get_ip4_config (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (self), NULL); + + return NM_DEVICE_GET_PRIVATE (self)->ip4_config; +} + + +static gboolean +nm_device_set_ip4_config (NMDevice *self, + NMIP4Config *new_config, + gboolean assumed, + NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv; + const char *ip_iface; + NMIP4Config *old_config = NULL; + gboolean success = TRUE; + NMIP4ConfigCompareFlags diff = NM_IP4_COMPARE_FLAG_ALL; + NMNamedManager *named_mgr; + + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + g_return_val_if_fail (reason != NULL, FALSE); + + priv = NM_DEVICE_GET_PRIVATE (self); + ip_iface = nm_device_get_ip_iface (self); + + old_config = priv->ip4_config; + + if (new_config && old_config) + diff = nm_ip4_config_diff (new_config, old_config); + + /* No actual change, do nothing */ + if (diff == NM_IP4_COMPARE_FLAG_NONE) + return TRUE; + + named_mgr = nm_named_manager_get (); + if (old_config) { + /* Remove any previous IP4 Config from the named manager */ + nm_named_manager_remove_ip4_config (named_mgr, ip_iface, old_config); + g_object_unref (old_config); + priv->ip4_config = NULL; + } + + if (new_config) { + priv->ip4_config = g_object_ref (new_config); + + /* Don't touch the device's actual IP config if the connection is + * assumed when NM starts. + */ + if (!assumed) + success = nm_system_apply_ip4_config (ip_iface, new_config, nm_device_get_priority (self), diff); + + if (success || assumed) { + /* Export over D-Bus */ + if (!nm_ip4_config_get_dbus_path (new_config)) + nm_ip4_config_export (new_config); + + /* Add the DNS information to the named manager */ + nm_named_manager_add_ip4_config (named_mgr, ip_iface, new_config, NM_NAMED_IP_CONFIG_TYPE_DEFAULT); + + nm_device_update_ip4_address (self); + } + } + g_object_unref (named_mgr); + + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_IP4_CONFIG); + + return success; +} + +/* + * nm_device_get_ip4_address + * + * Get a device's IPv4 address + * + */ +guint32 +nm_device_get_ip4_address (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, 0); + + return NM_DEVICE_GET_PRIVATE (self)->ip4_address; +} + + +void +nm_device_update_ip4_address (NMDevice *self) +{ + struct ifreq req; + guint32 new_address; + int fd; + + g_return_if_fail (self != NULL); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_IP4, "couldn't open control socket."); + return; + } + + memset (&req, 0, sizeof (struct ifreq)); + strncpy (req.ifr_name, nm_device_get_ip_iface (self), IFNAMSIZ); + if (ioctl (fd, SIOCGIFADDR, &req) == 0) { + new_address = ((struct sockaddr_in *)(&req.ifr_addr))->sin_addr.s_addr; + if (new_address != nm_device_get_ip4_address (self)) + NM_DEVICE_GET_PRIVATE (self)->ip4_address = new_address; + } + close (fd); +} + +static gboolean +nm_device_set_ip6_config (NMDevice *self, + NMIP6Config *new_config, + gboolean assumed, + NMDeviceStateReason *reason) +{ + NMDevicePrivate *priv; + const char *ip_iface; + NMIP6Config *old_config = NULL; + gboolean success = TRUE; + NMIP6ConfigCompareFlags diff = NM_IP6_COMPARE_FLAG_ALL; + NMNamedManager *named_mgr; + + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + g_return_val_if_fail (reason != NULL, FALSE); + + priv = NM_DEVICE_GET_PRIVATE (self); + ip_iface = nm_device_get_ip_iface (self); + + old_config = priv->ip6_config; + + if (new_config && old_config) + diff = nm_ip6_config_diff (new_config, old_config); + + /* No actual change, do nothing */ + if (diff == NM_IP6_COMPARE_FLAG_NONE) + return TRUE; + + named_mgr = nm_named_manager_get (); + if (old_config) { + /* Remove any previous IP6 Config from the named manager */ + nm_named_manager_remove_ip6_config (named_mgr, ip_iface, old_config); + g_object_unref (old_config); + priv->ip6_config = NULL; + } + + if (new_config) { + priv->ip6_config = g_object_ref (new_config); + + /* Don't touch the device's actual IP config if the connection is + * assumed when NM starts. + */ + if (!assumed) + success = nm_system_apply_ip6_config (ip_iface, new_config, nm_device_get_priority (self), diff); + + if (success || assumed) { + /* Export over D-Bus */ + if (!nm_ip6_config_get_dbus_path (new_config)) + nm_ip6_config_export (new_config); + + /* Add the DNS information to the named manager */ + nm_named_manager_add_ip6_config (named_mgr, ip_iface, new_config, NM_NAMED_IP_CONFIG_TYPE_DEFAULT); + } + } + g_object_unref (named_mgr); + + g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_IP6_CONFIG); + + return success; +} + +NMDHCP6Config * +nm_device_get_dhcp6_config (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (self), NULL); + + return NM_DEVICE_GET_PRIVATE (self)->dhcp6_config; +} + +NMIP6Config * +nm_device_get_ip6_config (NMDevice *self) +{ + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (NM_IS_DEVICE (self), NULL); + + return NM_DEVICE_GET_PRIVATE (self)->ip6_config; +} + +static gboolean +nm_device_is_up (NMDevice *self) +{ + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + + if (NM_DEVICE_GET_CLASS (self)->is_up) + return NM_DEVICE_GET_CLASS (self)->is_up (self); + + return TRUE; +} + +gboolean +nm_device_hw_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware) +{ + gboolean success; + guint32 tries = 0; + + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + + if (nm_device_hw_is_up (self)) + goto out; + + nm_log_info (LOGD_HW, "(%s): bringing up device.", nm_device_get_iface (self)); + + if (NM_DEVICE_GET_CLASS (self)->hw_bring_up) { + success = NM_DEVICE_GET_CLASS (self)->hw_bring_up (self, no_firmware); + if (!success) + return FALSE; + } + + /* Wait for the device to come up if requested */ + while (block && !nm_device_hw_is_up (self) && (tries++ < 50)) + g_usleep (200); + + if (!nm_device_hw_is_up (self)) { + nm_log_warn (LOGD_HW, "(%s): device not up after timeout!", nm_device_get_iface (self)); + return FALSE; + } + +out: + /* Can only get HW address of some devices when they are up */ + if (NM_DEVICE_GET_CLASS (self)->update_hw_address) + NM_DEVICE_GET_CLASS (self)->update_hw_address (self); + + nm_device_update_ip4_address (self); + return TRUE; +} + +void +nm_device_hw_take_down (NMDevice *self, gboolean block) +{ + guint32 tries = 0; + + g_return_if_fail (NM_IS_DEVICE (self)); + + if (!nm_device_hw_is_up (self)) + return; + + nm_log_info (LOGD_HW, "(%s): taking down device.", nm_device_get_iface (self)); + + if (NM_DEVICE_GET_CLASS (self)->hw_take_down) + NM_DEVICE_GET_CLASS (self)->hw_take_down (self); + + /* Wait for the device to come up if requested */ + while (block && nm_device_hw_is_up (self) && (tries++ < 50)) + g_usleep (200); +} + +static gboolean +nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware) +{ + gboolean success = FALSE; + + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + + if (!nm_device_hw_bring_up (self, block, no_firmware)) + return FALSE; + + if (nm_device_is_up (self)) + return TRUE; + + nm_log_info (LOGD_HW, "(%s): preparing device.", nm_device_get_iface (self)); + + if (NM_DEVICE_GET_CLASS (self)->bring_up) + success = NM_DEVICE_GET_CLASS (self)->bring_up (self); + + return success; +} + +static void +nm_device_take_down (NMDevice *self, gboolean block, NMDeviceStateReason reason) +{ + g_return_if_fail (NM_IS_DEVICE (self)); + + if (nm_device_get_act_request (self)) + nm_device_interface_deactivate (NM_DEVICE_INTERFACE (self), reason); + + if (nm_device_is_up (self)) { + nm_log_info (LOGD_HW, "(%s): cleaning up...", nm_device_get_iface (self)); + + if (NM_DEVICE_GET_CLASS (self)->take_down) + NM_DEVICE_GET_CLASS (self)->take_down (self); + } + + nm_device_hw_take_down (self, block); +} + +static void +dispose (GObject *object) +{ + NMDevice *self = NM_DEVICE (object); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + gboolean take_down = TRUE; + + if (priv->disposed || !priv->initialized) + goto out; + + priv->disposed = TRUE; + + /* Don't down can-assume-connection capable devices that are activated with + * a connection that can be assumed. + */ + if ( nm_device_interface_can_assume_connection (NM_DEVICE_INTERFACE (self)) + && (nm_device_get_state (self) == NM_DEVICE_STATE_ACTIVATED)) { + NMConnection *connection; + NMSettingIP4Config *s_ip4; + const char *method = NULL; + + /* Only system connections can be left up */ + connection = nm_act_request_get_connection (priv->act_request); + if ( connection + && (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM)) { + + /* Only static or DHCP IPv4 connections can be left up. + * All IPv6 connections can be left up, so we don't have + * to check that. + */ + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + g_assert (s_ip4); + + method = nm_setting_ip4_config_get_method (s_ip4); + if ( !method + || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) + || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) + take_down = FALSE; + } + } + + /* Clear any delayed transitions */ + delayed_transitions_clear (self); + + /* Clean up and stop DHCP */ + dhcp4_cleanup (self, take_down); + dhcp6_cleanup (self, take_down); + addrconf6_cleanup (self); + dnsmasq_cleanup (self); + + /* Take the device itself down and clear its IPv4 configuration */ + if (priv->managed && take_down) { + NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE; + + nm_device_take_down (self, FALSE, NM_DEVICE_STATE_REASON_REMOVED); + nm_device_set_ip4_config (self, NULL, FALSE, &ignored); + } + + /* reset the saved RA value */ + if (priv->ip6_accept_ra_path) { + nm_utils_do_sysctl (priv->ip6_accept_ra_path, + priv->ip6_accept_ra_save ? "1\n" : "0\n"); + } + g_free (priv->ip6_accept_ra_path); + + activation_source_clear (self, TRUE, AF_INET); + activation_source_clear (self, TRUE, AF_INET6); + + clear_act_request (self); + +out: + G_OBJECT_CLASS (nm_device_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMDevice *self = NM_DEVICE (object); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + g_object_unref (priv->dhcp_manager); + + g_free (priv->udi); + g_free (priv->iface); + g_free (priv->ip_iface); + g_free (priv->driver); + g_free (priv->type_desc); + if (priv->dhcp_anycast_address) + g_byte_array_free (priv->dhcp_anycast_address, TRUE); + + G_OBJECT_CLASS (nm_device_parent_class)->finalize (object); +} + + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + + switch (prop_id) { + case NM_DEVICE_INTERFACE_PROP_UDI: + /* construct-only */ + priv->udi = g_strdup (g_value_get_string (value)); + break; + case NM_DEVICE_INTERFACE_PROP_IFACE: + g_free (priv->iface); + priv->ifindex = 0; + priv->iface = g_value_dup_string (value); + if (priv->iface) { + priv->ifindex = nm_netlink_iface_to_index (priv->iface); + if (priv->ifindex < 0) { + nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", priv->iface); + } + } + break; + case NM_DEVICE_INTERFACE_PROP_DRIVER: + priv->driver = g_strdup (g_value_get_string (value)); + break; + case NM_DEVICE_INTERFACE_PROP_CAPABILITIES: + priv->capabilities = g_value_get_uint (value); + break; + case NM_DEVICE_INTERFACE_PROP_IP4_ADDRESS: + priv->ip4_address = g_value_get_uint (value); + break; + case NM_DEVICE_INTERFACE_PROP_MANAGED: + priv->managed = g_value_get_boolean (value); + break; + case NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE: + g_return_if_fail (priv->type == NM_DEVICE_TYPE_UNKNOWN); + priv->type = g_value_get_uint (value); + break; + case NM_DEVICE_INTERFACE_PROP_TYPE_DESC: + g_free (priv->type_desc); + priv->type_desc = g_value_dup_string (value); + break; + case NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE: + priv->rfkill_type = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDevice *self = NM_DEVICE (object); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMDeviceState state; + + state = nm_device_get_state (self); + + switch (prop_id) { + case NM_DEVICE_INTERFACE_PROP_UDI: + g_value_set_string (value, priv->udi); + break; + case NM_DEVICE_INTERFACE_PROP_IFACE: + g_value_set_string (value, priv->iface); + break; + case NM_DEVICE_INTERFACE_PROP_IFINDEX: + g_value_set_int (value, priv->ifindex); + break; + case NM_DEVICE_INTERFACE_PROP_DRIVER: + g_value_set_string (value, priv->driver); + break; + case NM_DEVICE_INTERFACE_PROP_CAPABILITIES: + g_value_set_uint (value, priv->capabilities); + break; + case NM_DEVICE_INTERFACE_PROP_IP4_ADDRESS: + g_value_set_uint (value, priv->ip4_address); + break; + case NM_DEVICE_INTERFACE_PROP_IP4_CONFIG: + if ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG)) { + if (priv->ip4_config) { + g_value_set_boxed (value, nm_ip4_config_get_dbus_path (priv->ip4_config)); + break; + } + } + g_value_set_boxed (value, "/"); + break; + case NM_DEVICE_INTERFACE_PROP_DHCP4_CONFIG: + if ( ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG)) + && priv->dhcp4_client) + g_value_set_boxed (value, nm_dhcp4_config_get_dbus_path (priv->dhcp4_config)); + else + g_value_set_boxed (value, "/"); + break; + case NM_DEVICE_INTERFACE_PROP_IP6_CONFIG: + if ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG)) { + if (priv->ip6_config) { + g_value_set_boxed (value, nm_ip6_config_get_dbus_path (priv->ip6_config)); + break; + } + } + g_value_set_boxed (value, "/"); + break; + case NM_DEVICE_INTERFACE_PROP_DHCP6_CONFIG: + if ( ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG)) + && priv->dhcp6_client) + g_value_set_boxed (value, nm_dhcp6_config_get_dbus_path (priv->dhcp6_config)); + else + g_value_set_boxed (value, "/"); + break; + case NM_DEVICE_INTERFACE_PROP_STATE: + g_value_set_uint (value, priv->state); + break; + case NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE: + g_value_set_uint (value, priv->type); + break; + case NM_DEVICE_INTERFACE_PROP_MANAGED: + g_value_set_boolean (value, priv->managed); + break; + case NM_DEVICE_INTERFACE_PROP_TYPE_DESC: + g_value_set_string (value, priv->type_desc); + break; + case NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE: + g_value_set_uint (value, priv->rfkill_type); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + + +static void +nm_device_class_init (NMDeviceClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMDevicePrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + object_class->finalize = finalize; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->constructor = constructor; + + klass->get_type_capabilities = real_get_type_capabilities; + klass->get_generic_capabilities = real_get_generic_capabilities; + klass->act_stage1_prepare = real_act_stage1_prepare; + klass->act_stage2_config = real_act_stage2_config; + klass->act_stage3_ip4_config_start = real_act_stage3_ip4_config_start; + klass->act_stage3_ip6_config_start = real_act_stage3_ip6_config_start; + klass->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config; + klass->act_stage4_get_ip6_config = real_act_stage4_get_ip6_config; + klass->act_stage4_ip4_config_timeout = real_act_stage4_ip4_config_timeout; + klass->act_stage4_ip6_config_timeout = real_act_stage4_ip6_config_timeout; + + /* Properties */ + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_UDI, + NM_DEVICE_INTERFACE_UDI); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_IFACE, + NM_DEVICE_INTERFACE_IFACE); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_IFINDEX, + NM_DEVICE_INTERFACE_IFINDEX); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_DRIVER, + NM_DEVICE_INTERFACE_DRIVER); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_CAPABILITIES, + NM_DEVICE_INTERFACE_CAPABILITIES); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_IP4_ADDRESS, + NM_DEVICE_INTERFACE_IP4_ADDRESS); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_IP4_CONFIG, + NM_DEVICE_INTERFACE_IP4_CONFIG); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_DHCP4_CONFIG, + NM_DEVICE_INTERFACE_DHCP4_CONFIG); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_IP6_CONFIG, + NM_DEVICE_INTERFACE_IP6_CONFIG); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_DHCP6_CONFIG, + NM_DEVICE_INTERFACE_DHCP6_CONFIG); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_STATE, + NM_DEVICE_INTERFACE_STATE); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE, + NM_DEVICE_INTERFACE_DEVICE_TYPE); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_MANAGED, + NM_DEVICE_INTERFACE_MANAGED); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_TYPE_DESC, + NM_DEVICE_INTERFACE_TYPE_DESC); + + g_object_class_override_property (object_class, + NM_DEVICE_INTERFACE_PROP_RFKILL_TYPE, + NM_DEVICE_INTERFACE_RFKILL_TYPE); + + signals[AUTOCONNECT_ALLOWED] = + g_signal_new ("autoconnect-allowed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + 0, + autoconnect_allowed_accumulator, NULL, + _nm_marshal_BOOLEAN__VOID, + G_TYPE_BOOLEAN, 0); +} + +static gboolean +failed_to_disconnected (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + nm_log_dbg (LOGD_DEVICE, "(%s): running failed->disconnected transition", + nm_device_get_iface (self)); + priv->failed_to_disconnected_id = 0; + nm_device_state_changed (self, NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE); + return FALSE; +} + +static gboolean +unavailable_to_disconnected (gpointer user_data) +{ + NMDevice *self = NM_DEVICE (user_data); + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + + nm_log_dbg (LOGD_DEVICE, "(%s): running unavailable->disconnected transition", + nm_device_get_iface (self)); + priv->unavailable_to_disconnected_id = 0; + nm_device_state_changed (self, NM_DEVICE_STATE_DISCONNECTED, NM_DEVICE_STATE_REASON_NONE); + return FALSE; +} + +void +nm_device_state_changed (NMDevice *device, + NMDeviceState state, + NMDeviceStateReason reason) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + NMDeviceState old_state; + NMActRequest *req; + gboolean no_firmware = FALSE; + + g_return_if_fail (NM_IS_DEVICE (device)); + + if (priv->state == state) + return; + + old_state = priv->state; + priv->state = state; + + nm_log_info (LOGD_DEVICE, "(%s): device state change: %d -> %d (reason %d)", + nm_device_get_iface (device), old_state, state, reason); + + /* Clear any delayed transitions */ + delayed_transitions_clear (device); + + /* Cache the activation request for the dispatcher */ + req = priv->act_request ? g_object_ref (priv->act_request) : NULL; + + /* Handle the new state here; but anything that could trigger + * another state change should be done below. + */ + switch (state) { + case NM_DEVICE_STATE_UNMANAGED: + if (old_state > NM_DEVICE_STATE_UNMANAGED) + nm_device_take_down (device, TRUE, reason); + break; + case NM_DEVICE_STATE_UNAVAILABLE: + if (old_state == NM_DEVICE_STATE_UNMANAGED) { + if (!nm_device_bring_up (device, TRUE, &no_firmware) && no_firmware) { + nm_log_warn (LOGD_HW, "%s: firmware may be missing.", nm_device_get_iface (device)); + } + } + /* 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. + */ + if (reason != NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) + nm_device_interface_deactivate (NM_DEVICE_INTERFACE (device), reason); + break; + case NM_DEVICE_STATE_DISCONNECTED: + if (old_state != NM_DEVICE_STATE_UNAVAILABLE) + nm_device_interface_deactivate (NM_DEVICE_INTERFACE (device), reason); + break; + default: + priv->autoconnect_inhibit = FALSE; + break; + } + + g_object_notify (G_OBJECT (device), NM_DEVICE_INTERFACE_STATE); + g_signal_emit_by_name (device, "state-changed", state, old_state, reason); + + /* Post-process the event after internal notification */ + + switch (state) { + case NM_DEVICE_STATE_UNAVAILABLE: + /* If the device can activate now (ie, it's got a carrier, the supplicant + * is active, or whatever) schedule a delayed transition to DISCONNECTED + * to get things rolling. The device can't transition immediately becuase + * we can't change states again from the state handler for a variety of + * reasons. + */ + if (nm_device_is_available (device)) { + nm_log_dbg (LOGD_DEVICE, "(%s): device is available, will transition to DISCONNECTED", + nm_device_get_iface (device)); + priv->unavailable_to_disconnected_id = g_idle_add (unavailable_to_disconnected, device); + } else { + nm_log_dbg (LOGD_DEVICE, "(%s): device not yet available for transition to DISCONNECTED", + nm_device_get_iface (device)); + } + break; + case NM_DEVICE_STATE_ACTIVATED: + nm_log_info (LOGD_DEVICE, "Activation (%s) successful, device activated.", + nm_device_get_iface (device)); + nm_utils_call_dispatcher ("up", nm_act_request_get_connection (req), device, NULL); + break; + case NM_DEVICE_STATE_FAILED: + nm_log_warn (LOGD_DEVICE, "Activation (%s) failed.", nm_device_get_iface (device)); + /* Schedule the transition to DISCONNECTED. The device can't transition + * immediately becuase we can't change states again from the state + * handler for a variety of reasons. + */ + priv->failed_to_disconnected_id = g_idle_add (failed_to_disconnected, device); + break; + default: + break; + } + + if (old_state == NM_DEVICE_STATE_ACTIVATED) + nm_utils_call_dispatcher ("down", nm_act_request_get_connection (req), device, NULL); + + /* Dispose of the cached activation request */ + if (req) + g_object_unref (req); +} + +NMDeviceState +nm_device_get_state (NMDevice *device) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), NM_DEVICE_STATE_UNKNOWN); + + return NM_DEVICE_GET_PRIVATE (device)->state; +} + +gboolean +nm_device_get_managed (NMDevice *device) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + return NM_DEVICE_GET_PRIVATE (device)->managed; +} + +void +nm_device_set_managed (NMDevice *device, + gboolean managed, + NMDeviceStateReason reason) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (device)); + + priv = NM_DEVICE_GET_PRIVATE (device); + if (priv->managed == managed) + return; + + priv->managed = managed; + nm_log_info (LOGD_DEVICE, "(%s): now %s", + nm_device_get_iface (device), + managed ? "managed" : "unmanaged"); + + g_object_notify (G_OBJECT (device), NM_DEVICE_INTERFACE_MANAGED); + + /* If now managed, jump to unavailable */ + if (managed) + nm_device_state_changed (device, NM_DEVICE_STATE_UNAVAILABLE, reason); + else + nm_device_state_changed (device, NM_DEVICE_STATE_UNMANAGED, reason); +} + +static gboolean +spec_match_list (NMDeviceInterface *device, const GSList *specs) +{ + NMDevice *self; + + g_return_val_if_fail (device != NULL, FALSE); + + self = NM_DEVICE (device); + if (NM_DEVICE_GET_CLASS (self)->spec_match_list) + return NM_DEVICE_GET_CLASS (self)->spec_match_list (self, specs); + + return FALSE; +} + +static NMConnection * +connection_match_config (NMDeviceInterface *device, const GSList *connections) +{ + g_return_val_if_fail (device != NULL, FALSE); + + if (NM_DEVICE_GET_CLASS (device)->connection_match_config) + return NM_DEVICE_GET_CLASS (device)->connection_match_config (NM_DEVICE (device), connections); + return NULL; +} + +void +nm_device_set_dhcp_timeout (NMDevice *device, guint32 timeout) +{ + g_return_if_fail (NM_IS_DEVICE (device)); + + NM_DEVICE_GET_PRIVATE (device)->dhcp_timeout = timeout; +} + +void +nm_device_set_dhcp_anycast_address (NMDevice *device, guint8 *addr) +{ + NMDevicePrivate *priv; + + g_return_if_fail (NM_IS_DEVICE (device)); + + priv = NM_DEVICE_GET_PRIVATE (device); + + if (priv->dhcp_anycast_address) { + g_byte_array_free (priv->dhcp_anycast_address, TRUE); + priv->dhcp_anycast_address = NULL; + } + + if (addr) { + priv->dhcp_anycast_address = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (priv->dhcp_anycast_address, addr, ETH_ALEN); + } +} + + +void +nm_device_clear_autoconnect_inhibit (NMDevice *device) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device); + g_return_if_fail (priv); + priv->autoconnect_inhibit = FALSE; +} + diff --git a/src/nm-device.h b/src/nm-device.h new file mode 100644 index 00000000..202f3924 --- /dev/null +++ b/src/nm-device.h @@ -0,0 +1,188 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef NM_DEVICE_H +#define NM_DEVICE_H + +#include +#include +#include + +#include "NetworkManager.h" +#include "nm-activation-request.h" +#include "nm-ip4-config.h" +#include "nm-ip6-config.h" +#include "nm-dhcp4-config.h" +#include "nm-dhcp6-config.h" +#include "nm-connection.h" + +typedef enum NMActStageReturn +{ + NM_ACT_STAGE_RETURN_FAILURE = 0, + NM_ACT_STAGE_RETURN_SUCCESS, + NM_ACT_STAGE_RETURN_POSTPONE, + NM_ACT_STAGE_RETURN_STOP /* This activation chain is done */ +} NMActStageReturn; + + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE (nm_device_get_type ()) +#define NM_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE, NMDevice)) +#define NM_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE, NMDeviceClass)) +#define NM_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE)) +#define NM_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE)) +#define NM_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE, NMDeviceClass)) + +typedef struct { + GObject parent; +} NMDevice; + +typedef struct { + GObjectClass parent; + + /* Hardware state, ie IFF_UP */ + gboolean (*hw_is_up) (NMDevice *self); + gboolean (*hw_bring_up) (NMDevice *self, gboolean *no_firmware); + void (*hw_take_down) (NMDevice *self); + + /* Additional stuff required to operate the device, like a + * connection to the supplicant, Bluez, etc + */ + gboolean (*is_up) (NMDevice *self); + gboolean (*bring_up) (NMDevice *self); + void (*take_down) (NMDevice *self); + + void (* update_hw_address) (NMDevice *self); + + guint32 (* get_type_capabilities) (NMDevice *self); + guint32 (* get_generic_capabilities) (NMDevice *self); + + gboolean (* is_available) (NMDevice *self); + + NMConnection * (* get_best_auto_connection) (NMDevice *self, + GSList *connections, + char **specific_object); + + void (* connection_secrets_updated) (NMDevice *self, + NMConnection *connection, + GSList *updated_settings, + RequestSecretsCaller caller); + + gboolean (* check_connection_compatible) (NMDevice *self, + NMConnection *connection, + GError **error); + + NMActStageReturn (* act_stage1_prepare) (NMDevice *self, + NMDeviceStateReason *reason); + NMActStageReturn (* act_stage2_config) (NMDevice *self, + NMDeviceStateReason *reason); + NMActStageReturn (* act_stage3_ip4_config_start) (NMDevice *self, + NMDeviceStateReason *reason); + NMActStageReturn (* act_stage3_ip6_config_start) (NMDevice *self, + NMDeviceStateReason *reason); + NMActStageReturn (* act_stage4_get_ip4_config) (NMDevice *self, + NMIP4Config **config, + NMDeviceStateReason *reason); + NMActStageReturn (* act_stage4_get_ip6_config) (NMDevice *self, + NMIP6Config **config, + NMDeviceStateReason *reason); + NMActStageReturn (* act_stage4_ip4_config_timeout) (NMDevice *self, + NMIP4Config **config, + NMDeviceStateReason *reason); + NMActStageReturn (* act_stage4_ip6_config_timeout) (NMDevice *self, + NMIP6Config **config, + NMDeviceStateReason *reason); + void (* deactivate) (NMDevice *self); + void (* deactivate_quickly) (NMDevice *self); + + gboolean (* can_interrupt_activation) (NMDevice *self); + + gboolean (* spec_match_list) (NMDevice *self, const GSList *specs); + + NMConnection * (* connection_match_config) (NMDevice *self, const GSList *connections); +} NMDeviceClass; + + +GType nm_device_get_type (void); + +const char * nm_device_get_path (NMDevice *dev); +void nm_device_set_path (NMDevice *dev, const char *path); + +const char * nm_device_get_udi (NMDevice *dev); +const char * nm_device_get_iface (NMDevice *dev); +int nm_device_get_ifindex (NMDevice *dev); +const char * nm_device_get_ip_iface (NMDevice *dev); +int nm_device_get_ip_ifindex(NMDevice *dev); +const char * nm_device_get_driver (NMDevice *dev); +const char * nm_device_get_type_desc (NMDevice *dev); + +NMDeviceType nm_device_get_device_type (NMDevice *dev); +guint32 nm_device_get_capabilities (NMDevice *dev); +guint32 nm_device_get_type_capabilities (NMDevice *dev); + +int nm_device_get_priority (NMDevice *dev); + +guint32 nm_device_get_ip4_address (NMDevice *dev); +void nm_device_update_ip4_address (NMDevice *dev); + +NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *dev); +NMDHCP6Config * nm_device_get_dhcp6_config (NMDevice *dev); + +NMIP4Config * nm_device_get_ip4_config (NMDevice *dev); +NMIP6Config * nm_device_get_ip6_config (NMDevice *dev); + +void * nm_device_get_system_config_data (NMDevice *dev); + +NMActRequest * nm_device_get_act_request (NMDevice *dev); + +gboolean nm_device_is_available (NMDevice *dev); + +NMConnection * nm_device_get_best_auto_connection (NMDevice *dev, + GSList *connections, + char **specific_object); + +void nm_device_activate_schedule_stage1_device_prepare (NMDevice *device); +void nm_device_activate_schedule_stage2_device_config (NMDevice *device); +void nm_device_activate_schedule_stage4_ip4_config_get (NMDevice *device); +void nm_device_activate_schedule_stage4_ip4_config_timeout (NMDevice *device); +void nm_device_activate_schedule_stage4_ip6_config_get (NMDevice *device); +void nm_device_activate_schedule_stage4_ip6_config_timeout (NMDevice *device); +gboolean nm_device_deactivate_quickly (NMDevice *dev); +gboolean nm_device_is_activating (NMDevice *dev); +gboolean nm_device_can_interrupt_activation (NMDevice *self); +gboolean nm_device_autoconnect_allowed (NMDevice *self); + +NMDeviceState nm_device_get_state (NMDevice *device); + +gboolean nm_device_get_managed (NMDevice *device); +void nm_device_set_managed (NMDevice *device, + gboolean managed, + NMDeviceStateReason reason); + +void nm_device_set_dhcp_timeout (NMDevice *device, guint32 timeout); +void nm_device_set_dhcp_anycast_address (NMDevice *device, guint8 *addr); + +void nm_device_clear_autoconnect_inhibit (NMDevice *device); + +G_END_DECLS + +#endif /* NM_DEVICE_H */ diff --git a/src/nm-dhcp4-config.c b/src/nm-dhcp4-config.c new file mode 100644 index 00000000..5acf053f --- /dev/null +++ b/src/nm-dhcp4-config.c @@ -0,0 +1,192 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#include +#include + +#include "NetworkManager.h" +#include "nm-dbus-manager.h" +#include "nm-dhcp4-config.h" +#include "nm-dhcp4-config-glue.h" +#include "nm-dbus-glib-types.h" +#include "nm-properties-changed-signal.h" +#include "nm-utils.h" + + +G_DEFINE_TYPE (NMDHCP4Config, nm_dhcp4_config, G_TYPE_OBJECT) + +#define NM_DHCP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP4_CONFIG, NMDHCP4ConfigPrivate)) + +typedef struct { + char *dbus_path; + GHashTable *options; +} NMDHCP4ConfigPrivate; + + +enum { + PROP_0, + PROP_OPTIONS, + + LAST_PROP +}; + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + +NMDHCP4Config * +nm_dhcp4_config_new (void) +{ + return NM_DHCP4_CONFIG (g_object_new (NM_TYPE_DHCP4_CONFIG, NULL)); +} + +void +nm_dhcp4_config_add_option (NMDHCP4Config *self, + const char *key, + const char *option) +{ + GValue *svalue; + + g_return_if_fail (NM_IS_DHCP4_CONFIG (self)); + g_return_if_fail (key != NULL); + g_return_if_fail (option != NULL); + + svalue = g_slice_new0 (GValue); + g_value_init (svalue, G_TYPE_STRING); + g_value_set_string (svalue, option); + g_hash_table_insert (NM_DHCP4_CONFIG_GET_PRIVATE (self)->options, g_strdup (key), svalue); + g_object_notify (G_OBJECT (self), NM_DHCP4_CONFIG_OPTIONS); +} + +void +nm_dhcp4_config_reset (NMDHCP4Config *self) +{ + g_return_if_fail (NM_IS_DHCP4_CONFIG (self)); + + g_hash_table_remove_all (NM_DHCP4_CONFIG_GET_PRIVATE (self)->options); + g_object_notify (G_OBJECT (self), NM_DHCP4_CONFIG_OPTIONS); +} + +const char * +nm_dhcp4_config_get_option (NMDHCP4Config *self, const char *key) +{ + GValue *value; + + g_return_val_if_fail (NM_IS_DHCP4_CONFIG (self), NULL); + g_return_val_if_fail (key != NULL, NULL); + + value = g_hash_table_lookup (NM_DHCP4_CONFIG_GET_PRIVATE (self)->options, key); + return value ? g_value_get_string (value) : NULL; +} + +const char * +nm_dhcp4_config_get_dbus_path (NMDHCP4Config *self) +{ + g_return_val_if_fail (NM_IS_DHCP4_CONFIG (self), NULL); + + return NM_DHCP4_CONFIG_GET_PRIVATE (self)->dbus_path; +} + +static void +nm_gvalue_destroy (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static void +nm_dhcp4_config_init (NMDHCP4Config *self) +{ + NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (self); + static guint32 counter = 0; + DBusGConnection *connection; + NMDBusManager *dbus_mgr; + + dbus_mgr = nm_dbus_manager_get (); + connection = nm_dbus_manager_get_connection (dbus_mgr); + priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/DHCP4Config/%d", counter++); + dbus_g_connection_register_g_object (connection, priv->dbus_path, G_OBJECT (self)); + g_object_unref (dbus_mgr); + + priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy); +} + +static void +finalize (GObject *object) +{ + NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object); + + g_free (priv->dbus_path); + 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) +{ + NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_OPTIONS: + g_value_set_boxed (value, priv->options); + 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); + + g_type_class_add_private (config_class, sizeof (NMDHCP4ConfigPrivate)); + + /* virtual methods */ + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + g_object_class_install_property + (object_class, PROP_OPTIONS, + g_param_spec_boxed (NM_DHCP4_CONFIG_OPTIONS, + "Options", + "DHCP configuration options returned by the server", + DBUS_TYPE_G_MAP_OF_VARIANT, + G_PARAM_READABLE)); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDHCP4ConfigClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (config_class), + &dbus_glib_nm_dhcp4_config_object_info); +} diff --git a/src/nm-dhcp4-config.h b/src/nm-dhcp4-config.h new file mode 100644 index 00000000..ffaa8430 --- /dev/null +++ b/src/nm-dhcp4-config.h @@ -0,0 +1,61 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#ifndef NM_DHCP4_CONFIG_H +#define NM_DHCP4_CONFIG_H + +#include +#include + +#define NM_TYPE_DHCP4_CONFIG (nm_dhcp4_config_get_type ()) +#define NM_DHCP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP4_CONFIG, NMDHCP4Config)) +#define NM_DHCP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP4_CONFIG, NMDHCP4ConfigClass)) +#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 ((obj), NM_TYPE_DHCP4_CONFIG)) +#define NM_DHCP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP4_CONFIG, NMDHCP4ConfigClass)) + +typedef struct { + GObject parent; +} NMDHCP4Config; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*properties_changed) (NMDHCP4Config *config, GHashTable *properties); +} NMDHCP4ConfigClass; + +#define NM_DHCP4_CONFIG_OPTIONS "options" + +GType nm_dhcp4_config_get_type (void); + +NMDHCP4Config *nm_dhcp4_config_new (void); + +const char *nm_dhcp4_config_get_dbus_path (NMDHCP4Config *config); + +void nm_dhcp4_config_add_option (NMDHCP4Config *config, + const char *key, + const char *option); + +void nm_dhcp4_config_reset (NMDHCP4Config *config); + +const char *nm_dhcp4_config_get_option (NMDHCP4Config *config, const char *option); + +#endif /* NM_DHCP4_CONFIG_H */ diff --git a/src/nm-dhcp6-config.c b/src/nm-dhcp6-config.c new file mode 100644 index 00000000..fb6ccce5 --- /dev/null +++ b/src/nm-dhcp6-config.c @@ -0,0 +1,192 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#include +#include + +#include "NetworkManager.h" +#include "nm-dbus-manager.h" +#include "nm-dhcp6-config.h" +#include "nm-dhcp6-config-glue.h" +#include "nm-dbus-glib-types.h" +#include "nm-properties-changed-signal.h" +#include "nm-utils.h" + + +G_DEFINE_TYPE (NMDHCP6Config, nm_dhcp6_config, G_TYPE_OBJECT) + +#define NM_DHCP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigPrivate)) + +typedef struct { + char *dbus_path; + GHashTable *options; +} NMDHCP6ConfigPrivate; + + +enum { + PROP_0, + PROP_OPTIONS, + + LAST_PROP +}; + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + +NMDHCP6Config * +nm_dhcp6_config_new (void) +{ + return NM_DHCP6_CONFIG (g_object_new (NM_TYPE_DHCP6_CONFIG, NULL)); +} + +void +nm_dhcp6_config_add_option (NMDHCP6Config *self, + const char *key, + const char *option) +{ + GValue *svalue; + + g_return_if_fail (NM_IS_DHCP6_CONFIG (self)); + g_return_if_fail (key != NULL); + g_return_if_fail (option != NULL); + + svalue = g_slice_new0 (GValue); + g_value_init (svalue, G_TYPE_STRING); + g_value_set_string (svalue, option); + g_hash_table_insert (NM_DHCP6_CONFIG_GET_PRIVATE (self)->options, g_strdup (key), svalue); + g_object_notify (G_OBJECT (self), NM_DHCP6_CONFIG_OPTIONS); +} + +void +nm_dhcp6_config_reset (NMDHCP6Config *self) +{ + g_return_if_fail (NM_IS_DHCP6_CONFIG (self)); + + g_hash_table_remove_all (NM_DHCP6_CONFIG_GET_PRIVATE (self)->options); + g_object_notify (G_OBJECT (self), NM_DHCP6_CONFIG_OPTIONS); +} + +const char * +nm_dhcp6_config_get_option (NMDHCP6Config *self, const char *key) +{ + GValue *value; + + g_return_val_if_fail (NM_IS_DHCP6_CONFIG (self), NULL); + g_return_val_if_fail (key != NULL, NULL); + + value = g_hash_table_lookup (NM_DHCP6_CONFIG_GET_PRIVATE (self)->options, key); + return value ? g_value_get_string (value) : NULL; +} + +const char * +nm_dhcp6_config_get_dbus_path (NMDHCP6Config *self) +{ + g_return_val_if_fail (NM_IS_DHCP6_CONFIG (self), NULL); + + return NM_DHCP6_CONFIG_GET_PRIVATE (self)->dbus_path; +} + +static void +nm_gvalue_destroy (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static void +nm_dhcp6_config_init (NMDHCP6Config *self) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (self); + static guint32 counter = 0; + DBusGConnection *connection; + NMDBusManager *dbus_mgr; + + dbus_mgr = nm_dbus_manager_get (); + connection = nm_dbus_manager_get_connection (dbus_mgr); + priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/DHCP6Config/%d", counter++); + dbus_g_connection_register_g_object (connection, priv->dbus_path, G_OBJECT (self)); + g_object_unref (dbus_mgr); + + priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy); +} + +static void +finalize (GObject *object) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + + g_free (priv->dbus_path); + 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) +{ + NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_OPTIONS: + g_value_set_boxed (value, priv->options); + 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); + + g_type_class_add_private (config_class, sizeof (NMDHCP6ConfigPrivate)); + + /* virtual methods */ + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + g_object_class_install_property + (object_class, PROP_OPTIONS, + g_param_spec_boxed (NM_DHCP6_CONFIG_OPTIONS, + "Options", + "DHCP configuration options returned by the server", + DBUS_TYPE_G_MAP_OF_VARIANT, + G_PARAM_READABLE)); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMDHCP6ConfigClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (config_class), + &dbus_glib_nm_dhcp6_config_object_info); +} diff --git a/src/nm-dhcp6-config.h b/src/nm-dhcp6-config.h new file mode 100644 index 00000000..90eb10ff --- /dev/null +++ b/src/nm-dhcp6-config.h @@ -0,0 +1,61 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#ifndef NM_DHCP6_CONFIG_H +#define NM_DHCP6_CONFIG_H + +#include +#include + +#define NM_TYPE_DHCP6_CONFIG (nm_dhcp6_config_get_type ()) +#define NM_DHCP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DHCP6_CONFIG, NMDHCP6Config)) +#define NM_DHCP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigClass)) +#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 ((obj), NM_TYPE_DHCP6_CONFIG)) +#define NM_DHCP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP6_CONFIG, NMDHCP6ConfigClass)) + +typedef struct { + GObject parent; +} NMDHCP6Config; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*properties_changed) (NMDHCP6Config *config, GHashTable *properties); +} NMDHCP6ConfigClass; + +#define NM_DHCP6_CONFIG_OPTIONS "options" + +GType nm_dhcp6_config_get_type (void); + +NMDHCP6Config *nm_dhcp6_config_new (void); + +const char *nm_dhcp6_config_get_dbus_path (NMDHCP6Config *config); + +void nm_dhcp6_config_add_option (NMDHCP6Config *config, + const char *key, + const char *option); + +void nm_dhcp6_config_reset (NMDHCP6Config *config); + +const char *nm_dhcp6_config_get_option (NMDHCP6Config *config, const char *option); + +#endif /* NM_DHCP6_CONFIG_H */ diff --git a/src/nm-hostname-provider.c b/src/nm-hostname-provider.c new file mode 100644 index 00000000..1cd1ca6c --- /dev/null +++ b/src/nm-hostname-provider.c @@ -0,0 +1,54 @@ +/* -*- 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) 2009 Novell, Inc. + */ + +#include "nm-hostname-provider.h" + +const char * +nm_hostname_provider_get_hostname (NMHostnameProvider *self) +{ + g_return_val_if_fail (NM_IS_HOSTNAME_PROVIDER (self), NULL); + + return NM_HOSTNAME_PROVIDER_GET_INTERFACE (self)->get_hostname (self); +} + +GType +nm_hostname_provider_get_type (void) +{ + static GType type = 0; + + if (!G_UNLIKELY (type)) { + const GTypeInfo type_info = { + sizeof (NMHostnameProvider), /* class_size */ + NULL, /* base_init */ + NULL, /* base_finalize */ + NULL, + NULL, /* class_finalize */ + NULL, /* class_data */ + 0, + 0, /* n_preallocs */ + NULL + }; + + type = g_type_register_static (G_TYPE_INTERFACE, "NMHostnameProvider", &type_info, 0); + g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); + } + + return type; +} diff --git a/src/nm-hostname-provider.h b/src/nm-hostname-provider.h new file mode 100644 index 00000000..7fe5c006 --- /dev/null +++ b/src/nm-hostname-provider.h @@ -0,0 +1,44 @@ +/* -*- 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) 2009 Novell, Inc. + */ + +#ifndef NM_HOSTNAME_PROVIDER_H +#define NM_HOSTNAME_PROVIDER_H + +#include + +#define NM_TYPE_HOSTNAME_PROVIDER (nm_hostname_provider_get_type ()) +#define NM_HOSTNAME_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_HOSTNAME_PROVIDER, NMHostnameProvider)) +#define NM_IS_HOSTNAME_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_HOSTNAME_PROVIDER)) +#define NM_HOSTNAME_PROVIDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_HOSTNAME_PROVIDER, NMHostnameProvider)) + +typedef struct _NMHostnameProvider NMHostnameProvider; + +struct _NMHostnameProvider { + GTypeInterface g_iface; + + /* Methods */ + const char *(*get_hostname) (NMHostnameProvider *self); +}; + +GType nm_hostname_provider_get_type (void); + +const char *nm_hostname_provider_get_hostname (NMHostnameProvider *self); + +#endif /* NM_HOSTNAME_PROVIDER_H */ diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c new file mode 100644 index 00000000..0ae3d1be --- /dev/null +++ b/src/nm-ip4-config.c @@ -0,0 +1,909 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include "nm-ip4-config.h" +#include "nm-dbus-manager.h" +#include "NetworkManager.h" +#include "NetworkManagerUtils.h" +#include "nm-setting-ip4-config.h" +#include "nm-utils.h" + +#include +#include +#include + +#include "nm-ip4-config-glue.h" +#include "nm-dbus-glib-types.h" + + +G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, G_TYPE_OBJECT) + +#define NM_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP4_CONFIG, NMIP4ConfigPrivate)) + +typedef struct { + char *path; + + GSList *addresses; + guint32 ptp_address; + + guint32 mtu; /* Maximum Transmission Unit of the interface */ + guint32 mss; /* Maximum Segment Size of the route */ + + GArray *nameservers; + GPtrArray *domains; + GPtrArray *searches; + + GArray *wins; + + GArray *nis; + char * nis_domain; + + GSList *routes; + + gboolean never_default; +} NMIP4ConfigPrivate; + + +enum { + PROP_0, + PROP_ADDRESSES, + PROP_NAMESERVERS, + PROP_DOMAINS, + PROP_ROUTES, + PROP_WINS_SERVERS, + + LAST_PROP +}; + + +static struct nl_addr * +nm_utils_ip4_addr_to_nl_addr (guint32 ip4_addr) +{ + struct nl_addr * nla = NULL; + + if (!(nla = nl_addr_alloc (sizeof (in_addr_t)))) + return NULL; + nl_addr_set_family (nla, AF_INET); + nl_addr_set_binary_addr (nla, &ip4_addr, sizeof (guint32)); + + return nla; +} + + +NMIP4Config * +nm_ip4_config_new (void) +{ + return (NMIP4Config *) g_object_new (NM_TYPE_IP4_CONFIG, NULL); +} + +void +nm_ip4_config_export (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + NMDBusManager *dbus_mgr; + DBusGConnection *connection; + static guint32 counter = 0; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + g_return_if_fail (priv->path == NULL); + + dbus_mgr = nm_dbus_manager_get (); + connection = nm_dbus_manager_get_connection (dbus_mgr); + priv->path = g_strdup_printf (NM_DBUS_PATH "/IP4Config/%d", counter++); + + dbus_g_connection_register_g_object (connection, priv->path, G_OBJECT (config)); + g_object_unref (dbus_mgr); +} + +const char * +nm_ip4_config_get_dbus_path (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), FALSE); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->path; +} + +void +nm_ip4_config_take_address (NMIP4Config *config, NMIP4Address *address) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (address != NULL); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + priv->addresses = g_slist_append (priv->addresses, address); +} + +void +nm_ip4_config_add_address (NMIP4Config *config, + NMIP4Address *address) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (address != NULL); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + priv->addresses = g_slist_append (priv->addresses, nm_ip4_address_dup (address)); +} + +void +nm_ip4_config_replace_address (NMIP4Config *config, + guint i, + NMIP4Address *new_address) +{ + NMIP4ConfigPrivate *priv; + GSList *old; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + old = g_slist_nth (priv->addresses, i); + g_return_if_fail (old != NULL); + nm_ip4_address_unref ((NMIP4Address *) old->data); + + old->data = nm_ip4_address_dup (new_address); +} + +NMIP4Address *nm_ip4_config_get_address (NMIP4Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL); + + return (NMIP4Address *) g_slist_nth_data (NM_IP4_CONFIG_GET_PRIVATE (config)->addresses, i); +} + +guint32 nm_ip4_config_get_num_addresses (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return g_slist_length (NM_IP4_CONFIG_GET_PRIVATE (config)->addresses); +} + +guint32 nm_ip4_config_get_ptp_address (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->ptp_address; +} + +void nm_ip4_config_set_ptp_address (NMIP4Config *config, guint32 ptp_addr) +{ + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + NM_IP4_CONFIG_GET_PRIVATE (config)->ptp_address = ptp_addr; +} + +void nm_ip4_config_add_nameserver (NMIP4Config *config, guint32 nameserver) +{ + NMIP4ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (nameserver > 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + for (i = 0; i < priv->nameservers->len; i++) { + guint32 s = g_array_index (priv->nameservers, guint32, i); + + /* No dupes */ + g_return_if_fail (nameserver != s); + } + + g_array_append_val (priv->nameservers, nameserver); +} + +guint32 nm_ip4_config_get_nameserver (NMIP4Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return g_array_index (NM_IP4_CONFIG_GET_PRIVATE (config)->nameservers, guint32, i); +} + +guint32 nm_ip4_config_get_num_nameservers (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->nameservers->len; +} + +void nm_ip4_config_reset_nameservers (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (priv->nameservers->len) + g_array_remove_range (priv->nameservers, 0, priv->nameservers->len); +} + +void nm_ip4_config_add_wins (NMIP4Config *config, guint32 wins) +{ + NMIP4ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (wins > 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + for (i = 0; i < priv->wins->len; i++) { + guint32 s = g_array_index (priv->wins, guint32, i); + + /* No dupes */ + g_return_if_fail (wins != s); + } + + g_array_append_val (priv->wins, wins); +} + +guint32 nm_ip4_config_get_wins (NMIP4Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return g_array_index (NM_IP4_CONFIG_GET_PRIVATE (config)->wins, guint32, i); +} + +guint32 nm_ip4_config_get_num_wins (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->wins->len; +} + +void nm_ip4_config_reset_wins (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (priv->wins->len) + g_array_remove_range (priv->wins, 0, priv->wins->len); +} + +void +nm_ip4_config_take_route (NMIP4Config *config, NMIP4Route *route) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (route != NULL); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + priv->routes = g_slist_append (priv->routes, route); +} + +void +nm_ip4_config_add_route (NMIP4Config *config, NMIP4Route *route) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (route != NULL); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + priv->routes = g_slist_append (priv->routes, nm_ip4_route_dup (route)); +} + +void +nm_ip4_config_replace_route (NMIP4Config *config, + guint i, + NMIP4Route *new_route) +{ + NMIP4ConfigPrivate *priv; + GSList *old; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + old = g_slist_nth (priv->routes, i); + g_return_if_fail (old != NULL); + nm_ip4_route_unref ((NMIP4Route *) old->data); + + old->data = nm_ip4_route_dup (new_route); +} + +NMIP4Route * +nm_ip4_config_get_route (NMIP4Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL); + + return (NMIP4Route *) g_slist_nth_data (NM_IP4_CONFIG_GET_PRIVATE (config)->routes, i); +} + +guint32 nm_ip4_config_get_num_routes (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return g_slist_length (NM_IP4_CONFIG_GET_PRIVATE (config)->routes); +} + +void nm_ip4_config_reset_routes (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + g_slist_foreach (priv->routes, (GFunc) g_free, NULL); + priv->routes = NULL; +} + +void nm_ip4_config_add_domain (NMIP4Config *config, const char *domain) +{ + NMIP4ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (domain != NULL); + g_return_if_fail (strlen (domain) > 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + + for (i = 0; i < priv->domains->len; i++) { + if (!strcmp (g_ptr_array_index (priv->domains, i), domain)) + return; + } + + g_ptr_array_add (priv->domains, g_strdup (domain)); +} + +const char *nm_ip4_config_get_domain (NMIP4Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL); + + return (const char *) g_ptr_array_index (NM_IP4_CONFIG_GET_PRIVATE (config)->domains, i); +} + +guint32 nm_ip4_config_get_num_domains (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->domains->len; +} + +void nm_ip4_config_reset_domains (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + for (i = 0; i < priv->domains->len; i++) + g_free (g_ptr_array_index (priv->domains, i)); + g_ptr_array_free (priv->domains, TRUE); + priv->domains = g_ptr_array_sized_new (3); +} + +void nm_ip4_config_add_search (NMIP4Config *config, const char *search) +{ + NMIP4ConfigPrivate *priv; + int i; + + g_return_if_fail (config != NULL); + g_return_if_fail (search != NULL); + g_return_if_fail (strlen (search) > 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + + for (i = 0; i < priv->searches->len; i++) { + if (!strcmp (g_ptr_array_index (priv->searches, i), search)) + return; + } + + g_ptr_array_add (priv->searches, g_strdup (search)); +} + +const char *nm_ip4_config_get_search (NMIP4Config *config, guint i) +{ + g_return_val_if_fail (config != NULL, NULL); + + return (const char *) g_ptr_array_index (NM_IP4_CONFIG_GET_PRIVATE (config)->searches, i); +} + +guint32 nm_ip4_config_get_num_searches (NMIP4Config *config) +{ + g_return_val_if_fail (config != NULL, 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->searches->len; +} + +void nm_ip4_config_reset_searches (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + for (i = 0; i < priv->searches->len; i++) + g_free (g_ptr_array_index (priv->searches, i)); + g_ptr_array_free (priv->searches, TRUE); + priv->searches = g_ptr_array_sized_new (3); +} + +guint32 nm_ip4_config_get_mtu (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->mtu; +} + +void nm_ip4_config_set_mtu (NMIP4Config *config, guint32 mtu) +{ + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + NM_IP4_CONFIG_GET_PRIVATE (config)->mtu = mtu; +} + +guint32 nm_ip4_config_get_mss (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->mss; +} + +void nm_ip4_config_set_mss (NMIP4Config *config, guint32 mss) +{ + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + NM_IP4_CONFIG_GET_PRIVATE (config)->mss = mss; +} + +gboolean +nm_ip4_config_get_never_default (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), FALSE); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->never_default; +} + +void +nm_ip4_config_set_never_default (NMIP4Config *config, gboolean never_default) +{ + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + NM_IP4_CONFIG_GET_PRIVATE (config)->never_default = never_default; +} + +void nm_ip4_config_add_nis_server (NMIP4Config *config, guint32 nis) +{ + NMIP4ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + g_return_if_fail (nis > 0); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + for (i = 0; i < priv->nis->len; i++) { + guint32 s = g_array_index (priv->nis, guint32, i); + + /* No dupes */ + g_return_if_fail (nis != s); + } + + g_array_append_val (priv->nis, nis); +} + +guint32 nm_ip4_config_get_nis_server (NMIP4Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return g_array_index (NM_IP4_CONFIG_GET_PRIVATE (config)->nis, guint32, i); +} + +guint32 nm_ip4_config_get_num_nis_servers (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->nis->len; +} + +void nm_ip4_config_reset_nis_servers (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + if (priv->nis->len) + g_array_remove_range (priv->nis, 0, priv->nis->len); +} + +void +nm_ip4_config_set_nis_domain (NMIP4Config *config, const char *domain) +{ + NMIP4ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP4_CONFIG (config)); + + priv = NM_IP4_CONFIG_GET_PRIVATE (config); + g_free (priv->nis_domain); + priv->nis_domain = g_strdup (domain); +} + +const char * +nm_ip4_config_get_nis_domain (NMIP4Config *config) +{ + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0); + + return NM_IP4_CONFIG_GET_PRIVATE (config)->nis_domain; +} + +/* libnl convenience/conversion functions */ + +static int ip4_addr_to_rtnl_local (guint32 ip4_address, struct rtnl_addr *addr) +{ + struct nl_addr * local = NULL; + int err = 0; + + g_return_val_if_fail (addr != NULL, -1); + + local = nm_utils_ip4_addr_to_nl_addr (ip4_address); + err = rtnl_addr_set_local (addr, local); + nl_addr_put (local); + + return err; +} + +static int ip4_addr_to_rtnl_peer (guint32 ip4_address, struct rtnl_addr *addr) +{ + struct nl_addr * peer = NULL; + int err = 0; + + g_return_val_if_fail (addr != NULL, -1); + + peer = nm_utils_ip4_addr_to_nl_addr (ip4_address); + err = rtnl_addr_set_peer (addr, peer); + nl_addr_put (peer); + + return err; +} + +static int ip4_addr_to_rtnl_broadcast (guint32 ip4_broadcast, struct rtnl_addr *addr) +{ + struct nl_addr * local = NULL; + int err = 0; + + g_return_val_if_fail (addr != NULL, -1); + + local = nm_utils_ip4_addr_to_nl_addr (ip4_broadcast); + err = rtnl_addr_set_broadcast (addr, local); + nl_addr_put (local); + + return err; +} + + +struct rtnl_addr * +nm_ip4_config_to_rtnl_addr (NMIP4Config *config, guint32 i, guint32 flags) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config); + NMIP4Address *config_addr; + struct rtnl_addr *addr; + gboolean success = TRUE; + + g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL); + + config_addr = nm_ip4_config_get_address (config, i); + g_return_val_if_fail (config_addr != NULL, NULL); + + if (!(addr = rtnl_addr_alloc())) + return NULL; + + if (flags & NM_RTNL_ADDR_ADDR) + success = (ip4_addr_to_rtnl_local (nm_ip4_address_get_address (config_addr), addr) >= 0); + + if (flags & NM_RTNL_ADDR_PTP_ADDR) + success = (ip4_addr_to_rtnl_peer (priv->ptp_address, addr) >= 0); + + if (flags & NM_RTNL_ADDR_PREFIX) + rtnl_addr_set_prefixlen (addr, nm_ip4_address_get_prefix (config_addr)); + + if (flags & NM_RTNL_ADDR_BROADCAST) { + guint32 hostmask, network, bcast, netmask; + + netmask = nm_utils_ip4_prefix_to_netmask (nm_ip4_address_get_prefix (config_addr)); + network = ntohl (nm_ip4_address_get_address (config_addr)) & ntohl (netmask); + hostmask = ~ntohl (netmask); + bcast = htonl (network | hostmask); + + success = (ip4_addr_to_rtnl_broadcast (bcast, addr) >= 0); + } + + if (!success) { + rtnl_addr_put (addr); + addr = NULL; + } + + return addr; +} + +static gboolean +addr_slist_compare (GSList *a, GSList *b) +{ + GSList *iter_a, *iter_b; + gboolean found = FALSE; + + for (iter_a = a; iter_a; iter_a = g_slist_next (iter_a)) { + NMIP4Address *addr_a = (NMIP4Address *) iter_a->data; + + for (iter_b = b, found = FALSE; iter_b; iter_b = g_slist_next (iter_b)) { + NMIP4Address *addr_b = (NMIP4Address *) iter_b->data; + + if (nm_ip4_address_compare (addr_a, addr_b)) { + found = TRUE; + break; + } + } + + if (!found) + return FALSE; + } + return TRUE; +} + +static gboolean +route_slist_compare (GSList *a, GSList *b) +{ + GSList *iter_a, *iter_b; + gboolean found = FALSE; + + for (iter_a = a; iter_a; iter_a = g_slist_next (iter_a)) { + NMIP4Route *route_a = (NMIP4Route *) iter_a->data; + + for (iter_b = b, found = FALSE; iter_b; iter_b = g_slist_next (iter_b)) { + NMIP4Route *route_b = (NMIP4Route *) iter_b->data; + + if (nm_ip4_route_compare (route_a, route_b)) { + found = TRUE; + break; + } + } + + if (!found) + return FALSE; + } + return TRUE; +} + +static gboolean +string_array_compare (GPtrArray *a, GPtrArray *b) +{ + int i, j; + gboolean found = FALSE; + + for (i = 0; i < a->len; i++) { + for (j = 0, found = FALSE; j < b->len; j++) { + const char *item_a = g_ptr_array_index (a, i); + const char *item_b = g_ptr_array_index (b, j); + + if ((!item_a && !item_b) || (item_a && item_b && !strcmp (item_a, item_b))) { + found = TRUE; + break; + } + } + + if (!found) + return FALSE; + } + return TRUE; +} + +static gboolean +addr_array_compare (GArray *a, GArray *b) +{ + int i, j; + gboolean found = FALSE; + + for (i = 0; i < a->len; i++) { + for (j = 0, found = FALSE; j < b->len; j++) { + if (g_array_index (a, guint32, i) == g_array_index (b, guint32, j)) { + found = TRUE; + break; + } + } + + if (!found) + return FALSE; + } + return TRUE; +} + +NMIP4ConfigCompareFlags +nm_ip4_config_diff (NMIP4Config *a, NMIP4Config *b) +{ + NMIP4ConfigPrivate *a_priv; + NMIP4ConfigPrivate *b_priv; + NMIP4ConfigCompareFlags flags = NM_IP4_COMPARE_FLAG_NONE; + + if ((a && !b) || (b && !a)) + return 0xFFFFFFFF; + if (!a && !b) + return NM_IP4_COMPARE_FLAG_NONE; + + a_priv = NM_IP4_CONFIG_GET_PRIVATE (a); + b_priv = NM_IP4_CONFIG_GET_PRIVATE (b); + + if ( !addr_slist_compare (a_priv->addresses, b_priv->addresses) + || !addr_slist_compare (b_priv->addresses, a_priv->addresses)) + flags |= NM_IP4_COMPARE_FLAG_ADDRESSES; + + if (a_priv->ptp_address != b_priv->ptp_address) + flags |= NM_IP4_COMPARE_FLAG_PTP_ADDRESS; + + if ( (a_priv->nameservers->len != b_priv->nameservers->len) + || !addr_array_compare (a_priv->nameservers, b_priv->nameservers) + || !addr_array_compare (b_priv->nameservers, a_priv->nameservers)) + flags |= NM_IP4_COMPARE_FLAG_NAMESERVERS; + + if ( (a_priv->wins->len != b_priv->wins->len) + || !addr_array_compare (a_priv->wins, b_priv->wins) + || !addr_array_compare (b_priv->wins, a_priv->wins)) + flags |= NM_IP4_COMPARE_FLAG_WINS_SERVERS; + + if ( (a_priv->nis->len != b_priv->nis->len) + || !addr_array_compare (a_priv->nis, b_priv->nis) + || !addr_array_compare (b_priv->nis, a_priv->nis)) + flags |= NM_IP4_COMPARE_FLAG_NIS_SERVERS; + + if ( (a_priv->nis_domain || b_priv->nis_domain) + && (g_strcmp0 (a_priv->nis_domain, b_priv->nis_domain) != 0)) + flags |= NM_IP4_COMPARE_FLAG_NIS_DOMAIN; + + if ( !route_slist_compare (a_priv->routes, b_priv->routes) + || !route_slist_compare (b_priv->routes, a_priv->routes)) + flags |= NM_IP4_COMPARE_FLAG_ROUTES; + + if ( (a_priv->domains->len != b_priv->domains->len) + || !string_array_compare (a_priv->domains, b_priv->domains) + || !string_array_compare (b_priv->domains, a_priv->domains)) + flags |= NM_IP4_COMPARE_FLAG_DOMAINS; + + if ( (a_priv->searches->len != b_priv->searches->len) + || !string_array_compare (a_priv->searches, b_priv->searches) + || !string_array_compare (b_priv->searches, a_priv->searches)) + flags |= NM_IP4_COMPARE_FLAG_SEARCHES; + + if (a_priv->mtu != b_priv->mtu) + flags |= NM_IP4_COMPARE_FLAG_MTU; + + if (a_priv->mss != b_priv->mss) + flags |= NM_IP4_COMPARE_FLAG_MSS; + + return flags; +} + +static void +nm_ip4_config_init (NMIP4Config *config) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config); + + priv->nameservers = g_array_new (FALSE, TRUE, sizeof (guint32)); + priv->wins = g_array_new (FALSE, TRUE, sizeof (guint32)); + priv->domains = g_ptr_array_sized_new (3); + priv->searches = g_ptr_array_sized_new (3); + priv->nis = g_array_new (FALSE, TRUE, sizeof (guint32)); +} + +static void +finalize (GObject *object) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object); + + nm_utils_slist_free (priv->addresses, (GDestroyNotify) nm_ip4_address_unref); + nm_utils_slist_free (priv->routes, (GDestroyNotify) nm_ip4_route_unref); + g_array_free (priv->wins, TRUE); + g_array_free (priv->nameservers, TRUE); + g_ptr_array_free (priv->domains, TRUE); + g_ptr_array_free (priv->searches, TRUE); + g_array_free (priv->nis, TRUE); + g_free (priv->nis_domain); + + G_OBJECT_CLASS (nm_ip4_config_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_ADDRESSES: + nm_utils_ip4_addresses_to_gvalue (priv->addresses, value); + break; + case PROP_NAMESERVERS: + g_value_set_boxed (value, priv->nameservers); + break; + case PROP_DOMAINS: + g_value_set_boxed (value, priv->domains); + break; + case PROP_ROUTES: + nm_utils_ip4_routes_to_gvalue (priv->routes, value); + break; + case PROP_WINS_SERVERS: + g_value_set_boxed (value, priv->wins); + 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); + + g_type_class_add_private (config_class, sizeof (NMIP4ConfigPrivate)); + + /* virtual methods */ + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + g_object_class_install_property + (object_class, PROP_ADDRESSES, + g_param_spec_boxed (NM_IP4_CONFIG_ADDRESSES, + "Addresses", + "IP4 addresses", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_NAMESERVERS, + g_param_spec_boxed (NM_IP4_CONFIG_NAMESERVERS, + "Nameservers", + "DNS list", + DBUS_TYPE_G_UINT_ARRAY, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DOMAINS, + g_param_spec_boxed (NM_IP4_CONFIG_DOMAINS, + "Domains", + "Domains", + DBUS_TYPE_G_ARRAY_OF_STRING, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_ROUTES, + g_param_spec_boxed (NM_IP4_CONFIG_ROUTES, + "Routes", + "Routes", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_WINS_SERVERS, + g_param_spec_boxed (NM_IP4_CONFIG_WINS_SERVERS, + "WinsServers", + "WINS server list", + DBUS_TYPE_G_UINT_ARRAY, + G_PARAM_READABLE)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (config_class), + &dbus_glib_nm_ip4_config_object_info); +} diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h new file mode 100644 index 00000000..2d27acff --- /dev/null +++ b/src/nm-ip4-config.h @@ -0,0 +1,142 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#ifndef NM_IP4_CONFIG_H +#define NM_IP4_CONFIG_H + +#include +#include + +#include "nm-setting-ip4-config.h" + +#define NM_TYPE_IP4_CONFIG (nm_ip4_config_get_type ()) +#define NM_IP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP4_CONFIG, NMIP4Config)) +#define NM_IP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IP4_CONFIG, NMIP4ConfigClass)) +#define NM_IS_IP4_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IP4_CONFIG)) +#define NM_IS_IP4_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IP4_CONFIG)) +#define NM_IP4_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP4_CONFIG, NMIP4ConfigClass)) + +typedef struct { + GObject parent; +} NMIP4Config; + +typedef struct { + GObjectClass parent; +} NMIP4ConfigClass; + +#define NM_IP4_CONFIG_ADDRESSES "addresses" +#define NM_IP4_CONFIG_NAMESERVERS "nameservers" +#define NM_IP4_CONFIG_DOMAINS "domains" +#define NM_IP4_CONFIG_ROUTES "routes" +#define NM_IP4_CONFIG_WINS_SERVERS "wins-servers" + +GType nm_ip4_config_get_type (void); + + +NMIP4Config * nm_ip4_config_new (void); +void nm_ip4_config_export (NMIP4Config *config); +const char * nm_ip4_config_get_dbus_path (NMIP4Config *config); + +void nm_ip4_config_take_address (NMIP4Config *config, NMIP4Address *address); +void nm_ip4_config_add_address (NMIP4Config *config, NMIP4Address *address); +void nm_ip4_config_replace_address (NMIP4Config *config, guint32 i, NMIP4Address *new_address); +NMIP4Address *nm_ip4_config_get_address (NMIP4Config *config, guint32 i); +guint32 nm_ip4_config_get_num_addresses (NMIP4Config *config); + +guint32 nm_ip4_config_get_ptp_address (NMIP4Config *config); +void nm_ip4_config_set_ptp_address (NMIP4Config *config, guint32 ptp_addr); + +void nm_ip4_config_add_nameserver (NMIP4Config *config, guint32 nameserver); +guint32 nm_ip4_config_get_nameserver (NMIP4Config *config, guint i); +guint32 nm_ip4_config_get_num_nameservers (NMIP4Config *config); +void nm_ip4_config_reset_nameservers (NMIP4Config *config); + +void nm_ip4_config_add_wins (NMIP4Config *config, guint32 wins); +guint32 nm_ip4_config_get_wins (NMIP4Config *config, guint i); +guint32 nm_ip4_config_get_num_wins (NMIP4Config *config); +void nm_ip4_config_reset_wins (NMIP4Config *config); + +void nm_ip4_config_take_route (NMIP4Config *config, NMIP4Route *route); +void nm_ip4_config_add_route (NMIP4Config *config, NMIP4Route *route); +void nm_ip4_config_replace_route (NMIP4Config *config, guint32 i, NMIP4Route *new_route); +NMIP4Route * nm_ip4_config_get_route (NMIP4Config *config, guint32 i); +guint32 nm_ip4_config_get_num_routes (NMIP4Config *config); +void nm_ip4_config_reset_routes (NMIP4Config *config); + +void nm_ip4_config_add_domain (NMIP4Config *config, const char *domain); +const char * nm_ip4_config_get_domain (NMIP4Config *config, guint i); +guint32 nm_ip4_config_get_num_domains (NMIP4Config *config); +void nm_ip4_config_reset_domains (NMIP4Config *config); + +void nm_ip4_config_add_search (NMIP4Config *config, const char *search); +const char * nm_ip4_config_get_search (NMIP4Config *config, guint i); +guint32 nm_ip4_config_get_num_searches (NMIP4Config *config); +void nm_ip4_config_reset_searches (NMIP4Config *config); + +guint32 nm_ip4_config_get_mtu (NMIP4Config *config); +void nm_ip4_config_set_mtu (NMIP4Config *config, guint32 mtu); + +guint32 nm_ip4_config_get_mss (NMIP4Config *config); +void nm_ip4_config_set_mss (NMIP4Config *config, guint32 mss); + +gboolean nm_ip4_config_get_never_default (NMIP4Config *config); +void nm_ip4_config_set_never_default (NMIP4Config *config, gboolean never_default); + +void nm_ip4_config_add_nis_server (NMIP4Config *config, guint32 nis); +guint32 nm_ip4_config_get_nis_server (NMIP4Config *config, guint i); +guint32 nm_ip4_config_get_num_nis_servers (NMIP4Config *config); +void nm_ip4_config_reset_nis_servers (NMIP4Config *config); + +void nm_ip4_config_set_nis_domain (NMIP4Config *config, const char *domain); +const char * nm_ip4_config_get_nis_domain (NMIP4Config *config); + + +/* Flags for nm_ip4_config_to_rtnl_addr() */ +#define NM_RTNL_ADDR_NONE 0x0000 +#define NM_RTNL_ADDR_ADDR 0x0001 +#define NM_RTNL_ADDR_PTP_ADDR 0x0002 +#define NM_RTNL_ADDR_PREFIX 0x0004 +#define NM_RTNL_ADDR_BROADCAST 0x0008 + +#define NM_RTNL_ADDR_DEFAULT (NM_RTNL_ADDR_ADDR | NM_RTNL_ADDR_PREFIX | NM_RTNL_ADDR_BROADCAST) +#define NM_RTNL_ADDR_PTP_DEFAULT (NM_RTNL_ADDR_ADDR | NM_RTNL_ADDR_PREFIX | NM_RTNL_ADDR_PTP_ADDR) + +struct rtnl_addr *nm_ip4_config_to_rtnl_addr (NMIP4Config *config, guint32 i, guint32 flags); + +typedef enum { + NM_IP4_COMPARE_FLAG_NONE = 0x00000000, /* match nothing, kinda pointless */ + NM_IP4_COMPARE_FLAG_ADDRESSES = 0x00000001, + NM_IP4_COMPARE_FLAG_PTP_ADDRESS = 0x00000002, + NM_IP4_COMPARE_FLAG_NAMESERVERS = 0x00000004, + NM_IP4_COMPARE_FLAG_ROUTES = 0x00000008, + NM_IP4_COMPARE_FLAG_DOMAINS = 0x00000010, + NM_IP4_COMPARE_FLAG_SEARCHES = 0x00000020, + NM_IP4_COMPARE_FLAG_MTU = 0x00000040, + NM_IP4_COMPARE_FLAG_MSS = 0x00000080, + NM_IP4_COMPARE_FLAG_WINS_SERVERS= 0x00000100, + NM_IP4_COMPARE_FLAG_NIS_SERVERS = 0x00000200, + NM_IP4_COMPARE_FLAG_NIS_DOMAIN = 0x00000400, + NM_IP4_COMPARE_FLAG_ALL = 0xFFFFFFFF /* match everything */ +} NMIP4ConfigCompareFlags; + +/* Returns a bitfield representing how the two IP4 configs differ */ +NMIP4ConfigCompareFlags nm_ip4_config_diff (NMIP4Config *a, NMIP4Config *b); + +#endif /* NM_IP4_CONFIG_H */ diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c new file mode 100644 index 00000000..4c6c5c62 --- /dev/null +++ b/src/nm-ip6-config.c @@ -0,0 +1,745 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include "nm-ip6-config.h" +#include "nm-dbus-manager.h" +#include "NetworkManager.h" +#include "NetworkManagerUtils.h" +#include "nm-setting-ip6-config.h" +#include "nm-utils.h" + +#include +#include +#include + +#include "nm-ip6-config-glue.h" +#include "nm-dbus-glib-types.h" + + +G_DEFINE_TYPE (NMIP6Config, nm_ip6_config, G_TYPE_OBJECT) + +#define NM_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP6_CONFIG, NMIP6ConfigPrivate)) + +typedef struct { + char *path; + + GSList *addresses; + struct in6_addr ptp_address; + + guint32 mss; /* Maximum Segment Size of the route */ + + GArray *nameservers; + GPtrArray *domains; + GPtrArray *searches; + + GSList *routes; + + gboolean never_default; +} NMIP6ConfigPrivate; + + +enum { + PROP_0, + PROP_ADDRESSES, + PROP_NAMESERVERS, + PROP_DOMAINS, + PROP_ROUTES, + + LAST_PROP +}; + + +static struct nl_addr * +nm_utils_ip6_addr_to_nl_addr (const struct in6_addr *ip6_addr) +{ + struct nl_addr * nla = NULL; + + if (!(nla = nl_addr_alloc (sizeof (struct in6_addr)))) + return NULL; + nl_addr_set_family (nla, AF_INET6); + nl_addr_set_binary_addr (nla, (struct in6_addr *)ip6_addr, sizeof (struct in6_addr)); + + return nla; +} + + +NMIP6Config * +nm_ip6_config_new (void) +{ + return (NMIP6Config *) g_object_new (NM_TYPE_IP6_CONFIG, NULL); +} + +void +nm_ip6_config_export (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + NMDBusManager *dbus_mgr; + DBusGConnection *connection; + static guint32 counter = 0; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + g_return_if_fail (priv->path == NULL); + + dbus_mgr = nm_dbus_manager_get (); + connection = nm_dbus_manager_get_connection (dbus_mgr); + priv->path = g_strdup_printf (NM_DBUS_PATH "/IP6Config/%d", counter++); + + dbus_g_connection_register_g_object (connection, priv->path, G_OBJECT (config)); + g_object_unref (dbus_mgr); +} + +const char * +nm_ip6_config_get_dbus_path (NMIP6Config *config) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), FALSE); + + return NM_IP6_CONFIG_GET_PRIVATE (config)->path; +} + +void +nm_ip6_config_take_address (NMIP6Config *config, NMIP6Address *address) +{ + NMIP6ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + g_return_if_fail (address != NULL); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + priv->addresses = g_slist_append (priv->addresses, address); +} + +void +nm_ip6_config_add_address (NMIP6Config *config, + NMIP6Address *address) +{ + NMIP6ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + g_return_if_fail (address != NULL); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + priv->addresses = g_slist_append (priv->addresses, nm_ip6_address_dup (address)); +} + +void +nm_ip6_config_replace_address (NMIP6Config *config, + guint i, + NMIP6Address *new_address) +{ + NMIP6ConfigPrivate *priv; + GSList *old; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + old = g_slist_nth (priv->addresses, i); + g_return_if_fail (old != NULL); + nm_ip6_address_unref ((NMIP6Address *) old->data); + + old->data = nm_ip6_address_dup (new_address); +} + +NMIP6Address *nm_ip6_config_get_address (NMIP6Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL); + + return (NMIP6Address *) g_slist_nth_data (NM_IP6_CONFIG_GET_PRIVATE (config)->addresses, i); +} + +guint32 nm_ip6_config_get_num_addresses (NMIP6Config *config) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + return g_slist_length (NM_IP6_CONFIG_GET_PRIVATE (config)->addresses); +} + +const struct in6_addr *nm_ip6_config_get_ptp_address (NMIP6Config *config) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + return &NM_IP6_CONFIG_GET_PRIVATE (config)->ptp_address; +} + +void nm_ip6_config_set_ptp_address (NMIP6Config *config, const struct in6_addr *ptp_addr) +{ + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + NM_IP6_CONFIG_GET_PRIVATE (config)->ptp_address = *ptp_addr; +} + +void nm_ip6_config_add_nameserver (NMIP6Config *config, const struct in6_addr *nameserver) +{ + NMIP6ConfigPrivate *priv; + struct in6_addr *nameservers; + int i; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + g_return_if_fail (nameserver != NULL); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + + /* No dupes */ + nameservers = (struct in6_addr *)priv->nameservers->data; + for (i = 0; i < priv->nameservers->len; i++) + g_return_if_fail (IN6_ARE_ADDR_EQUAL (nameserver, &nameservers[i]) == FALSE); + + g_array_append_val (priv->nameservers, *nameserver); +} + +const struct in6_addr *nm_ip6_config_get_nameserver (NMIP6Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + return &g_array_index (NM_IP6_CONFIG_GET_PRIVATE (config)->nameservers, struct in6_addr, i); +} + +guint32 nm_ip6_config_get_num_nameservers (NMIP6Config *config) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + return NM_IP6_CONFIG_GET_PRIVATE (config)->nameservers->len; +} + +void nm_ip6_config_reset_nameservers (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + if (priv->nameservers->len) + g_array_remove_range (priv->nameservers, 0, priv->nameservers->len); +} + +void +nm_ip6_config_take_route (NMIP6Config *config, NMIP6Route *route) +{ + NMIP6ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + g_return_if_fail (route != NULL); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + priv->routes = g_slist_append (priv->routes, route); +} + +void +nm_ip6_config_add_route (NMIP6Config *config, NMIP6Route *route) +{ + NMIP6ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + g_return_if_fail (route != NULL); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + priv->routes = g_slist_append (priv->routes, nm_ip6_route_dup (route)); +} + +void +nm_ip6_config_replace_route (NMIP6Config *config, + guint i, + NMIP6Route *new_route) +{ + NMIP6ConfigPrivate *priv; + GSList *old; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + old = g_slist_nth (priv->routes, i); + g_return_if_fail (old != NULL); + nm_ip6_route_unref ((NMIP6Route *) old->data); + + old->data = nm_ip6_route_dup (new_route); +} + +NMIP6Route * +nm_ip6_config_get_route (NMIP6Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL); + + return (NMIP6Route *) g_slist_nth_data (NM_IP6_CONFIG_GET_PRIVATE (config)->routes, i); +} + +guint32 nm_ip6_config_get_num_routes (NMIP6Config *config) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + return g_slist_length (NM_IP6_CONFIG_GET_PRIVATE (config)->routes); +} + +void nm_ip6_config_reset_routes (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + g_slist_foreach (priv->routes, (GFunc) g_free, NULL); + priv->routes = NULL; +} + +void nm_ip6_config_add_domain (NMIP6Config *config, const char *domain) +{ + NMIP6ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + g_return_if_fail (domain != NULL); + g_return_if_fail (strlen (domain) > 0); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + + for (i = 0; i < priv->domains->len; i++) { + if (!strcmp (g_ptr_array_index (priv->domains, i), domain)) + return; + } + + g_ptr_array_add (priv->domains, g_strdup (domain)); +} + +const char *nm_ip6_config_get_domain (NMIP6Config *config, guint i) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL); + + return (const char *) g_ptr_array_index (NM_IP6_CONFIG_GET_PRIVATE (config)->domains, i); +} + +guint32 nm_ip6_config_get_num_domains (NMIP6Config *config) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + return NM_IP6_CONFIG_GET_PRIVATE (config)->domains->len; +} + +void nm_ip6_config_reset_domains (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + for (i = 0; i < priv->domains->len; i++) + g_free (g_ptr_array_index (priv->domains, i)); + g_ptr_array_free (priv->domains, TRUE); + priv->domains = g_ptr_array_sized_new (3); +} + +void nm_ip6_config_add_search (NMIP6Config *config, const char *search) +{ + NMIP6ConfigPrivate *priv; + int i; + + g_return_if_fail (config != NULL); + g_return_if_fail (search != NULL); + g_return_if_fail (strlen (search) > 0); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + + for (i = 0; i < priv->searches->len; i++) { + if (!strcmp (g_ptr_array_index (priv->searches, i), search)) + return; + } + + g_ptr_array_add (priv->searches, g_strdup (search)); +} + +const char *nm_ip6_config_get_search (NMIP6Config *config, guint i) +{ + g_return_val_if_fail (config != NULL, NULL); + + return (const char *) g_ptr_array_index (NM_IP6_CONFIG_GET_PRIVATE (config)->searches, i); +} + +guint32 nm_ip6_config_get_num_searches (NMIP6Config *config) +{ + g_return_val_if_fail (config != NULL, 0); + + return NM_IP6_CONFIG_GET_PRIVATE (config)->searches->len; +} + +void nm_ip6_config_reset_searches (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv; + int i; + + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + priv = NM_IP6_CONFIG_GET_PRIVATE (config); + for (i = 0; i < priv->searches->len; i++) + g_free (g_ptr_array_index (priv->searches, i)); + g_ptr_array_free (priv->searches, TRUE); + priv->searches = g_ptr_array_sized_new (3); +} + +guint32 nm_ip6_config_get_mss (NMIP6Config *config) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), 0); + + return NM_IP6_CONFIG_GET_PRIVATE (config)->mss; +} + +void nm_ip6_config_set_mss (NMIP6Config *config, guint32 mss) +{ + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + NM_IP6_CONFIG_GET_PRIVATE (config)->mss = mss; +} + +gboolean +nm_ip6_config_get_never_default (NMIP6Config *config) +{ + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), FALSE); + + return NM_IP6_CONFIG_GET_PRIVATE (config)->never_default; +} + +void +nm_ip6_config_set_never_default (NMIP6Config *config, gboolean never_default) +{ + g_return_if_fail (NM_IS_IP6_CONFIG (config)); + + NM_IP6_CONFIG_GET_PRIVATE (config)->never_default = never_default; +} + +/* libnl convenience/conversion functions */ + +static int ip6_addr_to_rtnl_local (const struct in6_addr *ip6_address, struct rtnl_addr *addr) +{ + struct nl_addr * local = NULL; + int err = 0; + + g_return_val_if_fail (addr != NULL, -1); + + local = nm_utils_ip6_addr_to_nl_addr (ip6_address); + err = rtnl_addr_set_local (addr, local); + nl_addr_put (local); + + return err; +} + +static int ip6_addr_to_rtnl_peer (const struct in6_addr *ip6_address, struct rtnl_addr *addr) +{ + struct nl_addr * peer = NULL; + int err = 0; + + g_return_val_if_fail (addr != NULL, -1); + + peer = nm_utils_ip6_addr_to_nl_addr (ip6_address); + err = rtnl_addr_set_peer (addr, peer); + nl_addr_put (peer); + + return err; +} + +struct rtnl_addr * +nm_ip6_config_to_rtnl_addr (NMIP6Config *config, guint32 i, guint32 flags) +{ + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config); + NMIP6Address *config_addr; + struct rtnl_addr *addr; + gboolean success = TRUE; + + g_return_val_if_fail (NM_IS_IP6_CONFIG (config), NULL); + + config_addr = nm_ip6_config_get_address (config, i); + g_return_val_if_fail (config_addr != NULL, NULL); + + if (!(addr = rtnl_addr_alloc())) + return NULL; + + if (flags & NM_RTNL_ADDR_ADDR) + success = (ip6_addr_to_rtnl_local (nm_ip6_address_get_address (config_addr), addr) >= 0); + + if (flags & NM_RTNL_ADDR_PTP_ADDR) + success = (ip6_addr_to_rtnl_peer (&priv->ptp_address, addr) >= 0); + + if (flags & NM_RTNL_ADDR_PREFIX) + rtnl_addr_set_prefixlen (addr, nm_ip6_address_get_prefix (config_addr)); + + if (!success) { + rtnl_addr_put (addr); + addr = NULL; + } + + return addr; +} + +static gboolean +addr_slist_compare (GSList *a, GSList *b) +{ + GSList *iter_a, *iter_b; + gboolean found = FALSE; + + for (iter_a = a; iter_a; iter_a = g_slist_next (iter_a)) { + NMIP6Address *addr_a = (NMIP6Address *) iter_a->data; + + for (iter_b = b, found = FALSE; iter_b; iter_b = g_slist_next (iter_b)) { + NMIP6Address *addr_b = (NMIP6Address *) iter_b->data; + + if (nm_ip6_address_compare (addr_a, addr_b)) { + found = TRUE; + break; + } + } + + if (!found) + return FALSE; + } + return TRUE; +} + +static gboolean +route_slist_compare (GSList *a, GSList *b) +{ + GSList *iter_a, *iter_b; + gboolean found = FALSE; + + for (iter_a = a; iter_a; iter_a = g_slist_next (iter_a)) { + NMIP6Route *route_a = (NMIP6Route *) iter_a->data; + + for (iter_b = b, found = FALSE; iter_b; iter_b = g_slist_next (iter_b)) { + NMIP6Route *route_b = (NMIP6Route *) iter_b->data; + + if (nm_ip6_route_compare (route_a, route_b)) { + found = TRUE; + break; + } + } + + if (!found) + return FALSE; + } + return TRUE; +} + +static gboolean +string_array_compare (GPtrArray *a, GPtrArray *b) +{ + int i, j; + gboolean found = FALSE; + + for (i = 0; i < a->len; i++) { + for (j = 0, found = FALSE; j < b->len; j++) { + const char *item_a = g_ptr_array_index (a, i); + const char *item_b = g_ptr_array_index (b, j); + + if ((!item_a && !item_b) || (item_a && item_b && !strcmp (item_a, item_b))) { + found = TRUE; + break; + } + } + + if (!found) + return FALSE; + } + return TRUE; +} + +static gboolean +addr_array_compare (GArray *a, GArray *b) +{ + struct in6_addr *addrs_a, *addrs_b; + int i, j; + gboolean found = FALSE; + + addrs_a = (struct in6_addr *)a->data; + addrs_b = (struct in6_addr *)b->data; + for (i = 0; i < a->len; i++) { + for (j = 0, found = FALSE; j < b->len; j++) { + if (IN6_ARE_ADDR_EQUAL (&addrs_a[i], &addrs_b[j])) { + found = TRUE; + break; + } + } + + if (!found) + return FALSE; + } + return TRUE; +} + +NMIP6ConfigCompareFlags +nm_ip6_config_diff (NMIP6Config *a, NMIP6Config *b) +{ + NMIP6ConfigPrivate *a_priv; + NMIP6ConfigPrivate *b_priv; + NMIP6ConfigCompareFlags flags = NM_IP6_COMPARE_FLAG_NONE; + + if ((a && !b) || (b && !a)) + return 0xFFFFFFFF; + if (!a && !b) + return NM_IP6_COMPARE_FLAG_NONE; + + a_priv = NM_IP6_CONFIG_GET_PRIVATE (a); + b_priv = NM_IP6_CONFIG_GET_PRIVATE (b); + + if ( !addr_slist_compare (a_priv->addresses, b_priv->addresses) + || !addr_slist_compare (b_priv->addresses, a_priv->addresses)) + flags |= NM_IP6_COMPARE_FLAG_ADDRESSES; + + if (memcmp (&a_priv->ptp_address, &b_priv->ptp_address, sizeof (struct in6_addr)) != 0) + flags |= NM_IP6_COMPARE_FLAG_PTP_ADDRESS; + + if ( (a_priv->nameservers->len != b_priv->nameservers->len) + || !addr_array_compare (a_priv->nameservers, b_priv->nameservers) + || !addr_array_compare (b_priv->nameservers, a_priv->nameservers)) + flags |= NM_IP6_COMPARE_FLAG_NAMESERVERS; + + if ( !route_slist_compare (a_priv->routes, b_priv->routes) + || !route_slist_compare (b_priv->routes, a_priv->routes)) + flags |= NM_IP6_COMPARE_FLAG_ROUTES; + + if ( (a_priv->domains->len != b_priv->domains->len) + || !string_array_compare (a_priv->domains, b_priv->domains) + || !string_array_compare (b_priv->domains, a_priv->domains)) + flags |= NM_IP6_COMPARE_FLAG_DOMAINS; + + if ( (a_priv->searches->len != b_priv->searches->len) + || !string_array_compare (a_priv->searches, b_priv->searches) + || !string_array_compare (b_priv->searches, a_priv->searches)) + flags |= NM_IP6_COMPARE_FLAG_SEARCHES; + + if (a_priv->mss != b_priv->mss) + flags |= NM_IP6_COMPARE_FLAG_MSS; + + return flags; +} + +static void +nm_ip6_config_init (NMIP6Config *config) +{ + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config); + + priv->nameservers = g_array_new (FALSE, TRUE, sizeof (struct in6_addr)); + priv->domains = g_ptr_array_sized_new (3); + priv->searches = g_ptr_array_sized_new (3); +} + +static void +finalize (GObject *object) +{ + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object); + + nm_utils_slist_free (priv->addresses, (GDestroyNotify) nm_ip6_address_unref); + nm_utils_slist_free (priv->routes, (GDestroyNotify) nm_ip6_route_unref); + g_array_free (priv->nameservers, TRUE); + g_ptr_array_free (priv->domains, TRUE); + g_ptr_array_free (priv->searches, TRUE); + + G_OBJECT_CLASS (nm_ip6_config_parent_class)->finalize (object); +} + +static void +nameservers_to_gvalue (GArray *array, GValue *value) +{ + GPtrArray *dns; + guint i = 0; + + dns = g_ptr_array_new (); + + while (array && (i < array->len)) { + struct in6_addr *addr; + GByteArray *bytearray; + addr = &g_array_index (array, struct in6_addr, i++); + + bytearray = g_byte_array_sized_new (16); + g_byte_array_append (bytearray, (guint8 *) addr->s6_addr, 16); + g_ptr_array_add (dns, bytearray); + } + + g_value_take_boxed (value, dns); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_ADDRESSES: + nm_utils_ip6_addresses_to_gvalue (priv->addresses, value); + break; + case PROP_NAMESERVERS: + nameservers_to_gvalue (priv->nameservers, value); + break; + case PROP_DOMAINS: + g_value_set_boxed (value, priv->domains); + break; + case PROP_ROUTES: + nm_utils_ip6_routes_to_gvalue (priv->routes, 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); + + g_type_class_add_private (config_class, sizeof (NMIP6ConfigPrivate)); + + /* virtual methods */ + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + g_object_class_install_property (object_class, PROP_ADDRESSES, + g_param_spec_boxed (NM_IP6_CONFIG_ADDRESSES, + "Addresses", + "IP6 addresses", + DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_NAMESERVERS, + g_param_spec_boxed (NM_IP6_CONFIG_NAMESERVERS, + "Nameservers", + "DNS list", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_DOMAINS, + g_param_spec_boxed (NM_IP6_CONFIG_DOMAINS, + "Domains", + "Domains", + DBUS_TYPE_G_ARRAY_OF_STRING, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_ROUTES, + g_param_spec_boxed (NM_IP6_CONFIG_ROUTES, + "Routes", + "Routes", + DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE, + G_PARAM_READABLE)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (config_class), + &dbus_glib_nm_ip6_config_object_info); +} diff --git a/src/nm-ip6-config.h b/src/nm-ip6-config.h new file mode 100644 index 00000000..1e75a121 --- /dev/null +++ b/src/nm-ip6-config.h @@ -0,0 +1,120 @@ +/* -*- 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) 2008 Red Hat, Inc. + */ + +#ifndef NM_IP6_CONFIG_H +#define NM_IP6_CONFIG_H + +#include +#include + +#include "nm-setting-ip6-config.h" + +#define NM_TYPE_IP6_CONFIG (nm_ip6_config_get_type ()) +#define NM_IP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP6_CONFIG, NMIP6Config)) +#define NM_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IP6_CONFIG, NMIP6ConfigClass)) +#define NM_IS_IP6_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IP6_CONFIG)) +#define NM_IS_IP6_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IP6_CONFIG)) +#define NM_IP6_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP6_CONFIG, NMIP6ConfigClass)) + +typedef struct { + GObject parent; +} NMIP6Config; + +typedef struct { + GObjectClass parent; +} NMIP6ConfigClass; + +#define NM_IP6_CONFIG_ADDRESSES "addresses" +#define NM_IP6_CONFIG_NAMESERVERS "nameservers" +#define NM_IP6_CONFIG_DOMAINS "domains" +#define NM_IP6_CONFIG_ROUTES "routes" + +GType nm_ip6_config_get_type (void); + + +NMIP6Config * nm_ip6_config_new (void); +void nm_ip6_config_export (NMIP6Config *config); +const char * nm_ip6_config_get_dbus_path (NMIP6Config *config); + +void nm_ip6_config_take_address (NMIP6Config *config, NMIP6Address *address); +void nm_ip6_config_add_address (NMIP6Config *config, NMIP6Address *address); +void nm_ip6_config_replace_address (NMIP6Config *config, guint32 i, NMIP6Address *new_address); +NMIP6Address *nm_ip6_config_get_address (NMIP6Config *config, guint32 i); +guint32 nm_ip6_config_get_num_addresses (NMIP6Config *config); + +const struct in6_addr *nm_ip6_config_get_ptp_address (NMIP6Config *config); +void nm_ip6_config_set_ptp_address (NMIP6Config *config, const struct in6_addr *ptp_addr); + +void nm_ip6_config_add_nameserver (NMIP6Config *config, const struct in6_addr *nameserver); +const struct in6_addr *nm_ip6_config_get_nameserver (NMIP6Config *config, guint i); +guint32 nm_ip6_config_get_num_nameservers (NMIP6Config *config); +void nm_ip6_config_reset_nameservers (NMIP6Config *config); + +void nm_ip6_config_take_route (NMIP6Config *config, NMIP6Route *route); +void nm_ip6_config_add_route (NMIP6Config *config, NMIP6Route *route); +void nm_ip6_config_replace_route (NMIP6Config *config, guint32 i, NMIP6Route *new_route); +NMIP6Route * nm_ip6_config_get_route (NMIP6Config *config, guint32 i); +guint32 nm_ip6_config_get_num_routes (NMIP6Config *config); +void nm_ip6_config_reset_routes (NMIP6Config *config); + +void nm_ip6_config_add_domain (NMIP6Config *config, const char *domain); +const char * nm_ip6_config_get_domain (NMIP6Config *config, guint i); +guint32 nm_ip6_config_get_num_domains (NMIP6Config *config); +void nm_ip6_config_reset_domains (NMIP6Config *config); + +void nm_ip6_config_add_search (NMIP6Config *config, const char *search); +const char * nm_ip6_config_get_search (NMIP6Config *config, guint i); +guint32 nm_ip6_config_get_num_searches (NMIP6Config *config); +void nm_ip6_config_reset_searches (NMIP6Config *config); + +guint32 nm_ip6_config_get_mss (NMIP6Config *config); +void nm_ip6_config_set_mss (NMIP6Config *config, guint32 mss); + +gboolean nm_ip6_config_get_never_default (NMIP6Config *config); +void nm_ip6_config_set_never_default (NMIP6Config *config, gboolean never_default); + +/* Flags for nm_ip6_config_to_rtnl_addr() */ +#define NM_RTNL_ADDR_NONE 0x0000 +#define NM_RTNL_ADDR_ADDR 0x0001 +#define NM_RTNL_ADDR_PTP_ADDR 0x0002 +#define NM_RTNL_ADDR_PREFIX 0x0004 +#define NM_RTNL_ADDR_BROADCAST 0x0008 + +#define NM_RTNL_ADDR_DEFAULT (NM_RTNL_ADDR_ADDR | NM_RTNL_ADDR_PREFIX | NM_RTNL_ADDR_BROADCAST) +#define NM_RTNL_ADDR_PTP_DEFAULT (NM_RTNL_ADDR_ADDR | NM_RTNL_ADDR_PREFIX | NM_RTNL_ADDR_PTP_ADDR) + +struct rtnl_addr *nm_ip6_config_to_rtnl_addr (NMIP6Config *config, guint32 i, guint32 flags); + +typedef enum { + NM_IP6_COMPARE_FLAG_NONE = 0x00000000, /* match nothing, kinda pointless */ + NM_IP6_COMPARE_FLAG_ADDRESSES = 0x00000001, + NM_IP6_COMPARE_FLAG_PTP_ADDRESS = 0x00000002, + NM_IP6_COMPARE_FLAG_NAMESERVERS = 0x00000004, + NM_IP6_COMPARE_FLAG_ROUTES = 0x00000008, + NM_IP6_COMPARE_FLAG_DOMAINS = 0x00000010, + NM_IP6_COMPARE_FLAG_SEARCHES = 0x00000020, + NM_IP6_COMPARE_FLAG_MSS = 0x00000080, + NM_IP6_COMPARE_FLAG_ALL = 0xFFFFFFFF /* match everything */ +} NMIP6ConfigCompareFlags; + +/* Returns a bitfield representing how the two IP6 configs differ */ +NMIP6ConfigCompareFlags nm_ip6_config_diff (NMIP6Config *a, NMIP6Config *b); + +#endif /* NM_IP6_CONFIG_H */ diff --git a/src/nm-manager.c b/src/nm-manager.c new file mode 100644 index 00000000..7d46285b --- /dev/null +++ b/src/nm-manager.c @@ -0,0 +1,3463 @@ +/* -*- 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 - 2009 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include "nm-glib-compat.h" +#include "nm-manager.h" +#include "nm-logging.h" +#include "nm-dbus-manager.h" +#include "nm-vpn-manager.h" +#include "nm-modem-manager.h" +#include "nm-device-bt.h" +#include "nm-device-interface.h" +#include "nm-device-private.h" +#include "nm-device-ethernet.h" +#include "nm-device-wifi.h" +#include "nm-device-olpc-mesh.h" +#include "nm-device-cdma.h" +#include "nm-device-gsm.h" +#include "nm-system.h" +#include "nm-properties-changed-signal.h" +#include "nm-setting-bluetooth.h" +#include "nm-setting-connection.h" +#include "nm-setting-wireless.h" +#include "nm-setting-vpn.h" +#include "nm-marshal.h" +#include "nm-dbus-glib-types.h" +#include "nm-udev-manager.h" +#include "nm-hostname-provider.h" +#include "nm-bluez-manager.h" +#include "nm-bluez-common.h" +#include "nm-sysconfig-settings.h" +#include "nm-secrets-provider-interface.h" +#include "nm-settings-interface.h" +#include "nm-settings-system-interface.h" + +#define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" +#define NM_AUTOIP_DBUS_IFACE "org.freedesktop.nm_avahi_autoipd" + +static gboolean impl_manager_get_devices (NMManager *manager, GPtrArray **devices, GError **err); +static void impl_manager_activate_connection (NMManager *manager, + const char *service_name, + const char *connection_path, + const char *device_path, + const char *specific_object_path, + DBusGMethodInvocation *context); + +static gboolean impl_manager_deactivate_connection (NMManager *manager, + const char *connection_path, + GError **error); + +static gboolean impl_manager_sleep (NMManager *manager, gboolean sleep, GError **err); + +static gboolean impl_manager_enable (NMManager *manager, gboolean enable, GError **err); + +static gboolean impl_manager_set_logging (NMManager *manager, + const char *level, + const char *domains, + GError **error); + +/* Legacy 0.6 compatibility interface */ + +static gboolean impl_manager_legacy_sleep (NMManager *manager, GError **err); +static gboolean impl_manager_legacy_wake (NMManager *manager, GError **err); +static gboolean impl_manager_legacy_state (NMManager *manager, guint32 *state, GError **err); + +#include "nm-manager-glue.h" + +static void user_destroy_connections (NMManager *manager); + +static void connection_added_default_handler (NMManager *manager, + NMConnection *connection, + NMConnectionScope scope); + +static void udev_device_added_cb (NMUdevManager *udev_mgr, + GUdevDevice *device, + NMDeviceCreatorFn creator_fn, + gpointer user_data); + +static void udev_device_removed_cb (NMUdevManager *udev_mgr, + GUdevDevice *device, + gpointer user_data); + +static void bluez_manager_bdaddr_added_cb (NMBluezManager *bluez_mgr, + const char *bdaddr, + const char *name, + const char *object_path, + guint32 uuids, + NMManager *manager); + +static void bluez_manager_bdaddr_removed_cb (NMBluezManager *bluez_mgr, + const char *bdaddr, + const char *object_path, + gpointer user_data); + +static void bluez_manager_resync_devices (NMManager *self); + +static void add_device (NMManager *self, NMDevice *device); + +static void hostname_provider_init (NMHostnameProvider *provider_class); + +static const char *internal_activate_device (NMManager *manager, + NMDevice *device, + NMConnection *connection, + const char *specific_object, + gboolean user_requested, + gboolean assumed, + GError **error); + +static NMDevice *find_device_by_iface (NMManager *self, const gchar *iface); + +static GSList * remove_one_device (NMManager *manager, + GSList *list, + NMDevice *device, + gboolean quitting, + gboolean force_unmanage); + +static NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *udi); + +#define SSD_POKE_INTERVAL 120 +#define ORIGDEV_TAG "originating-device" + +typedef struct { + DBusGMethodInvocation *context; + NMConnectionScope scope; + char *connection_path; + char *specific_object_path; + char *device_path; + guint timeout_id; +} PendingConnectionInfo; + +typedef struct { + gboolean enabled; + gboolean hw_enabled; + RfKillType rtype; + const char *desc; + const char *key; + const char *prop; + const char *hw_prop; + RfKillState (*other_enabled_func) (NMManager *); +} RadioState; + +typedef struct { + char *config_file; + char *state_file; + + GSList *devices; + NMState state; + + NMDBusManager *dbus_mgr; + NMUdevManager *udev_mgr; + NMBluezManager *bluez_mgr; + + GHashTable *user_connections; + DBusGProxy *user_proxy; + + GHashTable *system_connections; + NMSysconfigSettings *sys_settings; + char *hostname; + + GSList *secrets_calls; + + PendingConnectionInfo *pending_connection_info; + + RadioState radio_states[RFKILL_TYPE_MAX]; + gboolean sleeping; + gboolean net_enabled; + + NMVPNManager *vpn_manager; + guint vpn_manager_id; + + NMModemManager *modem_manager; + guint modem_added_id; + guint modem_removed_id; + + DBusGProxy *aipd_proxy; + + gboolean disposed; +} NMManagerPrivate; + +#define NM_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_MANAGER, NMManagerPrivate)) + +G_DEFINE_TYPE_EXTENDED (NMManager, nm_manager, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_HOSTNAME_PROVIDER, + hostname_provider_init)) + +enum { + DEVICE_ADDED, + DEVICE_REMOVED, + STATE_CHANGED, + STATE_CHANGE, /* DEPRECATED */ + PROPERTIES_CHANGED, + CONNECTIONS_ADDED, + CONNECTION_ADDED, + CONNECTION_UPDATED, + CONNECTION_REMOVED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_STATE, + PROP_NETWORKING_ENABLED, + PROP_WIRELESS_ENABLED, + PROP_WIRELESS_HARDWARE_ENABLED, + PROP_WWAN_ENABLED, + PROP_WWAN_HARDWARE_ENABLED, + PROP_ACTIVE_CONNECTIONS, + + /* Not exported */ + PROP_HOSTNAME, + PROP_SLEEPING, + + LAST_PROP +}; + +typedef enum +{ + NM_MANAGER_ERROR_UNKNOWN_CONNECTION = 0, + NM_MANAGER_ERROR_UNKNOWN_DEVICE, + NM_MANAGER_ERROR_UNMANAGED_DEVICE, + NM_MANAGER_ERROR_INVALID_SERVICE, + NM_MANAGER_ERROR_SYSTEM_CONNECTION, + NM_MANAGER_ERROR_PERMISSION_DENIED, + NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE, + NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, + NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, +} NMManagerError; + +#define NM_MANAGER_ERROR (nm_manager_error_quark ()) +#define NM_TYPE_MANAGER_ERROR (nm_manager_error_get_type ()) + +static GQuark +nm_manager_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-manager-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +static GType +nm_manager_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* Connection was not provided by any known settings service. */ + ENUM_ENTRY (NM_MANAGER_ERROR_UNKNOWN_CONNECTION, "UnknownConnection"), + /* Unknown device. */ + ENUM_ENTRY (NM_MANAGER_ERROR_UNKNOWN_DEVICE, "UnknownDevice"), + /* Unmanaged device. */ + ENUM_ENTRY (NM_MANAGER_ERROR_UNMANAGED_DEVICE, "UnmanagedDevice"), + /* Invalid settings service (not a recognized system or user + * settings service name) + */ + ENUM_ENTRY (NM_MANAGER_ERROR_INVALID_SERVICE, "InvalidService"), + /* Connection was superceded by a system connection. */ + ENUM_ENTRY (NM_MANAGER_ERROR_SYSTEM_CONNECTION, "SystemConnection"), + /* User does not have the permission to activate this connection. */ + ENUM_ENTRY (NM_MANAGER_ERROR_PERMISSION_DENIED, "PermissionDenied"), + /* The connection was not active. */ + ENUM_ENTRY (NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE, "ConnectionNotActive"), + /* The manager is already in the requested sleep state */ + ENUM_ENTRY (NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, "AlreadyAsleepOrAwake"), + /* The manager is already in the requested enabled/disabled state */ + ENUM_ENTRY (NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, "AlreadyEnabledOrDisabled"), + { 0, 0, 0 }, + }; + etype = g_enum_register_static ("NMManagerError", values); + } + return etype; +} + +static gboolean +manager_sleeping (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + + if (priv->sleeping || !priv->net_enabled) + return TRUE; + return FALSE; +} + +static void +vpn_manager_connection_deactivated_cb (NMVPNManager *manager, + NMVPNConnection *vpn, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason, + gpointer user_data) +{ + g_object_notify (G_OBJECT (user_data), NM_MANAGER_ACTIVE_CONNECTIONS); +} + +static void +modem_added (NMModemManager *modem_manager, + NMModem *modem, + const char *driver, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMDevice *replace_device, *device = NULL; + const char *ip_iface; + GSList *iter; + + ip_iface = nm_modem_get_iface (modem); + + replace_device = find_device_by_iface (NM_MANAGER (user_data), ip_iface); + if (replace_device) { + priv->devices = remove_one_device (NM_MANAGER (user_data), + priv->devices, + replace_device, + FALSE, + TRUE); + } + + /* Give Bluetooth DUN devices first chance to claim the modem */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + if (NM_IS_DEVICE_BT (iter->data)) { + if (nm_device_bt_modem_added (NM_DEVICE_BT (iter->data), modem, driver)) + return; + } + } + + /* If it was a Bluetooth modem and no bluetooth device claimed it, ignore + * it. The rfcomm port (and thus the modem) gets created automatically + * by the Bluetooth code during the connection process. + */ + if (driver && !strcmp (driver, "bluetooth")) { + nm_log_info (LOGD_MB, "ignoring modem '%s' (no associated Bluetooth device)", ip_iface); + return; + } + + /* Otherwise make a new top-level NMDevice for it */ + if (NM_IS_MODEM_GSM (modem)) + device = nm_device_gsm_new (NM_MODEM_GSM (modem), driver); + else if (NM_IS_MODEM_CDMA (modem)) + device = nm_device_cdma_new (NM_MODEM_CDMA (modem), driver); + else + nm_log_info (LOGD_MB, "unhandled modem '%s'", ip_iface); + + if (device) + add_device (self, device); +} + +static void +nm_manager_update_state (NMManager *manager) +{ + NMManagerPrivate *priv; + NMState new_state = NM_STATE_DISCONNECTED; + + g_return_if_fail (NM_IS_MANAGER (manager)); + + priv = NM_MANAGER_GET_PRIVATE (manager); + + if (manager_sleeping (manager)) + new_state = NM_STATE_ASLEEP; + else { + GSList *iter; + + for (iter = priv->devices; iter; iter = iter->next) { + NMDevice *dev = NM_DEVICE (iter->data); + + if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) { + new_state = NM_STATE_CONNECTED; + break; + } else if (nm_device_is_activating (dev)) { + new_state = NM_STATE_CONNECTING; + } + } + } + + if (priv->state != new_state) { + priv->state = new_state; + g_object_notify (G_OBJECT (manager), NM_MANAGER_STATE); + + g_signal_emit (manager, signals[STATE_CHANGED], 0, priv->state); + + /* Emit StateChange too for backwards compatibility */ + g_signal_emit (manager, signals[STATE_CHANGE], 0, priv->state); + } +} + +static void +manager_device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + + switch (new_state) { + case NM_DEVICE_STATE_UNMANAGED: + case NM_DEVICE_STATE_UNAVAILABLE: + case NM_DEVICE_STATE_DISCONNECTED: + case NM_DEVICE_STATE_PREPARE: + case NM_DEVICE_STATE_FAILED: + g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); + break; + default: + break; + } + + nm_manager_update_state (manager); +} + +/* Removes a device from a device list; returns the start of the new device list */ +static GSList * +remove_one_device (NMManager *manager, + GSList *list, + NMDevice *device, + gboolean quitting, + gboolean force_unmanage) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + + if (nm_device_get_managed (device)) { + gboolean unmanage = !quitting; + + /* Don't unmanage active assume-connection-capable devices at shutdown */ + if ( nm_device_interface_can_assume_connection (NM_DEVICE_INTERFACE (device)) + && nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) + unmanage = FALSE; + + if (unmanage || force_unmanage) + nm_device_set_managed (device, FALSE, NM_DEVICE_STATE_REASON_REMOVED); + } + + g_signal_handlers_disconnect_by_func (device, manager_device_state_changed, manager); + + nm_sysconfig_settings_device_removed (priv->sys_settings, device); + g_signal_emit (manager, signals[DEVICE_REMOVED], 0, device); + g_object_unref (device); + + return g_slist_remove (list, device); +} + +static void +modem_removed (NMModemManager *modem_manager, + NMModem *modem, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMDevice *found; + GSList *iter; + + /* Give Bluetooth DUN devices first chance to handle the modem removal */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + if (NM_IS_DEVICE_BT (iter->data)) { + if (nm_device_bt_modem_removed (NM_DEVICE_BT (iter->data), modem)) + return; + } + } + + /* Otherwise remove the standalone modem */ + found = nm_manager_get_device_by_udi (self, nm_modem_get_path (modem)); + if (found) + priv->devices = remove_one_device (self, priv->devices, found, FALSE, TRUE); +} + +static void +aipd_handle_event (DBusGProxy *proxy, + const char *event, + const char *iface, + const char *address, + gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + GSList *iter; + gboolean handled = FALSE; + + if (!event || !iface) { + nm_log_warn (LOGD_AUTOIP4, "incomplete message received from avahi-autoipd"); + return; + } + + if ( (strcmp (event, "BIND") != 0) + && (strcmp (event, "CONFLICT") != 0) + && (strcmp (event, "UNBIND") != 0) + && (strcmp (event, "STOP") != 0)) { + nm_log_warn (LOGD_AUTOIP4, "unknown event '%s' received from avahi-autoipd", event); + return; + } + + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *candidate = NM_DEVICE (iter->data); + + if (!strcmp (nm_device_get_iface (candidate), iface)) { + nm_device_handle_autoip4_event (candidate, event, address); + handled = TRUE; + break; + } + } + + if (!handled) + nm_log_warn (LOGD_AUTOIP4, "(%s): unhandled avahi-autoipd event", iface); +} + +static const char * +hostname_provider_get_hostname (NMHostnameProvider *provider) +{ + return NM_MANAGER_GET_PRIVATE (provider)->hostname; +} + +static void +hostname_provider_init (NMHostnameProvider *provider_class) +{ + provider_class->get_hostname = hostname_provider_get_hostname; +} + +NMState +nm_manager_get_state (NMManager *manager) +{ + g_return_val_if_fail (NM_IS_MANAGER (manager), NM_STATE_UNKNOWN); + + return NM_MANAGER_GET_PRIVATE (manager)->state; +} + +static void +emit_removed (gpointer key, gpointer value, gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + NMConnection *connection = NM_CONNECTION (value); + + g_signal_emit (manager, signals[CONNECTION_REMOVED], 0, + connection, + nm_connection_get_scope (connection)); +} + +static void +pending_connection_info_destroy (PendingConnectionInfo *info) +{ + if (!info) + return; + + if (info->timeout_id) + g_source_remove (info->timeout_id); + + g_free (info->connection_path); + g_free (info->specific_object_path); + g_free (info->device_path); + + g_slice_free (PendingConnectionInfo, info); +} + +static GPtrArray * +get_active_connections (NMManager *manager, NMConnection *filter) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + NMVPNManager *vpn_manager; + GPtrArray *active; + GSList *iter; + + active = g_ptr_array_sized_new (3); + + /* Add active device connections */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMActRequest *req; + const char *path; + + req = nm_device_get_act_request (NM_DEVICE (iter->data)); + if (!req) + continue; + + if (!filter || (nm_act_request_get_connection (req) == filter)) { + path = nm_act_request_get_active_connection_path (req); + g_ptr_array_add (active, g_strdup (path)); + } + } + + /* Add active VPN connections */ + vpn_manager = nm_vpn_manager_get (); + nm_vpn_manager_add_active_connections (vpn_manager, filter, active); + g_object_unref (vpn_manager); + + return active; +} + +static void +remove_connection (NMManager *manager, + NMConnection *connection, + GHashTable *hash) +{ + /* Destroys the connection, then associated DBusGProxy due to the + * weak reference notify function placed on the connection when it + * was created. + */ + g_object_ref (connection); + g_hash_table_remove (hash, nm_connection_get_path (connection)); + g_signal_emit (manager, signals[CONNECTION_REMOVED], 0, + connection, + nm_connection_get_scope (connection)); + g_object_unref (connection); + + bluez_manager_resync_devices (manager); +} + +/*******************************************************************/ +/* User settings stuff via D-Bus */ +/*******************************************************************/ + +static void +user_destroy_connections (NMManager *manager) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + + if (priv->user_connections) { + g_hash_table_foreach (priv->user_connections, emit_removed, manager); + g_hash_table_remove_all (priv->user_connections); + } + + if (priv->user_proxy) { + g_object_unref (priv->user_proxy); + priv->user_proxy = NULL; + } +} + +typedef struct GetSettingsInfo { + NMManager *manager; + NMConnection *connection; + DBusGProxy *proxy; + DBusGProxyCall *call; + GSList **calls; +} GetSettingsInfo; + +static void +free_get_settings_info (gpointer data) +{ + GetSettingsInfo *info = (GetSettingsInfo *) data; + + /* If this was the last pending call for a batch of GetSettings calls, + * send out the connections-added signal. + */ + if (info->calls) { + *(info->calls) = g_slist_remove (*(info->calls), info->call); + if (g_slist_length (*(info->calls)) == 0) { + g_slist_free (*(info->calls)); + g_slice_free (GSList, (gpointer) info->calls); + g_signal_emit (info->manager, signals[CONNECTIONS_ADDED], 0, NM_CONNECTION_SCOPE_USER); + + /* Update the Bluetooth connections for all the new connections */ + bluez_manager_resync_devices (info->manager); + } + } + + if (info->manager) { + g_object_unref (info->manager); + info->manager = NULL; + } + if (info->connection) { + g_object_unref (info->connection); + info->connection = NULL; + } + if (info->proxy) { + g_object_unref (info->proxy); + info->proxy = NULL; + } + + g_slice_free (GetSettingsInfo, data); +} + +static void +user_connection_get_settings_cb (DBusGProxy *proxy, + DBusGProxyCall *call_id, + gpointer user_data) +{ + GetSettingsInfo *info = (GetSettingsInfo *) user_data; + GError *err = NULL; + GHashTable *settings = NULL; + NMConnection *connection; + NMManager *manager; + + g_return_if_fail (info != NULL); + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, + DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &settings, + G_TYPE_INVALID)) { + nm_log_info (LOGD_USER_SET, "couldn't retrieve connection settings: %s.", + err && err->message ? err->message : "(unknown)"); + g_error_free (err); + goto out; + } + + manager = info->manager; + connection = info->connection; + if (connection == NULL) { + const char *path = dbus_g_proxy_get_path (proxy); + NMManagerPrivate *priv; + GError *error = NULL; + NMConnection *existing = NULL; + + connection = nm_connection_new_from_hash (settings, &error); + if (connection == NULL) { + nm_log_warn (LOGD_USER_SET, "invalid connection: '%s' / '%s' invalid: %d", + g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), + error->message, error->code); + g_error_free (error); + goto out; + } + + nm_connection_set_path (connection, path); + nm_connection_set_scope (connection, NM_CONNECTION_SCOPE_USER); + + /* Add the new connection to the internal hashes only if the same + * connection isn't already there. + */ + priv = NM_MANAGER_GET_PRIVATE (manager); + + existing = g_hash_table_lookup (priv->user_connections, path); + if (!existing || !nm_connection_compare (existing, connection, NM_SETTING_COMPARE_FLAG_EXACT)) { + g_hash_table_insert (priv->user_connections, + g_strdup (path), + connection); + existing = NULL; + + /* Attach the D-Bus proxy representing the remote NMConnection + * to the local NMConnection object to ensure it stays alive to + * continue delivering signals. It'll be destroyed once the + * NMConnection is destroyed. + */ + g_object_set_data_full (G_OBJECT (connection), + "proxy", + g_object_ref (info->proxy), + g_object_unref); + } else + g_object_unref (connection); + + /* If the connection-added signal is supposed to be batched, don't + * emit the single connection-added here. Also, don't emit the signal + * if the connection wasn't actually added to the system or user hashes. + */ + if (!info->calls && !existing) { + g_signal_emit (manager, signals[CONNECTION_ADDED], 0, connection, NM_CONNECTION_SCOPE_USER); + /* Update the Bluetooth connections for that single new connection */ + bluez_manager_resync_devices (manager); + } + } else { + // FIXME: merge settings? or just replace? + nm_log_dbg (LOGD_USER_SET, "implement merge settings"); + } + +out: + if (settings) + g_hash_table_destroy (settings); + + return; +} + +static void +user_connection_removed_cb (DBusGProxy *proxy, gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + NMConnection *connection = NULL; + const char *path; + + path = dbus_g_proxy_get_path (proxy); + if (path) { + connection = g_hash_table_lookup (priv->user_connections, path); + if (connection) + remove_connection (manager, connection, priv->user_connections); + } +} + +static void +user_connection_updated_cb (DBusGProxy *proxy, + GHashTable *settings, + gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + NMConnection *new_connection; + NMConnection *old_connection = NULL; + gboolean valid = FALSE; + GError *error = NULL; + const char *path; + + path = dbus_g_proxy_get_path (proxy); + if (path) + old_connection = g_hash_table_lookup (priv->user_connections, path); + + g_return_if_fail (old_connection != NULL); + + new_connection = nm_connection_new_from_hash (settings, &error); + if (!new_connection) { + /* New connection invalid, remove existing connection */ + nm_log_warn (LOGD_USER_SET, "invalid connection: '%s' / '%s' invalid: %d", + g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), + error->message, error->code); + g_error_free (error); + remove_connection (manager, old_connection, priv->user_connections); + return; + } + g_object_unref (new_connection); + + valid = nm_connection_replace_settings (old_connection, settings, NULL); + if (valid) { + g_signal_emit (manager, signals[CONNECTION_UPDATED], 0, + old_connection, + nm_connection_get_scope (old_connection)); + + bluez_manager_resync_devices (manager); + } else { + remove_connection (manager, old_connection, priv->user_connections); + } +} + +static void +user_internal_new_connection_cb (DBusGProxy *proxy, + const char *path, + NMManager *manager, + GSList **calls) +{ + struct GetSettingsInfo *info; + DBusGProxy *con_proxy; + DBusGConnection *g_connection; + DBusGProxyCall *call; + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + + g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + con_proxy = dbus_g_proxy_new_for_name (g_connection, + dbus_g_proxy_get_bus_name (proxy), + path, + NM_DBUS_IFACE_SETTINGS_CONNECTION); + if (!con_proxy) { + nm_log_err (LOGD_USER_SET, "could not init user connection proxy"); + return; + } + + dbus_g_proxy_add_signal (con_proxy, "Updated", + DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (con_proxy, "Updated", + G_CALLBACK (user_connection_updated_cb), + manager, + NULL); + + dbus_g_proxy_add_signal (con_proxy, "Removed", G_TYPE_INVALID, G_TYPE_INVALID); + dbus_g_proxy_connect_signal (con_proxy, "Removed", + G_CALLBACK (user_connection_removed_cb), + manager, + NULL); + + info = g_slice_new0 (GetSettingsInfo); + info->manager = g_object_ref (manager); + info->calls = calls; + call = dbus_g_proxy_begin_call (con_proxy, "GetSettings", + user_connection_get_settings_cb, + info, + free_get_settings_info, + G_TYPE_INVALID); + info->call = call; + info->proxy = con_proxy; + if (info->calls) + *(info->calls) = g_slist_prepend (*(info->calls), call); +} + +static void +user_list_connections_cb (DBusGProxy *proxy, + DBusGProxyCall *call_id, + gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + GError *err = NULL; + GPtrArray *ops; + GSList **calls = NULL; + int i; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &ops, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_USER_SET, "couldn't retrieve connections: %s", + err && err->message ? err->message : "(unknown)"); + g_error_free (err); + goto out; + } + + /* Keep track of all calls made here; don't want to emit connection-added for + * each one, but emit connections-added when they are all done. + */ + calls = g_slice_new0 (GSList *); + + for (i = 0; i < ops->len; i++) { + char *op = g_ptr_array_index (ops, i); + + user_internal_new_connection_cb (proxy, op, manager, calls); + g_free (op); + } + + g_ptr_array_free (ops, TRUE); + +out: + return; +} + +static void +user_new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data) +{ + user_internal_new_connection_cb (proxy, path, NM_MANAGER (user_data), NULL); +} + +static void +user_query_connections (NMManager *manager) +{ + NMManagerPrivate *priv; + DBusGProxyCall *call; + DBusGConnection *g_connection; + + g_return_if_fail (NM_IS_MANAGER (manager)); + + priv = NM_MANAGER_GET_PRIVATE (manager); + if (!priv->user_proxy) { + g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + priv->user_proxy = dbus_g_proxy_new_for_name (g_connection, + NM_DBUS_SERVICE_USER_SETTINGS, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS); + if (!priv->user_proxy) { + nm_log_err (LOGD_USER_SET, "could not init user settings proxy"); + return; + } + + dbus_g_proxy_add_signal (priv->user_proxy, + "NewConnection", + DBUS_TYPE_G_OBJECT_PATH, + G_TYPE_INVALID); + + dbus_g_proxy_connect_signal (priv->user_proxy, "NewConnection", + G_CALLBACK (user_new_connection_cb), + manager, + NULL); + } + + /* grab connections */ + call = dbus_g_proxy_begin_call (priv->user_proxy, "ListConnections", + user_list_connections_cb, + manager, + NULL, + G_TYPE_INVALID); +} + +/*******************************************************************/ +/* System settings stuff via NMSysconfigSettings */ +/*******************************************************************/ + +static void +system_connection_updated_cb (NMSettingsConnectionInterface *connection, + gpointer unused, + NMManager *manager) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + const char *path; + NMSettingsConnectionInterface *existing; + GError *error = NULL; + + path = nm_connection_get_path (NM_CONNECTION (connection)); + + existing = g_hash_table_lookup (priv->system_connections, path); + if (!existing) + return; + if (existing != connection) { + nm_log_warn (LOGD_SYS_SET, "existing connection didn't matched updated."); + return; + } + + if (!nm_connection_verify (NM_CONNECTION (existing), &error)) { + /* Updated connection invalid, remove existing connection */ + nm_log_warn (LOGD_SYS_SET, "invalid connection: '%s' / '%s' invalid: %d", + g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)), + error->message, error->code); + g_error_free (error); + remove_connection (manager, NM_CONNECTION (existing), priv->system_connections); + return; + } + + g_signal_emit (manager, signals[CONNECTION_UPDATED], 0, + existing, NM_CONNECTION_SCOPE_SYSTEM); + + bluez_manager_resync_devices (manager); +} + +static void +system_connection_removed_cb (NMSettingsConnectionInterface *connection, + NMManager *manager) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + const char *path; + + path = nm_connection_get_path (NM_CONNECTION (connection)); + + connection = g_hash_table_lookup (priv->system_connections, path); + if (connection) + remove_connection (manager, NM_CONNECTION (connection), priv->system_connections); +} + +static void +system_internal_new_connection (NMManager *manager, + NMSettingsConnectionInterface *connection) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + const char *path; + + g_return_if_fail (connection != NULL); + + g_signal_connect (connection, NM_SETTINGS_CONNECTION_INTERFACE_UPDATED, + G_CALLBACK (system_connection_updated_cb), manager); + g_signal_connect (connection, NM_SETTINGS_CONNECTION_INTERFACE_REMOVED, + G_CALLBACK (system_connection_removed_cb), manager); + + path = nm_connection_get_path (NM_CONNECTION (connection)); + g_hash_table_insert (priv->system_connections, g_strdup (path), + g_object_ref (connection)); +} + +static void +system_new_connection_cb (NMSysconfigSettings *settings, + NMSettingsConnectionInterface *connection, + NMManager *manager) +{ + system_internal_new_connection (manager, connection); +} + +static void +system_query_connections (NMManager *manager) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + GSList *system_connections, *iter; + + system_connections = nm_settings_interface_list_connections (NM_SETTINGS_INTERFACE (priv->sys_settings)); + for (iter = system_connections; iter; iter = g_slist_next (iter)) + system_internal_new_connection (manager, NM_SETTINGS_CONNECTION_INTERFACE (iter->data)); + g_slist_free (system_connections); +} + +static void +system_unmanaged_devices_changed_cb (NMSysconfigSettings *sys_settings, + GParamSpec *pspec, + gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + const GSList *unmanaged_specs, *iter; + + unmanaged_specs = nm_sysconfig_settings_get_unmanaged_specs (sys_settings); + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *device = NM_DEVICE (iter->data); + gboolean managed; + + managed = !nm_device_interface_spec_match_list (NM_DEVICE_INTERFACE (device), unmanaged_specs); + nm_device_set_managed (device, + managed, + managed ? NM_DEVICE_STATE_REASON_NOW_MANAGED : + NM_DEVICE_STATE_REASON_NOW_UNMANAGED); + } +} + +static void +system_hostname_changed_cb (NMSysconfigSettings *sys_settings, + GParamSpec *pspec, + gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + char *hostname; + + hostname = nm_sysconfig_settings_get_hostname (sys_settings); + + if (!hostname && !priv->hostname) + return; + + if (hostname && priv->hostname && !strcmp (hostname, priv->hostname)) + return; + + g_free (priv->hostname); + priv->hostname = (hostname && strlen (hostname)) ? g_strdup (hostname) : NULL; + g_object_notify (G_OBJECT (manager), NM_MANAGER_HOSTNAME); + + g_free (hostname); +} + +/*******************************************************************/ +/* General NMManager stuff */ +/*******************************************************************/ + +static NMDevice * +nm_manager_get_device_by_udi (NMManager *manager, const char *udi) +{ + GSList *iter; + + for (iter = NM_MANAGER_GET_PRIVATE (manager)->devices; iter; iter = iter->next) { + if (!strcmp (nm_device_get_udi (NM_DEVICE (iter->data)), udi)) + return NM_DEVICE (iter->data); + } + return NULL; +} + +static NMDevice * +nm_manager_get_device_by_path (NMManager *manager, const char *path) +{ + GSList *iter; + + for (iter = NM_MANAGER_GET_PRIVATE (manager)->devices; iter; iter = iter->next) { + if (!strcmp (nm_device_get_path (NM_DEVICE (iter->data)), path)) + return NM_DEVICE (iter->data); + } + return NULL; +} + +static void +nm_manager_name_owner_changed (NMDBusManager *mgr, + const char *name, + const char *old, + const char *new, + gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + gboolean old_owner_good = (old && (strlen (old) > 0)); + gboolean new_owner_good = (new && (strlen (new) > 0)); + + if (strcmp (name, NM_DBUS_SERVICE_USER_SETTINGS) == 0) { + if (!old_owner_good && new_owner_good) { + /* User Settings service appeared, update stuff */ + user_query_connections (manager); + } else { + /* User Settings service disappeared, throw them away (?) */ + user_destroy_connections (manager); + bluez_manager_resync_devices (manager); + } + } +} + +/* Store value into key-file; supported types: boolean, int, string */ +static gboolean +write_value_to_state_file (const char *filename, + const char *group, + const char *key, + GType value_type, + gpointer value, + GError **error) +{ + GKeyFile *key_file; + char *data; + gsize len = 0; + gboolean ret = FALSE; + + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (group != NULL, FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (value_type == G_TYPE_BOOLEAN || + value_type == G_TYPE_INT || + value_type == G_TYPE_STRING, + FALSE); + + key_file = g_key_file_new (); + if (!key_file) + return FALSE; + + g_key_file_set_list_separator (key_file, ','); + g_key_file_load_from_file (key_file, filename, G_KEY_FILE_KEEP_COMMENTS, NULL); + switch (value_type) { + case G_TYPE_BOOLEAN: + g_key_file_set_boolean (key_file, group, key, *((gboolean *) value)); + break; + case G_TYPE_INT: + g_key_file_set_integer (key_file, group, key, *((gint *) value)); + break; + case G_TYPE_STRING: + g_key_file_set_string (key_file, group, key, *((const gchar **) value)); + break; + } + + data = g_key_file_to_data (key_file, &len, NULL); + if (data) { + ret = g_file_set_contents (filename, data, len, error); + g_free (data); + } + g_key_file_free (key_file); + + return ret; +} + +static void +manager_set_radio_enabled (NMManager *manager, + RadioState *rstate, + gboolean enabled) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + GSList *iter; + GError *error = NULL; + + /* Do nothing for radio types not yet implemented */ + if (!rstate->prop) + return; + + if (rstate->enabled == enabled) + return; + + /* Can't set wireless enabled if it's disabled in hardware */ + if (!rstate->hw_enabled && enabled) + return; + + rstate->enabled = enabled; + + g_object_notify (G_OBJECT (manager), rstate->prop); + + /* Update enabled key in state file */ + if (priv->state_file) { + if (!write_value_to_state_file (priv->state_file, + "main", rstate->key, + G_TYPE_BOOLEAN, (gpointer) &enabled, + &error)) { + nm_log_warn (LOGD_CORE, "writing to state file %s failed: (%d) %s.", + priv->state_file, + error ? error->code : -1, + (error && error->message) ? error->message : "unknown"); + } + } + + /* Don't touch devices if asleep/networking disabled */ + if (manager_sleeping (manager)) + return; + + /* enable/disable wireless devices as required */ + for (iter = priv->devices; iter; iter = iter->next) { + RfKillType devtype = RFKILL_TYPE_UNKNOWN; + + g_object_get (G_OBJECT (iter->data), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); + if (devtype == rstate->rtype) { + nm_log_dbg (LOGD_RFKILL, "(%s): setting radio %s", + nm_device_get_iface (NM_DEVICE (iter->data)), + enabled ? "enabled" : "disabled"); + nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (iter->data), enabled); + } + } +} + +static void +manager_hidden_ap_found (NMDeviceInterface *device, + NMAccessPoint *ap, + gpointer user_data) +{ + NMManager *manager = NM_MANAGER (user_data); + const struct ether_addr *ap_addr; + const GByteArray *ap_ssid; + GSList *iter; + GSList *connections; + gboolean done = FALSE; + + ap_ssid = nm_ap_get_ssid (ap); + if (ap_ssid && ap_ssid->len) + return; + + ap_addr = nm_ap_get_address (ap); + g_assert (ap_addr); + + /* Look for this AP's BSSID in the seen-bssids list of a connection, + * and if a match is found, copy over the SSID */ + connections = nm_manager_get_connections (manager, NM_CONNECTION_SCOPE_SYSTEM); + connections = g_slist_concat (connections, nm_manager_get_connections (manager, NM_CONNECTION_SCOPE_USER)); + + for (iter = connections; iter && !done; iter = g_slist_next (iter)) { + NMConnection *connection = NM_CONNECTION (iter->data); + NMSettingWireless *s_wireless; + const GByteArray *ssid; + guint32 num_bssids; + guint32 i; + + s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + if (!s_wireless) + goto next; + + num_bssids = nm_setting_wireless_get_num_seen_bssids (s_wireless); + if (num_bssids < 1) + goto next; + + ssid = nm_setting_wireless_get_ssid (s_wireless); + g_assert (ssid); + + for (i = 0; i < num_bssids; i++) { + const char *seen_bssid = nm_setting_wireless_get_seen_bssid (s_wireless, i); + struct ether_addr seen_addr; + + if (!ether_aton_r (seen_bssid, &seen_addr)) + continue; + + if (memcmp (ap_addr, &seen_addr, sizeof (struct ether_addr))) + continue; + + /* Copy the SSID from the connection to the AP */ + nm_ap_set_ssid (ap, ssid); + done = TRUE; + } + +next: + g_object_unref (connection); + } + g_slist_free (connections); +} + +static RfKillState +nm_manager_get_ipw_rfkill_state (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GSList *iter; + RfKillState ipw_state = RFKILL_UNBLOCKED; + + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *candidate = NM_DEVICE (iter->data); + RfKillState candidate_state; + + if (NM_IS_DEVICE_WIFI (candidate)) { + candidate_state = nm_device_wifi_get_ipw_rfkill_state (NM_DEVICE_WIFI (candidate)); + + if (candidate_state > ipw_state) + ipw_state = candidate_state; + } + } + + return ipw_state; +} + +static RfKillState +nm_manager_get_modem_enabled_state (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GSList *iter; + RfKillState wwan_state = RFKILL_UNBLOCKED; + + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *candidate = NM_DEVICE (iter->data); + RfKillState candidate_state = RFKILL_UNBLOCKED; + RfKillType devtype = RFKILL_TYPE_UNKNOWN; + + g_object_get (G_OBJECT (candidate), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); + if (devtype == RFKILL_TYPE_WWAN) { + if (!nm_device_interface_get_enabled (NM_DEVICE_INTERFACE (candidate))) + candidate_state = RFKILL_SOFT_BLOCKED; + + if (candidate_state > wwan_state) + wwan_state = candidate_state; + } + } + + return wwan_state; +} + +static void +manager_rfkill_update_one_type (NMManager *self, + RadioState *rstate, + RfKillType rtype) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + RfKillState udev_state = RFKILL_UNBLOCKED; + RfKillState other_state = RFKILL_UNBLOCKED; + RfKillState composite; + gboolean new_e = TRUE, new_he = TRUE; + + udev_state = nm_udev_manager_get_rfkill_state (priv->udev_mgr, rtype); + + if (rstate->other_enabled_func) + other_state = rstate->other_enabled_func (self); + + /* The composite state is the "worst" of either udev or other states */ + if (udev_state == RFKILL_HARD_BLOCKED || other_state == RFKILL_HARD_BLOCKED) + composite = RFKILL_HARD_BLOCKED; + else if (udev_state == RFKILL_SOFT_BLOCKED || other_state == RFKILL_SOFT_BLOCKED) + composite = RFKILL_SOFT_BLOCKED; + else + composite = RFKILL_UNBLOCKED; + + switch (composite) { + case RFKILL_UNBLOCKED: + new_e = TRUE; + new_he = TRUE; + break; + case RFKILL_SOFT_BLOCKED: + new_e = FALSE; + new_he = TRUE; + break; + case RFKILL_HARD_BLOCKED: + new_e = FALSE; + new_he = FALSE; + break; + default: + break; + } + + if (rstate->desc) { + nm_log_dbg (LOGD_RFKILL, "%s hw-enabled %d enabled %d", + rstate->desc, new_he, new_e); + } + + if (new_he != rstate->hw_enabled) { + nm_log_info (LOGD_RFKILL, "%s now %s by radio killswitch", + rstate->desc, + (new_e && new_he) ? "enabled" : "disabled"); + + rstate->hw_enabled = new_he; + if (rstate->hw_prop) + g_object_notify (G_OBJECT (self), rstate->hw_prop); + } + manager_set_radio_enabled (self, rstate, new_e); +} + +static void +nm_manager_rfkill_update (NMManager *self, RfKillType rtype) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + guint i; + + if (rtype != RFKILL_TYPE_UNKNOWN) { + manager_rfkill_update_one_type (self, &priv->radio_states[rtype], rtype); + return; + } + + /* Otherwise sync all radio types */ + for (i = 0; i < RFKILL_TYPE_MAX; i++) + manager_rfkill_update_one_type (self, &priv->radio_states[i], i); +} + +static void +manager_ipw_rfkill_state_changed (NMDeviceWifi *device, + GParamSpec *pspec, + gpointer user_data) +{ + nm_manager_rfkill_update (NM_MANAGER (user_data), RFKILL_TYPE_WLAN); +} + +static void +manager_modem_enabled_changed (NMModem *device, gpointer user_data) +{ + nm_manager_rfkill_update (NM_MANAGER (user_data), RFKILL_TYPE_WWAN); +} + +static void +add_device (NMManager *self, NMDevice *device) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + const char *iface, *driver, *type_desc; + char *path; + static guint32 devcount = 0; + const GSList *unmanaged_specs; + NMConnection *existing = NULL; + GHashTableIter iter; + gpointer value; + gboolean managed = FALSE; + + iface = nm_device_get_ip_iface (device); + g_assert (iface); + + if (!NM_IS_DEVICE_MODEM (device) && find_device_by_iface (self, iface)) { + g_object_unref (device); + return; + } + + priv->devices = g_slist_append (priv->devices, device); + + g_signal_connect (device, "state-changed", + G_CALLBACK (manager_device_state_changed), + self); + + if (NM_IS_DEVICE_WIFI (device)) { + /* Attach to the access-point-added signal so that the manager can fill + * non-SSID-broadcasting APs with an SSID. + */ + g_signal_connect (device, "hidden-ap-found", + G_CALLBACK (manager_hidden_ap_found), + self); + + /* Hook up rfkill handling for ipw-based cards until they get converted + * to use the kernel's rfkill subsystem in 2.6.33. + */ + g_signal_connect (device, "notify::" NM_DEVICE_WIFI_IPW_RFKILL_STATE, + G_CALLBACK (manager_ipw_rfkill_state_changed), + self); + + /* Update global rfkill state with this device's rfkill state, and + * then set this device's rfkill state based on the global state. + */ + nm_manager_rfkill_update (self, RFKILL_TYPE_WLAN); + nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), + priv->radio_states[RFKILL_TYPE_WLAN].enabled); + } else if (NM_IS_DEVICE_MODEM (device)) { + g_signal_connect (device, NM_DEVICE_MODEM_ENABLE_CHANGED, + G_CALLBACK (manager_modem_enabled_changed), + self); + + nm_manager_rfkill_update (self, RFKILL_TYPE_WWAN); + /* Until we start respecting WWAN rfkill switches the modem itself + * is the source of the enabled/disabled state, so the manager shouldn't + * touch it here. + nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), + priv->radio_states[RFKILL_TYPE_WWAN].enabled); + */ + } + + type_desc = nm_device_get_type_desc (device); + g_assert (type_desc); + driver = nm_device_get_driver (device); + if (!driver) + driver = "unknown"; + nm_log_info (LOGD_HW, "(%s): new %s device (driver: '%s' ifindex: %d)", + iface, type_desc, driver, nm_device_get_ifindex (device)); + + path = g_strdup_printf ("/org/freedesktop/NetworkManager/Devices/%d", devcount++); + nm_device_set_path (device, path); + dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (priv->dbus_mgr), + path, + G_OBJECT (device)); + nm_log_info (LOGD_CORE, "(%s): exported as %s", iface, path); + g_free (path); + + /* Check if we should assume the device's active connection by matching its + * config with an existing system connection. + */ + if (nm_device_interface_can_assume_connection (NM_DEVICE_INTERFACE (device))) { + GSList *connections = NULL; + + g_hash_table_iter_init (&iter, priv->system_connections); + while (g_hash_table_iter_next (&iter, NULL, &value)) + connections = g_slist_append (connections, value); + existing = nm_device_interface_connection_match_config (NM_DEVICE_INTERFACE (device), + (const GSList *) connections); + g_slist_free (connections); + + if (existing) { + NMSettingConnection *s_con; + + s_con = (NMSettingConnection *) nm_connection_get_setting (existing, NM_TYPE_SETTING_CONNECTION); + nm_log_dbg (LOGD_DEVICE, "(%s): found existing device connection '%s'", + nm_device_get_iface (device), + nm_setting_connection_get_id (s_con)); + } + } + + /* Start the device if it's supposed to be managed */ + unmanaged_specs = nm_sysconfig_settings_get_unmanaged_specs (priv->sys_settings); + if ( !manager_sleeping (self) + && !nm_device_interface_spec_match_list (NM_DEVICE_INTERFACE (device), unmanaged_specs)) { + nm_device_set_managed (device, + TRUE, + existing ? NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED : + NM_DEVICE_STATE_REASON_NOW_MANAGED); + managed = TRUE; + } + + nm_sysconfig_settings_device_added (priv->sys_settings, device); + g_signal_emit (self, signals[DEVICE_ADDED], 0, device); + + /* If the device has a connection it can assume, do that now */ + if (existing && managed && nm_device_is_available (device)) { + const char *ac_path; + GError *error = NULL; + + nm_log_dbg (LOGD_DEVICE, "(%s): will attempt to assume existing connection", + nm_device_get_iface (device)); + + ac_path = internal_activate_device (self, device, existing, NULL, FALSE, TRUE, &error); + if (ac_path) + g_object_notify (G_OBJECT (self), NM_MANAGER_ACTIVE_CONNECTIONS); + else { + nm_log_warn (LOGD_DEVICE, "assumed connection (%d) %s failed to activate: (%d) %s", + nm_connection_get_scope (existing), + nm_connection_get_path (existing), + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + g_error_free (error); + } + } +} + +static gboolean +bdaddr_matches_connection (NMSettingBluetooth *s_bt, const char *bdaddr) +{ + const GByteArray *arr; + gboolean ret = FALSE; + + arr = nm_setting_bluetooth_get_bdaddr (s_bt); + + if ( arr != NULL + && arr->len == ETH_ALEN) { + char *str; + + str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + arr->data[0], + arr->data[1], + arr->data[2], + arr->data[3], + arr->data[4], + arr->data[5]); + ret = g_str_equal (str, bdaddr); + g_free (str); + } + + return ret; +} + +static NMConnection * +bluez_manager_find_connection (NMManager *manager, + const char *bdaddr, + guint32 capabilities) +{ + NMConnection *found = NULL; + GSList *connections, *l; + + connections = nm_manager_get_connections (manager, NM_CONNECTION_SCOPE_SYSTEM); + connections = g_slist_concat (connections, nm_manager_get_connections (manager, NM_CONNECTION_SCOPE_USER)); + + for (l = connections; l != NULL; l = l->next) { + NMConnection *candidate = NM_CONNECTION (l->data); + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + const char *con_type; + const char *bt_type; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (candidate, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + con_type = nm_setting_connection_get_connection_type (s_con); + g_assert (con_type); + if (!g_str_equal (con_type, NM_SETTING_BLUETOOTH_SETTING_NAME)) + continue; + + s_bt = (NMSettingBluetooth *) nm_connection_get_setting (candidate, NM_TYPE_SETTING_BLUETOOTH); + if (!s_bt) + continue; + + if (!bdaddr_matches_connection (s_bt, bdaddr)) + continue; + + bt_type = nm_setting_bluetooth_get_connection_type (s_bt); + if ( g_str_equal (bt_type, NM_SETTING_BLUETOOTH_TYPE_DUN) + && !(capabilities & NM_BT_CAPABILITY_DUN)) + continue; + if ( g_str_equal (bt_type, NM_SETTING_BLUETOOTH_TYPE_PANU) + && !(capabilities & NM_BT_CAPABILITY_NAP)) + continue; + + found = candidate; + break; + } + + g_slist_free (connections); + return found; +} + +static void +bluez_manager_resync_devices (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GSList *iter, *gone = NULL, *keep = NULL; + + /* Remove devices from the device list that don't have a corresponding connection */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *candidate = NM_DEVICE (iter->data); + guint32 uuids; + const char *bdaddr; + + if (NM_IS_DEVICE_BT (candidate)) { + uuids = nm_device_bt_get_capabilities (NM_DEVICE_BT (candidate)); + bdaddr = nm_device_bt_get_hw_address (NM_DEVICE_BT (candidate)); + + if (bluez_manager_find_connection (self, bdaddr, uuids)) + keep = g_slist_prepend (keep, candidate); + else + gone = g_slist_prepend (gone, candidate); + } else + keep = g_slist_prepend (keep, candidate); + } + + /* Only touch the device list if anything actually changed */ + if (g_slist_length (gone)) { + g_slist_free (priv->devices); + priv->devices = keep; + + while (g_slist_length (gone)) + gone = remove_one_device (self, gone, NM_DEVICE (gone->data), FALSE, TRUE); + } else { + g_slist_free (keep); + g_slist_free (gone); + } + + /* Now look for devices without connections */ + nm_bluez_manager_query_devices (priv->bluez_mgr); +} + +static void +bluez_manager_bdaddr_added_cb (NMBluezManager *bluez_mgr, + const char *bdaddr, + const char *name, + const char *object_path, + guint32 capabilities, + NMManager *manager) +{ + NMDevice *device; + gboolean has_dun = (capabilities & NM_BT_CAPABILITY_DUN); + gboolean has_nap = (capabilities & NM_BT_CAPABILITY_NAP); + + g_return_if_fail (bdaddr != NULL); + g_return_if_fail (name != NULL); + g_return_if_fail (object_path != NULL); + g_return_if_fail (capabilities != NM_BT_CAPABILITY_NONE); + + /* Make sure the device is not already in the device list */ + if (nm_manager_get_device_by_udi (manager, object_path)) + return; + + if (has_dun == FALSE && has_nap == FALSE) + return; + + if (!bluez_manager_find_connection (manager, bdaddr, capabilities)) + return; + + device = nm_device_bt_new (object_path, bdaddr, name, capabilities, FALSE); + if (device) { + nm_log_info (LOGD_HW, "BT device %s (%s) added (%s%s%s)", + name, + bdaddr, + has_dun ? "DUN" : "", + has_dun && has_nap ? " " : "", + has_nap ? "NAP" : ""); + + add_device (manager, device); + } +} + +static void +bluez_manager_bdaddr_removed_cb (NMBluezManager *bluez_mgr, + const char *bdaddr, + const char *object_path, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GSList *iter; + + g_return_if_fail (bdaddr != NULL); + g_return_if_fail (object_path != NULL); + + nm_log_info (LOGD_HW, "BT device %s removed", bdaddr); + + for (iter = priv->devices; iter; iter = iter->next) { + NMDevice *device = NM_DEVICE (iter->data); + + if (!strcmp (nm_device_get_udi (device), object_path)) { + priv->devices = remove_one_device (self, priv->devices, device, FALSE, TRUE); + break; + } + } +} + +static NMDevice * +find_device_by_iface (NMManager *self, const gchar *iface) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GSList *iter; + + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *device = NM_DEVICE (iter->data); + const gchar *d_iface = nm_device_get_ip_iface (device); + if (!strcmp (d_iface, iface)) + return device; + } + + return NULL; +} + +static NMDevice * +find_device_by_ifindex (NMManager *self, guint32 ifindex) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GSList *iter; + + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *candidate = NM_DEVICE (iter->data); + + if (ifindex == nm_device_get_ifindex (candidate)) + return candidate; + } + return NULL; +} + +static void +udev_device_added_cb (NMUdevManager *udev_mgr, + GUdevDevice *udev_device, + NMDeviceCreatorFn creator_fn, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + GObject *device; + guint32 ifindex; + + ifindex = g_udev_device_get_property_as_int (udev_device, "IFINDEX"); + if (find_device_by_ifindex (self, ifindex)) + return; + + device = creator_fn (udev_mgr, udev_device, manager_sleeping (self)); + if (device) + add_device (self, NM_DEVICE (device)); +} + +static void +udev_device_removed_cb (NMUdevManager *manager, + GUdevDevice *udev_device, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + NMDevice *device; + guint32 ifindex; + + ifindex = g_udev_device_get_property_as_int (udev_device, "IFINDEX"); + device = find_device_by_ifindex (self, ifindex); + if (device) + priv->devices = remove_one_device (self, priv->devices, device, FALSE, TRUE); +} + +static void +udev_manager_rfkill_changed_cb (NMUdevManager *udev_mgr, + RfKillType rtype, + RfKillState udev_state, + gpointer user_data) +{ + nm_manager_rfkill_update (NM_MANAGER (user_data), rtype); +} + +GSList * +nm_manager_get_devices (NMManager *manager) +{ + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + + return NM_MANAGER_GET_PRIVATE (manager)->devices; +} + +static gboolean +impl_manager_get_devices (NMManager *manager, GPtrArray **devices, GError **err) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + GSList *iter; + + *devices = g_ptr_array_sized_new (g_slist_length (priv->devices)); + + for (iter = priv->devices; iter; iter = iter->next) + g_ptr_array_add (*devices, g_strdup (nm_device_get_path (NM_DEVICE (iter->data)))); + + return TRUE; +} + +static NMActRequest * +nm_manager_get_act_request_by_path (NMManager *manager, + const char *path, + NMDevice **device) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + GSList *iter; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (path != NULL, NULL); + g_return_val_if_fail (device != NULL, NULL); + g_return_val_if_fail (*device == NULL, NULL); + + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMActRequest *req; + const char *ac_path; + + req = nm_device_get_act_request (NM_DEVICE (iter->data)); + if (!req) + continue; + + ac_path = nm_act_request_get_active_connection_path (req); + if (!strcmp (path, ac_path)) { + *device = NM_DEVICE (iter->data); + return req; + } + } + + return NULL; +} + +typedef struct GetSecretsInfo { + NMManager *manager; + NMSecretsProviderInterface *provider; + + char *setting_name; + RequestSecretsCaller caller; + gboolean request_new; + + /* User connection bits */ + DBusGProxy *proxy; + DBusGProxyCall *call; + + /* System connection bits */ + guint32 idle_id; + char *hint1; + char *hint2; + char *connection_path; +} GetSecretsInfo; + +static void +free_get_secrets_info (gpointer data) +{ + GetSecretsInfo *info = data; + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (info->manager); + + g_object_weak_unref (G_OBJECT (info->provider), (GWeakNotify) free_get_secrets_info, info); + + priv->secrets_calls = g_slist_remove (priv->secrets_calls, info); + + if (info->proxy) { + if (info->call) + dbus_g_proxy_cancel_call (info->proxy, info->call); + g_object_unref (info->proxy); + } + + if (info->idle_id) + g_source_remove (info->idle_id); + + g_free (info->hint1); + g_free (info->hint2); + g_free (info->setting_name); + g_free (info->connection_path); + memset (info, 0, sizeof (GetSecretsInfo)); + g_free (info); +} + +static void +provider_cancel_secrets (NMSecretsProviderInterface *provider, gpointer user_data) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (user_data); + GSList *iter; + + for (iter = priv->secrets_calls; iter; iter = g_slist_next (iter)) { + GetSecretsInfo *candidate = iter->data; + + if (candidate->provider == provider) { + free_get_secrets_info (candidate); + break; + } + } +} + +static void +user_get_secrets_cb (DBusGProxy *proxy, + DBusGProxyCall *call, + gpointer user_data) +{ + GetSecretsInfo *info = (GetSecretsInfo *) user_data; + GHashTable *settings = NULL; + GError *error = NULL; + GObject *provider; + + g_return_if_fail (info != NULL); + g_return_if_fail (info->provider); + g_return_if_fail (info->setting_name); + + provider = g_object_ref (info->provider); + + if (dbus_g_proxy_end_call (proxy, call, &error, + DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &settings, + G_TYPE_INVALID)) { + nm_secrets_provider_interface_get_secrets_result (info->provider, + info->setting_name, + info->caller, + settings, + NULL); + g_hash_table_destroy (settings); + } else { + nm_secrets_provider_interface_get_secrets_result (info->provider, + info->setting_name, + info->caller, + NULL, + error); + g_clear_error (&error); + } + + info->call = NULL; + free_get_secrets_info (info); + + g_object_unref (provider); +} + +static GetSecretsInfo * +user_get_secrets (NMManager *self, + NMSecretsProviderInterface *provider, + NMConnection *connection, + const char *setting_name, + gboolean request_new, + RequestSecretsCaller caller_id, + const char *hint1, + const char *hint2) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + DBusGConnection *g_connection; + GetSecretsInfo *info = NULL; + GPtrArray *hints = NULL; + + info = g_malloc0 (sizeof (GetSecretsInfo)); + + g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + info->proxy = dbus_g_proxy_new_for_name (g_connection, + NM_DBUS_SERVICE_USER_SETTINGS, + nm_connection_get_path (connection), + NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS); + if (!info->proxy) { + nm_log_warn (LOGD_USER_SET, "could not create user connection secrets proxy"); + g_free (info); + return NULL; + } + + info->manager = self; + info->provider = provider; + info->caller = caller_id; + info->setting_name = g_strdup (setting_name); + + g_object_weak_ref (G_OBJECT (provider), (GWeakNotify) free_get_secrets_info, info); + + hints = g_ptr_array_sized_new (2); + if (hint1) + g_ptr_array_add (hints, (char *) hint1); + if (hint2) + g_ptr_array_add (hints, (char *) hint2); + + info->call = dbus_g_proxy_begin_call_with_timeout (info->proxy, "GetSecrets", + user_get_secrets_cb, + info, + NULL, + G_MAXINT32, + G_TYPE_STRING, setting_name, + DBUS_TYPE_G_ARRAY_OF_STRING, hints, + G_TYPE_BOOLEAN, request_new, + G_TYPE_INVALID); + g_ptr_array_free (hints, TRUE); + return info; +} + +static void +system_get_secrets_reply_cb (NMSettingsConnectionInterface *connection, + GHashTable *secrets, + GError *error, + gpointer user_data) +{ + GetSecretsInfo *info = user_data; + GObject *provider; + + provider = g_object_ref (info->provider); + + nm_secrets_provider_interface_get_secrets_result (info->provider, + info->setting_name, + info->caller, + error ? NULL : secrets, + error); + free_get_secrets_info (info); + g_object_unref (provider); +} + +static gboolean +system_get_secrets_idle_cb (gpointer user_data) +{ + GetSecretsInfo *info = user_data; + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (info->manager); + NMSettingsConnectionInterface *connection; + GError *error = NULL; + const char *hints[3] = { NULL, NULL, NULL }; + + info->idle_id = 0; + + connection = nm_settings_interface_get_connection_by_path (NM_SETTINGS_INTERFACE (priv->sys_settings), + info->connection_path); + if (!connection) { + error = g_error_new_literal (NM_MANAGER_ERROR, + NM_MANAGER_ERROR_UNKNOWN_CONNECTION, + "unknown connection (not exported by system settings)"); + nm_secrets_provider_interface_get_secrets_result (info->provider, + info->setting_name, + info->caller, + NULL, + error); + g_error_free (error); + free_get_secrets_info (info); + return FALSE; + } + + hints[0] = info->hint1; + hints[1] = info->hint2; + nm_settings_connection_interface_get_secrets (connection, + info->setting_name, + hints, + info->request_new, + system_get_secrets_reply_cb, + info); + return FALSE; +} + +static GetSecretsInfo * +system_get_secrets (NMManager *self, + NMSecretsProviderInterface *provider, + NMConnection *connection, + const char *setting_name, + gboolean request_new, + RequestSecretsCaller caller_id, + const char *hint1, + const char *hint2) +{ + GetSecretsInfo *info; + + info = g_malloc0 (sizeof (GetSecretsInfo)); + info->manager = self; + info->provider = provider; + info->caller = caller_id; + info->setting_name = g_strdup (setting_name); + info->hint1 = hint1 ? g_strdup (hint1) : NULL; + info->hint2 = hint2 ? g_strdup (hint2) : NULL; + info->connection_path = g_strdup (nm_connection_get_path (connection)); + info->request_new = request_new; + + g_object_weak_ref (G_OBJECT (provider), (GWeakNotify) free_get_secrets_info, info); + + info->idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, + system_get_secrets_idle_cb, + info, + NULL); + return info; +} + +static gboolean +provider_get_secrets (NMSecretsProviderInterface *provider, + NMConnection *connection, + const char *setting_name, + gboolean request_new, + RequestSecretsCaller caller_id, + const char *hint1, + const char *hint2, + gpointer user_data) +{ + NMManager *self = NM_MANAGER (user_data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + GetSecretsInfo *info = NULL; + NMConnectionScope scope; + GSList *iter; + + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (setting_name != NULL, FALSE); + + /* Tear down any pending secrets requests for this secrets provider */ + for (iter = priv->secrets_calls; iter; iter = g_slist_next (iter)) { + GetSecretsInfo *candidate = iter->data; + + if (provider == candidate->provider) { + free_get_secrets_info (candidate); + break; + } + } + + /* Build up the new secrets request */ + scope = nm_connection_get_scope (connection); + if (scope == NM_CONNECTION_SCOPE_SYSTEM) { + info = system_get_secrets (self, provider, connection, setting_name, + request_new, caller_id, hint1, hint2); + } else if (scope == NM_CONNECTION_SCOPE_USER) { + info = user_get_secrets (self, provider, connection, setting_name, + request_new, caller_id, hint1, hint2); + } + + if (info) + priv->secrets_calls = g_slist_append (priv->secrets_calls, info); + + return !!info; +} + +static const char * +internal_activate_device (NMManager *manager, + NMDevice *device, + NMConnection *connection, + const char *specific_object, + gboolean user_requested, + gboolean assumed, + GError **error) +{ + NMActRequest *req; + NMDeviceInterface *dev_iface; + gboolean success; + + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + dev_iface = NM_DEVICE_INTERFACE (device); + + /* Ensure the requested connection is compatible with the device */ + if (!nm_device_interface_check_connection_compatible (dev_iface, connection, error)) + return NULL; + + /* Tear down any existing connection */ + if (nm_device_get_act_request (device)) { + nm_device_state_changed (device, + NM_DEVICE_STATE_DISCONNECTED, + NM_DEVICE_STATE_REASON_NONE); + } + + req = nm_act_request_new (connection, specific_object, user_requested, assumed, (gpointer) device); + g_signal_connect (req, "manager-get-secrets", G_CALLBACK (provider_get_secrets), manager); + g_signal_connect (req, "manager-cancel-secrets", G_CALLBACK (provider_cancel_secrets), manager); + success = nm_device_interface_activate (dev_iface, req, error); + g_object_unref (req); + + return success ? nm_act_request_get_active_connection_path (req) : NULL; +} + +static gboolean +wait_for_connection_expired (gpointer data) +{ + NMManager *manager = NM_MANAGER (data); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + PendingConnectionInfo *info = priv->pending_connection_info; + GError *error = NULL; + + g_return_val_if_fail (info != NULL, FALSE); + + g_set_error (&error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_CONNECTION, + "%s", "Connection was not provided by any settings service"); + nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate (timeout): (%d) %s", + info->scope, info->connection_path, error->code, error->message); + dbus_g_method_return_error (info->context, error); + g_error_free (error); + + info->timeout_id = 0; + pending_connection_info_destroy (priv->pending_connection_info); + priv->pending_connection_info = NULL; + + return FALSE; +} + +const char * +nm_manager_activate_connection (NMManager *manager, + NMConnection *connection, + const char *specific_object, + const char *device_path, + gboolean user_requested, + GError **error) +{ + NMManagerPrivate *priv; + NMDevice *device = NULL; + NMSettingConnection *s_con; + NMVPNConnection *vpn_connection; + const char *path; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail (*error == NULL, NULL); + + priv = NM_MANAGER_GET_PRIVATE (manager); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + if (!strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_VPN_SETTING_NAME)) { + NMActRequest *req = NULL; + NMVPNManager *vpn_manager; + + /* VPN connection */ + + if (specific_object) { + /* Find the specifc connection the client requested we use */ + req = nm_manager_get_act_request_by_path (manager, specific_object, &device); + if (!req) { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE, + "%s", "Base connection for VPN connection not active."); + return NULL; + } + } else { + GSList *iter; + + /* Just find the current default connection */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *candidate = NM_DEVICE (iter->data); + NMActRequest *candidate_req; + + candidate_req = nm_device_get_act_request (candidate); + if (candidate_req && nm_act_request_get_default (candidate_req)) { + device = candidate; + req = candidate_req; + break; + } + } + } + + if (!device || !req) { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_DEVICE, + "%s", "Could not find source connection, or the source connection had no active device."); + return NULL; + } + + vpn_manager = nm_vpn_manager_get (); + vpn_connection = nm_vpn_manager_activate_connection (vpn_manager, + connection, + req, + device, + error); + g_signal_connect (vpn_connection, "manager-get-secrets", + G_CALLBACK (provider_get_secrets), manager); + g_signal_connect (vpn_connection, "manager-cancel-secrets", + G_CALLBACK (provider_cancel_secrets), manager); + path = nm_vpn_connection_get_active_connection_path (vpn_connection); + g_object_unref (vpn_manager); + } else { + NMDeviceState state; + + /* Device-based connection */ + device = nm_manager_get_device_by_path (manager, device_path); + if (!device) { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_DEVICE, + "%s", "Device not found"); + return NULL; + } + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + if (state < NM_DEVICE_STATE_DISCONNECTED) { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNMANAGED_DEVICE, + "%s", "Device not managed by NetworkManager"); + return NULL; + } + + path = internal_activate_device (manager, + device, + connection, + specific_object, + user_requested, + FALSE, + error); + } + + return path; +} + +static void +connection_added_default_handler (NMManager *manager, + NMConnection *connection, + NMConnectionScope scope) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + PendingConnectionInfo *info = priv->pending_connection_info; + const char *path; + GError *error = NULL; + + if (!info) + return; + + if (scope != info->scope) + return; + + if (strcmp (info->connection_path, nm_connection_get_path (connection))) + return; + + /* Will destroy below; can't be valid during the initial activation start */ + priv->pending_connection_info = NULL; + + path = nm_manager_activate_connection (manager, + connection, + info->specific_object_path, + info->device_path, + TRUE, + &error); + if (path) { + dbus_g_method_return (info->context, path); + g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); + } else { + dbus_g_method_return_error (info->context, error); + nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s", + scope, info->connection_path, error->code, error->message); + g_error_free (error); + } + + pending_connection_info_destroy (info); +} + +static gboolean +is_user_request_authorized (NMManager *manager, + DBusGMethodInvocation *context, + GError **error) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + DBusConnection *connection; + char *sender = NULL; + gulong sender_uid = G_MAXULONG; + DBusError dbus_error; + char *service_owner = NULL; + const char *service_name; + gulong service_uid = G_MAXULONG; + gboolean success = FALSE; + + /* Ensure the request to activate the user connection came from the + * same session as the user settings service. FIXME: use ConsoleKit + * too. + */ + if (!priv->user_proxy) { + g_set_error (error, NM_MANAGER_ERROR, + NM_MANAGER_ERROR_INVALID_SERVICE, + "%s", "No user settings service available"); + goto out; + } + + sender = dbus_g_method_get_sender (context); + if (!sender) { + g_set_error (error, NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s", "Could not determine D-Bus requestor"); + goto out; + } + + connection = nm_dbus_manager_get_dbus_connection (priv->dbus_mgr); + if (!connection) { + g_set_error (error, NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s", "Could not get the D-Bus system bus"); + goto out; + } + + dbus_error_init (&dbus_error); + /* FIXME: do this async */ + sender_uid = dbus_bus_get_unix_user (connection, sender, &dbus_error); + if (dbus_error_is_set (&dbus_error)) { + dbus_error_free (&dbus_error); + g_set_error (error, NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s", "Could not determine the Unix user ID of the requestor"); + goto out; + } + + /* Let root activate anything. + * FIXME: use a PolicyKit permission instead + */ + if (0 == sender_uid) { + success = TRUE; + goto out; + } + + service_name = dbus_g_proxy_get_bus_name (priv->user_proxy); + if (!service_name) { + g_set_error (error, NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s", "Could not determine user settings service name"); + goto out; + } + + service_owner = nm_dbus_manager_get_name_owner (priv->dbus_mgr, service_name, NULL); + if (!service_owner) { + g_set_error (error, NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s", "Could not determine D-Bus owner of the user settings service"); + goto out; + } + + dbus_error_init (&dbus_error); + /* FIXME: do this async */ + service_uid = dbus_bus_get_unix_user (connection, service_owner, &dbus_error); + if (dbus_error_is_set (&dbus_error)) { + dbus_error_free (&dbus_error); + g_set_error (error, NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s", "Could not determine the Unix UID of the sender of the request"); + goto out; + } + + /* And finally, the actual UID check */ + if (sender_uid != service_uid) { + g_set_error (error, NM_MANAGER_ERROR, + NM_MANAGER_ERROR_PERMISSION_DENIED, + "%s", "Requestor UID does not match the UID of the user settings service"); + goto out; + } + + success = TRUE; + +out: + g_free (sender); + g_free (service_owner); + return success; +} + +static void +impl_manager_activate_connection (NMManager *manager, + const char *service_name, + const char *connection_path, + const char *device_path, + const char *specific_object_path, + DBusGMethodInvocation *context) +{ + NMConnectionScope scope = NM_CONNECTION_SCOPE_UNKNOWN; + NMConnection *connection; + GError *error = NULL; + char *real_sop = NULL; + char *path = NULL; + + if (!strcmp (service_name, NM_DBUS_SERVICE_USER_SETTINGS)) { + if (!is_user_request_authorized (manager, context, &error)) + goto err; + + scope = NM_CONNECTION_SCOPE_USER; + } else if (!strcmp (service_name, NM_DBUS_SERVICE_SYSTEM_SETTINGS)) + scope = NM_CONNECTION_SCOPE_SYSTEM; + else { + g_set_error (&error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_INVALID_SERVICE, + "%s", "Invalid settings service name"); + goto err; + } + + /* "/" is special-cased to NULL to get through D-Bus */ + if (specific_object_path && strcmp (specific_object_path, "/")) + real_sop = g_strdup (specific_object_path); + + connection = nm_manager_get_connection_by_object_path (manager, scope, connection_path); + if (connection) { + path = (char *) nm_manager_activate_connection (manager, + connection, + real_sop, + device_path, + TRUE, + &error); + if (path) { + dbus_g_method_return (context, path); + g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); + } + } else { + PendingConnectionInfo *info; + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + + if (priv->pending_connection_info) { + pending_connection_info_destroy (priv->pending_connection_info); + priv->pending_connection_info = NULL; + } + + /* Don't have the connection quite yet, probably created by + * the client on-the-fly. Defer the activation until we have it + */ + + info = g_slice_new0 (PendingConnectionInfo); + info->context = context; + info->device_path = g_strdup (device_path); + info->scope = scope; + info->connection_path = g_strdup (connection_path); + info->specific_object_path = g_strdup (real_sop); + info->timeout_id = g_timeout_add_seconds (5, wait_for_connection_expired, manager); + + // FIXME: should probably be per-device, not global to the manager + NM_MANAGER_GET_PRIVATE (manager)->pending_connection_info = info; + } + + err: + if (error) { + dbus_g_method_return_error (context, error); + nm_log_warn (LOGD_CORE, "connection (%d) %s failed to activate: (%d) %s", + scope, connection_path, error->code, error->message); + g_error_free (error); + } + + g_free (real_sop); +} + +gboolean +nm_manager_deactivate_connection (NMManager *manager, + const char *connection_path, + NMDeviceStateReason reason, + GError **error) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + NMVPNManager *vpn_manager; + GSList *iter; + gboolean success = FALSE; + NMVPNConnectionStateReason vpn_reason = NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED; + + /* Check for device connections first */ + for (iter = priv->devices; iter; iter = g_slist_next (iter)) { + NMDevice *device = NM_DEVICE (iter->data); + NMActRequest *req; + + req = nm_device_get_act_request (device); + if (!req) + continue; + + if (!strcmp (connection_path, nm_act_request_get_active_connection_path (req))) { + nm_device_state_changed (device, + NM_DEVICE_STATE_DISCONNECTED, + reason); + success = TRUE; + goto done; + } + } + + /* Check for VPN connections next */ + vpn_manager = nm_vpn_manager_get (); + if (reason == NM_DEVICE_STATE_REASON_CONNECTION_REMOVED) + vpn_reason = NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED; + if (nm_vpn_manager_deactivate_connection (vpn_manager, connection_path, vpn_reason)) { + success = TRUE; + } else { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_NOT_ACTIVE, + "%s", "The connection was not active."); + } + g_object_unref (vpn_manager); + +done: + g_object_notify (G_OBJECT (manager), NM_MANAGER_ACTIVE_CONNECTIONS); + return success; +} + +static gboolean +impl_manager_deactivate_connection (NMManager *manager, + const char *connection_path, + GError **error) +{ + return nm_manager_deactivate_connection (manager, + connection_path, + NM_DEVICE_STATE_REASON_USER_REQUESTED, + error); +} + +static void +do_sleep_wake (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + const GSList *unmanaged_specs; + GSList *iter; + + if (manager_sleeping (self)) { + nm_log_info (LOGD_SUSPEND, "sleeping or disabling..."); + + /* Just deactivate and down all devices from the device list, + * to keep things fast the device list will get resynced when + * the manager wakes up. + */ + for (iter = priv->devices; iter; iter = iter->next) + nm_device_set_managed (NM_DEVICE (iter->data), FALSE, NM_DEVICE_STATE_REASON_SLEEPING); + + } else { + nm_log_info (LOGD_SUSPEND, "waking up and re-enabling..."); + + unmanaged_specs = nm_sysconfig_settings_get_unmanaged_specs (priv->sys_settings); + + /* Ensure rfkill state is up-to-date since we don't respond to state + * changes during sleep. + */ + nm_manager_rfkill_update (self, RFKILL_TYPE_UNKNOWN); + + /* Re-manage managed devices */ + for (iter = priv->devices; iter; iter = iter->next) { + NMDevice *device = NM_DEVICE (iter->data); + guint i; + + /* enable/disable wireless devices since that we don't respond + * to killswitch changes during sleep. + */ + for (i = 0; i < RFKILL_TYPE_MAX; i++) { + RadioState *rstate = &priv->radio_states[i]; + gboolean enabled = (rstate->hw_enabled && rstate->enabled); + RfKillType devtype = RFKILL_TYPE_UNKNOWN; + + if (rstate->desc) { + nm_log_dbg (LOGD_RFKILL, "%s %s devices (hw_enabled %d, enabled %d)", + enabled ? "enabling" : "disabling", + rstate->desc, rstate->hw_enabled, rstate->enabled); + } + + g_object_get (G_OBJECT (device), NM_DEVICE_INTERFACE_RFKILL_TYPE, &devtype, NULL); + if (devtype == rstate->rtype) + nm_device_interface_set_enabled (NM_DEVICE_INTERFACE (device), enabled); + } + + nm_device_clear_autoconnect_inhibit (device); + if (nm_device_interface_spec_match_list (NM_DEVICE_INTERFACE (device), unmanaged_specs)) + nm_device_set_managed (device, FALSE, NM_DEVICE_STATE_REASON_NOW_UNMANAGED); + else + nm_device_set_managed (device, TRUE, NM_DEVICE_STATE_REASON_NOW_MANAGED); + } + + /* Ask for new bluetooth devices */ + bluez_manager_resync_devices (self); + } + + nm_manager_update_state (self); +} + +static gboolean +impl_manager_sleep (NMManager *self, gboolean do_sleep, GError **error) +{ + NMManagerPrivate *priv; + + g_return_val_if_fail (NM_IS_MANAGER (self), FALSE); + + priv = NM_MANAGER_GET_PRIVATE (self); + + if (priv->sleeping == do_sleep) { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, + "Already %s", do_sleep ? "asleep" : "awake"); + return FALSE; + } + + nm_log_info (LOGD_SUSPEND, "%s requested (sleeping: %s enabled: %s)", + do_sleep ? "sleep" : "wake", + priv->sleeping ? "yes" : "no", + priv->net_enabled ? "yes" : "no"); + + priv->sleeping = do_sleep; + + do_sleep_wake (self); + + g_object_notify (G_OBJECT (self), NM_MANAGER_SLEEPING); + return TRUE; +} + +static gboolean +impl_manager_enable (NMManager *self, gboolean enable, GError **error) +{ + NMManagerPrivate *priv; + + g_return_val_if_fail (NM_IS_MANAGER (self), FALSE); + + priv = NM_MANAGER_GET_PRIVATE (self); + + if (priv->net_enabled == enable) { + g_set_error (error, + NM_MANAGER_ERROR, NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, + "Already %s", enable ? "enabled" : "disabled"); + return FALSE; + } + + /* Update "NetworkingEnabled" key in state file */ + if (priv->state_file) { + GError *err = NULL; + + if (!write_value_to_state_file (priv->state_file, + "main", "NetworkingEnabled", + G_TYPE_BOOLEAN, (gpointer) &enable, + &err)) { + /* Not a hard error */ + nm_log_warn (LOGD_SUSPEND, "writing to state file %s failed: (%d) %s.", + priv->state_file, + err ? err->code : -1, + (err && err->message) ? err->message : "unknown"); + } + } + + nm_log_info (LOGD_SUSPEND, "%s requested (sleeping: %s enabled: %s)", + enable ? "enable" : "disable", + priv->sleeping ? "yes" : "no", + priv->net_enabled ? "yes" : "no"); + + priv->net_enabled = enable; + + do_sleep_wake (self); + + g_object_notify (G_OBJECT (self), NM_MANAGER_NETWORKING_ENABLED); + return TRUE; +} + +/* Legacy 0.6 compatibility interface */ + +static gboolean +impl_manager_legacy_sleep (NMManager *manager, GError **error) +{ + return impl_manager_sleep (manager, TRUE, error); +} + +static gboolean +impl_manager_legacy_wake (NMManager *manager, GError **error) +{ + return impl_manager_sleep (manager, FALSE, error); +} + +static gboolean +impl_manager_legacy_state (NMManager *manager, guint32 *state, GError **err) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + + nm_manager_update_state (manager); + *state = priv->state; + return TRUE; +} + +static gboolean +impl_manager_set_logging (NMManager *manager, + const char *level, + const char *domains, + GError **error) +{ + if (nm_logging_setup (level, domains, error)) { + char *new_domains = nm_logging_domains_to_string (); + + nm_log_info (LOGD_CORE, "logging: level '%s' domains '%s'", + nm_logging_level_to_string (), + new_domains); + g_free (new_domains); + return TRUE; + } + return FALSE; +} + +/* Connections */ + +static int +connection_sort (gconstpointer pa, gconstpointer pb) +{ + NMConnection *a = NM_CONNECTION (pa); + NMSettingConnection *con_a; + NMConnection *b = NM_CONNECTION (pb); + NMSettingConnection *con_b; + + con_a = (NMSettingConnection *) nm_connection_get_setting (a, NM_TYPE_SETTING_CONNECTION); + g_assert (con_a); + con_b = (NMSettingConnection *) nm_connection_get_setting (b, NM_TYPE_SETTING_CONNECTION); + g_assert (con_b); + + if (nm_setting_connection_get_autoconnect (con_a) != nm_setting_connection_get_autoconnect (con_b)) { + if (nm_setting_connection_get_autoconnect (con_a)) + return -1; + return 1; + } + + if (nm_setting_connection_get_timestamp (con_a) > nm_setting_connection_get_timestamp (con_b)) + return -1; + else if (nm_setting_connection_get_timestamp (con_a) == nm_setting_connection_get_timestamp (con_b)) + return 0; + return 1; +} + +static void +connections_to_slist (gpointer key, gpointer value, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + + *list = g_slist_insert_sorted (*list, g_object_ref (value), connection_sort); +} + +/* Returns a GSList of referenced NMConnection objects, caller must + * unref the connections in the list and destroy the list. + */ +GSList * +nm_manager_get_connections (NMManager *manager, + NMConnectionScope scope) +{ + NMManagerPrivate *priv; + GSList *list = NULL; + + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + + priv = NM_MANAGER_GET_PRIVATE (manager); + if (scope == NM_CONNECTION_SCOPE_USER) + g_hash_table_foreach (priv->user_connections, connections_to_slist, &list); + else if (scope == NM_CONNECTION_SCOPE_SYSTEM) + g_hash_table_foreach (priv->system_connections, connections_to_slist, &list); + else + nm_log_err (LOGD_CORE, "unknown NMConnectionScope %d", scope); + return list; +} + +NMConnection * +nm_manager_get_connection_by_object_path (NMManager *manager, + NMConnectionScope scope, + const char *path) +{ + NMManagerPrivate *priv; + NMConnection *connection = NULL; + + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + g_return_val_if_fail (path != NULL, NULL); + + priv = NM_MANAGER_GET_PRIVATE (manager); + if (scope == NM_CONNECTION_SCOPE_USER) + connection = (NMConnection *) g_hash_table_lookup (priv->user_connections, path); + else if (scope == NM_CONNECTION_SCOPE_SYSTEM) + connection = (NMConnection *) g_hash_table_lookup (priv->system_connections, path); + else + nm_log_err (LOGD_CORE, "unknown NMConnectionScope %d", scope); + return connection; +} + +GPtrArray * +nm_manager_get_active_connections_by_connection (NMManager *manager, + NMConnection *connection) +{ + return get_active_connections (manager, connection); +} + +void +nm_manager_start (NMManager *self) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + guint i; + + /* Set initial radio enabled/disabled state */ + for (i = 0; i < RFKILL_TYPE_MAX; i++) { + RadioState *rstate = &priv->radio_states[i]; + gboolean enabled = TRUE, hw_enabled = TRUE; + + if (!rstate->desc) + continue; + + switch (nm_udev_manager_get_rfkill_state (priv->udev_mgr, i)) { + case RFKILL_UNBLOCKED: + enabled = TRUE; + hw_enabled = TRUE; + break; + case RFKILL_SOFT_BLOCKED: + enabled = FALSE; + hw_enabled = TRUE; + break; + case RFKILL_HARD_BLOCKED: + enabled = FALSE; + hw_enabled = FALSE; + break; + default: + break; + } + + rstate->hw_enabled = hw_enabled; + nm_log_info (LOGD_RFKILL, "%s %s by radio killswitch; %s by state file", + rstate->desc, + (rstate->hw_enabled && enabled) ? "enabled" : "disabled", + (rstate->enabled) ? "enabled" : "disabled"); + manager_set_radio_enabled (self, rstate, rstate->enabled && enabled); + } + + /* Log overall networking status - enabled/disabled */ + nm_log_info (LOGD_CORE, "Networking is %s by state file", + priv->net_enabled ? "enabled" : "disabled"); + + system_unmanaged_devices_changed_cb (priv->sys_settings, NULL, self); + system_hostname_changed_cb (priv->sys_settings, NULL, self); + system_query_connections (self); + + /* Get user connections if the user settings service is around, otherwise + * they will be queried when the user settings service shows up on the + * bus in nm_manager_name_owner_changed(). + */ + if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, NM_DBUS_SERVICE_USER_SETTINGS)) + user_query_connections (self); + + nm_udev_manager_query_devices (priv->udev_mgr); + bluez_manager_resync_devices (self); +} + +NMManager * +nm_manager_get (const char *config_file, + const char *plugins, + const char *state_file, + gboolean initial_net_enabled, + gboolean initial_wifi_enabled, + gboolean initial_wwan_enabled, + GError **error) +{ + static NMManager *singleton = NULL; + NMManagerPrivate *priv; + DBusGConnection *bus; + + if (singleton) + return g_object_ref (singleton); + + singleton = (NMManager *) g_object_new (NM_TYPE_MANAGER, NULL); + g_assert (singleton); + + priv = NM_MANAGER_GET_PRIVATE (singleton); + + bus = nm_dbus_manager_get_connection (priv->dbus_mgr); + g_assert (bus); + + priv->sys_settings = nm_sysconfig_settings_new (config_file, plugins, bus, error); + if (!priv->sys_settings) { + g_object_unref (singleton); + return NULL; + } + nm_settings_service_export (NM_SETTINGS_SERVICE (priv->sys_settings)); + + priv->config_file = g_strdup (config_file); + + priv->state_file = g_strdup (state_file); + + priv->net_enabled = initial_net_enabled; + + priv->radio_states[RFKILL_TYPE_WLAN].enabled = initial_wifi_enabled; + priv->radio_states[RFKILL_TYPE_WWAN].enabled = initial_wwan_enabled; + + g_signal_connect (priv->sys_settings, "notify::" NM_SYSCONFIG_SETTINGS_UNMANAGED_SPECS, + G_CALLBACK (system_unmanaged_devices_changed_cb), singleton); + g_signal_connect (priv->sys_settings, "notify::" NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME, + G_CALLBACK (system_hostname_changed_cb), singleton); + g_signal_connect (priv->sys_settings, "new-connection", + G_CALLBACK (system_new_connection_cb), singleton); + + dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (priv->dbus_mgr), + NM_DBUS_PATH, + G_OBJECT (singleton)); + + g_signal_connect (priv->dbus_mgr, + "name-owner-changed", + G_CALLBACK (nm_manager_name_owner_changed), + singleton); + + priv->udev_mgr = nm_udev_manager_new (); + g_signal_connect (priv->udev_mgr, + "device-added", + G_CALLBACK (udev_device_added_cb), + singleton); + g_signal_connect (priv->udev_mgr, + "device-removed", + G_CALLBACK (udev_device_removed_cb), + singleton); + g_signal_connect (priv->udev_mgr, + "rfkill-changed", + G_CALLBACK (udev_manager_rfkill_changed_cb), + singleton); + + priv->bluez_mgr = nm_bluez_manager_get (); + + g_signal_connect (priv->bluez_mgr, + "bdaddr-added", + G_CALLBACK (bluez_manager_bdaddr_added_cb), + singleton); + + g_signal_connect (priv->bluez_mgr, + "bdaddr-removed", + G_CALLBACK (bluez_manager_bdaddr_removed_cb), + singleton); + + return singleton; +} + +static void +dispose (GObject *object) +{ + NMManager *manager = NM_MANAGER (object); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + pending_connection_info_destroy (priv->pending_connection_info); + priv->pending_connection_info = NULL; + + while (g_slist_length (priv->secrets_calls)) + free_get_secrets_info ((GetSecretsInfo *) priv->secrets_calls->data); + + while (g_slist_length (priv->devices)) { + priv->devices = remove_one_device (manager, + priv->devices, + NM_DEVICE (priv->devices->data), + TRUE, + FALSE); + } + + user_destroy_connections (manager); + g_hash_table_destroy (priv->user_connections); + priv->user_connections = NULL; + + g_hash_table_foreach (priv->system_connections, emit_removed, manager); + g_hash_table_remove_all (priv->system_connections); + g_hash_table_destroy (priv->system_connections); + priv->system_connections = NULL; + + g_free (priv->hostname); + g_free (priv->config_file); + + if (priv->sys_settings) { + g_object_unref (priv->sys_settings); + priv->sys_settings = NULL; + } + + if (priv->vpn_manager_id) { + g_source_remove (priv->vpn_manager_id); + priv->vpn_manager_id = 0; + } + g_object_unref (priv->vpn_manager); + + if (priv->modem_added_id) { + g_source_remove (priv->modem_added_id); + priv->modem_added_id = 0; + } + if (priv->modem_removed_id) { + g_source_remove (priv->modem_removed_id); + priv->modem_removed_id = 0; + } + g_object_unref (priv->modem_manager); + + g_object_unref (priv->dbus_mgr); + if (priv->bluez_mgr) + g_object_unref (priv->bluez_mgr); + + G_OBJECT_CLASS (nm_manager_parent_class)->dispose (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMManager *self = NM_MANAGER (object); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + + switch (prop_id) { + case PROP_NETWORKING_ENABLED: + /* Construct only for now */ + priv->net_enabled = g_value_get_boolean (value); + break; + case PROP_WIRELESS_ENABLED: + manager_set_radio_enabled (NM_MANAGER (object), + &priv->radio_states[RFKILL_TYPE_WLAN], + g_value_get_boolean (value)); + break; + case PROP_WWAN_ENABLED: + manager_set_radio_enabled (NM_MANAGER (object), + &priv->radio_states[RFKILL_TYPE_WWAN], + 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) +{ + NMManager *self = NM_MANAGER (object); + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); + + switch (prop_id) { + case PROP_STATE: + nm_manager_update_state (self); + g_value_set_uint (value, priv->state); + break; + case PROP_NETWORKING_ENABLED: + g_value_set_boolean (value, priv->net_enabled); + break; + case PROP_WIRELESS_ENABLED: + g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WLAN].enabled); + break; + case PROP_WIRELESS_HARDWARE_ENABLED: + g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WLAN].hw_enabled); + break; + case PROP_WWAN_ENABLED: + g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WWAN].enabled); + break; + case PROP_WWAN_HARDWARE_ENABLED: + g_value_set_boolean (value, priv->radio_states[RFKILL_TYPE_WWAN].hw_enabled); + break; + case PROP_ACTIVE_CONNECTIONS: + g_value_take_boxed (value, get_active_connections (self, NULL)); + break; + case PROP_HOSTNAME: + g_value_set_string (value, priv->hostname); + break; + case PROP_SLEEPING: + g_value_set_boolean (value, priv->sleeping); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_manager_init (NMManager *manager) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + DBusGConnection *g_connection; + guint id, i; + + /* Initialize rfkill structures and states */ + memset (priv->radio_states, 0, sizeof (priv->radio_states)); + + priv->radio_states[RFKILL_TYPE_WLAN].enabled = TRUE; + priv->radio_states[RFKILL_TYPE_WLAN].key = "WirelessEnabled"; + priv->radio_states[RFKILL_TYPE_WLAN].prop = NM_MANAGER_WIRELESS_ENABLED; + priv->radio_states[RFKILL_TYPE_WLAN].hw_prop = NM_MANAGER_WIRELESS_HARDWARE_ENABLED; + priv->radio_states[RFKILL_TYPE_WLAN].desc = "WiFi"; + priv->radio_states[RFKILL_TYPE_WLAN].other_enabled_func = nm_manager_get_ipw_rfkill_state; + priv->radio_states[RFKILL_TYPE_WLAN].rtype = RFKILL_TYPE_WLAN; + + priv->radio_states[RFKILL_TYPE_WWAN].enabled = TRUE; + priv->radio_states[RFKILL_TYPE_WWAN].key = "WWANEnabled"; + priv->radio_states[RFKILL_TYPE_WWAN].prop = NM_MANAGER_WWAN_ENABLED; + priv->radio_states[RFKILL_TYPE_WWAN].hw_prop = NM_MANAGER_WWAN_HARDWARE_ENABLED; + priv->radio_states[RFKILL_TYPE_WWAN].desc = "WWAN"; + priv->radio_states[RFKILL_TYPE_WWAN].other_enabled_func = nm_manager_get_modem_enabled_state; + priv->radio_states[RFKILL_TYPE_WWAN].rtype = RFKILL_TYPE_WWAN; + + priv->radio_states[RFKILL_TYPE_WIMAX].enabled = TRUE; + priv->radio_states[RFKILL_TYPE_WIMAX].key = "WiMAXEnabled"; + priv->radio_states[RFKILL_TYPE_WIMAX].prop = NULL; + priv->radio_states[RFKILL_TYPE_WIMAX].hw_prop = NULL; + priv->radio_states[RFKILL_TYPE_WIMAX].desc = "WiMAX"; + priv->radio_states[RFKILL_TYPE_WIMAX].other_enabled_func = NULL; + priv->radio_states[RFKILL_TYPE_WIMAX].rtype = RFKILL_TYPE_WIMAX; + + for (i = 0; i < RFKILL_TYPE_MAX; i++) + priv->radio_states[i].hw_enabled = TRUE; + + priv->sleeping = FALSE; + priv->state = NM_STATE_DISCONNECTED; + + priv->dbus_mgr = nm_dbus_manager_get (); + + priv->user_connections = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_object_unref); + + priv->system_connections = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_object_unref); + + priv->modem_manager = nm_modem_manager_get (); + priv->modem_added_id = g_signal_connect (priv->modem_manager, "modem-added", + G_CALLBACK (modem_added), manager); + priv->modem_removed_id = g_signal_connect (priv->modem_manager, "modem-removed", + G_CALLBACK (modem_removed), manager); + + priv->vpn_manager = nm_vpn_manager_get (); + id = g_signal_connect (G_OBJECT (priv->vpn_manager), "connection-deactivated", + G_CALLBACK (vpn_manager_connection_deactivated_cb), manager); + priv->vpn_manager_id = id; + + g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + + /* avahi-autoipd stuff */ + priv->aipd_proxy = dbus_g_proxy_new_for_name (g_connection, + NM_AUTOIP_DBUS_SERVICE, + "/", + NM_AUTOIP_DBUS_IFACE); + if (priv->aipd_proxy) { + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING_STRING, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + + dbus_g_proxy_add_signal (priv->aipd_proxy, + "Event", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + + dbus_g_proxy_connect_signal (priv->aipd_proxy, "Event", + G_CALLBACK (aipd_handle_event), + manager, + NULL); + } else + nm_log_warn (LOGD_AUTOIP4, "could not initialize avahi-autoipd D-Bus proxy"); +} + +static void +nm_manager_class_init (NMManagerClass *manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (manager_class); + + g_type_class_add_private (manager_class, sizeof (NMManagerPrivate)); + + /* virtual methods */ + manager_class->connection_added = connection_added_default_handler; + + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->dispose = dispose; + + /* properties */ + g_object_class_install_property + (object_class, PROP_STATE, + g_param_spec_uint (NM_MANAGER_STATE, + "State", + "Current state", + 0, NM_STATE_DISCONNECTED, 0, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_NETWORKING_ENABLED, + g_param_spec_boolean (NM_MANAGER_NETWORKING_ENABLED, + "NetworkingEnabled", + "Is networking enabled", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_WIRELESS_ENABLED, + g_param_spec_boolean (NM_MANAGER_WIRELESS_ENABLED, + "WirelessEnabled", + "Is wireless enabled", + TRUE, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_WIRELESS_HARDWARE_ENABLED, + g_param_spec_boolean (NM_MANAGER_WIRELESS_HARDWARE_ENABLED, + "WirelessHardwareEnabled", + "RF kill state", + TRUE, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_WWAN_ENABLED, + g_param_spec_boolean (NM_MANAGER_WWAN_ENABLED, + "WwanEnabled", + "Is mobile broadband enabled", + TRUE, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_WWAN_HARDWARE_ENABLED, + g_param_spec_boolean (NM_MANAGER_WWAN_HARDWARE_ENABLED, + "WwanHardwareEnabled", + "Whether WWAN is disabled by a hardware switch or not", + TRUE, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_ACTIVE_CONNECTIONS, + g_param_spec_boxed (NM_MANAGER_ACTIVE_CONNECTIONS, + "Active connections", + "Active connections", + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, + G_PARAM_READABLE)); + + /* Hostname is not exported over D-Bus */ + g_object_class_install_property + (object_class, PROP_HOSTNAME, + g_param_spec_string (NM_MANAGER_HOSTNAME, + "Hostname", + "Hostname", + NULL, + G_PARAM_READABLE | NM_PROPERTY_PARAM_NO_EXPORT)); + + /* Sleeping is not exported over D-Bus */ + g_object_class_install_property + (object_class, PROP_SLEEPING, + g_param_spec_boolean (NM_MANAGER_SLEEPING, + "Sleeping", + "Sleeping", + FALSE, + G_PARAM_READABLE | NM_PROPERTY_PARAM_NO_EXPORT)); + + /* signals */ + signals[DEVICE_ADDED] = + g_signal_new ("device-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMManagerClass, device_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_OBJECT); + + signals[DEVICE_REMOVED] = + g_signal_new ("device-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMManagerClass, device_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_OBJECT); + + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMManagerClass, state_changed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMManagerClass, properties_changed)); + + signals[CONNECTIONS_ADDED] = + g_signal_new ("connections-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMManagerClass, connections_added), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + signals[CONNECTION_ADDED] = + g_signal_new ("connection-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMManagerClass, connection_added), + NULL, NULL, + _nm_marshal_VOID__OBJECT_UINT, + G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_UINT); + + signals[CONNECTION_UPDATED] = + g_signal_new ("connection-updated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMManagerClass, connection_updated), + NULL, NULL, + _nm_marshal_VOID__OBJECT_UINT, + G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_UINT); + + signals[CONNECTION_REMOVED] = + g_signal_new ("connection-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMManagerClass, connection_removed), + NULL, NULL, + _nm_marshal_VOID__OBJECT_UINT, + G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_UINT); + + /* StateChange is DEPRECATED */ + signals[STATE_CHANGE] = + g_signal_new ("state-change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (manager_class), + &dbus_glib_nm_manager_object_info); + + dbus_g_error_domain_register (NM_MANAGER_ERROR, NULL, NM_TYPE_MANAGER_ERROR); + dbus_g_error_domain_register (NM_LOGGING_ERROR, "org.freedesktop.NetworkManager.Logging", NM_TYPE_LOGGING_ERROR); +} + diff --git a/src/nm-manager.h b/src/nm-manager.h new file mode 100644 index 00000000..0f4d72f2 --- /dev/null +++ b/src/nm-manager.h @@ -0,0 +1,121 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2010 Red Hat, Inc. + */ + +#ifndef NM_MANAGER_H +#define NM_MANAGER_H 1 + +#include +#include +#include +#include "nm-device.h" +#include "nm-device-interface.h" + +#define NM_TYPE_MANAGER (nm_manager_get_type ()) +#define NM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MANAGER, NMManager)) +#define NM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MANAGER, NMManagerClass)) +#define NM_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MANAGER)) +#define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_MANAGER)) +#define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass)) + +#define NM_MANAGER_STATE "state" +#define NM_MANAGER_NETWORKING_ENABLED "networking-enabled" +#define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled" +#define NM_MANAGER_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled" +#define NM_MANAGER_WWAN_ENABLED "wwan-enabled" +#define NM_MANAGER_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled" +#define NM_MANAGER_ACTIVE_CONNECTIONS "active-connections" + +/* Not exported */ +#define NM_MANAGER_HOSTNAME "hostname" +#define NM_MANAGER_SLEEPING "sleeping" + +typedef struct { + GObject parent; +} NMManager; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*device_added) (NMManager *manager, NMDevice *device); + void (*device_removed) (NMManager *manager, NMDevice *device); + void (*state_changed) (NMManager *manager, guint state); + void (*properties_changed) (NMManager *manager, GHashTable *properties); + + void (*connections_added) (NMManager *manager, NMConnectionScope scope); + + void (*connection_added) (NMManager *manager, + NMConnection *connection, + NMConnectionScope scope); + + void (*connection_updated) (NMManager *manager, + NMConnection *connection, + NMConnectionScope scope); + + void (*connection_removed) (NMManager *manager, + NMConnection *connection, + NMConnectionScope scope); +} NMManagerClass; + +GType nm_manager_get_type (void); + +NMManager *nm_manager_get (const char *config_file, + const char *plugins, + const char *state_file, + gboolean initial_net_enabled, + gboolean initial_wifi_enabled, + gboolean initial_wwan_enabled, + GError **error); + +void nm_manager_start (NMManager *manager); + +/* Device handling */ + +GSList *nm_manager_get_devices (NMManager *manager); + +const char * nm_manager_activate_connection (NMManager *manager, + NMConnection *connection, + const char *specific_object, + const char *device_path, + gboolean user_requested, + GError **error); + +gboolean nm_manager_deactivate_connection (NMManager *manager, + const char *connection_path, + NMDeviceStateReason reason, + GError **error); + +/* State handling */ + +NMState nm_manager_get_state (NMManager *manager); + +/* Connections */ + +GSList *nm_manager_get_connections (NMManager *manager, NMConnectionScope scope); + +NMConnection * nm_manager_get_connection_by_object_path (NMManager *manager, + NMConnectionScope scope, + const char *path); + +GPtrArray * nm_manager_get_active_connections_by_connection (NMManager *manager, + NMConnection *connection); + +#endif /* NM_MANAGER_H */ diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c new file mode 100644 index 00000000..13b3ab98 --- /dev/null +++ b/src/nm-netlink-monitor.c @@ -0,0 +1,866 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + * Copyright (C) 2005 Ray Strode + * + * Some code borrowed from HAL: + * + * Copyright (C) 2003 David Zeuthen, + * Copyright (C) 2004 Novell, Inc. + */ + +/* for struct ucred and LIBNL_NEEDS_ADDR_CACHING_WORKAROUND */ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "nm-netlink-monitor.h" +#include "nm-logging.h" + +#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)) + +#define NM_NETLINK_MONITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_NETLINK_MONITOR, \ + NMNetlinkMonitorPrivate)) + +typedef struct { + /* Async event listener connection */ + struct nl_handle *nlh_event; + GIOChannel * io_channel; + guint event_id; + + /* Sync/blocking request/response connection */ + struct nl_handle *nlh_sync; + struct nl_cache * link_cache; + + guint request_status_id; + + GHashTable *subscriptions; +} NMNetlinkMonitorPrivate; + +enum { + NOTIFICATION = 0, + CARRIER_ON, + CARRIER_OFF, + ERROR, + LAST_SIGNAL +}; +static guint signals[LAST_SIGNAL] = { 0 }; + + +G_DEFINE_TYPE (NMNetlinkMonitor, nm_netlink_monitor, G_TYPE_OBJECT); + +static void +link_msg_handler (struct nl_object *obj, void *arg) +{ + NMNetlinkMonitor *self = NM_NETLINK_MONITOR (arg); + GError *error; + struct rtnl_link *filter; + struct rtnl_link *link_obj; + guint flags; + guint ifidx; + + filter = rtnl_link_alloc (); + if (!filter) { + error = g_error_new (NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_BAD_ALLOC, + _("error processing netlink message: %s"), + nl_geterror ()); + g_signal_emit (self, signals[ERROR], 0, error); + g_error_free (error); + return; + } + + /* Ensure it's a link object */ + if (nl_object_match_filter (obj, OBJ_CAST (filter)) == 0) { + rtnl_link_put (filter); + return; + } + + link_obj = (struct rtnl_link *) obj; + flags = rtnl_link_get_flags (link_obj); + ifidx = rtnl_link_get_ifindex (link_obj); + + nm_log_dbg (LOGD_HW, "netlink link message: iface idx %d flags 0x%X", ifidx, flags); + + /* IFF_LOWER_UP is the indicator of carrier status since kernel commit + * b00055aacdb172c05067612278ba27265fcd05ce in 2.6.17. + */ + if (flags & IFF_LOWER_UP) + g_signal_emit (self, signals[CARRIER_ON], 0, ifidx); + else + g_signal_emit (self, signals[CARRIER_OFF], 0, ifidx); + + rtnl_link_put (filter); +} + +static int +event_msg_recv (struct nl_msg *msg, void *arg) +{ + struct nl_handle *nlh = arg; + struct nlmsghdr *hdr = nlmsg_hdr (msg); + struct ucred *creds = nlmsg_get_creds (msg); + const struct sockaddr_nl *snl; + guint32 local_port; + gboolean accept_msg = FALSE; + + /* Only messages sent from the kernel */ + if (!creds || creds->uid != 0) { + nm_log_dbg (LOGD_HW, "ignoring netlink message from UID %d", + creds ? creds->uid : -1); + return NL_SKIP; + } + + snl = nlmsg_get_src (msg); + g_assert (snl); + + /* Accept any messages from the kernel */ + if (hdr->nlmsg_pid == 0 || snl->nl_pid == 0) + accept_msg = TRUE; + + /* And any multicast message directed to our netlink PID, since multicast + * currently requires CAP_ADMIN to use. + */ + local_port = nl_socket_get_local_port (nlh); + if ((hdr->nlmsg_pid == local_port) && snl->nl_groups) + accept_msg = TRUE; + + if (accept_msg == FALSE) { + nm_log_dbg (LOGD_HW, "ignoring netlink message from PID %d (local PID %d, multicast %d)", + hdr->nlmsg_pid, + local_port, + (hdr->nlmsg_flags & NLM_F_MULTI)); + return NL_SKIP; + } + + return NL_OK; +} + +static int +event_msg_ready (struct nl_msg *msg, void *arg) +{ + NMNetlinkMonitor *self = NM_NETLINK_MONITOR (arg); + + /* By the time the message gets here we've already checked the sender + * and we're sure it's safe to parse this message. + */ + + /* Let clients handle generic messages */ + g_signal_emit (self, signals[NOTIFICATION], 0, msg); + + /* Parse carrier messages */ + nl_msg_parse (msg, &link_msg_handler, self); + + return NL_OK; +} + +static gboolean +event_handler (GIOChannel *channel, + GIOCondition io_condition, + gpointer user_data) +{ + NMNetlinkMonitor *self = (NMNetlinkMonitor *) user_data; + NMNetlinkMonitorPrivate *priv; + GError *error = NULL; + + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), TRUE); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + g_return_val_if_fail (priv->event_id > 0, TRUE); + + if (io_condition & ERROR_CONDITIONS) { + const char *err_msg; + int err_code = 0; + socklen_t err_len = sizeof (err_code); + + /* Grab error information */ + if (getsockopt (g_io_channel_unix_get_fd (channel), + SOL_SOCKET, SO_ERROR, (void *) &err_code, &err_len)) + err_msg = strerror (err_code); + else + err_msg = _("error occurred while waiting for data on socket"); + + error = g_error_new (NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA, + "%s", err_msg); + g_signal_emit (self, signals[ERROR], 0, error); + g_error_free (error); + return TRUE; + } else if (io_condition & DISCONNECT_CONDITIONS) + return FALSE; + + g_return_val_if_fail (!(io_condition & ~EVENT_CONDITIONS), FALSE); + + /* Process the netlink messages */ + if (nl_recvmsgs_default (priv->nlh_event) < 0) { + error = g_error_new (NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_PROCESSING_MESSAGE, + _("error processing netlink message: %s"), + nl_geterror ()); + g_signal_emit (self, signals[ERROR], 0, error); + g_error_free (error); + } + + return TRUE; +} + +static gboolean +nlh_setup (struct nl_handle *nlh, + nl_recvmsg_msg_cb_t valid_func, + gpointer cb_data, + GError **error) +{ + nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, cb_data); + + if (valid_func) + nl_socket_modify_cb (nlh, NL_CB_VALID, NL_CB_CUSTOM, valid_func, cb_data); + + if (nl_connect (nlh, NETLINK_ROUTE) < 0) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, + _("unable to connect to netlink for monitoring link status: %s"), + nl_geterror ()); + return FALSE; + } + + /* Enable unix socket peer credentials which we use for verifying that the + * sender of the message is actually the kernel. + */ + if (nl_set_passcred (nlh, 1) < 0) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, + _("unable to enable netlink handle credential passing: %s"), + nl_geterror ()); + return FALSE; + } + + return TRUE; +} + +static gboolean +event_connection_setup (NMNetlinkMonitor *self, GError **error) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + GError *channel_error = NULL; + GIOFlags channel_flags; + struct nl_cb *cb; + int fd; + + g_return_val_if_fail (priv->io_channel == NULL, FALSE); + + /* Set up the event listener connection */ + cb = nl_cb_alloc (NL_CB_DEFAULT); + priv->nlh_event = nl_handle_alloc_cb (cb); + nl_cb_put (cb); + if (!priv->nlh_event) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_HANDLE, + _("unable to allocate netlink handle for monitoring link status: %s"), + nl_geterror ()); + goto error; + } + + if (!nlh_setup (priv->nlh_event, event_msg_ready, self, error)) + goto error; + + nl_disable_sequence_check (priv->nlh_event); + + /* Subscribe to the LINK group for internal carrier signals */ + if (!nm_netlink_monitor_subscribe (self, RTNLGRP_LINK, error)) + goto error; + + fd = nl_socket_get_fd (priv->nlh_event); + priv->io_channel = g_io_channel_unix_new (fd); + + g_io_channel_set_encoding (priv->io_channel, NULL, &channel_error); + /* Encoding is NULL, so no conversion error can possibly occur */ + g_assert (channel_error == NULL); + + g_io_channel_set_close_on_unref (priv->io_channel, TRUE); + channel_flags = g_io_channel_get_flags (priv->io_channel); + channel_error = NULL; + g_io_channel_set_flags (priv->io_channel, + channel_flags | G_IO_FLAG_NONBLOCK, + &channel_error); + if (channel_error != NULL) { + g_propagate_error (error, channel_error); + goto error; + } + + return TRUE; + +error: + if (priv->io_channel) + nm_netlink_monitor_close_connection (self); + + if (priv->nlh_event) { + nl_handle_destroy (priv->nlh_event); + priv->nlh_event = NULL; + } + + return FALSE; +} + +static gboolean +sync_connection_setup (NMNetlinkMonitor *self, GError **error) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + struct nl_cb *cb; +#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND + struct nl_cache *addr_cache; +#endif + + /* Set up the event listener connection */ + cb = nl_cb_alloc (NL_CB_DEFAULT); + priv->nlh_sync = nl_handle_alloc_cb (cb); + nl_cb_put (cb); + if (!priv->nlh_sync) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_HANDLE, + _("unable to allocate netlink handle for monitoring link status: %s"), + nl_geterror ()); + goto error; + } + + if (!nlh_setup (priv->nlh_sync, NULL, self, error)) + goto error; + +#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND + /* Work around apparent libnl bug; rtnl_addr requires that all + * addresses have the "peer" attribute set in order to be compared + * for equality, but this attribute is not normally set. As a + * result, most addresses will not compare as equal even to + * themselves, busting caching. + */ + addr_cache = rtnl_addr_alloc_cache (priv->nlh_sync); + nl_cache_get_ops (addr_cache)->co_obj_ops->oo_id_attrs &= ~0x80; + nl_cache_free (addr_cache); +#endif + + if ((priv->link_cache = rtnl_link_alloc_cache (priv->nlh_sync)) == NULL) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_LINK_CACHE, + _("unable to allocate netlink link cache for monitoring link status: %s"), + nl_geterror ()); + goto error; + } + nl_cache_mngt_provide (priv->link_cache); + + return TRUE; + +error: + if (priv->link_cache) { + nl_cache_free (priv->link_cache); + priv->link_cache = NULL; + } + + if (priv->nlh_sync) { + nl_handle_destroy (priv->nlh_sync); + priv->nlh_sync = NULL; + } + + return FALSE; +} + +gboolean +nm_netlink_monitor_open_connection (NMNetlinkMonitor *self, GError **error) +{ + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); + + if (!event_connection_setup (self, error)) + return FALSE; + + if (!sync_connection_setup (self, error)) + return FALSE; + + return TRUE; +} + +void +nm_netlink_monitor_close_connection (NMNetlinkMonitor *self) +{ + NMNetlinkMonitorPrivate *priv; + + g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + g_return_if_fail (priv->io_channel != NULL); + + if (priv->event_id) + nm_netlink_monitor_detach (self); + + g_io_channel_shutdown (priv->io_channel, + TRUE /* flush pending data */, + NULL); + g_io_channel_unref (priv->io_channel); + priv->io_channel = NULL; +} + +void +nm_netlink_monitor_attach (NMNetlinkMonitor *self) +{ + NMNetlinkMonitorPrivate *priv; + + g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + g_return_if_fail (priv->nlh_event != NULL); + g_return_if_fail (priv->event_id == 0); + + priv->event_id = g_io_add_watch (priv->io_channel, + (EVENT_CONDITIONS | ERROR_CONDITIONS | DISCONNECT_CONDITIONS), + event_handler, self); +} + +void +nm_netlink_monitor_detach (NMNetlinkMonitor *self) +{ + NMNetlinkMonitorPrivate *priv; + + g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + g_return_if_fail (priv->event_id > 0); + + g_source_remove (priv->event_id); + priv->event_id = 0; +} + +static int +get_subs (NMNetlinkMonitor *self, int group) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + return GPOINTER_TO_INT (g_hash_table_lookup (priv->subscriptions, + GINT_TO_POINTER (group))); +} + +static void +set_subs (NMNetlinkMonitor *self, int group, int new_subs) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + g_hash_table_insert (priv->subscriptions, + GINT_TO_POINTER (group), + GINT_TO_POINTER (new_subs)); +} + +gboolean +nm_netlink_monitor_subscribe (NMNetlinkMonitor *self, int group, GError **error) +{ + NMNetlinkMonitorPrivate *priv; + int subs; + + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + if (!priv->nlh_event) { + if (!nm_netlink_monitor_open_connection (self, error)) + return FALSE; + } + + subs = get_subs (self, group) + 1; + if (subs == 1) { + if (nl_socket_add_membership (priv->nlh_event, group) < 0) { + g_set_error (error, NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_NETLINK_JOIN_GROUP, + _("unable to join netlink group: %s"), + nl_geterror ()); + return FALSE; + } + } + + /* Update # of subscriptions for this group */ + set_subs (self, group, subs); + + return TRUE; +} + +void +nm_netlink_monitor_unsubscribe (NMNetlinkMonitor *self, int group) +{ + NMNetlinkMonitorPrivate *priv; + int subs; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_NETLINK_MONITOR (self)); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + g_return_if_fail (priv->nlh_event != NULL); + + subs = get_subs (self, group) - 1; + if (subs == 0) + nl_socket_drop_membership (priv->nlh_event, group); + + /* Update # of subscriptions for this group */ + set_subs (self, group, subs); +} + +/***************************************************************/ + +gboolean +nm_netlink_monitor_request_ip6_info (NMNetlinkMonitor *self, GError **error) +{ + NMNetlinkMonitorPrivate *priv; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + /* FIXME: nl_rtgen_request() gets the return value screwed up with + * libnl-1.1; revisit this and return a proper error when we port to + * a later libnl. + */ + nl_rtgen_request (priv->nlh_event, RTM_GETLINK, AF_INET6, NLM_F_DUMP); + + return TRUE; +} + + +static gboolean +deferred_emit_carrier_state (gpointer user_data) +{ + NMNetlinkMonitor *self = NM_NETLINK_MONITOR (user_data); + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + priv->request_status_id = 0; + + /* Update the link cache with latest state, and if there are no errors + * emit the link states for all the interfaces in the cache. + */ + if (nl_cache_refill (priv->nlh_sync, priv->link_cache)) { + nm_log_err (LOGD_HW, "error updating link cache: %s", nl_geterror ()); + } else + nl_cache_foreach_filter (priv->link_cache, NULL, link_msg_handler, self); + + return FALSE; +} + +gboolean +nm_netlink_monitor_request_status (NMNetlinkMonitor *self, GError **error) +{ + NMNetlinkMonitorPrivate *priv; + + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + /* Schedule the carrier state emission */ + if (!priv->request_status_id) + priv->request_status_id = g_idle_add (deferred_emit_carrier_state, self); + + return TRUE; +} + +typedef struct { + NMNetlinkMonitor *self; + struct rtnl_link *filter; + GError *error; + guint32 flags; +} GetFlagsInfo; + +static void +get_flags_sync_cb (struct nl_object *obj, void *arg) +{ + GetFlagsInfo *info = arg; + + /* Ensure this cache item matches our filter */ + if (nl_object_match_filter (obj, OBJ_CAST (info->filter)) != 0) + info->flags = rtnl_link_get_flags ((struct rtnl_link *) obj); +} + +gboolean +nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self, + guint32 ifindex, + guint32 *ifflags, + GError **error) +{ + NMNetlinkMonitorPrivate *priv; + GetFlagsInfo info; + struct rtnl_link *filter; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); + g_return_val_if_fail (ifflags != NULL, FALSE); + + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + /* Update the link cache with the latest information */ + if (nl_cache_refill (priv->nlh_sync, priv->link_cache)) { + g_set_error (error, + NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE, + _("error updating link cache: %s"), + nl_geterror ()); + return FALSE; + } + + /* HACK: Apparently to get it working we have to refill the cache twice; + * otherwise some kernels (or maybe libnl?) only send a few of the + * interfaces in the refill request. + */ + if (nl_cache_refill (priv->nlh_sync, priv->link_cache)) { + g_set_error (error, + NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE, + _("error updating link cache: %s"), + nl_geterror ()); + return FALSE; + } + + /* Set up the filter */ + filter = rtnl_link_alloc (); + if (!filter) { + g_set_error (error, + NM_NETLINK_MONITOR_ERROR, + NM_NETLINK_MONITOR_ERROR_BAD_ALLOC, + _("error processing netlink message: %s"), + nl_geterror ()); + return FALSE; + } + rtnl_link_set_ifindex (filter, ifindex); + + memset (&info, 0, sizeof (info)); + info.self = self; + info.filter = filter; + info.error = NULL; + nl_cache_foreach_filter (priv->link_cache, NULL, get_flags_sync_cb, &info); + + rtnl_link_put (filter); + + if (info.error) { + if (error) + *error = info.error; + else + g_error_free (info.error); + return FALSE; + } else + *ifflags = info.flags; + + return TRUE; /* success */ +} + +/***************************************************************/ + +struct nl_handle * +nm_netlink_get_default_handle (void) +{ + NMNetlinkMonitor *self; + struct nl_handle *nlh; + + self = nm_netlink_monitor_get (); + nlh = NM_NETLINK_MONITOR_GET_PRIVATE (self)->nlh_sync; + g_object_unref (self); + + return nlh; +} + +int +nm_netlink_iface_to_index (const char *iface) +{ + NMNetlinkMonitor *self; + NMNetlinkMonitorPrivate *priv; + int idx; + + g_return_val_if_fail (iface != NULL, -1); + + self = nm_netlink_monitor_get (); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + nl_cache_refill (priv->nlh_sync, priv->link_cache); + idx = rtnl_link_name2i (priv->link_cache, iface); + g_object_unref (self); + + return idx; +} + +#define MAX_IFACE_LEN 33 +char * +nm_netlink_index_to_iface (int idx) +{ + NMNetlinkMonitor *self; + NMNetlinkMonitorPrivate *priv; + char *buf = NULL; + + g_return_val_if_fail (idx >= 0, NULL); + + self = nm_netlink_monitor_get (); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + buf = g_malloc0 (MAX_IFACE_LEN); + g_assert (buf); + + nl_cache_refill (priv->nlh_sync, priv->link_cache); + if (!rtnl_link_i2name (priv->link_cache, idx, buf, MAX_IFACE_LEN - 1)) { + g_free (buf); + buf = NULL; + } + + g_object_unref (self); + return buf; +} + +struct rtnl_link * +nm_netlink_index_to_rtnl_link (int idx) +{ + NMNetlinkMonitor *self; + NMNetlinkMonitorPrivate *priv; + struct rtnl_link *ret = NULL; + + if (idx <= 0) + return NULL; + + self = nm_netlink_monitor_get (); + priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + nl_cache_refill (priv->nlh_sync, priv->link_cache); + ret = rtnl_link_get (priv->link_cache, idx); + g_object_unref (self); + + return ret; +} + +/***************************************************************/ + +NMNetlinkMonitor * +nm_netlink_monitor_get (void) +{ + static NMNetlinkMonitor *singleton = NULL; + + if (!singleton) + singleton = NM_NETLINK_MONITOR (g_object_new (NM_TYPE_NETLINK_MONITOR, NULL)); + else + g_object_ref (singleton); + + return singleton; +} + +static void +nm_netlink_monitor_init (NMNetlinkMonitor *self) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); + + priv->subscriptions = g_hash_table_new (g_direct_hash, g_direct_equal); +} + +static void +finalize (GObject *object) +{ + NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (object); + + if (priv->request_status_id) + g_source_remove (priv->request_status_id); + + if (priv->io_channel) + nm_netlink_monitor_close_connection (NM_NETLINK_MONITOR (object)); + + if (priv->link_cache) { + nl_cache_free (priv->link_cache); + priv->link_cache = NULL; + } + + if (priv->nlh_event) { + nl_handle_destroy (priv->nlh_event); + priv->nlh_event = NULL; + } + + if (priv->nlh_sync) { + nl_handle_destroy (priv->nlh_sync); + priv->nlh_sync = NULL; + } + + g_hash_table_destroy (priv->subscriptions); + + G_OBJECT_CLASS (nm_netlink_monitor_parent_class)->finalize (object); +} + +static void +nm_netlink_monitor_class_init (NMNetlinkMonitorClass *monitor_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (monitor_class); + + g_type_class_add_private (monitor_class, sizeof (NMNetlinkMonitorPrivate)); + + /* Virtual methods */ + object_class->finalize = finalize; + + /* Signals */ + signals[NOTIFICATION] = + g_signal_new ("notification", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMNetlinkMonitorClass, notification), + NULL, NULL, g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + signals[CARRIER_ON] = + g_signal_new ("carrier-on", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMNetlinkMonitorClass, carrier_on), + NULL, NULL, g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, G_TYPE_INT); + + signals[CARRIER_OFF] = + g_signal_new ("carrier-off", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMNetlinkMonitorClass, carrier_off), + NULL, NULL, g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, G_TYPE_INT); + + signals[ERROR] = + g_signal_new ("error", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMNetlinkMonitorClass, error), + NULL, NULL, g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); +} + +GQuark +nm_netlink_monitor_error_quark (void) +{ + static GQuark error_quark = 0; + + if (G_UNLIKELY (error_quark == 0)) + error_quark = g_quark_from_static_string ("nm-netlink-monitor-error-quark"); + return error_quark; +} + diff --git a/src/nm-netlink-monitor.h b/src/nm-netlink-monitor.h new file mode 100644 index 00000000..8b57a312 --- /dev/null +++ b/src/nm-netlink-monitor.h @@ -0,0 +1,99 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + * Copyright (C) 2005 Ray Strode + */ + +#ifndef NM_NETLINK_MONITOR_H +#define NM_NETLINK_MONITOR_H + +#include +#include +#include +#include + +#define NM_TYPE_NETLINK_MONITOR (nm_netlink_monitor_get_type ()) +#define NM_NETLINK_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_NETLINK_MONITOR, NMNetlinkMonitor)) +#define NM_NETLINK_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_NETLINK_MONITOR, NMNetlinkMonitorClass)) +#define NM_IS_NETLINK_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_NETLINK_MONITOR)) +#define NM_IS_NETLINK_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_NETLINK_MONITOR)) +#define NM_NETLINK_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_NETLINK_MONITOR, NMNetlinkMonitorClass)) + +typedef enum { + NM_NETLINK_MONITOR_ERROR_GENERIC = 0, + NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_HANDLE, + NM_NETLINK_MONITOR_ERROR_NETLINK_CONNECT, + NM_NETLINK_MONITOR_ERROR_NETLINK_JOIN_GROUP, + NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_LINK_CACHE, + NM_NETLINK_MONITOR_ERROR_PROCESSING_MESSAGE, + NM_NETLINK_MONITOR_ERROR_BAD_ALLOC, + NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA, + NM_NETLINK_MONITOR_ERROR_LINK_CACHE_UPDATE +} NMNetlinkMonitorError; + +typedef struct { + GObject parent; +} NMNetlinkMonitor; + +typedef struct { + GObjectClass parent_class; + + /* Signals */ + void (*notification) (NMNetlinkMonitor *monitor, struct nl_msg *msg); + void (*carrier_on) (NMNetlinkMonitor *monitor, int index); + void (*carrier_off) (NMNetlinkMonitor *monitor, int index); + void (*error) (NMNetlinkMonitor *monitor, GError *error); +} NMNetlinkMonitorClass; + + +#define NM_NETLINK_MONITOR_ERROR (nm_netlink_monitor_error_quark ()) +GType nm_netlink_monitor_get_type (void) G_GNUC_CONST; +GQuark nm_netlink_monitor_error_quark (void) G_GNUC_CONST; + +NMNetlinkMonitor *nm_netlink_monitor_get (void); + +gboolean nm_netlink_monitor_open_connection (NMNetlinkMonitor *monitor, + GError **error); +void nm_netlink_monitor_close_connection (NMNetlinkMonitor *monitor); +void nm_netlink_monitor_attach (NMNetlinkMonitor *monitor); +void nm_netlink_monitor_detach (NMNetlinkMonitor *monitor); + +gboolean nm_netlink_monitor_subscribe (NMNetlinkMonitor *monitor, + int group, + GError **error); +void nm_netlink_monitor_unsubscribe (NMNetlinkMonitor *monitor, + int group); + +gboolean nm_netlink_monitor_request_ip6_info (NMNetlinkMonitor *monitor, + GError **error); + +gboolean nm_netlink_monitor_request_status (NMNetlinkMonitor *monitor, + GError **error); +gboolean nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *monitor, + guint32 ifindex, + guint32 *ifflags, + GError **error); + +/* Generic utility functions */ +int nm_netlink_iface_to_index (const char *iface); +char * nm_netlink_index_to_iface (int idx); +struct rtnl_link *nm_netlink_index_to_rtnl_link (int idx); +struct nl_handle *nm_netlink_get_default_handle (void); + +#endif /* NM_NETLINK_MONITOR_H */ diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c new file mode 100644 index 00000000..a273a920 --- /dev/null +++ b/src/nm-policy-hostname.c @@ -0,0 +1,205 @@ +/* -*- 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 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include + +#include + +#include "nm-logging.h" +#include "nm-policy-hostname.h" +#include "nm-policy-hosts.h" + +/************************************************************************/ + +struct HostnameThread { + GThread *thread; + + GMutex *lock; + gboolean dead; + int ret; + + guint32 ip4_addr; + char hostname[NI_MAXHOST + 1]; + + HostnameThreadCallback callback; + gpointer user_data; +}; + +static gboolean +hostname_thread_run_cb (gpointer user_data) +{ + HostnameThread *ht = (HostnameThread *) user_data; + const char *hostname = NULL; + + if (strlen (ht->hostname)) + hostname = ht->hostname; + + (*ht->callback) (ht, ht->ret, hostname, ht->user_data); + return FALSE; +} + +static gpointer +hostname_thread_worker (gpointer data) +{ + HostnameThread *ht = (HostnameThread *) data; + struct sockaddr_in addr; + int i; + + g_mutex_lock (ht->lock); + if (ht->dead) { + g_mutex_unlock (ht->lock); + return (gpointer) NULL; + } + g_mutex_unlock (ht->lock); + + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = ht->ip4_addr; + + ht->ret = getnameinfo ((struct sockaddr *) &addr, sizeof (struct sockaddr_in), + ht->hostname, NI_MAXHOST, NULL, 0, + NI_NAMEREQD); + if (ht->ret == 0) { + for (i = 0; i < strlen (ht->hostname); i++) + ht->hostname[i] = tolower (ht->hostname[i]); + } + + /* Don't track the idle handler ID because by the time the g_idle_add() + * returns the ID, the handler may already have run and freed the + * HostnameThread. + */ + g_idle_add (hostname_thread_run_cb, ht); + return (gpointer) TRUE; +} + +void +hostname_thread_free (HostnameThread *ht) +{ + g_return_if_fail (ht != NULL); + + g_mutex_free (ht->lock); + memset (ht, 0, sizeof (HostnameThread)); + g_free (ht); +} + +HostnameThread * +hostname_thread_new (guint32 ip4_addr, HostnameThreadCallback callback, gpointer user_data) +{ + HostnameThread *ht; + + ht = g_malloc0 (sizeof (HostnameThread)); + g_assert (ht); + + ht->lock = g_mutex_new (); + ht->callback = callback; + ht->user_data = user_data; + ht->ip4_addr = ip4_addr; + + ht->thread = g_thread_create (hostname_thread_worker, ht, FALSE, NULL); + if (!ht->thread) { + hostname_thread_free (ht); + ht = NULL; + } + + return ht; +} + +void +hostname_thread_kill (HostnameThread *ht) +{ + g_return_if_fail (ht != NULL); + + g_mutex_lock (ht->lock); + ht->dead = TRUE; + g_mutex_unlock (ht->lock); +} + +gboolean +hostname_thread_is_dead (HostnameThread *ht) +{ + g_return_val_if_fail (ht != NULL, TRUE); + + return ht->dead; +} + +/************************************************************************/ + +#define FALLBACK_HOSTNAME "localhost.localdomain" + +gboolean +nm_policy_set_system_hostname (const char *new_hostname, const char *msg) +{ + char old_hostname[HOST_NAME_MAX + 1]; + int ret = 0; + const char *name; + gboolean set_hostname = TRUE, changed = FALSE; + + if (new_hostname) + g_warn_if_fail (strlen (new_hostname)); + + name = (new_hostname && strlen (new_hostname)) ? new_hostname : FALLBACK_HOSTNAME; + + old_hostname[HOST_NAME_MAX] = '\0'; + errno = 0; + ret = gethostname (old_hostname, HOST_NAME_MAX); + if (ret != 0) { + nm_log_warn (LOGD_DNS, "couldn't get the system hostname: (%d) %s", + errno, strerror (errno)); + } else { + /* Don't set the hostname if it isn't actually changing */ + if ( (new_hostname && !strcmp (old_hostname, new_hostname)) + || (!new_hostname && !strcmp (old_hostname, FALLBACK_HOSTNAME))) + set_hostname = FALSE; + } + + if (set_hostname) { + nm_log_info (LOGD_DNS, "Setting system hostname to '%s' (%s)", name, msg); + ret = sethostname (name, strlen (name)); + if (ret != 0) { + nm_log_warn (LOGD_DNS, "couldn't set the system hostname to '%s': (%d) %s", + name, errno, strerror (errno)); + return FALSE; + } + } + + /* But even if the hostname isn't changing, always try updating /etc/hosts + * just in case the hostname changed while NM wasn't running; we need to + * make sure that /etc/hosts has valid mappings for '127.0.0.1' and the + * current system hostname. If those exist, + * nm_policy_hosts_update_etc_hosts() will just return and won't touch + * /etc/hosts at all. + */ + if (!nm_policy_hosts_update_etc_hosts (name, FALLBACK_HOSTNAME, &changed)) { + /* error updating /etc/hosts; fallback to localhost.localdomain */ + nm_log_info (LOGD_DNS, "Setting system hostname to '" FALLBACK_HOSTNAME "' (error updating /etc/hosts)"); + ret = sethostname (FALLBACK_HOSTNAME, strlen (FALLBACK_HOSTNAME)); + if (ret != 0) { + nm_log_warn (LOGD_DNS, "couldn't set the fallback system hostname (%s): (%d) %s", + FALLBACK_HOSTNAME, errno, strerror (errno)); + } + } + + return changed; +} + diff --git a/src/nm-policy-hostname.h b/src/nm-policy-hostname.h new file mode 100644 index 00000000..c59ca410 --- /dev/null +++ b/src/nm-policy-hostname.h @@ -0,0 +1,47 @@ +/* -*- 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 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_POLICY_HOSTNAME_H +#define NM_POLICY_HOSTNAME_H + +#include + +gboolean nm_policy_set_system_hostname (const char *new_hostname, const char *msg); + + +typedef struct HostnameThread HostnameThread; + +typedef void (*HostnameThreadCallback) (HostnameThread *ht, + int error, + const char *hostname, + gpointer user_data); + +HostnameThread * hostname_thread_new (guint32 ip4_addr, + HostnameThreadCallback callback, + gpointer user_data); + +void hostname_thread_free (HostnameThread *ht); + +gboolean hostname_thread_is_dead (HostnameThread *ht); + +void hostname_thread_kill (HostnameThread *ht); + +#endif /* NM_POLICY_HOSTNAME_H */ diff --git a/src/nm-policy-hosts.c b/src/nm-policy-hosts.c new file mode 100644 index 00000000..7723c997 --- /dev/null +++ b/src/nm-policy-hosts.c @@ -0,0 +1,235 @@ +/* -*- 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 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include + +#include "nm-policy-hosts.h" +#include "nm-logging.h" + +gboolean +nm_policy_hosts_find_token (const char *line, const char *token) +{ + const char *start = line, *p = line; + + g_return_val_if_fail (line != NULL, FALSE); + g_return_val_if_fail (token != NULL, FALSE); + g_return_val_if_fail (strlen (token) > 0, FALSE); + + /* Walk through the line to find the next whitespace character */ + while (p <= line + strlen (line)) { + if (isblank (*p) || (*p == '\0')) { + /* Token starts with 'start' and ends with 'end' */ + if ((p > start) && *start && (p - start == strlen (token)) && !strncmp (start, token, (p - start))) + return TRUE; /* found */ + + /* not found; advance start and continue looking */ + start = p + 1; + } + p++; + } + + return FALSE; +} + +static gboolean +is_local_mapping (const char *str, const char *hostname) +{ + return ( !strncmp (str, "127.0.0.1", strlen ("127.0.0.1")) + && nm_policy_hosts_find_token (str, hostname ? hostname : "localhost")); +} + +GString * +nm_policy_get_etc_hosts (const char **lines, + gsize existing_len, + const char *hostname, + const char *fallback_hostname, + GError **error) +{ + GString *contents = NULL; + const char **line; + gboolean found_host_nonlocal = FALSE; + gboolean found_host = FALSE; + gboolean found_localhost = FALSE; + gboolean initial_comments = TRUE; + gboolean added = FALSE; + + g_return_val_if_fail (lines != NULL, FALSE); + g_return_val_if_fail (hostname != NULL, FALSE); + + /* /etc/hosts needs at least two things: + * + * 1) current hostname mapped to any address + * 2) 'localhost' mapped to 127.0.0.1 + * + * If both these conditions exist in /etc/hosts, we don't need to bother + * updating the file. + */ + + /* Look for the two cases from above */ + for (line = lines; lines && *line; line++) { + if (strlen (*line) && (*line[0] != '#')) { + if (nm_policy_hosts_find_token (*line, hostname)) { + if (!is_local_mapping (*line, "localhost")) { + /* hostname is not on a 127.0.0.1 line or the line does not + * contain 'localhost'. + */ + found_host_nonlocal = TRUE; + } + found_host = TRUE; + } + + if (is_local_mapping (*line, "localhost")) { + /* a 127.0.0.1 line containing 'localhost' */ + found_localhost = TRUE; + } + } + + if (found_localhost && found_host) + return NULL; /* No update required */ + } + + contents = g_string_sized_new (existing_len ? existing_len + 100 : 200); + if (!contents) { + g_set_error_literal (error, 0, 0, "not enough memory"); + return NULL; + } + + /* Construct the new hosts file; replace any 127.0.0.1 entry that is at the + * beginning of the file or right after initial comments and contains + * the string 'localhost'. If there is no 127.0.0.1 entry at the beginning + * or after initial comments that contains 'localhost', add one there + * and ignore any other 127.0.0.1 entries that contain 'localhost'. + */ + for (line = lines, initial_comments = TRUE; lines && *line; line++) { + gboolean add_line = TRUE; + + /* This is the first line after the initial comments */ + if (strlen (*line) && initial_comments && (*line[0] != '#')) { + initial_comments = FALSE; + + /* If some other line contained the hostname but not 'localhost', + * make a simple localhost mapping and assume the user knows what + * they are doing with their manual hostname entry. Otherwise if + * the hostname wasn't found somewhere else, add it to the localhost + * mapping line to make sure it's mapped to something. + */ + if (found_host_nonlocal) + g_string_append (contents, "127.0.0.1"); + else + g_string_append_printf (contents, "127.0.0.1\t%s", hostname); + + if (strcmp (hostname, fallback_hostname)) { + g_string_append_printf (contents, "\t%s", fallback_hostname); + /* Don't add a standalone 'localhost.localdomain' 127 mapping */ + if (is_local_mapping (*line, fallback_hostname)) + add_line = FALSE; + } + + g_string_append (contents, "\tlocalhost\n"); + added = TRUE; + + /* Don't add the original line if it is a 'localhost' mapping */ + if (is_local_mapping (*line, "localhost")) + add_line = FALSE; + } + + if (add_line) { + g_string_append (contents, *line); + /* Only append the new line if this isn't the last line in the file */ + if (*(line+1)) + g_string_append_c (contents, '\n'); + } + } + + /* Hmm, /etc/hosts was empty for some reason */ + if (!added) { + g_string_append (contents, "# Do not remove the following line, or various programs\n"); + g_string_append (contents, "# that require network functionality will fail.\n"); + g_string_append_printf (contents, "127.0.0.1\t%s\tlocalhost\n", fallback_hostname); + } + + return contents; +} + +gboolean +nm_policy_hosts_update_etc_hosts (const char *hostname, + const char *fallback_hostname, + gboolean *out_changed) +{ + char *contents = NULL; + char **lines = NULL; + GError *error = NULL; + GString *new_contents = NULL; + gsize contents_len = 0; + gboolean success = FALSE; + + g_return_val_if_fail (hostname != NULL, FALSE); + g_return_val_if_fail (out_changed != NULL, FALSE); + + if (!g_file_get_contents (SYSCONFDIR "/hosts", &contents, &contents_len, &error)) { + nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", + error ? error->code : 0, + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + return FALSE; + } + + /* Get the new /etc/hosts contents */ + lines = g_strsplit_set (contents, "\n\r", 0); + new_contents = nm_policy_get_etc_hosts ((const char **) lines, + contents_len, + hostname, + fallback_hostname, + &error); + g_strfreev (lines); + g_free (contents); + + if (new_contents) { + nm_log_info (LOGD_DNS, "Updating /etc/hosts with new system hostname"); + + g_clear_error (&error); + /* And actually update /etc/hosts */ + if (!g_file_set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) { + nm_log_warn (LOGD_DNS, "couldn't update " SYSCONFDIR "/hosts: (%d) %s", + error ? error->code : 0, + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + } else { + success = TRUE; + *out_changed = TRUE; + } + + g_string_free (new_contents, TRUE); + } else if (!error) { + /* No change required */ + success = TRUE; + } else { + nm_log_warn (LOGD_DNS, "couldn't read " SYSCONFDIR "/hosts: (%d) %s", + error->code, error->message ? error->message : "(unknown)"); + g_clear_error (&error); + } + + return success; +} + diff --git a/src/nm-policy-hosts.h b/src/nm-policy-hosts.h new file mode 100644 index 00000000..0a77e667 --- /dev/null +++ b/src/nm-policy-hosts.h @@ -0,0 +1,40 @@ +/* -*- 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 - 2010 Red Hat, Inc. + */ + +#ifndef NM_POLICY_HOSTS_H +#define NM_POLICT_HOSTS_H + +#include + +gboolean nm_policy_hosts_update_etc_hosts (const char *hostname, + const char *fallback_hostname, + gboolean *out_changed); + +/* Only for testcases; don't use outside of nm-policy-hosts.c */ +gboolean nm_policy_hosts_find_token (const char *line, const char *token); + +GString *nm_policy_get_etc_hosts (const char **lines, + gsize existing_len, + const char *hostname, + const char *fallback_hostname, + GError **error); + +#endif /* NM_POLICY_HOSTS_H */ + diff --git a/src/nm-policy.c b/src/nm-policy.c new file mode 100644 index 00000000..455545b6 --- /dev/null +++ b/src/nm-policy.c @@ -0,0 +1,1138 @@ +/* -*- 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 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include + +#include "nm-policy.h" +#include "NetworkManagerUtils.h" +#include "nm-wifi-ap.h" +#include "nm-activation-request.h" +#include "nm-logging.h" +#include "nm-device-interface.h" +#include "nm-device.h" +#include "nm-device-wifi.h" +#include "nm-device-ethernet.h" +#include "nm-device-modem.h" +#include "nm-dbus-manager.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-connection.h" +#include "nm-system.h" +#include "nm-named-manager.h" +#include "nm-vpn-manager.h" +#include "nm-policy-hosts.h" +#include "nm-policy-hostname.h" + +struct NMPolicy { + NMManager *manager; + guint update_state_id; + GSList *pending_activation_checks; + GSList *signal_ids; + GSList *dev_signal_ids; + + NMVPNManager *vpn_manager; + gulong vpn_activated_id; + gulong vpn_deactivated_id; + + NMDevice *default_device4; + NMDevice *default_device6; + + HostnameThread *lookup; + + char *orig_hostname; /* hostname at NM start time */ +}; + +#define INVALID_TAG "invalid" + +static const char * +get_connection_id (NMConnection *connection) +{ + NMSettingConnection *s_con; + + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_return_val_if_fail (s_con != NULL, NULL); + + return nm_setting_connection_get_id (s_con); +} + +static NMDevice * +get_best_ip4_device (NMManager *manager, NMActRequest **out_req) +{ + GSList *devices, *iter; + NMDevice *best = NULL; + int best_prio = G_MAXINT; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + g_return_val_if_fail (out_req != NULL, NULL); + g_return_val_if_fail (*out_req == NULL, NULL); + + devices = nm_manager_get_devices (manager); + for (iter = devices; iter; iter = g_slist_next (iter)) { + NMDevice *dev = NM_DEVICE (iter->data); + NMActRequest *req; + NMConnection *connection; + NMIP4Config *ip4_config; + NMSettingIP4Config *s_ip4; + int prio; + guint i; + gboolean can_default = FALSE; + const char *method = NULL; + + if (nm_device_get_state (dev) != NM_DEVICE_STATE_ACTIVATED) + continue; + + ip4_config = nm_device_get_ip4_config (dev); + if (!ip4_config) + continue; + + req = nm_device_get_act_request (dev); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* Never set the default route through an IPv4LL-addressed device */ + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + method = nm_setting_ip4_config_get_method (s_ip4); + + if (s_ip4 && !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) + continue; + + /* Make sure at least one of this device's IP addresses has a gateway */ + for (i = 0; i < nm_ip4_config_get_num_addresses (ip4_config); i++) { + NMIP4Address *addr; + + addr = nm_ip4_config_get_address (ip4_config, i); + if (nm_ip4_address_get_gateway (addr)) { + can_default = TRUE; + break; + } + } + + if (!can_default && !NM_IS_DEVICE_MODEM (dev)) + continue; + + /* 'never-default' devices can't ever be the default */ + if (s_ip4 && nm_setting_ip4_config_get_never_default (s_ip4)) + continue; + + prio = nm_device_get_priority (dev); + if (prio > 0 && prio < best_prio) { + best = dev; + best_prio = prio; + *out_req = req; + } + } + + return best; +} + +static NMDevice * +get_best_ip6_device (NMManager *manager, NMActRequest **out_req) +{ + GSList *devices, *iter; + NMDevice *best = NULL; + int best_prio = G_MAXINT; + + g_return_val_if_fail (manager != NULL, NULL); + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + g_return_val_if_fail (out_req != NULL, NULL); + g_return_val_if_fail (*out_req == NULL, NULL); + + devices = nm_manager_get_devices (manager); + for (iter = devices; iter; iter = g_slist_next (iter)) { + NMDevice *dev = NM_DEVICE (iter->data); + NMActRequest *req; + NMConnection *connection; + NMIP6Config *ip6_config; + NMSettingIP6Config *s_ip6; + int prio; + guint i; + gboolean can_default = FALSE; + const char *method = NULL; + + if (nm_device_get_state (dev) != NM_DEVICE_STATE_ACTIVATED) + continue; + + ip6_config = nm_device_get_ip6_config (dev); + if (!ip6_config) + continue; + + req = nm_device_get_act_request (dev); + g_assert (req); + connection = nm_act_request_get_connection (req); + g_assert (connection); + + /* Never set the default route through an IPv4LL-addressed device */ + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) + method = nm_setting_ip6_config_get_method (s_ip6); + + if (method && !strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) + continue; + + /* Make sure at least one of this device's IP addresses has a gateway */ + for (i = 0; i < nm_ip6_config_get_num_addresses (ip6_config); i++) { + NMIP6Address *addr; + + addr = nm_ip6_config_get_address (ip6_config, i); + if (nm_ip6_address_get_gateway (addr)) { + can_default = TRUE; + break; + } + } + + if (!can_default && !NM_IS_DEVICE_MODEM (dev)) + continue; + + /* 'never-default' devices can't ever be the default */ + if (s_ip6 && nm_setting_ip6_config_get_never_default (s_ip6)) + continue; + + prio = nm_device_get_priority (dev); + if (prio > 0 && prio < best_prio) { + best = dev; + best_prio = prio; + *out_req = req; + } + } + + return best; +} + +static void +_set_hostname (const char *new_hostname, const char *msg) +{ + if (nm_policy_set_system_hostname (new_hostname, msg)) + nm_utils_call_dispatcher ("hostname", NULL, NULL, NULL); +} + +static void +lookup_callback (HostnameThread *thread, + int result, + const char *hostname, + gpointer user_data) +{ + NMPolicy *policy = (NMPolicy *) user_data; + char *msg; + + /* Update the hostname if the calling lookup thread is the in-progress one */ + if (!hostname_thread_is_dead (thread) && (thread == policy->lookup)) { + policy->lookup = NULL; + if (!hostname) { + /* No valid IP4 config (!!); fall back to localhost.localdomain */ + msg = g_strdup_printf ("address lookup failed: %d", result); + _set_hostname (NULL, msg); + g_free (msg); + } else + _set_hostname (hostname, "from address lookup"); + } + hostname_thread_free (thread); +} + +static void +update_system_hostname (NMPolicy *policy, NMDevice *best) +{ + char *configured_hostname = NULL; + NMActRequest *best_req = NULL; + NMDHCP4Config *dhcp4_config; + NMIP4Config *ip4_config; + NMIP4Address *addr; + + g_return_if_fail (policy != NULL); + + if (policy->lookup) { + hostname_thread_kill (policy->lookup); + policy->lookup = NULL; + } + + /* Hostname precedence order: + * + * 1) a configured hostname (from system-settings) + * 2) automatic hostname from the default device's config (DHCP, VPN, etc) + * 3) the original hostname when NM started + * 4) reverse-DNS of the best device's IPv4 address + * + */ + + /* Try a persistent hostname first */ + g_object_get (G_OBJECT (policy->manager), NM_MANAGER_HOSTNAME, &configured_hostname, NULL); + if (configured_hostname) { + _set_hostname (configured_hostname, "from system configuration"); + g_free (configured_hostname); + return; + } + + /* Try automatically determined hostname from the best device's IP config */ + if (!best) + best = get_best_ip4_device (policy->manager, &best_req); + + if (!best) { + /* No best device; fall back to original hostname or if there wasn't + * one, 'localhost.localdomain' + */ + _set_hostname (policy->orig_hostname, "no default device"); + return; + } + + /* Grab a hostname out of the device's DHCP4 config */ + dhcp4_config = nm_device_get_dhcp4_config (best); + if (dhcp4_config) { + const char *dhcp4_hostname, *p; + + p = dhcp4_hostname = nm_dhcp4_config_get_option (dhcp4_config, "host_name"); + if (dhcp4_hostname && strlen (dhcp4_hostname)) { + /* Sanity check */ + while (*p) { + if (!isblank (*p++)) { + _set_hostname (dhcp4_hostname, "from DHCP"); + return; + } + } + nm_log_warn (LOGD_DNS, "DHCP-provided hostname '%s' looks invalid; ignoring it", + dhcp4_hostname); + } + } + + /* If no automatically-configured hostname, try using the hostname from + * when NM started up. + */ + if (policy->orig_hostname) { + _set_hostname (policy->orig_hostname, "from system startup"); + return; + } + + /* No configured hostname, no automatically determined hostname, and + * no bootup hostname. Start reverse DNS of the current IP address. + */ + ip4_config = nm_device_get_ip4_config (best); + if ( !ip4_config + || (nm_ip4_config_get_num_nameservers (ip4_config) == 0) + || (nm_ip4_config_get_num_addresses (ip4_config) == 0)) { + /* No valid IP4 config (!!); fall back to localhost.localdomain */ + _set_hostname (NULL, "no IPv4 config"); + return; + } + + addr = nm_ip4_config_get_address (ip4_config, 0); + g_assert (addr); /* checked for > 1 address above */ + + /* Start the hostname lookup thread */ + policy->lookup = hostname_thread_new (nm_ip4_address_get_address (addr), lookup_callback, policy); + if (!policy->lookup) { + /* Fall back to 'localhost.localdomain' */ + _set_hostname (NULL, "error starting hostname thread"); + } +} + +static void +update_ip4_routing_and_dns (NMPolicy *policy, gboolean force_update) +{ + NMNamedIPConfigType dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + NMDevice *best = NULL; + NMActRequest *best_req = NULL; + NMNamedManager *named_mgr; + GSList *devices = NULL, *iter, *vpns; + NMIP4Config *ip4_config = NULL; + NMIP4Address *addr; + const char *ip_iface = NULL; + NMConnection *connection = NULL; + NMSettingConnection *s_con = NULL; + const char *connection_id; + + best = get_best_ip4_device (policy->manager, &best_req); + if (!best) + goto out; + if (!force_update && (best == policy->default_device4)) + goto out; + + /* If a VPN connection is active, it is preferred */ + vpns = nm_vpn_manager_get_active_connections (policy->vpn_manager); + for (iter = vpns; iter; iter = g_slist_next (iter)) { + NMVPNConnection *candidate = NM_VPN_CONNECTION (iter->data); + NMConnection *vpn_connection; + NMSettingIP4Config *s_ip4; + gboolean can_default = TRUE; + NMVPNConnectionState vpn_state; + + /* If it's marked 'never-default', don't make it default */ + vpn_connection = nm_vpn_connection_get_connection (candidate); + g_assert (vpn_connection); + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (vpn_connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4 && nm_setting_ip4_config_get_never_default (s_ip4)) + can_default = FALSE; + + vpn_state = nm_vpn_connection_get_vpn_state (candidate); + if (can_default && (vpn_state == NM_VPN_CONNECTION_STATE_ACTIVATED)) { + NMIP4Config *parent_ip4; + NMDevice *parent; + + ip_iface = nm_vpn_connection_get_ip_iface (candidate); + connection = nm_vpn_connection_get_connection (candidate); + ip4_config = nm_vpn_connection_get_ip4_config (candidate); + addr = nm_ip4_config_get_address (ip4_config, 0); + + parent = nm_vpn_connection_get_parent_device (candidate); + parent_ip4 = nm_device_get_ip4_config (parent); + + nm_system_replace_default_ip4_route_vpn (ip_iface, + nm_ip4_address_get_gateway (addr), + nm_vpn_connection_get_ip4_internal_gateway (candidate), + nm_ip4_config_get_mss (ip4_config), + nm_device_get_ip_iface (parent), + nm_ip4_config_get_mss (parent_ip4)); + + dns_type = NM_NAMED_IP_CONFIG_TYPE_VPN; + } + g_object_unref (candidate); + } + g_slist_free (vpns); + + /* The best device gets the default route if a VPN connection didn't */ + if (!ip_iface || !ip4_config) { + connection = nm_act_request_get_connection (best_req); + ip_iface = nm_device_get_ip_iface (best); + ip4_config = nm_device_get_ip4_config (best); + g_assert (ip4_config); + addr = nm_ip4_config_get_address (ip4_config, 0); + + nm_system_replace_default_ip4_route (ip_iface, nm_ip4_address_get_gateway (addr), nm_ip4_config_get_mss (ip4_config)); + + dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + } + + if (!ip_iface || !ip4_config) { + nm_log_warn (LOGD_CORE, "couldn't determine IP interface (%p) or IPv4 config (%p)!", + ip_iface, ip4_config); + goto out; + } + + /* Update the default active connection. Only mark the new default + * active connection after setting default = FALSE on all other connections + * first. The order is important, we don't want two connections marked + * default at the same time ever. + */ + devices = nm_manager_get_devices (policy->manager); + for (iter = devices; iter; iter = g_slist_next (iter)) { + NMDevice *dev = NM_DEVICE (iter->data); + NMActRequest *req; + + req = nm_device_get_act_request (dev); + if (req && (req != best_req)) + nm_act_request_set_default (req, FALSE); + } + + named_mgr = nm_named_manager_get (); + nm_named_manager_add_ip4_config (named_mgr, ip_iface, ip4_config, dns_type); + g_object_unref (named_mgr); + + /* Now set new default active connection _after_ updating DNS info, so that + * if the connection is shared dnsmasq picks up the right stuff. + */ + if (best_req) + nm_act_request_set_default (best_req, TRUE); + + if (connection) + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + + connection_id = s_con ? nm_setting_connection_get_id (s_con) : NULL; + if (connection_id) { + nm_log_info (LOGD_CORE, "Policy set '%s' (%s) as default for IPv4 routing and DNS.", connection_id, ip_iface); + } else { + nm_log_info (LOGD_CORE, "Policy set (%s) as default for IPv4 routing and DNS.", ip_iface); + } + +out: + policy->default_device4 = best; +} + +static void +update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update) +{ + NMNamedIPConfigType dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + NMDevice *best = NULL; + NMActRequest *best_req = NULL; + NMNamedManager *named_mgr; + GSList *devices = NULL, *iter; +#if NOT_YET + GSList *vpns; +#endif + NMIP6Config *ip6_config = NULL; + NMIP6Address *addr; + const char *ip_iface = NULL; + NMConnection *connection = NULL; + NMSettingConnection *s_con = NULL; + const char *connection_id; + + best = get_best_ip6_device (policy->manager, &best_req); + if (!best) + goto out; + if (!force_update && (best == policy->default_device6)) + goto out; + +#if NOT_YET + /* If a VPN connection is active, it is preferred */ + vpns = nm_vpn_manager_get_active_connections (policy->vpn_manager); + for (iter = vpns; iter; iter = g_slist_next (iter)) { + NMVPNConnection *candidate = NM_VPN_CONNECTION (iter->data); + NMConnection *vpn_connection; + NMSettingIP6Config *s_ip6; + gboolean can_default = TRUE; + NMVPNConnectionState vpn_state; + + /* If it's marked 'never-default', don't make it default */ + vpn_connection = nm_vpn_connection_get_connection (candidate); + g_assert (vpn_connection); + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (vpn_connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6 && nm_setting_ip6_config_get_never_default (s_ip6)) + can_default = FALSE; + + vpn_state = nm_vpn_connection_get_vpn_state (candidate); + if (can_default && (vpn_state == NM_VPN_CONNECTION_STATE_ACTIVATED)) { + NMIP6Config *parent_ip6; + NMDevice *parent; + + ip_iface = nm_vpn_connection_get_ip_iface (candidate); + connection = nm_vpn_connection_get_connection (candidate); + ip6_config = nm_vpn_connection_get_ip6_config (candidate); + addr = nm_ip6_config_get_address (ip6_config, 0); + + parent = nm_vpn_connection_get_parent_device (candidate); + parent_ip6 = nm_device_get_ip6_config (parent); + + nm_system_replace_default_ip6_route_vpn (ip_iface, + nm_ip6_address_get_gateway (addr), + nm_vpn_connection_get_ip4_internal_gateway (candidate), + nm_ip6_config_get_mss (ip4_config), + nm_device_get_ip_iface (parent), + nm_ip6_config_get_mss (parent_ip4)); + + dns_type = NM_NAMED_IP_CONFIG_TYPE_VPN; + } + g_object_unref (candidate); + } + g_slist_free (vpns); +#endif + + /* The best device gets the default route if a VPN connection didn't */ + if (!ip_iface || !ip6_config) { + connection = nm_act_request_get_connection (best_req); + ip_iface = nm_device_get_ip_iface (best); + ip6_config = nm_device_get_ip6_config (best); + g_assert (ip6_config); + addr = nm_ip6_config_get_address (ip6_config, 0); + + nm_system_replace_default_ip6_route (ip_iface, nm_ip6_address_get_gateway (addr)); + + dns_type = NM_NAMED_IP_CONFIG_TYPE_BEST_DEVICE; + } + + if (!ip_iface || !ip6_config) { + nm_log_warn (LOGD_CORE, "couldn't determine IP interface (%p) or IPv6 config (%p)!", + ip_iface, ip6_config); + goto out; + } + + /* Update the default active connection. Only mark the new default + * active connection after setting default = FALSE on all other connections + * first. The order is important, we don't want two connections marked + * default at the same time ever. + */ + devices = nm_manager_get_devices (policy->manager); + for (iter = devices; iter; iter = g_slist_next (iter)) { + NMDevice *dev = NM_DEVICE (iter->data); + NMActRequest *req; + + req = nm_device_get_act_request (dev); + if (req && (req != best_req)) + nm_act_request_set_default6 (req, FALSE); + } + + named_mgr = nm_named_manager_get (); + nm_named_manager_add_ip6_config (named_mgr, ip_iface, ip6_config, dns_type); + g_object_unref (named_mgr); + + /* Now set new default active connection _after_ updating DNS info, so that + * if the connection is shared dnsmasq picks up the right stuff. + */ + if (best_req) + nm_act_request_set_default6 (best_req, TRUE); + + if (connection) + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + + connection_id = s_con ? nm_setting_connection_get_id (s_con) : NULL; + if (connection_id) { + nm_log_info (LOGD_CORE, "Policy set '%s' (%s) as default for IPv6 routing and DNS.", connection_id, ip_iface); + } else { + nm_log_info (LOGD_CORE, "Policy set (%s) as default for IPv6 routing and DNS.", ip_iface); + } + +out: + policy->default_device6 = best; +} + +static void +update_routing_and_dns (NMPolicy *policy, gboolean force_update) +{ + update_ip4_routing_and_dns (policy, force_update); + update_ip6_routing_and_dns (policy, force_update); + + /* Update the system hostname */ + update_system_hostname (policy, policy->default_device4); +} + +typedef struct { + NMPolicy *policy; + NMDevice *device; + guint id; +} ActivateData; + +static gboolean +auto_activate_device (gpointer user_data) +{ + ActivateData *data = (ActivateData *) user_data; + NMPolicy *policy; + NMConnection *best_connection; + char *specific_object = NULL; + GSList *connections, *iter; + + g_assert (data); + policy = data->policy; + + // FIXME: if a device is already activating (or activated) with a connection + // but another connection now overrides the current one for that device, + // deactivate the device and activate the new connection instead of just + // bailing if the device is already active + if (nm_device_get_act_request (data->device)) + goto out; + + /* System connections first, then user connections */ + connections = nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_SYSTEM); + connections = g_slist_concat (connections, nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_USER)); + + /* Remove connections that are in the invalid list. */ + iter = connections; + while (iter) { + NMConnection *iter_connection = NM_CONNECTION (iter->data); + GSList *next = g_slist_next (iter); + + if (g_object_get_data (G_OBJECT (iter_connection), INVALID_TAG)) { + connections = g_slist_remove_link (connections, iter); + g_object_unref (iter_connection); + g_slist_free (iter); + } + iter = next; + } + + best_connection = nm_device_get_best_auto_connection (data->device, connections, &specific_object); + if (best_connection) { + GError *error = NULL; + const char *device_path; + + device_path = nm_device_get_path (data->device); + if (!nm_manager_activate_connection (policy->manager, + best_connection, + specific_object, + device_path, + FALSE, + &error)) { + NMSettingConnection *s_con; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (best_connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + nm_log_info (LOGD_DEVICE, "Connection '%s' auto-activation failed: (%d) %s", + nm_setting_connection_get_id (s_con), error->code, error->message); + g_error_free (error); + } + } + + g_slist_foreach (connections, (GFunc) g_object_unref, NULL); + g_slist_free (connections); + + out: + /* Remove this call's handler ID */ + policy->pending_activation_checks = g_slist_remove (policy->pending_activation_checks, data); + g_object_unref (data->device); + g_free (data); + + return FALSE; +} + +/*****************************************************************************/ + +static void +vpn_connection_activated (NMVPNManager *manager, + NMVPNConnection *vpn, + gpointer user_data) +{ + update_routing_and_dns ((NMPolicy *) user_data, TRUE); +} + +static void +vpn_connection_deactivated (NMVPNManager *manager, + NMVPNConnection *vpn, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason, + gpointer user_data) +{ + update_routing_and_dns ((NMPolicy *) user_data, TRUE); +} + +static void +global_state_changed (NMManager *manager, NMState state, gpointer user_data) +{ +} + +static void +hostname_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data) +{ + update_system_hostname ((NMPolicy *) user_data, NULL); +} + +static void +sleeping_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data) +{ + gboolean sleeping = FALSE, enabled = FALSE; + GSList *connections, *iter; + + g_object_get (G_OBJECT (manager), NM_MANAGER_SLEEPING, &sleeping, NULL); + g_object_get (G_OBJECT (manager), NM_MANAGER_NETWORKING_ENABLED, &enabled, NULL); + + /* Clear the invalid flag on all connections so they'll get retried on wakeup */ + if (sleeping || !enabled) { + connections = nm_manager_get_connections (manager, NM_CONNECTION_SCOPE_SYSTEM); + connections = g_slist_concat (connections, nm_manager_get_connections (manager, NM_CONNECTION_SCOPE_USER)); + for (iter = connections; iter; iter = g_slist_next (iter)) + g_object_set_data (G_OBJECT (iter->data), INVALID_TAG, NULL); + g_slist_free (connections); + } +} + +static void +schedule_activate_check (NMPolicy *policy, NMDevice *device, guint delay_seconds) +{ + ActivateData *data; + GSList *iter; + NMDeviceState state; + + if (nm_manager_get_state (policy->manager) == NM_STATE_ASLEEP) + return; + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (device)); + if (state < NM_DEVICE_STATE_DISCONNECTED) + return; + + if (!nm_device_autoconnect_allowed (device)) + return; + + for (iter = policy->pending_activation_checks; iter; iter = g_slist_next (iter)) { + /* Only one pending activation check at a time */ + if (((ActivateData *) iter->data)->device == device) + return; + } + + data = g_malloc0 (sizeof (ActivateData)); + g_return_if_fail (data != NULL); + + data->policy = policy; + data->device = g_object_ref (device); + data->id = delay_seconds ? g_timeout_add_seconds (delay_seconds, auto_activate_device, data) : g_idle_add (auto_activate_device, data); + policy->pending_activation_checks = g_slist_append (policy->pending_activation_checks, data); +} + +static NMConnection * +get_device_connection (NMDevice *device) +{ + NMActRequest *req; + + req = nm_device_get_act_request (device); + if (!req) + return NULL; + + return nm_act_request_get_connection (req); +} + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMPolicy *policy = (NMPolicy *) user_data; + NMConnection *connection = get_device_connection (device); + + switch (new_state) { + case NM_DEVICE_STATE_FAILED: + /* Mark the connection invalid if it failed during activation so that + * it doesn't get automatically chosen over and over and over again. + */ + if (connection) { + gboolean fail = FALSE; + + if (IS_ACTIVATING_STATE (old_state)) { + nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); + fail = TRUE; + } else if ( (old_state == NM_DEVICE_STATE_ACTIVATED) + && (reason == NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED)) { + nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid because IP configuration expired.", + get_connection_id (connection)); + fail = TRUE; + } + + if (fail) { + g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); + nm_connection_clear_secrets (connection); + } + } + schedule_activate_check (policy, device, 3); + break; + case NM_DEVICE_STATE_ACTIVATED: + if (connection) { + /* Clear the invalid tag on the connection */ + g_object_set_data (G_OBJECT (connection), INVALID_TAG, NULL); + + /* And clear secrets so they will always be requested from the + * settings service when the next connection is made. + */ + nm_connection_clear_secrets (connection); + } + + update_routing_and_dns (policy, FALSE); + break; + case NM_DEVICE_STATE_UNMANAGED: + case NM_DEVICE_STATE_UNAVAILABLE: + case NM_DEVICE_STATE_DISCONNECTED: + update_routing_and_dns (policy, FALSE); + schedule_activate_check (policy, device, 0); + break; + default: + break; + } +} + +static void +device_ip_config_changed (NMDevice *device, + GParamSpec *pspec, + gpointer user_data) +{ + update_routing_and_dns ((NMPolicy *) user_data, TRUE); +} + +static void +wireless_networks_changed (NMDeviceWifi *device, NMAccessPoint *ap, gpointer user_data) +{ + schedule_activate_check ((NMPolicy *) user_data, NM_DEVICE (device), 0); +} + +typedef struct { + gulong id; + NMDevice *device; +} DeviceSignalID; + +static GSList * +add_device_signal_id (GSList *list, gulong id, NMDevice *device) +{ + DeviceSignalID *data; + + data = g_malloc0 (sizeof (DeviceSignalID)); + if (!data) + return list; + + data->id = id; + data->device = device; + return g_slist_append (list, data); +} + +static void +device_added (NMManager *manager, NMDevice *device, gpointer user_data) +{ + NMPolicy *policy = (NMPolicy *) user_data; + gulong id; + + id = g_signal_connect (device, "state-changed", + G_CALLBACK (device_state_changed), + policy); + policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device); + + id = g_signal_connect (device, "notify::" NM_DEVICE_INTERFACE_IP4_CONFIG, + G_CALLBACK (device_ip_config_changed), + policy); + policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device); + + id = g_signal_connect (device, "notify::" NM_DEVICE_INTERFACE_IP6_CONFIG, + G_CALLBACK (device_ip_config_changed), + policy); + policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device); + + if (NM_IS_DEVICE_WIFI (device)) { + id = g_signal_connect (device, "access-point-added", + G_CALLBACK (wireless_networks_changed), + policy); + policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device); + + id = g_signal_connect (device, "access-point-removed", + G_CALLBACK (wireless_networks_changed), + policy); + policy->dev_signal_ids = add_device_signal_id (policy->dev_signal_ids, id, device); + } +} + +static void +device_removed (NMManager *manager, NMDevice *device, gpointer user_data) +{ + NMPolicy *policy = (NMPolicy *) user_data; + GSList *iter; + + /* Clear any idle callbacks for this device */ + iter = policy->pending_activation_checks; + while (iter) { + ActivateData *data = (ActivateData *) iter->data; + GSList *next = g_slist_next (iter); + + if (data->device == device) { + g_source_remove (data->id); + g_object_unref (data->device); + g_free (data); + policy->pending_activation_checks = g_slist_delete_link (policy->pending_activation_checks, iter); + } + iter = next; + } + + /* Clear any signal handlers for this device */ + iter = policy->dev_signal_ids; + while (iter) { + DeviceSignalID *data = (DeviceSignalID *) iter->data; + GSList *next = g_slist_next (iter); + + if (data->device == device) { + g_signal_handler_disconnect (data->device, data->id); + g_free (data); + policy->dev_signal_ids = g_slist_delete_link (policy->dev_signal_ids, iter); + } + iter = next; + } + + update_routing_and_dns (policy, FALSE); +} + +static void +schedule_activate_all (NMPolicy *policy) +{ + GSList *iter, *devices; + + devices = nm_manager_get_devices (policy->manager); + for (iter = devices; iter; iter = g_slist_next (iter)) + schedule_activate_check (policy, NM_DEVICE (iter->data), 0); +} + +static void +connections_added (NMManager *manager, + NMConnectionScope scope, + gpointer user_data) +{ + schedule_activate_all ((NMPolicy *) user_data); +} + +static void +connection_added (NMManager *manager, + NMConnection *connection, + NMConnectionScope scope, + gpointer user_data) +{ + schedule_activate_all ((NMPolicy *) user_data); +} + +static void +connection_updated (NMManager *manager, + NMConnection *connection, + NMConnectionScope scope, + gpointer user_data) +{ + /* Clear the invalid tag on the connection if it got updated. */ + g_object_set_data (G_OBJECT (connection), INVALID_TAG, NULL); + + schedule_activate_all ((NMPolicy *) user_data); +} + +static void +connection_removed (NMManager *manager, + NMConnection *connection, + NMConnectionScope scope, + gpointer user_data) +{ + NMSettingConnection *s_con; + GPtrArray *list; + int i; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + if (!s_con) + return; + + list = nm_manager_get_active_connections_by_connection (manager, connection); + if (!list) + return; + + for (i = 0; i < list->len; i++) { + char *path = g_ptr_array_index (list, i); + GError *error = NULL; + + if (!nm_manager_deactivate_connection (manager, path, NM_DEVICE_STATE_REASON_CONNECTION_REMOVED, &error)) { + nm_log_warn (LOGD_DEVICE, "Connection '%s' disappeared, but error deactivating it: (%d) %s", + nm_setting_connection_get_id (s_con), error->code, error->message); + g_error_free (error); + } + g_free (path); + } + g_ptr_array_free (list, TRUE); +} + +NMPolicy * +nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager) +{ + NMPolicy *policy; + static gboolean initialized = FALSE; + gulong id; + char hostname[HOST_NAME_MAX + 2]; + + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + g_return_val_if_fail (initialized == FALSE, NULL); + + policy = g_malloc0 (sizeof (NMPolicy)); + policy->manager = g_object_ref (manager); + policy->update_state_id = 0; + + /* Grab hostname on startup and use that if nothing provides one */ + memset (hostname, 0, sizeof (hostname)); + if (gethostname (&hostname[0], HOST_NAME_MAX) == 0) { + /* only cache it if it's a valid hostname */ + if (strlen (hostname) && strcmp (hostname, "localhost") && strcmp (hostname, "localhost.localdomain")) + policy->orig_hostname = g_strdup (hostname); + } + + policy->vpn_manager = g_object_ref (vpn_manager); + id = g_signal_connect (policy->vpn_manager, "connection-activated", + G_CALLBACK (vpn_connection_activated), policy); + policy->vpn_activated_id = id; + id = g_signal_connect (policy->vpn_manager, "connection-deactivated", + G_CALLBACK (vpn_connection_deactivated), policy); + policy->vpn_deactivated_id = id; + + id = g_signal_connect (manager, "state-changed", + G_CALLBACK (global_state_changed), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + id = g_signal_connect (manager, "notify::" NM_MANAGER_HOSTNAME, + G_CALLBACK (hostname_changed), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + id = g_signal_connect (manager, "notify::" NM_MANAGER_SLEEPING, + G_CALLBACK (sleeping_changed), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + id = g_signal_connect (manager, "notify::" NM_MANAGER_NETWORKING_ENABLED, + G_CALLBACK (sleeping_changed), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + id = g_signal_connect (manager, "device-added", + G_CALLBACK (device_added), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + id = g_signal_connect (manager, "device-removed", + G_CALLBACK (device_removed), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + /* Large batch of connections added, manager doesn't want us to + * process each one individually. + */ + id = g_signal_connect (manager, "connections-added", + G_CALLBACK (connections_added), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + /* Single connection added */ + id = g_signal_connect (manager, "connection-added", + G_CALLBACK (connection_added), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + id = g_signal_connect (manager, "connection-updated", + G_CALLBACK (connection_updated), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + id = g_signal_connect (manager, "connection-removed", + G_CALLBACK (connection_removed), policy); + policy->signal_ids = g_slist_append (policy->signal_ids, (gpointer) id); + + return policy; +} + +void +nm_policy_destroy (NMPolicy *policy) +{ + GSList *iter; + + g_return_if_fail (policy != NULL); + + /* Tell any existing hostname lookup thread to die, it'll get cleaned up + * by the lookup thread callback. + */ + if (policy->lookup) { + hostname_thread_kill (policy->lookup); + policy->lookup = NULL; + } + + for (iter = policy->pending_activation_checks; iter; iter = g_slist_next (iter)) { + ActivateData *data = (ActivateData *) iter->data; + + g_source_remove (data->id); + g_object_unref (data->device); + g_free (data); + } + g_slist_free (policy->pending_activation_checks); + + g_signal_handler_disconnect (policy->vpn_manager, policy->vpn_activated_id); + g_signal_handler_disconnect (policy->vpn_manager, policy->vpn_deactivated_id); + + for (iter = policy->signal_ids; iter; iter = g_slist_next (iter)) + g_signal_handler_disconnect (policy->manager, (gulong) iter->data); + g_slist_free (policy->signal_ids); + + for (iter = policy->dev_signal_ids; iter; iter = g_slist_next (iter)) { + DeviceSignalID *data = (DeviceSignalID *) iter->data; + + g_signal_handler_disconnect (data->device, data->id); + g_free (data); + } + g_slist_free (policy->dev_signal_ids); + + g_free (policy->orig_hostname); + + g_object_unref (policy->manager); + g_free (policy); +} + diff --git a/src/nm-policy.h b/src/nm-policy.h new file mode 100644 index 00000000..7d99613c --- /dev/null +++ b/src/nm-policy.h @@ -0,0 +1,36 @@ +/* -*- 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 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#ifndef NETWORK_MANAGER_POLICY_H +#define NETWORK_MANAGER_POLICY_H + +#include "NetworkManager.h" +#include "nm-manager.h" +#include "nm-vpn-manager.h" +#include "nm-device.h" +#include "nm-activation-request.h" + +typedef struct NMPolicy NMPolicy; + +NMPolicy *nm_policy_new (NMManager *manager, NMVPNManager *vpn_manager); +void nm_policy_destroy (NMPolicy *policy); + +#endif /* NETWORK_MANAGER_POLICY_H */ diff --git a/src/nm-properties-changed-signal.c b/src/nm-properties-changed-signal.c new file mode 100644 index 00000000..4a9db8af --- /dev/null +++ b/src/nm-properties-changed-signal.c @@ -0,0 +1,201 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include +#include + +#include +#include "nm-properties-changed-signal.h" +#include "nm-dbus-glib-types.h" + +#define NM_DBUS_PROPERTY_CHANGED "NM_DBUS_PROPERTY_CHANGED" + +typedef struct { + GHashTable *hash; + gulong signal_id; + guint idle_id; +} PropertiesChangedInfo; + +static void +destroy_value (gpointer data) +{ + GValue *val = (GValue *) data; + + g_value_unset (val); + g_slice_free (GValue, val); +} + +static PropertiesChangedInfo * +properties_changed_info_new (void) +{ + PropertiesChangedInfo *info; + + info = g_slice_new0 (PropertiesChangedInfo); + info->hash = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + destroy_value); + return info; +} + +static void +properties_changed_info_destroy (gpointer data) +{ + PropertiesChangedInfo *info = (PropertiesChangedInfo *) data; + + if (info->idle_id) + g_source_remove (info->idle_id); + + g_hash_table_destroy (info->hash); + g_slice_free (PropertiesChangedInfo, info); +} + +#ifdef DEBUG +static void +add_to_string (gpointer key, gpointer value, gpointer user_data) +{ + char *buf = (char *) user_data; + GValue str_val = { 0, }; + + g_value_init (&str_val, G_TYPE_STRING); + if (!g_value_transform ((GValue *) value, &str_val)) { + if (G_VALUE_HOLDS_OBJECT (value)) { + GObject *obj = g_value_get_object (value); + + if (g_value_get_object (value)) { + sprintf (buf + strlen (buf), "{%s: %p (%s)}, ", + (const char *) key, obj, G_OBJECT_TYPE_NAME (obj)); + } else { + sprintf (buf + strlen (buf), "{%s: %p}, ", (const char *) key, obj); + } + } else + sprintf (buf + strlen (buf), "{%s: }, ", (const char *) key); + } else { + sprintf (buf + strlen (buf), "{%s: %s}, ", (const char *) key, g_value_get_string (&str_val)); + } + g_value_unset (&str_val); +} +#endif + +static gboolean +properties_changed (gpointer data) +{ + GObject *object = G_OBJECT (data); + PropertiesChangedInfo *info = (PropertiesChangedInfo *) g_object_get_data (object, NM_DBUS_PROPERTY_CHANGED); + + g_assert (info); + +#ifdef DEBUG + { + char buf[2048] = { 0, }; + g_hash_table_foreach (info->hash, add_to_string, &buf); + nm_log_dbg (LOGD_CORE, "%s -> %s", G_OBJECT_TYPE_NAME (object), buf); + } +#endif + + g_signal_emit (object, info->signal_id, 0, info->hash); + g_hash_table_remove_all (info->hash); + + return FALSE; +} + +static void +idle_id_reset (gpointer data) +{ + GObject *object = G_OBJECT (data); + PropertiesChangedInfo *info = (PropertiesChangedInfo *) g_object_get_data (object, NM_DBUS_PROPERTY_CHANGED); + + /* info is unset when the object is being destroyed */ + if (info) + info->idle_id = 0; +} + +static char* +uscore_to_wincaps (const char *uscore) +{ + const char *p; + GString *str; + gboolean last_was_uscore; + + last_was_uscore = TRUE; + + str = g_string_new (NULL); + p = uscore; + while (p && *p) { + if (*p == '-' || *p == '_') + last_was_uscore = TRUE; + else { + if (last_was_uscore) { + g_string_append_c (str, g_ascii_toupper (*p)); + last_was_uscore = FALSE; + } else + g_string_append_c (str, *p); + } + ++p; + } + + return g_string_free (str, FALSE); +} + +static void +notify (GObject *object, GParamSpec *pspec) +{ + PropertiesChangedInfo *info; + GValue *value; + + /* Ignore properties that shouldn't be exported */ + if (pspec->flags & NM_PROPERTY_PARAM_NO_EXPORT) + return; + + info = (PropertiesChangedInfo *) g_object_get_data (object, NM_DBUS_PROPERTY_CHANGED); + if (!info) { + info = properties_changed_info_new (); + g_object_set_data_full (object, NM_DBUS_PROPERTY_CHANGED, info, properties_changed_info_destroy); + info->signal_id = g_signal_lookup ("properties-changed", G_OBJECT_TYPE (object)); + g_assert (info->signal_id); + } + + value = g_slice_new0 (GValue); + g_value_init (value, pspec->value_type); + g_object_get_property (object, pspec->name, value); + g_hash_table_insert (info->hash, uscore_to_wincaps (pspec->name), value); + + if (!info->idle_id) + info->idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, properties_changed, object, idle_id_reset); +} + +guint +nm_properties_changed_signal_new (GObjectClass *object_class, + guint class_offset) +{ + guint id; + + object_class->notify = notify; + + id = g_signal_new ("properties-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + class_offset, + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, DBUS_TYPE_G_MAP_OF_VARIANT); + + return id; +} diff --git a/src/nm-properties-changed-signal.h b/src/nm-properties-changed-signal.h new file mode 100644 index 00000000..b87e34e1 --- /dev/null +++ b/src/nm-properties-changed-signal.h @@ -0,0 +1,32 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef _NM_PROPERTIES_CHANGED_SIGNAL_H_ +#define _NM_PROPERTIES_CHANGED_SIGNAL_H_ + +#include + +#define NM_PROPERTY_PARAM_NO_EXPORT (1 << (0 + G_PARAM_USER_SHIFT)) + +guint nm_properties_changed_signal_new (GObjectClass *object_class, + guint class_offset); + +#endif /* _NM_PROPERTIES_CHANGED_SIGNAL_H_ */ diff --git a/src/nm-rfkill.h b/src/nm-rfkill.h new file mode 100644 index 00000000..d3cd7774 --- /dev/null +++ b/src/nm-rfkill.h @@ -0,0 +1,45 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_RFKILL_H +#define NM_RFKILL_H + +typedef enum { + RFKILL_UNBLOCKED = 0, + RFKILL_SOFT_BLOCKED = 1, + RFKILL_HARD_BLOCKED = 2 +} RfKillState; + +typedef enum { + RFKILL_TYPE_WLAN = 0, + RFKILL_TYPE_WWAN = 1, + RFKILL_TYPE_WIMAX = 2, + + /* UNKNOWN and MAX should always be 1 more than + * the last rfkill type since RFKILL_TYPE_MAX is + * used as an array size. + */ + RFKILL_TYPE_UNKNOWN = 3, /* KEEP LAST */ + RFKILL_TYPE_MAX = RFKILL_TYPE_UNKNOWN +} RfKillType; + +#endif /* NM_RFKILL_H */ + diff --git a/src/nm-secrets-provider-interface.c b/src/nm-secrets-provider-interface.c new file mode 100644 index 00000000..47b8e57e --- /dev/null +++ b/src/nm-secrets-provider-interface.c @@ -0,0 +1,224 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#include + +#include "nm-marshal.h" +#include "nm-secrets-provider-interface.h" + +#include +#include +#include "nm-logging.h" + +static void +nm_secrets_provider_interface_init (gpointer g_iface) +{ + GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); + static gboolean initialized = FALSE; + + if (initialized) + return; + initialized = TRUE; + + /* Signals */ + g_signal_new ("manager-get-secrets", + iface_type, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSecretsProviderInterface, manager_get_secrets), + NULL, NULL, + _nm_marshal_BOOLEAN__POINTER_STRING_BOOLEAN_UINT_STRING_STRING, + G_TYPE_BOOLEAN, 6, + G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); + + g_signal_new ("manager-cancel-secrets", + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSecretsProviderInterface, manager_cancel_secrets), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + + +GType +nm_secrets_provider_interface_get_type (void) +{ + static GType interface_type = 0; + + if (!interface_type) { + const GTypeInfo interface_info = { + sizeof (NMSecretsProviderInterface), /* class_size */ + nm_secrets_provider_interface_init, /* base_init */ + NULL, /* base_finalize */ + NULL, + NULL, /* class_finalize */ + NULL, /* class_data */ + 0, + 0, /* n_preallocs */ + NULL + }; + + interface_type = g_type_register_static (G_TYPE_INTERFACE, + "NMSecretsProviderInterface", + &interface_info, 0); + + g_type_interface_add_prerequisite (interface_type, G_TYPE_OBJECT); + } + + return interface_type; +} + +gboolean +nm_secrets_provider_interface_get_secrets (NMSecretsProviderInterface *self, + NMConnection *connection, + const char *setting_name, + gboolean request_new, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2) +{ + guint success = FALSE; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_SECRETS_PROVIDER_INTERFACE (self), FALSE); + g_return_val_if_fail (connection != NULL, FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + g_return_val_if_fail (setting_name != NULL, FALSE); + + nm_secrets_provider_interface_cancel_get_secrets (self); + + g_signal_emit_by_name (self, "manager-get-secrets", + connection, setting_name, request_new, caller, hint1, hint2, + &success); + if (!success) { + nm_log_warn (LOGD_CORE, "failed to get connection secrets."); + return FALSE; + } + + return TRUE; +} + +void +nm_secrets_provider_interface_cancel_get_secrets (NMSecretsProviderInterface *self) +{ + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_SECRETS_PROVIDER_INTERFACE (self)); + + g_signal_emit_by_name (self, "manager-cancel-secrets"); +} + + +static void +add_one_key_to_list (gpointer key, gpointer data, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + + *list = g_slist_append (*list, key); +} + +static gint +settings_order_func (gconstpointer a, gconstpointer b) +{ + /* Just ensure the 802.1x setting gets processed _before_ the + * wireless-security one. + */ + + if ( !strcmp (a, NM_SETTING_802_1X_SETTING_NAME) + && !strcmp (b, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME)) + return -1; + + if ( !strcmp (a, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) + && !strcmp (b, NM_SETTING_802_1X_SETTING_NAME)) + return 1; + + return 0; +} + +void +nm_secrets_provider_interface_get_secrets_result (NMSecretsProviderInterface *self, + const char *setting_name, + RequestSecretsCaller caller, + GHashTable *settings, + GError *error) +{ + GSList *keys = NULL, *iter; + GSList *updated = NULL; + GError *tmp_error = NULL; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_SECRETS_PROVIDER_INTERFACE (self)); + + if (error) { + NM_SECRETS_PROVIDER_INTERFACE_GET_INTERFACE (self)->result (self, + setting_name, + caller, + NULL, + error); + return; + } + + if (g_hash_table_size (settings) == 0) { + g_set_error (&tmp_error, 0, 0, "%s", "no secrets were received!"); + NM_SECRETS_PROVIDER_INTERFACE_GET_INTERFACE (self)->result (self, + setting_name, + caller, + NULL, + tmp_error); + g_clear_error (&tmp_error); + return; + } + + g_hash_table_foreach (settings, add_one_key_to_list, &keys); + keys = g_slist_sort (keys, settings_order_func); + for (iter = keys; iter; iter = g_slist_next (iter)) { + GHashTable *hash; + const char *name = (const char *) iter->data; + + hash = g_hash_table_lookup (settings, name); + if (!hash) { + nm_log_warn (LOGD_CORE, "couldn't get setting secrets for '%s'", name); + continue; + } + + if (NM_SECRETS_PROVIDER_INTERFACE_GET_INTERFACE (self)->update_setting (self, name, hash)) + updated = g_slist_append (updated, (gpointer) setting_name); + } + g_slist_free (keys); + + if (g_slist_length (updated)) { + NM_SECRETS_PROVIDER_INTERFACE_GET_INTERFACE (self)->result (self, + setting_name, + caller, + updated, + NULL); + } else { + g_set_error (&tmp_error, 0, 0, "%s", "no secrets updated because no valid " + "settings were received!"); + NM_SECRETS_PROVIDER_INTERFACE_GET_INTERFACE (self)->result (self, + setting_name, + caller, + NULL, + tmp_error); + g_clear_error (&tmp_error); + } + + g_slist_free (updated); +} + diff --git a/src/nm-secrets-provider-interface.h b/src/nm-secrets-provider-interface.h new file mode 100644 index 00000000..3d9e08b1 --- /dev/null +++ b/src/nm-secrets-provider-interface.h @@ -0,0 +1,90 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#ifndef NM_SECRETS_PROVIDER_INTERFACE_H +#define NM_SECRETS_PROVIDER_INTERFACE_H + +#include +#include + +typedef enum { + SECRETS_CALLER_NONE = 0, + SECRETS_CALLER_ETHERNET, + SECRETS_CALLER_WIFI, + SECRETS_CALLER_MOBILE_BROADBAND, + SECRETS_CALLER_PPP, + SECRETS_CALLER_VPN +} RequestSecretsCaller; + +#define NM_TYPE_SECRETS_PROVIDER_INTERFACE (nm_secrets_provider_interface_get_type ()) +#define NM_SECRETS_PROVIDER_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SECRETS_PROVIDER_INTERFACE, NMSecretsProviderInterface)) +#define NM_IS_SECRETS_PROVIDER_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SECRETS_PROVIDER_INTERFACE)) +#define NM_SECRETS_PROVIDER_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SECRETS_PROVIDER_INTERFACE, NMSecretsProviderInterface)) + +typedef struct _NMSecretsProviderInterface NMSecretsProviderInterface; + +struct _NMSecretsProviderInterface { + GTypeInterface g_iface; + + /* Methods */ + void (*result) (NMSecretsProviderInterface *self, + const char *setting_name, + RequestSecretsCaller caller, + const GSList *updated, + GError *error); + + gboolean (*update_setting) (NMSecretsProviderInterface *self, + const char *setting_name, + GHashTable *new); + + /* Signals */ + void (*manager_get_secrets) (NMSecretsProviderInterface *self, + NMConnection *connection, + const char *setting_name, + gboolean request_new, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2); + + void (*manager_cancel_secrets) (NMSecretsProviderInterface *self); +}; + +GType nm_secrets_provider_interface_get_type (void); + +/* For callers */ +gboolean nm_secrets_provider_interface_get_secrets (NMSecretsProviderInterface *self, + NMConnection *connection, + const char *setting_name, + gboolean request_new, + RequestSecretsCaller caller, + const char *hint1, + const char *hint2); + +void nm_secrets_provider_interface_cancel_get_secrets (NMSecretsProviderInterface *self); + +/* For NMManager */ +void nm_secrets_provider_interface_get_secrets_result (NMSecretsProviderInterface *self, + const char *setting_name, + RequestSecretsCaller caller, + GHashTable *settings, + GError *error); + +#endif /* NM_SECRETS_PROVIDER_INTERFACE_H */ + diff --git a/src/nm-system.c b/src/nm-system.c new file mode 100644 index 00000000..35aa36a1 --- /dev/null +++ b/src/nm-system.c @@ -0,0 +1,1347 @@ +/* -*- 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 - 2010 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + * Copyright (C) 1996 - 1997 Yoichi Hariguchi + * Copyright (C) January, 1998 Sergei Viznyuk + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-system.h" +#include "nm-device.h" +#include "nm-named-manager.h" +#include "NetworkManagerUtils.h" +#include "nm-utils.h" +#include "nm-logging.h" +#include "nm-netlink-monitor.h" + +/* Because of a bug in libnl, rtnl.h should be included before route.h */ +#include + +#include +#include +#include +#include +#include + +static void nm_system_device_set_priority (const char *iface, + NMIP4Config *config, + int priority); + +static gboolean +ip4_dest_in_same_subnet (NMIP4Config *config, guint32 dest, guint32 dest_prefix) +{ + int num; + int i; + + num = nm_ip4_config_get_num_addresses (config); + for (i = 0; i < num; i++) { + NMIP4Address *addr = nm_ip4_config_get_address (config, i); + guint32 prefix = nm_ip4_address_get_prefix (addr); + guint32 address = nm_ip4_address_get_address (addr); + + if (prefix <= dest_prefix) { + guint32 masked_addr = ntohl(address) >> (32 - prefix); + guint32 masked_dest = ntohl(dest) >> (32 - prefix); + + if (masked_addr == masked_dest) + return TRUE; + } + } + + return FALSE; +} + +static struct rtnl_route * +create_route (int iface_idx, int mss) +{ + struct rtnl_route *route; + + route = rtnl_route_alloc (); + if (route) { + rtnl_route_set_oif (route, iface_idx); + + if (mss && rtnl_route_set_metric (route, RTAX_ADVMSS, mss) < 0) { + nm_log_warn (LOGD_DEVICE, "could not set mss"); + } + } else + nm_log_err (LOGD_DEVICE, "could not allocate route"); + + return route; +} + +static struct rtnl_route * +nm_system_device_set_ip4_route (const char *iface, + guint32 ip4_dest, + guint32 ip4_prefix, + guint32 ip4_gateway, + guint32 metric, + int mss) +{ + struct nl_handle *nlh; + struct rtnl_route *route; + struct nl_addr *dest_addr; + struct nl_addr *gw_addr = NULL; + int err, iface_idx; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, NULL); + + iface_idx = nm_netlink_iface_to_index (iface); + g_return_val_if_fail (iface_idx >= 0, NULL); + + route = create_route (iface_idx, mss); + g_return_val_if_fail (route != NULL, NULL); + + /* Destination */ + dest_addr = nl_addr_build (AF_INET, &ip4_dest, sizeof (ip4_dest)); + g_return_val_if_fail (dest_addr != NULL, NULL); + nl_addr_set_prefixlen (dest_addr, (int) ip4_prefix); + + rtnl_route_set_dst (route, dest_addr); + nl_addr_put (dest_addr); + + /* Gateway */ + if (ip4_gateway) { + gw_addr = nl_addr_build (AF_INET, &ip4_gateway, sizeof (ip4_gateway)); + if (gw_addr) { + rtnl_route_set_gateway (route, gw_addr); + rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); + } else { + nm_log_err (LOGD_DEVICE | LOGD_IP4, "Invalid gateway 0x%X", ip4_gateway); + rtnl_route_put (route); + return NULL; + } + } + + /* Metric */ + if (metric) + rtnl_route_set_prio (route, metric); + + /* Add the route */ + err = rtnl_route_add (nlh, route, 0); + if (err == -ESRCH && ip4_gateway) { + /* Gateway might be over a bridge; try adding a route to gateway first */ + struct rtnl_route *route2; + + route2 = create_route (iface_idx, mss); + if (route2) { + /* Add route to gateway over bridge */ + rtnl_route_set_dst (route2, gw_addr); + err = rtnl_route_add (nlh, route2, 0); + if (!err) { + /* Try adding the route again */ + err = rtnl_route_add (nlh, route, 0); + if (err) + rtnl_route_del (nlh, route2, 0); + } + rtnl_route_put (route2); + } + } + + if (gw_addr) + nl_addr_put (gw_addr); + + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 route: %s", + iface, nl_geterror ()); + rtnl_route_put (route); + route = NULL; + } + + return route; +} + +static gboolean +sync_addresses (const char *iface, int ifindex, int family, + struct rtnl_addr **addrs, int num_addrs) +{ + struct nl_handle *nlh; + struct nl_cache *addr_cache; + struct rtnl_addr *filter_addr, *match_addr; + struct nl_object *match; + struct nl_addr *nladdr; + int i, err; + guint32 log_domain = (family == AF_INET) ? LOGD_IP4 : LOGD_IP6; + char buf[INET6_ADDRSTRLEN + 1]; + + log_domain |= LOGD_DEVICE; + + nlh = nm_netlink_get_default_handle (); + if (!nlh) + return FALSE; + + addr_cache = rtnl_addr_alloc_cache (nlh); + if (!addr_cache) + return FALSE; + + filter_addr = rtnl_addr_alloc (); + if (!filter_addr) { + nl_cache_free (addr_cache); + return FALSE; + } + rtnl_addr_set_ifindex (filter_addr, ifindex); + if (family) + rtnl_addr_set_family (filter_addr, family); + + nm_log_dbg (log_domain, "(%s): syncing addresses (family %d)", iface, family); + + /* Walk through the cache, comparing the addresses already on + * the interface to the addresses in addrs. + */ + for (match = nl_cache_get_first (addr_cache); match; match = nl_cache_get_next (match)) { + gboolean buf_valid = FALSE; + match_addr = (struct rtnl_addr *) match; + + /* Skip addresses not on our interface */ + if (!nl_object_match_filter (match, (struct nl_object *) filter_addr)) + continue; + + if (addrs) { + for (i = 0; i < num_addrs; i++) { + if (addrs[i] && nl_object_identical (match, (struct nl_object *) addrs[i])) + break; + } + + if (addrs[i]) { + /* match == addrs[i], so remove it from addrs so we don't + * try to add it to the interface again below. + */ + rtnl_addr_put (addrs[i]); + addrs[i] = NULL; + continue; + } + } + + nladdr = rtnl_addr_get_local (match_addr); + + /* Don't delete IPv6 link-local addresses; they don't belong to NM */ + if (rtnl_addr_get_family (match_addr) == AF_INET6) { + struct in6_addr *tmp; + + if (rtnl_addr_get_scope (match_addr) == RT_SCOPE_LINK) { + nm_log_dbg (log_domain, "(%s): ignoring IPv6 link-local address", iface); + continue; + } + + tmp = nl_addr_get_binary_addr (nladdr); + if (inet_ntop (AF_INET6, tmp, buf, sizeof (buf))) + buf_valid = TRUE; + } else if (rtnl_addr_get_family (match_addr) == AF_INET) { + struct in_addr *tmp; + + tmp = nl_addr_get_binary_addr (nladdr); + if (inet_ntop (AF_INET, tmp, buf, sizeof (buf))) + buf_valid = TRUE; + } + + if (buf_valid) { + nm_log_dbg (log_domain, "(%s): removing address '%s/%d'", + iface, buf, nl_addr_get_prefixlen (nladdr)); + } + + /* Otherwise, match_addr should be removed from the interface. */ + err = rtnl_addr_delete (nlh, match_addr, 0); + if (err < 0) { + nm_log_err (log_domain, "(%s): error %d returned from rtnl_addr_delete(): %s", + iface, err, nl_geterror ()); + } + } + + rtnl_addr_put (filter_addr); + nl_cache_free (addr_cache); + + /* Now add the remaining new addresses */ + for (i = 0; i < num_addrs; i++) { + struct in6_addr *in6tmp; + struct in_addr *in4tmp; + gboolean buf_valid = FALSE; + + if (!addrs[i]) + continue; + + nladdr = rtnl_addr_get_local (addrs[i]); + if (rtnl_addr_get_family (addrs[i]) == AF_INET6) { + in6tmp = nl_addr_get_binary_addr (nladdr); + if (inet_ntop (AF_INET6, in6tmp, buf, sizeof (buf))) + buf_valid = TRUE; + } else if (rtnl_addr_get_family (addrs[i]) == AF_INET) { + in4tmp = nl_addr_get_binary_addr (nladdr); + if (inet_ntop (AF_INET, in4tmp, buf, sizeof (buf))) + buf_valid = TRUE; + } + + if (buf_valid) { + nm_log_dbg (log_domain, "(%s): adding address '%s/%d'", + iface, buf, nl_addr_get_prefixlen (nladdr)); + } + + err = rtnl_addr_add (nlh, addrs[i], 0); + if (err < 0) { + nm_log_err (log_domain, + "(%s): error %d returned from rtnl_addr_add():\n%s", + iface, err, nl_geterror ()); + } + + rtnl_addr_put (addrs[i]); + } + g_free (addrs); + + return TRUE; +} + +static gboolean +add_ip4_addresses (NMIP4Config *config, const char *iface) +{ + int num_addrs, i, iface_idx; + guint32 flags = 0; + gboolean did_gw = FALSE; + struct rtnl_addr **addrs; + + iface_idx = nm_netlink_iface_to_index (iface); + + num_addrs = nm_ip4_config_get_num_addresses (config); + addrs = g_new0 (struct rtnl_addr *, num_addrs + 1); + + for (i = 0; i < num_addrs; i++) { + NMIP4Address *addr; + + addr = nm_ip4_config_get_address (config, i); + g_assert (addr); + + flags = NM_RTNL_ADDR_DEFAULT; + if (nm_ip4_address_get_gateway (addr) && !did_gw) { + if (nm_ip4_config_get_ptp_address (config)) + flags |= NM_RTNL_ADDR_PTP_ADDR; + did_gw = TRUE; + } + + addrs[i] = nm_ip4_config_to_rtnl_addr (config, i, flags); + if (!addrs[i]) { + nm_log_warn (LOGD_DEVICE | LOGD_IP4, + "(%s): couldn't create rtnl address!", + iface); + continue; + } + rtnl_addr_set_ifindex (addrs[i], iface_idx); + } + + return sync_addresses (iface, iface_idx, AF_INET, addrs, num_addrs); +} + +struct rtnl_route * +nm_system_add_ip4_vpn_gateway_route (NMDevice *parent_device, NMIP4Config *vpn_config) +{ + NMIP4Config *parent_config; + guint32 parent_gw = 0, parent_prefix = 0, vpn_gw = 0, i; + NMIP4Address *tmp; + struct rtnl_route *route = NULL; + + g_return_val_if_fail (NM_IS_DEVICE (parent_device), NULL); + + /* Set up a route to the VPN gateway's public IP address through the default + * network device if the VPN gateway is on a different subnet. + */ + + parent_config = nm_device_get_ip4_config (parent_device); + g_return_val_if_fail (parent_config != NULL, NULL); + + for (i = 0; i < nm_ip4_config_get_num_addresses (parent_config); i++) { + tmp = nm_ip4_config_get_address (parent_config, i); + if (nm_ip4_address_get_gateway (tmp)) { + parent_gw = nm_ip4_address_get_gateway (tmp); + parent_prefix = nm_ip4_address_get_prefix (tmp); + break; + } + } + + for (i = 0; i < nm_ip4_config_get_num_addresses (vpn_config); i++) { + tmp = nm_ip4_config_get_address (vpn_config, i); + if (nm_ip4_address_get_gateway (tmp)) { + vpn_gw = nm_ip4_address_get_gateway (tmp); + break; + } + } + + if (!parent_gw || !vpn_gw) + return NULL; + + /* If the VPN gateway is in the same subnet as one of the parent device's + * IP addresses, don't add the host route to it, but a route through the + * parent device. + */ + if (ip4_dest_in_same_subnet (parent_config, vpn_gw, parent_prefix)) { + route = nm_system_device_set_ip4_route (nm_device_get_ip_iface (parent_device), + vpn_gw, 32, 0, 0, nm_ip4_config_get_mss (parent_config)); + } else { + route = nm_system_device_set_ip4_route (nm_device_get_ip_iface (parent_device), + vpn_gw, 32, parent_gw, 0, nm_ip4_config_get_mss (parent_config)); + } + + return route; +} + +/* + * nm_system_apply_ip4_config + * + * Set IPv4 configuration of the device from an NMIP4Config object. + * + */ +gboolean +nm_system_apply_ip4_config (const char *iface, + NMIP4Config *config, + int priority, + NMIP4ConfigCompareFlags flags) +{ + int i; + + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + if (flags & NM_IP4_COMPARE_FLAG_ADDRESSES) { + if (!add_ip4_addresses (config, iface)) + return FALSE; + sleep (1); + } + + if (flags & NM_IP4_COMPARE_FLAG_ROUTES) { + for (i = 0; i < nm_ip4_config_get_num_routes (config); i++) { + NMIP4Route *route = nm_ip4_config_get_route (config, i); + struct rtnl_route *tmp; + + /* Don't add the route if it's more specific than one of the subnets + * the device already has an IP address on. + */ + if (ip4_dest_in_same_subnet (config, + nm_ip4_route_get_dest (route), + nm_ip4_route_get_prefix (route))) + continue; + + /* Don't add the route if it doesn't have a gateway and the connection + * is never supposed to be the default connection. + */ + if ( nm_ip4_config_get_never_default (config) + && nm_ip4_route_get_dest (route) == 0) + continue; + + tmp = nm_system_device_set_ip4_route (iface, + nm_ip4_route_get_dest (route), + nm_ip4_route_get_prefix (route), + nm_ip4_route_get_next_hop (route), + nm_ip4_route_get_metric (route), + nm_ip4_config_get_mss (config)); + rtnl_route_put (tmp); + } + } + + if (flags & NM_IP4_COMPARE_FLAG_MTU) { + if (nm_ip4_config_get_mtu (config)) + nm_system_device_set_mtu (iface, nm_ip4_config_get_mtu (config)); + } + + if (priority > 0) + nm_system_device_set_priority (iface, config, priority); + + return TRUE; +} + +static struct rtnl_route * +nm_system_device_set_ip6_route (const char *iface, + const struct in6_addr *ip6_dest, + guint32 ip6_prefix, + const struct in6_addr *ip6_gateway, + guint32 metric, + int mss) +{ + struct nl_handle *nlh; + struct rtnl_route *route; + struct nl_addr *dest_addr; + struct nl_addr *gw_addr = NULL; + int err, iface_idx; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, NULL); + + iface_idx = nm_netlink_iface_to_index (iface); + g_return_val_if_fail (iface_idx >= 0, NULL); + + route = create_route (iface_idx, mss); + g_return_val_if_fail (route != NULL, NULL); + + /* Destination */ + dest_addr = nl_addr_build (AF_INET6, (struct in6_addr *) ip6_dest, sizeof (*ip6_dest)); + g_return_val_if_fail (dest_addr != NULL, NULL); + nl_addr_set_prefixlen (dest_addr, (int) ip6_prefix); + + rtnl_route_set_dst (route, dest_addr); + nl_addr_put (dest_addr); + + /* Gateway */ + if (ip6_gateway && !IN6_IS_ADDR_UNSPECIFIED (ip6_gateway)) { + gw_addr = nl_addr_build (AF_INET6, (struct in6_addr *) ip6_gateway, sizeof (*ip6_gateway)); + if (gw_addr) { + rtnl_route_set_gateway (route, gw_addr); + rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); + } else { + nm_log_warn (LOGD_DEVICE | LOGD_IP6, "Invalid gateway"); + rtnl_route_put (route); + return NULL; + } + } + + /* Metric */ + if (metric) + rtnl_route_set_prio (route, metric); + + /* Add the route */ + err = rtnl_route_add (nlh, route, 0); + if (err == -ESRCH && ip6_gateway) { + /* Gateway might be over a bridge; try adding a route to gateway first */ + struct rtnl_route *route2; + + route2 = create_route (iface_idx, mss); + if (route2) { + /* Add route to gateway over bridge */ + rtnl_route_set_dst (route2, gw_addr); + err = rtnl_route_add (nlh, route2, 0); + if (!err) { + /* Try adding the route again */ + err = rtnl_route_add (nlh, route, 0); + if (err) + rtnl_route_del (nlh, route2, 0); + } + rtnl_route_put (route2); + } + } + + if (gw_addr) + nl_addr_put (gw_addr); + + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to set IPv6 route: %s", + iface, nl_geterror ()); + rtnl_route_put (route); + route = NULL; + } + + return route; +} + +static gboolean +add_ip6_addresses (NMIP6Config *config, const char *iface) +{ + int num_addrs, i, iface_idx; + struct rtnl_addr **addrs; + + iface_idx = nm_netlink_iface_to_index (iface); + + num_addrs = nm_ip6_config_get_num_addresses (config); + addrs = g_new0 (struct rtnl_addr *, num_addrs + 1); + + for (i = 0; i < num_addrs; i++) { + NMIP6Address *addr; + + addr = nm_ip6_config_get_address (config, i); + g_assert (addr); + + addrs[i] = nm_ip6_config_to_rtnl_addr (config, i, NM_RTNL_ADDR_DEFAULT); + if (!addrs[i]) { + nm_log_warn (LOGD_DEVICE | LOGD_IP6, + "(%s): couldn't create rtnl address!", + iface); + continue; + } + rtnl_addr_set_ifindex (addrs[i], iface_idx); + } + + return sync_addresses (iface, iface_idx, AF_INET6, addrs, num_addrs); +} + +/* + * nm_system_apply_ip6_config + * + * Set IPv6 configuration of the device from an NMIP6Config object. + * + */ +gboolean +nm_system_apply_ip6_config (const char *iface, + NMIP6Config *config, + int priority, + NMIP6ConfigCompareFlags flags) +{ + int i; + + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (config != NULL, FALSE); + + if (flags & NM_IP6_COMPARE_FLAG_ADDRESSES) { + if (!add_ip6_addresses (config, iface)) + return FALSE; + sleep (1); // FIXME? + } + + if (flags & NM_IP6_COMPARE_FLAG_ROUTES) { + for (i = 0; i < nm_ip6_config_get_num_routes (config); i++) { + NMIP6Route *route = nm_ip6_config_get_route (config, i); + struct rtnl_route *tmp; + + /* Don't add the route if it doesn't have a gateway and the connection + * is never supposed to be the default connection. + */ + if ( nm_ip6_config_get_never_default (config) + && IN6_IS_ADDR_UNSPECIFIED(nm_ip6_route_get_dest (route))) + continue; + + tmp = nm_system_device_set_ip6_route (iface, + nm_ip6_route_get_dest (route), + nm_ip6_route_get_prefix (route), + nm_ip6_route_get_next_hop (route), + nm_ip6_route_get_metric (route), + nm_ip6_config_get_mss (config)); + rtnl_route_put (tmp); + } + } + +// FIXME +// if (priority > 0) +// nm_system_device_set_priority (iface, config, priority); + + return TRUE; +} + +/* + * nm_system_device_set_up_down + * + * Mark the device as up or down. + * + */ +gboolean +nm_system_device_set_up_down (NMDevice *dev, + gboolean up, + gboolean *no_firmware) +{ + g_return_val_if_fail (dev != NULL, FALSE); + + return nm_system_device_set_up_down_with_iface (nm_device_get_ip_iface (dev), up, no_firmware); +} + +gboolean +nm_system_device_set_up_down_with_iface (const char *iface, + gboolean up, + gboolean *no_firmware) +{ + struct rtnl_link *request = NULL, *old = NULL; + struct nl_handle *nlh; + gboolean success = FALSE; + guint32 idx; + + g_return_val_if_fail (iface != NULL, FALSE); + if (no_firmware) + g_return_val_if_fail (*no_firmware == FALSE, FALSE); + + if (!(request = rtnl_link_alloc ())) + goto out; + + if (up) + rtnl_link_set_flags (request, IFF_UP); + else + rtnl_link_unset_flags (request, IFF_UP); + + idx = nm_netlink_iface_to_index (iface); + old = nm_netlink_index_to_rtnl_link (idx); + if (old) { + nlh = nm_netlink_get_default_handle (); + if (nlh) { + if (rtnl_link_change (nlh, old, request, 0) == 0) + success = TRUE; + else if ((nl_get_errno () == ENOENT) && no_firmware && up) + *no_firmware = TRUE; + } + } + + rtnl_link_put (old); + rtnl_link_put (request); + +out: + return success; +} + +gboolean +nm_system_device_is_up (NMDevice *device) +{ + g_return_val_if_fail (device != NULL, FALSE); + + return nm_system_device_is_up_with_iface (nm_device_get_ip_iface (device)); +} + +gboolean +nm_system_device_is_up_with_iface (const char *iface) +{ + struct ifreq ifr; + int fd; + gboolean up = FALSE; + + fd = socket (PF_INET, SOCK_DGRAM, 0); + if (fd < 0) { + nm_log_err (LOGD_HW, "couldn't open control socket."); + return FALSE; + } + + /* Get device's flags */ + memset (&ifr, 0, sizeof (ifr)); + strncpy (ifr.ifr_name, iface, IFNAMSIZ); + if (ioctl (fd, SIOCGIFFLAGS, &ifr) < 0) { + if (errno != ENODEV) { + nm_log_err (LOGD_HW, "(%s): could not get flags: errno %d", + iface, errno); + } + } else { + up = !!(ifr.ifr_flags & IFF_UP); + } + close (fd); + + return up; +} + +gboolean +nm_system_device_set_mtu (const char *iface, guint32 mtu) +{ + struct rtnl_link *old; + struct rtnl_link *new; + gboolean success = FALSE; + struct nl_handle *nlh; + int iface_idx; + + g_return_val_if_fail (iface != NULL, FALSE); + g_return_val_if_fail (mtu > 0, FALSE); + + new = rtnl_link_alloc (); + if (!new) + return FALSE; + + iface_idx = nm_netlink_iface_to_index (iface); + old = nm_netlink_index_to_rtnl_link (iface_idx); + if (old) { + rtnl_link_set_mtu (new, mtu); + nlh = nm_netlink_get_default_handle (); + if (nlh) { + rtnl_link_change (nlh, old, new, 0); + success = TRUE; + } + rtnl_link_put (old); + } + + rtnl_link_put (new); + return success; +} + +static struct rtnl_route * +add_ip4_route_to_gateway (const char *iface, guint32 gw, guint32 mss) +{ + struct nl_handle *nlh; + struct rtnl_route *route = NULL; + struct nl_addr *gw_addr = NULL; + int iface_idx, err; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, NULL); + + iface_idx = nm_netlink_iface_to_index (iface); + if (iface_idx < 0) + return NULL; + + /* Gateway might be over a bridge; try adding a route to gateway first */ + route = rtnl_route_alloc (); + if (route == NULL) + return NULL; + + rtnl_route_set_family (route, AF_INET); + rtnl_route_set_table (route, RT_TABLE_MAIN); + rtnl_route_set_oif (route, iface_idx); + rtnl_route_set_scope (route, RT_SCOPE_LINK); + + gw_addr = nl_addr_build (AF_INET, &gw, sizeof (gw)); + if (!gw_addr) + goto error; + nl_addr_set_prefixlen (gw_addr, 32); + rtnl_route_set_dst (route, gw_addr); + nl_addr_put (gw_addr); + + if (mss) { + if (rtnl_route_set_metric (route, RTAX_ADVMSS, mss) < 0) + goto error; + } + + /* Add direct route to the gateway */ + err = rtnl_route_add (nlh, route, 0); + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to add IPv4 route to gateway (%d)", + iface, err); + goto error; + } + + return route; + +error: + rtnl_route_put (route); + return NULL; +} + +static int +replace_default_ip4_route (const char *iface, guint32 gw, guint32 mss) +{ + struct rtnl_route *route = NULL; + struct nl_handle *nlh; + struct nl_addr *dst_addr = NULL; + guint32 dst = 0; + struct nl_addr *gw_addr = NULL; + int iface_idx, err = -1; + + g_return_val_if_fail (iface != NULL, -ENODEV); + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, -ENOMEM); + + iface_idx = nm_netlink_iface_to_index (iface); + if (iface_idx < 0) + return -ENODEV; + + route = rtnl_route_alloc(); + g_return_val_if_fail (route != NULL, -ENOMEM); + + rtnl_route_set_family (route, AF_INET); + rtnl_route_set_table (route, RT_TABLE_MAIN); + rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); + rtnl_route_set_oif (route, iface_idx); + + /* Build up the destination address */ + dst_addr = nl_addr_build (AF_INET, &dst, sizeof (dst)); + if (!dst_addr) { + err = -ENOMEM; + goto out; + } + nl_addr_set_prefixlen (dst_addr, 0); + rtnl_route_set_dst (route, dst_addr); + + /* Build up the gateway address */ + gw_addr = nl_addr_build (AF_INET, &gw, sizeof (gw)); + if (!gw_addr) { + err = -ENOMEM; + goto out; + } + nl_addr_set_prefixlen (gw_addr, 0); + rtnl_route_set_gateway (route, gw_addr); + + if (mss > 0) { + err = rtnl_route_set_metric (route, RTAX_ADVMSS, mss); + if (err < 0) + goto out; + } + + /* Add the new default route */ + err = rtnl_route_add (nlh, route, NLM_F_REPLACE); + +out: + if (dst_addr) + nl_addr_put (dst_addr); + if (gw_addr) + nl_addr_put (gw_addr); + rtnl_route_put (route); + return err; +} + +/* + * nm_system_replace_default_ip4_route_vpn + * + * Replace default IPv4 route with one via the current device + * + */ +gboolean +nm_system_replace_default_ip4_route_vpn (const char *iface, + guint32 ext_gw, + guint32 int_gw, + guint32 mss, + const char *parent_iface, + guint32 parent_mss) +{ + struct rtnl_route *gw_route = NULL; + struct nl_handle *nlh; + gboolean success = FALSE; + int err; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, FALSE); + + err = replace_default_ip4_route (iface, int_gw, mss); + if (err == 0) { + return TRUE; + } else if (err != -ESRCH) { + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 default route: %d", + iface, err); + return FALSE; + } + + /* Try adding a direct route to the gateway first */ + gw_route = add_ip4_route_to_gateway (parent_iface, ext_gw, parent_mss); + if (!gw_route) + return FALSE; + + /* Try adding the original route again */ + err = replace_default_ip4_route (iface, int_gw, mss); + if (err != 0) { + rtnl_route_del (nlh, gw_route, 0); + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 default route (pass #2): %d", + iface, err); + } else + success = TRUE; + + rtnl_route_put (gw_route); + return success; +} + +/* + * nm_system_replace_default_ip4_route + * + * Replace default IPv4 route with one via the current device + * + */ +gboolean +nm_system_replace_default_ip4_route (const char *iface, guint32 gw, guint32 mss) +{ + struct rtnl_route *gw_route = NULL; + struct nl_handle *nlh; + gboolean success = FALSE; + int err; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, FALSE); + + err = replace_default_ip4_route (iface, gw, mss); + if (err == 0) { + return TRUE; + } else if (err != -ESRCH) { + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 default route: %d", + iface, err); + return FALSE; + } + + /* Try adding a direct route to the gateway first */ + gw_route = add_ip4_route_to_gateway (iface, gw, mss); + if (!gw_route) + return FALSE; + + /* Try adding the original route again */ + err = replace_default_ip4_route (iface, gw, mss); + if (err != 0) { + rtnl_route_del (nlh, gw_route, 0); + nm_log_err (LOGD_DEVICE | LOGD_IP4, + "(%s): failed to set IPv4 default route (pass #2): %d", + iface, err); + } else + success = TRUE; + + rtnl_route_put (gw_route); + return success; +} + +static struct rtnl_route * +add_ip6_route_to_gateway (const char *iface, const struct in6_addr *gw) +{ + struct nl_handle *nlh; + struct rtnl_route *route = NULL; + struct nl_addr *gw_addr = NULL; + int iface_idx, err; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, NULL); + + iface_idx = nm_netlink_iface_to_index (iface); + if (iface_idx < 0) + return NULL; + + /* Gateway might be over a bridge; try adding a route to gateway first */ + route = rtnl_route_alloc (); + if (route == NULL) + return NULL; + + rtnl_route_set_family (route, AF_INET6); + rtnl_route_set_table (route, RT_TABLE_MAIN); + rtnl_route_set_oif (route, iface_idx); + rtnl_route_set_scope (route, RT_SCOPE_LINK); + + gw_addr = nl_addr_build (AF_INET, (void *) gw, sizeof (*gw)); + if (!gw_addr) + goto error; + nl_addr_set_prefixlen (gw_addr, 128); + rtnl_route_set_dst (route, gw_addr); + nl_addr_put (gw_addr); + + /* Add direct route to the gateway */ + err = rtnl_route_add (nlh, route, 0); + if (err) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to add IPv4 route to gateway (%d)", + iface, err); + goto error; + } + + return route; + +error: + rtnl_route_put (route); + return NULL; +} + +static int +replace_default_ip6_route (const char *iface, const struct in6_addr *gw) +{ + struct rtnl_route *route = NULL; + struct nl_handle *nlh; + struct nl_addr *gw_addr = NULL; + int iface_idx, err = -1; + + g_return_val_if_fail (iface != NULL, -ENODEV); + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, -ENOMEM); + + iface_idx = nm_netlink_iface_to_index (iface); + if (iface_idx < 0) + return -ENODEV; + + route = rtnl_route_alloc(); + g_return_val_if_fail (route != NULL, -ENOMEM); + + rtnl_route_set_family (route, AF_INET6); + rtnl_route_set_table (route, RT_TABLE_MAIN); + rtnl_route_set_scope (route, RT_SCOPE_UNIVERSE); + rtnl_route_set_oif (route, iface_idx); + + if (gw && !IN6_IS_ADDR_UNSPECIFIED (gw)) { + /* Build up the gateway address */ + gw_addr = nl_addr_build (AF_INET6, (void *) gw, sizeof (*gw)); + if (!gw_addr) { + err = -ENOMEM; + goto out; + } + nl_addr_set_prefixlen (gw_addr, -1); + rtnl_route_set_gateway (route, gw_addr); + } + + /* Add the new default route */ + err = rtnl_route_add (nlh, route, NLM_F_REPLACE); + if (err == -EEXIST) { + /* FIXME: even though we use NLM_F_REPLACE the kernel won't replace + * the route if it's the same. Should try to remove it first, then + * add the new one again here. + */ + err = 0; + } + +out: + if (gw_addr) + nl_addr_put (gw_addr); + rtnl_route_put (route); + return err; +} + +/* + * nm_system_replace_default_ip6_route + * + * Replace default IPv6 route with one via the given gateway + * + */ +gboolean +nm_system_replace_default_ip6_route (const char *iface, const struct in6_addr *gw) +{ + struct rtnl_route *gw_route = NULL; + struct nl_handle *nlh; + gboolean success = FALSE; + int err; + + nlh = nm_netlink_get_default_handle (); + g_return_val_if_fail (nlh != NULL, FALSE); + + err = replace_default_ip6_route (iface, gw); + if (err == 0) { + return TRUE; + } else if (err != -ESRCH) { + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to set IPv6 default route: %d", + iface, err); + return FALSE; + } + + /* Try adding a direct route to the gateway first */ + gw_route = add_ip6_route_to_gateway (iface, gw); + if (!gw_route) + return FALSE; + + /* Try adding the original route again */ + err = replace_default_ip6_route (iface, gw); + if (err != 0) { + rtnl_route_del (nlh, gw_route, 0); + nm_log_err (LOGD_DEVICE | LOGD_IP6, + "(%s): failed to set IPv6 default route (pass #2): %d", + iface, err); + } else + success = TRUE; + + rtnl_route_put (gw_route); + return success; +} + +static void flush_addresses (const char *iface, gboolean ipv4_only) +{ + int iface_idx; + + g_return_if_fail (iface != NULL); + iface_idx = nm_netlink_iface_to_index (iface); + if (iface_idx >= 0) + sync_addresses (iface, iface_idx, ipv4_only ? AF_INET : AF_UNSPEC, NULL, 0); +} + +/* + * nm_system_device_flush_addresses + * + * Flush all network addresses associated with a network device + * + */ +void nm_system_device_flush_addresses (NMDevice *dev) +{ + g_return_if_fail (dev != NULL); + + flush_addresses (nm_device_get_ip_iface (dev), + nm_device_get_ip6_config (dev) == NULL); +} + + +/* + * nm_system_device_flush_addresses_with_iface + * + * Flush all network addresses associated with a network device + * + */ +void nm_system_device_flush_addresses_with_iface (const char *iface) +{ + flush_addresses (iface, FALSE); +} + + +static void +foreach_route (void (*callback)(struct nl_object *, gpointer), + gpointer user_data) +{ + struct nl_handle *nlh; + struct nl_cache *route_cache; + + nlh = nm_netlink_get_default_handle (); + route_cache = rtnl_route_alloc_cache (nlh); + g_assert (route_cache); + nl_cache_foreach (route_cache, callback, user_data); + nl_cache_free (route_cache); +} + + +typedef struct { + const char *iface; + int iface_idx; + int family; +} RouteCheckData; + +static void +check_one_route (struct nl_object *object, void *user_data) +{ + RouteCheckData *data = (RouteCheckData *) user_data; + struct rtnl_route *route = (struct rtnl_route *) object; + int err; + + /* Delete all routes from this interface */ + if (rtnl_route_get_oif (route) != data->iface_idx) + return; + if (data->family && rtnl_route_get_family (route) != data->family) + return; + + /* We don't want to flush IPv6 link-local routes that may exist on the + * the interface since the LL address and routes should normally stay + * assigned all the time. + */ + if ( (data->family == AF_INET6 || data->family == AF_UNSPEC) + && (rtnl_route_get_family (route) == AF_INET6)) { + struct nl_addr *nl; + struct in6_addr *addr = NULL; + + nl = rtnl_route_get_dst (route); + if (nl) + addr = nl_addr_get_binary_addr (nl); + + if (addr) { + if (IN6_IS_ADDR_LINKLOCAL (addr) || IN6_IS_ADDR_MC_LINKLOCAL (addr)) + return; + } + } + + err = rtnl_route_del (nm_netlink_get_default_handle (), route, 0); + if (err < 0) { + nm_log_err (LOGD_DEVICE, + "(%s): error %d returned from rtnl_route_del(): %s", + data->iface, err, nl_geterror()); + } +} + +static void flush_routes (int ifindex, const char *iface, int family) +{ + RouteCheckData check_data; + + g_return_if_fail (iface != NULL); + + if (ifindex < 0) { + ifindex = nm_netlink_iface_to_index (iface); + if (ifindex < 0) { + nm_log_dbg (LOGD_DEVICE, "(%s) failed to lookup interface index", iface); + return; + } + } + + memset (&check_data, 0, sizeof (check_data)); + check_data.iface = iface; + check_data.iface_idx = ifindex; + check_data.family = family; + foreach_route (check_one_route, &check_data); +} + +/* + * nm_system_device_flush_routes + * + * Flush all network addresses associated with a network device + * + */ +void nm_system_device_flush_routes (NMDevice *dev, int family) +{ + g_return_if_fail (dev != NULL); + + flush_routes (nm_device_get_ip_ifindex (dev), + nm_device_get_ip_iface (dev), + family); +} + +/* + * nm_system_device_flush_routes_with_iface + * + * Flush all routes associated with a network device. 'family' is an + * address family, either AF_INET, AF_INET6, or AF_UNSPEC. + * + */ +void nm_system_device_flush_routes_with_iface (const char *iface, int family) +{ + flush_routes (-1, iface, family); +} + +typedef struct { + struct rtnl_route *route; + NMIP4Config *config; + int iface; +} SetPriorityInfo; + +static void +find_route (struct nl_object *object, gpointer user_data) +{ + struct rtnl_route *route = (struct rtnl_route *) object; + SetPriorityInfo *info = (SetPriorityInfo *) user_data; + struct nl_addr *dst; + struct in_addr *dst_addr; + int num; + int i; + + if (info->route || + rtnl_route_get_oif (route) != info->iface || + rtnl_route_get_scope (route) != RT_SCOPE_LINK) + return; + + dst = rtnl_route_get_dst (route); + if (nl_addr_get_family (dst) != AF_INET) + return; + + dst_addr = nl_addr_get_binary_addr (dst); + num = nm_ip4_config_get_num_addresses (info->config); + for (i = 0; i < num; i++) { + NMIP4Address *addr = nm_ip4_config_get_address (info->config, i); + guint32 prefix = nm_ip4_address_get_prefix (addr); + guint32 address = nm_ip4_address_get_address (addr); + + if (prefix == nl_addr_get_prefixlen (dst) && + (address & nm_utils_ip4_prefix_to_netmask (prefix)) == dst_addr->s_addr) { + + /* Ref the route so it sticks around after the cache is cleared */ + rtnl_route_get (route); + info->route = route; + break; + } + } +} + +static void +nm_system_device_set_priority (const char *iface, + NMIP4Config *config, + int priority) +{ + SetPriorityInfo info; + + info.route = NULL; + info.config = config; + info.iface = nm_netlink_iface_to_index (iface); + g_return_if_fail (info.iface >= 0); + + foreach_route (find_route, &info); + if (info.route) { + struct nl_handle *nlh; + + nlh = nm_netlink_get_default_handle (); + rtnl_route_del (nlh, info.route, 0); + + rtnl_route_set_prio (info.route, priority); + rtnl_route_add (nlh, info.route, 0); + rtnl_route_put (info.route); + } +} diff --git a/src/nm-system.h b/src/nm-system.h new file mode 100644 index 00000000..2eee0141 --- /dev/null +++ b/src/nm-system.h @@ -0,0 +1,84 @@ +/* -*- 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 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + */ + +#ifndef NETWORK_MANAGER_SYSTEM_H +#define NETWORK_MANAGER_SYSTEM_H + +#include +#include + +#include +#include "nm-device.h" +#include "nm-ip4-config.h" + +/* Prototypes for system/distribution dependent functions, + * implemented in the backend files in backends/ directory + */ + +void nm_system_device_flush_routes (NMDevice *dev, int family); +void nm_system_device_flush_routes_with_iface (const char *iface, int family); + +gboolean nm_system_replace_default_ip4_route (const char *iface, + guint32 gw, + guint32 mss); + +gboolean nm_system_replace_default_ip6_route (const char *iface, + const struct in6_addr *gw); + +gboolean nm_system_replace_default_ip4_route_vpn (const char *iface, + guint32 ext_gw, + guint32 int_gw, + guint32 mss, + const char *parent_iface, + guint32 parent_mss); + +struct rtnl_route *nm_system_add_ip4_vpn_gateway_route (NMDevice *parent_device, NMIP4Config *vpn_config); + + +void nm_system_device_flush_addresses (NMDevice *dev); +void nm_system_device_flush_addresses_with_iface (const char *iface); + +void nm_system_enable_loopback (void); +void nm_system_update_dns (void); + +gboolean nm_system_apply_ip4_config (const char *iface, + NMIP4Config *config, + int priority, + NMIP4ConfigCompareFlags flags); + +gboolean nm_system_apply_ip6_config (const char *iface, + NMIP6Config *config, + int priority, + NMIP6ConfigCompareFlags flags); + +gboolean nm_system_device_set_up_down (NMDevice *dev, + gboolean up, + gboolean *no_firmware); +gboolean nm_system_device_set_up_down_with_iface (const char *iface, + gboolean up, + gboolean *no_firmware); + +gboolean nm_system_device_is_up (NMDevice *device); +gboolean nm_system_device_is_up_with_iface (const char *iface); + +gboolean nm_system_device_set_mtu (const char *iface, guint32 mtu); + +#endif diff --git a/src/nm-udev-manager.c b/src/nm-udev-manager.c new file mode 100644 index 00000000..ff0ef68c --- /dev/null +++ b/src/nm-udev-manager.c @@ -0,0 +1,578 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "wireless-helper.h" + +#define G_UDEV_API_IS_SUBJECT_TO_CHANGE +#include + +#include "nm-udev-manager.h" +#include "nm-marshal.h" +#include "nm-logging.h" +#include "NetworkManagerUtils.h" +#include "nm-device-wifi.h" +#include "nm-device-olpc-mesh.h" +#include "nm-device-ethernet.h" + +typedef struct { + GUdevClient *client; + + /* Authoritative rfkill state (RFKILL_* enum) */ + RfKillState rfkill_states[RFKILL_TYPE_MAX]; + GSList *killswitches; + + gboolean disposed; +} NMUdevManagerPrivate; + +#define NM_UDEV_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_UDEV_MANAGER, NMUdevManagerPrivate)) + +G_DEFINE_TYPE (NMUdevManager, nm_udev_manager, G_TYPE_OBJECT) + +enum { + DEVICE_ADDED, + DEVICE_REMOVED, + RFKILL_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + +typedef struct { + char *name; + guint64 seqnum; + char *path; + char *driver; + RfKillType rtype; + gint state; +} Killswitch; + +RfKillState +nm_udev_manager_get_rfkill_state (NMUdevManager *self, RfKillType rtype) +{ + g_return_val_if_fail (self != NULL, RFKILL_UNBLOCKED); + g_return_val_if_fail (rtype < RFKILL_TYPE_MAX, RFKILL_UNBLOCKED); + + return NM_UDEV_MANAGER_GET_PRIVATE (self)->rfkill_states[rtype]; +} + +static const char * +rfkill_type_to_desc (RfKillType rtype) +{ + if (rtype == 0) + return "WiFi"; + else if (rtype == 1) + return "WWan"; + else if (rtype == 2) + return "WiMAX"; + return "unknown"; +} + +static const char * +rfkill_state_to_desc (RfKillState rstate) +{ + if (rstate == 0) + return "unblocked"; + else if (rstate == 1) + return "soft-blocked"; + else if (rstate == 2) + return "hard-blocked"; + return "unknown"; +} + +static Killswitch * +killswitch_new (GUdevDevice *device, RfKillType rtype) +{ + Killswitch *ks; + GUdevDevice *parent = NULL; + const char *driver; + + ks = g_malloc0 (sizeof (Killswitch)); + ks->name = g_strdup (g_udev_device_get_name (device)); + ks->seqnum = g_udev_device_get_seqnum (device); + ks->path = g_strdup (g_udev_device_get_sysfs_path (device)); + ks->rtype = rtype; + + driver = g_udev_device_get_property (device, "DRIVER"); + if (!driver) { + parent = g_udev_device_get_parent (device); + if (parent) + driver = g_udev_device_get_property (parent, "DRIVER"); + } + if (driver) + ks->driver = g_strdup (driver); + + if (parent) + g_object_unref (parent); + + return ks; +} + +static void +killswitch_destroy (Killswitch *ks) +{ + g_return_if_fail (ks != NULL); + + g_free (ks->name); + g_free (ks->path); + g_free (ks->driver); + memset (ks, 0, sizeof (Killswitch)); + g_free (ks); +} + +NMUdevManager * +nm_udev_manager_new (void) +{ + return NM_UDEV_MANAGER (g_object_new (NM_TYPE_UDEV_MANAGER, NULL)); +} + +static RfKillState +sysfs_state_to_nm_state (gint sysfs_state) +{ + switch (sysfs_state) { + case 0: + return RFKILL_SOFT_BLOCKED; + case 1: + return RFKILL_UNBLOCKED; + case 2: + return RFKILL_HARD_BLOCKED; + default: + nm_log_warn (LOGD_RFKILL, "unhandled rfkill state %d", sysfs_state); + break; + } + return RFKILL_UNBLOCKED; +} + +static void +recheck_killswitches (NMUdevManager *self) +{ + NMUdevManagerPrivate *priv = NM_UDEV_MANAGER_GET_PRIVATE (self); + GSList *iter; + RfKillState poll_states[RFKILL_TYPE_MAX]; + int i; + + /* Default state is unblocked */ + for (i = 0; i < RFKILL_TYPE_MAX; i++) + poll_states[i] = RFKILL_UNBLOCKED; + + for (iter = priv->killswitches; iter; iter = g_slist_next (iter)) { + Killswitch *ks = iter->data; + GUdevDevice *device; + RfKillState dev_state; + + device = g_udev_client_query_by_subsystem_and_name (priv->client, "rfkill", ks->name); + if (!device) + continue; + + dev_state = sysfs_state_to_nm_state (g_udev_device_get_property_as_int (device, "RFKILL_STATE")); + if (dev_state > poll_states[ks->rtype]) + poll_states[ks->rtype] = dev_state; + + g_object_unref (device); + } + + for (i = 0; i < RFKILL_TYPE_MAX; i++) { + if (poll_states[i] != priv->rfkill_states[i]) { + nm_log_dbg (LOGD_RFKILL, "%s rfkill state now '%s'", + rfkill_type_to_desc (i), + rfkill_state_to_desc (poll_states[i])); + + priv->rfkill_states[i] = poll_states[i]; + g_signal_emit (self, signals[RFKILL_CHANGED], 0, i, priv->rfkill_states[i]); + } + } +} + +static Killswitch * +killswitch_find_by_name (NMUdevManager *self, const char *name) +{ + NMUdevManagerPrivate *priv = NM_UDEV_MANAGER_GET_PRIVATE (self); + GSList *iter; + + g_return_val_if_fail (name != NULL, NULL); + + for (iter = priv->killswitches; iter; iter = g_slist_next (iter)) { + Killswitch *candidate = iter->data; + + if (!strcmp (name, candidate->name)) + return candidate; + } + return NULL; +} + +static const RfKillType +rfkill_type_to_enum (const char *str) +{ + g_return_val_if_fail (str != NULL, RFKILL_TYPE_UNKNOWN); + + if (!strcmp (str, "wlan")) + return RFKILL_TYPE_WLAN; + else if (!strcmp (str, "wwan")) + return RFKILL_TYPE_WWAN; + else if (!strcmp (str, "wimax")) + return RFKILL_TYPE_WIMAX; + + return RFKILL_TYPE_UNKNOWN; +} + +static void +add_one_killswitch (NMUdevManager *self, GUdevDevice *device) +{ + NMUdevManagerPrivate *priv = NM_UDEV_MANAGER_GET_PRIVATE (self); + const char *str_type; + RfKillType rtype; + Killswitch *ks; + + str_type = g_udev_device_get_property (device, "RFKILL_TYPE"); + rtype = rfkill_type_to_enum (str_type); + if (rtype == RFKILL_TYPE_UNKNOWN) + return; + + ks = killswitch_new (device, rtype); + priv->killswitches = g_slist_prepend (priv->killswitches, ks); + + nm_log_info (LOGD_RFKILL, "found %s radio killswitch %s (at %s) (driver %s)", + rfkill_type_to_desc (rtype), + ks->name, + ks->path, + ks->driver ? ks->driver : ""); +} + +static void +rfkill_add (NMUdevManager *self, GUdevDevice *device) +{ + const char *name; + + g_return_if_fail (device != NULL); + name = g_udev_device_get_name (device); + g_return_if_fail (name != NULL); + + if (!killswitch_find_by_name (self, name)) + add_one_killswitch (self, device); +} + +static void +rfkill_remove (NMUdevManager *self, + GUdevDevice *device) +{ + NMUdevManagerPrivate *priv = NM_UDEV_MANAGER_GET_PRIVATE (self); + GSList *iter; + const char *name; + + g_return_if_fail (device != NULL); + name = g_udev_device_get_name (device); + g_return_if_fail (name != NULL); + + for (iter = priv->killswitches; iter; iter = g_slist_next (iter)) { + Killswitch *ks = iter->data; + + if (!strcmp (ks->name, name)) { + nm_log_info (LOGD_RFKILL, "radio killswitch %s disappeared", ks->path); + priv->killswitches = g_slist_remove (priv->killswitches, ks); + killswitch_destroy (ks); + break; + } + } +} + +static gboolean +is_wireless (GUdevDevice *device) +{ + char phy80211_path[255]; + struct stat s; + int fd; + struct iwreq iwr; + const char *ifname, *path; + gboolean is_wifi = FALSE; + + ifname = g_udev_device_get_name (device); + g_assert (ifname); + + fd = socket (PF_INET, SOCK_DGRAM, 0); + strncpy (iwr.ifr_ifrn.ifrn_name, ifname, IFNAMSIZ); + + path = g_udev_device_get_sysfs_path (device); + snprintf (phy80211_path, sizeof (phy80211_path), "%s/phy80211", path); + + if ( (ioctl (fd, SIOCGIWNAME, &iwr) == 0) + || (stat (phy80211_path, &s) == 0 && (s.st_mode & S_IFDIR))) + is_wifi = TRUE; + + close (fd); + return is_wifi; +} + +static gboolean +is_olpc_mesh (GUdevDevice *device) +{ + const gchar *prop = g_udev_device_get_property (device, "ID_NM_OLPC_MESH"); + return (prop != NULL); +} + +static GObject * +device_creator (NMUdevManager *manager, + GUdevDevice *udev_device, + gboolean sleeping) +{ + GObject *device = NULL; + const char *ifname, *driver, *path, *subsys; + GUdevDevice *parent = NULL, *grandparent = NULL; + gint ifindex; + + ifname = g_udev_device_get_name (udev_device); + g_assert (ifname); + + path = g_udev_device_get_sysfs_path (udev_device); + if (!path) { + nm_log_warn (LOGD_HW, "couldn't determine device path; ignoring..."); + return NULL; + } + + driver = g_udev_device_get_driver (udev_device); + if (!driver) { + /* Try the parent */ + parent = g_udev_device_get_parent (udev_device); + if (parent) { + driver = g_udev_device_get_driver (parent); + if (!driver) { + /* try the grandparent only if it's an ibmebus device */ + subsys = g_udev_device_get_subsystem (parent); + if (subsys && !strcmp (subsys, "ibmebus")) { + grandparent = g_udev_device_get_parent (parent); + if (grandparent) + driver = g_udev_device_get_driver (grandparent); + } + } + } + } + + if (!driver) { + nm_log_warn (LOGD_HW, "%s: couldn't determine device driver; ignoring...", path); + goto out; + } + + ifindex = g_udev_device_get_sysfs_attr_as_int (udev_device, "ifindex"); + if (ifindex <= 0) { + nm_log_warn (LOGD_HW, "%s: device had invalid ifindex %d; ignoring...", path, (guint32) ifindex); + goto out; + } + + if (is_olpc_mesh (udev_device)) /* must be before is_wireless */ + device = (GObject *) nm_device_olpc_mesh_new (path, ifname, driver); + else if (is_wireless (udev_device)) + device = (GObject *) nm_device_wifi_new (path, ifname, driver); + else + device = (GObject *) nm_device_ethernet_new (path, ifname, driver); + +out: + if (grandparent) + g_object_unref (grandparent); + if (parent) + g_object_unref (parent); + return device; +} + +static void +net_add (NMUdevManager *self, GUdevDevice *device) +{ + gint etype; + const char *iface; + const char *devtype; + + g_return_if_fail (device != NULL); + + etype = g_udev_device_get_sysfs_attr_as_int (device, "type"); + if (etype != 1) { + nm_log_dbg (LOGD_HW, "ignoring interface with type %d", etype); + return; /* Not using ethernet encapsulation, don't care */ + } + + /* Not all ethernet devices are immediately usable; newer mobile broadband + * devices (Ericsson, Option, Sierra) require setup on the tty before the + * ethernet device is usable. 2.6.33 and later kernels set the 'DEVTYPE' + * uevent variable which we can use to ignore the interface as a NMDevice + * subclass. ModemManager will pick it up though and so we'll handle it + * through the mobile broadband stuff. + */ + devtype = g_udev_device_get_property (device, "DEVTYPE"); + if (devtype && !strcmp (devtype, "wwan")) { + nm_log_dbg (LOGD_HW, "ignoring interface with devtype '%s'", devtype); + return; + } + + iface = g_udev_device_get_name (device); + if (!iface) { + nm_log_dbg (LOGD_HW, "failed to get device's interface"); + return; + } + + g_signal_emit (self, signals[DEVICE_ADDED], 0, device, device_creator); +} + +static void +net_remove (NMUdevManager *self, GUdevDevice *device) +{ + g_signal_emit (self, signals[DEVICE_REMOVED], 0, device); +} + +void +nm_udev_manager_query_devices (NMUdevManager *self) +{ + NMUdevManagerPrivate *priv = NM_UDEV_MANAGER_GET_PRIVATE (self); + GList *devices, *iter; + + g_return_if_fail (self != NULL); + g_return_if_fail (NM_IS_UDEV_MANAGER (self)); + + devices = g_udev_client_query_by_subsystem (priv->client, "net"); + for (iter = devices; iter; iter = g_list_next (iter)) { + net_add (self, G_UDEV_DEVICE (iter->data)); + g_object_unref (G_UDEV_DEVICE (iter->data)); + } + g_list_free (devices); +} + +static void +handle_uevent (GUdevClient *client, + const char *action, + GUdevDevice *device, + gpointer user_data) +{ + NMUdevManager *self = NM_UDEV_MANAGER (user_data); + const char *subsys; + + g_return_if_fail (action != NULL); + + /* A bit paranoid */ + subsys = g_udev_device_get_subsystem (device); + g_return_if_fail (subsys != NULL); + + nm_log_dbg (LOGD_HW, "UDEV event: action '%s' subsys '%s' device '%s'", + action, subsys, g_udev_device_get_name (device)); + + g_return_if_fail (!strcmp (subsys, "rfkill") || !strcmp (subsys, "net")); + + if (!strcmp (action, "add")) { + if (!strcmp (subsys, "rfkill")) + rfkill_add (self, device); + else if (!strcmp (subsys, "net")) + net_add (self, device); + } else if (!strcmp (action, "remove")) { + if (!strcmp (subsys, "rfkill")) + rfkill_remove (self, device); + else if (!strcmp (subsys, "net")) + net_remove (self, device); + } + + recheck_killswitches (self); +} + +static void +nm_udev_manager_init (NMUdevManager *self) +{ + NMUdevManagerPrivate *priv = NM_UDEV_MANAGER_GET_PRIVATE (self); + const char *subsys[3] = { "rfkill", "net", NULL }; + GList *switches, *iter; + guint32 i; + + for (i = 0; i < RFKILL_TYPE_MAX; i++) + priv->rfkill_states[i] = RFKILL_UNBLOCKED; + + priv->client = g_udev_client_new (subsys); + g_signal_connect (priv->client, "uevent", G_CALLBACK (handle_uevent), self); + + switches = g_udev_client_query_by_subsystem (priv->client, "rfkill"); + for (iter = switches; iter; iter = g_list_next (iter)) { + add_one_killswitch (self, G_UDEV_DEVICE (iter->data)); + g_object_unref (G_UDEV_DEVICE (iter->data)); + } + g_list_free (switches); + + recheck_killswitches (self); +} + +static void +dispose (GObject *object) +{ + NMUdevManager *self = NM_UDEV_MANAGER (object); + NMUdevManagerPrivate *priv = NM_UDEV_MANAGER_GET_PRIVATE (self); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_udev_manager_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + g_object_unref (priv->client); + + g_slist_foreach (priv->killswitches, (GFunc) killswitch_destroy, NULL); + g_slist_free (priv->killswitches); + + G_OBJECT_CLASS (nm_udev_manager_parent_class)->dispose (object); +} + +static void +nm_udev_manager_class_init (NMUdevManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (NMUdevManagerPrivate)); + + /* virtual methods */ + object_class->dispose = dispose; + + /* Signals */ + signals[DEVICE_ADDED] = + g_signal_new ("device-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMUdevManagerClass, device_added), + NULL, NULL, + _nm_marshal_VOID__POINTER_POINTER, + G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER); + + signals[DEVICE_REMOVED] = + g_signal_new ("device-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMUdevManagerClass, device_removed), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + signals[RFKILL_CHANGED] = + g_signal_new ("rfkill-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMUdevManagerClass, rfkill_changed), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); +} + diff --git a/src/nm-udev-manager.h b/src/nm-udev-manager.h new file mode 100644 index 00000000..06a2d35c --- /dev/null +++ b/src/nm-udev-manager.h @@ -0,0 +1,72 @@ +/* -*- 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 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef NM_UDEV_MANAGER_H +#define NM_UDEV_MANAGER_H + +#include +#include + +#define G_UDEV_API_IS_SUBJECT_TO_CHANGE +#include + +#include "nm-rfkill.h" + +G_BEGIN_DECLS + +#define NM_TYPE_UDEV_MANAGER (nm_udev_manager_get_type ()) +#define NM_UDEV_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_UDEV_MANAGER, NMUdevManager)) +#define NM_UDEV_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_UDEV_MANAGER, NMUdevManagerClass)) +#define NM_IS_UDEV_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_UDEV_MANAGER)) +#define NM_IS_UDEV_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_UDEV_MANAGER)) +#define NM_UDEV_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_UDEV_MANAGER, NMUdevManagerClass)) + +typedef struct { + GObject parent; +} NMUdevManager; + +typedef GObject *(*NMDeviceCreatorFn) (NMUdevManager *manager, + GUdevDevice *device, + gboolean sleeping); + +typedef struct { + GObjectClass parent; + + /* Virtual functions */ + void (*device_added) (NMUdevManager *manager, + GUdevDevice *device, + NMDeviceCreatorFn creator_fn); + + void (*device_removed) (NMUdevManager *manager, GUdevDevice *device); + + void (*rfkill_changed) (NMUdevManager *manager, RfKillType rtype, RfKillState state); +} NMUdevManagerClass; + +GType nm_udev_manager_get_type (void); + +NMUdevManager *nm_udev_manager_new (void); + +void nm_udev_manager_query_devices (NMUdevManager *manager); + +RfKillState nm_udev_manager_get_rfkill_state (NMUdevManager *manager, RfKillType rtype); + +#endif /* NM_UDEV_MANAGER_H */ + diff --git a/src/nm-wifi-ap.c b/src/nm-wifi-ap.c new file mode 100644 index 00000000..c7b5d8a5 --- /dev/null +++ b/src/nm-wifi-ap.c @@ -0,0 +1,1477 @@ +/* -*- 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 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include "wireless-helper.h" + +#include + +#include "nm-wifi-ap.h" +#include "NetworkManagerUtils.h" +#include "nm-utils.h" +#include "nm-logging.h" +#include "nm-dbus-manager.h" +#include "wpa.h" +#include "nm-properties-changed-signal.h" +#include "nm-setting-wireless.h" + +#include "nm-access-point-glue.h" + +/* + * Encapsulates Access Point information + */ +typedef struct +{ + char *dbus_path; + + /* Scanned or cached values */ + GByteArray * ssid; + struct ether_addr address; + NM80211Mode mode; + gint8 strength; + guint32 freq; /* Frequency in MHz; ie 2412 (== 2.412 GHz) */ + guint32 max_bitrate;/* Maximum bitrate of the AP in Kbit/s (ie 54000 Kb/s == 54Mbit/s) */ + + guint32 flags; /* General flags */ + guint32 wpa_flags; /* WPA-related flags */ + guint32 rsn_flags; /* RSN (WPA2) -related flags */ + + /* Non-scanned attributes */ + gboolean fake; /* Whether or not the AP is from a scan */ + gboolean broadcast; /* Whether or not the AP is broadcasting (hidden) */ + gboolean user_created; /* Whether or not the AP was created + * by the user with "Create network..." + * A subset of Ad-Hoc mode. user_created + * implies Ad-Hoc, but not necessarily + * the other way around. + */ + glong last_seen; /* Last time the AP was seen in a scan in seconds */ + + /* Things from user prefs/NetworkManagerInfo */ + GTimeVal timestamp; + GSList * user_addresses; +} NMAccessPointPrivate; + +#define NM_AP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_AP, NMAccessPointPrivate)) + +G_DEFINE_TYPE (NMAccessPoint, nm_ap, G_TYPE_OBJECT) + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_FLAGS, + PROP_WPA_FLAGS, + PROP_RSN_FLAGS, + PROP_SSID, + PROP_FREQUENCY, + PROP_HW_ADDRESS, + PROP_MODE, + PROP_MAX_BITRATE, + PROP_STRENGTH, + LAST_PROP +}; + +static void +nm_ap_init (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (ap); + + priv->dbus_path = NULL; + priv->mode = NM_802_11_MODE_INFRA; + priv->flags = NM_802_11_AP_FLAGS_NONE; + priv->wpa_flags = NM_802_11_AP_SEC_NONE; + priv->rsn_flags = NM_802_11_AP_SEC_NONE; + priv->broadcast = TRUE; +} + +static void +finalize (GObject *object) +{ + NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (object); + + g_free (priv->dbus_path); + if (priv->ssid) + g_byte_array_free (priv->ssid, TRUE); + g_slist_foreach (priv->user_addresses, (GFunc)g_free, NULL); + g_slist_free (priv->user_addresses); + + G_OBJECT_CLASS (nm_ap_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMAccessPoint *ap = NM_AP (object); + + switch (prop_id) { + case PROP_FLAGS: + nm_ap_set_flags (ap, g_value_get_uint (value)); + break; + case PROP_WPA_FLAGS: + nm_ap_set_wpa_flags (ap, g_value_get_uint (value)); + break; + case PROP_RSN_FLAGS: + nm_ap_set_rsn_flags (ap, g_value_get_uint (value)); + break; + case PROP_SSID: + nm_ap_set_ssid (ap, (GByteArray *) g_value_get_boxed (value)); + break; + case PROP_FREQUENCY: + nm_ap_set_freq (ap, g_value_get_uint (value)); + break; + case PROP_MODE: + nm_ap_set_mode (ap, g_value_get_uint (value)); + break; + case PROP_MAX_BITRATE: + nm_ap_set_max_bitrate (ap, g_value_get_uint (value)); + break; + case PROP_STRENGTH: + nm_ap_set_strength (ap, g_value_get_char (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) +{ + NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (object); + GArray * ssid; + int len; + int i; + + switch (prop_id) { + case PROP_FLAGS: + g_value_set_uint (value, priv->flags); + break; + case PROP_WPA_FLAGS: + g_value_set_uint (value, priv->wpa_flags); + break; + case PROP_RSN_FLAGS: + g_value_set_uint (value, priv->rsn_flags); + break; + case PROP_SSID: + len = priv->ssid ? priv->ssid->len : 0; + ssid = g_array_sized_new (FALSE, TRUE, sizeof (unsigned char), len); + for (i = 0; i < len; i++) + g_array_append_val (ssid, priv->ssid->data[i]); + g_value_set_boxed (value, ssid); + g_array_free (ssid, TRUE); + break; + case PROP_FREQUENCY: + g_value_set_uint (value, priv->freq); + break; + case PROP_HW_ADDRESS: + g_value_take_string (value, nm_ether_ntop (&priv->address)); + break; + case PROP_MODE: + g_value_set_uint (value, priv->mode); + break; + case PROP_MAX_BITRATE: + g_value_set_uint (value, priv->max_bitrate); + break; + case PROP_STRENGTH: + g_value_set_char (value, priv->strength); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_ap_class_init (NMAccessPointClass *ap_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (ap_class); + guint32 all_sec_flags; + + g_type_class_add_private (ap_class, sizeof (NMAccessPointPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* properties */ + + all_sec_flags = NM_802_11_AP_SEC_NONE + | NM_802_11_AP_SEC_PAIR_WEP40 + | NM_802_11_AP_SEC_PAIR_WEP104 + | NM_802_11_AP_SEC_PAIR_TKIP + | NM_802_11_AP_SEC_PAIR_CCMP + | NM_802_11_AP_SEC_GROUP_WEP40 + | NM_802_11_AP_SEC_GROUP_WEP104 + | NM_802_11_AP_SEC_GROUP_TKIP + | NM_802_11_AP_SEC_GROUP_CCMP + | NM_802_11_AP_SEC_KEY_MGMT_PSK + | NM_802_11_AP_SEC_KEY_MGMT_802_1X; + + g_object_class_install_property + (object_class, PROP_FLAGS, + g_param_spec_uint (NM_AP_FLAGS, + "Flags", + "Flags", + NM_802_11_AP_FLAGS_NONE, + NM_802_11_AP_FLAGS_PRIVACY, + NM_802_11_AP_FLAGS_NONE, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_WPA_FLAGS, + g_param_spec_uint (NM_AP_WPA_FLAGS, + "WPA Flags", + "WPA Flags", + NM_802_11_AP_SEC_NONE, + all_sec_flags, + NM_802_11_AP_SEC_NONE, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_RSN_FLAGS, + g_param_spec_uint (NM_AP_RSN_FLAGS, + "RSN Flags", + "RSN Flags", + NM_802_11_AP_SEC_NONE, + all_sec_flags, + NM_802_11_AP_SEC_NONE, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_SSID, + g_param_spec_boxed (NM_AP_SSID, + "SSID", + "SSID", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_FREQUENCY, + g_param_spec_uint (NM_AP_FREQUENCY, + "Frequency", + "Frequency", + 0, 10000, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_AP_HW_ADDRESS, + "MAC Address", + "Hardware MAC address", + NULL, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_uint (NM_AP_MODE, + "Mode", + "Mode", + NM_802_11_MODE_ADHOC, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_MAX_BITRATE, + g_param_spec_uint (NM_AP_MAX_BITRATE, + "Max Bitrate", + "Max Bitrate", + 0, G_MAXUINT16, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_STRENGTH, + g_param_spec_char (NM_AP_STRENGTH, + "Strength", + "Strength", + G_MININT8, G_MAXINT8, 0, + G_PARAM_READWRITE)); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMAccessPointClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (ap_class), + &dbus_glib_nm_access_point_object_info); +} + +void +nm_ap_export_to_dbus (NMAccessPoint *ap) +{ + NMAccessPointPrivate *priv; + NMDBusManager *mgr; + DBusGConnection *g_connection; + static guint32 counter = 0; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + if (priv->dbus_path) { + nm_log_err (LOGD_CORE, "Tried to export AP %s twice.", priv->dbus_path); + return; + } + + mgr = nm_dbus_manager_get (); + g_assert (mgr); + + g_connection = nm_dbus_manager_get_connection (mgr); + g_assert (g_connection); + + priv->dbus_path = g_strdup_printf (NM_DBUS_PATH_ACCESS_POINT "/%d", counter++); + dbus_g_connection_register_g_object (g_connection, priv->dbus_path, G_OBJECT (ap)); + + g_object_unref (mgr); +} + +/* + * nm_ap_new + * + * Create a new, blank user access point info structure + * + */ +NMAccessPoint *nm_ap_new (void) +{ + GObject *object; + + object = g_object_new (NM_TYPE_AP, NULL); + if (!object) + return NULL; + + return (NMAccessPoint *) object; +} + + +#define IEEE80211_CAP_ESS 0x0001 +#define IEEE80211_CAP_IBSS 0x0002 +#define IEEE80211_CAP_PRIVACY 0x0010 + +static void +foreach_property_cb (gpointer key, gpointer value, gpointer user_data) +{ + GValue *variant = (GValue *) value; + NMAccessPoint *ap = (NMAccessPoint *) user_data; + + if (G_VALUE_HOLDS_BOXED (variant)) { + GArray *array = g_value_get_boxed (variant); + + if (!strcmp (key, "ssid")) { + guint32 len = MIN (IW_ESSID_MAX_SIZE, array->len); + GByteArray * ssid; + + /* Stupid ieee80211 layer uses */ + if (((len == 8) || (len == 9)) + && (memcmp (array->data, "", 8) == 0)) + return; + + if (nm_utils_is_empty_ssid ((const guint8 *) array->data, len)) + return; + + ssid = g_byte_array_sized_new (len); + g_byte_array_append (ssid, (const guint8 *) array->data, len); + nm_ap_set_ssid (ap, ssid); + g_byte_array_free (ssid, TRUE); + } else if (!strcmp (key, "bssid")) { + struct ether_addr addr; + + if (array->len != ETH_ALEN) + return; + memset (&addr, 0, sizeof (struct ether_addr)); + memcpy (&addr, array->data, ETH_ALEN); + nm_ap_set_address (ap, &addr); + } else if (!strcmp (key, "wpaie")) { + guint8 * ie = (guint8 *) array->data; + guint32 flags = nm_ap_get_wpa_flags (ap); + + if (array->len <= 0 || array->len > WPA_MAX_IE_LEN) + return; + flags = nm_ap_add_security_from_ie (flags, ie, array->len); + nm_ap_set_wpa_flags (ap, flags); + } else if (!strcmp (key, "rsnie")) { + guint8 * ie = (guint8 *) array->data; + guint32 flags = nm_ap_get_rsn_flags (ap); + + if (array->len <= 0 || array->len > WPA_MAX_IE_LEN) + return; + flags = nm_ap_add_security_from_ie (flags, ie, array->len); + nm_ap_set_rsn_flags (ap, flags); + } + } else if (G_VALUE_HOLDS_INT (variant)) { + gint32 int_val = g_value_get_int (variant); + + if (!strcmp (key, "frequency")) { + nm_ap_set_freq (ap, (guint32) int_val); + } else if (!strcmp (key, "maxrate")) { + /* Supplicant reports as b/s, we use Kb/s internally */ + nm_ap_set_max_bitrate (ap, int_val / 1000); + } + } else if (G_VALUE_HOLDS_UINT (variant)) { + guint32 val = g_value_get_uint (variant); + + if (!strcmp (key, "capabilities")) { + if (val & IEEE80211_CAP_ESS) { + nm_ap_set_mode (ap, NM_802_11_MODE_INFRA); + } else if (val & IEEE80211_CAP_IBSS) { + nm_ap_set_mode (ap, NM_802_11_MODE_ADHOC); + } + + if (val & IEEE80211_CAP_PRIVACY) { + guint32 flags = nm_ap_get_flags (ap); + nm_ap_set_flags (ap, flags | NM_802_11_AP_FLAGS_PRIVACY); + } + } + } +} + + +NMAccessPoint * +nm_ap_new_from_properties (GHashTable *properties) +{ + NMAccessPoint *ap; + GTimeVal cur_time; + const struct ether_addr * 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 (); + + g_object_freeze_notify (G_OBJECT (ap)); + g_hash_table_foreach (properties, foreach_property_cb, ap); + + /* ignore APs with invalid BSSIDs */ + addr = nm_ap_get_address (ap); + if ( !(memcmp (addr->ether_addr_octet, bad_bssid1, ETH_ALEN)) + || !(memcmp (addr->ether_addr_octet, bad_bssid2, ETH_ALEN))) { + g_object_unref (ap); + return NULL; + } + + g_get_current_time (&cur_time); + nm_ap_set_last_seen (ap, cur_time.tv_sec); + + if (!nm_ap_get_ssid (ap)) + nm_ap_set_broadcast (ap, FALSE); + + g_object_thaw_notify (G_OBJECT (ap)); + + return ap; +} + +#define PROTO_WPA "wpa" +#define PROTO_RSN "rsn" + +static gboolean +has_proto (NMSettingWirelessSecurity *sec, const char *proto) +{ + guint32 num_protos = nm_setting_wireless_security_get_num_protos (sec); + guint32 i; + + if (num_protos == 0) + return TRUE; /* interpret no protos as "all" */ + + for (i = 0; i < num_protos; i++) { + if (!strcmp (nm_setting_wireless_security_get_proto (sec, i), proto)) + return TRUE; + } + return FALSE; +} + +static void +add_pair_ciphers (NMAccessPoint *ap, NMSettingWirelessSecurity *sec) +{ + guint32 num = nm_setting_wireless_security_get_num_pairwise (sec); + guint32 flags = NM_802_11_AP_SEC_NONE; + guint32 i; + + /* If no ciphers are specified, that means "all" WPA ciphers */ + if (num == 0) { + flags |= NM_802_11_AP_SEC_PAIR_TKIP | NM_802_11_AP_SEC_PAIR_CCMP; + } else { + for (i = 0; i < num; i++) { + const char *cipher = nm_setting_wireless_security_get_pairwise (sec, i); + + if (!strcmp (cipher, "tkip")) + flags |= NM_802_11_AP_SEC_PAIR_TKIP; + else if (!strcmp (cipher, "ccmp")) + flags |= NM_802_11_AP_SEC_PAIR_CCMP; + } + } + + if (has_proto (sec, PROTO_WPA)) + nm_ap_set_wpa_flags (ap, nm_ap_get_wpa_flags (ap) | flags); + if (has_proto (sec, PROTO_RSN)) + nm_ap_set_rsn_flags (ap, nm_ap_get_rsn_flags (ap) | flags); +} + +static void +add_group_ciphers (NMAccessPoint *ap, NMSettingWirelessSecurity *sec) +{ + guint32 num = nm_setting_wireless_security_get_num_groups (sec); + guint32 flags = NM_802_11_AP_SEC_NONE; + guint32 i; + + /* If no ciphers are specified, that means "all" WPA ciphers */ + if (num == 0) { + flags |= NM_802_11_AP_SEC_GROUP_TKIP | NM_802_11_AP_SEC_GROUP_CCMP; + } else { + for (i = 0; i < num; i++) { + const char *cipher = nm_setting_wireless_security_get_group (sec, i); + + if (!strcmp (cipher, "wep40")) + flags |= NM_802_11_AP_SEC_GROUP_WEP40; + else if (!strcmp (cipher, "wep104")) + flags |= NM_802_11_AP_SEC_GROUP_WEP104; + else if (!strcmp (cipher, "tkip")) + flags |= NM_802_11_AP_SEC_GROUP_TKIP; + else if (!strcmp (cipher, "ccmp")) + flags |= NM_802_11_AP_SEC_GROUP_CCMP; + } + } + + if (has_proto (sec, PROTO_WPA)) + nm_ap_set_wpa_flags (ap, nm_ap_get_wpa_flags (ap) | flags); + if (has_proto (sec, PROTO_RSN)) + nm_ap_set_rsn_flags (ap, nm_ap_get_rsn_flags (ap) | flags); +} + +NMAccessPoint * +nm_ap_new_fake_from_connection (NMConnection *connection) +{ + NMAccessPoint *ap; + NMSettingWireless *s_wireless; + NMSettingWirelessSecurity *s_wireless_sec; + const GByteArray *ssid; + const char *mode, *band, *key_mgmt; + guint32 channel, flags; + gboolean psk = FALSE, eap = FALSE; + + g_return_val_if_fail (connection != NULL, NULL); + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + g_return_val_if_fail (s_wireless != NULL, NULL); + + ssid = nm_setting_wireless_get_ssid (s_wireless); + g_return_val_if_fail (ssid != NULL, NULL); + g_return_val_if_fail (ssid->len > 0, NULL); + + ap = nm_ap_new (); + nm_ap_set_fake (ap, TRUE); + nm_ap_set_ssid (ap, ssid); + + // FIXME: bssid too? + + mode = nm_setting_wireless_get_mode (s_wireless); + if (mode) { + if (!strcmp (mode, "infrastructure")) + nm_ap_set_mode (ap, NM_802_11_MODE_INFRA); + else if (!strcmp (mode, "adhoc")) + nm_ap_set_mode (ap, NM_802_11_MODE_ADHOC); + else + goto error; + } else { + nm_ap_set_mode (ap, NM_802_11_MODE_INFRA); + } + + band = nm_setting_wireless_get_band (s_wireless); + channel = nm_setting_wireless_get_channel (s_wireless); + + if (band && channel) { + guint32 freq = channel_to_freq (channel, band); + + if (freq == 0) + goto error; + + nm_ap_set_freq (ap, freq); + } + + s_wireless_sec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); + /* Assume presence of a security setting means the AP is encrypted */ + if (!s_wireless_sec) + goto done; + + key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wireless_sec); + + /* Everything below here uses encryption */ + nm_ap_set_flags (ap, nm_ap_get_flags (ap) | NM_802_11_AP_FLAGS_PRIVACY); + + /* Static & Dynamic WEP */ + if (!strcmp (key_mgmt, "none") || !strcmp (key_mgmt, "ieee8021x")) + goto done; + + psk = !strcmp (key_mgmt, "wpa-psk"); + eap = !strcmp (key_mgmt, "wpa-eap"); + if (psk || eap) { + if (has_proto (s_wireless_sec, PROTO_WPA)) { + flags = nm_ap_get_wpa_flags (ap); + flags |= eap ? NM_802_11_AP_SEC_KEY_MGMT_802_1X : NM_802_11_AP_SEC_KEY_MGMT_PSK; + nm_ap_set_wpa_flags (ap, flags); + } + if (has_proto (s_wireless_sec, PROTO_RSN)) { + flags = nm_ap_get_rsn_flags (ap); + flags |= eap ? NM_802_11_AP_SEC_KEY_MGMT_802_1X : NM_802_11_AP_SEC_KEY_MGMT_PSK; + nm_ap_set_rsn_flags (ap, flags); + } + + add_pair_ciphers (ap, s_wireless_sec); + add_group_ciphers (ap, s_wireless_sec); + } else if (!strcmp (key_mgmt, "wpa-none")) { + guint32 i; + + /* Ad-Hoc has special requirements: proto=WPA, pairwise=(none), and + * group=TKIP/CCMP (but not both). + */ + + flags = nm_ap_get_wpa_flags (ap); + flags |= NM_802_11_AP_SEC_KEY_MGMT_PSK; + + /* Clear ciphers; pairwise must be unset anyway, and group gets set below */ + flags &= ~( NM_802_11_AP_SEC_PAIR_WEP40 + | NM_802_11_AP_SEC_PAIR_WEP104 + | NM_802_11_AP_SEC_PAIR_TKIP + | NM_802_11_AP_SEC_PAIR_CCMP + | NM_802_11_AP_SEC_GROUP_WEP40 + | NM_802_11_AP_SEC_GROUP_WEP104 + | NM_802_11_AP_SEC_GROUP_TKIP + | NM_802_11_AP_SEC_GROUP_CCMP); + + for (i = 0; i < nm_setting_wireless_security_get_num_groups (s_wireless_sec); i++) { + if (!strcmp (nm_setting_wireless_security_get_group (s_wireless_sec, i), "ccmp")) { + flags |= NM_802_11_AP_SEC_GROUP_CCMP; + break; + } + } + + /* Default to TKIP since not all WPA-capable cards can do CCMP */ + if (!(flags & NM_802_11_AP_SEC_GROUP_CCMP)) + flags |= NM_802_11_AP_SEC_GROUP_TKIP; + + nm_ap_set_wpa_flags (ap, flags); + + /* Don't use Ad-Hoc RSN yet */ + nm_ap_set_rsn_flags (ap, NM_802_11_AP_SEC_NONE); + } + +done: + return ap; + +error: + g_object_unref (ap); + return NULL; +} + + +#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" +#define MAC_ARG(x) ((guint8*)(x))[0],((guint8*)(x))[1],((guint8*)(x))[2],((guint8*)(x))[3],((guint8*)(x))[4],((guint8*)(x))[5] + +void +nm_ap_print_self (NMAccessPoint *ap, + const char * prefix) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (ap != NULL); + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + nm_log_dbg (LOGD_WIFI_SCAN, "%s'%s' (%p)", + prefix, + priv->ssid ? nm_utils_escape_ssid (priv->ssid->data, priv->ssid->len) : "(none)", + ap); + nm_log_dbg (LOGD_WIFI_SCAN, " BSSID " MAC_FMT, MAC_ARG (priv->address.ether_addr_octet)); + nm_log_dbg (LOGD_WIFI_SCAN, " mode %d", priv->mode); + nm_log_dbg (LOGD_WIFI_SCAN, " timestamp %ld", priv->timestamp.tv_sec); + nm_log_dbg (LOGD_WIFI_SCAN, " flags 0x%X", priv->flags); + nm_log_dbg (LOGD_WIFI_SCAN, " wpa flags 0x%X", priv->wpa_flags); + nm_log_dbg (LOGD_WIFI_SCAN, " rsn flags 0x%X", priv->rsn_flags); + nm_log_dbg (LOGD_WIFI_SCAN, " quality %d", priv->strength); + nm_log_dbg (LOGD_WIFI_SCAN, " frequency %d", priv->freq); + nm_log_dbg (LOGD_WIFI_SCAN, " max rate %d", priv->max_bitrate); + nm_log_dbg (LOGD_WIFI_SCAN, " last-seen %ld", priv->last_seen); +} + +const char * +nm_ap_get_dbus_path (NMAccessPoint *ap) +{ + g_return_val_if_fail (NM_IS_AP (ap), NULL); + + return NM_AP_GET_PRIVATE (ap)->dbus_path; +} + + +/* + * Get/set functions for timestamp + * + */ +const GTimeVal *nm_ap_get_timestamp (const NMAccessPoint *ap) +{ + g_return_val_if_fail (NM_IS_AP (ap), 0); + + return (&NM_AP_GET_PRIVATE (ap)->timestamp); +} + +void nm_ap_set_timestamp (NMAccessPoint *ap, glong sec, glong usec) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + priv->timestamp.tv_sec = sec; + priv->timestamp.tv_usec = usec; +} + +void nm_ap_set_timestamp_via_timestamp (NMAccessPoint *ap, const GTimeVal *timestamp) +{ + g_return_if_fail (NM_IS_AP (ap)); + + NM_AP_GET_PRIVATE (ap)->timestamp = *timestamp; +} + +/* + * Get/set functions for ssid + * + */ +const GByteArray * nm_ap_get_ssid (const NMAccessPoint *ap) +{ + g_return_val_if_fail (NM_IS_AP (ap), NULL); + + return NM_AP_GET_PRIVATE (ap)->ssid; +} + +void +nm_ap_set_ssid (NMAccessPoint *ap, const GByteArray * ssid) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + if ((ssid == priv->ssid) && ssid == NULL) + return; + + /* same SSID */ + if ((ssid && priv->ssid) && (ssid->len == priv->ssid->len)) { + if (!memcmp (ssid->data, priv->ssid->data, ssid->len)) + return; + } + + if (priv->ssid) { + g_byte_array_free (priv->ssid, TRUE); + priv->ssid = NULL; + } + + if (ssid) { + priv->ssid = g_byte_array_sized_new (ssid->len); + priv->ssid->len = ssid->len; + memcpy (priv->ssid->data, ssid->data, ssid->len); + } + + g_object_notify (G_OBJECT (ap), NM_AP_SSID); +} + + +guint32 +nm_ap_get_flags (NMAccessPoint *ap) +{ + guint32 flags; + + g_return_val_if_fail (NM_IS_AP (ap), NM_802_11_AP_FLAGS_NONE); + + g_object_get (ap, NM_AP_FLAGS, &flags, NULL); + + return flags; +} + + +void +nm_ap_set_flags (NMAccessPoint *ap, guint32 flags) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + if (priv->flags != flags) { + priv->flags = flags; + g_object_notify (G_OBJECT (ap), NM_AP_FLAGS); + } +} + +guint32 +nm_ap_get_wpa_flags (NMAccessPoint *ap) +{ + guint32 flags; + + g_return_val_if_fail (NM_IS_AP (ap), NM_802_11_AP_SEC_NONE); + + g_object_get (ap, NM_AP_WPA_FLAGS, &flags, NULL); + + return flags; +} + + +void +nm_ap_set_wpa_flags (NMAccessPoint *ap, guint32 flags) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + if (priv->wpa_flags != flags) { + priv->wpa_flags = flags; + g_object_notify (G_OBJECT (ap), NM_AP_WPA_FLAGS); + } +} + +guint32 +nm_ap_get_rsn_flags (NMAccessPoint *ap) +{ + guint32 flags; + + g_return_val_if_fail (NM_IS_AP (ap), NM_802_11_AP_SEC_NONE); + + g_object_get (ap, NM_AP_RSN_FLAGS, &flags, NULL); + + return flags; +} + + +void +nm_ap_set_rsn_flags (NMAccessPoint *ap, guint32 flags) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + if (priv->rsn_flags != flags) { + priv->rsn_flags = flags; + g_object_notify (G_OBJECT (ap), NM_AP_RSN_FLAGS); + } +} + +/* + * Get/set functions for address + * + */ +const struct ether_addr * nm_ap_get_address (const NMAccessPoint *ap) +{ + g_return_val_if_fail (NM_IS_AP (ap), NULL); + + return &NM_AP_GET_PRIVATE (ap)->address; +} + +void nm_ap_set_address (NMAccessPoint *ap, const struct ether_addr * addr) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + g_return_if_fail (addr != NULL); + + priv = NM_AP_GET_PRIVATE (ap); + + if (memcmp (addr, &priv->address, sizeof (priv->address))) { + memcpy (&NM_AP_GET_PRIVATE (ap)->address, addr, sizeof (struct ether_addr)); + g_object_notify (G_OBJECT (ap), NM_AP_HW_ADDRESS); + } +} + + +/* + * Get/set functions for mode (ie Ad-Hoc, Infrastructure, etc) + * + */ +NM80211Mode nm_ap_get_mode (NMAccessPoint *ap) +{ + NM80211Mode mode; + + g_return_val_if_fail (NM_IS_AP (ap), -1); + + g_object_get (ap, NM_AP_MODE, &mode, NULL); + + return mode; +} + +void nm_ap_set_mode (NMAccessPoint *ap, const NM80211Mode mode) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + if (mode == NM_802_11_MODE_ADHOC || mode == NM_802_11_MODE_INFRA) { + priv = NM_AP_GET_PRIVATE (ap); + + if (priv->mode != mode) { + priv->mode = mode; + g_object_notify (G_OBJECT (ap), NM_AP_MODE); + } + } else + nm_log_warn (LOGD_WIFI, "Invalid AP mode '%d'", mode); +} + + +/* + * Get/set functions for strength + * + */ +gint8 nm_ap_get_strength (NMAccessPoint *ap) +{ + gint8 strength; + + g_return_val_if_fail (NM_IS_AP (ap), 0); + + g_object_get (ap, NM_AP_STRENGTH, &strength, NULL); + + return strength; +} + +void nm_ap_set_strength (NMAccessPoint *ap, const gint8 strength) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + if (priv->strength != strength) { + priv->strength = strength; + g_object_notify (G_OBJECT (ap), NM_AP_STRENGTH); + } +} + + +/* + * Get/set functions for frequency + * + */ +guint32 +nm_ap_get_freq (NMAccessPoint *ap) +{ + guint32 freq; + + g_return_val_if_fail (NM_IS_AP (ap), 0); + + g_object_get (ap, NM_AP_FREQUENCY, &freq, NULL); + + return freq; +} + +void +nm_ap_set_freq (NMAccessPoint *ap, + const guint32 freq) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + if (priv->freq != freq) { + priv->freq = freq; + g_object_notify (G_OBJECT (ap), NM_AP_FREQUENCY); + } +} + + +/* + * Get/set functions for max bitrate + * + */ +guint32 nm_ap_get_max_bitrate (NMAccessPoint *ap) +{ + guint32 rate; + + g_return_val_if_fail (NM_IS_AP (ap), 0); + + g_object_get (ap, NM_AP_MAX_BITRATE, &rate, NULL); + + return rate; +} + +void +nm_ap_set_max_bitrate (NMAccessPoint *ap, guint32 bitrate) +{ + NMAccessPointPrivate *priv; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + if (priv->max_bitrate != bitrate) { + priv->max_bitrate = bitrate; + g_object_notify (G_OBJECT (ap), NM_AP_MAX_BITRATE); + } +} + +/* + * Get/Set functions to indicate that an access point is 'fake', ie whether + * or not it was created from scan results + */ +gboolean nm_ap_get_fake (const NMAccessPoint *ap) +{ + g_return_val_if_fail (NM_IS_AP (ap), FALSE); + + return NM_AP_GET_PRIVATE (ap)->fake; +} + +void nm_ap_set_fake (NMAccessPoint *ap, gboolean fake) +{ + g_return_if_fail (NM_IS_AP (ap)); + + NM_AP_GET_PRIVATE (ap)->fake = fake; +} + + +/* + * Get/Set functions to indicate whether an AP broadcasts its SSID. + */ +gboolean nm_ap_get_broadcast (NMAccessPoint *ap) +{ + g_return_val_if_fail (NM_IS_AP (ap), TRUE); + + return NM_AP_GET_PRIVATE (ap)->broadcast; +} + + +void nm_ap_set_broadcast (NMAccessPoint *ap, gboolean broadcast) +{ + g_return_if_fail (NM_IS_AP (ap)); + + NM_AP_GET_PRIVATE (ap)->broadcast = broadcast; +} + + +/* + * Get/Set functions for how long ago the AP was last seen in a scan. + * APs older than a certain date are dropped from the list. + * + */ +glong nm_ap_get_last_seen (const NMAccessPoint *ap) +{ + g_return_val_if_fail (NM_IS_AP (ap), FALSE); + + return NM_AP_GET_PRIVATE (ap)->last_seen; +} + +void nm_ap_set_last_seen (NMAccessPoint *ap, const glong last_seen) +{ + g_return_if_fail (NM_IS_AP (ap)); + + NM_AP_GET_PRIVATE (ap)->last_seen = last_seen; +} + + +/* + * Get/Set functions to indicate that an access point is + * user-created, ie whether or not its a network filled with + * information from the user and intended to create a new Ad-Hoc + * wireless network. + * + */ +gboolean nm_ap_get_user_created (const NMAccessPoint *ap) +{ + g_return_val_if_fail (NM_IS_AP (ap), FALSE); + + return NM_AP_GET_PRIVATE (ap)->user_created; +} + +void nm_ap_set_user_created (NMAccessPoint *ap, gboolean user_created) +{ + g_return_if_fail (NM_IS_AP (ap)); + + NM_AP_GET_PRIVATE (ap)->user_created = user_created; +} + + +/* + * Get/Set functions for user address list + * + * The internal address list is always "owned" by the AP and + * the list returned by nm_ap_get_user_addresses() is a deep copy. + * Likewise, when setting the list, a deep copy is made for the + * ap's actual list. + * + */ +GSList *nm_ap_get_user_addresses (const NMAccessPoint *ap) +{ + GSList *new = NULL; + GSList *elt = NULL; + + g_return_val_if_fail (NM_IS_AP (ap), NULL); + + for (elt = NM_AP_GET_PRIVATE (ap)->user_addresses; elt; elt = g_slist_next (elt)) + { + if (elt->data) + new = g_slist_append (new, g_strdup (elt->data)); + } + + /* Return a _deep__copy_ of the address list */ + return new; +} + +void nm_ap_set_user_addresses (NMAccessPoint *ap, GSList *list) +{ + NMAccessPointPrivate *priv; + GSList *elt = NULL; + GSList *new = NULL; + + g_return_if_fail (NM_IS_AP (ap)); + + priv = NM_AP_GET_PRIVATE (ap); + + /* Free existing list */ + g_slist_foreach (priv->user_addresses, (GFunc) g_free, NULL); + + /* Copy new list and set as our own */ + for (elt = list; elt; elt = g_slist_next (elt)) + { + if (elt->data) + new = g_slist_append (new, g_ascii_strup (elt->data, -1)); + } + + priv->user_addresses = new; +} + + +guint32 +nm_ap_add_security_from_ie (guint32 flags, + const guint8 *wpa_ie, + guint32 length) +{ + wpa_ie_data * cap_data; + + if (!(cap_data = wpa_parse_wpa_ie (wpa_ie, length))) + return NM_802_11_AP_SEC_NONE; + + /* Pairwise cipher flags */ + if (cap_data->pairwise_cipher & IW_AUTH_CIPHER_WEP40) + flags |= NM_802_11_AP_SEC_PAIR_WEP40; + if (cap_data->pairwise_cipher & IW_AUTH_CIPHER_WEP104) + flags |= NM_802_11_AP_SEC_PAIR_WEP104; + if (cap_data->pairwise_cipher & IW_AUTH_CIPHER_TKIP) + flags |= NM_802_11_AP_SEC_PAIR_TKIP; + if (cap_data->pairwise_cipher & IW_AUTH_CIPHER_CCMP) + flags |= NM_802_11_AP_SEC_PAIR_CCMP; + + /* Group cipher flags */ + if (cap_data->group_cipher & IW_AUTH_CIPHER_WEP40) + flags |= NM_802_11_AP_SEC_GROUP_WEP40; + if (cap_data->group_cipher & IW_AUTH_CIPHER_WEP104) + flags |= NM_802_11_AP_SEC_GROUP_WEP104; + if (cap_data->group_cipher & IW_AUTH_CIPHER_TKIP) + flags |= NM_802_11_AP_SEC_GROUP_TKIP; + if (cap_data->group_cipher & IW_AUTH_CIPHER_CCMP) + flags |= NM_802_11_AP_SEC_GROUP_CCMP; + + if (cap_data->key_mgmt & IW_AUTH_KEY_MGMT_802_1X) + flags |= NM_802_11_AP_SEC_KEY_MGMT_802_1X; + if (cap_data->key_mgmt & IW_AUTH_KEY_MGMT_PSK) + flags |= NM_802_11_AP_SEC_KEY_MGMT_PSK; + + g_slice_free (wpa_ie_data, cap_data); + return flags; +} + +gboolean +nm_ap_check_compatible (NMAccessPoint *self, + NMConnection *connection) +{ + NMAccessPointPrivate *priv; + NMSettingWireless *s_wireless; + NMSettingWirelessSecurity *s_wireless_sec; + const char *mode; + const char *band; + const GByteArray *bssid; + guint32 channel; + + g_return_val_if_fail (NM_IS_AP (self), FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + + priv = NM_AP_GET_PRIVATE (self); + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + if (s_wireless == NULL) + return FALSE; + + if (!nm_utils_same_ssid (nm_setting_wireless_get_ssid (s_wireless), priv->ssid, TRUE)) + return FALSE; + + bssid = nm_setting_wireless_get_bssid (s_wireless); + if (bssid && memcmp (bssid->data, &priv->address, ETH_ALEN)) + return FALSE; + + mode = nm_setting_wireless_get_mode (s_wireless); + if (mode) { + if (!strcmp (mode, "infrastructure") && (priv->mode != NM_802_11_MODE_INFRA)) + return FALSE; + if (!strcmp (mode, "adhoc") && (priv->mode != NM_802_11_MODE_ADHOC)) + return FALSE; + } + + band = nm_setting_wireless_get_band (s_wireless); + if (band) { + if (!strcmp (band, "a")) { + if (priv->freq < 4915 || priv->freq > 5825) + return FALSE; + } else if (!strcmp (band, "bg")) { + if (priv->freq < 2412 || priv->freq > 2484) + return FALSE; + } + } + + channel = nm_setting_wireless_get_channel (s_wireless); + if (channel) { + guint32 ap_chan = freq_to_channel (priv->freq); + + if (channel != ap_chan) + return FALSE; + } + + s_wireless_sec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, + NM_TYPE_SETTING_WIRELESS_SECURITY); + + return nm_setting_wireless_ap_security_compatible (s_wireless, + s_wireless_sec, + nm_ap_get_flags (self), + nm_ap_get_wpa_flags (self), + nm_ap_get_rsn_flags (self), + nm_ap_get_mode (self)); +} + +static gboolean +capabilities_compatible (guint32 a_flags, guint32 b_flags) +{ + if (a_flags == b_flags) + return TRUE; + + /* Make sure there's a common key management method */ + if (!((a_flags & 0x300) & (b_flags & 0x300))) + return FALSE; + + /* Ensure common pairwise ciphers */ + if (!((a_flags & 0xF) & (b_flags & 0xF))) + return FALSE; + + /* Ensure common group ciphers */ + if (!((a_flags & 0xF0) & (b_flags & 0xF0))) + return FALSE; + + return TRUE; +} + +NMAccessPoint * +nm_ap_match_in_list (NMAccessPoint *find_ap, + GSList *ap_list, + gboolean strict_match) +{ + GSList *iter; + + g_return_val_if_fail (find_ap != NULL, NULL); + + for (iter = ap_list; iter; iter = g_slist_next (iter)) { + NMAccessPoint * list_ap = NM_AP (iter->data); + const GByteArray * list_ssid = nm_ap_get_ssid (list_ap); + const struct ether_addr * list_addr = nm_ap_get_address (list_ap); + + const GByteArray * find_ssid = nm_ap_get_ssid (find_ap); + const struct ether_addr * find_addr = nm_ap_get_address (find_ap); + + /* SSID match; if both APs are hiding their SSIDs, + * let matching continue on BSSID and other properties + */ + if ( (!list_ssid && find_ssid) + || (list_ssid && !find_ssid) + || !nm_utils_same_ssid (list_ssid, find_ssid, TRUE)) + continue; + + /* BSSID match */ + if ( (strict_match || nm_ethernet_address_is_valid (find_addr)) + && nm_ethernet_address_is_valid (list_addr) + && memcmp (list_addr->ether_addr_octet, + find_addr->ether_addr_octet, + ETH_ALEN) != 0) { + continue; + } + + /* mode match */ + if (nm_ap_get_mode (list_ap) != nm_ap_get_mode (find_ap)) + continue; + + /* Frequency match */ + if (nm_ap_get_freq (list_ap) != nm_ap_get_freq (find_ap)) + continue; + + /* AP flags */ + if (nm_ap_get_flags (list_ap) != nm_ap_get_flags (find_ap)) + continue; + + if (strict_match) { + if (nm_ap_get_wpa_flags (list_ap) != nm_ap_get_wpa_flags (find_ap)) + continue; + + if (nm_ap_get_rsn_flags (list_ap) != nm_ap_get_rsn_flags (find_ap)) + continue; + } else { + guint32 list_wpa_flags = nm_ap_get_wpa_flags (list_ap); + guint32 find_wpa_flags = nm_ap_get_wpa_flags (find_ap); + guint32 list_rsn_flags = nm_ap_get_rsn_flags (list_ap); + guint32 find_rsn_flags = nm_ap_get_rsn_flags (find_ap); + + /* Just ensure that there is overlap in the capabilities */ + if ( !capabilities_compatible (list_wpa_flags, find_wpa_flags) + && !capabilities_compatible (list_rsn_flags, find_rsn_flags)) + continue; + } + + return list_ap; + } + + return NULL; +} + + +struct cf_pair { + guint32 chan; + guint32 freq; +}; + +static struct cf_pair a_table[] = { + /* A band */ + { 7, 5035 }, + { 8, 5040 }, + { 9, 5045 }, + { 11, 5055 }, + { 12, 5060 }, + { 16, 5080 }, + { 34, 5170 }, + { 36, 5180 }, + { 38, 5190 }, + { 40, 5200 }, + { 42, 5210 }, + { 44, 5220 }, + { 46, 5230 }, + { 48, 5240 }, + { 50, 5250 }, + { 52, 5260 }, + { 56, 5280 }, + { 58, 5290 }, + { 60, 5300 }, + { 64, 5320 }, + { 100, 5500 }, + { 104, 5520 }, + { 108, 5540 }, + { 112, 5560 }, + { 116, 5580 }, + { 120, 5600 }, + { 124, 5620 }, + { 128, 5640 }, + { 132, 5660 }, + { 136, 5680 }, + { 140, 5700 }, + { 149, 5745 }, + { 152, 5760 }, + { 153, 5765 }, + { 157, 5785 }, + { 160, 5800 }, + { 161, 5805 }, + { 165, 5825 }, + { 183, 4915 }, + { 184, 4920 }, + { 185, 4925 }, + { 187, 4935 }, + { 188, 4945 }, + { 192, 4960 }, + { 196, 4980 }, + { 0, -1 } +}; + +static struct cf_pair bg_table[] = { + /* B/G band */ + { 1, 2412 }, + { 2, 2417 }, + { 3, 2422 }, + { 4, 2427 }, + { 5, 2432 }, + { 6, 2437 }, + { 7, 2442 }, + { 8, 2447 }, + { 9, 2452 }, + { 10, 2457 }, + { 11, 2462 }, + { 12, 2467 }, + { 13, 2472 }, + { 14, 2484 }, + { 0, -1 } +}; + +guint32 +freq_to_channel (guint32 freq) +{ + int i = 0; + + if (freq > 4900) { + while (a_table[i].chan && (a_table[i].freq != freq)) + i++; + return a_table[i].chan; + } else { + while (bg_table[i].chan && (bg_table[i].freq != freq)) + i++; + return bg_table[i].chan; + } + + return 0; +} + +guint32 +channel_to_freq (guint32 channel, const char *band) +{ + int i = 0; + + if (!strcmp (band, "a")) { + while (a_table[i].chan && (a_table[i].chan != channel)) + i++; + return a_table[i].freq; + } else if (!strcmp (band, "bg")) { + while (bg_table[i].chan && (bg_table[i].chan != channel)) + i++; + return bg_table[i].freq; + } + + return 0; +} + diff --git a/src/nm-wifi-ap.h b/src/nm-wifi-ap.h new file mode 100644 index 00000000..edc9e56b --- /dev/null +++ b/src/nm-wifi-ap.h @@ -0,0 +1,129 @@ +/* -*- 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 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef NM_ACCESS_POINT_H +#define NM_ACCESS_POINT_H + +#include +#include +#include +#include "NetworkManager.h" +#include "nm-connection.h" + +#define NM_TYPE_AP (nm_ap_get_type ()) +#define NM_AP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AP, NMAccessPoint)) +#define NM_AP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_AP, NMAccessPointClass)) +#define NM_IS_AP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_AP)) +#define NM_IS_AP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_AP)) +#define NM_AP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_AP, NMAccessPointClass)) + +#define NM_AP_FLAGS "flags" +#define NM_AP_WPA_FLAGS "wpa-flags" +#define NM_AP_RSN_FLAGS "rsn-flags" +#define NM_AP_SSID "ssid" +#define NM_AP_FREQUENCY "frequency" +#define NM_AP_HW_ADDRESS "hw-address" +#define NM_AP_MODE "mode" +#define NM_AP_MAX_BITRATE "max-bitrate" +#define NM_AP_STRENGTH "strength" + +typedef struct { + GObject parent; +} NMAccessPoint; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*properties_changed) (NMAccessPoint *ap, GHashTable *properties); +} NMAccessPointClass; + +GType nm_ap_get_type (void); + +NMAccessPoint * nm_ap_new (void); +NMAccessPoint * nm_ap_new_from_properties (GHashTable *properties); +NMAccessPoint * nm_ap_new_fake_from_connection (NMConnection *connection); +void nm_ap_export_to_dbus (NMAccessPoint *ap); + +const char * nm_ap_get_dbus_path (NMAccessPoint *ap); +const GTimeVal * nm_ap_get_timestamp (const NMAccessPoint *ap); +void nm_ap_set_timestamp (NMAccessPoint *ap, glong sec, glong usec); +void nm_ap_set_timestamp_via_timestamp (NMAccessPoint *ap, const GTimeVal *timestamp); + +const GByteArray * nm_ap_get_ssid (const NMAccessPoint * ap); +void nm_ap_set_ssid (NMAccessPoint * ap, const GByteArray * ssid); + +guint32 nm_ap_get_flags (NMAccessPoint *ap); +void nm_ap_set_flags (NMAccessPoint *ap, guint32 flags); + +guint32 nm_ap_get_wpa_flags (NMAccessPoint *ap); +void nm_ap_set_wpa_flags (NMAccessPoint *ap, guint32 flags); + +guint32 nm_ap_get_rsn_flags (NMAccessPoint *ap); +void nm_ap_set_rsn_flags (NMAccessPoint *ap, guint32 flags); + +const struct ether_addr * nm_ap_get_address (const NMAccessPoint *ap); +void nm_ap_set_address (NMAccessPoint *ap, const struct ether_addr *addr); + +NM80211Mode nm_ap_get_mode (NMAccessPoint *ap); +void nm_ap_set_mode (NMAccessPoint *ap, const NM80211Mode mode); + +gint8 nm_ap_get_strength (NMAccessPoint *ap); +void nm_ap_set_strength (NMAccessPoint *ap, gint8 strength); + +guint32 nm_ap_get_freq (NMAccessPoint *ap); +void nm_ap_set_freq (NMAccessPoint *ap, guint32 freq); + +guint32 nm_ap_get_max_bitrate (NMAccessPoint *ap); +void nm_ap_set_max_bitrate (NMAccessPoint *ap, guint32 bitrate); + +gboolean nm_ap_get_fake (const NMAccessPoint *ap); +void nm_ap_set_fake (NMAccessPoint *ap, gboolean fake); + +gboolean nm_ap_get_broadcast (NMAccessPoint *ap); +void nm_ap_set_broadcast (NMAccessPoint *ap, gboolean broadcast); + +glong nm_ap_get_last_seen (const NMAccessPoint *ap); +void nm_ap_set_last_seen (NMAccessPoint *ap, const glong last_seen); + +gboolean nm_ap_get_user_created (const NMAccessPoint *ap); +void nm_ap_set_user_created (NMAccessPoint *ap, gboolean user_created); + +GSList * nm_ap_get_user_addresses (const NMAccessPoint *ap); +void nm_ap_set_user_addresses (NMAccessPoint *ap, GSList *list); + +guint32 nm_ap_add_security_from_ie (guint32 flags, + const guint8 *wpa_ie, + guint32 length); + +gboolean nm_ap_check_compatible (NMAccessPoint *self, + NMConnection *connection); + +NMAccessPoint * nm_ap_match_in_list (NMAccessPoint *find_ap, + GSList *ap_list, + gboolean strict_match); + +void nm_ap_print_self (NMAccessPoint *ap, const char * prefix); + +guint32 freq_to_channel (guint32 freq); +guint32 channel_to_freq (guint32 channel, const char *band); + +#endif /* NM_ACCESS_POINT_H */ diff --git a/src/ppp-manager/Makefile.am b/src/ppp-manager/Makefile.am new file mode 100644 index 00000000..2dc7ad94 --- /dev/null +++ b/src/ppp-manager/Makefile.am @@ -0,0 +1,58 @@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ + -I${top_builddir}/marshallers + +noinst_LTLIBRARIES = libppp-manager.la + +libppp_manager_la_SOURCES = \ + nm-ppp-manager.c \ + nm-ppp-manager.h \ + nm-ppp-status.h + +nm-ppp-manager-glue.h: $(top_srcdir)/introspection/nm-ppp-manager.xml + dbus-binding-tool --prefix=nm_ppp_manager --mode=glib-server --output=$@ $< + +built_sources = nm-ppp-manager-glue.h + +$(libppp_manager_la_OBJECTS): $(built_sources) + +libppp_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBDIR=\"$(libdir)\" \ + -DPLUGINDIR=\"$(PPPD_PLUGIN_DIR)\" + +libppp_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +pppd_plugindir = $(PPPD_PLUGIN_DIR) +pppd_plugin_LTLIBRARIES = nm-pppd-plugin.la + +nm_pppd_plugin_la_SOURCES = \ + nm-pppd-plugin.c \ + nm-pppd-plugin.h \ + nm-ppp-status.h + +nm_pppd_plugin_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) + +nm_pppd_plugin_la_LDFLAGS = -module -avoid-version + +nm_pppd_plugin_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +BUILT_SOURCES = nm-ppp-manager-glue.h + +CLEANFILES = $(BUILT_SOURCES) + diff --git a/src/ppp-manager/Makefile.in b/src/ppp-manager/Makefile.in new file mode 100644 index 00000000..59cb32ba --- /dev/null +++ b/src/ppp-manager/Makefile.in @@ -0,0 +1,679 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/ppp-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pppd_plugindir)" +LTLIBRARIES = $(noinst_LTLIBRARIES) $(pppd_plugin_LTLIBRARIES) +am__DEPENDENCIES_1 = +libppp_manager_la_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libppp_manager_la_OBJECTS = libppp_manager_la-nm-ppp-manager.lo +libppp_manager_la_OBJECTS = $(am_libppp_manager_la_OBJECTS) +nm_pppd_plugin_la_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_nm_pppd_plugin_la_OBJECTS = nm_pppd_plugin_la-nm-pppd-plugin.lo +nm_pppd_plugin_la_OBJECTS = $(am_nm_pppd_plugin_la_OBJECTS) +nm_pppd_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(nm_pppd_plugin_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libppp_manager_la_SOURCES) $(nm_pppd_plugin_la_SOURCES) +DIST_SOURCES = $(libppp_manager_la_SOURCES) \ + $(nm_pppd_plugin_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ + -I${top_builddir}/marshallers + +noinst_LTLIBRARIES = libppp-manager.la +libppp_manager_la_SOURCES = \ + nm-ppp-manager.c \ + nm-ppp-manager.h \ + nm-ppp-status.h + +built_sources = nm-ppp-manager-glue.h +libppp_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLIBDIR=\"$(libdir)\" \ + -DPLUGINDIR=\"$(PPPD_PLUGIN_DIR)\" + +libppp_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +pppd_plugindir = $(PPPD_PLUGIN_DIR) +pppd_plugin_LTLIBRARIES = nm-pppd-plugin.la +nm_pppd_plugin_la_SOURCES = \ + nm-pppd-plugin.c \ + nm-pppd-plugin.h \ + nm-ppp-status.h + +nm_pppd_plugin_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) + +nm_pppd_plugin_la_LDFLAGS = -module -avoid-version +nm_pppd_plugin_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +BUILT_SOURCES = nm-ppp-manager-glue.h +CLEANFILES = $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ppp-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/ppp-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +install-pppd_pluginLTLIBRARIES: $(pppd_plugin_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pppd_plugindir)" || $(MKDIR_P) "$(DESTDIR)$(pppd_plugindir)" + @list='$(pppd_plugin_LTLIBRARIES)'; test -n "$(pppd_plugindir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pppd_plugindir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pppd_plugindir)"; \ + } + +uninstall-pppd_pluginLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pppd_plugin_LTLIBRARIES)'; test -n "$(pppd_plugindir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pppd_plugindir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pppd_plugindir)/$$f"; \ + done + +clean-pppd_pluginLTLIBRARIES: + -test -z "$(pppd_plugin_LTLIBRARIES)" || rm -f $(pppd_plugin_LTLIBRARIES) + @list='$(pppd_plugin_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libppp-manager.la: $(libppp_manager_la_OBJECTS) $(libppp_manager_la_DEPENDENCIES) + $(LINK) $(libppp_manager_la_OBJECTS) $(libppp_manager_la_LIBADD) $(LIBS) +nm-pppd-plugin.la: $(nm_pppd_plugin_la_OBJECTS) $(nm_pppd_plugin_la_DEPENDENCIES) + $(nm_pppd_plugin_la_LINK) -rpath $(pppd_plugindir) $(nm_pppd_plugin_la_OBJECTS) $(nm_pppd_plugin_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libppp_manager_la-nm-ppp-manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm_pppd_plugin_la-nm-pppd-plugin.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libppp_manager_la-nm-ppp-manager.lo: nm-ppp-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libppp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libppp_manager_la-nm-ppp-manager.lo -MD -MP -MF $(DEPDIR)/libppp_manager_la-nm-ppp-manager.Tpo -c -o libppp_manager_la-nm-ppp-manager.lo `test -f 'nm-ppp-manager.c' || echo '$(srcdir)/'`nm-ppp-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libppp_manager_la-nm-ppp-manager.Tpo $(DEPDIR)/libppp_manager_la-nm-ppp-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ppp-manager.c' object='libppp_manager_la-nm-ppp-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libppp_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libppp_manager_la-nm-ppp-manager.lo `test -f 'nm-ppp-manager.c' || echo '$(srcdir)/'`nm-ppp-manager.c + +nm_pppd_plugin_la-nm-pppd-plugin.lo: nm-pppd-plugin.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_pppd_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm_pppd_plugin_la-nm-pppd-plugin.lo -MD -MP -MF $(DEPDIR)/nm_pppd_plugin_la-nm-pppd-plugin.Tpo -c -o nm_pppd_plugin_la-nm-pppd-plugin.lo `test -f 'nm-pppd-plugin.c' || echo '$(srcdir)/'`nm-pppd-plugin.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/nm_pppd_plugin_la-nm-pppd-plugin.Tpo $(DEPDIR)/nm_pppd_plugin_la-nm-pppd-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-pppd-plugin.c' object='nm_pppd_plugin_la-nm-pppd-plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nm_pppd_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm_pppd_plugin_la-nm-pppd-plugin.lo `test -f 'nm-pppd-plugin.c' || echo '$(srcdir)/'`nm-pppd-plugin.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pppd_plugindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-pppd_pluginLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pppd_pluginLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pppd_pluginLTLIBRARIES + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES \ + clean-pppd_pluginLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pppd_pluginLTLIBRARIES install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-pppd_pluginLTLIBRARIES + + +nm-ppp-manager-glue.h: $(top_srcdir)/introspection/nm-ppp-manager.xml + dbus-binding-tool --prefix=nm_ppp_manager --mode=glib-server --output=$@ $< + +$(libppp_manager_la_OBJECTS): $(built_sources) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c new file mode 100644 index 00000000..148ad2cf --- /dev/null +++ b/src/ppp-manager/nm-ppp-manager.c @@ -0,0 +1,1058 @@ +/* -*- 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) 2008 Novell, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#ifndef aligned_u64 +#define aligned_u64 unsigned long long __attribute__((aligned(8))) +#endif +#include + +#include "NetworkManager.h" +#include "nm-glib-compat.h" +#include "nm-ppp-manager.h" +#include "nm-setting-connection.h" +#include "nm-setting-ppp.h" +#include "nm-setting-pppoe.h" +#include "nm-setting-gsm.h" +#include "nm-setting-cdma.h" +#include "nm-dbus-manager.h" +#include "nm-logging.h" +#include "nm-marshal.h" + +static void impl_ppp_manager_need_secrets (NMPPPManager *manager, + DBusGMethodInvocation *context); + +static gboolean impl_ppp_manager_set_state (NMPPPManager *manager, + guint32 state, + GError **err); + +static gboolean impl_ppp_manager_set_ip4_config (NMPPPManager *manager, + GHashTable *config, + GError **err); + +#include "nm-ppp-manager-glue.h" + +#define NM_PPPD_PLUGIN PLUGINDIR "/nm-pppd-plugin.so" +#define PPP_MANAGER_SECRET_TRIES "ppp-manager-secret-tries" + +typedef struct { + GPid pid; + NMDBusManager *dbus_manager; + char *dbus_path; + + char *parent_iface; + + NMActRequest *act_req; + DBusGMethodInvocation *pending_secrets_context; + + guint32 ppp_watch_id; + guint32 ppp_timeout_handler; + + /* Monitoring */ + char *ip_iface; + int monitor_fd; + guint monitor_id; +} NMPPPManagerPrivate; + +#define NM_PPP_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_PPP_MANAGER, NMPPPManagerPrivate)) + +G_DEFINE_TYPE (NMPPPManager, nm_ppp_manager, G_TYPE_OBJECT) + +enum { + STATE_CHANGED, + IP4_CONFIG, + STATS, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_PARENT_IFACE, + LAST_PROP +}; + +typedef enum { + NM_PPP_MANAGER_ERROR_UNKOWN +} NMPPPManagerError; + +GQuark +nm_ppp_manager_error_quark (void) +{ + static GQuark quark; + + if (!quark) + quark = g_quark_from_static_string ("nm_ppp_manager_error"); + + return quark; +} + +static void +nm_ppp_manager_init (NMPPPManager *manager) +{ +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMPPPManagerPrivate *priv; + DBusGConnection *connection; + static guint32 counter = 0; + + object = G_OBJECT_CLASS (nm_ppp_manager_parent_class)->constructor (type, + n_construct_params, + construct_params); + if (!object) + return NULL; + + priv = NM_PPP_MANAGER_GET_PRIVATE (object); + priv->dbus_manager = nm_dbus_manager_get (); + if (!priv->dbus_manager) { + g_object_unref (object); + return NULL; + } + + connection = nm_dbus_manager_get_connection (priv->dbus_manager); + priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/PPP/%d", counter++); + dbus_g_connection_register_g_object (connection, priv->dbus_path, object); + + return object; +} + +static void +dispose (GObject *object) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); + + nm_ppp_manager_stop (NM_PPP_MANAGER (object)); + + g_object_unref (priv->act_req); + g_object_unref (priv->dbus_manager); + + G_OBJECT_CLASS (nm_ppp_manager_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); + + g_free (priv->ip_iface); + g_free (priv->parent_iface); + + G_OBJECT_CLASS (nm_ppp_manager_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PARENT_IFACE: + if (priv->parent_iface) + g_free (priv->parent_iface); + priv->parent_iface = g_value_dup_string (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) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_PARENT_IFACE: + g_value_set_string (value, priv->parent_iface); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_ppp_manager_class_init (NMPPPManagerClass *manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (manager_class); + + g_type_class_add_private (manager_class, sizeof (NMPPPManagerPrivate)); + + object_class->constructor = constructor; + object_class->dispose = dispose; + object_class->finalize = finalize; + object_class->get_property = get_property; + object_class->set_property = set_property; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_PARENT_IFACE, + g_param_spec_string (NM_PPP_MANAGER_PARENT_IFACE, + "ParentIface", + "Parent interface", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /* signals */ + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMPPPManagerClass, state_changed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, + G_TYPE_UINT); + + signals[IP4_CONFIG] = + g_signal_new ("ip4-config", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMPPPManagerClass, ip4_config), + NULL, NULL, + _nm_marshal_VOID__STRING_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_STRING, + G_TYPE_OBJECT); + + signals[STATS] = + g_signal_new ("stats", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMPPPManagerClass, stats), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (manager_class), + &dbus_glib_nm_ppp_manager_object_info); +} + +NMPPPManager * +nm_ppp_manager_new (const char *iface) +{ + g_return_val_if_fail (iface != NULL, NULL); + + return (NMPPPManager *) g_object_new (NM_TYPE_PPP_MANAGER, + NM_PPP_MANAGER_PARENT_IFACE, iface, + NULL); +} + +/*******************************************/ + +static gboolean +monitor_cb (gpointer user_data) +{ + NMPPPManager *manager = NM_PPP_MANAGER (user_data); + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + struct ifpppstatsreq req; + + memset (&req, 0, sizeof (req)); + req.stats_ptr = (caddr_t) &req.stats; + + strncpy (req.ifr__name, priv->ip_iface, sizeof (req.ifr__name)); + if (ioctl (priv->monitor_fd, SIOCGPPPSTATS, &req) < 0) { + nm_log_warn (LOGD_PPP, "could not read ppp stats: %s", strerror (errno)); + } else { + g_signal_emit (manager, signals[STATS], 0, + req.stats.p.ppp_ibytes, + req.stats.p.ppp_obytes); + } + + return TRUE; +} + +static void +monitor_stats (NMPPPManager *manager) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + + priv->monitor_fd = socket (AF_INET, SOCK_DGRAM, 0); + if (priv->monitor_fd > 0) + priv->monitor_id = g_timeout_add_seconds (5, monitor_cb, manager); + else + nm_log_warn (LOGD_PPP, "could not monitor PPP stats: %s", strerror (errno)); +} + +/*******************************************/ + +static void +remove_timeout_handler (NMPPPManager *manager) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + + if (priv->ppp_timeout_handler) { + g_source_remove (priv->ppp_timeout_handler); + priv->ppp_timeout_handler = 0; + } +} + +static void +impl_ppp_manager_need_secrets (NMPPPManager *manager, + DBusGMethodInvocation *context) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + NMConnection *connection; + NMSettingConnection *s_con; + const char *connection_type; + const char *setting_name; + guint32 tries; + GPtrArray *hints = NULL; + const char *hint1 = NULL, *hint2 = NULL; + + connection = nm_act_request_get_connection (priv->act_req); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + g_assert (s_con); + + connection_type = nm_setting_connection_get_connection_type (s_con); + g_assert (connection_type); + + nm_connection_clear_secrets (connection); + setting_name = nm_connection_need_secrets (connection, &hints); + if (!setting_name) { + NMSetting *setting; + + setting = nm_connection_get_setting_by_name (connection, connection_type); + if (setting) { + const char *username = NULL; + const char *password = NULL; + + /* FIXME: push this down to the settings and keep PPP manager generic */ + if (NM_IS_SETTING_PPPOE (setting)) { + username = nm_setting_pppoe_get_username (NM_SETTING_PPPOE (setting)); + password = nm_setting_pppoe_get_password (NM_SETTING_PPPOE (setting)); + } else if (NM_IS_SETTING_GSM (setting)) { + username = nm_setting_gsm_get_username (NM_SETTING_GSM (setting)); + password = nm_setting_gsm_get_password (NM_SETTING_GSM (setting)); + } else if (NM_IS_SETTING_CDMA (setting)) { + username = nm_setting_cdma_get_username (NM_SETTING_CDMA (setting)); + password = nm_setting_cdma_get_password (NM_SETTING_CDMA (setting)); + } + + /* If secrets are not required, send the existing username and password + * back to the PPP plugin immediately. + */ + priv->pending_secrets_context = context; + nm_ppp_manager_update_secrets (manager, + priv->parent_iface, + username ? username : "", + password ? password : "", + NULL); + } else { + GError *err = NULL; + + g_set_error (&err, NM_PPP_MANAGER_ERROR, NM_PPP_MANAGER_ERROR_UNKOWN, + "Missing type-specific setting; no secrets could be found."); + nm_log_warn (LOGD_PPP, "%s", err->message); + dbus_g_method_return_error (context, err); + } + return; + } + + /* Extract hints */ + if (hints) { + if (hints->len > 0) + hint1 = g_ptr_array_index (hints, 0); + if (hints->len > 1) + hint2 = g_ptr_array_index (hints, 1); + } + + tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), PPP_MANAGER_SECRET_TRIES)); + /* Only ask for completely new secrets after retrying them once; some PPP + * servers (T-Mobile USA) appear to ask a few times when they actually don't + * even care what you pass back. + */ + nm_act_request_get_secrets (priv->act_req, + setting_name, + tries > 1 ? TRUE : FALSE, + SECRETS_CALLER_PPP, + hint1, + hint2); + g_object_set_data (G_OBJECT (connection), PPP_MANAGER_SECRET_TRIES, GUINT_TO_POINTER (++tries)); + priv->pending_secrets_context = context; + + if (hints) + g_ptr_array_free (hints, TRUE); +} + +static gboolean impl_ppp_manager_set_state (NMPPPManager *manager, + guint32 state, + GError **err) +{ + g_signal_emit (manager, signals[STATE_CHANGED], 0, state); + + return TRUE; +} + +static gboolean +impl_ppp_manager_set_ip4_config (NMPPPManager *manager, + GHashTable *config_hash, + GError **err) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + NMConnection *connection; + NMSettingPPP *s_ppp; + NMIP4Config *config; + NMIP4Address *addr; + GValue *val; + int i; + + nm_log_info (LOGD_PPP, "PPP manager(IP Config Get) reply received."); + + remove_timeout_handler (manager); + + config = nm_ip4_config_new (); + addr = nm_ip4_address_new (); + nm_ip4_address_set_prefix (addr, 32); + + val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_GATEWAY); + if (val) { + nm_ip4_address_set_gateway (addr, g_value_get_uint (val)); + nm_ip4_config_set_ptp_address (config, g_value_get_uint (val)); + } + + val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_ADDRESS); + if (val) + nm_ip4_address_set_address (addr, g_value_get_uint (val)); + + val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_PREFIX); + if (val) + nm_ip4_address_set_prefix (addr, g_value_get_uint (val)); + + if (nm_ip4_address_get_address (addr) && nm_ip4_address_get_prefix (addr)) { + nm_ip4_config_take_address (config, addr); + } else { + nm_log_err (LOGD_PPP, "invalid IPv4 address received!"); + nm_ip4_address_unref (addr); + goto out; + } + + val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_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)); + } + + val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_WINS); + if (val) { + GArray *wins = (GArray *) g_value_get_boxed (val); + + for (i = 0; i < wins->len; i++) + nm_ip4_config_add_wins (config, g_array_index (wins, guint, i)); + } + + val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_INTERFACE); + if (!val || !G_VALUE_HOLDS_STRING (val)) { + nm_log_err (LOGD_PPP, "no interface received!"); + goto out; + } + priv->ip_iface = g_value_dup_string (val); + + /* Got successful IP4 config; obviously the secrets worked */ + connection = nm_act_request_get_connection (priv->act_req); + g_assert (connection); + g_object_set_data (G_OBJECT (connection), PPP_MANAGER_SECRET_TRIES, NULL); + + /* Merge in custom MTU */ + s_ppp = (NMSettingPPP *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP); + if (s_ppp) { + guint32 mtu = nm_setting_ppp_get_mtu (s_ppp); + + if (mtu) + nm_ip4_config_set_mtu (config, mtu); + } + + /* Push the IP4 config up to the device */ + g_signal_emit (manager, signals[IP4_CONFIG], 0, priv->ip_iface, config); + + monitor_stats (manager); + + out: + g_object_unref (config); + + return TRUE; +} + +/*******************************************/ + + + +typedef struct { + GPtrArray *array; + GStringChunk *chunk; +} NMCmdLine; + +static NMCmdLine * +nm_cmd_line_new (void) +{ + NMCmdLine *cmd; + + cmd = g_slice_new (NMCmdLine); + cmd->array = g_ptr_array_new (); + cmd->chunk = g_string_chunk_new (1024); + + return cmd; +} + +static void +nm_cmd_line_destroy (NMCmdLine *cmd) +{ + g_ptr_array_free (cmd->array, TRUE); + g_string_chunk_free (cmd->chunk); + g_slice_free (NMCmdLine, cmd); +} + +static char * +nm_cmd_line_to_str (NMCmdLine *cmd) +{ + char *str; + + g_ptr_array_add (cmd->array, NULL); + str = g_strjoinv (" ", (gchar **) cmd->array->pdata); + g_ptr_array_remove_index (cmd->array, cmd->array->len - 1); + + return str; +} + +static void +nm_cmd_line_add_string (NMCmdLine *cmd, const char *str) +{ + g_ptr_array_add (cmd->array, g_string_chunk_insert (cmd->chunk, str)); +} + +static void +nm_cmd_line_add_int (NMCmdLine *cmd, int i) +{ + char *str; + + str = g_strdup_printf ("%d", i); + nm_cmd_line_add_string (cmd, str); + g_free (str); +} + +/*******************************************/ + +static inline const char * +nm_find_pppd (void) +{ + static const char *pppd_binary_paths[] = { + "/usr/local/sbin/pppd", + "/usr/sbin/pppd", + "/sbin/pppd", + NULL + }; + + const char **pppd_binary = pppd_binary_paths; + + while (*pppd_binary != NULL) { + if (g_file_test (*pppd_binary, G_FILE_TEST_EXISTS)) + break; + pppd_binary++; + } + + return *pppd_binary; +} + +static void +ppp_exit_code (guint pppd_exit_status, GPid pid) +{ + const char *msg; + + switch (pppd_exit_status) { + case 1: + msg = "Fatal pppd error"; + break; + case 2: + msg = "pppd options error"; + break; + case 3: + msg = "No root priv error"; + break; + case 4: + msg = "No ppp module error"; + break; + case 5: + msg = "pppd received a signal"; + break; + case 6: + msg = "Serial port lock failed"; + break; + case 7: + msg = "Serial port open failed"; + break; + case 8: + msg = "Connect script failed"; + break; + case 9: + msg = "Pty program error"; + break; + case 10: + msg = "PPP negotiation failed"; + break; + case 11: + msg = "Peer didn't authenticatie itself"; + break; + case 12: + msg = "Link idle: Idle Seconds reached."; + break; + case 13: + msg = "Connect time limit reached."; + break; + case 14: + msg = "Callback negotiated, call should come back."; + break; + case 15: + msg = "Lack of LCP echo responses"; + break; + case 16: + msg = "A modem hung up the phone"; + break; + case 17: + msg = "Loopback detected"; + break; + case 18: + msg = "The init script failed"; + break; + case 19: + msg = "Authentication error.\n" + "We failed to authenticate ourselves to the peer.\n" + "Maybe bad account or password?"; + break; + default: + msg = "Unknown error"; + } + + nm_log_warn (LOGD_PPP, "pppd pid %d exited with error: %s", pid, msg); +} + +static void +ppp_watch_cb (GPid pid, gint status, gpointer user_data) +{ + NMPPPManager *manager = NM_PPP_MANAGER (user_data); + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + guint err; + + g_assert (pid == priv->pid); + + if (WIFEXITED (status)) { + err = WEXITSTATUS (status); + if (err != 0) + ppp_exit_code (err, priv->pid); + } else if (WIFSTOPPED (status)) { + nm_log_info (LOGD_PPP, "pppd pid %d stopped unexpectedly with signal %d", priv->pid, WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_info (LOGD_PPP, "pppd pid %d died with signal %d", priv->pid, WTERMSIG (status)); + } else + nm_log_info (LOGD_PPP, "pppd pid %d died from an unknown cause", priv->pid); + + nm_log_dbg (LOGD_PPP, "pppd pid %d cleaned up", priv->pid); + priv->pid = 0; + g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD); +} + +static gboolean +pppd_timed_out (gpointer data) +{ + NMPPPManager *manager = NM_PPP_MANAGER (data); + + nm_log_warn (LOGD_PPP, "pppd timed out or didn't initialize our dbus module"); + nm_ppp_manager_stop (manager); + + g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD); + + return FALSE; +} + +static NMCmdLine * +create_pppd_cmd_line (NMPPPManager *self, + NMSettingPPP *setting, + NMSettingPPPOE *pppoe, + const char *ppp_name, + GError **err) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (self); + const char *ppp_binary; + NMCmdLine *cmd; + const char *ppp_debug; + + ppp_binary = nm_find_pppd (); + if (!ppp_binary) { + g_set_error (err, NM_PPP_MANAGER_ERROR, NM_PPP_MANAGER_ERROR, + "Could not find ppp binary."); + return NULL; + } + + /* Create pppd command line */ + cmd = nm_cmd_line_new (); + nm_cmd_line_add_string (cmd, ppp_binary); + + nm_cmd_line_add_string (cmd, "nodetach"); + nm_cmd_line_add_string (cmd, "lock"); + + /* NM handles setting the default route */ + nm_cmd_line_add_string (cmd, "nodefaultroute"); + + ppp_debug = getenv ("NM_PPP_DEBUG"); + if (ppp_debug) + nm_cmd_line_add_string (cmd, "debug"); + + if (ppp_name) { + nm_cmd_line_add_string (cmd, "user"); + nm_cmd_line_add_string (cmd, ppp_name); + } + + if (pppoe) { + char *dev_str; + const char *pppoe_service; + + nm_cmd_line_add_string (cmd, "plugin"); + nm_cmd_line_add_string (cmd, "rp-pppoe.so"); + + dev_str = g_strdup_printf ("nic-%s", priv->parent_iface); + nm_cmd_line_add_string (cmd, dev_str); + g_free (dev_str); + + pppoe_service = nm_setting_pppoe_get_service (pppoe); + if (pppoe_service) { + nm_cmd_line_add_string (cmd, "rp_pppoe_service"); + nm_cmd_line_add_string (cmd, pppoe_service); + } + } else { + nm_cmd_line_add_string (cmd, priv->parent_iface); + /* Don't send some random address as the local address */ + nm_cmd_line_add_string (cmd, "noipdefault"); + } + + if (nm_setting_ppp_get_baud (setting)) + nm_cmd_line_add_int (cmd, nm_setting_ppp_get_baud (setting)); + + /* noauth by default, because we certainly don't have any information + * with which to verify anything the peer gives us if we ask it to + * authenticate itself, which is what 'auth' really means. + */ + nm_cmd_line_add_string (cmd, "noauth"); + + if (nm_setting_ppp_get_refuse_eap (setting)) + nm_cmd_line_add_string (cmd, "refuse-eap"); + if (nm_setting_ppp_get_refuse_pap (setting)) + nm_cmd_line_add_string (cmd, "refuse-pap"); + if (nm_setting_ppp_get_refuse_chap (setting)) + nm_cmd_line_add_string (cmd, "refuse-chap"); + if (nm_setting_ppp_get_refuse_mschap (setting)) + nm_cmd_line_add_string (cmd, "refuse-mschap"); + if (nm_setting_ppp_get_refuse_mschapv2 (setting)) + nm_cmd_line_add_string (cmd, "refuse-mschap-v2"); + if (nm_setting_ppp_get_nobsdcomp (setting)) + nm_cmd_line_add_string (cmd, "nobsdcomp"); + if (nm_setting_ppp_get_nodeflate (setting)) + nm_cmd_line_add_string (cmd, "nodeflate"); + if (nm_setting_ppp_get_require_mppe (setting)) + nm_cmd_line_add_string (cmd, "require-mppe"); + if (nm_setting_ppp_get_require_mppe_128 (setting)) + nm_cmd_line_add_string (cmd, "require-mppe-128"); + if (nm_setting_ppp_get_mppe_stateful (setting)) + nm_cmd_line_add_string (cmd, "mppe-stateful"); + if (nm_setting_ppp_get_crtscts (setting)) + nm_cmd_line_add_string (cmd, "crtscts"); + + /* Always ask for DNS, we don't have to use them if the connection + * overrides the returned servers. + */ + nm_cmd_line_add_string (cmd, "usepeerdns"); + + if (nm_setting_ppp_get_mru (setting)) { + nm_cmd_line_add_string (cmd, "mru"); + nm_cmd_line_add_int (cmd, nm_setting_ppp_get_mru (setting)); + } + + if (nm_setting_ppp_get_mtu (setting)) { + nm_cmd_line_add_string (cmd, "mtu"); + nm_cmd_line_add_int (cmd, nm_setting_ppp_get_mtu (setting)); + } + + nm_cmd_line_add_string (cmd, "lcp-echo-failure"); + nm_cmd_line_add_int (cmd, nm_setting_ppp_get_lcp_echo_failure (setting)); + + nm_cmd_line_add_string (cmd, "lcp-echo-interval"); + nm_cmd_line_add_int (cmd, nm_setting_ppp_get_lcp_echo_interval (setting)); + + nm_cmd_line_add_string (cmd, "ipparam"); + nm_cmd_line_add_string (cmd, priv->dbus_path); + + nm_cmd_line_add_string (cmd, "plugin"); + nm_cmd_line_add_string (cmd, NM_PPPD_PLUGIN); + + return cmd; +} + +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); +} + +static void +pppoe_fill_defaults (NMSettingPPP *setting) +{ + if (!nm_setting_ppp_get_mtu (setting)) + g_object_set (setting, NM_SETTING_PPP_MTU, (guint32) 1492, NULL); + + if (!nm_setting_ppp_get_mru (setting)) + g_object_set (setting, NM_SETTING_PPP_MRU, (guint32) 1492, NULL); + + if (!nm_setting_ppp_get_lcp_echo_interval (setting)) + g_object_set (setting, NM_SETTING_PPP_LCP_ECHO_INTERVAL, (guint32) 20, NULL); + + if (!nm_setting_ppp_get_lcp_echo_failure (setting)) + g_object_set (setting, NM_SETTING_PPP_LCP_ECHO_FAILURE, (guint32) 3, NULL); + + g_object_set (setting, + NM_SETTING_PPP_NOAUTH, TRUE, + NM_SETTING_PPP_NODEFLATE, TRUE, + NULL); + + /* FIXME: These commented settings should be set as well, update NMSettingPPP first. */ +#if 0 + setting->noipdefault = TRUE; + setting->default_asyncmap = TRUE; + setting->defaultroute = TRUE; + setting->hide_password = TRUE; + setting->noaccomp = TRUE; + setting->nopcomp = TRUE; + setting->novj = TRUE; + setting->novjccomp = TRUE; +#endif +} + +gboolean +nm_ppp_manager_start (NMPPPManager *manager, + NMActRequest *req, + const char *ppp_name, + guint32 timeout_secs, + GError **err) +{ + NMPPPManagerPrivate *priv; + NMConnection *connection; + NMSettingPPP *s_ppp; + gboolean s_ppp_created = FALSE; + NMSettingPPPOE *pppoe_setting; + 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); + + priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + + priv->pid = 0; + + /* Make sure /dev/ppp exists (bgo #533064) */ + if (stat ("/dev/ppp", &st) || !S_ISCHR (st.st_mode)) + ignored = system ("/sbin/modprobe ppp_generic"); + + connection = nm_act_request_get_connection (req); + g_assert (connection); + + s_ppp = (NMSettingPPP *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP); + if (!s_ppp) { + /* If the PPP settings are all default we may not have a PPP setting yet, + * so just make a default one here. + */ + s_ppp = NM_SETTING_PPP (nm_setting_ppp_new ()); + s_ppp_created = TRUE; + } + + pppoe_setting = (NMSettingPPPOE *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE); + if (pppoe_setting) + pppoe_fill_defaults (s_ppp); + + ppp_cmd = create_pppd_cmd_line (manager, s_ppp, pppoe_setting, ppp_name, err); + if (!ppp_cmd) + goto out; + + g_ptr_array_add (ppp_cmd->array, NULL); + + nm_log_info (LOGD_PPP, "starting PPP connection"); + + cmd_str = nm_cmd_line_to_str (ppp_cmd); + nm_log_dbg (LOGD_PPP, "command line: %s", cmd_str); + g_free (cmd_str); + + 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)) { + goto out; + } + + nm_log_info (LOGD_PPP, "pppd started with pid %d", priv->pid); + + priv->ppp_watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) ppp_watch_cb, manager); + priv->ppp_timeout_handler = g_timeout_add_seconds (timeout_secs, pppd_timed_out, manager); + priv->act_req = g_object_ref (req); + + out: + if (s_ppp_created) + g_object_unref (s_ppp); + + if (ppp_cmd) + nm_cmd_line_destroy (ppp_cmd); + + return priv->pid > 0; +} + +void +nm_ppp_manager_update_secrets (NMPPPManager *manager, + const char *device, + const char *username, + const char *password, + const char *error_message) +{ + NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + + g_return_if_fail (NM_IS_PPP_MANAGER (manager)); + g_return_if_fail (device != NULL); + g_return_if_fail (priv->pending_secrets_context != NULL); + + if (error_message) { + g_return_if_fail (username == NULL); + g_return_if_fail (password == NULL); + } else { + g_return_if_fail (username != NULL); + g_return_if_fail (password != NULL); + } + + if (error_message) { + GError *err = NULL; + + g_set_error (&err, NM_PPP_MANAGER_ERROR, NM_PPP_MANAGER_ERROR_UNKOWN, "%s", error_message); + nm_log_warn (LOGD_PPP, "%s", error_message); + dbus_g_method_return_error (priv->pending_secrets_context, err); + g_error_free (err); + } else { + /* This is sort of a hack but... + pppd plugin only ever needs username and password. + Passing the full connection there would mean some bloat: + the plugin would need to link against libnm-util just to parse this. + So instead, let's just send what it needs */ + + dbus_g_method_return (priv->pending_secrets_context, username, password); + } + priv->pending_secrets_context = NULL; +} + +static gboolean +ensure_killed (gpointer data) +{ + int pid = GPOINTER_TO_INT (data); + + if (kill (pid, 0) == 0) + kill (pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_PPP, "waiting for pppd pid %d to exit", pid); + waitpid (pid, NULL, 0); + nm_log_dbg (LOGD_PPP, "pppd pid %d cleaned up", pid); + + return FALSE; +} + +void +nm_ppp_manager_stop (NMPPPManager *manager) +{ + NMPPPManagerPrivate *priv; + + g_return_if_fail (NM_IS_PPP_MANAGER (manager)); + + priv = NM_PPP_MANAGER_GET_PRIVATE (manager); + + if (priv->monitor_id) { + g_source_remove (priv->monitor_id); + priv->monitor_id = 0; + } + + if (priv->monitor_fd) { + /* Get the stats one last time */ + monitor_cb (manager); + close (priv->monitor_fd); + priv->monitor_fd = 0; + } + + if (priv->ppp_timeout_handler) { + g_source_remove (priv->ppp_timeout_handler); + priv->ppp_timeout_handler = 0; + } + + if (priv->ppp_watch_id) { + g_source_remove (priv->ppp_watch_id); + priv->ppp_watch_id = 0; + } + + if (priv->pid) { + if (kill (priv->pid, SIGTERM) == 0) + g_timeout_add_seconds (2, ensure_killed, GINT_TO_POINTER (priv->pid)); + else { + kill (priv->pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_PPP, "waiting for pppd pid %d to exit", priv->pid); + waitpid (priv->pid, NULL, 0); + nm_log_dbg (LOGD_PPP, "pppd pid %d cleaned up", priv->pid); + } + + priv->pid = 0; + } +} diff --git a/src/ppp-manager/nm-ppp-manager.h b/src/ppp-manager/nm-ppp-manager.h new file mode 100644 index 00000000..a0200973 --- /dev/null +++ b/src/ppp-manager/nm-ppp-manager.h @@ -0,0 +1,80 @@ +/* -*- 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) 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_PPP_MANAGER_H +#define NM_PPP_MANAGER_H + +#include +#include + +#include "nm-ppp-status.h" +#include "nm-activation-request.h" +#include "nm-connection.h" +#include "nm-ip4-config.h" +#include "nm-pppd-plugin.h" + +#define NM_TYPE_PPP_MANAGER (nm_ppp_manager_get_type ()) +#define NM_PPP_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_PPP_MANAGER, NMPPPManager)) +#define NM_PPP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_PPP_MANAGER, NMPPPManagerClass)) +#define NM_IS_PPP_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_PPP_MANAGER)) +#define NM_IS_PPP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_PPP_MANAGER)) +#define NM_PPP_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_PPP_MANAGER, NMPPPManagerClass)) + +#define NM_PPP_MANAGER_PARENT_IFACE "parent-iface" + +typedef struct { + GObject parent; +} NMPPPManager; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*state_changed) (NMPPPManager *manager, NMPPPStatus status); + void (*ip4_config) (NMPPPManager *manager, const char *iface, NMIP4Config *config); + void (*stats) (NMPPPManager *manager, guint32 in_bytes, guint32 out_bytes); +} NMPPPManagerClass; + +GType nm_ppp_manager_get_type (void); + +NMPPPManager *nm_ppp_manager_new (const char *iface); + +gboolean nm_ppp_manager_start (NMPPPManager *manager, + NMActRequest *req, + const char *ppp_name, + guint32 timeout_secs, + GError **err); + +void nm_ppp_manager_update_secrets (NMPPPManager *manager, + const char *device, + const char *username, + const char *password, + const char *error_message); + +void nm_ppp_manager_stop (NMPPPManager *manager); + + +#define NM_PPP_MANAGER_ERROR nm_ppp_manager_error_quark() +#define NM_TYPE_PPP_MANAGER_ERROR (nm_ppp_manager_error_get_type ()) + +GQuark nm_ppp_manager_error_quark (void); + +#endif /* NM_PPP_MANAGER_H */ diff --git a/src/ppp-manager/nm-ppp-status.h b/src/ppp-manager/nm-ppp-status.h new file mode 100644 index 00000000..cfc7c393 --- /dev/null +++ b/src/ppp-manager/nm-ppp-status.h @@ -0,0 +1,43 @@ +/* -*- 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) 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_PPP_STATUS_H +#define NM_PPP_STATUS_H + +typedef enum { + NM_PPP_STATUS_UNKNOWN, + + NM_PPP_STATUS_DEAD, + NM_PPP_STATUS_INITIALIZE, + NM_PPP_STATUS_SERIALCONN, + NM_PPP_STATUS_DORMANT, + NM_PPP_STATUS_ESTABLISH, + NM_PPP_STATUS_AUTHENTICATE, + NM_PPP_STATUS_CALLBACK, + NM_PPP_STATUS_NETWORK, + NM_PPP_STATUS_RUNNING, + NM_PPP_STATUS_TERMINATE, + NM_PPP_STATUS_DISCONNECT, + NM_PPP_STATUS_HOLDOFF, + NM_PPP_STATUS_MASTER +} NMPPPStatus; + +#endif /* NM_PPP_STATUS_H */ diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c new file mode 100644 index 00000000..c64bb87f --- /dev/null +++ b/src/ppp-manager/nm-pppd-plugin.c @@ -0,0 +1,359 @@ +/* -*- 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) 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "NetworkManager.h" +#include "nm-pppd-plugin.h" +#include "nm-ppp-status.h" +#include "nm-dbus-glib-types.h" + +int plugin_init (void); + +char pppd_version[] = VERSION; + +static DBusGProxy *proxy = NULL; + +static void +nm_phasechange (void *data, int arg) +{ + NMPPPStatus ppp_status = NM_PPP_STATUS_UNKNOWN; + char *ppp_phase; + + g_return_if_fail (DBUS_IS_G_PROXY (proxy)); + + switch (arg) { + case PHASE_DEAD: + ppp_status = NM_PPP_STATUS_DEAD; + ppp_phase = "dead"; + break; + case PHASE_INITIALIZE: + ppp_status = NM_PPP_STATUS_INITIALIZE; + ppp_phase = "initialize"; + break; + case PHASE_SERIALCONN: + ppp_status = NM_PPP_STATUS_SERIALCONN; + ppp_phase = "serial connection"; + break; + case PHASE_DORMANT: + ppp_status = NM_PPP_STATUS_DORMANT; + ppp_phase = "dormant"; + break; + case PHASE_ESTABLISH: + ppp_status = NM_PPP_STATUS_ESTABLISH; + ppp_phase = "establish"; + break; + case PHASE_AUTHENTICATE: + ppp_status = NM_PPP_STATUS_AUTHENTICATE; + ppp_phase = "authenticate"; + break; + case PHASE_CALLBACK: + ppp_status = NM_PPP_STATUS_CALLBACK; + ppp_phase = "callback"; + break; + case PHASE_NETWORK: + ppp_status = NM_PPP_STATUS_NETWORK; + ppp_phase = "network"; + break; + case PHASE_RUNNING: + ppp_status = NM_PPP_STATUS_RUNNING; + ppp_phase = "running"; + break; + case PHASE_TERMINATE: + ppp_status = NM_PPP_STATUS_TERMINATE; + ppp_phase = "terminate"; + break; + case PHASE_DISCONNECT: + ppp_status = NM_PPP_STATUS_DISCONNECT; + ppp_phase = "disconnect"; + break; + case PHASE_HOLDOFF: + ppp_status = NM_PPP_STATUS_HOLDOFF; + ppp_phase = "holdoff"; + break; + case PHASE_MASTER: + ppp_status = NM_PPP_STATUS_MASTER; + ppp_phase = "master"; + break; + + default: + ppp_phase = "unknown"; + break; + } + + g_message ("nm-ppp-plugin: (%s): status %d / phase '%s'", + __func__, + ppp_status, + ppp_phase); + + if (ppp_status != NM_PPP_STATUS_UNKNOWN) { + dbus_g_proxy_call_no_reply (proxy, "SetState", + G_TYPE_UINT, ppp_status, G_TYPE_INVALID, + G_TYPE_INVALID); + } +} + +static GValue * +str_to_gvalue (const char *str) +{ + GValue *val; + + val = g_slice_new0 (GValue); + g_value_init (val, G_TYPE_STRING); + g_value_set_string (val, str); + + return val; +} + +static GValue * +uint_to_gvalue (guint32 i) +{ + GValue *val; + + val = g_slice_new0 (GValue); + g_value_init (val, G_TYPE_UINT); + g_value_set_uint (val, i); + + return val; +} + +static void +value_destroy (gpointer data) +{ + GValue *val = (GValue *) data; + + g_value_unset (val); + g_slice_free (GValue, val); +} + +static void +nm_ip_up (void *data, int arg) +{ + ipcp_options opts = ipcp_gotoptions[0]; + ipcp_options peer_opts = ipcp_hisoptions[0]; + GHashTable *hash; + GArray *array; + GValue *val; + guint32 pppd_made_up_address = htonl (0x0a404040 + ifunit); + + g_return_if_fail (DBUS_IS_G_PROXY (proxy)); + + g_message ("nm-ppp-plugin: (%s): ip-up event", __func__); + + if (!opts.ouraddr) { + g_warning ("nm-ppp-plugin: (%s): didn't receive an internal IP from pppd!", __func__); + nm_phasechange (NULL, PHASE_DEAD); + return; + } + + hash = g_hash_table_new_full (g_str_hash, g_str_equal, + NULL, value_destroy); + + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_INTERFACE, + str_to_gvalue (ifname)); + + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_ADDRESS, + uint_to_gvalue (opts.ouraddr)); + + /* Prefer the peer options remote address first, _unless_ pppd made the + * address up, at which point prefer the local options remote address, + * and if that's not right, use the made-up address as a last resort. + */ + if (peer_opts.hisaddr && (peer_opts.hisaddr != pppd_made_up_address)) { + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, + uint_to_gvalue (peer_opts.hisaddr)); + } else if (opts.hisaddr) { + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, + uint_to_gvalue (opts.hisaddr)); + } else if (peer_opts.hisaddr == pppd_made_up_address) { + /* As a last resort, use the made-up address */ + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_GATEWAY, + uint_to_gvalue (peer_opts.hisaddr)); + } + + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_PREFIX, uint_to_gvalue (32)); + + if (opts.dnsaddr[0] || opts.dnsaddr[1]) { + array = g_array_new (FALSE, FALSE, sizeof (guint32)); + + if (opts.dnsaddr[0]) + g_array_append_val (array, opts.dnsaddr[0]); + if (opts.dnsaddr[1]) + g_array_append_val (array, opts.dnsaddr[1]); + + val = g_slice_new0 (GValue); + g_value_init (val, DBUS_TYPE_G_UINT_ARRAY); + g_value_set_boxed (val, array); + + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_DNS, val); + } + + if (opts.winsaddr[0] || opts.winsaddr[1]) { + array = g_array_new (FALSE, FALSE, sizeof (guint32)); + + if (opts.winsaddr[0]) + g_array_append_val (array, opts.winsaddr[0]); + if (opts.winsaddr[1]) + g_array_append_val (array, opts.winsaddr[1]); + + val = g_slice_new0 (GValue); + g_value_init (val, DBUS_TYPE_G_UINT_ARRAY); + g_value_set_boxed (val, array); + + g_hash_table_insert (hash, NM_PPP_IP4_CONFIG_WINS, val); + } + + g_message ("nm-ppp-plugin: (%s): sending Ip4Config to NetworkManager...", __func__); + + dbus_g_proxy_call_no_reply (proxy, "SetIp4Config", + DBUS_TYPE_G_MAP_OF_VARIANT, hash, G_TYPE_INVALID, + G_TYPE_INVALID); + + g_hash_table_destroy (hash); +} + +static int +get_chap_check() +{ + return 1; +} + +static int +get_pap_check() +{ + return 1; +} + +static int +get_credentials (char *username, char *password) +{ + char *my_username = NULL; + char *my_password = NULL; + size_t len; + GError *err = NULL; + + if (username && !password) { + /* pppd is checking pap support; return 1 for supported */ + return 1; + } + + g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), -1); + + g_message ("nm-ppp-plugin: (%s): passwd-hook, requesting credentials...", __func__); + + dbus_g_proxy_call (proxy, "NeedSecrets", &err, + G_TYPE_INVALID, + G_TYPE_STRING, &my_username, + G_TYPE_STRING, &my_password, + G_TYPE_INVALID); + + if (err) { + g_warning ("nm-ppp-plugin: (%s): could not get secrets: (%d) %s", + __func__, + err ? err->code : -1, + err->message ? err->message : "(unknown)"); + g_error_free (err); + return -1; + } + + g_message ("nm-ppp-plugin: (%s): got credentials from NetworkManager", __func__); + + if (my_username) { + len = strlen (my_username) + 1; + len = len < MAXNAMELEN ? len : MAXNAMELEN; + + strncpy (username, my_username, len); + username[len - 1] = '\0'; + + g_free (my_username); + } + + if (my_password) { + len = strlen (my_password) + 1; + len = len < MAXSECRETLEN ? len : MAXSECRETLEN; + + strncpy (password, my_password, len); + password[len - 1] = '\0'; + + g_free (my_password); + } + + return 1; +} + +static void +nm_exit_notify (void *data, int arg) +{ + g_return_if_fail (DBUS_IS_G_PROXY (proxy)); + + g_message ("nm-ppp-plugin: (%s): cleaning up", __func__); + + g_object_unref (proxy); + proxy = NULL; +} + +int +plugin_init (void) +{ + DBusGConnection *bus; + GError *err = NULL; + + g_type_init (); + + g_message ("nm-ppp-plugin: (%s): initializing", __func__); + + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err); + if (!bus) { + g_warning ("nm-pppd-plugin: (%s): couldn't connect to system bus: (%d) %s", + __func__, + err ? err->code : -1, + err && err->message ? err->message : "(unknown)"); + g_error_free (err); + return -1; + } + + /* NM passes in the object path of the corresponding PPPManager + * object as the 'ipparam' argument to pppd. + */ + proxy = dbus_g_proxy_new_for_name (bus, NM_DBUS_SERVICE, ipparam, NM_DBUS_INTERFACE_PPP); + + dbus_g_connection_unref (bus); + + chap_passwd_hook = get_credentials; + chap_check_hook = get_chap_check; + pap_passwd_hook = get_credentials; + pap_check_hook = get_pap_check; + + add_notifier (&phasechange, nm_phasechange, NULL); + add_notifier (&ip_up_notifier, nm_ip_up, NULL); + add_notifier (&exitnotify, nm_exit_notify, proxy); + + return 0; +} diff --git a/src/ppp-manager/nm-pppd-plugin.h b/src/ppp-manager/nm-pppd-plugin.h new file mode 100644 index 00000000..95a2a182 --- /dev/null +++ b/src/ppp-manager/nm-pppd-plugin.h @@ -0,0 +1,29 @@ +/* -*- 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) 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#define NM_DBUS_INTERFACE_PPP "org.freedesktop.NetworkManager.PPP" + +#define NM_PPP_IP4_CONFIG_INTERFACE "interface" +#define NM_PPP_IP4_CONFIG_ADDRESS "address" +#define NM_PPP_IP4_CONFIG_PREFIX "prefix" +#define NM_PPP_IP4_CONFIG_GATEWAY "gateway" +#define NM_PPP_IP4_CONFIG_DNS "dns" +#define NM_PPP_IP4_CONFIG_WINS "wins" diff --git a/src/supplicant-manager/Makefile.am b/src/supplicant-manager/Makefile.am new file mode 100644 index 00000000..e59ae843 --- /dev/null +++ b/src/supplicant-manager/Makefile.am @@ -0,0 +1,35 @@ +SUBDIRS=. tests + +INCLUDES = \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/named-manager + +noinst_LTLIBRARIES = libsupplicant-manager.la + +libsupplicant_manager_la_SOURCES = \ + nm-supplicant-types.h \ + nm-supplicant-manager.h \ + nm-supplicant-manager.c \ + nm-supplicant-config.h \ + nm-supplicant-config.c \ + nm-supplicant-interface.c \ + nm-supplicant-interface.h \ + nm-supplicant-settings-verify.h \ + nm-supplicant-settings-verify.c + +libsupplicant_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ + -DNM_LOCALSTATEDIR=\"$(localstatedir)\" + +libsupplicant_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + diff --git a/src/supplicant-manager/Makefile.in b/src/supplicant-manager/Makefile.in new file mode 100644 index 00000000..9d326ba7 --- /dev/null +++ b/src/supplicant-manager/Makefile.in @@ -0,0 +1,760 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/supplicant-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libsupplicant_manager_la_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libsupplicant_manager_la_OBJECTS = \ + libsupplicant_manager_la-nm-supplicant-manager.lo \ + libsupplicant_manager_la-nm-supplicant-config.lo \ + libsupplicant_manager_la-nm-supplicant-interface.lo \ + libsupplicant_manager_la-nm-supplicant-settings-verify.lo +libsupplicant_manager_la_OBJECTS = \ + $(am_libsupplicant_manager_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libsupplicant_manager_la_SOURCES) +DIST_SOURCES = $(libsupplicant_manager_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = . tests +INCLUDES = \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/named-manager + +noinst_LTLIBRARIES = libsupplicant-manager.la +libsupplicant_manager_la_SOURCES = \ + nm-supplicant-types.h \ + nm-supplicant-manager.h \ + nm-supplicant-manager.c \ + nm-supplicant-config.h \ + nm-supplicant-config.c \ + nm-supplicant-interface.c \ + nm-supplicant-interface.h \ + nm-supplicant-settings-verify.h \ + nm-supplicant-settings-verify.c + +libsupplicant_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DNM_PKGDATADIR=\"$(pkgdatadir)\" \ + -DNM_LOCALSTATEDIR=\"$(localstatedir)\" + +libsupplicant_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/supplicant-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/supplicant-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libsupplicant-manager.la: $(libsupplicant_manager_la_OBJECTS) $(libsupplicant_manager_la_DEPENDENCIES) + $(LINK) $(libsupplicant_manager_la_OBJECTS) $(libsupplicant_manager_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsupplicant_manager_la-nm-supplicant-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsupplicant_manager_la-nm-supplicant-interface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsupplicant_manager_la-nm-supplicant-manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsupplicant_manager_la-nm-supplicant-settings-verify.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libsupplicant_manager_la-nm-supplicant-manager.lo: nm-supplicant-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsupplicant_manager_la-nm-supplicant-manager.lo -MD -MP -MF $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-manager.Tpo -c -o libsupplicant_manager_la-nm-supplicant-manager.lo `test -f 'nm-supplicant-manager.c' || echo '$(srcdir)/'`nm-supplicant-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-manager.Tpo $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-supplicant-manager.c' object='libsupplicant_manager_la-nm-supplicant-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsupplicant_manager_la-nm-supplicant-manager.lo `test -f 'nm-supplicant-manager.c' || echo '$(srcdir)/'`nm-supplicant-manager.c + +libsupplicant_manager_la-nm-supplicant-config.lo: nm-supplicant-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsupplicant_manager_la-nm-supplicant-config.lo -MD -MP -MF $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-config.Tpo -c -o libsupplicant_manager_la-nm-supplicant-config.lo `test -f 'nm-supplicant-config.c' || echo '$(srcdir)/'`nm-supplicant-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-config.Tpo $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-supplicant-config.c' object='libsupplicant_manager_la-nm-supplicant-config.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsupplicant_manager_la-nm-supplicant-config.lo `test -f 'nm-supplicant-config.c' || echo '$(srcdir)/'`nm-supplicant-config.c + +libsupplicant_manager_la-nm-supplicant-interface.lo: nm-supplicant-interface.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsupplicant_manager_la-nm-supplicant-interface.lo -MD -MP -MF $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-interface.Tpo -c -o libsupplicant_manager_la-nm-supplicant-interface.lo `test -f 'nm-supplicant-interface.c' || echo '$(srcdir)/'`nm-supplicant-interface.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-interface.Tpo $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-interface.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-supplicant-interface.c' object='libsupplicant_manager_la-nm-supplicant-interface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsupplicant_manager_la-nm-supplicant-interface.lo `test -f 'nm-supplicant-interface.c' || echo '$(srcdir)/'`nm-supplicant-interface.c + +libsupplicant_manager_la-nm-supplicant-settings-verify.lo: nm-supplicant-settings-verify.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsupplicant_manager_la-nm-supplicant-settings-verify.lo -MD -MP -MF $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-settings-verify.Tpo -c -o libsupplicant_manager_la-nm-supplicant-settings-verify.lo `test -f 'nm-supplicant-settings-verify.c' || echo '$(srcdir)/'`nm-supplicant-settings-verify.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-settings-verify.Tpo $(DEPDIR)/libsupplicant_manager_la-nm-supplicant-settings-verify.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-supplicant-settings-verify.c' object='libsupplicant_manager_la-nm-supplicant-settings-verify.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsupplicant_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsupplicant_manager_la-nm-supplicant-settings-verify.lo `test -f 'nm-supplicant-settings-verify.c' || echo '$(srcdir)/'`nm-supplicant-settings-verify.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c new file mode 100644 index 00000000..b516de52 --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-config.c @@ -0,0 +1,1014 @@ +/* -*- 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) 2006 - 2010 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include "nm-supplicant-config.h" +#include "nm-supplicant-settings-verify.h" +#include "nm-logging.h" +#include "nm-setting.h" +#include "NetworkManagerUtils.h" + +static char *hexstr2bin (const char *hex, size_t len); + +#define NM_SUPPLICANT_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_SUPPLICANT_CONFIG, \ + NMSupplicantConfigPrivate)) + +G_DEFINE_TYPE (NMSupplicantConfig, nm_supplicant_config, G_TYPE_OBJECT) + +typedef struct { + char *value; + guint32 len; + OptType type; +} ConfigOption; + +typedef struct +{ + GHashTable *config; + GHashTable *blobs; + guint32 ap_scan; + gboolean dispose_has_run; +} NMSupplicantConfigPrivate; + +NMSupplicantConfig * +nm_supplicant_config_new (void) +{ + return g_object_new (NM_TYPE_SUPPLICANT_CONFIG, NULL); +} + +static void +config_option_free (ConfigOption *opt) +{ + g_free (opt->value); + g_slice_free (ConfigOption, opt); +} + +static void +blob_free (GByteArray *array) +{ + g_byte_array_free (array, TRUE); +} + +static void +nm_supplicant_config_init (NMSupplicantConfig * self) +{ + NMSupplicantConfigPrivate *priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self); + + priv->config = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) config_option_free); + + priv->blobs = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) blob_free); + + priv->ap_scan = 1; + priv->dispose_has_run = FALSE; +} + +static gboolean +nm_supplicant_config_add_option_with_type (NMSupplicantConfig *self, + const char *key, + const char *value, + gint32 len, + OptType opt_type, + gboolean secret) +{ + NMSupplicantConfigPrivate *priv; + ConfigOption *old_opt; + ConfigOption *opt; + OptType type; + + g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self); + + if (len < 0) + len = strlen (value); + + if (opt_type != TYPE_INVALID) + type = opt_type; + else { + type = nm_supplicant_settings_verify_setting (key, value, len); + if (type == TYPE_INVALID) { + char buf[255]; + memset (&buf[0], 0, sizeof (buf)); + memcpy (&buf[0], value, len > 254 ? 254 : len); + nm_log_warn (LOGD_SUPPLICANT, "Key '%s' and/or value '%s' invalid.", key, buf); + return FALSE; + } + } + + old_opt = (ConfigOption *) g_hash_table_lookup (priv->config, key); + if (old_opt) { + nm_log_warn (LOGD_SUPPLICANT, "Key '%s' already in table.", key); + return FALSE; + } + + opt = g_slice_new0 (ConfigOption); + if (opt == NULL) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option."); + return FALSE; + } + + opt->value = g_malloc0 ((sizeof (char) * len) + 1); + if (opt->value == NULL) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option value."); + g_slice_free (ConfigOption, opt); + return FALSE; + } + memcpy (opt->value, value, len); + + opt->len = len; + opt->type = type; + + { + char buf[255]; + memset (&buf[0], 0, sizeof (buf)); + memcpy (&buf[0], opt->value, opt->len > 254 ? 254 : opt->len); + nm_log_info (LOGD_SUPPLICANT, "Config: added '%s' value '%s'", key, secret ? "" : &buf[0]); + } + + g_hash_table_insert (priv->config, g_strdup (key), opt); + + return TRUE; +} + +static gboolean +nm_supplicant_config_add_option (NMSupplicantConfig *self, + const char *key, + const char *value, + gint32 len, + gboolean secret) +{ + return nm_supplicant_config_add_option_with_type (self, key, value, len, TYPE_INVALID, secret); +} + +static gboolean +nm_supplicant_config_add_blob (NMSupplicantConfig *self, + const char *key, + const GByteArray *value, + const char *blobid) +{ + NMSupplicantConfigPrivate *priv; + ConfigOption *old_opt; + ConfigOption *opt; + OptType type; + GByteArray *blob; + + g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE); + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + g_return_val_if_fail (value->len > 0, FALSE); + g_return_val_if_fail (blobid != NULL, FALSE); + + priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self); + + type = nm_supplicant_settings_verify_setting (key, (const char *) value->data, value->len); + if (type == TYPE_INVALID) { + nm_log_warn (LOGD_SUPPLICANT, "Key '%s' and/or it's contained value is invalid.", key); + return FALSE; + } + + old_opt = (ConfigOption *) g_hash_table_lookup (priv->config, key); + if (old_opt) { + nm_log_warn (LOGD_SUPPLICANT, "Key '%s' already in table.", key); + return FALSE; + } + + blob = g_byte_array_sized_new (value->len); + if (!blob) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config blob."); + return FALSE; + } + g_byte_array_append (blob, value->data, value->len); + + opt = g_slice_new0 (ConfigOption); + if (opt == NULL) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option."); + g_byte_array_free (blob, TRUE); + return FALSE; + } + + opt->value = g_strdup_printf ("blob://%s", blobid); + if (opt->value == NULL) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't allocate memory for new config option value."); + g_byte_array_free (blob, TRUE); + g_slice_free (ConfigOption, opt); + return FALSE; + } + + opt->len = strlen (opt->value); + opt->type = type; + + nm_log_info (LOGD_SUPPLICANT, "Config: added '%s' value '%s'", key, opt->value); + + g_hash_table_insert (priv->config, g_strdup (key), opt); + g_hash_table_insert (priv->blobs, g_strdup (blobid), blob); + + return TRUE; +} + +static void +nm_supplicant_config_finalize (GObject *object) +{ + /* Complete object destruction */ + g_hash_table_destroy (NM_SUPPLICANT_CONFIG_GET_PRIVATE (object)->config); + g_hash_table_destroy (NM_SUPPLICANT_CONFIG_GET_PRIVATE (object)->blobs); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_config_parent_class)->finalize (object); +} + + +static void +nm_supplicant_config_class_init (NMSupplicantConfigClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = nm_supplicant_config_finalize; + + g_type_class_add_private (object_class, sizeof (NMSupplicantConfigPrivate)); +} + +guint32 +nm_supplicant_config_get_ap_scan (NMSupplicantConfig * self) +{ + g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), 1); + + return NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->ap_scan; +} + +void +nm_supplicant_config_set_ap_scan (NMSupplicantConfig * self, + guint32 ap_scan) +{ + g_return_if_fail (NM_IS_SUPPLICANT_CONFIG (self)); + g_return_if_fail (ap_scan >= 0 && ap_scan <= 2); + + NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->ap_scan = ap_scan; +} + +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: + 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) +{ + NMSupplicantConfigPrivate *priv; + GHashTable *hash; + + 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; +} + +GHashTable * +nm_supplicant_config_get_blobs (NMSupplicantConfig * self) +{ + g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), NULL); + + return NM_SUPPLICANT_CONFIG_GET_PRIVATE (self)->blobs; +} + +#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" +#define MAC_ARG(x) ((guint8*)(x))[0],((guint8*)(x))[1],((guint8*)(x))[2],((guint8*)(x))[3],((guint8*)(x))[4],((guint8*)(x))[5] + +gboolean +nm_supplicant_config_add_setting_wireless (NMSupplicantConfig * self, + NMSettingWireless * setting, + gboolean is_broadcast, + guint32 adhoc_freq, + gboolean has_scan_capa_ssid) +{ + NMSupplicantConfigPrivate *priv; + gboolean is_adhoc; + const char *mode; + const GByteArray *id; + + g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE); + g_return_val_if_fail (setting != NULL, FALSE); + + priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self); + + mode = nm_setting_wireless_get_mode (setting); + is_adhoc = (mode && !strcmp (mode, "adhoc")) ? TRUE : FALSE; + if (is_adhoc) + priv->ap_scan = 2; + else if (is_broadcast == FALSE) { + /* drivers that support scanning specific SSIDs should use + * ap_scan=1, while those that do not should use ap_scan=2. + */ + priv->ap_scan = has_scan_capa_ssid ? 1 : 2; + } + + id = nm_setting_wireless_get_ssid (setting); + if (!nm_supplicant_config_add_option (self, "ssid", (char *) id->data, id->len, FALSE)) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding SSID to supplicant config."); + return FALSE; + } + + if (is_adhoc) { + if (!nm_supplicant_config_add_option (self, "mode", "1", -1, FALSE)) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding mode to supplicant config."); + return FALSE; + } + + if (adhoc_freq) { + char *str_freq; + + str_freq = g_strdup_printf ("%u", adhoc_freq); + if (!nm_supplicant_config_add_option (self, "frequency", str_freq, -1, FALSE)) { + g_free (str_freq); + nm_log_warn (LOGD_SUPPLICANT, "Error adding Ad-Hoc frequency to supplicant config."); + return FALSE; + } + g_free (str_freq); + } + } + + /* Except for Ad-Hoc networks, request that the driver probe for the + * specific SSID we want to associate with. + */ + if (!is_adhoc) { + if (!nm_supplicant_config_add_option (self, "scan_ssid", "1", -1, FALSE)) + return FALSE; + } + + id = nm_setting_wireless_get_bssid (setting); + if (id && id->len) { + char *str_bssid; + + str_bssid = g_strdup_printf (MAC_FMT, MAC_ARG (id->data)); + if (!nm_supplicant_config_add_option (self, "bssid", + str_bssid, strlen (str_bssid), + FALSE)) { + g_free (str_bssid); + nm_log_warn (LOGD_SUPPLICANT, "Error adding BSSID to supplicant config."); + return FALSE; + } + g_free (str_bssid); + } + + // FIXME: band & channel config items + + return TRUE; +} + +static gboolean +add_string_val (NMSupplicantConfig *self, + const char *field, + const char *name, + gboolean ucase, + gboolean secret) +{ + gboolean success; + char *value; + + if (!field) + return TRUE; + + value = ucase ? g_ascii_strup (field, -1) : g_strdup (field); + success = nm_supplicant_config_add_option (self, name, value, strlen (field), secret); + if (!success) + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); + g_free (value); + return success; +} + +#define ADD_STRING_LIST_VAL(setting, setting_name, field, field_plural, name, ucase, secret) \ + if (nm_setting_##setting_name##_get_num_##field_plural (setting)) { \ + guint32 k; \ + GString *str = g_string_new (NULL); \ + for (k = 0; k < nm_setting_##setting_name##_get_num_##field_plural (setting); k++) { \ + const char *item = nm_setting_##setting_name##_get_##field (setting, k); \ + if (!str->len) { \ + g_string_append (str, item); \ + } else { \ + g_string_append_c (str, ' '); \ + g_string_append (str, item); \ + } \ + } \ + if (ucase) \ + g_string_ascii_up (str); \ + if (str->len) \ + success = nm_supplicant_config_add_option (self, name, str->str, -1, secret); \ + else \ + success = TRUE; \ + g_string_free (str, TRUE); \ + if (!success) { \ + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); \ + return FALSE; \ + } \ + } + +static char * +get_blob_id (const char *name, const char *seed_uid) +{ + char *uid = g_strdup_printf ("%s-%s", seed_uid, name); + char *p = uid; + while (*p) { + if (*p == '/') *p = '-'; + p++; + } + return uid; +} + +#define ADD_BLOB_VAL(field, name, con_uid) \ + if (field && field->len) { \ + char *uid = get_blob_id (name, con_uid); \ + success = nm_supplicant_config_add_blob (self, name, field, uid); \ + g_free (uid); \ + if (!success) { \ + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); \ + return FALSE; \ + } \ + } + + +static gboolean +wep128_passphrase_hash (const char *input, + size_t input_len, + guint8 *out_digest, + size_t *out_digest_len) +{ + GChecksum *sum; + guint8 data[64]; + int i; + + g_return_val_if_fail (out_digest != NULL, FALSE); + g_return_val_if_fail (out_digest_len != NULL, FALSE); + g_return_val_if_fail (*out_digest_len >= 16, FALSE); + + /* Get at least 64 bytes by repeating the passphrase into the buffer */ + for (i = 0; i < sizeof (data); i++) + data[i] = input[i % input_len]; + + sum = g_checksum_new (G_CHECKSUM_MD5); + g_assert (sum); + g_checksum_update (sum, data, sizeof (data)); + g_checksum_get_digest (sum, out_digest, out_digest_len); + g_checksum_free (sum); + + g_assert (*out_digest_len == 16); + /* WEP104 keys are 13 bytes in length (26 hex characters) */ + *out_digest_len = 13; + return TRUE; +} + +static gboolean +add_wep_key (NMSupplicantConfig *self, + const char *key, + const char *name, + NMWepKeyType wep_type) +{ + char *value; + gboolean success; + size_t key_len = key ? strlen (key) : 0; + + if (!key || !key_len) + return TRUE; + + if ( (wep_type == NM_WEP_KEY_TYPE_UNKNOWN) + || (wep_type == NM_WEP_KEY_TYPE_KEY)) { + if ((key_len == 10) || (key_len == 26)) { + value = hexstr2bin (key, strlen (key)); + success = nm_supplicant_config_add_option (self, name, value, key_len / 2, TRUE); + g_free (value); + if (!success) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); + return FALSE; + } + } else if ((key_len == 5) || (key_len == 13)) { + if (!nm_supplicant_config_add_option (self, name, key, key_len, TRUE)) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); + return FALSE; + } + } else { + nm_log_warn (LOGD_SUPPLICANT, "Invalid WEP key '%s'", name); + return FALSE; + } + } else if (wep_type == NM_WEP_KEY_TYPE_PASSPHRASE) { + guint8 digest[16]; + size_t digest_len = sizeof (digest); + + success = wep128_passphrase_hash (key, key_len, digest, &digest_len); + if (success) + success = nm_supplicant_config_add_option (self, name, (const char *) digest, digest_len, TRUE); + if (!success) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding %s to supplicant config.", name); + return FALSE; + } + } + + return TRUE; +} + +gboolean +nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self, + NMSettingWirelessSecurity *setting, + NMSetting8021x *setting_8021x, + const char *connection_uid) +{ + char *value; + gboolean success; + const char *key_mgmt, *auth_alg; + const char *psk; + + g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE); + g_return_val_if_fail (setting != NULL, FALSE); + g_return_val_if_fail (connection_uid != NULL, FALSE); + + key_mgmt = nm_setting_wireless_security_get_key_mgmt (setting); + if (!add_string_val (self, key_mgmt, "key_mgmt", TRUE, FALSE)) + return FALSE; + + auth_alg = nm_setting_wireless_security_get_auth_alg (setting); + if (!add_string_val (self, auth_alg, "auth_alg", TRUE, FALSE)) + return FALSE; + + psk = nm_setting_wireless_security_get_psk (setting); + if (psk) { + size_t psk_len = strlen (psk); + + if (psk_len == 64) { + /* Hex PSK */ + value = hexstr2bin (psk, psk_len); + success = nm_supplicant_config_add_option (self, "psk", value, psk_len / 2, TRUE); + g_free (value); + if (!success) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding 'psk' to supplicant config."); + return FALSE; + } + } else if (psk_len >= 8 && psk_len <= 63) { + /* Use TYPE_STRING here so that it gets pushed to the + * supplicant as a string, and therefore gets quoted, + * and therefore the supplicant will interpret it as a + * passphrase and not a hex key. + */ + if (!nm_supplicant_config_add_option_with_type (self, "psk", psk, -1, TYPE_STRING, TRUE)) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding 'psk' to supplicant config."); + return FALSE; + } + } else { + /* Invalid PSK */ + nm_log_warn (LOGD_SUPPLICANT, "Invalid PSK length %u: not between 8 and 63 characters inclusive.", (guint32) psk_len); + return FALSE; + } + } + + /* Only WPA-specific things when using WPA */ + if ( !strcmp (key_mgmt, "wpa-none") + || !strcmp (key_mgmt, "wpa-psk") + || !strcmp (key_mgmt, "wpa-eap")) { + ADD_STRING_LIST_VAL (setting, wireless_security, proto, protos, "proto", TRUE, FALSE); + ADD_STRING_LIST_VAL (setting, wireless_security, pairwise, pairwise, "pairwise", TRUE, FALSE); + ADD_STRING_LIST_VAL (setting, wireless_security, group, groups, "group", TRUE, FALSE); + } + + /* WEP keys if required */ + if (!strcmp (key_mgmt, "none")) { + NMWepKeyType wep_type = nm_setting_wireless_security_get_wep_key_type (setting); + const char *wep0 = nm_setting_wireless_security_get_wep_key (setting, 0); + 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); + + if (!add_wep_key (self, wep0, "wep_key0", wep_type)) + return FALSE; + if (!add_wep_key (self, wep1, "wep_key1", wep_type)) + return FALSE; + if (!add_wep_key (self, wep2, "wep_key2", wep_type)) + return FALSE; + if (!add_wep_key (self, wep3, "wep_key3", wep_type)) + return FALSE; + + if (wep0 || wep1 || wep2 || wep3) { + value = g_strdup_printf ("%d", nm_setting_wireless_security_get_wep_tx_keyidx (setting)); + success = nm_supplicant_config_add_option (self, "wep_tx_keyidx", value, -1, FALSE); + g_free (value); + if (!success) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding wep_tx_keyidx to supplicant config."); + return FALSE; + } + } + } + + if (auth_alg && !strcmp (auth_alg, "leap")) { + /* LEAP */ + if (!strcmp (key_mgmt, "ieee8021x")) { + const char *tmp; + + tmp = nm_setting_wireless_security_get_leap_username (setting); + if (!add_string_val (self, tmp, "identity", FALSE, FALSE)) + return FALSE; + + tmp = nm_setting_wireless_security_get_leap_password (setting); + if (!add_string_val (self, tmp, "password", FALSE, TRUE)) + return FALSE; + + if (!add_string_val (self, "leap", "eap", TRUE, FALSE)) + return FALSE; + } else { + return FALSE; + } + } else { + /* 802.1x for Dynamic WEP and WPA-Enterprise */ + if (!strcmp (key_mgmt, "ieee8021x") || !strcmp (key_mgmt, "wpa-eap")) { + if (!setting_8021x) + return FALSE; + if (!nm_supplicant_config_add_setting_8021x (self, setting_8021x, connection_uid, FALSE)) + return FALSE; + } + } + + return TRUE; +} + +gboolean +nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, + NMSetting8021x *setting, + const char *connection_uid, + gboolean wired) +{ + char *tmp; + const char *peapver, *value, *path; + gboolean success, added; + GString *phase1, *phase2; + const GByteArray *array; + + g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE); + g_return_val_if_fail (setting != NULL, FALSE); + g_return_val_if_fail (connection_uid != NULL, FALSE); + + value = nm_setting_802_1x_get_password (setting); + if (!add_string_val (self, value, "password", FALSE, TRUE)) + return FALSE; + value = nm_setting_802_1x_get_pin (setting); + if (!add_string_val (self, value, "pin", FALSE, TRUE)) + return FALSE; + + if (wired) { + if (!add_string_val (self, "IEEE8021X", "key_mgmt", FALSE, FALSE)) + return FALSE; + /* Wired 802.1x must always use eapol_flags=0 */ + if (!add_string_val (self, "0", "eapol_flags", FALSE, FALSE)) + return FALSE; + } + + ADD_STRING_LIST_VAL (setting, 802_1x, eap_method, eap_methods, "eap", TRUE, FALSE); + + /* Drop the fragment size a bit for better compatibility */ + if (!nm_supplicant_config_add_option (self, "fragment_size", "1300", -1, FALSE)) + return FALSE; + + phase1 = g_string_new (NULL); + peapver = nm_setting_802_1x_get_phase1_peapver (setting); + if (peapver) { + if (!strcmp (peapver, "0")) + g_string_append (phase1, "peapver=0"); + else if (!strcmp (peapver, "1")) + g_string_append (phase1, "peapver=1"); + } + + if (nm_setting_802_1x_get_phase1_peaplabel (setting)) { + if (phase1->len) + g_string_append_c (phase1, ' '); + g_string_append_printf (phase1, "peaplabel=%s", nm_setting_802_1x_get_phase1_peaplabel (setting)); + } + + if (phase1->len) { + if (!add_string_val (self, phase1->str, "phase1", FALSE, FALSE)) { + g_string_free (phase1, TRUE); + return FALSE; + } + } + g_string_free (phase1, TRUE); + + phase2 = g_string_new (NULL); + if (nm_setting_802_1x_get_phase2_auth (setting)) { + tmp = g_ascii_strup (nm_setting_802_1x_get_phase2_auth (setting), -1); + g_string_append_printf (phase2, "auth=%s", tmp); + g_free (tmp); + } + + if (nm_setting_802_1x_get_phase2_autheap (setting)) { + if (phase2->len) + g_string_append_c (phase2, ' '); + tmp = g_ascii_strup (nm_setting_802_1x_get_phase2_autheap (setting), -1); + g_string_append_printf (phase2, "autheap=%s", tmp); + g_free (tmp); + } + + if (phase2->len) { + if (!add_string_val (self, phase2->str, "phase2", FALSE, FALSE)) { + g_string_free (phase2, TRUE); + return FALSE; + } + } + g_string_free (phase2, TRUE); + + /* CA path */ + path = nm_setting_802_1x_get_ca_path (setting); + if (nm_setting_802_1x_get_system_ca_certs (setting)) + path = SYSTEM_CA_PATH; + if (path) { + if (!add_string_val (self, path, "ca_path", FALSE, FALSE)) + return FALSE; + } + + /* Phase2 CA path */ + path = nm_setting_802_1x_get_phase2_ca_path (setting); + if (nm_setting_802_1x_get_system_ca_certs (setting)) + path = SYSTEM_CA_PATH; + if (path) { + if (!add_string_val (self, path, "ca_path2", FALSE, FALSE)) + return FALSE; + } + + /* CA certificate */ + switch (nm_setting_802_1x_get_ca_cert_scheme (setting)) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + array = nm_setting_802_1x_get_ca_cert_blob (setting); + ADD_BLOB_VAL (array, "ca_cert", connection_uid); + break; + case NM_SETTING_802_1X_CK_SCHEME_PATH: + path = nm_setting_802_1x_get_ca_cert_path (setting); + if (!add_string_val (self, path, "ca_cert", FALSE, FALSE)) + return FALSE; + break; + default: + break; + } + + /* Phase 2 CA certificate */ + switch (nm_setting_802_1x_get_phase2_ca_cert_scheme (setting)) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + array = nm_setting_802_1x_get_phase2_ca_cert_blob (setting); + ADD_BLOB_VAL (array, "ca_cert2", connection_uid); + break; + case NM_SETTING_802_1X_CK_SCHEME_PATH: + path = nm_setting_802_1x_get_phase2_ca_cert_path (setting); + if (!add_string_val (self, path, "ca_cert2", FALSE, FALSE)) + return FALSE; + break; + default: + break; + } + + /* Private key */ + added = FALSE; + switch (nm_setting_802_1x_get_private_key_scheme (setting)) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + array = nm_setting_802_1x_get_private_key_blob (setting); + ADD_BLOB_VAL (array, "private_key", connection_uid); + added = TRUE; + break; + case NM_SETTING_802_1X_CK_SCHEME_PATH: + path = nm_setting_802_1x_get_private_key_path (setting); + if (!add_string_val (self, path, "private_key", FALSE, FALSE)) + return FALSE; + added = TRUE; + break; + default: + break; + } + + if (added) { + NMSetting8021xCKFormat format; + NMSetting8021xCKScheme scheme; + + format = nm_setting_802_1x_get_private_key_format (setting); + scheme = nm_setting_802_1x_get_private_key_scheme (setting); + + if ( scheme == NM_SETTING_802_1X_CK_SCHEME_PATH + || format == NM_SETTING_802_1X_CK_FORMAT_PKCS12) { + /* Only add the private key password for PKCS#12 blobs and + * all path schemes, since in both of these cases the private key + * isn't decrypted at all. + */ + value = nm_setting_802_1x_get_private_key_password (setting); + if (!add_string_val (self, value, "private_key_passwd", FALSE, TRUE)) + return FALSE; + } + + if (format != NM_SETTING_802_1X_CK_FORMAT_PKCS12) { + /* Only add the client cert if the private key is not PKCS#12, as + * wpa_supplicant configuration directs us to do. + */ + switch (nm_setting_802_1x_get_client_cert_scheme (setting)) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + array = nm_setting_802_1x_get_client_cert_blob (setting); + ADD_BLOB_VAL (array, "client_cert", connection_uid); + break; + case NM_SETTING_802_1X_CK_SCHEME_PATH: + path = nm_setting_802_1x_get_client_cert_path (setting); + if (!add_string_val (self, path, "client_cert", FALSE, FALSE)) + return FALSE; + break; + default: + break; + } + } + } + + /* Phase 2 private key */ + added = FALSE; + switch (nm_setting_802_1x_get_phase2_private_key_scheme (setting)) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + array = nm_setting_802_1x_get_phase2_private_key_blob (setting); + ADD_BLOB_VAL (array, "private_key2", connection_uid); + added = TRUE; + break; + case NM_SETTING_802_1X_CK_SCHEME_PATH: + path = nm_setting_802_1x_get_phase2_private_key_path (setting); + if (!add_string_val (self, path, "private_key2", FALSE, FALSE)) + return FALSE; + added = TRUE; + break; + default: + break; + } + + if (added) { + NMSetting8021xCKFormat format; + NMSetting8021xCKScheme scheme; + + format = nm_setting_802_1x_get_phase2_private_key_format (setting); + scheme = nm_setting_802_1x_get_phase2_private_key_scheme (setting); + + if ( scheme == NM_SETTING_802_1X_CK_SCHEME_PATH + || format == NM_SETTING_802_1X_CK_FORMAT_PKCS12) { + /* Only add the private key password for PKCS#12 blobs and + * all path schemes, since in both of these cases the private key + * isn't decrypted at all. + */ + value = nm_setting_802_1x_get_phase2_private_key_password (setting); + if (!add_string_val (self, value, "private_key_passwd2", FALSE, TRUE)) + return FALSE; + } + + if (format != NM_SETTING_802_1X_CK_FORMAT_PKCS12) { + /* Only add the client cert if the private key is not PKCS#12, as + * wpa_supplicant configuration directs us to do. + */ + switch (nm_setting_802_1x_get_phase2_client_cert_scheme (setting)) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + array = nm_setting_802_1x_get_phase2_client_cert_blob (setting); + ADD_BLOB_VAL (array, "client_cert2", connection_uid); + break; + case NM_SETTING_802_1X_CK_SCHEME_PATH: + path = nm_setting_802_1x_get_phase2_client_cert_path (setting); + if (!add_string_val (self, path, "client_cert2", FALSE, FALSE)) + return FALSE; + break; + default: + break; + } + } + } + + value = nm_setting_802_1x_get_identity (setting); + if (!add_string_val (self, value, "identity", FALSE, FALSE)) + return FALSE; + value = nm_setting_802_1x_get_anonymous_identity (setting); + if (!add_string_val (self, value, "anonymous_identity", FALSE, FALSE)) + return FALSE; + + return TRUE; +} + +gboolean +nm_supplicant_config_add_no_security (NMSupplicantConfig *self) +{ + return nm_supplicant_config_add_option (self, "key_mgmt", "NONE", -1, FALSE); +} + +/* From hostap, Copyright (c) 2002-2005, Jouni Malinen */ + +static int hex2num (char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + return -1; +} + +static int hex2byte (const char *hex) +{ + int a, b; + a = hex2num(*hex++); + if (a < 0) + return -1; + b = hex2num(*hex++); + if (b < 0) + return -1; + return (a << 4) | b; +} + +static char * +hexstr2bin (const char *hex, size_t len) +{ + size_t i; + int a; + const char * ipos = hex; + char * buf = NULL; + char * opos; + + /* Length must be a multiple of 2 */ + if ((len % 2) != 0) + return NULL; + + opos = buf = g_malloc0 ((len / 2) + 1); + for (i = 0; i < len; i += 2) { + a = hex2byte (ipos); + if (a < 0) { + g_free (buf); + return NULL; + } + *opos++ = a; + ipos += 2; + } + return buf; +} + +/* End from hostap */ + diff --git a/src/supplicant-manager/nm-supplicant-config.h b/src/supplicant-manager/nm-supplicant-config.h new file mode 100644 index 00000000..dad23e29 --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-config.h @@ -0,0 +1,84 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SUPPLICANT_CONFIG_H +#define NM_SUPPLICANT_CONFIG_H + +#include +#include +#include +#include +#include "nm-supplicant-types.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SUPPLICANT_CONFIG (nm_supplicant_config_get_type ()) +#define NM_SUPPLICANT_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_CONFIG, NMSupplicantConfig)) +#define NM_SUPPLICANT_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_CONFIG, NMSupplicantConfigClass)) +#define NM_IS_SUPPLICANT_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SUPPLICANT_CONFIG)) +#define NM_IS_SUPPLICANT_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_CONFIG)) +#define NM_SUPPLICANT_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_CONFIG, NMSupplicantConfigClass)) + +struct _NMSupplicantConfig +{ + GObject parent; +}; + +typedef struct +{ + GObjectClass parent; +} NMSupplicantConfigClass; + + +GType nm_supplicant_config_get_type (void); + +NMSupplicantConfig *nm_supplicant_config_new (void); + +guint32 nm_supplicant_config_get_ap_scan (NMSupplicantConfig *self); + +void nm_supplicant_config_set_ap_scan (NMSupplicantConfig *self, + guint32 ap_scan); + +GHashTable *nm_supplicant_config_get_hash (NMSupplicantConfig *self); + +GHashTable *nm_supplicant_config_get_blobs (NMSupplicantConfig *self); + +gboolean nm_supplicant_config_add_setting_wireless (NMSupplicantConfig *self, + NMSettingWireless *setting, + gboolean is_broadcast, + guint32 adhoc_freq, + gboolean has_scan_capa_ssid); + +gboolean nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self, + NMSettingWirelessSecurity *setting, + NMSetting8021x *setting_8021x, + const char *connection_uid); + +gboolean nm_supplicant_config_add_no_security (NMSupplicantConfig *self); + +gboolean nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, + NMSetting8021x *setting, + const char *connection_uid, + gboolean wired); + +G_END_DECLS + +#endif /* NM_SUPPLICANT_CONFIG_H */ diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c new file mode 100644 index 00000000..a65a458f --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -0,0 +1,1429 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include +#include +#include + +#include "nm-supplicant-interface.h" +#include "nm-supplicant-manager.h" +#include "nm-logging.h" +#include "nm-marshal.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" + +#define WPAS_DBUS_IFACE_INTERFACE WPAS_DBUS_INTERFACE ".Interface" +#define WPAS_DBUS_IFACE_BSSID WPAS_DBUS_INTERFACE ".BSSID" +#define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network" +#define WPAS_ERROR_INVALID_IFACE WPAS_DBUS_INTERFACE ".InvalidInterface" +#define WPAS_ERROR_EXISTS_ERROR WPAS_DBUS_INTERFACE ".ExistsError" + + +G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT) + + +#define NM_SUPPLICANT_INTERFACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_SUPPLICANT_INTERFACE, \ + NMSupplicantInterfacePrivate)) + +static void nm_supplicant_interface_set_property (GObject * object, + guint prop_id, + const GValue * value, + GParamSpec * pspec); + +static void nm_supplicant_interface_get_property (GObject * object, + guint prop_id, + GValue * value, + GParamSpec * pspec); + +static void nm_supplicant_interface_start (NMSupplicantInterface *self); + +static void nm_supplicant_interface_add_to_supplicant (NMSupplicantInterface *self, + gboolean get_only); + +static void nm_supplicant_interface_smgr_state_changed (NMSupplicantManager *smgr, + guint32 new_state, + guint32 old_state, + gpointer user_data); + +static void nm_supplicant_interface_set_state (NMSupplicantInterface *self, + guint32 new_state); + + +/* Signals */ +enum { + STATE, /* change in the interface's state */ + REMOVED, /* interface was removed by the supplicant */ + SCANNED_AP, /* interface saw a new access point from a scan */ + SCAN_REQ_RESULT, /* result of a wireless scan request */ + SCAN_RESULTS, /* scan results returned from supplicant */ + CONNECTION_STATE, /* link state of the device's connection */ + CONNECTION_ERROR, /* an error occurred during a connection request */ + LAST_SIGNAL +}; +static guint nm_supplicant_interface_signals[LAST_SIGNAL] = { 0 }; + + +/* Properties */ +enum { + PROP_0 = 0, + PROP_SUPPLICANT_MANAGER, + PROP_DEVICE, + PROP_STATE, + PROP_CONNECTION_STATE, + PROP_SCANNING, + LAST_PROP +}; + + +typedef struct +{ + NMSupplicantManager * smgr; + gulong smgr_state_sig_handler; + NMDBusManager * dbus_mgr; + char * dev; + gboolean is_wireless; + + char * object_path; + guint32 state; + NMCallStore * assoc_pcalls; + NMCallStore * other_pcalls; + + guint32 con_state; + gboolean scanning; + + DBusGProxy * iface_proxy; + DBusGProxy * net_proxy; + + guint scan_results_timeout; + guint32 last_scan; + + NMSupplicantConfig * cfg; + + gboolean dispose_has_run; +} NMSupplicantInterfacePrivate; + +static gboolean +cancel_all_cb (GObject *object, gpointer call_id, gpointer user_data) +{ + dbus_g_proxy_cancel_call (DBUS_G_PROXY (object), (DBusGProxyCall *) call_id); + + return TRUE; +} + +static void +cancel_all_callbacks (NMCallStore *store) +{ + nm_call_store_foreach (store, NULL, cancel_all_cb, NULL); + nm_call_store_clear (store); +} + +typedef struct { + NMSupplicantInterface *interface; + DBusGProxy *proxy; + NMCallStore *store; + DBusGProxyCall *call; + gboolean disposing; +} NMSupplicantInfo; + +static NMSupplicantInfo * +nm_supplicant_info_new (NMSupplicantInterface *interface, + DBusGProxy *proxy, + NMCallStore *store) +{ + NMSupplicantInfo *info; + + info = g_slice_new0 (NMSupplicantInfo); + info->interface = g_object_ref (interface); + info->proxy = g_object_ref (proxy); + info->store = store; + + return info; +} + +static void +nm_supplicant_info_set_call (NMSupplicantInfo *info, DBusGProxyCall *call) +{ + g_return_if_fail (info != NULL); + g_return_if_fail (call != NULL); + + nm_call_store_add (info->store, G_OBJECT (info->proxy), (gpointer) call); + info->call = call; +} + +static void +nm_supplicant_info_destroy (gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + + /* Guard against double-disposal; since DBusGProxy doesn't guard against + * double-disposal, we could infinite loop here if we're in the middle of + * some wpa_supplicant D-Bus calls. When the supplicant dies we'll dispose + * of the proxy, which kills all its pending calls, which brings us here. + * Then when we unref the proxy here, its dispose() function will get called + * again, and we get right back here until we segfault because our callstack + * is too long. + */ + if (!info->disposing) { + info->disposing = TRUE; + + if (info->call) { + nm_call_store_remove (info->store, G_OBJECT (info->proxy), info->call); + info->call = NULL; + } + + g_object_unref (info->proxy); + info->proxy = NULL; + g_object_unref (info->interface); + info->interface = NULL; + + memset (info, 0, sizeof (NMSupplicantInfo)); + g_slice_free (NMSupplicantInfo, info); + } +} + + +NMSupplicantInterface * +nm_supplicant_interface_new (NMSupplicantManager * smgr, const char *ifname, gboolean is_wireless) +{ + NMSupplicantInterface * iface; + + g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (smgr), NULL); + g_return_val_if_fail (ifname != NULL, NULL); + + iface = g_object_new (NM_TYPE_SUPPLICANT_INTERFACE, + "supplicant-manager", smgr, + "device", ifname, + NULL); + if (iface) { + NM_SUPPLICANT_INTERFACE_GET_PRIVATE (iface)->is_wireless = is_wireless; + nm_supplicant_interface_start (iface); + } + + return iface; +} + +static void +nm_supplicant_interface_init (NMSupplicantInterface * self) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + priv->state = NM_SUPPLICANT_INTERFACE_STATE_INIT; + priv->con_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; + priv->assoc_pcalls = nm_call_store_new (); + priv->other_pcalls = nm_call_store_new (); + + priv->dispose_has_run = FALSE; + + priv->dbus_mgr = nm_dbus_manager_get (); +} + + +static void +nm_supplicant_interface_set_property (GObject * object, + guint prop_id, + const GValue * value, + GParamSpec * pspec) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); + gulong id; + + switch (prop_id) { + case PROP_SUPPLICANT_MANAGER: + priv->smgr = NM_SUPPLICANT_MANAGER (g_value_get_object (value)); + g_object_ref (G_OBJECT (priv->smgr)); + + id = g_signal_connect (priv->smgr, + "state", + G_CALLBACK (nm_supplicant_interface_smgr_state_changed), + object); + priv->smgr_state_sig_handler = id; + break; + case PROP_DEVICE: + /* Construct-only */ + priv->dev = g_strdup (g_value_get_string (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_supplicant_interface_get_property (GObject * object, + guint prop_id, + GValue * value, + GParamSpec * pspec) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_SUPPLICANT_MANAGER: + g_value_set_object (value, G_OBJECT (priv->smgr)); + break; + case PROP_DEVICE: + g_value_set_string (value, priv->dev); + break; + case PROP_STATE: + g_value_set_uint (value, priv->state); + break; + case PROP_CONNECTION_STATE: + g_value_set_uint (value, priv->con_state); + break; + case PROP_SCANNING: + g_value_set_boolean (value, priv->scanning); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +try_remove_iface (DBusGConnection *g_connection, + const char *path) +{ + DBusGProxy *proxy; + + g_return_if_fail (g_connection != NULL); + g_return_if_fail (path != NULL); + + proxy = dbus_g_proxy_new_for_name (g_connection, + WPAS_DBUS_SERVICE, + WPAS_DBUS_PATH, + WPAS_DBUS_INTERFACE); + if (!proxy) + return; + + dbus_g_proxy_call_no_reply (proxy, "removeInterface", + DBUS_TYPE_G_OBJECT_PATH, path, + G_TYPE_INVALID); + g_object_unref (proxy); +} + +static void +nm_supplicant_interface_dispose (GObject *object) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (object); + guint32 sm_state; + + if (priv->dispose_has_run) { + G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); + return; + } + + priv->dispose_has_run = TRUE; + + /* Ask wpa_supplicant to remove this interface */ + sm_state = nm_supplicant_manager_get_state (priv->smgr); + if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { + if (priv->object_path) { + try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr), + priv->object_path); + } + } + + if (priv->iface_proxy) + g_object_unref (priv->iface_proxy); + + if (priv->net_proxy) + g_object_unref (priv->net_proxy); + + if (priv->scan_results_timeout) + g_source_remove (priv->scan_results_timeout); + + if (priv->smgr) { + g_signal_handler_disconnect (priv->smgr, + priv->smgr_state_sig_handler); + g_object_unref (priv->smgr); + } + + g_free (priv->dev); + + /* Cancel pending calls before unrefing the dbus manager */ + cancel_all_callbacks (priv->other_pcalls); + nm_call_store_destroy (priv->other_pcalls); + + cancel_all_callbacks (priv->assoc_pcalls); + nm_call_store_destroy (priv->assoc_pcalls); + + if (priv->dbus_mgr) + g_object_unref (priv->dbus_mgr); + + if (priv->cfg) + g_object_unref (priv->cfg); + + g_free (priv->object_path); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_interface_parent_class)->dispose (object); +} + +static void +nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMSupplicantInterfacePrivate)); + + object_class->dispose = nm_supplicant_interface_dispose; + object_class->set_property = nm_supplicant_interface_set_property; + object_class->get_property = nm_supplicant_interface_get_property; + + /* Properties */ + g_object_class_install_property (object_class, + PROP_SUPPLICANT_MANAGER, + g_param_spec_object ("supplicant-manager", + "Supplicant Manager", + "Supplicant manager to which this interface belongs", + NM_TYPE_SUPPLICANT_MANAGER, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_DEVICE, + g_param_spec_string ("device", + "Device", + "Device which this interface represents to the supplicant", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (object_class, + PROP_STATE, + g_param_spec_uint ("state", + "State", + "State of the supplicant interface; INIT, READY, or DOWN", + NM_SUPPLICANT_INTERFACE_STATE_INIT, + NM_SUPPLICANT_INTERFACE_STATE_LAST - 1, + NM_SUPPLICANT_INTERFACE_STATE_INIT, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, + PROP_SCANNING, + g_param_spec_boolean ("scanning", + "Scanning", + "Scanning", + FALSE, + G_PARAM_READABLE)); + + /* Signals */ + nm_supplicant_interface_signals[STATE] = + g_signal_new ("state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + nm_supplicant_interface_signals[REMOVED] = + g_signal_new ("removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, removed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + nm_supplicant_interface_signals[SCANNED_AP] = + g_signal_new ("scanned-ap", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scanned_ap), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); + + nm_supplicant_interface_signals[SCAN_REQ_RESULT] = + g_signal_new ("scan-req-result", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_req_result), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); + + nm_supplicant_interface_signals[SCAN_RESULTS] = + g_signal_new ("scan-results", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, scan_results), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); + + nm_supplicant_interface_signals[CONNECTION_STATE] = + g_signal_new ("connection-state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + nm_supplicant_interface_signals[CONNECTION_ERROR] = + g_signal_new ("connection-error", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantInterfaceClass, connection_error), + NULL, NULL, + _nm_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); +} + +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, + nm_supplicant_interface_signals[CONNECTION_ERROR], + 0, + name, + err->message); +} + +static void +bssid_properties_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + GError *err = NULL; + GHashTable *hash = NULL; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, + DBUS_TYPE_G_MAP_OF_VARIANT, &hash, + G_TYPE_INVALID)) { + if (!strstr (err->message, "The BSSID requested was invalid")) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't retrieve BSSID properties: %s.", + err->message); + } + g_error_free (err); + } else { + g_signal_emit (info->interface, + nm_supplicant_interface_signals[SCANNED_AP], + 0, + hash); + + g_hash_table_destroy (hash); + } +} + +static void +request_bssid_properties (NMSupplicantInterface * self, + const char * op) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + NMSupplicantInfo *info; + DBusGProxy *proxy; + DBusGProxyCall *call; + + proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + WPAS_DBUS_SERVICE, + op, + WPAS_DBUS_IFACE_BSSID); + info = nm_supplicant_info_new (self, proxy, priv->other_pcalls); + call = dbus_g_proxy_begin_call (proxy, "properties", + bssid_properties_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); + g_object_unref (proxy); +} + +static void +scan_results_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + GError *err = NULL; + GPtrArray *array = NULL; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &array, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "could not get scan results: %s.", err->message); + g_error_free (err); + } else { + int i; + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + + /* Notify listeners of the result of the scan */ + g_signal_emit (info->interface, + nm_supplicant_interface_signals[SCAN_RESULTS], + 0, + array->len); + + /* Fire off a "properties" call for each returned BSSID */ + for (i = 0; i < array->len; i++) { + char *op = g_ptr_array_index (array, i); + + request_bssid_properties (info->interface, op); + g_free (op); + } + + g_ptr_array_free (array, TRUE); + } +} + +static gboolean +request_scan_results (gpointer user_data) +{ + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + NMSupplicantInfo *info; + DBusGProxyCall *call; + GTimeVal cur_time; + + priv->scan_results_timeout = 0; + + g_return_val_if_fail (priv->iface_proxy != NULL, FALSE); + + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "scanResults", + scan_results_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); + + g_get_current_time (&cur_time); + priv->last_scan = cur_time.tv_sec; + return FALSE; +} + +static void +wpas_iface_query_scan_results (DBusGProxy *proxy, gpointer user_data) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (user_data); + GTimeVal cur_time; + + /* Only query scan results if a query is not queued */ + if (priv->scan_results_timeout) + return; + + g_get_current_time (&cur_time); + + /* Only fetch scan results every 4s max, but initially do it right away */ + if (priv->last_scan + 4 < cur_time.tv_sec) { + priv->scan_results_timeout = g_idle_add (request_scan_results, + user_data); + } else { + priv->scan_results_timeout = + g_timeout_add_seconds ((4 - (cur_time.tv_sec - priv->last_scan)), + request_scan_results, user_data); + } +} + +static guint32 +wpas_state_string_to_enum (const char * str_state) +{ + guint32 enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; + + if (!strcmp (str_state, "DISCONNECTED")) + enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED; + else if (!strcmp (str_state, "INACTIVE")) + enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE; + else if (!strcmp (str_state, "SCANNING")) + enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING; + else if (!strcmp (str_state, "ASSOCIATING")) + enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING; + else if (!strcmp (str_state, "ASSOCIATED")) + enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED; + else if (!strcmp (str_state, "4WAY_HANDSHAKE")) + enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE; + else if (!strcmp (str_state, "GROUP_HANDSHAKE")) + enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE; + else if (!strcmp (str_state, "COMPLETED")) + enum_state = NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED; + + return enum_state; +} + +static void +wpas_iface_handle_state_change (DBusGProxy *proxy, + const char *str_new_state, + const char *str_old_state, + gpointer user_data) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (user_data); + guint32 old_state, enum_new_state; + + enum_new_state = wpas_state_string_to_enum (str_new_state); + old_state = priv->con_state; + priv->con_state = enum_new_state; + if (priv->con_state != old_state) { + g_signal_emit (user_data, + nm_supplicant_interface_signals[CONNECTION_STATE], + 0, + priv->con_state, + old_state); + } +} + + +static void +iface_state_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + GError *err = NULL; + char *state_str = NULL; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, + G_TYPE_STRING, &state_str, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "could not get interface state: %s.", err->message); + g_error_free (err); + } else { + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + + priv->con_state = wpas_state_string_to_enum (state_str); + g_free (state_str); + nm_supplicant_interface_set_state (info->interface, NM_SUPPLICANT_INTERFACE_STATE_READY); + } +} + +static void +wpas_iface_get_state (NMSupplicantInterface *self) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + NMSupplicantInfo *info; + DBusGProxyCall *call; + + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "state", + iface_state_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); +} + +static void +iface_scanning_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + gboolean scanning = FALSE; + + if (dbus_g_proxy_end_call (proxy, call_id, NULL, + G_TYPE_BOOLEAN, &scanning, + G_TYPE_INVALID)) { + if (scanning != priv->scanning) { + priv->scanning = scanning; + g_object_notify (G_OBJECT (info->interface), "scanning"); + } + } +} + +static void +wpas_iface_get_scanning (NMSupplicantInterface *self) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + NMSupplicantInfo *info; + DBusGProxyCall *call; + + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "scanning", + iface_scanning_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); +} + +static void +wpas_iface_handle_scanning (DBusGProxy *proxy, + gboolean scanning, + gpointer user_data) +{ + NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (user_data); + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + if (scanning != priv->scanning) { + priv->scanning = scanning; + g_object_notify (G_OBJECT (self), "scanning"); + } +} + +gboolean +nm_supplicant_interface_get_scanning (NMSupplicantInterface *self) +{ + NMSupplicantInterfacePrivate *priv; + + g_return_val_if_fail (self != NULL, FALSE); + + priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + if (priv->scanning) + return TRUE; + if (priv->con_state == NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING) + return TRUE; + return FALSE; +} + +static void +nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + GError *err = NULL; + char *path = NULL; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, + DBUS_TYPE_G_OBJECT_PATH, &path, + G_TYPE_INVALID)) { + + if (dbus_g_error_has_name (err, WPAS_ERROR_INVALID_IFACE)) { + /* Interface not added, try to add it */ + nm_supplicant_interface_add_to_supplicant (info->interface, FALSE); + } else if (dbus_g_error_has_name (err, WPAS_ERROR_EXISTS_ERROR)) { + /* Interface already added, just try to get the interface */ + nm_supplicant_interface_add_to_supplicant (info->interface, TRUE); + } else { + nm_log_err (LOGD_SUPPLICANT, "(%s): error getting interface: %s", + priv->dev, err->message); + } + + g_error_free (err); + } else { + nm_log_dbg (LOGD_SUPPLICANT, "(%s): interface added to supplicant", priv->dev); + + 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_proxy_add_signal (priv->iface_proxy, "ScanResultsAvailable", G_TYPE_INVALID); + + dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_STRING, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + + dbus_g_proxy_add_signal (priv->iface_proxy, "StateChange", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + + dbus_g_proxy_connect_signal (priv->iface_proxy, "ScanResultsAvailable", + G_CALLBACK (wpas_iface_query_scan_results), + info->interface, + NULL); + + dbus_g_proxy_connect_signal (priv->iface_proxy, "StateChange", + G_CALLBACK (wpas_iface_handle_state_change), + info->interface, + NULL); + + dbus_g_proxy_add_signal (priv->iface_proxy, "Scanning", G_TYPE_BOOLEAN, G_TYPE_INVALID); + + dbus_g_proxy_connect_signal (priv->iface_proxy, "Scanning", + G_CALLBACK (wpas_iface_handle_scanning), + info->interface, + NULL); + + /* Interface added to the supplicant; get its initial state. */ + wpas_iface_get_state (info->interface); + wpas_iface_get_scanning (info->interface); + } +} + +static void +nm_supplicant_interface_add_to_supplicant (NMSupplicantInterface * self, + gboolean get_only) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + NMSupplicantInfo *info; + DBusGProxy *proxy; + DBusGProxyCall *call; + + proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + WPAS_DBUS_SERVICE, + WPAS_DBUS_PATH, + WPAS_DBUS_INTERFACE); + info = nm_supplicant_info_new (self, proxy, priv->other_pcalls); + + if (get_only) { + call = dbus_g_proxy_begin_call (proxy, "getInterface", + nm_supplicant_interface_add_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_STRING, priv->dev, + G_TYPE_INVALID); + } else { + GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal); + GValue *driver; + + driver = g_new0 (GValue, 1); + g_value_init (driver, G_TYPE_STRING); + g_value_set_string (driver, priv->is_wireless ? "wext" : "wired"); + g_hash_table_insert (hash, "driver", driver); + + call = dbus_g_proxy_begin_call (proxy, "addInterface", + nm_supplicant_interface_add_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_STRING, priv->dev, + DBUS_TYPE_G_MAP_OF_VARIANT, hash, + G_TYPE_INVALID); + + g_value_unset (driver); + g_free (driver); + g_hash_table_destroy (hash); + } + + g_object_unref (proxy); + + nm_supplicant_info_set_call (info, call); +} + +static void +nm_supplicant_interface_start (NMSupplicantInterface * self) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + guint32 state; + + /* Can only start the interface from INIT state */ + g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT); + + nm_log_dbg (LOGD_SUPPLICANT, "(%s): adding interface to supplicant", priv->dev); + + state = nm_supplicant_manager_get_state (priv->smgr); + if (state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { + nm_supplicant_interface_set_state (self, NM_SUPPLICANT_INTERFACE_STATE_STARTING); + nm_supplicant_interface_add_to_supplicant (self, FALSE); + } else if (state == NM_SUPPLICANT_MANAGER_STATE_DOWN) { + /* Don't do anything; wait for signal from supplicant manager + * that its state has changed. + */ + } else + nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant manager state!"); +} + +static void +nm_supplicant_interface_handle_supplicant_manager_idle_state (NMSupplicantInterface * self) +{ + switch (NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->state) { + case NM_SUPPLICANT_INTERFACE_STATE_INIT: + /* Move to STARTING state when supplicant is ready */ + nm_supplicant_interface_start (self); + break; + case NM_SUPPLICANT_INTERFACE_STATE_STARTING: + /* Don't do anything here, though we should never hit this */ + break; + case NM_SUPPLICANT_INTERFACE_STATE_READY: + /* Don't do anything here, though we should never hit this */ + break; + case NM_SUPPLICANT_INTERFACE_STATE_DOWN: + /* Don't do anything here; interface can't get out of DOWN state */ + break; + default: + nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant interface state!"); + break; + } +} + + +static void +nm_supplicant_interface_set_state (NMSupplicantInterface * self, + guint32 new_state) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + guint32 old_state; + + g_return_if_fail (new_state < NM_SUPPLICANT_INTERFACE_STATE_LAST); + + if (new_state == priv->state) + return; + + old_state = priv->state; + if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) { + /* If the interface is transitioning to DOWN and there's are + * in-progress pending calls, cancel them. + */ + cancel_all_callbacks (priv->other_pcalls); + cancel_all_callbacks (priv->assoc_pcalls); + } + + priv->state = new_state; + g_signal_emit (self, + nm_supplicant_interface_signals[STATE], + 0, + priv->state, + old_state); +} + +static void +nm_supplicant_interface_smgr_state_changed (NMSupplicantManager * smgr, + guint32 new_state, + guint32 old_state, + gpointer user_data) +{ + NMSupplicantInterface * self = NM_SUPPLICANT_INTERFACE (user_data); + + switch (new_state) { + case NM_SUPPLICANT_MANAGER_STATE_DOWN: + /* The supplicant went away, likely the connection to it is also + * gone. Therefore, this interface must move to the DOWN state + * and be disposed of. + */ + nm_supplicant_interface_set_state (self, NM_SUPPLICANT_INTERFACE_STATE_DOWN); + break; + case NM_SUPPLICANT_MANAGER_STATE_IDLE: + /* Handle the supplicant now being available. */ + nm_supplicant_interface_handle_supplicant_manager_idle_state (self); + break; + default: + nm_log_warn (LOGD_SUPPLICANT, "Unknown supplicant manager state!"); + break; + } +} + + +static void +remove_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + GError *err = NULL; + guint tmp; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + nm_log_dbg (LOGD_SUPPLICANT, "Couldn't remove network from supplicant interface: %s.", + err->message); + g_error_free (err); + } +} + +static void +disconnect_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + GError *err = NULL; + guint tmp; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't disconnect supplicant interface: %s.", + err->message); + g_error_free (err); + } +} + +void +nm_supplicant_interface_disconnect (NMSupplicantInterface * self) +{ + NMSupplicantInterfacePrivate *priv; + + g_return_if_fail (NM_IS_SUPPLICANT_INTERFACE (self)); + + priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + /* Clear and cancel all pending calls related to a prior + * connection attempt. + */ + cancel_all_callbacks (priv->assoc_pcalls); + + /* Don't do anything if there is no connection to the supplicant yet. */ + if (!priv->iface_proxy) + return; + + /* Don't try to disconnect if the supplicant interface is already + * disconnected. + */ + if (priv->con_state == NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED + || priv->con_state == NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE) { + if (priv->net_proxy) { + g_object_unref (priv->net_proxy); + priv->net_proxy = NULL; + } + + return; + } + + /* Remove any network that was added by NetworkManager */ + if (priv->net_proxy) { + dbus_g_proxy_begin_call (priv->iface_proxy, "removeNetwork", + remove_network_cb, + NULL, NULL, + DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (priv->net_proxy), + G_TYPE_INVALID); + + g_object_unref (priv->net_proxy); + priv->net_proxy = NULL; + } + + dbus_g_proxy_begin_call (priv->iface_proxy, "disconnect", + disconnect_cb, + NULL, NULL, + G_TYPE_INVALID); +} + +static void +select_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + GError *err = NULL; + guint tmp; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't select network config: %s.", err->message); + emit_error_helper (info->interface, err); + g_error_free (err); + } +} + +static void +set_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + GError *err = NULL; + guint tmp; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network config: %s.", err->message); + emit_error_helper (info->interface, err); + g_error_free (err); + } else { + DBusGProxyCall *call; + + info = nm_supplicant_info_new (info->interface, priv->iface_proxy, priv->assoc_pcalls); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "selectNetwork", + select_network_cb, + info, + nm_supplicant_info_destroy, + DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (proxy), + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); + } +} + +static void +call_set_network (NMSupplicantInfo *info) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + GHashTable *config_hash; + DBusGProxyCall *call; + + config_hash = nm_supplicant_config_get_hash (priv->cfg); + call = dbus_g_proxy_begin_call (priv->net_proxy, "set", + set_network_cb, + info, + nm_supplicant_info_destroy, + DBUS_TYPE_G_MAP_OF_VARIANT, config_hash, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); + g_hash_table_destroy (config_hash); +} + +static void +set_blobs_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + GError *err = NULL; + guint tmp; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't set network certificates: %s.", err->message); + emit_error_helper (info->interface, err); + g_error_free (err); + } else { + info = nm_supplicant_info_new (info->interface, priv->iface_proxy, priv->assoc_pcalls); + call_set_network (info); + } +} + +static GValue * +byte_array_to_gvalue (const GByteArray *array) +{ + GValue *val; + + val = g_slice_new0 (GValue); + g_value_init (val, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_set_boxed (val, array); + + return val; +} + +static void +blob_free (GValue *val) +{ + g_value_unset (val); + g_slice_free (GValue, val); +} + +static void +convert_blob (const char *key, const GByteArray *value, GHashTable *hash) +{ + GValue *val; + + val = byte_array_to_gvalue (value); + g_hash_table_insert (hash, g_strdup (key), val); +} + +static void +call_set_blobs (NMSupplicantInfo *info, GHashTable *orig_blobs) +{ + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + DBusGProxyCall *call; + GHashTable *blobs; + + blobs = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) blob_free); + if (!blobs) { + const char *msg = "Not enough memory to create blob table."; + + nm_log_warn (LOGD_SUPPLICANT, "%s", msg); + g_signal_emit (info->interface, + nm_supplicant_interface_signals[CONNECTION_ERROR], + 0, "SendBlobError", msg); + return; + } + + g_hash_table_foreach (orig_blobs, (GHFunc) convert_blob, blobs); + + call = dbus_g_proxy_begin_call (priv->iface_proxy, "setBlobs", + set_blobs_cb, + info, + nm_supplicant_info_destroy, + DBUS_TYPE_G_MAP_OF_VARIANT, blobs, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); + g_hash_table_destroy (blobs); +} + +static void +add_network_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + GError *err = NULL; + char *path = NULL; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, + DBUS_TYPE_G_OBJECT_PATH, &path, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't add a network to the supplicant interface: %s.", + err->message); + emit_error_helper (info->interface, err); + g_error_free (err); + } else { + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + GHashTable *blobs; + + priv->net_proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr), + WPAS_DBUS_SERVICE, + path, + WPAS_DBUS_IFACE_NETWORK); + g_free (path); + + info = nm_supplicant_info_new (info->interface, + priv->net_proxy, + priv->assoc_pcalls); + /* Send any blobs first; if there aren't any jump to sending the + * config settings. + */ + blobs = nm_supplicant_config_get_blobs (priv->cfg); + if (g_hash_table_size (blobs) > 0) + call_set_blobs (info, blobs); + else + call_set_network (info); + } +} + +static void +set_ap_scan_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + GError *err = NULL; + guint32 tmp; + DBusGProxyCall *call; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, G_TYPE_UINT, &tmp, G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "Couldn't send AP scan mode to the supplicant interface: %s.", + err->message); + emit_error_helper (info->interface, err); + g_error_free (err); + return; + } + + nm_log_info (LOGD_SUPPLICANT, "Config: set interface ap_scan to %d", + nm_supplicant_config_get_ap_scan (priv->cfg)); + + info = nm_supplicant_info_new (info->interface, proxy, info->store); + call = dbus_g_proxy_begin_call (proxy, "addNetwork", + add_network_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); +} + +gboolean +nm_supplicant_interface_set_config (NMSupplicantInterface * self, + NMSupplicantConfig * cfg) +{ + NMSupplicantInterfacePrivate *priv; + NMSupplicantInfo *info; + DBusGProxyCall *call; + guint32 ap_scan; + + g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE); + + priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + nm_supplicant_interface_disconnect (self); + + if (priv->cfg) + g_object_unref (priv->cfg); + priv->cfg = cfg; + + if (cfg == NULL) + return TRUE; + + g_object_ref (priv->cfg); + + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); + ap_scan = nm_supplicant_config_get_ap_scan (priv->cfg); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "setAPScan", + set_ap_scan_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_UINT, ap_scan, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); + + return call != NULL; +} + +const char * +nm_supplicant_interface_get_device (NMSupplicantInterface * self) +{ + g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); + + return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; +} + +static void +scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) +{ + NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + GError *err = NULL; + guint32 success = 0; + + if (!dbus_g_proxy_end_call (proxy, call_id, &err, + G_TYPE_UINT, &success, + G_TYPE_INVALID)) { + nm_log_warn (LOGD_SUPPLICANT, "Could not get scan request result: %s", err->message); + g_error_free (err); + } + + /* Notify listeners of the result of the scan */ + g_signal_emit (info->interface, + nm_supplicant_interface_signals[SCAN_REQ_RESULT], + 0, + success ? TRUE : FALSE); +} + +gboolean +nm_supplicant_interface_request_scan (NMSupplicantInterface * self) +{ + NMSupplicantInterfacePrivate *priv; + NMSupplicantInfo *info; + DBusGProxyCall *call; + + g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE); + + priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self); + + info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls); + call = dbus_g_proxy_begin_call (priv->iface_proxy, "scan", + scan_request_cb, + info, + nm_supplicant_info_destroy, + G_TYPE_INVALID); + nm_supplicant_info_set_call (info, call); + + return call != NULL; +} + +guint32 +nm_supplicant_interface_get_state (NMSupplicantInterface * self) +{ + g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NM_SUPPLICANT_INTERFACE_STATE_DOWN); + + return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->state; +} + +guint32 +nm_supplicant_interface_get_connection_state (NMSupplicantInterface * self) +{ + g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED); + + return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->con_state; +} + +const char * +nm_supplicant_interface_state_to_string (guint32 state) +{ + switch (state) { + case NM_SUPPLICANT_INTERFACE_STATE_INIT: + return "init"; + case NM_SUPPLICANT_INTERFACE_STATE_STARTING: + return "starting"; + case NM_SUPPLICANT_INTERFACE_STATE_READY: + return "ready"; + case NM_SUPPLICANT_INTERFACE_STATE_DOWN: + return "down"; + default: + break; + } + return "unknown"; +} + +const char * +nm_supplicant_interface_connection_state_to_string (guint32 state) +{ + switch (state) { + case NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED: + return "disconnected"; + case NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE: + return "inactive"; + case NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING: + return "scanning"; + case NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING: + return "associating"; + case NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED: + return "associated"; + case NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE: + return "4-way handshake"; + case NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE: + return "group handshake"; + case NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED: + return "completed"; + default: + break; + } + return "unknown"; +} + diff --git a/src/supplicant-manager/nm-supplicant-interface.h b/src/supplicant-manager/nm-supplicant-interface.h new file mode 100644 index 00000000..bee5436f --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-interface.h @@ -0,0 +1,145 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SUPPLICANT_INTERFACE_H +#define NM_SUPPLICANT_INTERFACE_H + +#include +#include +#include "nm-supplicant-types.h" + +G_BEGIN_DECLS + +/* + * Supplicant interface states + * The states are linear, ie INIT -> READY -> DOWN and state may only be + * changed in one direction. If an interface reaches the DOWN state, it + * cannot be re-initialized; it must be torn down and a new one created. + * + * INIT: interface has been created, but cannot be used yet; it is waiting + * for pending requests of the supplicant to complete. + * READY: interface is ready for use + * DOWN: interface has been removed or has otherwise been made invalid; it + * must be torn down. + * + * Note: LAST is an invalid state and only used for boundary checking. + */ +enum { + NM_SUPPLICANT_INTERFACE_STATE_INIT = 0, + NM_SUPPLICANT_INTERFACE_STATE_STARTING, + NM_SUPPLICANT_INTERFACE_STATE_READY, + NM_SUPPLICANT_INTERFACE_STATE_DOWN, + NM_SUPPLICANT_INTERFACE_STATE_LAST +}; + + +/* + * Supplicant interface connection states + * The wpa_supplicant state for the connection. + */ +enum { + NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED = 0, + NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE, + NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING, + NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING, + NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED, + NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE, + NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE, + NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED, + NM_SUPPLICANT_INTERFACE_CON_STATE_LAST +}; + +#define NM_TYPE_SUPPLICANT_INTERFACE (nm_supplicant_interface_get_type ()) +#define NM_SUPPLICANT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterface)) +#define NM_SUPPLICANT_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfaceClass)) +#define NM_IS_SUPPLICANT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SUPPLICANT_INTERFACE)) +#define NM_IS_SUPPLICANT_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_INTERFACE)) +#define NM_SUPPLICANT_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfaceClass)) + +struct _NMSupplicantInterface { + GObject parent; +}; + +typedef struct { + GObjectClass parent; + + /* Signals */ + + /* change in the interface's state */ + void (*state) (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state); + + /* interface was removed by the supplicant */ + void (*removed) (NMSupplicantInterface * iface); + + /* interface saw a new access point from a scan */ + void (*scanned_ap) (NMSupplicantInterface * iface, + DBusMessage * message); + + /* result of a wireless scan request */ + void (*scan_req_result) (NMSupplicantInterface * iface, + gboolean success); + + /* scan results returned from supplicant */ + void (*scan_results) (NMSupplicantInterface * iface, + guint num_bssids); + + /* link state of the device's connection */ + void (*connection_state) (NMSupplicantInterface * iface, + guint32 new_state, + guint32 old_state); + + /* an error occurred during a connection request */ + void (*connection_error) (NMSupplicantInterface * iface, + const char * name, + const char * message); +} NMSupplicantInterfaceClass; + + +GType nm_supplicant_interface_get_type (void); + +NMSupplicantInterface * nm_supplicant_interface_new (NMSupplicantManager * smgr, + const char *ifname, + gboolean is_wireless); + +gboolean nm_supplicant_interface_set_config (NMSupplicantInterface * iface, + NMSupplicantConfig * cfg); + +void nm_supplicant_interface_disconnect (NMSupplicantInterface * iface); + +const char * nm_supplicant_interface_get_device (NMSupplicantInterface * iface); + +gboolean nm_supplicant_interface_request_scan (NMSupplicantInterface * self); + +guint32 nm_supplicant_interface_get_state (NMSupplicantInterface * self); + +guint32 nm_supplicant_interface_get_connection_state (NMSupplicantInterface * self); + +const char *nm_supplicant_interface_state_to_string (guint32 state); + +const char *nm_supplicant_interface_connection_state_to_string (guint32 state); + +gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self); + +G_END_DECLS + +#endif /* NM_SUPPLICANT_INTERFACE_H */ diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c new file mode 100644 index 00000000..a2cf58eb --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -0,0 +1,343 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#include +#include +#include + +#include "nm-supplicant-manager.h" +#include "nm-supplicant-interface.h" +#include "nm-dbus-manager.h" +#include "nm-marshal.h" +#include "nm-logging.h" +#include "nm-glib-compat.h" + +#define SUPPLICANT_POKE_INTERVAL 120 + +typedef struct { + NMDBusManager * dbus_mgr; + guint32 state; + GSList * ifaces; + gboolean dispose_has_run; + guint poke_id; +} NMSupplicantManagerPrivate; + +#define NM_SUPPLICANT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_SUPPLICANT_MANAGER, \ + NMSupplicantManagerPrivate)) + +G_DEFINE_TYPE (NMSupplicantManager, nm_supplicant_manager, G_TYPE_OBJECT) + + +static void nm_supplicant_manager_name_owner_changed (NMDBusManager *dbus_mgr, + const char *name, + const char *old, + const char *new, + gpointer user_data); + +static void nm_supplicant_manager_set_state (NMSupplicantManager * self, + guint32 new_state); + +static gboolean nm_supplicant_manager_startup (NMSupplicantManager * self); + + +/* Signals */ +enum { + STATE, /* change in the manager's state */ + LAST_SIGNAL +}; +static guint nm_supplicant_manager_signals[LAST_SIGNAL] = { 0 }; + + +NMSupplicantManager * +nm_supplicant_manager_get (void) +{ + static NMSupplicantManager * singleton = NULL; + + if (!singleton) { + singleton = NM_SUPPLICANT_MANAGER (g_object_new (NM_TYPE_SUPPLICANT_MANAGER, NULL)); + } else { + g_object_ref (singleton); + } + + g_assert (singleton); + return singleton; +} + +static gboolean +poke_supplicant_cb (gpointer user_data) +{ + NMSupplicantManager *self = NM_SUPPLICANT_MANAGER (user_data); + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + DBusGConnection *g_connection; + DBusGProxy *proxy; + const char *tmp = "ignoreme"; + + g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr); + proxy = dbus_g_proxy_new_for_name (g_connection, + WPAS_DBUS_SERVICE, + WPAS_DBUS_PATH, + WPAS_DBUS_INTERFACE); + if (!proxy) { + nm_log_warn (LOGD_SUPPLICANT, "Error: could not init wpa_supplicant proxy"); + goto out; + } + + nm_log_info (LOGD_SUPPLICANT, "Trying to start the supplicant..."); + dbus_g_proxy_call_no_reply (proxy, "getInterface", G_TYPE_STRING, tmp, G_TYPE_INVALID); + g_object_unref (proxy); + +out: + /* Reschedule the poke */ + priv->poke_id = g_timeout_add_seconds (SUPPLICANT_POKE_INTERVAL, + poke_supplicant_cb, + (gpointer) self); + + return FALSE; +} + +static void +nm_supplicant_manager_init (NMSupplicantManager * self) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + gboolean running; + + priv->dispose_has_run = FALSE; + priv->state = NM_SUPPLICANT_MANAGER_STATE_DOWN; + priv->dbus_mgr = nm_dbus_manager_get (); + priv->poke_id = 0; + + running = nm_supplicant_manager_startup (self); + + g_signal_connect (priv->dbus_mgr, + "name-owner-changed", + G_CALLBACK (nm_supplicant_manager_name_owner_changed), + self); + + if (!running) { + /* Try to activate the supplicant */ + priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + } +} + +static void +nm_supplicant_manager_dispose (GObject *object) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (object); + + if (priv->dispose_has_run) { + G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); + return; + } + + priv->dispose_has_run = TRUE; + + if (priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + + if (priv->dbus_mgr) { + g_object_unref (G_OBJECT (priv->dbus_mgr)); + priv->dbus_mgr = NULL; + } + + /* Chain up to the parent class */ + G_OBJECT_CLASS (nm_supplicant_manager_parent_class)->dispose (object); +} + +static void +nm_supplicant_manager_class_init (NMSupplicantManagerClass *klass) +{ + GObjectClass * object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (NMSupplicantManagerPrivate)); + + object_class->dispose = nm_supplicant_manager_dispose; + + /* Signals */ + nm_supplicant_manager_signals[STATE] = + g_signal_new ("state", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMSupplicantManagerClass, state), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); +} + +static void +nm_supplicant_manager_name_owner_changed (NMDBusManager *dbus_mgr, + const char *name, + const char *old_owner, + const char *new_owner, + gpointer user_data) +{ + NMSupplicantManager * self = (NMSupplicantManager *) 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)); + + /* Can't handle the signal if its not from the supplicant service */ + if (strcmp (WPAS_DBUS_SERVICE, name) != 0) + return; + + if (!old_owner_good && new_owner_good) { + gboolean running; + + running = nm_supplicant_manager_startup (self); + + if (running && priv->poke_id) { + g_source_remove (priv->poke_id); + priv->poke_id = 0; + } + } else if (old_owner_good && !new_owner_good) { + nm_supplicant_manager_set_state (self, NM_SUPPLICANT_MANAGER_STATE_DOWN); + + if (priv->poke_id) + g_source_remove (priv->poke_id); + + /* Poke the supplicant so that it gets activated by dbus system bus + * activation. + */ + priv->poke_id = g_idle_add (poke_supplicant_cb, (gpointer) self); + } +} + + +guint32 +nm_supplicant_manager_get_state (NMSupplicantManager * self) +{ + g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), FALSE); + + return NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->state; +} + +static void +nm_supplicant_manager_set_state (NMSupplicantManager * self, guint32 new_state) +{ + NMSupplicantManagerPrivate *priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + guint32 old_state; + + if (new_state == priv->state) + return; + + old_state = priv->state; + priv->state = new_state; + g_signal_emit (self, + nm_supplicant_manager_signals[STATE], + 0, + priv->state, + old_state); +} + +static gboolean +nm_supplicant_manager_startup (NMSupplicantManager * self) +{ + gboolean running; + + /* FIXME: convert to pending call */ + running = nm_dbus_manager_name_has_owner (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->dbus_mgr, + WPAS_DBUS_SERVICE); + if (running) + nm_supplicant_manager_set_state (self, NM_SUPPLICANT_MANAGER_STATE_IDLE); + + return running; +} + +NMSupplicantInterface * +nm_supplicant_manager_get_iface (NMSupplicantManager * self, + const char *ifname, + gboolean is_wireless) +{ + NMSupplicantManagerPrivate *priv; + NMSupplicantInterface * iface = NULL; + GSList * elt; + + g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), NULL); + g_return_val_if_fail (ifname != NULL, NULL); + + priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + + /* Ensure we don't already have this interface */ + for (elt = priv->ifaces; elt; elt = g_slist_next (elt)) { + NMSupplicantInterface * if_tmp = (NMSupplicantInterface *) elt->data; + + if (!strcmp (ifname, nm_supplicant_interface_get_device (if_tmp))) { + iface = if_tmp; + break; + } + } + + if (!iface) { + nm_log_dbg (LOGD_SUPPLICANT, "(%s): creating new supplicant interface", ifname); + iface = nm_supplicant_interface_new (self, ifname, is_wireless); + if (iface) + priv->ifaces = g_slist_append (priv->ifaces, iface); + } else { + nm_log_dbg (LOGD_SUPPLICANT, "(%s): returning existing supplicant interface", ifname); + } + + return iface; +} + +void +nm_supplicant_manager_release_iface (NMSupplicantManager * self, + NMSupplicantInterface * iface) +{ + NMSupplicantManagerPrivate *priv; + GSList * elt; + + g_return_if_fail (NM_IS_SUPPLICANT_MANAGER (self)); + g_return_if_fail (NM_IS_SUPPLICANT_INTERFACE (iface)); + + priv = NM_SUPPLICANT_MANAGER_GET_PRIVATE (self); + + for (elt = priv->ifaces; elt; elt = g_slist_next (elt)) { + NMSupplicantInterface * if_tmp = (NMSupplicantInterface *) elt->data; + + if (if_tmp == iface) { + /* Remove the iface from the supplicant manager's list and + * dereference to match additional reference in get_iface. + */ + priv->ifaces = g_slist_remove_link (priv->ifaces, elt); + g_slist_free_1 (elt); + g_object_unref (iface); + break; + } + } +} + +const char * +nm_supplicant_manager_state_to_string (guint32 state) +{ + switch (state) { + case NM_SUPPLICANT_MANAGER_STATE_DOWN: + return "down"; + case NM_SUPPLICANT_MANAGER_STATE_IDLE: + return "idle"; + default: + break; + } + return "unknown"; +} + + diff --git a/src/supplicant-manager/nm-supplicant-manager.h b/src/supplicant-manager/nm-supplicant-manager.h new file mode 100644 index 00000000..fef2a774 --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-manager.h @@ -0,0 +1,88 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. + */ + +#ifndef NM_SUPPLICANT_MANAGER_H +#define NM_SUPPLICANT_MANAGER_H + +#include +#include "nm-supplicant-types.h" +#include "nm-device.h" + +#define WPAS_DBUS_SERVICE "fi.epitest.hostap.WPASupplicant" +#define WPAS_DBUS_PATH "/fi/epitest/hostap/WPASupplicant" +#define WPAS_DBUS_INTERFACE "fi.epitest.hostap.WPASupplicant" + + +G_BEGIN_DECLS + +/* + * Supplicant manager states + * Either state may transition to the other state at any time. + * + * DOWN: supplicant manager has been created, but cannot be used; the supplicant + * is either not running or has not yet been fully initialized. + * IDLE: supplicant manager is ready for use + * + * Note: LAST is an invalid state and only used for boundary checking. + */ +enum { + NM_SUPPLICANT_MANAGER_STATE_DOWN = 0, + NM_SUPPLICANT_MANAGER_STATE_IDLE, + NM_SUPPLICANT_MANAGER_STATE_LAST +}; + + +#define NM_TYPE_SUPPLICANT_MANAGER (nm_supplicant_manager_get_type ()) +#define NM_SUPPLICANT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManager)) +#define NM_SUPPLICANT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_MANAGER, NMSupplicantManagerClass)) +#define NM_IS_SUPPLICANT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SUPPLICANT_MANAGER)) +#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)) + +struct _NMSupplicantManager +{ + GObject parent; +}; + +typedef struct +{ + GObjectClass parent; + + /* class members */ + void (* state) (NMSupplicantManager * mgr, guint32 new_state, guint32 old_state); +} NMSupplicantManagerClass; + +GType nm_supplicant_manager_get_type (void); + +NMSupplicantManager * nm_supplicant_manager_get (void); + +guint32 nm_supplicant_manager_get_state (NMSupplicantManager * mgr); + +NMSupplicantInterface * nm_supplicant_manager_get_iface (NMSupplicantManager * mgr, + const char *ifname, + gboolean is_wireless); + +void nm_supplicant_manager_release_iface (NMSupplicantManager * mgr, + NMSupplicantInterface * iface); + +const char *nm_supplicant_manager_state_to_string (guint32 state); + +#endif /* NM_SUPPLICANT_MANAGER_H */ diff --git a/src/supplicant-manager/nm-supplicant-settings-verify.c b/src/supplicant-manager/nm-supplicant-settings-verify.c new file mode 100644 index 00000000..28334655 --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-settings-verify.c @@ -0,0 +1,238 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include + +#include "nm-supplicant-settings-verify.h" + +struct Opt { + const char * key; + const OptType type; + const gint32 int_low; /* Inclusive */ + const gint32 int_high; /* Inclusive; max length for strings */ + const gboolean str_allowed_multiple; + const char ** str_allowed; +}; + + +static gboolean validate_type_int (const struct Opt * opt, + const char * value, + const guint32 len); + +static gboolean validate_type_bytes (const struct Opt * opt, + const char * value, + const guint32 len); + +static gboolean validate_type_keyword (const struct Opt * opt, + const char * value, + const guint32 len); + +typedef gboolean (*validate_func)(const struct Opt *, const char *, const guint32); + +struct validate_entry { + const OptType type; + const validate_func func; +}; + +static const struct validate_entry validate_table[] = { + { TYPE_INT, validate_type_int }, + { TYPE_BYTES, validate_type_bytes }, + { TYPE_KEYWORD, validate_type_keyword }, +}; + + +const char * pairwise_allowed[] = { "CCMP", "TKIP", "NONE", NULL }; +const char * group_allowed[] = { "CCMP", "TKIP", "WEP104", "WEP40", NULL }; +const char * proto_allowed[] = { "WPA", "RSN", NULL }; +const char * key_mgmt_allowed[] = { "WPA-PSK", "WPA-EAP", "IEEE8021X", "WPA-NONE", + "NONE", NULL }; +const char * auth_alg_allowed[] = { "OPEN", "SHARED", "LEAP", NULL }; +const char * eap_allowed[] = { "LEAP", "MD5", "TLS", "PEAP", "TTLS", "SIM", + "PSK", "FAST", NULL }; + +const char * phase1_allowed[] = {"peapver=0", "peapver=1", "peaplabel=1", + "peap_outer_success=0", "include_tls_length=1", + "sim_min_num_chal=3", NULL }; +const char * phase2_allowed[] = {"auth=PAP", "auth=CHAP", "auth=MSCHAP", + "auth=MSCHAPV2", "auth=GTC", "auth=OTP", + "auth=MD5", "auth=TLS", "autheap=MD5", + "autheap=MSCHAPV2", "autheap=OTP", + "autheap=GTC", "autheap=TLS", NULL }; + +static const struct Opt opt_table[] = { + { "ssid", TYPE_BYTES, 0, 32,FALSE, NULL }, + { "bssid", TYPE_KEYWORD, 0, 0, FALSE, NULL }, + { "scan_ssid", TYPE_INT, 0, 1, FALSE, NULL }, + { "mode", TYPE_INT, 0, 1, FALSE, NULL }, + { "frequency", TYPE_INT, 2412, 5825, FALSE, NULL }, + { "auth_alg", TYPE_KEYWORD, 0, 0, FALSE, auth_alg_allowed }, + { "psk", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "pairwise", TYPE_KEYWORD, 0, 0, FALSE, pairwise_allowed }, + { "group", TYPE_KEYWORD, 0, 0, FALSE, group_allowed }, + { "proto", TYPE_KEYWORD, 0, 0, FALSE, proto_allowed }, + { "key_mgmt", TYPE_KEYWORD, 0, 0, FALSE, key_mgmt_allowed }, + { "wep_key0", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "wep_key1", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "wep_key2", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "wep_key3", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "wep_tx_keyidx", TYPE_INT, 0, 3, FALSE, NULL }, + { "eapol_flags", TYPE_INT, 0, 3, FALSE, NULL }, + { "eap", TYPE_KEYWORD, 0, 0, FALSE, eap_allowed }, + { "identity", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "password", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "ca_path", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "ca_cert", TYPE_BYTES, 0, 65536, FALSE, NULL }, + { "client_cert", TYPE_BYTES, 0, 65536, FALSE, NULL }, + { "private_key", TYPE_BYTES, 0, 65536, FALSE, NULL }, + { "private_key_passwd", TYPE_BYTES, 0, 1024, FALSE, NULL }, + { "phase1", TYPE_KEYWORD, 0, 0, TRUE, phase1_allowed }, + { "phase2", TYPE_KEYWORD, 0, 0, TRUE, phase2_allowed }, + { "anonymous_identity", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "ca_path2", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "ca_cert2", TYPE_BYTES, 0, 65536, FALSE, NULL }, + { "client_cert2", TYPE_BYTES, 0, 65536, FALSE, NULL }, + { "private_key2", TYPE_BYTES, 0, 65536, FALSE, NULL }, + { "private_key2_passwd",TYPE_BYTES, 0, 1024, FALSE, NULL }, + { "pin", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "pcsc", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "nai", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "eappsk", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "pac_file", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "engine", TYPE_INT, 0, 1, FALSE, NULL }, + { "engine_id", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "key_id", TYPE_BYTES, 0, 0, FALSE, NULL }, + { "fragment_size", TYPE_INT, 1, 2000, FALSE, NULL }, +}; + + +static gboolean +validate_type_int (const struct Opt * opt, + const char * value, + const guint32 len) +{ + long int intval; + + g_return_val_if_fail (opt != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + errno = 0; + intval = strtol (value, NULL, 10); + if (errno != 0) + return FALSE; + + /* strtol returns a long, but we are dealing with ints */ + if (intval > INT_MAX || intval < INT_MIN) + return FALSE; + if (intval > opt->int_high || intval < opt->int_low) + return FALSE; + + return TRUE; +} + +static gboolean +validate_type_bytes (const struct Opt * opt, + const char * value, + const guint32 len) +{ + guint32 check_len; + + g_return_val_if_fail (opt != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + check_len = opt->int_high ? opt->int_high : 255; + if (len > check_len) + return FALSE; + + return TRUE; +} + +static gboolean +validate_type_keyword (const struct Opt * opt, + const char * value, + const guint32 len) +{ + char ** allowed; + gchar ** candidates = NULL; + char ** candidate; + gboolean found = FALSE; + + g_return_val_if_fail (opt != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + /* Allow everything */ + if (!opt->str_allowed) + return TRUE; + + candidates = g_strsplit (value, " ", 0); + if (!candidates) + goto out; + + /* validate each space-separated word in 'value' */ + for (candidate = candidates; *candidate; candidate++) { + found = FALSE; + for (allowed = (char **) opt->str_allowed; *allowed; allowed++) { + if (strcmp (*candidate, *allowed) == 0) { + found = TRUE; + break; + } + } + if (!found) + break; + } + +out: + g_strfreev (candidates); + return found; +} + +OptType +nm_supplicant_settings_verify_setting (const char * key, + const char * value, + const guint32 len) +{ + OptType type = TYPE_INVALID; + int opt_count = sizeof (opt_table) / sizeof (opt_table[0]); + int val_count = sizeof (validate_table) / sizeof (validate_table[0]); + int i, j; + + g_return_val_if_fail (key != NULL, FALSE); + g_return_val_if_fail (value != NULL, FALSE); + + for (i = 0; i < opt_count; i++) { + if (strcmp (opt_table[i].key, key) != 0) + continue; + + for (j = 0; j < val_count; j++) { + if (validate_table[j].type == opt_table[i].type) { + if ((*(validate_table[j].func))(&opt_table[i], value, len)) { + type = opt_table[i].type; + break; + } + } + } + } + + return type; +} + diff --git a/src/supplicant-manager/nm-supplicant-settings-verify.h b/src/supplicant-manager/nm-supplicant-settings-verify.h new file mode 100644 index 00000000..0939ebdb --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-settings-verify.h @@ -0,0 +1,37 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + */ + +#ifndef NM_SUPPLICANT_SETTINGS_VERIFY_H +#define NM_SUPPLICANT_SETTINGS_VERIFY_H + +typedef enum OptType { + TYPE_INVALID = 0, + TYPE_INT, + TYPE_BYTES, + TYPE_KEYWORD, + TYPE_STRING +} OptType; + +OptType nm_supplicant_settings_verify_setting (const char * key, + const char * value, + const guint32 len); + + +#endif /* NM_SUPPLICANT_SETTINGS_VERIFY_H */ diff --git a/src/supplicant-manager/nm-supplicant-types.h b/src/supplicant-manager/nm-supplicant-types.h new file mode 100644 index 00000000..16e4a6ba --- /dev/null +++ b/src/supplicant-manager/nm-supplicant-types.h @@ -0,0 +1,28 @@ +/* -*- 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) 2006 - 2008 Red Hat, Inc. + */ + +#ifndef NM_SUPPLICANT_TYPES_H +#define NM_SUPPLICANT_TYPES_H + +typedef struct _NMSupplicantManager NMSupplicantManager; +typedef struct _NMSupplicantInterface NMSupplicantInterface; +typedef struct _NMSupplicantConfig NMSupplicantConfig; + +#endif /* NM_SUPPLICANT_TYPES_H */ diff --git a/src/supplicant-manager/tests/Makefile.am b/src/supplicant-manager/tests/Makefile.am new file mode 100644 index 00000000..b5e4db61 --- /dev/null +++ b/src/supplicant-manager/tests/Makefile.am @@ -0,0 +1,27 @@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/supplicant-manager + +noinst_PROGRAMS = test-supplicant-config + +test_supplicant_config_SOURCES = \ + test-supplicant-config.c + +test_supplicant_config_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_supplicant_config_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \ + $(DBUS_LIBS) + +if WITH_TESTS + +check-local: test-supplicant-config + $(abs_builddir)/test-supplicant-config + +endif + diff --git a/src/supplicant-manager/tests/Makefile.in b/src/supplicant-manager/tests/Makefile.in new file mode 100644 index 00000000..f919b8b8 --- /dev/null +++ b/src/supplicant-manager/tests/Makefile.in @@ -0,0 +1,579 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = test-supplicant-config$(EXEEXT) +subdir = src/supplicant-manager/tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_test_supplicant_config_OBJECTS = \ + test_supplicant_config-test-supplicant-config.$(OBJEXT) +test_supplicant_config_OBJECTS = $(am_test_supplicant_config_OBJECTS) +am__DEPENDENCIES_1 = +test_supplicant_config_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_supplicant_config_SOURCES) +DIST_SOURCES = $(test_supplicant_config_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/supplicant-manager + +test_supplicant_config_SOURCES = \ + test-supplicant-config.c + +test_supplicant_config_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +test_supplicant_config_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/src/supplicant-manager/libsupplicant-manager.la \ + $(DBUS_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/supplicant-manager/tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/supplicant-manager/tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +test-supplicant-config$(EXEEXT): $(test_supplicant_config_OBJECTS) $(test_supplicant_config_DEPENDENCIES) + @rm -f test-supplicant-config$(EXEEXT) + $(LINK) $(test_supplicant_config_OBJECTS) $(test_supplicant_config_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_supplicant_config-test-supplicant-config.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +test_supplicant_config-test-supplicant-config.o: test-supplicant-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_supplicant_config_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_supplicant_config-test-supplicant-config.o -MD -MP -MF $(DEPDIR)/test_supplicant_config-test-supplicant-config.Tpo -c -o test_supplicant_config-test-supplicant-config.o `test -f 'test-supplicant-config.c' || echo '$(srcdir)/'`test-supplicant-config.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_supplicant_config-test-supplicant-config.Tpo $(DEPDIR)/test_supplicant_config-test-supplicant-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-supplicant-config.c' object='test_supplicant_config-test-supplicant-config.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_supplicant_config_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_supplicant_config-test-supplicant-config.o `test -f 'test-supplicant-config.c' || echo '$(srcdir)/'`test-supplicant-config.c + +test_supplicant_config-test-supplicant-config.obj: test-supplicant-config.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_supplicant_config_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_supplicant_config-test-supplicant-config.obj -MD -MP -MF $(DEPDIR)/test_supplicant_config-test-supplicant-config.Tpo -c -o test_supplicant_config-test-supplicant-config.obj `if test -f 'test-supplicant-config.c'; then $(CYGPATH_W) 'test-supplicant-config.c'; else $(CYGPATH_W) '$(srcdir)/test-supplicant-config.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_supplicant_config-test-supplicant-config.Tpo $(DEPDIR)/test_supplicant_config-test-supplicant-config.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-supplicant-config.c' object='test_supplicant_config-test-supplicant-config.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_supplicant_config_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_supplicant_config-test-supplicant-config.obj `if test -f 'test-supplicant-config.c'; then $(CYGPATH_W) 'test-supplicant-config.c'; else $(CYGPATH_W) '$(srcdir)/test-supplicant-config.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +@WITH_TESTS_FALSE@check-local: +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-generic clean-libtool clean-noinstPROGRAMS ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +@WITH_TESTS_TRUE@check-local: test-supplicant-config +@WITH_TESTS_TRUE@ $(abs_builddir)/test-supplicant-config + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/supplicant-manager/tests/test-supplicant-config.c b/src/supplicant-manager/tests/test-supplicant-config.c new file mode 100644 index 00000000..d0868b5f --- /dev/null +++ b/src/supplicant-manager/tests/test-supplicant-config.c @@ -0,0 +1,518 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* 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 (C) 2008 - 2009 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "nm-test-helpers.h" + +#include "nm-supplicant-config.h" +#include "nm-supplicant-settings-verify.h" + +static gboolean +validate_opt (const char *detail, + GHashTable *hash, + const char *key, + OptType val_type, + gconstpointer expected, + size_t expected_len) +{ + GValue *value; + gint int_val; + GByteArray *array; + 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; + } + + return TRUE; +} + +static void +test_wifi_open (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingIP4Config *s_ip4; + NMSupplicantConfig *config; + GHashTable *hash; + char *uuid; + gboolean success; + GError *error = NULL; + GByteArray *ssid; + const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 }; + GByteArray *bssid; + const unsigned char bssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 }; + const char *bssid_str = "11:22:33:44:55:66"; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-open", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-open", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Wifi Open", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-open", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + bssid = g_byte_array_sized_new (sizeof (bssid_data)); + g_byte_array_append (bssid, bssid_data, sizeof (bssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_BSSID, bssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_BAND, "bg", + NULL); + + g_byte_array_free (ssid, TRUE); + g_byte_array_free (bssid, TRUE); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-open", "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_AUTO, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-open", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + config = nm_supplicant_config_new (); + ASSERT (config != NULL, + "wifi-open", "failed to create new supplicant config"); + + success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE); + ASSERT (success == TRUE, + "wifi-open", "failed to add wireless setting to supplicant config."); + + success = nm_supplicant_config_add_no_security (config); + ASSERT (success == TRUE, + "wifi-open", "failed to add wireless security to supplicant config."); + + 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); + + g_object_unref (connection); +} + +static void +test_wifi_wep_key (const char *detail, + NMWepKeyType wep_type, + const char *key_data, + const unsigned char *expected, + size_t expected_size) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSupplicantConfig *config; + GHashTable *hash; + char *uuid; + gboolean success; + GError *error = NULL; + GByteArray *ssid; + const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 }; + GByteArray *bssid; + const unsigned char bssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 }; + const char *bssid_str = "11:22:33:44:55:66"; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + detail, "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Wifi WEP Key", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + bssid = g_byte_array_sized_new (sizeof (bssid_data)); + g_byte_array_append (bssid, bssid_data, sizeof (bssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_BSSID, bssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_BAND, "bg", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + g_byte_array_free (bssid, TRUE); + + /* Wifi Security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, wep_type, + NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, key_data); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + detail, "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_AUTO, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + detail, "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + config = nm_supplicant_config_new (); + ASSERT (config != NULL, + detail, "failed to create new supplicant config"); + + success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE); + ASSERT (success == TRUE, + detail, "failed to add wireless setting to supplicant config."); + + success = 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."); + + 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); + + g_object_unref (connection); +} + +static void +test_wifi_wep (void) +{ + const char *key1 = "12345"; + const unsigned char key1_expected[] = { 0x31, 0x32, 0x33, 0x34, 0x35 }; + const char *key2 = "ascii test$$$"; + const unsigned char key2_expected[] = { 0x61, 0x73, 0x63, 0x69, 0x69, 0x20, 0x74, 0x65, 0x73, 0x74, 0x24, 0x24, 0x24 }; + const char *key3 = "abcdef1234"; + const unsigned char key3_expected[] = { 0xab, 0xcd, 0xef, 0x12, 0x34 }; + const char *key4 = "96aec785c6392675f87f592972"; + const unsigned char key4_expected[] = { 0x96, 0xae, 0xc7, 0x85, 0xc6, 0x39, 0x26, 0x75, 0xf8, 0x7f, 0x59, 0x29, 0x72 }; + const char *key5 = "r34lly l33t w3p p4ssphr4s3 for t3st1ng"; + const unsigned char key5_expected[] = { 0xce, 0x68, 0x8b, 0x35, 0xf6, 0x0a, 0x2b, 0xbf, 0xc9, 0x8f, 0xed, 0x10, 0xda }; + + test_wifi_wep_key ("wifi-wep-ascii-40", NM_WEP_KEY_TYPE_KEY, key1, key1_expected, sizeof (key1_expected)); + test_wifi_wep_key ("wifi-wep-ascii-104", NM_WEP_KEY_TYPE_KEY, key2, key2_expected, sizeof (key2_expected)); + test_wifi_wep_key ("wifi-wep-hex-40", NM_WEP_KEY_TYPE_KEY, key3, key3_expected, sizeof (key3_expected)); + test_wifi_wep_key ("wifi-wep-hex-104", NM_WEP_KEY_TYPE_KEY, key4, key4_expected, sizeof (key4_expected)); + test_wifi_wep_key ("wifi-wep-passphrase-104", NM_WEP_KEY_TYPE_PASSPHRASE, key5, key5_expected, sizeof (key5_expected)); + + test_wifi_wep_key ("wifi-wep-old-hex-104", NM_WEP_KEY_TYPE_UNKNOWN, key4, key4_expected, sizeof (key4_expected)); +} + +static void +test_wifi_wpa_psk (const char *detail, + OptType key_type, + const char *key_data, + const unsigned char *expected, + size_t expected_size) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSupplicantConfig *config; + GHashTable *hash; + char *uuid; + gboolean success; + GError *error = NULL; + GByteArray *ssid; + const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 }; + GByteArray *bssid; + const unsigned char bssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 }; + const char *bssid_str = "11:22:33:44:55:66"; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + detail, "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Wifi WEP Key", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + bssid = g_byte_array_sized_new (sizeof (bssid_data)); + g_byte_array_append (bssid, bssid_data, sizeof (bssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_BSSID, bssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_BAND, "bg", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + g_byte_array_free (bssid, TRUE); + + /* Wifi Security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + detail, "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", + NM_SETTING_WIRELESS_SECURITY_PSK, key_data, + NULL); + + nm_setting_wireless_security_add_proto (s_wsec, "wpa"); + nm_setting_wireless_security_add_proto (s_wsec, "rsn"); + nm_setting_wireless_security_add_pairwise (s_wsec, "tkip"); + nm_setting_wireless_security_add_pairwise (s_wsec, "ccmp"); + nm_setting_wireless_security_add_group (s_wsec, "tkip"); + nm_setting_wireless_security_add_group (s_wsec, "ccmp"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + detail, "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_AUTO, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + detail, "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + config = nm_supplicant_config_new (); + ASSERT (config != NULL, + detail, "failed to create new supplicant config"); + + success = nm_supplicant_config_add_setting_wireless (config, s_wifi, TRUE, 0, TRUE); + ASSERT (success == TRUE, + detail, "failed to add wireless setting to supplicant config."); + + success = 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."); + + 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); +} + +static void +test_wifi_wpa_psk_types (void) +{ + const char *key1 = "d4721e911461d3cdef9793858e977fcda091779243abb7316c2f11605a160893"; + const unsigned char key1_expected[] = { 0xd4, 0x72, 0x1e, 0x91, 0x14, 0x61, 0xd3, 0xcd, + 0xef, 0x97, 0x93, 0x85, 0x8e, 0x97, 0x7f, 0xcd, + 0xa0, 0x91, 0x77, 0x92, 0x43, 0xab, 0xb7, 0x31, + 0x6c, 0x2f, 0x11, 0x60, 0x5a, 0x16, 0x08, 0x93 }; + const char *key2 = "r34lly l33t wp4 p4ssphr4s3 for t3st1ng"; + + test_wifi_wpa_psk ("wifi-wpa-psk-hex", TYPE_BYTES, key1, key1_expected, sizeof (key1_expected)); + test_wifi_wpa_psk ("wifi-wep-psk-passphrase", TYPE_STRING, key2, (gconstpointer) key2, strlen (key2)); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + DBusGConnection *bus; + char *base; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + if (!nm_utils_init (&error)) + FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + + /* The tests */ + test_wifi_open (); + test_wifi_wep (); + test_wifi_wpa_psk_types (); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + diff --git a/src/system-settings/Makefile.am b/src/system-settings/Makefile.am new file mode 100644 index 00000000..3b616b90 --- /dev/null +++ b/src/system-settings/Makefile.am @@ -0,0 +1,61 @@ +INCLUDES = -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src \ + -I${top_builddir}/marshallers + +noinst_LTLIBRARIES = libsystem-settings.la + +BUILT_SOURCES = \ + nm-settings-system-glue.h + +libsystem_settings_la_SOURCES = \ + nm-sysconfig-settings.c \ + nm-sysconfig-settings.h \ + nm-inotify-helper.c \ + nm-inotify-helper.h \ + nm-polkit-helpers.h \ + nm-system-config-error.c \ + nm-system-config-error.h \ + nm-system-config-interface.c \ + nm-system-config-interface.h \ + nm-sysconfig-connection.c \ + nm-sysconfig-connection.h \ + nm-default-wired-connection.c \ + nm-default-wired-connection.h + +libsystem_settings_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(POLKIT_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DSBINDIR=\"$(sbindir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DGNOMELOCALEDIR=\"$(datadir)/locale\" \ + -DPLUGINDIR=\"$(pkglibdir)\" + +libsystem_settings_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(POLKIT_LIBS) + +libsystem_settings_la_LDFLAGS = -rdynamic + +nm-settings-system-glue.h: $(top_srcdir)/introspection/nm-settings-system.xml + dbus-binding-tool --prefix=nm_settings_system --mode=glib-server --output=$@ $< + +CLEANFILES = \ + $(BUILT_SOURCES) + diff --git a/src/system-settings/Makefile.in b/src/system-settings/Makefile.in new file mode 100644 index 00000000..d86d4188 --- /dev/null +++ b/src/system-settings/Makefile.in @@ -0,0 +1,661 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/system-settings +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libsystem_settings_la_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libsystem_settings_la_OBJECTS = \ + libsystem_settings_la-nm-sysconfig-settings.lo \ + libsystem_settings_la-nm-inotify-helper.lo \ + libsystem_settings_la-nm-system-config-error.lo \ + libsystem_settings_la-nm-system-config-interface.lo \ + libsystem_settings_la-nm-sysconfig-connection.lo \ + libsystem_settings_la-nm-default-wired-connection.lo +libsystem_settings_la_OBJECTS = $(am_libsystem_settings_la_OBJECTS) +libsystem_settings_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libsystem_settings_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libsystem_settings_la_SOURCES) +DIST_SOURCES = $(libsystem_settings_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src \ + -I${top_builddir}/marshallers + +noinst_LTLIBRARIES = libsystem-settings.la +BUILT_SOURCES = \ + nm-settings-system-glue.h + +libsystem_settings_la_SOURCES = \ + nm-sysconfig-settings.c \ + nm-sysconfig-settings.h \ + nm-inotify-helper.c \ + nm-inotify-helper.h \ + nm-polkit-helpers.h \ + nm-system-config-error.c \ + nm-system-config-error.h \ + nm-system-config-interface.c \ + nm-system-config-interface.h \ + nm-sysconfig-connection.c \ + nm-sysconfig-connection.h \ + nm-default-wired-connection.c \ + nm-default-wired-connection.h + +libsystem_settings_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(POLKIT_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DBINDIR=\"$(bindir)\" \ + -DSBINDIR=\"$(sbindir)\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DDATADIR=\"$(datadir)\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DLOCALSTATEDIR=\"$(localstatedir)\" \ + -DGNOMELOCALEDIR=\"$(datadir)/locale\" \ + -DPLUGINDIR=\"$(pkglibdir)\" + +libsystem_settings_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(POLKIT_LIBS) + +libsystem_settings_la_LDFLAGS = -rdynamic +CLEANFILES = \ + $(BUILT_SOURCES) + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/system-settings/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/system-settings/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libsystem-settings.la: $(libsystem_settings_la_OBJECTS) $(libsystem_settings_la_DEPENDENCIES) + $(libsystem_settings_la_LINK) $(libsystem_settings_la_OBJECTS) $(libsystem_settings_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsystem_settings_la-nm-default-wired-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsystem_settings_la-nm-inotify-helper.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsystem_settings_la-nm-sysconfig-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsystem_settings_la-nm-sysconfig-settings.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsystem_settings_la-nm-system-config-error.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsystem_settings_la-nm-system-config-interface.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libsystem_settings_la-nm-sysconfig-settings.lo: nm-sysconfig-settings.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsystem_settings_la-nm-sysconfig-settings.lo -MD -MP -MF $(DEPDIR)/libsystem_settings_la-nm-sysconfig-settings.Tpo -c -o libsystem_settings_la-nm-sysconfig-settings.lo `test -f 'nm-sysconfig-settings.c' || echo '$(srcdir)/'`nm-sysconfig-settings.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsystem_settings_la-nm-sysconfig-settings.Tpo $(DEPDIR)/libsystem_settings_la-nm-sysconfig-settings.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-sysconfig-settings.c' object='libsystem_settings_la-nm-sysconfig-settings.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsystem_settings_la-nm-sysconfig-settings.lo `test -f 'nm-sysconfig-settings.c' || echo '$(srcdir)/'`nm-sysconfig-settings.c + +libsystem_settings_la-nm-inotify-helper.lo: nm-inotify-helper.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsystem_settings_la-nm-inotify-helper.lo -MD -MP -MF $(DEPDIR)/libsystem_settings_la-nm-inotify-helper.Tpo -c -o libsystem_settings_la-nm-inotify-helper.lo `test -f 'nm-inotify-helper.c' || echo '$(srcdir)/'`nm-inotify-helper.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsystem_settings_la-nm-inotify-helper.Tpo $(DEPDIR)/libsystem_settings_la-nm-inotify-helper.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-inotify-helper.c' object='libsystem_settings_la-nm-inotify-helper.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsystem_settings_la-nm-inotify-helper.lo `test -f 'nm-inotify-helper.c' || echo '$(srcdir)/'`nm-inotify-helper.c + +libsystem_settings_la-nm-system-config-error.lo: nm-system-config-error.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsystem_settings_la-nm-system-config-error.lo -MD -MP -MF $(DEPDIR)/libsystem_settings_la-nm-system-config-error.Tpo -c -o libsystem_settings_la-nm-system-config-error.lo `test -f 'nm-system-config-error.c' || echo '$(srcdir)/'`nm-system-config-error.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsystem_settings_la-nm-system-config-error.Tpo $(DEPDIR)/libsystem_settings_la-nm-system-config-error.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-system-config-error.c' object='libsystem_settings_la-nm-system-config-error.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsystem_settings_la-nm-system-config-error.lo `test -f 'nm-system-config-error.c' || echo '$(srcdir)/'`nm-system-config-error.c + +libsystem_settings_la-nm-system-config-interface.lo: nm-system-config-interface.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsystem_settings_la-nm-system-config-interface.lo -MD -MP -MF $(DEPDIR)/libsystem_settings_la-nm-system-config-interface.Tpo -c -o libsystem_settings_la-nm-system-config-interface.lo `test -f 'nm-system-config-interface.c' || echo '$(srcdir)/'`nm-system-config-interface.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsystem_settings_la-nm-system-config-interface.Tpo $(DEPDIR)/libsystem_settings_la-nm-system-config-interface.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-system-config-interface.c' object='libsystem_settings_la-nm-system-config-interface.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsystem_settings_la-nm-system-config-interface.lo `test -f 'nm-system-config-interface.c' || echo '$(srcdir)/'`nm-system-config-interface.c + +libsystem_settings_la-nm-sysconfig-connection.lo: nm-sysconfig-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsystem_settings_la-nm-sysconfig-connection.lo -MD -MP -MF $(DEPDIR)/libsystem_settings_la-nm-sysconfig-connection.Tpo -c -o libsystem_settings_la-nm-sysconfig-connection.lo `test -f 'nm-sysconfig-connection.c' || echo '$(srcdir)/'`nm-sysconfig-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsystem_settings_la-nm-sysconfig-connection.Tpo $(DEPDIR)/libsystem_settings_la-nm-sysconfig-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-sysconfig-connection.c' object='libsystem_settings_la-nm-sysconfig-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsystem_settings_la-nm-sysconfig-connection.lo `test -f 'nm-sysconfig-connection.c' || echo '$(srcdir)/'`nm-sysconfig-connection.c + +libsystem_settings_la-nm-default-wired-connection.lo: nm-default-wired-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsystem_settings_la-nm-default-wired-connection.lo -MD -MP -MF $(DEPDIR)/libsystem_settings_la-nm-default-wired-connection.Tpo -c -o libsystem_settings_la-nm-default-wired-connection.lo `test -f 'nm-default-wired-connection.c' || echo '$(srcdir)/'`nm-default-wired-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsystem_settings_la-nm-default-wired-connection.Tpo $(DEPDIR)/libsystem_settings_la-nm-default-wired-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-default-wired-connection.c' object='libsystem_settings_la-nm-default-wired-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsystem_settings_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsystem_settings_la-nm-default-wired-connection.lo `test -f 'nm-default-wired-connection.c' || echo '$(srcdir)/'`nm-default-wired-connection.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +nm-settings-system-glue.h: $(top_srcdir)/introspection/nm-settings-system.xml + dbus-binding-tool --prefix=nm_settings_system --mode=glib-server --output=$@ $< + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/system-settings/nm-default-wired-connection.c b/src/system-settings/nm-default-wired-connection.c new file mode 100644 index 00000000..54e00d62 --- /dev/null +++ b/src/system-settings/nm-default-wired-connection.c @@ -0,0 +1,308 @@ +/* -*- 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 2008 Novell, Inc. + * (C) Copyright 2009 Red Hat, Inc. + */ + +#include + +#include + +#include +#include +#include +#include + +#include "nm-dbus-glib-types.h" +#include "nm-marshal.h" +#include "nm-default-wired-connection.h" +#include "nm-settings-connection-interface.h" + +static NMSettingsConnectionInterface *parent_settings_connection_iface; + +static void settings_connection_interface_init (NMSettingsConnectionInterface *iface); + +G_DEFINE_TYPE_EXTENDED (NMDefaultWiredConnection, nm_default_wired_connection, NM_TYPE_SYSCONFIG_CONNECTION, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, + settings_connection_interface_init)) + +#define NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnectionPrivate)) + +typedef struct { + NMDevice *device; + GByteArray *mac; + gboolean read_only; +} NMDefaultWiredConnectionPrivate; + +enum { + PROP_0, + PROP_MAC, + PROP_DEVICE, + PROP_READ_ONLY, + LAST_PROP +}; + +enum { + TRY_UPDATE, + DELETED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + +NMDefaultWiredConnection * +nm_default_wired_connection_new (const GByteArray *mac, + NMDevice *device, + gboolean read_only) +{ + + g_return_val_if_fail (mac != NULL, NULL); + g_return_val_if_fail (mac->len == ETH_ALEN, NULL); + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + return g_object_new (NM_TYPE_DEFAULT_WIRED_CONNECTION, + NM_DEFAULT_WIRED_CONNECTION_MAC, mac, + NM_DEFAULT_WIRED_CONNECTION_DEVICE, device, + NM_DEFAULT_WIRED_CONNECTION_READ_ONLY, read_only, + NULL); +} + +NMDevice * +nm_default_wired_connection_get_device (NMDefaultWiredConnection *wired) +{ + g_return_val_if_fail (NM_IS_DEFAULT_WIRED_CONNECTION (wired), NULL); + + return NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (wired)->device; +} + +static gboolean +update (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceUpdateFunc callback, + gpointer user_data) +{ + NMDefaultWiredConnection *self = NM_DEFAULT_WIRED_CONNECTION (connection); + + /* Keep the object alive over try-update since it might get removed + * from the settings service there, but we still need it for the callback. + */ + g_object_ref (connection); + g_signal_emit (self, signals[TRY_UPDATE], 0); + callback (connection, NULL, user_data); + g_object_unref (connection); + return TRUE; +} + +static gboolean +do_delete (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceDeleteFunc callback, + gpointer user_data) +{ + NMDefaultWiredConnection *self = NM_DEFAULT_WIRED_CONNECTION (connection); + NMDefaultWiredConnectionPrivate *priv = NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (connection); + + g_signal_emit (self, signals[DELETED], 0, priv->mac); + return parent_settings_connection_iface->delete (connection, callback, user_data); +} + +/****************************************************************/ + +static void +settings_connection_interface_init (NMSettingsConnectionInterface *iface) +{ + parent_settings_connection_iface = g_type_interface_peek_parent (iface); + iface->update = update; + iface->delete = do_delete; +} + +static void +nm_default_wired_connection_init (NMDefaultWiredConnection *self) +{ +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMDefaultWiredConnectionPrivate *priv; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + char *id, *uuid; + + object = G_OBJECT_CLASS (nm_default_wired_connection_parent_class)->constructor (type, n_construct_params, construct_params); + if (!object) + return NULL; + + priv = NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (object); + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + + id = g_strdup_printf (_("Auto %s"), nm_device_get_iface (priv->device)); + uuid = nm_utils_uuid_generate (); + + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, id, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_READ_ONLY, priv->read_only, + NULL); + + g_free (id); + g_free (uuid); + + nm_connection_add_setting (NM_CONNECTION (object), NM_SETTING (s_con)); + + /* Lock the connection to the specific device */ + s_wired = NM_SETTING_WIRED (nm_setting_wired_new ()); + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, priv->mac, NULL); + nm_connection_add_setting (NM_CONNECTION (object), NM_SETTING (s_wired)); + + return object; +} + +static void +finalize (GObject *object) +{ + NMDefaultWiredConnectionPrivate *priv = NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (object); + + g_object_unref (priv->device); + g_byte_array_free (priv->mac, TRUE); + + G_OBJECT_CLASS (nm_default_wired_connection_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMDefaultWiredConnectionPrivate *priv = NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_MAC: + g_value_set_pointer (value, priv->mac); + break; + case PROP_DEVICE: + g_value_set_object (value, priv->device); + break; + case PROP_READ_ONLY: + g_value_set_boolean (value, priv->read_only); + 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) +{ + NMDefaultWiredConnectionPrivate *priv = NM_DEFAULT_WIRED_CONNECTION_GET_PRIVATE (object); + GByteArray *array; + + switch (prop_id) { + case PROP_MAC: + /* Construct only */ + array = g_value_get_pointer (value); + if (priv->mac) { + g_byte_array_free (priv->mac, TRUE); + priv->mac = NULL; + } + if (array) { + g_return_if_fail (array->len == ETH_ALEN); + priv->mac = g_byte_array_sized_new (array->len); + g_byte_array_append (priv->mac, array->data, ETH_ALEN); + } + break; + case PROP_DEVICE: + if (priv->device) + g_object_unref (priv->device); + priv->device = g_value_dup_object (value); + break; + case PROP_READ_ONLY: + priv->read_only = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_default_wired_connection_class_init (NMDefaultWiredConnectionClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (NMDefaultWiredConnectionPrivate)); + + /* Virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_MAC, + g_param_spec_pointer (NM_DEFAULT_WIRED_CONNECTION_MAC, + "MAC", + "MAC Address", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_DEVICE, + g_param_spec_object (NM_DEFAULT_WIRED_CONNECTION_DEVICE, + "Device", + "Device", + NM_TYPE_DEVICE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_READ_ONLY, + g_param_spec_boolean (NM_DEFAULT_WIRED_CONNECTION_READ_ONLY, + "ReadOnly", + "Read Only", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /* Signals */ + signals[TRY_UPDATE] = + g_signal_new ("try-update", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + /* The 'deleted' signal is used to signal intentional deletions (like + * updating or user-requested deletion) rather than using the + * superclass' 'removed' signal, since that signal doesn't have the + * semantics we want; it gets emitted as a side-effect of various operations + * and is meant more for D-Bus clients instead of in-service uses. + */ + signals[DELETED] = + g_signal_new ("deleted", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); +} diff --git a/src/system-settings/nm-default-wired-connection.h b/src/system-settings/nm-default-wired-connection.h new file mode 100644 index 00000000..de89b675 --- /dev/null +++ b/src/system-settings/nm-default-wired-connection.h @@ -0,0 +1,59 @@ +/* -*- 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 2008 Novell, Inc. + * (C) Copyright 2009 Red Hat, Inc. + */ + +#ifndef NM_DEFAULT_WIRED_CONNECTION_H +#define NM_DEFAULT_WIRED_CONNECTION_H + +#include "nm-sysconfig-connection.h" +#include "nm-device.h" + +G_BEGIN_DECLS + +#define NM_TYPE_DEFAULT_WIRED_CONNECTION (nm_default_wired_connection_get_type ()) +#define NM_DEFAULT_WIRED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnection)) +#define NM_DEFAULT_WIRED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnectionClass)) +#define NM_IS_DEFAULT_WIRED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEFAULT_WIRED_CONNECTION)) +#define NM_IS_DEFAULT_WIRED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEFAULT_WIRED_CONNECTION)) +#define NM_DEFAULT_WIRED_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEFAULT_WIRED_CONNECTION, NMDefaultWiredConnectionClass)) + +#define NM_DEFAULT_WIRED_CONNECTION_MAC "mac" +#define NM_DEFAULT_WIRED_CONNECTION_DEVICE "device" +#define NM_DEFAULT_WIRED_CONNECTION_READ_ONLY "read-only" + +typedef struct { + NMSysconfigConnection parent; +} NMDefaultWiredConnection; + +typedef struct { + NMSysconfigConnectionClass parent; +} NMDefaultWiredConnectionClass; + +GType nm_default_wired_connection_get_type (void); + +NMDefaultWiredConnection *nm_default_wired_connection_new (const GByteArray *mac, + NMDevice *device, + gboolean read_only); + +NMDevice *nm_default_wired_connection_get_device (NMDefaultWiredConnection *wired); + +G_END_DECLS + +#endif /* NM_DEFAULT_WIRED_CONNECTION_H */ diff --git a/src/system-settings/nm-inotify-helper.c b/src/system-settings/nm-inotify-helper.c new file mode 100644 index 00000000..0ee168e5 --- /dev/null +++ b/src/system-settings/nm-inotify-helper.c @@ -0,0 +1,212 @@ +/* -*- 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 2008 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include "nm-marshal.h" +#include "nm-inotify-helper.h" +#include "nm-logging.h" + +G_DEFINE_TYPE (NMInotifyHelper, nm_inotify_helper, G_TYPE_OBJECT) + +#define NM_INOTIFY_HELPER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_INOTIFY_HELPER, NMInotifyHelperPrivate)) + +typedef struct { + int ifd; + + GHashTable *wd_refs; +} NMInotifyHelperPrivate; + +/* Signals */ +enum { + EVENT, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +int +nm_inotify_helper_add_watch (NMInotifyHelper *self, const char *path) +{ + NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (self); + int wd; + guint32 refcount; + + g_return_val_if_fail (priv->ifd >= 0, -1); + + /* We only care about modifications since we're just trying to get change + * notifications on hardlinks. + */ + + wd = inotify_add_watch (priv->ifd, path, IN_CLOSE_WRITE); + if (wd < 0) + return -1; + + refcount = GPOINTER_TO_UINT (g_hash_table_lookup (priv->wd_refs, GINT_TO_POINTER (wd))); + refcount++; + g_hash_table_replace (priv->wd_refs, GINT_TO_POINTER (wd), GUINT_TO_POINTER (refcount)); + + return wd; +} + +void +nm_inotify_helper_remove_watch (NMInotifyHelper *self, int wd) +{ + NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (self); + guint32 refcount; + + g_return_if_fail (priv->ifd >= 0); + + refcount = GPOINTER_TO_UINT (g_hash_table_lookup (priv->wd_refs, GINT_TO_POINTER (wd))); + if (!refcount) + return; + + refcount--; + if (!refcount) { + g_hash_table_remove (priv->wd_refs, GINT_TO_POINTER (wd)); + inotify_rm_watch (priv->ifd, wd); + } else + g_hash_table_replace (priv->wd_refs, GINT_TO_POINTER (wd), GUINT_TO_POINTER (refcount)); +} + +static gboolean +inotify_event_handler (GIOChannel *channel, GIOCondition cond, gpointer user_data) +{ + NMInotifyHelper *self = NM_INOTIFY_HELPER (user_data); + struct inotify_event evt; + + /* read the notifications from the watch descriptor */ + while (g_io_channel_read_chars (channel, (gchar *) &evt, sizeof (struct inotify_event), NULL, NULL) == G_IO_STATUS_NORMAL) { + gchar filename[PATH_MAX + 1]; + + filename[0] = '\0'; + if (evt.len > 0) { + g_io_channel_read_chars (channel, + filename, + evt.len > PATH_MAX ? PATH_MAX : evt.len, + NULL, NULL); + } + + if (!(evt.mask & IN_IGNORED)) + g_signal_emit (self, signals[EVENT], 0, &evt, &filename[0]); + } + + return TRUE; +} + +static gboolean +init_inotify (NMInotifyHelper *self) +{ + NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (self); + GIOChannel *channel; + guint source_id; + + priv->ifd = inotify_init (); + if (priv->ifd == -1) { + nm_log_warn (LOGD_SYS_SET, "couldn't initialize inotify"); + return FALSE; + } + + /* Watch the inotify descriptor for file/directory change events */ + channel = g_io_channel_unix_new (priv->ifd); + if (!channel) { + nm_log_warn (LOGD_SYS_SET, "couldn't create new GIOChannel"); + close (priv->ifd); + priv->ifd = -1; + return FALSE; + } + + g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, NULL); + g_io_channel_set_encoding (channel, NULL, NULL); + + source_id = g_io_add_watch (channel, + G_IO_IN | G_IO_ERR, + (GIOFunc) inotify_event_handler, + (gpointer) self); + g_io_channel_unref (channel); + 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 (!singleton) + return NULL; + + if (!init_inotify (singleton)) { + g_object_unref (singleton); + return NULL; + } + } else + g_object_ref (singleton); + + g_assert (singleton); + return singleton; +} + +static void +nm_inotify_helper_init (NMInotifyHelper *self) +{ + NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (self); + + priv->wd_refs = g_hash_table_new (g_direct_hash, g_direct_equal); +} + +static void +finalize (GObject *object) +{ + NMInotifyHelperPrivate *priv = NM_INOTIFY_HELPER_GET_PRIVATE (object); + + if (priv->ifd >= 0) + close (priv->ifd); + + g_hash_table_destroy (priv->wd_refs); + + G_OBJECT_CLASS (nm_inotify_helper_parent_class)->finalize (object); +} + +static void +nm_inotify_helper_class_init (NMInotifyHelperClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (NMInotifyHelperPrivate)); + + /* Virtual methods */ + object_class->finalize = finalize; + + /* Signals */ + signals[EVENT] = + g_signal_new ("event", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (NMInotifyHelperClass, event), + NULL, NULL, + _nm_marshal_VOID__POINTER_STRING, + G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_STRING); +} + diff --git a/src/system-settings/nm-inotify-helper.h b/src/system-settings/nm-inotify-helper.h new file mode 100644 index 00000000..10d43ac9 --- /dev/null +++ b/src/system-settings/nm-inotify-helper.h @@ -0,0 +1,54 @@ +/* -*- 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 2008 Red Hat, Inc. + */ + +#ifndef __INOTIFY_HELPER_H__ +#define __INOTIFY_HELPER_H__ + +#include +#include +#include + +#define NM_TYPE_INOTIFY_HELPER (nm_inotify_helper_get_type ()) +#define NM_INOTIFY_HELPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_INOTIFY_HELPER, NMInotifyHelper)) +#define NM_INOTIFY_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_INOTIFY_HELPER, NMInotifyHelperClass)) +#define NM_IS_INOTIFY_HELPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_INOTIFY_HELPER)) +#define NM_IS_INOTIFY_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_INOTIFY_HELPER)) +#define NM_INOTIFY_HELPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_INOTIFY_HELPER, NMInotifyHelperClass)) + +typedef struct { + GObject parent; +} NMInotifyHelper; + +typedef struct { + GObjectClass parent; + + /* signals */ + void (* event) (NMInotifyHelper *helper, struct inotify_event *evt, const char *filename); +} NMInotifyHelperClass; + +GType nm_inotify_helper_get_type (void); + +NMInotifyHelper * nm_inotify_helper_get (void); + +int nm_inotify_helper_add_watch (NMInotifyHelper *helper, const char *path); + +void nm_inotify_helper_remove_watch (NMInotifyHelper *helper, int wd); + +#endif /* __INOTIFY_HELPER_H__ */ diff --git a/src/system-settings/nm-polkit-helpers.h b/src/system-settings/nm-polkit-helpers.h new file mode 100644 index 00000000..c26fcc2c --- /dev/null +++ b/src/system-settings/nm-polkit-helpers.h @@ -0,0 +1,32 @@ +/* -*- 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 2008 Novell, Inc. + * (C) Copyright 2008 Red Hat, Inc. + */ + +#ifndef NM_POLKIT_HELPERS_H +#define NM_POLKIT_HELPERS_H + +#include + +#define NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY "org.freedesktop.network-manager-settings.system.modify" +#define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_PROTECTED "org.freedesktop.network-manager-settings.system.wifi.share.protected" +#define NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_OPEN "org.freedesktop.network-manager-settings.system.wifi.share.open" +#define NM_SYSCONFIG_POLICY_ACTION_HOSTNAME_MODIFY "org.freedesktop.network-manager-settings.system.hostname.modify" + +#endif /* NM_POLKIT_HELPERS_H */ diff --git a/src/system-settings/nm-sysconfig-connection.c b/src/system-settings/nm-sysconfig-connection.c new file mode 100644 index 00000000..f46895ac --- /dev/null +++ b/src/system-settings/nm-sysconfig-connection.c @@ -0,0 +1,658 @@ +/* -*- 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 2008 Novell, Inc. + * (C) Copyright 2008 - 2009 Red Hat, Inc. + */ + +#include +#include + +#include "nm-sysconfig-connection.h" +#include "nm-system-config-error.h" +#include "nm-dbus-glib-types.h" +#include "nm-settings-connection-interface.h" +#include "nm-settings-interface.h" +#include "nm-polkit-helpers.h" +#include "nm-logging.h" + + +static void settings_connection_interface_init (NMSettingsConnectionInterface *klass); + +G_DEFINE_TYPE_EXTENDED (NMSysconfigConnection, nm_sysconfig_connection, NM_TYPE_EXPORTED_CONNECTION, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, + settings_connection_interface_init)) + +#define NM_SYSCONFIG_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ + NM_TYPE_SYSCONFIG_CONNECTION, \ + NMSysconfigConnectionPrivate)) + +typedef struct { + PolkitAuthority *authority; + GSList *pk_calls; + NMConnection *secrets; +} NMSysconfigConnectionPrivate; + +/**************************************************************/ + +static void +ignore_cb (NMSettingsConnectionInterface *connection, + GError *error, + gpointer user_data) +{ +} + +gboolean +nm_sysconfig_connection_update (NMSysconfigConnection *self, + NMConnection *new, + gboolean signal_update, + GError **error) +{ + NMSysconfigConnectionPrivate *priv; + GHashTable *new_settings; + gboolean success = FALSE; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (NM_IS_SYSCONFIG_CONNECTION (self), FALSE); + g_return_val_if_fail (new != NULL, FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (new), FALSE); + + priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + + /* Do nothing if there's nothing to update */ + if (nm_connection_compare (NM_CONNECTION (self), + NM_CONNECTION (new), + NM_SETTING_COMPARE_FLAG_EXACT)) + return TRUE; + + new_settings = nm_connection_to_hash (new); + g_assert (new_settings); + if (nm_connection_replace_settings (NM_CONNECTION (self), new_settings, error)) { + /* Copy the connection to keep its secrets around even if NM + * calls nm_connection_clear_secrets(). + */ + if (priv->secrets) + g_object_unref (priv->secrets); + priv->secrets = nm_connection_duplicate (NM_CONNECTION (self)); + + if (signal_update) { + nm_settings_connection_interface_update (NM_SETTINGS_CONNECTION_INTERFACE (self), + ignore_cb, + NULL); + } + success = TRUE; + } + g_hash_table_destroy (new_settings); + return success; +} + +/**************************************************************/ + +static GValue * +string_to_gvalue (const char *str) +{ + GValue *val = g_slice_new0 (GValue); + + g_value_init (val, G_TYPE_STRING); + g_value_set_string (val, str); + return val; +} + +static GValue * +byte_array_to_gvalue (const GByteArray *array) +{ + GValue *val; + + val = g_slice_new0 (GValue); + g_value_init (val, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_set_boxed (val, array); + + return val; +} + +static void +copy_one_secret (gpointer key, gpointer value, gpointer user_data) +{ + const char *value_str = (const char *) value; + + if (value_str) { + g_hash_table_insert ((GHashTable *) user_data, + g_strdup ((char *) key), + string_to_gvalue (value_str)); + } +} + +static void +add_secrets (NMSetting *setting, + const char *key, + const GValue *value, + GParamFlags flags, + gpointer user_data) +{ + GHashTable *secrets = user_data; + + if (!(flags & NM_SETTING_PARAM_SECRET)) + return; + + /* Copy secrets into the returned hash table */ + if (G_VALUE_HOLDS_STRING (value)) { + const char *tmp; + + tmp = g_value_get_string (value); + if (tmp) + g_hash_table_insert (secrets, g_strdup (key), string_to_gvalue (tmp)); + } else if (G_VALUE_HOLDS (value, DBUS_TYPE_G_MAP_OF_STRING)) { + /* Flatten the string hash by pulling its keys/values out */ + g_hash_table_foreach (g_value_get_boxed (value), copy_one_secret, secrets); + } else if (G_VALUE_TYPE (value) == DBUS_TYPE_G_UCHAR_ARRAY) { + GByteArray *array; + + array = g_value_get_boxed (value); + if (array) + g_hash_table_insert (secrets, g_strdup (key), byte_array_to_gvalue (array)); + } +} + +static void +destroy_gvalue (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static gboolean +get_secrets (NMSettingsConnectionInterface *connection, + const char *setting_name, + const char **hints, + gboolean request_new, + NMSettingsConnectionInterfaceGetSecretsFunc callback, + gpointer user_data) +{ + NMSysconfigConnection *self = NM_SYSCONFIG_CONNECTION (connection); + NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + GHashTable *settings = NULL; + GHashTable *secrets = NULL; + NMSetting *setting; + GError *error = NULL; + + /* Use priv->secrets to work around the fact that nm_connection_clear_secrets() + * will clear secrets on this object's settings. priv->secrets should be + * a complete copy of this object and kept in sync by + * nm_sysconfig_connection_update(). + */ + if (!priv->secrets) { + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, + "%s.%d - Internal error; secrets cache invalid.", + __FILE__, __LINE__); + (*callback) (connection, NULL, error, user_data); + g_error_free (error); + return TRUE; + } + + setting = nm_connection_get_setting_by_name (priv->secrets, setting_name); + if (!setting) { + error = g_error_new (NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INVALID_SETTING, + "%s.%d - Connection didn't have requested setting '%s'.", + __FILE__, __LINE__, setting_name); + (*callback) (connection, NULL, error, user_data); + g_error_free (error); + return TRUE; + } + + /* Returned secrets are a{sa{sv}}; this is the outer a{s...} hash that + * will contain all the individual settings hashes. + */ + settings = g_hash_table_new_full (g_str_hash, g_str_equal, + g_free, (GDestroyNotify) g_hash_table_destroy); + + /* Add the secrets from this setting to the inner secrets hash for this setting */ + secrets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, destroy_gvalue); + nm_setting_enumerate_values (setting, add_secrets, secrets); + + g_hash_table_insert (settings, g_strdup (setting_name), secrets); + callback (connection, settings, NULL, user_data); + g_hash_table_destroy (settings); + return TRUE; +} + +/**************************************************************/ + +typedef struct { + NMSysconfigConnection *self; + DBusGMethodInvocation *context; + PolkitSubject *subject; + GCancellable *cancellable; + gboolean disposed; + + /* Update */ + NMConnection *connection; + + /* Secrets */ + char *setting_name; + char **hints; + gboolean request_new; +} PolkitCall; + +static PolkitCall * +polkit_call_new (NMSysconfigConnection *self, + DBusGMethodInvocation *context, + NMConnection *connection, + const char *setting_name, + const char **hints, + gboolean request_new) +{ + PolkitCall *call; + char *sender; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (context != NULL, NULL); + + call = g_malloc0 (sizeof (PolkitCall)); + call->self = self; + call->context = context; + call->cancellable = g_cancellable_new (); + call->connection = connection; + call->setting_name = g_strdup (setting_name); + if (hints) + call->hints = g_strdupv ((char **) hints); + call->request_new = request_new; + + sender = dbus_g_method_get_sender (context); + call->subject = polkit_system_bus_name_new (sender); + g_free (sender); + + return call; +} + +static void +polkit_call_free (PolkitCall *call) +{ + if (call->connection) + g_object_unref (call->connection); + g_free (call->setting_name); + if (call->hints) + g_strfreev (call->hints); + + g_object_unref (call->subject); + g_object_unref (call->cancellable); + g_free (call); +} + +static void +con_update_cb (NMSettingsConnectionInterface *connection, + GError *error, + gpointer user_data) +{ + PolkitCall *call = user_data; + + if (error) + dbus_g_method_return_error (call->context, error); + else + dbus_g_method_return (call->context); + + polkit_call_free (call); +} + +static void +pk_update_cb (GObject *object, GAsyncResult *result, gpointer user_data) +{ + PolkitCall *call = user_data; + NMSysconfigConnection *self = call->self; + NMSysconfigConnectionPrivate *priv; + PolkitAuthorizationResult *pk_result; + GError *error = NULL; + + /* If our NMSysconfigConnection is already gone, do nothing */ + if (call->disposed) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, + "Request was canceled."); + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + return; + } + + priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + + priv->pk_calls = g_slist_remove (priv->pk_calls, call); + + pk_result = polkit_authority_check_authorization_finish (priv->authority, + result, + &error); + /* Some random error happened */ + if (error) { + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + return; + } + + /* Caller didn't successfully authenticate */ + if (!polkit_authorization_result_get_is_authorized (pk_result)) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED, + "Insufficient privileges."); + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + goto out; + } + + /* Update our settings internally so the update() call will save the new + * ones. We don't let nm_sysconfig_connection_update() handle the update + * signal since we need our own callback after the update is done. + */ + if (!nm_sysconfig_connection_update (self, call->connection, FALSE, &error)) { + /* Shouldn't really happen since we've already validated the settings */ + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + goto out; + } + + /* Caller is authenticated, now we can finally try to commit the update */ + nm_settings_connection_interface_update (NM_SETTINGS_CONNECTION_INTERFACE (self), + con_update_cb, + call); + +out: + g_object_unref (pk_result); +} + +static void +dbus_update (NMExportedConnection *exported, + GHashTable *new_settings, + DBusGMethodInvocation *context) +{ + NMSysconfigConnection *self = NM_SYSCONFIG_CONNECTION (exported); + NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + PolkitCall *call; + NMConnection *tmp; + GError *error = NULL; + + /* Check if the settings are valid first */ + tmp = nm_connection_new_from_hash (new_settings, &error); + if (!tmp) { + g_assert (error); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + call = polkit_call_new (self, context, tmp, NULL, NULL, FALSE); + g_assert (call); + polkit_authority_check_authorization (priv->authority, + call->subject, + NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY, + NULL, + POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, + call->cancellable, + pk_update_cb, + call); + priv->pk_calls = g_slist_prepend (priv->pk_calls, call); +} + +static void +con_delete_cb (NMSettingsConnectionInterface *connection, + GError *error, + gpointer user_data) +{ + PolkitCall *call = user_data; + + if (error) + dbus_g_method_return_error (call->context, error); + else + dbus_g_method_return (call->context); + + polkit_call_free (call); +} + +static void +pk_delete_cb (GObject *object, GAsyncResult *result, gpointer user_data) +{ + PolkitCall *call = user_data; + NMSysconfigConnection *self = call->self; + NMSysconfigConnectionPrivate *priv; + PolkitAuthorizationResult *pk_result; + GError *error = NULL; + + /* If our NMSysconfigConnection is already gone, do nothing */ + if (call->disposed) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, + "Request was canceled."); + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + return; + } + + priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + + priv->pk_calls = g_slist_remove (priv->pk_calls, call); + + pk_result = polkit_authority_check_authorization_finish (priv->authority, + result, + &error); + /* Some random error happened */ + if (error) { + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + return; + } + + /* Caller didn't successfully authenticate */ + if (!polkit_authorization_result_get_is_authorized (pk_result)) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED, + "Insufficient privileges."); + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + goto out; + } + + /* Caller is authenticated, now we can finally try to delete */ + nm_settings_connection_interface_delete (NM_SETTINGS_CONNECTION_INTERFACE (self), + con_delete_cb, + call); + +out: + g_object_unref (pk_result); +} + +static void +dbus_delete (NMExportedConnection *exported, + DBusGMethodInvocation *context) +{ + NMSysconfigConnection *self = NM_SYSCONFIG_CONNECTION (exported); + NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + PolkitCall *call; + + call = polkit_call_new (self, context, NULL, NULL, NULL, FALSE); + g_assert (call); + polkit_authority_check_authorization (priv->authority, + call->subject, + NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY, + NULL, + POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, + call->cancellable, + pk_delete_cb, + call); + priv->pk_calls = g_slist_prepend (priv->pk_calls, call); +} + +static void +con_secrets_cb (NMSettingsConnectionInterface *connection, + GHashTable *secrets, + GError *error, + gpointer user_data) +{ + PolkitCall *call = user_data; + + if (error) + dbus_g_method_return_error (call->context, error); + else + dbus_g_method_return (call->context, secrets); + + polkit_call_free (call); +} + +static void +pk_secrets_cb (GObject *object, GAsyncResult *result, gpointer user_data) +{ + PolkitCall *call = user_data; + NMSysconfigConnection *self = call->self; + NMSysconfigConnectionPrivate *priv; + PolkitAuthorizationResult *pk_result; + GError *error = NULL; + + /* If our NMSysconfigConnection is already gone, do nothing */ + if (call->disposed) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, + "Request was canceled."); + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + return; + } + + priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + + priv->pk_calls = g_slist_remove (priv->pk_calls, call); + + pk_result = polkit_authority_check_authorization_finish (priv->authority, + result, + &error); + /* Some random error happened */ + if (error) { + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + return; + } + + /* Caller didn't successfully authenticate */ + if (!polkit_authorization_result_get_is_authorized (pk_result)) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED, + "Insufficient privileges."); + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + goto out; + } + + /* Caller is authenticated, now we can finally try to update */ + nm_settings_connection_interface_get_secrets (NM_SETTINGS_CONNECTION_INTERFACE (self), + call->setting_name, + (const char **) call->hints, + call->request_new, + con_secrets_cb, + call); + +out: + g_object_unref (pk_result); +} + +static void +dbus_get_secrets (NMExportedConnection *exported, + const gchar *setting_name, + const gchar **hints, + gboolean request_new, + DBusGMethodInvocation *context) +{ + NMSysconfigConnection *self = NM_SYSCONFIG_CONNECTION (exported); + NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + PolkitCall *call; + + call = polkit_call_new (self, context, NULL, setting_name, hints, request_new); + g_assert (call); + polkit_authority_check_authorization (priv->authority, + call->subject, + NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY, + NULL, + POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, + call->cancellable, + pk_secrets_cb, + call); + priv->pk_calls = g_slist_prepend (priv->pk_calls, call); +} + +/**************************************************************/ + +static void +settings_connection_interface_init (NMSettingsConnectionInterface *iface) +{ + iface->get_secrets = get_secrets; +} + +static void +nm_sysconfig_connection_init (NMSysconfigConnection *self) +{ + NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + + priv->authority = polkit_authority_get (); + if (!priv->authority) { + nm_log_err (LOGD_SYS_SET, "%s: error creating PolicyKit authority"); + } +} + +static void +dispose (GObject *object) +{ + NMSysconfigConnection *self = NM_SYSCONFIG_CONNECTION (object); + NMSysconfigConnectionPrivate *priv = NM_SYSCONFIG_CONNECTION_GET_PRIVATE (self); + GSList *iter; + + if (priv->secrets) + g_object_unref (priv->secrets); + + /* Cancel PolicyKit requests */ + for (iter = priv->pk_calls; iter; iter = g_slist_next (iter)) { + PolkitCall *call = iter->data; + + call->disposed = TRUE; + g_cancellable_cancel (call->cancellable); + } + g_slist_free (priv->pk_calls); + priv->pk_calls = NULL; + + G_OBJECT_CLASS (nm_sysconfig_connection_parent_class)->dispose (object); +} + +static void +nm_sysconfig_connection_class_init (NMSysconfigConnectionClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + NMExportedConnectionClass *ec_class = NM_EXPORTED_CONNECTION_CLASS (class); + + g_type_class_add_private (class, sizeof (NMSysconfigConnectionPrivate)); + + /* Virtual methods */ + object_class->dispose = dispose; + ec_class->update = dbus_update; + ec_class->delete = dbus_delete; + ec_class->get_secrets = dbus_get_secrets; +} diff --git a/src/system-settings/nm-sysconfig-connection.h b/src/system-settings/nm-sysconfig-connection.h new file mode 100644 index 00000000..0431dc95 --- /dev/null +++ b/src/system-settings/nm-sysconfig-connection.h @@ -0,0 +1,56 @@ +/* -*- 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 2008 Novell, Inc. + */ + +#ifndef NM_SYSCONFIG_CONNECTION_H +#define NM_SYSCONFIG_CONNECTION_H + +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SYSCONFIG_CONNECTION (nm_sysconfig_connection_get_type ()) +#define NM_SYSCONFIG_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SYSCONFIG_CONNECTION, NMSysconfigConnection)) +#define NM_SYSCONFIG_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SYSCONFIG_CONNECTION, NMSysconfigConnectionClass)) +#define NM_IS_SYSCONFIG_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SYSCONFIG_CONNECTION)) +#define NM_IS_SYSCONFIG_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SYSCONFIG_CONNECTION)) +#define NM_SYSCONFIG_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SYSCONFIG_CONNECTION, NMSysconfigConnectionClass)) + +typedef struct { + NMExportedConnection parent; +} NMSysconfigConnection; + +typedef struct { + NMExportedConnectionClass parent; +} NMSysconfigConnectionClass; + +GType nm_sysconfig_connection_get_type (void); + +/* Called by a system-settings plugin to update a connection is out of sync + * with it's backing storage. + */ +gboolean nm_sysconfig_connection_update (NMSysconfigConnection *self, + NMConnection *new_settings, + gboolean signal_update, + GError **error); + +G_END_DECLS + +#endif /* NM_SYSCONFIG_CONNECTION_H */ diff --git a/src/system-settings/nm-sysconfig-settings.c b/src/system-settings/nm-sysconfig-settings.c new file mode 100644 index 00000000..4bcfb04b --- /dev/null +++ b/src/system-settings/nm-sysconfig-settings.c @@ -0,0 +1,1520 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * Søren Sandmann + * Dan Williams + * Tambet Ingo + * + * 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 - 2010 Red Hat, Inc. + * (C) Copyright 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../nm-device-ethernet.h" +#include "nm-dbus-glib-types.h" +#include "nm-sysconfig-settings.h" +#include "nm-sysconfig-connection.h" +#include "nm-polkit-helpers.h" +#include "nm-system-config-error.h" +#include "nm-default-wired-connection.h" +#include "nm-logging.h" + +#define CONFIG_KEY_NO_AUTO_DEFAULT "no-auto-default" + +/* LINKER CRACKROCK */ +#define EXPORT(sym) void * __export_##sym = &sym; + +#include "nm-inotify-helper.h" +EXPORT(nm_inotify_helper_get_type) +EXPORT(nm_inotify_helper_get) +EXPORT(nm_inotify_helper_add_watch) +EXPORT(nm_inotify_helper_remove_watch) + +EXPORT(nm_sysconfig_connection_get_type) +EXPORT(nm_sysconfig_connection_update) +/* END LINKER CRACKROCK */ + +static void claim_connection (NMSysconfigSettings *self, + NMSettingsConnectionInterface *connection, + gboolean do_export); + +static void impl_settings_save_hostname (NMSysconfigSettings *self, + const char *hostname, + DBusGMethodInvocation *context); + +static void impl_settings_get_permissions (NMSysconfigSettings *self, + DBusGMethodInvocation *context); + +#include "nm-settings-system-glue.h" + +static void unmanaged_specs_changed (NMSystemConfigInterface *config, gpointer user_data); + +typedef struct { + PolkitAuthority *authority; + guint auth_changed_id; + char *config_file; + + GSList *pk_calls; + GSList *permissions_calls; + + GSList *plugins; + gboolean connections_loaded; + GHashTable *connections; + GSList *unmanaged_specs; +} NMSysconfigSettingsPrivate; + +static void settings_system_interface_init (NMSettingsSystemInterface *klass); + +G_DEFINE_TYPE_WITH_CODE (NMSysconfigSettings, nm_sysconfig_settings, NM_TYPE_SETTINGS_SERVICE, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_SYSTEM_INTERFACE, + settings_system_interface_init)) + +#define NM_SYSCONFIG_SETTINGS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SYSCONFIG_SETTINGS, NMSysconfigSettingsPrivate)) + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_UNMANAGED_SPECS, + + LAST_PROP +}; + +static void +load_connections (NMSysconfigSettings *self) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GSList *iter; + + if (priv->connections_loaded) + return; + + for (iter = priv->plugins; iter; iter = g_slist_next (iter)) { + NMSystemConfigInterface *plugin = NM_SYSTEM_CONFIG_INTERFACE (iter->data); + GSList *plugin_connections; + GSList *elt; + + plugin_connections = nm_system_config_interface_get_connections (plugin); + + // FIXME: ensure connections from plugins loaded with a lower priority + // get rejected when they conflict with connections from a higher + // priority plugin. + + for (elt = plugin_connections; elt; elt = g_slist_next (elt)) + claim_connection (self, NM_SETTINGS_CONNECTION_INTERFACE (elt->data), TRUE); + + g_slist_free (plugin_connections); + } + + priv->connections_loaded = TRUE; + + /* FIXME: Bad hack */ + unmanaged_specs_changed (NULL, self); +} + +static GSList * +list_connections (NMSettingsService *settings) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (settings); + GHashTableIter iter; + gpointer key; + GSList *list = NULL; + + load_connections (NM_SYSCONFIG_SETTINGS (settings)); + + g_hash_table_iter_init (&iter, priv->connections); + while (g_hash_table_iter_next (&iter, &key, NULL)) + list = g_slist_prepend (list, NM_EXPORTED_CONNECTION (key)); + return g_slist_reverse (list); +} + +static void +clear_unmanaged_specs (NMSysconfigSettings *self) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + g_slist_foreach (priv->unmanaged_specs, (GFunc) g_free, NULL); + g_slist_free (priv->unmanaged_specs); + priv->unmanaged_specs = NULL; +} + +static char* +uscore_to_wincaps (const char *uscore) +{ + const char *p; + GString *str; + gboolean last_was_uscore; + + last_was_uscore = TRUE; + + str = g_string_new (NULL); + p = uscore; + while (p && *p) { + if (*p == '-' || *p == '_') + last_was_uscore = TRUE; + else { + if (last_was_uscore) { + g_string_append_c (str, g_ascii_toupper (*p)); + last_was_uscore = FALSE; + } else + g_string_append_c (str, *p); + } + ++p; + } + + return g_string_free (str, FALSE); +} + +static void +notify (GObject *object, GParamSpec *pspec) +{ + GValue *value; + GHashTable *hash; + + value = g_slice_new0 (GValue); + hash = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL); + + g_value_init (value, pspec->value_type); + g_object_get_property (object, pspec->name, value); + g_hash_table_insert (hash, uscore_to_wincaps (pspec->name), value); + g_signal_emit (object, signals[PROPERTIES_CHANGED], 0, hash); + g_hash_table_destroy (hash); + g_value_unset (value); + g_slice_free (GValue, value); +} + +const GSList * +nm_sysconfig_settings_get_unmanaged_specs (NMSysconfigSettings *self) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + load_connections (self); + return priv->unmanaged_specs; +} + +static NMSystemConfigInterface * +get_plugin (NMSysconfigSettings *self, guint32 capability) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GSList *iter; + + g_return_val_if_fail (self != NULL, NULL); + + /* Do any of the plugins support setting the hostname? */ + for (iter = priv->plugins; iter; iter = iter->next) { + NMSystemConfigInterfaceCapabilities caps = NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE; + + g_object_get (G_OBJECT (iter->data), NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES, &caps, NULL); + if (caps & capability) + return NM_SYSTEM_CONFIG_INTERFACE (iter->data); + } + + return NULL; +} + +char * +nm_sysconfig_settings_get_hostname (NMSysconfigSettings *self) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GSList *iter; + char *hostname = NULL; + + /* Hostname returned is the hostname returned from the first plugin + * that provides one. + */ + for (iter = priv->plugins; iter; iter = iter->next) { + NMSystemConfigInterfaceCapabilities caps = NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE; + + g_object_get (G_OBJECT (iter->data), NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES, &caps, NULL); + if (caps & NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME) { + g_object_get (G_OBJECT (iter->data), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME, &hostname, NULL); + if (hostname && strlen (hostname)) + return hostname; + g_free (hostname); + } + } + + return hostname; +} + +static void +plugin_connection_added (NMSystemConfigInterface *config, + NMSettingsConnectionInterface *connection, + gpointer user_data) +{ + claim_connection (NM_SYSCONFIG_SETTINGS (user_data), connection, TRUE); +} + +static gboolean +find_unmanaged_device (NMSysconfigSettings *self, const char *needle) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GSList *iter; + + for (iter = priv->unmanaged_specs; iter; iter = g_slist_next (iter)) { + if (!strcmp ((const char *) iter->data, needle)) + return TRUE; + } + return FALSE; +} + +static void +unmanaged_specs_changed (NMSystemConfigInterface *config, + gpointer user_data) +{ + NMSysconfigSettings *self = NM_SYSCONFIG_SETTINGS (user_data); + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GSList *iter; + + clear_unmanaged_specs (self); + + /* Ask all the plugins for their unmanaged specs */ + for (iter = priv->plugins; iter; iter = g_slist_next (iter)) { + GSList *specs, *specs_iter; + + specs = nm_system_config_interface_get_unmanaged_specs (NM_SYSTEM_CONFIG_INTERFACE (iter->data)); + for (specs_iter = specs; specs_iter; specs_iter = specs_iter->next) { + if (!find_unmanaged_device (self, (const char *) specs_iter->data)) { + priv->unmanaged_specs = g_slist_prepend (priv->unmanaged_specs, specs_iter->data); + } else + g_free (specs_iter->data); + } + + g_slist_free (specs); + } + + g_object_notify (G_OBJECT (self), NM_SYSCONFIG_SETTINGS_UNMANAGED_SPECS); +} + +static void +hostname_changed (NMSystemConfigInterface *config, + GParamSpec *pspec, + gpointer user_data) +{ + g_object_notify (G_OBJECT (user_data), NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME); +} + +static void +add_plugin (NMSysconfigSettings *self, NMSystemConfigInterface *plugin) +{ + NMSysconfigSettingsPrivate *priv; + char *pname = NULL; + char *pinfo = NULL; + + g_return_if_fail (NM_IS_SYSCONFIG_SETTINGS (self)); + g_return_if_fail (NM_IS_SYSTEM_CONFIG_INTERFACE (plugin)); + + priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + priv->plugins = g_slist_append (priv->plugins, g_object_ref (plugin)); + + g_signal_connect (plugin, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + G_CALLBACK (plugin_connection_added), self); + g_signal_connect (plugin, "notify::hostname", G_CALLBACK (hostname_changed), self); + + nm_system_config_interface_init (plugin, NULL); + + g_object_get (G_OBJECT (plugin), + NM_SYSTEM_CONFIG_INTERFACE_NAME, &pname, + NM_SYSTEM_CONFIG_INTERFACE_INFO, &pinfo, + NULL); + + g_signal_connect (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED, + G_CALLBACK (unmanaged_specs_changed), self); + + nm_log_info (LOGD_SYS_SET, "Loaded plugin %s: %s", pname, pinfo); + g_free (pname); + g_free (pinfo); +} + +static GObject * +find_plugin (GSList *list, const char *pname) +{ + GSList *iter; + GObject *obj = NULL; + + g_return_val_if_fail (pname != NULL, FALSE); + + for (iter = list; iter && !obj; iter = g_slist_next (iter)) { + NMSystemConfigInterface *plugin = NM_SYSTEM_CONFIG_INTERFACE (iter->data); + char *list_pname = NULL; + + g_object_get (G_OBJECT (plugin), + NM_SYSTEM_CONFIG_INTERFACE_NAME, + &list_pname, + NULL); + if (list_pname && !strcmp (pname, list_pname)) + obj = G_OBJECT (plugin); + + g_free (list_pname); + } + + return obj; +} + +static gboolean +load_plugins (NMSysconfigSettings *self, const char *plugins, GError **error) +{ + GSList *list = NULL; + char **plist; + char **iter; + gboolean success = TRUE; + + plist = g_strsplit (plugins, ",", 0); + if (!plist) + return FALSE; + + for (iter = plist; *iter; iter++) { + GModule *plugin; + char *full_name, *path; + const char *pname = *iter; + GObject *obj; + GObject * (*factory_func) (void); + + /* ifcfg-fedora was renamed ifcfg-rh; handle old configs here */ + if (!strcmp (pname, "ifcfg-fedora")) + pname = "ifcfg-rh"; + + obj = find_plugin (list, pname); + if (obj) + continue; + + full_name = g_strdup_printf ("nm-settings-plugin-%s", pname); + path = g_module_build_path (PLUGINDIR, full_name); + + plugin = g_module_open (path, G_MODULE_BIND_LOCAL); + if (!plugin) { + g_set_error (error, 0, 0, + "Could not load plugin '%s': %s", + pname, g_module_error ()); + g_free (full_name); + g_free (path); + success = FALSE; + break; + } + + g_free (full_name); + g_free (path); + + if (!g_module_symbol (plugin, "nm_system_config_factory", (gpointer) (&factory_func))) { + g_set_error (error, 0, 0, + "Could not find plugin '%s' factory function.", + pname); + success = FALSE; + break; + } + + obj = (*factory_func) (); + if (!obj || !NM_IS_SYSTEM_CONFIG_INTERFACE (obj)) { + g_set_error (error, 0, 0, + "Plugin '%s' returned invalid system config object.", + pname); + success = FALSE; + break; + } + + g_module_make_resident (plugin); + g_object_weak_ref (obj, (GWeakNotify) g_module_close, plugin); + add_plugin (self, NM_SYSTEM_CONFIG_INTERFACE (obj)); + list = g_slist_append (list, obj); + } + + g_strfreev (plist); + + g_slist_foreach (list, (GFunc) g_object_unref, NULL); + g_slist_free (list); + + return success; +} + +static void +connection_removed (NMSettingsConnectionInterface *connection, + gpointer user_data) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (user_data); + + g_hash_table_remove (priv->connections, connection); +} + +static void +claim_connection (NMSysconfigSettings *self, + NMSettingsConnectionInterface *connection, + gboolean do_export) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + g_return_if_fail (NM_IS_SYSCONFIG_SETTINGS (self)); + g_return_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection)); + + if (g_hash_table_lookup (priv->connections, connection)) + /* A plugin is lying to us. */ + return; + + g_hash_table_insert (priv->connections, g_object_ref (connection), GINT_TO_POINTER (1)); + g_signal_connect (connection, + NM_SETTINGS_CONNECTION_INTERFACE_REMOVED, + G_CALLBACK (connection_removed), + self); + + if (do_export) { + nm_settings_service_export_connection (NM_SETTINGS_SERVICE (self), connection); + g_signal_emit_by_name (self, NM_SETTINGS_INTERFACE_NEW_CONNECTION, connection); + } +} + +static void +remove_connection (NMSysconfigSettings *self, + NMSettingsConnectionInterface *connection, + gboolean do_signal) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + g_return_if_fail (NM_IS_SYSCONFIG_SETTINGS (self)); + g_return_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection)); + + if (g_hash_table_lookup (priv->connections, connection)) { + g_signal_emit_by_name (G_OBJECT (connection), NM_SETTINGS_CONNECTION_INTERFACE_REMOVED); + g_hash_table_remove (priv->connections, connection); + } +} + +typedef struct { + NMSysconfigSettings *self; + DBusGMethodInvocation *context; + PolkitSubject *subject; + GCancellable *cancellable; + gboolean disposed; + + NMConnection *connection; + NMSettingsAddConnectionFunc callback; + gpointer callback_data; + + char *hostname; + + NMSettingsSystemPermissions permissions; + guint32 permissions_calls; +} PolkitCall; + +#include "nm-dbus-manager.h" + +static PolkitCall * +polkit_call_new (NMSysconfigSettings *self, + DBusGMethodInvocation *context, + NMConnection *connection, + NMSettingsAddConnectionFunc callback, + gpointer callback_data, + const char *hostname) +{ + PolkitCall *call; + char *sender; + + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (context != NULL, NULL); + + call = g_malloc0 (sizeof (PolkitCall)); + call->self = self; + call->cancellable = g_cancellable_new (); + call->context = context; + if (connection) + call->connection = g_object_ref (connection); + if (callback) { + call->callback = callback; + call->callback_data = callback_data; + } + if (hostname) + call->hostname = g_strdup (hostname); + + sender = dbus_g_method_get_sender (context); + call->subject = polkit_system_bus_name_new (sender); + g_free (sender); + + return call; +} + +static void +polkit_call_free (PolkitCall *call) +{ + if (call->connection) + g_object_unref (call->connection); + g_object_unref (call->cancellable); + g_free (call->hostname); + g_object_unref (call->subject); + g_free (call); +} + +static gboolean +add_new_connection (NMSysconfigSettings *self, + NMConnection *connection, + GError **error) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GError *tmp_error = NULL, *last_error = NULL; + GSList *iter; + gboolean success = FALSE; + + /* Here's how it works: + 1) plugin writes a connection. + 2) plugin notices that a new connection is available for reading. + 3) plugin reads the new connection (the one it wrote in 1) and emits 'connection-added' signal. + 4) NMSysconfigSettings receives the signal and adds it to it's connection list. + */ + + for (iter = priv->plugins; iter && !success; iter = iter->next) { + success = nm_system_config_interface_add_connection (NM_SYSTEM_CONFIG_INTERFACE (iter->data), + connection, + &tmp_error); + g_clear_error (&last_error); + if (!success) { + last_error = tmp_error; + tmp_error = NULL; + } + } + + if (!success) + *error = last_error; + return success; +} + +static void +pk_add_cb (GObject *object, GAsyncResult *result, gpointer user_data) +{ + PolkitCall *call = user_data; + NMSysconfigSettings *self = call->self; + NMSysconfigSettingsPrivate *priv; + PolkitAuthorizationResult *pk_result; + GError *error = NULL, *add_error = NULL; + + /* If NMSysconfigSettings is already gone, do nothing */ + if (call->disposed) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, + "Request was canceled."); + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + return; + } + + priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + priv->pk_calls = g_slist_remove (priv->pk_calls, call); + + pk_result = polkit_authority_check_authorization_finish (priv->authority, + result, + &error); + /* Some random error happened */ + if (error) { + call->callback (NM_SETTINGS_INTERFACE (self), error, call->callback_data); + goto out; + } + + /* Caller didn't successfully authenticate */ + if (!polkit_authorization_result_get_is_authorized (pk_result)) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED, + "Insufficient privileges."); + call->callback (NM_SETTINGS_INTERFACE (self), error, call->callback_data); + goto out; + } + + if (add_new_connection (self, call->connection, &add_error)) + call->callback (NM_SETTINGS_INTERFACE (self), NULL, call->callback_data); + else { + error = g_error_new (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_ADD_FAILED, + "Saving connection failed: (%d) %s", + add_error ? add_error->code : -1, + (add_error && add_error->message) ? add_error->message : "(unknown)"); + g_error_free (add_error); + call->callback (NM_SETTINGS_INTERFACE (self), error, call->callback_data); + } + +out: + g_clear_error (&error); + polkit_call_free (call); + if (pk_result) + g_object_unref (pk_result); +} + +static void +add_connection (NMSettingsService *service, + NMConnection *connection, + DBusGMethodInvocation *context, /* Only present for D-Bus calls */ + NMSettingsAddConnectionFunc callback, + gpointer user_data) +{ + NMSysconfigSettings *self = NM_SYSCONFIG_SETTINGS (service); + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + PolkitCall *call; + GError *error = NULL; + + /* Do any of the plugins support adding? */ + if (!get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS)) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_ADD_NOT_SUPPORTED, + "None of the registered plugins support add."); + callback (NM_SETTINGS_INTERFACE (service), error, user_data); + g_error_free (error); + return; + } + + call = polkit_call_new (self, context, connection, callback, user_data, NULL); + g_assert (call); + polkit_authority_check_authorization (priv->authority, + call->subject, + NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY, + NULL, + POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, + call->cancellable, + pk_add_cb, + call); + priv->pk_calls = g_slist_append (priv->pk_calls, call); +} + +static void +pk_hostname_cb (GObject *object, GAsyncResult *result, gpointer user_data) +{ + PolkitCall *call = user_data; + NMSysconfigSettings *self = call->self; + NMSysconfigSettingsPrivate *priv; + PolkitAuthorizationResult *pk_result; + GError *error = NULL; + GSList *iter; + gboolean success = FALSE; + + /* If our NMSysconfigConnection is already gone, do nothing */ + if (call->disposed) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, + "Request was canceled."); + dbus_g_method_return_error (call->context, error); + g_error_free (error); + polkit_call_free (call); + return; + } + + priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + priv->pk_calls = g_slist_remove (priv->pk_calls, call); + + pk_result = polkit_authority_check_authorization_finish (priv->authority, + result, + &error); + /* Some random error happened */ + if (error) { + dbus_g_method_return_error (call->context, error); + goto out; + } + + /* Caller didn't successfully authenticate */ + if (!polkit_authorization_result_get_is_authorized (pk_result)) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED, + "Insufficient privileges."); + dbus_g_method_return_error (call->context, error); + goto out; + } + + /* Set the hostname in all plugins */ + for (iter = priv->plugins; iter; iter = iter->next) { + NMSystemConfigInterfaceCapabilities caps = NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE; + + g_object_get (G_OBJECT (iter->data), NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES, &caps, NULL); + if (caps & NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME) { + g_object_set (G_OBJECT (iter->data), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME, call->hostname, NULL); + success = TRUE; + } + } + + if (success) { + dbus_g_method_return (call->context); + } else { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_SAVE_HOSTNAME_FAILED, + "Saving the hostname failed."); + dbus_g_method_return_error (call->context, error); + } + +out: + g_clear_error (&error); + polkit_call_free (call); + if (pk_result) + g_object_unref (pk_result); +} + +static void +impl_settings_save_hostname (NMSysconfigSettings *self, + const char *hostname, + DBusGMethodInvocation *context) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + PolkitCall *call; + GError *error = NULL; + + /* Do any of the plugins support setting the hostname? */ + if (!get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME)) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_SAVE_HOSTNAME_NOT_SUPPORTED, + "None of the registered plugins support setting the hostname."); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + call = polkit_call_new (self, context, NULL, NULL, NULL, hostname); + g_assert (call); + polkit_authority_check_authorization (priv->authority, + call->subject, + NM_SYSCONFIG_POLICY_ACTION_HOSTNAME_MODIFY, + NULL, + POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, + call->cancellable, + pk_hostname_cb, + call); + priv->pk_calls = g_slist_append (priv->pk_calls, call); +} + +static void +pk_authority_changed_cb (GObject *object, gpointer user_data) +{ + /* Let clients know they should re-check their authorization */ + g_signal_emit_by_name (NM_SYSCONFIG_SETTINGS (user_data), + NM_SETTINGS_SYSTEM_INTERFACE_CHECK_PERMISSIONS); +} + +typedef struct { + PolkitCall *pk_call; + const char *pk_action; + GCancellable *cancellable; + NMSettingsSystemPermissions permission; + gboolean disposed; +} PermissionsCall; + +static void +permission_call_done (GObject *object, GAsyncResult *result, gpointer user_data) +{ + PermissionsCall *call = user_data; + PolkitCall *pk_call = call->pk_call; + NMSysconfigSettings *self = pk_call->self; + NMSysconfigSettingsPrivate *priv; + PolkitAuthorizationResult *pk_result; + GError *error = NULL; + + /* If NMSysconfigSettings is gone, just skip to the end */ + if (call->disposed) + goto done; + + priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + priv->permissions_calls = g_slist_remove (priv->permissions_calls, call); + + pk_result = polkit_authority_check_authorization_finish (priv->authority, + result, + &error); + /* Some random error happened */ + if (error) { + nm_log_err (LOGD_SYS_SET, "error checking '%s' permission: (%d) %s", + __FILE__, __LINE__, __func__, + call->pk_action, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + if (error) + g_error_free (error); + } else { + /* If the caller is authorized, or the caller could authorize via a + * challenge, then authorization is possible. Otherwise, caller is out of + * luck. + */ + if ( polkit_authorization_result_get_is_authorized (pk_result) + || polkit_authorization_result_get_is_challenge (pk_result)) + pk_call->permissions |= call->permission; + } + + g_object_unref (pk_result); + +done: + pk_call->permissions_calls--; + if (pk_call->permissions_calls == 0) { + if (call->disposed) { + error = g_error_new_literal (NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, + "Request was canceled."); + dbus_g_method_return_error (pk_call->context, error); + g_error_free (error); + } else { + /* All the permissions calls are done, return the full permissions + * bitfield back to the user. + */ + dbus_g_method_return (pk_call->context, pk_call->permissions); + } + + polkit_call_free (pk_call); + } + memset (call, 0, sizeof (PermissionsCall)); + g_free (call); +} + +static void +start_permission_check (NMSysconfigSettings *self, + PolkitCall *pk_call, + const char *pk_action, + NMSettingsSystemPermissions permission) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + PermissionsCall *call; + + g_return_if_fail (pk_call != NULL); + g_return_if_fail (pk_action != NULL); + g_return_if_fail (permission != NM_SETTINGS_SYSTEM_PERMISSION_NONE); + + call = g_malloc0 (sizeof (PermissionsCall)); + call->pk_call = pk_call; + call->pk_action = pk_action; + call->permission = permission; + call->cancellable = g_cancellable_new (); + + pk_call->permissions_calls++; + + polkit_authority_check_authorization (priv->authority, + pk_call->subject, + pk_action, + NULL, + 0, + call->cancellable, + permission_call_done, + call); + priv->permissions_calls = g_slist_append (priv->permissions_calls, call); +} + +static void +impl_settings_get_permissions (NMSysconfigSettings *self, + DBusGMethodInvocation *context) +{ + PolkitCall *call; + + call = polkit_call_new (self, context, NULL, NULL, NULL, FALSE); + g_assert (call); + + /* Start checks for the various permissions */ + + /* Only check for connection-modify if one of our plugins supports it. */ + if (get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS)) { + start_permission_check (self, call, + NM_SYSCONFIG_POLICY_ACTION_CONNECTION_MODIFY, + NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY); + } + + /* Only check for hostname-modify if one of our plugins supports it. */ + if (get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME)) { + start_permission_check (self, call, + NM_SYSCONFIG_POLICY_ACTION_HOSTNAME_MODIFY, + NM_SETTINGS_SYSTEM_PERMISSION_HOSTNAME_MODIFY); + } + + // FIXME: hook these into plugin permissions like the modify permissions */ + start_permission_check (self, call, + NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_OPEN, + NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_OPEN); + start_permission_check (self, call, + NM_SYSCONFIG_POLICY_ACTION_WIFI_SHARE_PROTECTED, + NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_PROTECTED); +} + +static gboolean +get_permissions (NMSettingsSystemInterface *settings, + NMSettingsSystemGetPermissionsFunc callback, + gpointer user_data) +{ + NMSysconfigSettings *self = NM_SYSCONFIG_SETTINGS (settings); + NMSettingsSystemPermissions permissions = NM_SETTINGS_SYSTEM_PERMISSION_NONE; + + /* Local caller (ie, NM) gets full permissions by default because it doesn't + * need authorization. However, permissions are still subject to plugin's + * restrictions. i.e. if no plugins support connection-modify, then even + * the local caller won't get that permission. + */ + + /* Only check for connection-modify if one of our plugins supports it. */ + if (get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS)) + permissions |= NM_SETTINGS_SYSTEM_PERMISSION_CONNECTION_MODIFY; + + /* Only check for hostname-modify if one of our plugins supports it. */ + if (get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME)) + permissions |= NM_SETTINGS_SYSTEM_PERMISSION_HOSTNAME_MODIFY; + + // FIXME: hook these into plugin permissions like the modify permissions */ + permissions |= NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_OPEN; + permissions |= NM_SETTINGS_SYSTEM_PERMISSION_WIFI_SHARE_PROTECTED; + + callback (settings, permissions, NULL, user_data); + return TRUE; +} + +static gboolean +have_connection_for_device (NMSysconfigSettings *self, GByteArray *mac) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GHashTableIter iter; + gpointer key; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + const GByteArray *setting_mac; + gboolean ret = FALSE; + + g_return_val_if_fail (NM_IS_SYSCONFIG_SETTINGS (self), FALSE); + g_return_val_if_fail (mac != NULL, FALSE); + + /* Find a wired connection locked to the given MAC address, if any */ + g_hash_table_iter_init (&iter, priv->connections); + while (g_hash_table_iter_next (&iter, &key, NULL)) { + NMConnection *connection = NM_CONNECTION (key); + const char *connection_type; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + connection_type = nm_setting_connection_get_connection_type (s_con); + + if ( strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME) + && strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) + continue; + + s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + + /* No wired setting; therefore the PPPoE connection applies to any device */ + if (!s_wired && !strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) { + ret = TRUE; + break; + } + + setting_mac = nm_setting_wired_get_mac_address (s_wired); + if (setting_mac) { + /* A connection mac-locked to this device */ + if (!memcmp (setting_mac->data, mac->data, ETH_ALEN)) { + ret = TRUE; + break; + } + } else { + /* A connection that applies to any wired device */ + ret = TRUE; + break; + } + } + + return ret; +} + +/* Search through the list of blacklisted MAC addresses in the config file. */ +static gboolean +is_mac_auto_wired_blacklisted (NMSysconfigSettings *self, const GByteArray *mac) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GKeyFile *config; + char **list, **iter; + gboolean found = FALSE; + + g_return_val_if_fail (mac != NULL, FALSE); + + if (!priv->config_file) + return FALSE; + + config = g_key_file_new (); + if (!config) { + nm_log_warn (LOGD_SYS_SET, "not enough memory to load config file."); + return FALSE; + } + + g_key_file_set_list_separator (config, ','); + if (!g_key_file_load_from_file (config, priv->config_file, G_KEY_FILE_NONE, NULL)) + goto out; + + list = g_key_file_get_string_list (config, "main", CONFIG_KEY_NO_AUTO_DEFAULT, NULL, NULL); + for (iter = list; iter && *iter; iter++) { + struct ether_addr *candidate; + + candidate = ether_aton (*iter); + if (candidate && !memcmp (mac->data, candidate->ether_addr_octet, ETH_ALEN)) { + found = TRUE; + break; + } + } + + if (list) + g_strfreev (list); + +out: + g_key_file_free (config); + return found; +} + +#define DEFAULT_WIRED_TAG "default-wired" + +static void +default_wired_deleted (NMDefaultWiredConnection *wired, + const GByteArray *mac, + NMSysconfigSettings *self) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + NMSettingConnection *s_con; + char *tmp; + GKeyFile *config; + char **list, **iter, **updated; + gboolean found = FALSE; + gsize len = 0, i; + char *data; + + /* If there was no config file specified, there's nothing to do */ + if (!priv->config_file) + goto cleanup; + + /* When the default wired connection is removed (either deleted or saved + * to a new persistent connection by a plugin), write the MAC address of + * the wired device to the config file and don't create a new default wired + * connection for that device again. + */ + + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (wired), + NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + + /* Ignore removals of read-only connections, since they couldn't have + * been removed by the user. + */ + if (nm_setting_connection_get_read_only (s_con)) + goto cleanup; + + config = g_key_file_new (); + if (!config) + goto cleanup; + + g_key_file_set_list_separator (config, ','); + g_key_file_load_from_file (config, priv->config_file, G_KEY_FILE_KEEP_COMMENTS, NULL); + + list = g_key_file_get_string_list (config, "main", CONFIG_KEY_NO_AUTO_DEFAULT, &len, NULL); + /* Traverse entire list to get count of # items */ + for (iter = list; iter && *iter; iter++) { + struct ether_addr *candidate; + + candidate = ether_aton (*iter); + if (candidate && !memcmp (mac->data, candidate->ether_addr_octet, ETH_ALEN)) + found = TRUE; + } + + /* Add this device's MAC to the list */ + if (!found) { + tmp = g_strdup_printf ("%02x:%02x:%02x:%02x:%02x:%02x", + mac->data[0], mac->data[1], mac->data[2], + mac->data[3], mac->data[4], mac->data[5]); + + /* New list; size + 1 for the new element, + 1 again for ending NULL */ + updated = g_malloc0 (sizeof (char*) * (len + 2)); + + /* Copy original list and add new MAC */ + for (i = 0; list && list[i]; i++) + updated[i] = list[i]; + updated[i++] = tmp; + updated[i] = NULL; + + g_key_file_set_string_list (config, + "main", CONFIG_KEY_NO_AUTO_DEFAULT, + (const char **) updated, + len + 2); + /* g_free() not g_strfreev() since 'updated' isn't a deep-copy */ + g_free (updated); + g_free (tmp); + + data = g_key_file_to_data (config, &len, NULL); + if (data) { + g_file_set_contents (priv->config_file, data, len, NULL); + g_free (data); + } + } + + if (list) + g_strfreev (list); + g_key_file_free (config); + +cleanup: + g_object_set_data (G_OBJECT (nm_default_wired_connection_get_device (wired)), + DEFAULT_WIRED_TAG, + NULL); +} + +static void +delete_cb (NMSettingsConnectionInterface *connection, GError *error, gpointer user_data) +{ +} + +static gboolean +default_wired_try_update (NMDefaultWiredConnection *wired, + NMSysconfigSettings *self) +{ + GError *error = NULL; + NMSettingConnection *s_con; + const char *id; + + /* Try to move this default wired conneciton to a plugin so that it has + * persistent storage. + */ + + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (wired), + NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + id = nm_setting_connection_get_id (s_con); + g_assert (id); + + remove_connection (self, NM_SETTINGS_CONNECTION_INTERFACE (wired), FALSE); + if (add_new_connection (self, NM_CONNECTION (wired), &error)) { + nm_settings_connection_interface_delete (NM_SETTINGS_CONNECTION_INTERFACE (wired), + delete_cb, + NULL); + + g_object_set_data (G_OBJECT (nm_default_wired_connection_get_device (wired)), + DEFAULT_WIRED_TAG, + NULL); + nm_log_info (LOGD_SYS_SET, "Saved default wired connection '%s' to persistent storage", id); + return FALSE; + } + + nm_log_warn (LOGD_SYS_SET, "couldn't save default wired connection '%s': %d / %s", + id, + error ? error->code : -1, + (error && error->message) ? error->message : "(unknown)"); + + /* If there was an error, don't destroy the default wired connection, + * but add it back to the system settings service. Connection is already + * exported on the bus, don't export it again, thus do_export == FALSE. + */ + claim_connection (self, NM_SETTINGS_CONNECTION_INTERFACE (wired), FALSE); + return TRUE; +} + +void +nm_sysconfig_settings_device_added (NMSysconfigSettings *self, NMDevice *device) +{ + GByteArray *mac = NULL; + struct ether_addr tmp; + NMDefaultWiredConnection *wired; + NMSettingConnection *s_con; + gboolean read_only = TRUE; + const char *id; + + if (nm_device_get_device_type (device) != NM_DEVICE_TYPE_ETHERNET) + return; + + /* If the device isn't managed or it already has a default wired connection, + * ignore it. + */ + if ( !nm_device_get_managed (device) + || g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_TAG)) + return; + + nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (device), &tmp); + + mac = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (mac, tmp.ether_addr_octet, ETH_ALEN); + + if ( have_connection_for_device (self, mac) + || is_mac_auto_wired_blacklisted (self, mac)) + goto ignore; + + if (get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS)) + read_only = FALSE; + + wired = nm_default_wired_connection_new (mac, device, read_only); + if (!wired) + goto ignore; + + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (wired), + NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + id = nm_setting_connection_get_id (s_con); + g_assert (id); + + nm_log_info (LOGD_SYS_SET, "Added default wired connection '%s' for %s", + id, nm_device_get_udi (device)); + + g_signal_connect (wired, "try-update", (GCallback) default_wired_try_update, self); + g_signal_connect (wired, "deleted", (GCallback) default_wired_deleted, self); + claim_connection (self, NM_SETTINGS_CONNECTION_INTERFACE (wired), TRUE); + g_object_unref (wired); + + g_object_set_data (G_OBJECT (device), DEFAULT_WIRED_TAG, wired); + +ignore: + g_byte_array_free (mac, TRUE); +} + +void +nm_sysconfig_settings_device_removed (NMSysconfigSettings *self, NMDevice *device) +{ + NMDefaultWiredConnection *connection; + + if (nm_device_get_device_type (device) != NM_DEVICE_TYPE_ETHERNET) + return; + + connection = (NMDefaultWiredConnection *) g_object_get_data (G_OBJECT (device), DEFAULT_WIRED_TAG); + if (connection) + remove_connection (self, NM_SETTINGS_CONNECTION_INTERFACE (connection), TRUE); +} + +NMSysconfigSettings * +nm_sysconfig_settings_new (const char *config_file, + const char *plugins, + DBusGConnection *bus, + GError **error) +{ + NMSysconfigSettings *self; + NMSysconfigSettingsPrivate *priv; + + self = g_object_new (NM_TYPE_SYSCONFIG_SETTINGS, + NM_SETTINGS_SERVICE_BUS, bus, + NM_SETTINGS_SERVICE_SCOPE, NM_CONNECTION_SCOPE_SYSTEM, + NULL); + if (!self) + return NULL; + + priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + priv->config_file = g_strdup (config_file); + + if (plugins) { + /* Load the plugins; fail if a plugin is not found. */ + if (!load_plugins (self, plugins, error)) { + g_object_unref (self); + return NULL; + } + unmanaged_specs_changed (NULL, self); + } + + return self; +} + +/***************************************************************/ + +static void +dispose (GObject *object) +{ + NMSysconfigSettings *self = NM_SYSCONFIG_SETTINGS (object); + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + GSList *iter; + + if (priv->auth_changed_id) { + g_signal_handler_disconnect (priv->authority, priv->auth_changed_id); + priv->auth_changed_id = 0; + } + + /* Cancel PolicyKit requests */ + for (iter = priv->pk_calls; iter; iter = g_slist_next (iter)) { + PolkitCall *call = iter->data; + + call->disposed = TRUE; + g_cancellable_cancel (call->cancellable); + } + g_slist_free (priv->pk_calls); + priv->pk_calls = NULL; + + /* Cancel PolicyKit permissions requests */ + for (iter = priv->permissions_calls; iter; iter = g_slist_next (iter)) { + PermissionsCall *call = iter->data; + + call->disposed = TRUE; + g_cancellable_cancel (call->cancellable); + } + g_slist_free (priv->permissions_calls); + priv->permissions_calls = NULL; + + G_OBJECT_CLASS (nm_sysconfig_settings_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMSysconfigSettings *self = NM_SYSCONFIG_SETTINGS (object); + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + g_hash_table_destroy (priv->connections); + + clear_unmanaged_specs (self); + + g_slist_foreach (priv->plugins, (GFunc) g_object_unref, NULL); + g_slist_free (priv->plugins); + + g_free (priv->config_file); + + G_OBJECT_CLASS (nm_sysconfig_settings_parent_class)->finalize (object); +} + +static void +settings_system_interface_init (NMSettingsSystemInterface *iface) +{ + iface->get_permissions = get_permissions; + + dbus_g_object_type_install_info (G_TYPE_FROM_INTERFACE (iface), + &dbus_glib_nm_settings_system_object_info); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSysconfigSettings *self = NM_SYSCONFIG_SETTINGS (object); + const GSList *specs, *iter; + GSList *copy = NULL; + + switch (prop_id) { + case PROP_UNMANAGED_SPECS: + specs = nm_sysconfig_settings_get_unmanaged_specs (self); + for (iter = specs; iter; iter = g_slist_next (iter)) + copy = g_slist_append (copy, g_strdup (iter->data)); + g_value_take_boxed (value, copy); + break; + case NM_SETTINGS_SYSTEM_INTERFACE_PROP_HOSTNAME: + g_value_take_string (value, nm_sysconfig_settings_get_hostname (self)); + + /* Don't ever pass NULL through D-Bus */ + if (!g_value_get_string (value)) + g_value_set_static_string (value, ""); + break; + case NM_SETTINGS_SYSTEM_INTERFACE_PROP_CAN_MODIFY: + g_value_set_boolean (value, !!get_plugin (self, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_sysconfig_settings_class_init (NMSysconfigSettingsClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + NMSettingsServiceClass *ss_class = NM_SETTINGS_SERVICE_CLASS (class); + + g_type_class_add_private (class, sizeof (NMSysconfigSettingsPrivate)); + + /* virtual methods */ + object_class->notify = notify; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + ss_class->list_connections = list_connections; + ss_class->add_connection = add_connection; + + /* properties */ + g_object_class_install_property + (object_class, PROP_UNMANAGED_SPECS, + g_param_spec_boxed (NM_SYSCONFIG_SETTINGS_UNMANAGED_SPECS, + "Unamanged device specs", + "Unmanaged device specs", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READABLE)); + + g_object_class_override_property (object_class, + NM_SETTINGS_SYSTEM_INTERFACE_PROP_HOSTNAME, + NM_SETTINGS_SYSTEM_INTERFACE_HOSTNAME); + + g_object_class_override_property (object_class, + NM_SETTINGS_SYSTEM_INTERFACE_PROP_CAN_MODIFY, + NM_SETTINGS_SYSTEM_INTERFACE_CAN_MODIFY); + + /* signals */ + signals[PROPERTIES_CHANGED] = + g_signal_new ("properties-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSysconfigSettingsClass, properties_changed), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, DBUS_TYPE_G_MAP_OF_VARIANT); + + dbus_g_error_domain_register (NM_SYSCONFIG_SETTINGS_ERROR, + NM_DBUS_IFACE_SETTINGS_SYSTEM, + NM_TYPE_SYSCONFIG_SETTINGS_ERROR); + + dbus_g_error_domain_register (NM_SETTINGS_INTERFACE_ERROR, + NM_DBUS_IFACE_SETTINGS, + NM_TYPE_SETTINGS_INTERFACE_ERROR); + + /* And register all the settings errors with D-Bus */ + dbus_g_error_domain_register (NM_CONNECTION_ERROR, NULL, NM_TYPE_CONNECTION_ERROR); + dbus_g_error_domain_register (NM_SETTING_802_1X_ERROR, NULL, NM_TYPE_SETTING_802_1X_ERROR); + dbus_g_error_domain_register (NM_SETTING_BLUETOOTH_ERROR, NULL, NM_TYPE_SETTING_BLUETOOTH_ERROR); + dbus_g_error_domain_register (NM_SETTING_CDMA_ERROR, NULL, NM_TYPE_SETTING_CDMA_ERROR); + dbus_g_error_domain_register (NM_SETTING_CONNECTION_ERROR, NULL, NM_TYPE_SETTING_CONNECTION_ERROR); + dbus_g_error_domain_register (NM_SETTING_GSM_ERROR, NULL, NM_TYPE_SETTING_GSM_ERROR); + dbus_g_error_domain_register (NM_SETTING_IP4_CONFIG_ERROR, NULL, NM_TYPE_SETTING_IP4_CONFIG_ERROR); + dbus_g_error_domain_register (NM_SETTING_IP6_CONFIG_ERROR, NULL, NM_TYPE_SETTING_IP6_CONFIG_ERROR); + dbus_g_error_domain_register (NM_SETTING_OLPC_MESH_ERROR, NULL, NM_TYPE_SETTING_OLPC_MESH_ERROR); + dbus_g_error_domain_register (NM_SETTING_PPP_ERROR, NULL, NM_TYPE_SETTING_PPP_ERROR); + dbus_g_error_domain_register (NM_SETTING_PPPOE_ERROR, NULL, NM_TYPE_SETTING_PPPOE_ERROR); + dbus_g_error_domain_register (NM_SETTING_SERIAL_ERROR, NULL, NM_TYPE_SETTING_SERIAL_ERROR); + dbus_g_error_domain_register (NM_SETTING_VPN_ERROR, NULL, NM_TYPE_SETTING_VPN_ERROR); + dbus_g_error_domain_register (NM_SETTING_WIRED_ERROR, NULL, NM_TYPE_SETTING_WIRED_ERROR); + dbus_g_error_domain_register (NM_SETTING_WIRELESS_SECURITY_ERROR, NULL, NM_TYPE_SETTING_WIRELESS_SECURITY_ERROR); + dbus_g_error_domain_register (NM_SETTING_WIRELESS_ERROR, NULL, NM_TYPE_SETTING_WIRELESS_ERROR); + dbus_g_error_domain_register (NM_SETTING_ERROR, NULL, NM_TYPE_SETTING_ERROR); +} + +static void +nm_sysconfig_settings_init (NMSysconfigSettings *self) +{ + NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self); + + priv->connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL); + + priv->authority = polkit_authority_get (); + if (priv->authority) { + priv->auth_changed_id = g_signal_connect (priv->authority, + "changed", + G_CALLBACK (pk_authority_changed_cb), + self); + } else + nm_log_warn (LOGD_SYS_SET, "failed to create PolicyKit authority."); +} + diff --git a/src/system-settings/nm-sysconfig-settings.h b/src/system-settings/nm-sysconfig-settings.h new file mode 100644 index 00000000..ae2ba683 --- /dev/null +++ b/src/system-settings/nm-sysconfig-settings.h @@ -0,0 +1,71 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * Søren Sandmann + * Dan Williams + * Tambet Ingo + * + * 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 - 2009 Red Hat, Inc. + * (C) Copyright 2008 Novell, Inc. + */ + +#ifndef __NM_SYSCONFIG_SETTINGS_H__ +#define __NM_SYSCONFIG_SETTINGS_H__ + +#include +#include + +#include "nm-sysconfig-connection.h" +#include "nm-system-config-interface.h" +#include "nm-device.h" + +#define NM_TYPE_SYSCONFIG_SETTINGS (nm_sysconfig_settings_get_type ()) +#define NM_SYSCONFIG_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SYSCONFIG_SETTINGS, NMSysconfigSettings)) +#define NM_SYSCONFIG_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SYSCONFIG_SETTINGS, NMSysconfigSettingsClass)) +#define NM_IS_SYSCONFIG_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SYSCONFIG_SETTINGS)) +#define NM_IS_SYSCONFIG_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SYSCONFIG_SETTINGS)) +#define NM_SYSCONFIG_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SYSCONFIG_SETTINGS, NMSysconfigSettingsClass)) + +#define NM_SYSCONFIG_SETTINGS_UNMANAGED_SPECS "unmanaged-specs" + +typedef struct { + NMSettingsService parent_instance; +} NMSysconfigSettings; + +typedef struct { + NMSettingsServiceClass parent_class; + + /* Signals */ + void (*properties_changed) (NMSysconfigSettings *self, GHashTable *properties); +} NMSysconfigSettingsClass; + +GType nm_sysconfig_settings_get_type (void); + +NMSysconfigSettings *nm_sysconfig_settings_new (const char *config_file, + const char *plugins, + DBusGConnection *bus, + GError **error); + +const GSList *nm_sysconfig_settings_get_unmanaged_specs (NMSysconfigSettings *self); + +char *nm_sysconfig_settings_get_hostname (NMSysconfigSettings *self); + +void nm_sysconfig_settings_device_added (NMSysconfigSettings *self, NMDevice *device); + +void nm_sysconfig_settings_device_removed (NMSysconfigSettings *self, NMDevice *device); + +#endif /* __NM_SYSCONFIG_SETTINGS_H__ */ diff --git a/src/system-settings/nm-system-config-error.c b/src/system-settings/nm-system-config-error.c new file mode 100644 index 00000000..13d47462 --- /dev/null +++ b/src/system-settings/nm-system-config-error.c @@ -0,0 +1,59 @@ +/* -*- 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. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#include "nm-system-config-error.h" + +GQuark +nm_sysconfig_settings_error_quark (void) +{ + static GQuark ret = 0; + + if (ret == 0) + ret = g_quark_from_static_string ("nm_sysconfig_settings_error"); + + return ret; +} + +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_sysconfig_settings_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, "GeneralError"), + ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED, "NotPrivileged"), + ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_ADD_NOT_SUPPORTED, "AddNotSupported"), + ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_UPDATE_NOT_SUPPORTED, "UpdateNotSupported"), + ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_DELETE_NOT_SUPPORTED, "DeleteNotSupported"), + ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_ADD_FAILED, "AddFailed"), + ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_SAVE_HOSTNAME_NOT_SUPPORTED, "SaveHostnameNotSupported"), + ENUM_ENTRY (NM_SYSCONFIG_SETTINGS_ERROR_SAVE_HOSTNAME_FAILED, "SaveHostnameFailed"), + { 0, 0, 0 } + }; + + etype = g_enum_register_static ("NMSysconfigSettingsError", values); + } + + return etype; +} diff --git a/src/system-settings/nm-system-config-error.h b/src/system-settings/nm-system-config-error.h new file mode 100644 index 00000000..63896fcd --- /dev/null +++ b/src/system-settings/nm-system-config-error.h @@ -0,0 +1,45 @@ +/* -*- 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. + * + * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_SYSTEM_CONFIG_ERROR_H +#define NM_SYSTEM_CONFIG_ERROR_H + +#include +#include + +enum { + NM_SYSCONFIG_SETTINGS_ERROR_GENERAL = 0, + NM_SYSCONFIG_SETTINGS_ERROR_NOT_PRIVILEGED, + NM_SYSCONFIG_SETTINGS_ERROR_ADD_NOT_SUPPORTED, + NM_SYSCONFIG_SETTINGS_ERROR_UPDATE_NOT_SUPPORTED, + NM_SYSCONFIG_SETTINGS_ERROR_DELETE_NOT_SUPPORTED, + NM_SYSCONFIG_SETTINGS_ERROR_ADD_FAILED, + NM_SYSCONFIG_SETTINGS_ERROR_SAVE_HOSTNAME_NOT_SUPPORTED, + NM_SYSCONFIG_SETTINGS_ERROR_SAVE_HOSTNAME_FAILED, +}; + +#define NM_SYSCONFIG_SETTINGS_ERROR (nm_sysconfig_settings_error_quark ()) +#define NM_TYPE_SYSCONFIG_SETTINGS_ERROR (nm_sysconfig_settings_error_get_type ()) + +GQuark nm_sysconfig_settings_error_quark (void); +GType nm_sysconfig_settings_error_get_type (void); + +#endif /* NM_SYSTEM_CONFIG_ERROR_H */ diff --git a/src/system-settings/nm-system-config-interface.c b/src/system-settings/nm-system-config-interface.c new file mode 100644 index 00000000..90fd93ba --- /dev/null +++ b/src/system-settings/nm-system-config-interface.c @@ -0,0 +1,163 @@ +/* -*- 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. + * + * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#include "nm-system-config-interface.h" + +static void +interface_init (gpointer g_iface) +{ + GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); + static gboolean initialized = FALSE; + + if (initialized) + return; + + /* Properties */ + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_SYSTEM_CONFIG_INTERFACE_NAME, + "Name", + "Plugin name", + NULL, + G_PARAM_READABLE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_SYSTEM_CONFIG_INTERFACE_INFO, + "Info", + "Plugin information", + NULL, + G_PARAM_READABLE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_uint (NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES, + "Capabilities", + "Plugin capabilties", + NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE, + NM_SYSTEM_CONFIG_INTERFACE_CAP_LAST - 1, + NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE, + G_PARAM_READABLE)); + + g_object_interface_install_property + (g_iface, + g_param_spec_string (NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME, + "Hostname", + "Configured hostname", + NULL, + G_PARAM_READWRITE)); + + /* Signals */ + g_signal_new (NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSystemConfigInterface, connection_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + NM_TYPE_SETTINGS_CONNECTION_INTERFACE); + + g_signal_new (NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED, + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMSystemConfigInterface, unmanaged_specs_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + initialized = TRUE; +} + + +GType +nm_system_config_interface_get_type (void) +{ + static GType system_config_interface_type = 0; + + if (!system_config_interface_type) { + const GTypeInfo system_config_interface_info = { + sizeof (NMSystemConfigInterface), /* class_size */ + interface_init, /* base_init */ + NULL, /* base_finalize */ + NULL, + NULL, /* class_finalize */ + NULL, /* class_data */ + 0, + 0, /* n_preallocs */ + NULL + }; + + system_config_interface_type = g_type_register_static (G_TYPE_INTERFACE, + "NMSystemConfigInterface", + &system_config_interface_info, + 0); + + g_type_interface_add_prerequisite (system_config_interface_type, G_TYPE_OBJECT); + } + + return system_config_interface_type; +} + +void +nm_system_config_interface_init (NMSystemConfigInterface *config, + gpointer unused) +{ + g_return_if_fail (config != NULL); + + if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->init) + NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->init (config); +} + +GSList * +nm_system_config_interface_get_connections (NMSystemConfigInterface *config) +{ + g_return_val_if_fail (config != NULL, NULL); + + if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_connections) + return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_connections (config); + return NULL; +} + +GSList * +nm_system_config_interface_get_unmanaged_specs (NMSystemConfigInterface *config) +{ + g_return_val_if_fail (config != NULL, NULL); + + if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_unmanaged_specs) + return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_unmanaged_specs (config); + return NULL; +} + +gboolean +nm_system_config_interface_add_connection (NMSystemConfigInterface *config, + NMConnection *connection, + GError **error) +{ + gboolean success = FALSE; + + g_return_val_if_fail (config != NULL, FALSE); + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + + if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->add_connection) + success = NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->add_connection (config, connection, error); + + return success; +} diff --git a/src/system-settings/nm-system-config-interface.h b/src/system-settings/nm-system-config-interface.h new file mode 100644 index 00000000..c5bbaaa9 --- /dev/null +++ b/src/system-settings/nm-system-config-interface.h @@ -0,0 +1,145 @@ +/* -*- 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. + * + * Copyright (C) 2007 - 2008 Red Hat, Inc. + * Copyright (C) 2008 Novell, Inc. + */ + +#ifndef NM_SYSTEM_CONFIG_INTERFACE_H +#define NM_SYSTEM_CONFIG_INTERFACE_H + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define PLUGIN_PRINT(pname, fmt, args...) \ + { g_message (" " pname ": " fmt, ##args); } + +#define PLUGIN_WARN(pname, fmt, args...) \ + { g_warning (" " pname ": " fmt, ##args); } + + +/* Plugin's factory function that returns a GObject that implements + * NMSystemConfigInterface. + */ +GObject * nm_system_config_factory (void); + +/* NOTE: + * When passing NMConnection objects to NetworkManager, any properties + * of that NMConnection's NMSetting objects that are secrets must be set as + * GObject data items on the NMSetting object, _not_ inside the NMSetting + * object itself. This is to ensure that the secrets are only given to + * NetworkManager itself and not exposed to clients like nm-applet that need + * connection details, but not secrets. + */ + +#define NM_TYPE_SYSTEM_CONFIG_INTERFACE (nm_system_config_interface_get_type ()) +#define NM_SYSTEM_CONFIG_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SYSTEM_CONFIG_INTERFACE, NMSystemConfigInterface)) +#define NM_IS_SYSTEM_CONFIG_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SYSTEM_CONFIG_INTERFACE)) +#define NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_SYSTEM_CONFIG_INTERFACE, NMSystemConfigInterface)) + + +#define NM_SYSTEM_CONFIG_INTERFACE_NAME "name" +#define NM_SYSTEM_CONFIG_INTERFACE_INFO "info" +#define NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES "capabilities" +#define NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME "hostname" + +#define NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED "unmanaged-specs-changed" +#define NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED "connection-added" + +typedef enum { + NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE = 0x00000000, + NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS = 0x00000001, + NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME = 0x00000002, + + NM_SYSTEM_CONFIG_INTERFACE_CAP_LAST = NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME +} NMSystemConfigInterfaceCapabilities; + +typedef enum { + NM_SYSTEM_CONFIG_INTERFACE_PROP_FIRST = 0x1000, + + NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME = NM_SYSTEM_CONFIG_INTERFACE_PROP_FIRST, + NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO, + NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES, + NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME, +} NMSystemConfigInterfaceProp; + + +typedef struct _NMSystemConfigInterface NMSystemConfigInterface; + +struct _NMSystemConfigInterface { + GTypeInterface g_iface; + + /* Called when the plugin is loaded to initialize it */ + void (*init) (NMSystemConfigInterface *config); + + /* Returns a GSList of objects that implement NMSettingsConnectionInterface + * that represent connections the plugin knows about. The returned list + * is freed by the system settings service. + */ + GSList * (*get_connections) (NMSystemConfigInterface *config); + + /* + * Return a string list of specifications of devices which NetworkManager + * should not manage. Returned list will be freed by the system settings + * service, and each element must be allocated using g_malloc() or its + * variants (g_strdup, g_strdup_printf, etc). + * + * Each string in the list must follow the format :, where + * the method and data are one of the following: + * + * Method: mac Data: device MAC address formatted with leading zeros and + * lowercase letters, like 00:0a:0b:0c:0d:0e + */ + GSList * (*get_unmanaged_specs) (NMSystemConfigInterface *config); + + /* + * Add a new connection. + */ + gboolean (*add_connection) (NMSystemConfigInterface *config, + NMConnection *connection, + GError **error); + + /* Signals */ + + /* Emitted when a new connection has been found by the plugin */ + void (*connection_added) (NMSystemConfigInterface *config, + NMSettingsConnectionInterface *connection); + + /* Emitted when the list of unmanaged device specifications changes */ + void (*unmanaged_specs_changed) (NMSystemConfigInterface *config); +}; + +GType nm_system_config_interface_get_type (void); + +void nm_system_config_interface_init (NMSystemConfigInterface *config, + gpointer unused); + +GSList *nm_system_config_interface_get_connections (NMSystemConfigInterface *config); + +GSList *nm_system_config_interface_get_unmanaged_specs (NMSystemConfigInterface *config); + +gboolean nm_system_config_interface_add_connection (NMSystemConfigInterface *config, + NMConnection *connection, + GError **error); + +G_END_DECLS + +#endif /* NM_SYSTEM_CONFIG_INTERFACE_H */ diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am new file mode 100644 index 00000000..62612a0e --- /dev/null +++ b/src/tests/Makefile.am @@ -0,0 +1,49 @@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/src/dhcp-manager \ + -I$(top_builddir)/marshallers \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/src + +noinst_PROGRAMS = test-dhcp-options test-policy-hosts + +####### DHCP options test ####### + +test_dhcp_options_SOURCES = \ + test-dhcp-options.c + +test_dhcp_options_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" + +test_dhcp_options_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/src/dhcp-manager/libdhcp-manager.la \ + $(top_builddir)/src/libtest-dhcp.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +####### policy /etc/hosts test ####### + +test_policy_hosts_SOURCES = \ + test-policy-hosts.c + +test_policy_hosts_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_policy_hosts_LDADD = \ + -ldl \ + $(top_builddir)/src/libtest-policy-hosts.la \ + $(GLIB_LIBS) + +if WITH_TESTS + +check-local: test-dhcp-options + $(abs_builddir)/test-dhcp-options + $(abs_builddir)/test-policy-hosts + +endif + diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in new file mode 100644 index 00000000..75fb715d --- /dev/null +++ b/src/tests/Makefile.in @@ -0,0 +1,628 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = test-dhcp-options$(EXEEXT) \ + test-policy-hosts$(EXEEXT) +subdir = src/tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_test_dhcp_options_OBJECTS = \ + test_dhcp_options-test-dhcp-options.$(OBJEXT) +test_dhcp_options_OBJECTS = $(am_test_dhcp_options_OBJECTS) +am__DEPENDENCIES_1 = +test_dhcp_options_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/src/dhcp-manager/libdhcp-manager.la \ + $(top_builddir)/src/libtest-dhcp.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_test_policy_hosts_OBJECTS = \ + test_policy_hosts-test-policy-hosts.$(OBJEXT) +test_policy_hosts_OBJECTS = $(am_test_policy_hosts_OBJECTS) +test_policy_hosts_DEPENDENCIES = \ + $(top_builddir)/src/libtest-policy-hosts.la \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_dhcp_options_SOURCES) $(test_policy_hosts_SOURCES) +DIST_SOURCES = $(test_dhcp_options_SOURCES) \ + $(test_policy_hosts_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/src/dhcp-manager \ + -I$(top_builddir)/marshallers \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/src + + +####### DHCP options test ####### +test_dhcp_options_SOURCES = \ + test-dhcp-options.c + +test_dhcp_options_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \ + -DDHCPCD_PATH=\"$(DHCPCD_PATH)\" + +test_dhcp_options_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/src/dhcp-manager/libdhcp-manager.la \ + $(top_builddir)/src/libtest-dhcp.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + + +####### policy /etc/hosts test ####### +test_policy_hosts_SOURCES = \ + test-policy-hosts.c + +test_policy_hosts_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_policy_hosts_LDADD = \ + -ldl \ + $(top_builddir)/src/libtest-policy-hosts.la \ + $(GLIB_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +test-dhcp-options$(EXEEXT): $(test_dhcp_options_OBJECTS) $(test_dhcp_options_DEPENDENCIES) + @rm -f test-dhcp-options$(EXEEXT) + $(LINK) $(test_dhcp_options_OBJECTS) $(test_dhcp_options_LDADD) $(LIBS) +test-policy-hosts$(EXEEXT): $(test_policy_hosts_OBJECTS) $(test_policy_hosts_DEPENDENCIES) + @rm -f test-policy-hosts$(EXEEXT) + $(LINK) $(test_policy_hosts_OBJECTS) $(test_policy_hosts_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dhcp_options-test-dhcp-options.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_policy_hosts-test-policy-hosts.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +test_dhcp_options-test-dhcp-options.o: test-dhcp-options.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dhcp_options_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dhcp_options-test-dhcp-options.o -MD -MP -MF $(DEPDIR)/test_dhcp_options-test-dhcp-options.Tpo -c -o test_dhcp_options-test-dhcp-options.o `test -f 'test-dhcp-options.c' || echo '$(srcdir)/'`test-dhcp-options.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_dhcp_options-test-dhcp-options.Tpo $(DEPDIR)/test_dhcp_options-test-dhcp-options.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-dhcp-options.c' object='test_dhcp_options-test-dhcp-options.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dhcp_options_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dhcp_options-test-dhcp-options.o `test -f 'test-dhcp-options.c' || echo '$(srcdir)/'`test-dhcp-options.c + +test_dhcp_options-test-dhcp-options.obj: test-dhcp-options.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dhcp_options_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dhcp_options-test-dhcp-options.obj -MD -MP -MF $(DEPDIR)/test_dhcp_options-test-dhcp-options.Tpo -c -o test_dhcp_options-test-dhcp-options.obj `if test -f 'test-dhcp-options.c'; then $(CYGPATH_W) 'test-dhcp-options.c'; else $(CYGPATH_W) '$(srcdir)/test-dhcp-options.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_dhcp_options-test-dhcp-options.Tpo $(DEPDIR)/test_dhcp_options-test-dhcp-options.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-dhcp-options.c' object='test_dhcp_options-test-dhcp-options.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dhcp_options_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dhcp_options-test-dhcp-options.obj `if test -f 'test-dhcp-options.c'; then $(CYGPATH_W) 'test-dhcp-options.c'; else $(CYGPATH_W) '$(srcdir)/test-dhcp-options.c'; fi` + +test_policy_hosts-test-policy-hosts.o: test-policy-hosts.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_policy_hosts_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_policy_hosts-test-policy-hosts.o -MD -MP -MF $(DEPDIR)/test_policy_hosts-test-policy-hosts.Tpo -c -o test_policy_hosts-test-policy-hosts.o `test -f 'test-policy-hosts.c' || echo '$(srcdir)/'`test-policy-hosts.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_policy_hosts-test-policy-hosts.Tpo $(DEPDIR)/test_policy_hosts-test-policy-hosts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-policy-hosts.c' object='test_policy_hosts-test-policy-hosts.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_policy_hosts_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_policy_hosts-test-policy-hosts.o `test -f 'test-policy-hosts.c' || echo '$(srcdir)/'`test-policy-hosts.c + +test_policy_hosts-test-policy-hosts.obj: test-policy-hosts.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_policy_hosts_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_policy_hosts-test-policy-hosts.obj -MD -MP -MF $(DEPDIR)/test_policy_hosts-test-policy-hosts.Tpo -c -o test_policy_hosts-test-policy-hosts.obj `if test -f 'test-policy-hosts.c'; then $(CYGPATH_W) 'test-policy-hosts.c'; else $(CYGPATH_W) '$(srcdir)/test-policy-hosts.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_policy_hosts-test-policy-hosts.Tpo $(DEPDIR)/test_policy_hosts-test-policy-hosts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-policy-hosts.c' object='test_policy_hosts-test-policy-hosts.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_policy_hosts_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_policy_hosts-test-policy-hosts.obj `if test -f 'test-policy-hosts.c'; then $(CYGPATH_W) 'test-policy-hosts.c'; else $(CYGPATH_W) '$(srcdir)/test-policy-hosts.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +@WITH_TESTS_FALSE@check-local: +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-generic clean-libtool clean-noinstPROGRAMS ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +@WITH_TESTS_TRUE@check-local: test-dhcp-options +@WITH_TESTS_TRUE@ $(abs_builddir)/test-dhcp-options +@WITH_TESTS_TRUE@ $(abs_builddir)/test-policy-hosts + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/tests/test-dhcp-options.c b/src/tests/test-dhcp-options.c new file mode 100644 index 00000000..dd1f9149 --- /dev/null +++ b/src/tests/test-dhcp-options.c @@ -0,0 +1,715 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* nm-dhcp-manager.c - Handle the DHCP daemon for 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, 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 - 2010 Red Hat, Inc. + * + */ + +#include +#include +#include +#include +#include + +#include "nm-test-helpers.h" +#include + +#include "nm-dhcp-manager.h" + +typedef struct { + const char *name; + const char *value; +} Option; + +static void +destroy_gvalue (gpointer data) +{ + GValue *value = (GValue *) data; + + g_value_unset (value); + g_slice_free (GValue, value); +} + +static GValue * +string_to_byte_array_gvalue (const char *str) +{ + GByteArray *array; + GValue *val; + + array = g_byte_array_sized_new (strlen (str)); + g_byte_array_append (array, (const guint8 *) str, strlen (str)); + + val = g_slice_new0 (GValue); + g_value_init (val, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (val, array); + + return val; +} + +static GHashTable * +fill_table (Option *test_options, GHashTable *table) +{ + Option *opt; + + if (!table) + table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroy_gvalue); + for (opt = test_options; opt->name; opt++) { + g_hash_table_insert (table, + (gpointer) opt->name, + string_to_byte_array_gvalue (opt->value)); + } + return table; +} + +static Option generic_options[] = { + { "new_subnet_mask", "255.255.255.0" }, + { "new_ip_address", "192.168.1.106" }, + { "new_network_number", "192.168.1.0" }, + { "interface", "eth0" }, + { "reason", "BOUND" }, + { "new_expiry", "1232324877" }, + { "new_dhcp_lease_time", "3600" }, + { "new_dhcp_server_identifier", "192.168.1.1" }, + { "new_routers", "192.168.1.1" }, + { "new_domain_name_servers", "216.254.95.2 216.231.41.2" }, + { "new_dhcp_message_type", "5" }, + { "new_broadcast_address", "192.168.1.255" }, + { "new_domain_search", "foobar.com blah.foobar.com" }, + { "new_host_name", "nmreallywhipsthe" }, + { "new_domain_name", "lamasass.com" }, + { "new_interface_mtu", "987" }, + { "new_static_routes", "10.1.1.5 10.1.1.1 100.99.88.56 10.1.1.1" }, + { NULL, NULL } +}; + +static void +test_generic_options (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Address *addr; + NMIP4Route *route; + struct in_addr tmp; + const char *expected_addr = "192.168.1.106"; + const char *expected_gw = "192.168.1.1"; + const char *expected_dns1 = "216.254.95.2"; + const char *expected_dns2 = "216.231.41.2"; + const char *expected_search1 = "foobar.com"; + const char *expected_search2 = "blah.foobar.com"; + const char *expected_route1_dest = "10.1.1.5"; + const char *expected_route1_gw = "10.1.1.1"; + const char *expected_route2_dest = "100.99.88.56"; + const char *expected_route2_gw = "10.1.1.1"; + + options = fill_table (generic_options, NULL); + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-generic", "failed to parse DHCP4 options"); + + /* IP4 address */ + ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, + "dhcp-generic", "unexpected number of IP addresses"); + addr = nm_ip4_config_get_address (ip4_config, 0); + + ASSERT (inet_pton (AF_INET, expected_addr, &tmp) > 0, + "dhcp-generic", "couldn't convert expected IP address"); + ASSERT (nm_ip4_address_get_address (addr) == tmp.s_addr, + "dhcp-generic", "unexpected IP address"); + + ASSERT (nm_ip4_address_get_prefix (addr) == 24, + "dhcp-generic", "unexpected IP address prefix length"); + + /* Gateway */ + ASSERT (inet_pton (AF_INET, expected_gw, &tmp) > 0, + "dhcp-generic", "couldn't convert expected IP gateway"); + ASSERT (nm_ip4_address_get_gateway (addr) == tmp.s_addr, + "dhcp-generic", "unexpected IP gateway"); + + ASSERT (nm_ip4_config_get_ptp_address (ip4_config) == 0, + "dhcp-generic", "unexpected PTP address"); + + ASSERT (nm_ip4_config_get_num_wins (ip4_config) == 0, + "dhcp-generic", "unexpected number of WINS servers"); + + ASSERT (nm_ip4_config_get_mtu (ip4_config) == 987, + "dhcp-generic", "unexpected MTU"); + + /* Domain searches */ + ASSERT (nm_ip4_config_get_num_searches (ip4_config) == 2, + "dhcp-generic", "unexpected number of domain searches"); + ASSERT (strcmp (nm_ip4_config_get_search (ip4_config, 0), expected_search1) == 0, + "dhcp-generic", "unexpected domain search #1"); + ASSERT (strcmp (nm_ip4_config_get_search (ip4_config, 1), expected_search2) == 0, + "dhcp-generic", "unexpected domain search #2"); + + /* DNS servers */ + ASSERT (nm_ip4_config_get_num_nameservers (ip4_config) == 2, + "dhcp-generic", "unexpected number of domain name servers"); + ASSERT (inet_pton (AF_INET, expected_dns1, &tmp) > 0, + "dhcp-generic", "couldn't convert expected DNS server address #1"); + ASSERT (nm_ip4_config_get_nameserver (ip4_config, 0) == tmp.s_addr, + "dhcp-generic", "unexpected domain name server #1"); + ASSERT (inet_pton (AF_INET, expected_dns2, &tmp) > 0, + "dhcp-generic", "couldn't convert expected DNS server address #2"); + ASSERT (nm_ip4_config_get_nameserver (ip4_config, 1) == tmp.s_addr, + "dhcp-generic", "unexpected domain name server #2"); + + /* Routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, + "dhcp-generic", "unexpected number of routes"); + + /* Route #1 */ + route = nm_ip4_config_get_route (ip4_config, 0); + ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, + "dhcp-generic", "couldn't convert expected route destination #1"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-generic", "unexpected route #1 destination"); + + ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, + "dhcp-generic", "couldn't convert expected route next hop #1"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-generic", "unexpected route #1 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 32, + "dhcp-generic", "unexpected route #1 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-generic", "unexpected route #1 metric"); + + /* Route #2 */ + route = nm_ip4_config_get_route (ip4_config, 1); + ASSERT (inet_pton (AF_INET, expected_route2_dest, &tmp) > 0, + "dhcp-generic", "couldn't convert expected route destination #2"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-generic", "unexpected route #2 destination"); + + ASSERT (inet_pton (AF_INET, expected_route2_gw, &tmp) > 0, + "dhcp-generic", "couldn't convert expected route next hop #2"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-generic", "unexpected route #2 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 32, + "dhcp-generic", "unexpected route #2 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-generic", "unexpected route #2 metric"); + + g_hash_table_destroy (options); +} + +static Option wins_options[] = { + { "new_netbios_name_servers", "63.12.199.5 150.4.88.120" }, + { NULL, NULL } +}; + +static void +test_wins_options (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Address *addr; + struct in_addr tmp; + const char *expected_wins1 = "63.12.199.5"; + const char *expected_wins2 = "150.4.88.120"; + + options = fill_table (generic_options, NULL); + options = fill_table (wins_options, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-wins", "failed to parse DHCP4 options"); + + /* IP4 address */ + ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, + "dhcp-wins", "unexpected number of IP addresses"); + addr = nm_ip4_config_get_address (ip4_config, 0); + + ASSERT (nm_ip4_config_get_num_wins (ip4_config) == 2, + "dhcp-wins", "unexpected number of WINS servers"); + ASSERT (inet_pton (AF_INET, expected_wins1, &tmp) > 0, + "dhcp-wins", "couldn't convert expected WINS server address #1"); + ASSERT (nm_ip4_config_get_wins (ip4_config, 0) == tmp.s_addr, + "dhcp-wins", "unexpected WINS server #1"); + ASSERT (inet_pton (AF_INET, expected_wins2, &tmp) > 0, + "dhcp-wins", "couldn't convert expected WINS server address #1"); + ASSERT (nm_ip4_config_get_wins (ip4_config, 1) == tmp.s_addr, + "dhcp-wins", "unexpected WINS server #1"); + + g_hash_table_destroy (options); +} + +static Option classless_routes_options[] = { + /* For dhclient */ + { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 8 10 10 17 66 41" }, + /* For dhcpcd */ + { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.0.0/8 10.17.66.41" }, + { NULL, NULL } +}; + +static void +test_classless_static_routes (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Route *route; + struct in_addr tmp; + const char *expected_route1_dest = "192.168.10.0"; + const char *expected_route1_gw = "192.168.1.1"; + const char *expected_route2_dest = "10.0.0.0"; + const char *expected_route2_gw = "10.17.66.41"; + + options = fill_table (generic_options, NULL); + options = fill_table (classless_routes_options, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-rfc3442", "failed to parse DHCP4 options"); + + /* IP4 routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, + "dhcp-rfc3442", "unexpected number of IP routes"); + + /* Route #1 */ + route = nm_ip4_config_get_route (ip4_config, 0); + ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, + "dhcp-rfc3442", "couldn't convert expected route destination #1"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-rfc3442", "unexpected route #1 destination"); + + ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, + "dhcp-rfc3442", "couldn't convert expected route next hop #1"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-rfc3442", "unexpected route #1 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 24, + "dhcp-rfc3442", "unexpected route #1 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-rfc3442", "unexpected route #1 metric"); + + /* Route #2 */ + route = nm_ip4_config_get_route (ip4_config, 1); + ASSERT (inet_pton (AF_INET, expected_route2_dest, &tmp) > 0, + "dhcp-rfc3442", "couldn't convert expected route destination #2"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-rfc3442", "unexpected route #2 destination"); + + ASSERT (inet_pton (AF_INET, expected_route2_gw, &tmp) > 0, + "dhcp-rfc3442", "couldn't convert expected route next hop #2"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-rfc3442", "unexpected route #2 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 8, + "dhcp-rfc3442", "unexpected route #2 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-rfc3442", "unexpected route #2 metric"); + + g_hash_table_destroy (options); +} + +static Option invalid_classless_routes1[] = { + /* For dhclient */ + { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 45 10 17 66 41" }, + /* For dhcpcd */ + { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 10.0.adfadf/44 10.17.66.41" }, + { NULL, NULL } +}; + +static void +test_invalid_classless_routes1 (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Route *route; + struct in_addr tmp; + const char *expected_route1_dest = "192.168.10.0"; + const char *expected_route1_gw = "192.168.1.1"; + + options = fill_table (generic_options, NULL); + options = fill_table (invalid_classless_routes1, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-rfc3442-invalid-1", "failed to parse DHCP4 options"); + + /* IP4 routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 1, + "dhcp-rfc3442-invalid-1", "unexpected number of IP routes"); + + /* Route #1 */ + route = nm_ip4_config_get_route (ip4_config, 0); + ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, + "dhcp-rfc3442-invalid-1", "couldn't convert expected route destination #1"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-rfc3442-invalid-1", "unexpected route #1 destination"); + + ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, + "dhcp-rfc3442-invalid-1", "couldn't convert expected route next hop #1"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-rfc3442-invalid-1", "unexpected route #1 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 24, + "dhcp-rfc3442-invalid-1", "unexpected route #1 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-rfc3442-invalid-1", "unexpected route #1 metric"); + + g_hash_table_destroy (options); +} + +static Option invalid_classless_routes2[] = { + /* For dhclient */ + { "new_rfc3442_classless_static_routes", "45 10 17 66 41 24 192 168 10 192 168 1 1" }, + /* For dhcpcd */ + { "new_classless_static_routes", "10.0.adfadf/44 10.17.66.41 192.168.10.0/24 192.168.1.1" }, + { NULL, NULL } +}; + +static void +test_invalid_classless_routes2 (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Route *route; + struct in_addr tmp; + const char *expected_route1_dest = "10.1.1.5"; + const char *expected_route1_gw = "10.1.1.1"; + const char *expected_route2_dest = "100.99.88.56"; + const char *expected_route2_gw = "10.1.1.1"; + + options = fill_table (generic_options, NULL); + options = fill_table (invalid_classless_routes2, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-rfc3442-invalid-2", "failed to parse DHCP4 options"); + + /* Test falling back to old-style static routes if the classless static + * routes are invalid. + */ + + /* Routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 2, + "dhcp-rfc3442-invalid-2", "unexpected number of routes"); + + /* Route #1 */ + route = nm_ip4_config_get_route (ip4_config, 0); + ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, + "dhcp-rfc3442-invalid-2", "couldn't convert expected route destination #1"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-rfc3442-invalid-2", "unexpected route #1 destination"); + + ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, + "dhcp-rfc3442-invalid-2", "couldn't convert expected route next hop #1"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-rfc3442-invalid-2", "unexpected route #1 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 32, + "dhcp-rfc3442-invalid-2", "unexpected route #1 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-rfc3442-invalid-2", "unexpected route #1 metric"); + + /* Route #2 */ + route = nm_ip4_config_get_route (ip4_config, 1); + ASSERT (inet_pton (AF_INET, expected_route2_dest, &tmp) > 0, + "dhcp-rfc3442-invalid-2", "couldn't convert expected route destination #2"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-rfc3442-invalid-2", "unexpected route #2 destination"); + + ASSERT (inet_pton (AF_INET, expected_route2_gw, &tmp) > 0, + "dhcp-rfc3442-invalid-2", "couldn't convert expected route next hop #2"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-rfc3442-invalid-2", "unexpected route #2 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 32, + "dhcp-rfc3442-invalid-2", "unexpected route #2 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-rfc3442-invalid-2", "unexpected route #2 metric"); + + g_hash_table_destroy (options); +} + +static Option invalid_classless_routes3[] = { + /* For dhclient */ + { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 32 128 10 17 66 41" }, + /* For dhcpcd */ + { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 128/32 10.17.66.41" }, + { NULL, NULL } +}; + +static void +test_invalid_classless_routes3 (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Route *route; + struct in_addr tmp; + const char *expected_route1_dest = "192.168.10.0"; + const char *expected_route1_gw = "192.168.1.1"; + + options = fill_table (generic_options, NULL); + options = fill_table (invalid_classless_routes3, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-rfc3442-invalid-3", "failed to parse DHCP4 options"); + + /* IP4 routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 1, + "dhcp-rfc3442-invalid-3", "unexpected number of IP routes"); + + /* Route #1 */ + route = nm_ip4_config_get_route (ip4_config, 0); + ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, + "dhcp-rfc3442-invalid-3", "couldn't convert expected route destination #1"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-rfc3442-invalid-3", "unexpected route #1 destination"); + + ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, + "dhcp-rfc3442-invalid-3", "couldn't convert expected route next hop #1"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-rfc3442-invalid-3", "unexpected route #1 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 24, + "dhcp-rfc3442-invalid-3", "unexpected route #1 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-rfc3442-invalid-3", "unexpected route #1 metric"); + + g_hash_table_destroy (options); +} + +static Option gw_in_classless_routes[] = { + /* For dhclient */ + { "new_rfc3442_classless_static_routes", "24 192 168 10 192 168 1 1 0 192 2 3 4" }, + /* For dhcpcd */ + { "new_classless_static_routes", "192.168.10.0/24 192.168.1.1 0.0.0.0/0 192.2.3.4" }, + { NULL, NULL } +}; + +static void +test_gateway_in_classless_routes (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Address *addr; + NMIP4Route *route; + struct in_addr tmp; + const char *expected_route1_dest = "192.168.10.0"; + const char *expected_route1_gw = "192.168.1.1"; + const char *expected_gateway = "192.2.3.4"; + + options = fill_table (generic_options, NULL); + options = fill_table (gw_in_classless_routes, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-rfc3442-gateway", "failed to parse DHCP4 options"); + + /* IP4 routes */ + ASSERT (nm_ip4_config_get_num_routes (ip4_config) == 1, + "dhcp-rfc3442-gateway", "unexpected number of IP routes"); + + /* Route #1 */ + route = nm_ip4_config_get_route (ip4_config, 0); + ASSERT (inet_pton (AF_INET, expected_route1_dest, &tmp) > 0, + "dhcp-rfc3442-gateway", "couldn't convert expected route destination #1"); + ASSERT (nm_ip4_route_get_dest (route) == tmp.s_addr, + "dhcp-rfc3442-gateway", "unexpected route #1 destination"); + + ASSERT (inet_pton (AF_INET, expected_route1_gw, &tmp) > 0, + "dhcp-rfc3442-gateway", "couldn't convert expected route next hop #1"); + ASSERT (nm_ip4_route_get_next_hop (route) == tmp.s_addr, + "dhcp-rfc3442-gateway", "unexpected route #1 next hop"); + + ASSERT (nm_ip4_route_get_prefix (route) == 24, + "dhcp-rfc3442-gateway", "unexpected route #1 prefix"); + ASSERT (nm_ip4_route_get_metric (route) == 0, + "dhcp-rfc3442-gateway", "unexpected route #1 metric"); + + /* Address */ + ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, + "dhcp-rfc3442-gateway", "unexpected number of IP addresses"); + addr = nm_ip4_config_get_address (ip4_config, 0); + ASSERT (inet_pton (AF_INET, expected_gateway, &tmp) > 0, + "dhcp-rfc3442-gateway", "couldn't convert expected IP gateway"); + ASSERT (nm_ip4_address_get_gateway (addr) == tmp.s_addr, + "dhcp-rfc3442-gateway", "unexpected IP gateway"); + + g_hash_table_destroy (options); +} + +static Option escaped_searches_options[] = { + { "new_domain_search", "host1\\032host2\\032host3" }, + { NULL, NULL } +}; + +static void +test_escaped_domain_searches (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + const char *expected_search0 = "host1"; + const char *expected_search1 = "host2"; + const char *expected_search2 = "host3"; + + options = fill_table (generic_options, NULL); + options = fill_table (escaped_searches_options, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-escaped-domain-searches", "failed to parse DHCP4 options"); + + /* domain searches */ + ASSERT (nm_ip4_config_get_num_searches (ip4_config) == 3, + "dhcp-escaped-domain-searches", "unexpected number of searches"); + ASSERT (!strcmp (nm_ip4_config_get_search (ip4_config, 0), expected_search0), + "dhcp-escaped-domain-searches", "unexpected domain search #1"); + ASSERT (!strcmp (nm_ip4_config_get_search (ip4_config, 1), expected_search1), + "dhcp-escaped-domain-searches", "unexpected domain search #1"); + ASSERT (!strcmp (nm_ip4_config_get_search (ip4_config, 2), expected_search2), + "dhcp-escaped-domain-searches", "unexpected domain search #1"); + + g_hash_table_destroy (options); +} + +static Option invalid_escaped_searches_options[] = { + { "new_domain_search", "host1\\aahost2\\032host3" }, + { NULL, NULL } +}; + +static void +test_invalid_escaped_domain_searches (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + + options = fill_table (generic_options, NULL); + options = fill_table (invalid_escaped_searches_options, options); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-invalid-escaped-domain-searches", "failed to parse DHCP4 options"); + + /* domain searches */ + ASSERT (nm_ip4_config_get_num_searches (ip4_config) == 0, + "dhcp-invalid-escaped-domain-searches", "unexpected domain searches"); + + g_hash_table_destroy (options); +} + +static void +test_ip4_missing_prefix (const char *client, const char *ip, guint32 expected_prefix) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Address *addr; + + options = fill_table (generic_options, NULL); + g_hash_table_insert (options, "new_ip_address", string_to_byte_array_gvalue (ip)); + g_hash_table_remove (options, "new_subnet_mask"); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-ip4-missing-prefix", "failed to parse DHCP4 options"); + + ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, + "dhcp-ip4-missing-prefix", "unexpected number of IP4 addresses (not 1)"); + + addr = nm_ip4_config_get_address (ip4_config, 0); + ASSERT (addr != NULL, + "dhcp-ip4-missing-prefix", "missing IP4 address #1"); + + ASSERT (nm_ip4_address_get_prefix (addr) == expected_prefix, + "dhcp-ip4-missing-prefix", "unexpected IP4 address prefix %d (expected %d)", + nm_ip4_address_get_prefix (addr), expected_prefix); + + g_hash_table_destroy (options); +} + +static void +test_ip4_prefix_classless (const char *client) +{ + GHashTable *options; + NMIP4Config *ip4_config; + NMIP4Address *addr; + + /* Ensure that the missing-subnet-mask handler doesn't mangle classless + * subnet masks at all. The handler should trigger only if the server + * doesn't send the subnet mask. + */ + + options = fill_table (generic_options, NULL); + g_hash_table_insert (options, "new_ip_address", string_to_byte_array_gvalue ("172.16.54.22")); + g_hash_table_insert (options, "new_subnet_mask", string_to_byte_array_gvalue ("255.255.252.0")); + + ip4_config = nm_dhcp_manager_test_ip4_options_to_config (client, "eth0", options, "rebind"); + ASSERT (ip4_config != NULL, + "dhcp-ip4-prefix-classless", "failed to parse DHCP4 options"); + + ASSERT (nm_ip4_config_get_num_addresses (ip4_config) == 1, + "dhcp-ip4-prefix-classless", "unexpected number of IP4 addresses (not 1)"); + + addr = nm_ip4_config_get_address (ip4_config, 0); + ASSERT (addr != NULL, + "dhcp-ip4-prefix-classless", "missing IP4 address #1"); + + ASSERT (nm_ip4_address_get_prefix (addr) == 22, + "dhcp-ip4-prefix-classless", "unexpected IP4 address prefix %d (expected 22)", + nm_ip4_address_get_prefix (addr)); + + g_hash_table_destroy (options); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + DBusGConnection *bus; + char *base; + const char *clients[2][2] = { {DHCLIENT_PATH, "dhclient"}, {DHCPCD_PATH, "dhcpcd"} }; + guint32 i; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + if (!nm_utils_init (&error)) + FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + + /* The tests */ + for (i = 0; i < 2; i++) { + const char *client_path = clients[i][0]; + const char *client = clients[i][1]; + + if (!client_path || !strlen (client_path)) + continue; + + test_generic_options (client); + test_wins_options (client); + test_classless_static_routes (client); + test_invalid_classless_routes1 (client); + test_invalid_classless_routes2 (client); + test_invalid_classless_routes3 (client); + test_gateway_in_classless_routes (client); + test_escaped_domain_searches (client); + test_invalid_escaped_domain_searches (client); + test_ip4_missing_prefix (client, "192.168.1.10", 24); + test_ip4_missing_prefix (client, "172.16.54.50", 16); + test_ip4_missing_prefix (client, "10.1.2.3", 8); + test_ip4_prefix_classless (client); + } + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + diff --git a/src/tests/test-policy-hosts.c b/src/tests/test-policy-hosts.c new file mode 100644 index 00000000..e14f15e5 --- /dev/null +++ b/src/tests/test-policy-hosts.c @@ -0,0 +1,394 @@ +/* -*- 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) 2010 Red Hat, Inc. + * + */ + +#include +#include + +#include "nm-policy-hosts.h" + +#define FALLBACK_HOSTNAME "localhost.localdomain" + +static void +test_generic (const char *before, + const char *after, + const char *hostname, + gboolean expect_error) +{ + char **lines; + GString *newc; + GError *error = NULL; + + /* Get the new /etc/hosts contents */ + lines = g_strsplit_set (before, "\n\r", 0); + newc = nm_policy_get_etc_hosts ((const char **) lines, + strlen (before), + hostname, + FALLBACK_HOSTNAME, + &error); + g_strfreev (lines); + + if (expect_error) { + g_assert (newc == NULL); + g_assert (error != NULL); + g_clear_error (&error); + } else if (after == NULL) { + /* No change to /etc/hosts required */ + g_assert (newc == NULL); + g_assert (error == NULL); + } else { + g_assert (newc != NULL); + g_assert (error == NULL); + +#if 0 + g_message ("\n--------------------------------------\n" + "%s" + "--------------------------------------", + newc->str); +#endif + g_assert (strlen (newc->str) == strlen (after)); + g_assert (strcmp (newc->str, after) == 0); + g_string_free (newc, TRUE); + } +} + +/*******************************************/ + +static const char *generic_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_generic (void) +{ + test_generic (generic_before, NULL, "localhost.localdomain", FALSE); +} + +/*******************************************/ + +static const char *generic_no_boilerplate_before = \ + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_generic_no_boilerplate (void) +{ + test_generic (generic_no_boilerplate_before, NULL, "localhost.localdomain", FALSE); +} + +/*******************************************/ + +static const char *generic_no_boilerplate_no_lh_before = \ + "127.0.0.1 localhost.localdomain\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *generic_no_boilerplate_no_lh_after = \ + "127.0.0.1 localhost\n" + "127.0.0.1 localhost.localdomain\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_generic_no_boilerplate_no_lh (void) +{ + test_generic (generic_no_boilerplate_no_lh_before, + generic_no_boilerplate_no_lh_after, + "localhost.localdomain", + FALSE); +} + +/*******************************************/ + + +static const char *generic_no_boilerplate_no_lh_no_host_before = \ + "127.0.0.1 localhost.localdomain\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *generic_no_boilerplate_no_lh_no_host_after = \ + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_generic_no_boilerplate_no_lh_no_host (void) +{ + test_generic (generic_no_boilerplate_no_lh_no_host_before, + generic_no_boilerplate_no_lh_no_host_after, + "comet", + FALSE); +} + +/*******************************************/ +static const char *named_generic_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 playboy localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_named_generic (void) +{ + test_generic (named_generic_before, NULL, "playboy", FALSE); +} + +/*******************************************/ + +static const char *named_non127_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "192.168.1.2 tomcat\n"; + +static void +test_hosts_named_non127 (void) +{ + test_generic (named_non127_before, NULL, "tomcat", FALSE); +} + +/*******************************************/ + +static const char *named2_non127_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "192.168.1.2 tomcat\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n"; + +static void +test_hosts_named2_non127 (void) +{ + test_generic (named2_non127_before, NULL, "tomcat", FALSE); +} + +/*******************************************/ + +static const char *named_no_lh_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "192.168.1.2 tomcat\n"; + +static const char *named_no_lh_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "192.168.1.2 tomcat\n"; + +static void +test_hosts_named_no_localhost (void) +{ + test_generic (named_no_lh_before, named_no_lh_after, "tomcat", FALSE); +} + +/*******************************************/ + +static const char *no_lh_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 tomcat\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static const char *no_lh_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost\n" + "127.0.0.1 tomcat\n" + "::1 localhost6.localdomain6 localhost6\n" + "127.0.0.1 lcmd.us.intellitxt.com\n"; + +static void +test_hosts_no_localhost (void) +{ + test_generic (no_lh_before, no_lh_after, "tomcat", FALSE); +} + +/*******************************************/ + +static const char *named_last_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 sparcbook.ausil.us\n" + "::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 sparcbook.ausil.us\n"; + +static void +test_hosts_named_last (void) +{ + test_generic (named_last_before, NULL, "sparcbook.ausil.us", FALSE); +} + +/*******************************************/ + +static const char *no_host_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n" + "127.0.0.1 a.tribalfusion.com\n"; + +static const char *no_host_after = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 comet localhost.localdomain localhost\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n" + "127.0.0.1 a.tribalfusion.com\n"; + +static void +test_hosts_no_host (void) +{ + test_generic (no_host_before, no_host_after, "comet", FALSE); +} + +/*******************************************/ + +static const char *long_before = \ + "# Do not remove the following line, or various programs\n" + "# that require network functionality will fail.\n" + "127.0.0.1 localhost.localdomain localhost comet\n" + "::1 localhost6.localdomain6 localhost6\n" + "\n" + "127.0.0.1 lcmd.us.intellitxt.com\n" + "127.0.0.1 adserver.adtech.de\n" + "127.0.0.1 a.as-us.falkag.net\n" + "127.0.0.1 a.as-eu.falkag.net\n" + "127.0.0.1 ads.doubleclick.com\n" + "\n" + "# random comment\n" + "127.0.0.1 m1.2mdn.net\n" + "127.0.0.1 ds.serving-sys.com\n" + "127.0.0.1 pagead2.googlesyndication.com\n" + "127.0.0.1 ad.doubleclick.com\n" + "127.0.0.1 ad.doubleclick.net\n" + "127.0.0.1 oascentral.movietickets.com\n" + "127.0.0.1 view.atdmt.com\n" + "127.0.0.1 ads.chumcity.com\n" + "127.0.0.1 ads.as4x.tmcs.net\n" + "127.0.0.1 n4403ad.doubleclick.net\n" + "127.0.0.1 www.assoc-amazon.com\n" + "127.0.0.1 s25.sitemeter.com\n" + "127.0.0.1 adlog.com.com\n" + "127.0.0.1 ahs.laptopmag.com\n" + "127.0.0.1 altfarm.mediaplex.com\n" + "127.0.0.1 ads.addynamix.com\n" + "127.0.0.1 srx.main.ebayrtm.com\n" + "127.0.0.1 cdn5.tribalfusion.com\n" + "127.0.0.1 a.tribalfusion.com\n"; + + +static void +test_hosts_long (void) +{ + test_generic (long_before, NULL, "comet", FALSE); +} + +/*******************************************/ + +typedef struct { + const char *line; + const char *token; + gboolean expected; +} Foo; + +static Foo foo[] = { + /* Using \t here to easily differentiate tabs vs. spaces for testing */ + { "127.0.0.1\tfoobar\tblah", "blah", TRUE }, + { "", "blah", FALSE }, + { "1.1.1.1\tbork\tfoo", "blah", FALSE }, + { "127.0.0.1 foobar\tblah", "blah", TRUE }, + { "127.0.0.1 foobar blah", "blah", TRUE }, + { "127.0.0.1 localhost", "localhost.localdomain", FALSE }, + { "192.168.1.1 blah borkbork", "blah", TRUE }, + { "192.168.1.1 foobar\tblah borkbork", "blah", TRUE }, + { "192.168.1.1\tfoobar\tblah\tborkbork", "blah", TRUE }, + { "192.168.1.1 \tfoobar \tblah \tborkbork\t ", "blah", TRUE }, + { "\t\t\t\t \t\t\tasdfadf a\t\t\t\t\t \t\t\t\t\t ", "blah", FALSE }, + { NULL, NULL, FALSE } +}; + +static void +test_find_token (void) +{ + Foo *iter = &foo[0]; + + while (iter->line) { + gboolean found; + + found = nm_policy_hosts_find_token (iter->line, iter->token); + if (found != iter->expected) { + g_warning ("find-token: unexpected token result %d for '%s' <= '%s' (expected %d)", + found, iter->line, iter->token, iter->expected); + } + g_assert (found == iter->expected); + iter++; + } +} + +typedef void (*TCFunc)(void); + +#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL) + +int main (int argc, char **argv) +{ + GTestSuite *suite; + + g_test_init (&argc, &argv, NULL); + + suite = g_test_get_root (); + + g_test_suite_add (suite, TESTCASE (test_find_token, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_generic, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate_no_lh, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_generic_no_boilerplate_no_lh_no_host, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named_generic, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named2_non127, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named_no_localhost, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_no_localhost, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_named_last, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_no_host, NULL)); + g_test_suite_add (suite, TESTCASE (test_hosts_long, NULL)); + + return g_test_run (); +} + diff --git a/src/vpn-manager/Makefile.am b/src/vpn-manager/Makefile.am new file mode 100644 index 00000000..56e4a4ce --- /dev/null +++ b/src/vpn-manager/Makefile.am @@ -0,0 +1,46 @@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/named-manager \ + -DVPN_NAME_FILES_DIR=\""$(sysconfdir)/NetworkManager/VPN"\" + + +noinst_LTLIBRARIES = libvpn-manager.la + +libvpn_manager_la_SOURCES = \ + nm-vpn-manager.c \ + nm-vpn-manager.h \ + nm-vpn-service.c \ + nm-vpn-service.h \ + nm-vpn-connection.c \ + nm-vpn-connection.h + +libvpn_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED + +libvpn_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +nm-vpn-connection-glue.h: $(top_srcdir)/introspection/nm-vpn-connection.xml + dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-server --output=$@ $< + +nm-vpn-plugin-bindings.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml + dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-client --output=$@ $< + + +BUILT_SOURCES = \ + nm-vpn-connection-glue.h \ + nm-vpn-plugin-bindings.h + +CLEANFILES = $(BUILT_SOURCES) + diff --git a/src/vpn-manager/Makefile.in b/src/vpn-manager/Makefile.in new file mode 100644 index 00000000..dc1ba727 --- /dev/null +++ b/src/vpn-manager/Makefile.in @@ -0,0 +1,611 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/vpn-manager +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libvpn_manager_la_DEPENDENCIES = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libvpn_manager_la_OBJECTS = libvpn_manager_la-nm-vpn-manager.lo \ + libvpn_manager_la-nm-vpn-service.lo \ + libvpn_manager_la-nm-vpn-connection.lo +libvpn_manager_la_OBJECTS = $(am_libvpn_manager_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libvpn_manager_la_SOURCES) +DIST_SOURCES = $(libvpn_manager_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I${top_srcdir} \ + -I${top_srcdir}/include \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/src/logging \ + -I${top_srcdir}/src \ + -I${top_builddir}/marshallers \ + -I${top_srcdir}/src/named-manager \ + -DVPN_NAME_FILES_DIR=\""$(sysconfdir)/NetworkManager/VPN"\" + +noinst_LTLIBRARIES = libvpn-manager.la +libvpn_manager_la_SOURCES = \ + nm-vpn-manager.c \ + nm-vpn-manager.h \ + nm-vpn-service.c \ + nm-vpn-service.h \ + nm-vpn-connection.c \ + nm-vpn-connection.h + +libvpn_manager_la_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DG_DISABLE_DEPRECATED + +libvpn_manager_la_LIBADD = \ + $(top_builddir)/marshallers/libmarshallers.la \ + $(top_builddir)/src/logging/libnm-logging.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +BUILT_SOURCES = \ + nm-vpn-connection-glue.h \ + nm-vpn-plugin-bindings.h + +CLEANFILES = $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/vpn-manager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/vpn-manager/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libvpn-manager.la: $(libvpn_manager_la_OBJECTS) $(libvpn_manager_la_DEPENDENCIES) + $(LINK) $(libvpn_manager_la_OBJECTS) $(libvpn_manager_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvpn_manager_la-nm-vpn-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvpn_manager_la-nm-vpn-manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvpn_manager_la-nm-vpn-service.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libvpn_manager_la-nm-vpn-manager.lo: nm-vpn-manager.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvpn_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libvpn_manager_la-nm-vpn-manager.lo -MD -MP -MF $(DEPDIR)/libvpn_manager_la-nm-vpn-manager.Tpo -c -o libvpn_manager_la-nm-vpn-manager.lo `test -f 'nm-vpn-manager.c' || echo '$(srcdir)/'`nm-vpn-manager.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libvpn_manager_la-nm-vpn-manager.Tpo $(DEPDIR)/libvpn_manager_la-nm-vpn-manager.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-vpn-manager.c' object='libvpn_manager_la-nm-vpn-manager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvpn_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libvpn_manager_la-nm-vpn-manager.lo `test -f 'nm-vpn-manager.c' || echo '$(srcdir)/'`nm-vpn-manager.c + +libvpn_manager_la-nm-vpn-service.lo: nm-vpn-service.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvpn_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libvpn_manager_la-nm-vpn-service.lo -MD -MP -MF $(DEPDIR)/libvpn_manager_la-nm-vpn-service.Tpo -c -o libvpn_manager_la-nm-vpn-service.lo `test -f 'nm-vpn-service.c' || echo '$(srcdir)/'`nm-vpn-service.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libvpn_manager_la-nm-vpn-service.Tpo $(DEPDIR)/libvpn_manager_la-nm-vpn-service.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-vpn-service.c' object='libvpn_manager_la-nm-vpn-service.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvpn_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libvpn_manager_la-nm-vpn-service.lo `test -f 'nm-vpn-service.c' || echo '$(srcdir)/'`nm-vpn-service.c + +libvpn_manager_la-nm-vpn-connection.lo: nm-vpn-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvpn_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libvpn_manager_la-nm-vpn-connection.lo -MD -MP -MF $(DEPDIR)/libvpn_manager_la-nm-vpn-connection.Tpo -c -o libvpn_manager_la-nm-vpn-connection.lo `test -f 'nm-vpn-connection.c' || echo '$(srcdir)/'`nm-vpn-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libvpn_manager_la-nm-vpn-connection.Tpo $(DEPDIR)/libvpn_manager_la-nm-vpn-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-vpn-connection.c' object='libvpn_manager_la-nm-vpn-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvpn_manager_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libvpn_manager_la-nm-vpn-connection.lo `test -f 'nm-vpn-connection.c' || echo '$(srcdir)/'`nm-vpn-connection.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +nm-vpn-connection-glue.h: $(top_srcdir)/introspection/nm-vpn-connection.xml + dbus-binding-tool --prefix=nm_vpn_connection --mode=glib-server --output=$@ $< + +nm-vpn-plugin-bindings.h: $(top_srcdir)/introspection/nm-vpn-plugin.xml + dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-client --output=$@ $< + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c new file mode 100644 index 00000000..7eae972e --- /dev/null +++ b/src/vpn-manager/nm-vpn-connection.c @@ -0,0 +1,1192 @@ +/* -*- 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) 2005 - 2010 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "NetworkManager.h" +#include "NetworkManagerVPN.h" +#include "nm-vpn-connection.h" +#include "nm-setting-connection.h" +#include "nm-setting-vpn.h" +#include "nm-setting-ip4-config.h" +#include "nm-dbus-manager.h" +#include "nm-manager.h" +#include "nm-system.h" +#include "nm-logging.h" +#include "nm-utils.h" +#include "nm-vpn-plugin-bindings.h" +#include "nm-marshal.h" +#include "nm-active-connection.h" +#include "nm-properties-changed-signal.h" +#include "nm-dbus-glib-types.h" +#include "NetworkManagerUtils.h" +#include "nm-named-manager.h" +#include "nm-netlink-monitor.h" +#include "nm-glib-compat.h" + +#include "nm-vpn-connection-glue.h" + +static void secrets_provider_interface_init (NMSecretsProviderInterface *sp_interface_class); + +G_DEFINE_TYPE_EXTENDED (NMVPNConnection, nm_vpn_connection, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SECRETS_PROVIDER_INTERFACE, + secrets_provider_interface_init)) + +typedef struct { + gboolean disposed; + + NMConnection *connection; + + NMActRequest *act_request; + char *ac_path; + + NMDevice *parent_dev; + gulong device_monitor; + gulong device_ip4; + + gboolean is_default; + gboolean is_default6; + NMActiveConnectionState state; + + NMVPNConnectionState vpn_state; + NMVPNConnectionStateReason failure_reason; + DBusGProxy *proxy; + guint ipconfig_timeout; + NMIP4Config *ip4_config; + guint32 ip4_internal_gw; + char *tundev; + char *banner; + + struct rtnl_route *gw_route; +} NMVPNConnectionPrivate; + +#define NM_VPN_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_CONNECTION, NMVPNConnectionPrivate)) + +enum { + PROPERTIES_CHANGED, + VPN_STATE_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_SERVICE_NAME, + PROP_CONNECTION, + PROP_SPECIFIC_OBJECT, + PROP_DEVICES, + PROP_STATE, + PROP_DEFAULT, + PROP_DEFAULT6, + PROP_VPN, + PROP_VPN_STATE, + PROP_BANNER, + + LAST_PROP +}; + +static void +nm_vpn_connection_set_vpn_state (NMVPNConnection *connection, + NMVPNConnectionState vpn_state, + NMVPNConnectionStateReason reason) +{ + NMVPNConnectionPrivate *priv; + NMActiveConnectionState new_ac_state; + NMVPNConnectionState old_vpn_state; + char *ip_iface; + + g_return_if_fail (NM_IS_VPN_CONNECTION (connection)); + + priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + if (vpn_state == priv->vpn_state) + return; + + old_vpn_state = priv->vpn_state; + priv->vpn_state = vpn_state; + + /* Save ip_iface since when the VPN goes down it may get freed + * before we're done with it. + */ + ip_iface = g_strdup (priv->tundev); + + /* Set the NMActiveConnection state based on VPN state */ + switch (vpn_state) { + case NM_VPN_CONNECTION_STATE_PREPARE: + case NM_VPN_CONNECTION_STATE_NEED_AUTH: + case NM_VPN_CONNECTION_STATE_CONNECT: + case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: + new_ac_state = NM_ACTIVE_CONNECTION_STATE_ACTIVATING; + break; + case NM_VPN_CONNECTION_STATE_ACTIVATED: + new_ac_state = NM_ACTIVE_CONNECTION_STATE_ACTIVATED; + break; + default: + new_ac_state = NM_ACTIVE_CONNECTION_STATE_UNKNOWN; + break; + } + + if (new_ac_state != priv->state) { + priv->state = new_ac_state; + g_object_notify (G_OBJECT (connection), NM_ACTIVE_CONNECTION_STATE); + } + + /* 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. + */ + g_object_ref (connection); + + g_signal_emit (connection, signals[VPN_STATE_CHANGED], 0, vpn_state, reason); + g_object_notify (G_OBJECT (connection), NM_VPN_CONNECTION_VPN_STATE); + + /* Call dispatcher after the event gets processed internally */ + switch (vpn_state) { + case NM_VPN_CONNECTION_STATE_ACTIVATED: + nm_utils_call_dispatcher ("vpn-up", + priv->connection, + priv->parent_dev, + ip_iface); + break; + case NM_VPN_CONNECTION_STATE_FAILED: + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + if (old_vpn_state == NM_VPN_CONNECTION_STATE_ACTIVATED) { + nm_utils_call_dispatcher ("vpn-down", + priv->connection, + priv->parent_dev, + ip_iface); + } + break; + default: + break; + } + + g_free (ip_iface); + g_object_unref (connection); +} + +static void +device_state_changed (NMDevice *device, + NMDeviceState new_state, + NMDeviceState old_state, + NMDeviceStateReason reason, + gpointer user_data) +{ + NMVPNConnection *connection = NM_VPN_CONNECTION (user_data); + + if (new_state <= NM_DEVICE_STATE_DISCONNECTED) { + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED); + } else if (new_state == NM_DEVICE_STATE_FAILED) { + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_FAILED, + NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED); + } +} + +static void +device_ip4_config_changed (NMDevice *device, + GParamSpec *pspec, + gpointer user_data) +{ + NMVPNConnection *vpn = NM_VPN_CONNECTION (user_data); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn); + + if ( (priv->vpn_state != NM_VPN_CONNECTION_STATE_ACTIVATED) + || !nm_device_get_ip4_config (device)) + return; + + if (priv->gw_route) + rtnl_route_put (priv->gw_route); + + /* Re-add the VPN gateway route */ + priv->gw_route = nm_system_add_ip4_vpn_gateway_route (priv->parent_dev, priv->ip4_config); +} + +NMVPNConnection * +nm_vpn_connection_new (NMConnection *connection, + NMActRequest *act_request, + NMDevice *parent_device) +{ + NMVPNConnection *self; + NMVPNConnectionPrivate *priv; + + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + g_return_val_if_fail (NM_IS_ACT_REQUEST (act_request), NULL); + g_return_val_if_fail (NM_IS_DEVICE (parent_device), NULL); + + self = (NMVPNConnection *) g_object_new (NM_TYPE_VPN_CONNECTION, NULL); + if (!self) + return NULL; + + priv = NM_VPN_CONNECTION_GET_PRIVATE (self); + + priv->connection = g_object_ref (connection); + priv->parent_dev = g_object_ref (parent_device); + priv->act_request = g_object_ref (act_request); + + priv->device_monitor = g_signal_connect (parent_device, "state-changed", + G_CALLBACK (device_state_changed), + self); + + priv->device_ip4 = g_signal_connect (parent_device, "notify::" NM_DEVICE_INTERFACE_IP4_CONFIG, + G_CALLBACK (device_ip4_config_changed), + self); + return self; +} + +static const char * +nm_vpn_connection_get_service (NMVPNConnection *connection) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + NMSettingVPN *setting; + + setting = (NMSettingVPN *) nm_connection_get_setting (priv->connection, NM_TYPE_SETTING_VPN); + return nm_setting_vpn_get_service_type (setting); +} + +static void +plugin_failed (DBusGProxy *proxy, + NMVPNPluginFailure plugin_failure, + gpointer user_data) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (user_data); + + nm_log_warn (LOGD_VPN, "VPN plugin failed: %d", plugin_failure); + + switch (plugin_failure) { + case NM_VPN_PLUGIN_FAILURE_LOGIN_FAILED: + priv->failure_reason = NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED; + break; + case NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG: + priv->failure_reason = NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID; + break; + default: + priv->failure_reason = NM_VPN_CONNECTION_STATE_REASON_UNKNOWN; + } +} + +static void +plugin_state_changed (DBusGProxy *proxy, + NMVPNServiceState state, + gpointer user_data) +{ + NMVPNConnection *connection = NM_VPN_CONNECTION (user_data); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + nm_log_info (LOGD_VPN, "VPN plugin state changed: %d", state); + + if (state == NM_VPN_SERVICE_STATE_STOPPED) { + /* Clear connection secrets to ensure secrets get requested each time the + * connection is activated. + */ + nm_connection_clear_secrets (priv->connection); + + switch (nm_vpn_connection_get_vpn_state (connection)) { + case NM_VPN_CONNECTION_STATE_PREPARE: + case NM_VPN_CONNECTION_STATE_NEED_AUTH: + case NM_VPN_CONNECTION_STATE_CONNECT: + case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: + case NM_VPN_CONNECTION_STATE_ACTIVATED: + nm_log_info (LOGD_VPN, "VPN plugin state change reason: %d", priv->failure_reason); + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_FAILED, + priv->failure_reason); + + /* Reset the failure reason */ + priv->failure_reason = NM_VPN_CONNECTION_STATE_REASON_UNKNOWN; + break; + default: + break; + } + } +} + +static const char * +ip_address_to_string (guint32 numeric) +{ + struct in_addr temp_addr; + static char buf[INET_ADDRSTRLEN + 1]; + + memset (&buf, '\0', sizeof (buf)); + temp_addr.s_addr = numeric; + + if (inet_ntop (AF_INET, &temp_addr, buf, INET_ADDRSTRLEN)) { + return buf; + } else { + nm_log_warn (LOGD_VPN, "error converting IP4 address 0x%X", + ntohl (temp_addr.s_addr)); + return NULL; + } +} + +static void +print_vpn_config (NMIP4Config *config, + guint32 internal_gw, + const char *tundev, + const char *banner) +{ + NMIP4Address *addr; + char *dns_domain = NULL; + guint32 num, i; + + g_return_if_fail (config != NULL); + + addr = nm_ip4_config_get_address (config, 0); + + nm_log_info (LOGD_VPN, "VPN Gateway: %s", ip_address_to_string (nm_ip4_address_get_gateway (addr))); + if (internal_gw) + nm_log_info (LOGD_VPN, "Internal Gateway: %s", ip_address_to_string (internal_gw)); + nm_log_info (LOGD_VPN, "Tunnel Device: %s", tundev); + nm_log_info (LOGD_VPN, "Internal IP4 Address: %s", ip_address_to_string (nm_ip4_address_get_address (addr))); + nm_log_info (LOGD_VPN, "Internal IP4 Prefix: %d", nm_ip4_address_get_prefix (addr)); + nm_log_info (LOGD_VPN, "Internal IP4 Point-to-Point Address: %s", + ip_address_to_string (nm_ip4_config_get_ptp_address (config))); + nm_log_info (LOGD_VPN, "Maximum Segment Size (MSS): %d", nm_ip4_config_get_mss (config)); + + num = nm_ip4_config_get_num_routes (config); + for (i = 0; i < num; i++) { + NMIP4Route *route; + + route = nm_ip4_config_get_route (config, i); + nm_log_info (LOGD_VPN, "Static Route: %s/%d Next Hop: %s", + ip_address_to_string (nm_ip4_route_get_dest (route)), + nm_ip4_route_get_prefix (route), + ip_address_to_string (nm_ip4_route_get_next_hop (route))); + } + + num = nm_ip4_config_get_num_nameservers (config); + for (i = 0; i < num; i++) { + nm_log_info (LOGD_VPN, "Internal IP4 DNS: %s", + ip_address_to_string (nm_ip4_config_get_nameserver (config, i))); + } + + if (nm_ip4_config_get_num_domains (config) > 0) + dns_domain = (char *) nm_ip4_config_get_domain (config, 0); + + nm_log_info (LOGD_VPN, "DNS Domain: '%s'", dns_domain ? dns_domain : "(none)"); + + if (banner && strlen (banner)) { + nm_log_info (LOGD_VPN, "Login Banner:"); + nm_log_info (LOGD_VPN, "-----------------------------------------"); + nm_log_info (LOGD_VPN, "%s", banner); + nm_log_info (LOGD_VPN, "-----------------------------------------"); + } +} + +static void +nm_vpn_connection_ip4_config_get (DBusGProxy *proxy, + GHashTable *config_hash, + gpointer user_data) +{ + NMVPNConnection *connection = NM_VPN_CONNECTION (user_data); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + NMSettingIP4Config *s_ip4; + NMIP4Address *addr; + NMIP4Config *config; + GValue *val; + int i; + guint32 vpn_ext_gw = 0; + + nm_log_info (LOGD_VPN, "VPN connection '%s' (IP Config Get) reply received.", + nm_vpn_connection_get_name (connection)); + + g_source_remove (priv->ipconfig_timeout); + priv->ipconfig_timeout = 0; + + config = nm_ip4_config_new (); + + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV); + if (val) + priv->tundev = g_strdup (g_value_get_string (val)); + else { + nm_log_err (LOGD_VPN, "invalid or missing tunnel device received!"); + goto error; + } + + addr = nm_ip4_address_new (); + nm_ip4_address_set_prefix (addr, 24); /* default to class C */ + + /* 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); + + /* External world-visible address of the VPN server */ + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY); + if (val) { + nm_ip4_address_set_gateway (addr, g_value_get_uint (val)); + vpn_ext_gw = g_value_get_uint (val); + } + + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS); + if (val) + nm_ip4_address_set_address (addr, g_value_get_uint (val)); + + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_PTP); + if (val) + nm_ip4_config_set_ptp_address (config, g_value_get_uint (val)); + + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_PREFIX); + if (val) + nm_ip4_address_set_prefix (addr, g_value_get_uint (val)); + + if (nm_ip4_address_get_address (addr) && nm_ip4_address_get_prefix (addr)) { + nm_ip4_config_take_address (config, addr); + } else { + nm_log_err (LOGD_VPN, "invalid IP4 config received!"); + nm_ip4_address_unref (addr); + goto error; + } + + 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)); + } + + 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)); + } + + 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)); + + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_MTU); + if (val) + nm_ip4_config_set_mtu (config, g_value_get_uint (val)); + + 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_BANNER); + if (val) { + if (priv->banner) + g_free (priv->banner); + priv->banner = g_strdup (g_value_get_string (val)); + } + + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_ROUTES); + if (val) { + GSList *routes; + GSList *iter; + + routes = nm_utils_ip4_routes_from_gvalue (val); + for (iter = routes; iter; iter = iter->next) { + NMIP4Route *route = iter->data; + + /* 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 ( vpn_ext_gw + && nm_ip4_route_get_dest (route) == vpn_ext_gw + && nm_ip4_route_get_prefix (route) == 32) + continue; + + /* Otherwise accept the VPN-provided route */ + nm_ip4_config_take_route (config, route); + } + + g_slist_free (routes); + } + + print_vpn_config (config, priv->ip4_internal_gw, priv->tundev, priv->banner); + + /* Merge in user overrides from the NMConnection's IPv4 setting */ + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (priv->connection, NM_TYPE_SETTING_IP4_CONFIG)); + nm_utils_merge_ip4_config (config, s_ip4); + + nm_system_device_set_up_down_with_iface (priv->tundev, TRUE, NULL); + + if (nm_system_apply_ip4_config (priv->tundev, config, 0, NM_IP4_COMPARE_FLAG_ALL)) { + NMNamedManager *named_mgr; + + /* Add any explicit route to the VPN gateway through the parent device */ + priv->gw_route = nm_system_add_ip4_vpn_gateway_route (priv->parent_dev, config); + + /* Add the VPN to DNS */ + named_mgr = nm_named_manager_get (); + nm_named_manager_add_ip4_config (named_mgr, priv->tundev, config, NM_NAMED_IP_CONFIG_TYPE_VPN); + g_object_unref (named_mgr); + + priv->ip4_config = config; + + nm_log_info (LOGD_VPN, "VPN connection '%s' (IP Config Get) complete.", + nm_vpn_connection_get_name (connection)); + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_ACTIVATED, + NM_VPN_CONNECTION_STATE_REASON_NONE); + return; + } + +error: + nm_log_warn (LOGD_VPN, "VPN connection '%s' did not receive valid IP config information.", + nm_vpn_connection_get_name (connection)); + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_FAILED, + NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID); + g_object_unref (config); +} + +static gboolean +nm_vpn_connection_ip_config_timeout (gpointer user_data) +{ + NMVPNConnection *connection = NM_VPN_CONNECTION (user_data); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + priv->ipconfig_timeout = 0; + + /* If the activation request's state is still IP_CONFIG_GET and we're + * in this timeout, cancel activation because it's taken too long. + */ + if (nm_vpn_connection_get_vpn_state (connection) == NM_VPN_CONNECTION_STATE_IP_CONFIG_GET) { + nm_log_warn (LOGD_VPN, "VPN connection '%s' (IP Config Get) timeout exceeded.", + nm_vpn_connection_get_name (connection)); + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_FAILED, + NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT); + } + + return FALSE; +} + +static void +nm_vpn_connection_connect_cb (DBusGProxy *proxy, GError *err, gpointer user_data) +{ + NMVPNConnection *connection = NM_VPN_CONNECTION (user_data); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + nm_log_info (LOGD_VPN, "VPN connection '%s' (Connect) reply received.", + nm_vpn_connection_get_name (connection)); + + if (err) { + nm_log_warn (LOGD_VPN, "VPN connection '%s' failed to connect: '%s'.", + nm_vpn_connection_get_name (connection), err->message); + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_FAILED, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED); + } else { + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_IP_CONFIG_GET, + NM_VPN_CONNECTION_STATE_REASON_NONE); + + /* 40 second timeout waiting for IP config signal from VPN service */ + priv->ipconfig_timeout = g_timeout_add_seconds (40, nm_vpn_connection_ip_config_timeout, connection); + } +} + +static void +really_activate (NMVPNConnection *connection) +{ + NMVPNConnectionPrivate *priv; + + g_return_if_fail (NM_IS_VPN_CONNECTION (connection)); + g_return_if_fail (nm_vpn_connection_get_vpn_state (connection) == NM_VPN_CONNECTION_STATE_NEED_AUTH); + + priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + /* Ip4Config signal */ + 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, "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); + + org_freedesktop_NetworkManager_VPN_Plugin_connect_async (priv->proxy, + nm_connection_to_hash (priv->connection), + nm_vpn_connection_connect_cb, + connection); + + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_CONNECT, + NM_VPN_CONNECTION_STATE_REASON_NONE); +} + +void +nm_vpn_connection_activate (NMVPNConnection *connection) +{ + NMVPNConnectionPrivate *priv; + NMDBusManager *dbus_mgr; + + g_return_if_fail (NM_IS_VPN_CONNECTION (connection)); + g_return_if_fail (nm_vpn_connection_get_vpn_state (connection) == NM_VPN_CONNECTION_STATE_PREPARE); + + priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + dbus_mgr = nm_dbus_manager_get (); + priv->proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (dbus_mgr), + nm_vpn_connection_get_service (connection), + NM_VPN_DBUS_PLUGIN_PATH, + NM_VPN_DBUS_PLUGIN_INTERFACE); + g_object_unref (dbus_mgr); + + 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); + + /* 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); + + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_NEED_AUTH, + NM_VPN_CONNECTION_STATE_REASON_NONE); +} + +const char * +nm_vpn_connection_get_active_connection_path (NMVPNConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL); + + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->ac_path; +} + +const char * +nm_vpn_connection_get_name (NMVPNConnection *connection) +{ + NMVPNConnectionPrivate *priv; + NMSettingConnection *setting; + + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL); + + priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + setting = (NMSettingConnection *) nm_connection_get_setting (priv->connection, NM_TYPE_SETTING_CONNECTION); + + return nm_setting_connection_get_id (setting); +} + +NMConnection * +nm_vpn_connection_get_connection (NMVPNConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL); + + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->connection; +} + +NMVPNConnectionState +nm_vpn_connection_get_vpn_state (NMVPNConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NM_VPN_CONNECTION_STATE_UNKNOWN); + + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->vpn_state; +} + +const char * +nm_vpn_connection_get_banner (NMVPNConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL); + + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->banner; +} + +NMIP4Config * +nm_vpn_connection_get_ip4_config (NMVPNConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL); + + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->ip4_config; +} + +const char * +nm_vpn_connection_get_ip_iface (NMVPNConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL); + + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->tundev; +} + +NMDevice * +nm_vpn_connection_get_parent_device (NMVPNConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), NULL); + + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->parent_dev; +} + +guint32 +nm_vpn_connection_get_ip4_internal_gateway (NMVPNConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_CONNECTION (connection), 0); + + return NM_VPN_CONNECTION_GET_PRIVATE (connection)->ip4_internal_gw; +} + +void +nm_vpn_connection_fail (NMVPNConnection *connection, + NMVPNConnectionStateReason reason) +{ + g_return_if_fail (NM_IS_VPN_CONNECTION (connection)); + + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_FAILED, + reason); +} + +void +nm_vpn_connection_disconnect (NMVPNConnection *connection, + NMVPNConnectionStateReason reason) +{ + g_return_if_fail (NM_IS_VPN_CONNECTION (connection)); + + nm_vpn_connection_set_vpn_state (connection, + NM_VPN_CONNECTION_STATE_DISCONNECTED, + reason); +} + +/******************************************************************************/ + +static gboolean +secrets_update_setting (NMSecretsProviderInterface *interface, + const char *setting_name, + GHashTable *new) +{ + NMVPNConnection *self = NM_VPN_CONNECTION (interface); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self); + GError *error = NULL; + + g_return_val_if_fail (priv->connection != NULL, FALSE); + + if (strcmp (setting_name, NM_SETTING_VPN_SETTING_NAME)) + return FALSE; + + if (!nm_connection_update_secrets (priv->connection, NM_SETTING_VPN_SETTING_NAME, new, &error)) { + nm_log_warn (LOGD_VPN, "Failed to update VPN secrets: %d %s", + error ? error->code : -1, + error && error->message ? error->message : "(none)"); + g_clear_error (&error); + return FALSE; + } + return TRUE; +} + +static void +secrets_result (NMSecretsProviderInterface *interface, + const char *setting_name, + RequestSecretsCaller caller, + const GSList *updated, + GError *error) +{ + NMVPNConnection *self = NM_VPN_CONNECTION (interface); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self); + + g_return_if_fail (priv->connection != NULL); + g_return_if_fail (caller == SECRETS_CALLER_VPN); + + if (error) + nm_vpn_connection_fail (self, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS); + else + really_activate (self); +} + +static void +secrets_provider_interface_init (NMSecretsProviderInterface *sp_interface_class) +{ + /* interface implementation */ + sp_interface_class->update_setting = secrets_update_setting; + sp_interface_class->result = secrets_result; +} + +static void +connection_need_secrets_cb (DBusGProxy *proxy, + char *setting_name, + GError *error, + gpointer user_data) +{ + NMVPNConnection *self = NM_VPN_CONNECTION (user_data); + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (self); + + if (error) { + nm_log_err (LOGD_VPN, "NeedSecrets failed: %s %s", + g_quark_to_string (error->domain), + error->message); + nm_vpn_connection_fail (self, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS); + return; + } + + if (!setting_name || !strlen (setting_name)) { + /* No secrets required */ + really_activate (self); + return; + } + + /* Get the secrets the VPN plugin wants */ + if (!nm_secrets_provider_interface_get_secrets (NM_SECRETS_PROVIDER_INTERFACE (self), + priv->connection, + setting_name, + FALSE, + SECRETS_CALLER_VPN, + NULL, + NULL)) + nm_vpn_connection_fail (self, NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS); +} + +static void +call_need_secrets (NMVPNConnection *vpn_connection) +{ + NMVPNConnectionPrivate *priv; + GHashTable *settings; + + priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn_connection); + settings = nm_connection_to_hash (priv->connection); + org_freedesktop_NetworkManager_VPN_Plugin_need_secrets_async (priv->proxy, + settings, + connection_need_secrets_cb, + vpn_connection); + g_hash_table_destroy (settings); +} + +static void +vpn_cleanup (NMVPNConnection *connection) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + if (priv->tundev) { + nm_system_device_set_up_down_with_iface (priv->tundev, FALSE, NULL); + /* FIXME: use AF_UNSPEC here when we have IPv6 support */ + nm_system_device_flush_routes_with_iface (priv->tundev, AF_INET); + nm_system_device_flush_addresses_with_iface (priv->tundev); + } + + if (priv->ip4_config) { + NMIP4Config *parent_config; + NMNamedManager *named_mgr; + + /* Remove attributes of the VPN's IP4 Config */ + named_mgr = nm_named_manager_get (); + nm_named_manager_remove_ip4_config (named_mgr, priv->tundev, priv->ip4_config); + g_object_unref (named_mgr); + + /* Remove any previously added VPN gateway host route */ + if (priv->gw_route) + rtnl_route_del (nm_netlink_get_default_handle (), priv->gw_route, 0); + + /* Reset routes and addresses of the currently active device */ + parent_config = nm_device_get_ip4_config (priv->parent_dev); + if (parent_config) { + if (!nm_system_apply_ip4_config (nm_device_get_ip_iface (priv->parent_dev), + nm_device_get_ip4_config (priv->parent_dev), + nm_device_get_priority (priv->parent_dev), + NM_IP4_COMPARE_FLAG_ADDRESSES | NM_IP4_COMPARE_FLAG_ROUTES)) { + nm_log_err (LOGD_VPN, "failed to re-apply VPN parent device addresses and routes."); + } + } + } + + if (priv->gw_route) { + rtnl_route_put (priv->gw_route); + priv->gw_route = NULL; + } + + if (priv->banner) { + g_free (priv->banner); + priv->banner = NULL; + } + + if (priv->tundev) { + g_free (priv->tundev); + priv->tundev = NULL; + } + + /* Clear out connection secrets to ensure that the settings service + * gets asked for them next time the connection is activated. + */ + if (priv->connection) + nm_connection_clear_secrets (priv->connection); +} + +static void +connection_state_changed (NMVPNConnection *connection, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + + nm_secrets_provider_interface_cancel_get_secrets (NM_SECRETS_PROVIDER_INTERFACE (priv->act_request)); + + switch (state) { + case NM_VPN_CONNECTION_STATE_NEED_AUTH: + call_need_secrets (connection); + break; + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + case NM_VPN_CONNECTION_STATE_FAILED: + if (priv->proxy) { + GError *err = NULL; + + org_freedesktop_NetworkManager_VPN_Plugin_disconnect (priv->proxy, &err); + if (err) { + nm_log_warn (LOGD_VPN, "error disconnecting VPN: %s", err->message); + g_error_free (err); + } + + g_object_unref (priv->proxy); + priv->proxy = NULL; + } + vpn_cleanup (connection); + break; + default: + break; + } +} + +static void +nm_vpn_connection_init (NMVPNConnection *connection) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection); + NMDBusManager *dbus_mgr; + + priv->state = NM_ACTIVE_CONNECTION_STATE_UNKNOWN; + priv->vpn_state = NM_VPN_CONNECTION_STATE_PREPARE; + priv->ac_path = nm_active_connection_get_next_object_path (); + + dbus_mgr = nm_dbus_manager_get (); + dbus_g_connection_register_g_object (nm_dbus_manager_get_connection (dbus_mgr), + priv->ac_path, + G_OBJECT (connection)); + g_object_unref (dbus_mgr); +} + +static void +dispose (GObject *object) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object); + + if (priv->disposed) { + G_OBJECT_CLASS (nm_vpn_connection_parent_class)->dispose (object); + return; + } + priv->disposed = TRUE; + + if (priv->gw_route) + rtnl_route_put (priv->gw_route); + + if (priv->device_ip4) + g_signal_handler_disconnect (priv->parent_dev, priv->device_ip4); + + if (priv->device_monitor) + g_signal_handler_disconnect (priv->parent_dev, priv->device_monitor); + + g_object_unref (priv->parent_dev); + + if (priv->ip4_config) + g_object_unref (priv->ip4_config); + + if (priv->ipconfig_timeout) + g_source_remove (priv->ipconfig_timeout); + + if (priv->proxy) + g_object_unref (priv->proxy); + + g_object_unref (priv->act_request); + g_object_unref (priv->connection); + + G_OBJECT_CLASS (nm_vpn_connection_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object); + + g_free (priv->banner); + g_free (priv->tundev); + g_free (priv->ac_path); + + G_OBJECT_CLASS (nm_vpn_connection_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_SERVICE_NAME: + nm_active_connection_scope_to_value (priv->connection, value); + break; + case PROP_CONNECTION: + g_value_set_boxed (value, nm_connection_get_path (priv->connection)); + break; + case PROP_SPECIFIC_OBJECT: + g_value_set_boxed (value, nm_act_request_get_active_connection_path (priv->act_request)); + break; + case PROP_DEVICES: + g_value_take_boxed (value, g_ptr_array_new ()); + break; + case PROP_STATE: + g_value_set_uint (value, priv->state); + break; + case PROP_DEFAULT: + g_value_set_boolean (value, priv->is_default); + break; + case PROP_DEFAULT6: + g_value_set_boolean (value, priv->is_default6); + break; + case PROP_VPN: + g_value_set_boolean (value, TRUE); + break; + case PROP_VPN_STATE: + g_value_set_uint (value, priv->vpn_state); + break; + case PROP_BANNER: + g_value_set_string (value, priv->banner ? priv->banner : ""); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_vpn_connection_class_init (NMVPNConnectionClass *connection_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (connection_class); + + g_type_class_add_private (connection_class, sizeof (NMVPNConnectionPrivate)); + + /* virtual methods */ + connection_class->vpn_state_changed = connection_state_changed; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + /* properties */ + g_object_class_install_property + (object_class, PROP_SERVICE_NAME, + g_param_spec_string (NM_ACTIVE_CONNECTION_SERVICE_NAME, + "Service name", + "Service name", + NULL, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_CONNECTION, + g_param_spec_boxed (NM_ACTIVE_CONNECTION_CONNECTION, + "Connection", + "Connection", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_SPECIFIC_OBJECT, + g_param_spec_boxed (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, + "Specific object", + "Specific object", + DBUS_TYPE_G_OBJECT_PATH, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DEVICES, + g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, + "Devices", + "Devices", + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_STATE, + g_param_spec_uint (NM_ACTIVE_CONNECTION_STATE, + "State", + "State", + NM_ACTIVE_CONNECTION_STATE_UNKNOWN, + NM_ACTIVE_CONNECTION_STATE_ACTIVATED, + NM_ACTIVE_CONNECTION_STATE_UNKNOWN, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DEFAULT, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, + "Default", + "Is the default IPv4 active connection", + FALSE, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_DEFAULT6, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, + "Default6", + "Is the default IPv6 active connection", + FALSE, + G_PARAM_READABLE)); + g_object_class_install_property + (object_class, PROP_VPN, + g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN, + "VPN", + "Is a VPN connection", + TRUE, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_VPN_STATE, + g_param_spec_uint (NM_VPN_CONNECTION_VPN_STATE, + "VpnState", + "Current VPN state", + NM_VPN_CONNECTION_STATE_UNKNOWN, + NM_VPN_CONNECTION_STATE_DISCONNECTED, + NM_VPN_CONNECTION_STATE_UNKNOWN, + G_PARAM_READABLE)); + + g_object_class_install_property + (object_class, PROP_BANNER, + g_param_spec_string (NM_VPN_CONNECTION_BANNER, + "Banner", + "Login Banner", + NULL, + G_PARAM_READABLE)); + + /* signals */ + signals[VPN_STATE_CHANGED] = + g_signal_new ("vpn-state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNConnectionClass, vpn_state_changed), + NULL, NULL, + _nm_marshal_VOID__UINT_UINT, + G_TYPE_NONE, 2, + G_TYPE_UINT, G_TYPE_UINT); + + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMVPNConnectionClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (object_class), + &dbus_glib_nm_vpn_connection_object_info); +} + diff --git a/src/vpn-manager/nm-vpn-connection.h b/src/vpn-manager/nm-vpn-connection.h new file mode 100644 index 00000000..d69674db --- /dev/null +++ b/src/vpn-manager/nm-vpn-connection.h @@ -0,0 +1,78 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef NM_VPN_CONNECTION_H +#define NM_VPN_CONNECTION_H + +#include +#include +#include "NetworkManagerVPN.h" +#include "nm-device.h" +#include "nm-activation-request.h" +#include "nm-secrets-provider-interface.h" + +#define NM_TYPE_VPN_CONNECTION (nm_vpn_connection_get_type ()) +#define NM_VPN_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_CONNECTION, NMVPNConnection)) +#define NM_VPN_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_CONNECTION, NMVPNConnectionClass)) +#define NM_IS_VPN_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_CONNECTION)) +#define NM_IS_VPN_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_VPN_CONNECTION)) +#define NM_VPN_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_CONNECTION, NMVPNConnectionClass)) + +#define NM_VPN_CONNECTION_VPN_STATE "vpn-state" +#define NM_VPN_CONNECTION_BANNER "banner" + +typedef struct { + GObject parent; +} NMVPNConnection; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*vpn_state_changed) (NMVPNConnection *connection, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason); + + void (*properties_changed) (NMVPNConnection *connection, GHashTable *properties); +} NMVPNConnectionClass; + +GType nm_vpn_connection_get_type (void); + +NMVPNConnection * nm_vpn_connection_new (NMConnection *connection, + NMActRequest *act_request, + NMDevice *parent_device); + +void nm_vpn_connection_activate (NMVPNConnection *connection); +NMConnection * nm_vpn_connection_get_connection (NMVPNConnection *connection); +const char * nm_vpn_connection_get_active_connection_path (NMVPNConnection *connection); +const char * nm_vpn_connection_get_name (NMVPNConnection *connection); +NMVPNConnectionState nm_vpn_connection_get_vpn_state (NMVPNConnection *connection); +const char * nm_vpn_connection_get_banner (NMVPNConnection *connection); +void nm_vpn_connection_fail (NMVPNConnection *connection, + NMVPNConnectionStateReason reason); +void nm_vpn_connection_disconnect (NMVPNConnection *connection, + NMVPNConnectionStateReason reason); +NMIP4Config * nm_vpn_connection_get_ip4_config (NMVPNConnection *connection); +const char * nm_vpn_connection_get_ip_iface (NMVPNConnection *connection); +NMDevice * nm_vpn_connection_get_parent_device (NMVPNConnection *connection); +guint32 nm_vpn_connection_get_ip4_internal_gateway (NMVPNConnection *connection); + +#endif /* NM_VPN_CONNECTION_H */ diff --git a/src/vpn-manager/nm-vpn-manager.c b/src/vpn-manager/nm-vpn-manager.c new file mode 100644 index 00000000..221a8b54 --- /dev/null +++ b/src/vpn-manager/nm-vpn-manager.c @@ -0,0 +1,369 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#include + +#include "nm-vpn-manager.h" +#include "nm-vpn-service.h" +#include "nm-vpn-connection.h" +#include "nm-setting-vpn.h" +#include "nm-dbus-manager.h" +#include "NetworkManagerVPN.h" +#include "nm-marshal.h" + +G_DEFINE_TYPE (NMVPNManager, nm_vpn_manager, G_TYPE_OBJECT) + +#define NM_VPN_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_MANAGER, NMVPNManagerPrivate)) + +typedef struct { + GSList *services; +} NMVPNManagerPrivate; + +enum { + CONNECTION_ACTIVATED, + CONNECTION_DEACTIVATED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +GQuark +nm_vpn_manager_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string ("nm-vpn-manager-error"); + return quark; +} + +/* This should really be standard. */ +#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } + +GType +nm_vpn_manager_error_get_type (void) +{ + static GType etype = 0; + + if (etype == 0) { + static const GEnumValue values[] = { + /* The base device for the VPN connection is not active. */ + ENUM_ENTRY (NM_VPN_MANAGER_ERROR_DEVICE_NOT_ACTIVE, "BaseDeviceNotActive"), + /* The requested VPN connection was invalid. */ + ENUM_ENTRY (NM_VPN_MANAGER_ERROR_CONNECTION_INVALID, "ConnectionInvalid"), + /* The VPN service required by this VPN connection did not exist or was invalid. */ + ENUM_ENTRY (NM_VPN_MANAGER_ERROR_SERVICE_INVALID, "ServiceInvalid"), + /* The VPN service required by this VPN connection could not be started. */ + ENUM_ENTRY (NM_VPN_MANAGER_ERROR_SERVICE_START_FAILED, "ServiceStartFailed"), + { 0, 0, 0 } + }; + etype = g_enum_register_static ("NMVPNManagerError", values); + } + return etype; +} + + + +static NMVPNService * +nm_vpn_manager_get_service (NMVPNManager *manager, const char *service_name) +{ + GSList *iter; + + for (iter = NM_VPN_MANAGER_GET_PRIVATE (manager)->services; iter; iter = iter->next) { + NMVPNService *service = NM_VPN_SERVICE (iter->data); + + if (!strcmp (service_name, nm_vpn_service_get_name (service))) + return g_object_ref (service); + } + + return NULL; +} + +static void +remove_service (gpointer data, GObject *service) +{ + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (data); + + priv->services = g_slist_remove (priv->services, service); +} + +static void +nm_vpn_manager_add_service (NMVPNManager *manager, NMVPNService *service) +{ + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (manager); + + priv->services = g_slist_prepend (priv->services, service); + g_object_weak_ref (G_OBJECT (service), remove_service, manager); +} + +static NMVPNConnection * +find_active_vpn_connection_by_connection (NMVPNManager *manager, NMConnection *connection) +{ + NMVPNManagerPrivate *priv; + GSList *iter; + + g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + priv = NM_VPN_MANAGER_GET_PRIVATE (manager); + for (iter = priv->services; iter; iter = g_slist_next (iter)) { + GSList *connections, *elt; + + connections = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + for (elt = connections; elt; elt = g_slist_next (elt)) { + NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); + + if (nm_vpn_connection_get_connection (vpn) == connection) + return vpn; + } + } + return NULL; +} + +static void +connection_vpn_state_changed (NMVPNConnection *connection, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason, + gpointer user_data) +{ + NMVPNManager *manager = NM_VPN_MANAGER (user_data); + + switch (state) { + case NM_VPN_CONNECTION_STATE_ACTIVATED: + g_signal_emit (manager, signals[CONNECTION_ACTIVATED], 0, connection); + break; + case NM_VPN_CONNECTION_STATE_FAILED: + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + g_signal_emit (manager, signals[CONNECTION_DEACTIVATED], 0, connection, state, reason); + break; + default: + break; + } +} + +NMVPNConnection * +nm_vpn_manager_activate_connection (NMVPNManager *manager, + NMConnection *connection, + NMActRequest *act_request, + NMDevice *device, + GError **error) +{ + NMSettingVPN *vpn_setting; + NMVPNService *service; + NMVPNConnection *vpn = NULL; + const char *service_type; + + g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + g_return_val_if_fail (NM_IS_ACT_REQUEST (act_request), NULL); + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail (*error == NULL, NULL); + + if (nm_device_get_state (device) != NM_DEVICE_STATE_ACTIVATED) { + g_set_error (error, + NM_VPN_MANAGER_ERROR, NM_VPN_MANAGER_ERROR_DEVICE_NOT_ACTIVE, + "%s", "The base device for the VPN connection was not active."); + return NULL; + } + + vpn_setting = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); + if (!vpn_setting) { + g_set_error (error, + NM_VPN_MANAGER_ERROR, NM_VPN_MANAGER_ERROR_CONNECTION_INVALID, + "%s", "The connection was not a VPN connection."); + return NULL; + } + + vpn = find_active_vpn_connection_by_connection (manager, connection); + if (vpn) { + nm_vpn_connection_disconnect (vpn, NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED); + vpn = NULL; + } + + service_type = nm_setting_vpn_get_service_type (vpn_setting); + service = nm_vpn_manager_get_service (manager, service_type); + if (!service) { + service = nm_vpn_service_new (service_type); + if (service) + nm_vpn_manager_add_service (manager, service); + } + + if (service) { + vpn = nm_vpn_service_activate (service, connection, act_request, device, error); + if (vpn) { + g_signal_connect (vpn, "vpn-state-changed", + G_CALLBACK (connection_vpn_state_changed), + manager); + } + } else { + g_set_error (error, + NM_VPN_MANAGER_ERROR, NM_VPN_MANAGER_ERROR_SERVICE_INVALID, + "%s", "The VPN service was invalid."); + } + + return vpn; +} + +gboolean +nm_vpn_manager_deactivate_connection (NMVPNManager *manager, + const char *path, + NMVPNConnectionStateReason reason) +{ + NMVPNManagerPrivate *priv; + GSList *iter; + gboolean found = FALSE; + + g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), FALSE); + g_return_val_if_fail (path != NULL, FALSE); + + priv = NM_VPN_MANAGER_GET_PRIVATE (manager); + for (iter = priv->services; iter; iter = g_slist_next (iter)) { + GSList *connections, *elt; + + connections = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + for (elt = connections; elt; elt = g_slist_next (elt)) { + NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); + const char *vpn_path; + + vpn_path = nm_vpn_connection_get_active_connection_path (vpn); + if (!strcmp (path, vpn_path)) { + nm_vpn_connection_disconnect (vpn, reason); + found = TRUE; + } + } + } + + return found ? TRUE : FALSE; +} + +void +nm_vpn_manager_add_active_connections (NMVPNManager *manager, + NMConnection *filter, + GPtrArray *array) +{ + NMVPNManagerPrivate *priv; + GSList *iter; + + g_return_if_fail (NM_IS_VPN_MANAGER (manager)); + g_return_if_fail (array != NULL); + + priv = NM_VPN_MANAGER_GET_PRIVATE (manager); + for (iter = priv->services; iter; iter = g_slist_next (iter)) { + GSList *active, *elt; + + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + for (elt = active; elt; elt = g_slist_next (elt)) { + NMVPNConnection *vpn = NM_VPN_CONNECTION (elt->data); + const char *path; + + if (!filter || (nm_vpn_connection_get_connection (vpn) == filter)) { + path = nm_vpn_connection_get_active_connection_path (vpn); + g_ptr_array_add (array, g_strdup (path)); + } + } + } +} + +GSList * +nm_vpn_manager_get_active_connections (NMVPNManager *manager) +{ + NMVPNManagerPrivate *priv; + GSList *iter; + GSList *list = NULL; + + g_return_val_if_fail (NM_IS_VPN_MANAGER (manager), NULL); + + priv = NM_VPN_MANAGER_GET_PRIVATE (manager); + for (iter = priv->services; iter; iter = g_slist_next (iter)) { + GSList *active, *elt; + + active = nm_vpn_service_get_active_connections (NM_VPN_SERVICE (iter->data)); + for (elt = active; elt; elt = g_slist_next (elt)) + list = g_slist_append (list, g_object_ref (NM_VPN_CONNECTION (elt->data))); + } + + return list; +} + +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; +} + +/******************************************************************************/ + +static void +nm_vpn_manager_init (NMVPNManager *manager) +{ +} + +static void +finalize (GObject *object) +{ + NMVPNManagerPrivate *priv = NM_VPN_MANAGER_GET_PRIVATE (object); + + g_slist_foreach (priv->services, (GFunc) g_object_unref, NULL); + + G_OBJECT_CLASS (nm_vpn_manager_parent_class)->finalize (object); +} + +static void +nm_vpn_manager_class_init (NMVPNManagerClass *manager_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (manager_class); + + g_type_class_add_private (manager_class, sizeof (NMVPNManagerPrivate)); + + /* virtual methods */ + object_class->finalize = finalize; + + /* signals */ + signals[CONNECTION_ACTIVATED] = + g_signal_new ("connection-activated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, G_TYPE_OBJECT); + + signals[CONNECTION_DEACTIVATED] = + g_signal_new ("connection-deactivated", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVPNManagerClass, connection_deactivated), + NULL, NULL, + _nm_marshal_VOID__OBJECT_UINT_UINT, + G_TYPE_NONE, 3, + G_TYPE_OBJECT, G_TYPE_UINT, G_TYPE_UINT); + + dbus_g_error_domain_register (NM_VPN_MANAGER_ERROR, NULL, NM_TYPE_VPN_MANAGER_ERROR); +} + diff --git a/src/vpn-manager/nm-vpn-manager.h b/src/vpn-manager/nm-vpn-manager.h new file mode 100644 index 00000000..d07aa250 --- /dev/null +++ b/src/vpn-manager/nm-vpn-manager.h @@ -0,0 +1,86 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +#ifndef NM_VPN_MANAGER_H +#define NM_VPN_MANAGER_H + +#include +#include +#include "nm-vpn-connection.h" +#include "nm-activation-request.h" + +#define NM_TYPE_VPN_MANAGER (nm_vpn_manager_get_type ()) +#define NM_VPN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_MANAGER, NMVPNManager)) +#define NM_VPN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_MANAGER, NMVPNManagerClass)) +#define NM_IS_VPN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_MANAGER)) +#define NM_IS_VPN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_VPN_MANAGER)) +#define NM_VPN_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_MANAGER, NMVPNManagerClass)) + +typedef enum +{ + NM_VPN_MANAGER_ERROR_DEVICE_NOT_ACTIVE = 0, + NM_VPN_MANAGER_ERROR_CONNECTION_INVALID, + NM_VPN_MANAGER_ERROR_SERVICE_INVALID, + NM_VPN_MANAGER_ERROR_SERVICE_START_FAILED, +} NMVPNManagerError; + +#define NM_VPN_MANAGER_ERROR (nm_vpn_manager_error_quark ()) +#define NM_TYPE_VPN_MANAGER_ERROR (nm_vpn_manager_error_get_type ()) + +GQuark nm_vpn_manager_error_quark (void); +GType nm_vpn_manager_error_get_type (void); + + +typedef struct { + GObject parent; +} NMVPNManager; + +typedef struct { + GObjectClass parent; + + /* Signals */ + void (*connection_deactivated) (NMVPNManager *manager, + NMVPNConnection *connection, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason); +} NMVPNManagerClass; + +GType nm_vpn_manager_get_type (void); + +NMVPNManager *nm_vpn_manager_get (void); + +NMVPNConnection *nm_vpn_manager_activate_connection (NMVPNManager *manager, + NMConnection *connection, + NMActRequest *act_request, + NMDevice *device, + GError **error); + +gboolean nm_vpn_manager_deactivate_connection (NMVPNManager *manager, + const char *path, + NMVPNConnectionStateReason reason); + +void nm_vpn_manager_add_active_connections (NMVPNManager *manager, + NMConnection *filter, + GPtrArray *list); + +GSList *nm_vpn_manager_get_active_connections (NMVPNManager *manager); + +#endif /* NM_VPN_VPN_MANAGER_H */ diff --git a/src/vpn-manager/nm-vpn-service.c b/src/vpn-manager/nm-vpn-service.c new file mode 100644 index 00000000..bdbb3774 --- /dev/null +++ b/src/vpn-manager/nm-vpn-service.c @@ -0,0 +1,478 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "nm-vpn-service.h" +#include "nm-dbus-manager.h" +#include "nm-logging.h" +#include "nm-vpn-manager.h" +#include "nm-glib-compat.h" + +G_DEFINE_TYPE (NMVPNService, nm_vpn_service, G_TYPE_OBJECT) + +typedef struct { + NMDBusManager *dbus_mgr; + char *name; + char *dbus_service; + char *program; + + GPid pid; + GSList *connections; + guint service_start_timeout; + guint service_child_watch; + gulong name_owner_id; +} NMVPNServicePrivate; + +#define NM_VPN_SERVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_SERVICE, NMVPNServicePrivate)) + +#define VPN_CONNECTION_GROUP "VPN Connection" + +static GKeyFile * +find_service_file (const char *name) +{ + GDir *dir; + const char *fn; + GKeyFile *key_file = NULL; + + dir = g_dir_open (VPN_NAME_FILES_DIR, 0, NULL); + if (!dir) + return NULL; + + while ((fn = g_dir_read_name (dir))) { + char *path; + gboolean found = FALSE; + + /* only parse filenames that end with .name */ + if (!g_str_has_suffix (fn, ".name")) + continue; + + key_file = g_key_file_new (); + path = g_build_filename (VPN_NAME_FILES_DIR, fn, NULL); + + if (g_key_file_load_from_file (key_file, path, G_KEY_FILE_NONE, NULL)) { + gchar *val; + + val = g_key_file_get_string (key_file, VPN_CONNECTION_GROUP, "service", NULL); + if (val) { + if (!strcmp (val, name)) + found = TRUE; + g_free (val); + } + } + + g_free (path); + + if (found) + break; + + g_key_file_free (key_file); + key_file = NULL; + } + + g_dir_close (dir); + + return key_file; +} + +NMVPNService * +nm_vpn_service_new (const char *name) +{ + GKeyFile *key_file; + NMVPNService *service = NULL; + NMVPNServicePrivate *priv; + char *dbus_service = NULL; + char *program = NULL; + gboolean success = FALSE; + + g_return_val_if_fail (name != NULL, NULL); + + key_file = find_service_file (name); + if (!key_file) + return NULL; + + dbus_service = g_key_file_get_string (key_file, VPN_CONNECTION_GROUP, "service", NULL); + if (!dbus_service) + goto out; + + program = g_key_file_get_string (key_file, VPN_CONNECTION_GROUP, "program", NULL); + if (!program) + goto out; + + service = (NMVPNService *) g_object_new (NM_TYPE_VPN_SERVICE, NULL); + if (!service) + goto out; + + priv = NM_VPN_SERVICE_GET_PRIVATE (service); + + priv->name = g_strdup (name); + priv->dbus_service = dbus_service; + priv->program = program; + + success = TRUE; + + out: + g_key_file_free (key_file); + + if (!success) { + g_free (dbus_service); + g_free (program); + } + + return service; +} + +const char * +nm_vpn_service_get_name (NMVPNService *service) +{ + g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL); + + return NM_VPN_SERVICE_GET_PRIVATE (service)->name; +} + +static void +nm_vpn_service_connections_stop (NMVPNService *service, + gboolean fail, + NMVPNConnectionStateReason reason) +{ + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); + GSList *iter, *copy; + + /* Copy because stopping the connection may remove it from the list + * in the the NMVPNService objects' VPN connection state handler. + */ + copy = g_slist_copy (priv->connections); + for (iter = copy; iter; iter = iter->next) { + if (fail) + nm_vpn_connection_fail (NM_VPN_CONNECTION (iter->data), reason); + else + nm_vpn_connection_disconnect (NM_VPN_CONNECTION (iter->data), reason); + } + g_slist_free (copy); +} + +/* + * nm_vpn_service_child_setup + * + * Set the process group ID of the newly forked process + * + */ +static void +nm_vpn_service_child_setup (gpointer user_data G_GNUC_UNUSED) +{ + /* We are in the child process at this point */ + pid_t pid = getpid (); + setpgid (pid, pid); +} + +static void +vpn_service_watch_cb (GPid pid, gint status, gpointer user_data) +{ + NMVPNService *service = NM_VPN_SERVICE (user_data); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); + + if (WIFEXITED (status)) { + guint err = WEXITSTATUS (status); + + if (err != 0) { + nm_log_warn (LOGD_VPN, "VPN service '%s' exited with error: %d", + nm_vpn_service_get_name (service), WSTOPSIG (status)); + } + } else if (WIFSTOPPED (status)) { + nm_log_warn (LOGD_VPN, "VPN service '%s' stopped unexpectedly with signal %d", + nm_vpn_service_get_name (service), WSTOPSIG (status)); + } else if (WIFSIGNALED (status)) { + nm_log_warn (LOGD_VPN, "VPN service '%s' died with signal %d", + nm_vpn_service_get_name (service), WTERMSIG (status)); + } else { + nm_log_warn (LOGD_VPN, "VPN service '%s' died from an unknown cause", + nm_vpn_service_get_name (service)); + } + + priv->pid = 0; + priv->service_child_watch = 0; + + nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); +} + +static gboolean +nm_vpn_service_timeout (gpointer data) +{ + NMVPNService *service = NM_VPN_SERVICE (data); + + nm_log_warn (LOGD_VPN, "VPN service '%s' did not start in time, cancelling connections", + nm_vpn_service_get_name (service)); + + NM_VPN_SERVICE_GET_PRIVATE (service)->service_start_timeout = 0; + nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT); + + return FALSE; +} + +static gboolean +nm_vpn_service_daemon_exec (NMVPNService *service, GError **error) +{ + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); + char *vpn_argv[2]; + gboolean success = FALSE; + GError *spawn_error = NULL; + + g_return_val_if_fail (NM_IS_VPN_SERVICE (service), FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + vpn_argv[0] = priv->program; + vpn_argv[1] = NULL; + + success = g_spawn_async (NULL, vpn_argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, + nm_vpn_service_child_setup, NULL, &priv->pid, + &spawn_error); + if (success) { + nm_log_info (LOGD_VPN, "VPN service '%s' started (%s), PID %d", + nm_vpn_service_get_name (service), priv->dbus_service, priv->pid); + + priv->service_child_watch = g_child_watch_add (priv->pid, vpn_service_watch_cb, service); + priv->service_start_timeout = g_timeout_add_seconds (5, nm_vpn_service_timeout, service); + } else { + nm_log_warn (LOGD_VPN, "VPN service '%s': could not launch the VPN service. error: (%d) %s.", + nm_vpn_service_get_name (service), spawn_error->code, spawn_error->message); + + g_set_error (error, + NM_VPN_MANAGER_ERROR, NM_VPN_MANAGER_ERROR_SERVICE_START_FAILED, + "%s", spawn_error ? spawn_error->message : "unknown g_spawn_async() error"); + + nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED); + if (spawn_error) + g_error_free (spawn_error); + } + + return success; +} + +static gboolean +destroy_service (gpointer data) +{ + g_object_unref (data); + + return FALSE; +} + +static void +connection_vpn_state_changed (NMVPNConnection *connection, + NMVPNConnectionState state, + NMVPNConnectionStateReason reason, + gpointer user_data) +{ + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (user_data); + + switch (state) { + case NM_VPN_CONNECTION_STATE_FAILED: + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + /* Remove the connection from our list */ + priv->connections = g_slist_remove (priv->connections, connection); + g_object_unref (connection); + + if (priv->connections == NULL) { + /* schedule a timeout (10 seconds) to destroy the service */ + g_timeout_add_seconds (10, destroy_service, user_data); + } + break; + default: + break; + } +} + +NMVPNConnection * +nm_vpn_service_activate (NMVPNService *service, + NMConnection *connection, + NMActRequest *act_request, + NMDevice *device, + GError **error) +{ + NMVPNConnection *vpn; + NMVPNServicePrivate *priv; + + g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL); + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + g_return_val_if_fail (NM_IS_ACT_REQUEST (act_request), NULL); + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail (*error == NULL, NULL); + + priv = NM_VPN_SERVICE_GET_PRIVATE (service); + + vpn = nm_vpn_connection_new (connection, act_request, device); + g_signal_connect (vpn, "vpn-state-changed", + G_CALLBACK (connection_vpn_state_changed), + service); + + priv->connections = g_slist_prepend (priv->connections, vpn); + + if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, priv->dbus_service)) { + // FIXME: fill in error when errors happen + nm_vpn_connection_activate (vpn); + } else if (priv->service_start_timeout == 0) { + nm_log_info (LOGD_VPN, "Starting VPN service '%s'...", + nm_vpn_service_get_name (service)); + if (!nm_vpn_service_daemon_exec (service, error)) + vpn = NULL; + } + + return vpn; +} + +GSList * +nm_vpn_service_get_active_connections (NMVPNService *service) +{ + g_return_val_if_fail (NM_IS_VPN_SERVICE (service), NULL); + + return g_slist_copy (NM_VPN_SERVICE_GET_PRIVATE (service)->connections); +} + +static void +nm_vpn_service_name_owner_changed (NMDBusManager *mgr, + const char *name, + const char *old, + const char *new, + gpointer user_data) +{ + NMVPNService *service = NM_VPN_SERVICE (user_data); + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); + gboolean old_owner_good; + gboolean new_owner_good; + + if (strcmp (name, priv->dbus_service)) + return; + + /* Service changed, no need to wait for the timeout any longer */ + if (priv->service_start_timeout) { + g_source_remove (priv->service_start_timeout); + priv->service_start_timeout = 0; + } + + old_owner_good = (old && (strlen (old) > 0)); + new_owner_good = (new && (strlen (new) > 0)); + + if (!old_owner_good && new_owner_good) { + /* service just appeared */ + GSList *iter; + + nm_log_info (LOGD_VPN, "VPN service '%s' appeared, activating connections", + nm_vpn_service_get_name (service)); + + for (iter = priv->connections; iter; iter = iter->next) + nm_vpn_connection_activate (NM_VPN_CONNECTION (iter->data)); + + } else if (old_owner_good && !new_owner_good) { + /* service went away */ + nm_log_info (LOGD_VPN, "VPN service '%s' disappeared, cancelling connections", + nm_vpn_service_get_name (service)); + nm_vpn_service_connections_stop (service, TRUE, NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); + } +} + +/******************************************************************************/ + +static void +nm_vpn_service_init (NMVPNService *service) +{ + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (service); + + priv->dbus_mgr = nm_dbus_manager_get (); + + priv->name_owner_id = g_signal_connect (priv->dbus_mgr, "name-owner-changed", + G_CALLBACK (nm_vpn_service_name_owner_changed), + service); +} + +static gboolean +ensure_killed (gpointer data) +{ + int pid = GPOINTER_TO_INT (data); + + if (kill (pid, 0) == 0) + kill (pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_VPN, "waiting for VPN service pid %d to exit", pid); + waitpid (pid, NULL, 0); + nm_log_dbg (LOGD_VPN, "VPN service pid %d cleaned up", pid); + + return FALSE; +} + +static void +finalize (GObject *object) +{ + NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (object); + + if (priv->service_start_timeout) + g_source_remove (priv->service_start_timeout); + + nm_vpn_service_connections_stop (NM_VPN_SERVICE (object), + FALSE, + NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED); + + g_signal_handler_disconnect (priv->dbus_mgr, priv->name_owner_id); + + if (priv->service_child_watch) + g_source_remove (priv->service_child_watch); + + if (priv->pid) { + if (kill (priv->pid, SIGTERM) == 0) + g_timeout_add_seconds (2, ensure_killed, GINT_TO_POINTER (priv->pid)); + else { + kill (priv->pid, SIGKILL); + + /* ensure the child is reaped */ + nm_log_dbg (LOGD_VPN, "waiting for VPN service pid %d to exit", priv->pid); + waitpid (priv->pid, NULL, 0); + nm_log_dbg (LOGD_VPN, "VPN service pid %d cleaned up", priv->pid); + } + + priv->pid = 0; + } + + g_object_unref (priv->dbus_mgr); + + g_free (priv->name); + g_free (priv->dbus_service); + g_free (priv->program); + + G_OBJECT_CLASS (nm_vpn_service_parent_class)->finalize (object); +} + +static void +nm_vpn_service_class_init (NMVPNServiceClass *service_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (service_class); + + g_type_class_add_private (service_class, sizeof (NMVPNServicePrivate)); + + /* virtual methods */ + object_class->finalize = finalize; +} diff --git a/src/vpn-manager/nm-vpn-service.h b/src/vpn-manager/nm-vpn-service.h new file mode 100644 index 00000000..9c5e0eef --- /dev/null +++ b/src/vpn-manager/nm-vpn-service.h @@ -0,0 +1,60 @@ +/* -*- 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) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2008 Novell, Inc. + */ + +#ifndef NM_VPN_SERVICE_H +#define NM_VPN_SERVICE_H + +#include +#include +#include "nm-device.h" +#include "nm-vpn-connection.h" +#include "nm-activation-request.h" + +#define NM_TYPE_VPN_SERVICE (nm_vpn_service_get_type ()) +#define NM_VPN_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_SERVICE, NMVPNService)) +#define NM_VPN_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_SERVICE, NMVPNServiceClass)) +#define NM_IS_VPN_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_SERVICE)) +#define NM_IS_VPN_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_VPN_SERVICE)) +#define NM_VPN_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_SERVICE, NMVPNServiceClass)) + +typedef struct { + GObject parent; +} NMVPNService; + +typedef struct { + GObjectClass parent; +} NMVPNServiceClass; + +GType nm_vpn_service_get_type (void); + +NMVPNService * nm_vpn_service_new (const char *service_name); + +const char * nm_vpn_service_get_name (NMVPNService *service); + +NMVPNConnection * nm_vpn_service_activate (NMVPNService *service, + NMConnection *connection, + NMActRequest *act_request, + NMDevice *device, + GError **error); + +GSList * nm_vpn_service_get_active_connections (NMVPNService *service); + +#endif /* NM_VPN_VPN_SERVICE_H */ diff --git a/src/wpa.c b/src/wpa.c new file mode 100644 index 00000000..5f4fd024 --- /dev/null +++ b/src/wpa.c @@ -0,0 +1,455 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * WPA Supplicant - WPA state machine and EAPOL-Key processing + * Copyright (c) 2003-2005, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this file may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#include "wireless-helper.h" + +#include +#include +#include + +#include "wpa.h" +#include "nm-logging.h" + +typedef guint16 u16; +typedef guint8 u8; + +#define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) + +#define BIT(n) (1 << (n)) +#define WPA_CAPABILITY_PREAUTH BIT(0) + +#define WPA_REPLAY_COUNTER_LEN 8 +#define WPA_NONCE_LEN 32 + +#define PMKID_LEN 16 + +static const int WPA_SELECTOR_LEN = 4; +static const u8 WPA_OUI_TYPE[] = { 0x00, 0x50, 0xf2, 1 }; +static const u16 WPA_VERSION = 1; +static const u8 WPA_AUTH_KEY_MGMT_NONE[] = { 0x00, 0x50, 0xf2, 0 }; +static const u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[] = { 0x00, 0x50, 0xf2, 1 }; +static const u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[] = { 0x00, 0x50, 0xf2, 2 }; +static const u8 WPA_CIPHER_SUITE_NONE[] = { 0x00, 0x50, 0xf2, 0 }; +static const u8 WPA_CIPHER_SUITE_WEP40[] = { 0x00, 0x50, 0xf2, 1 }; +static const u8 WPA_CIPHER_SUITE_TKIP[] = { 0x00, 0x50, 0xf2, 2 }; +static const u8 WPA_CIPHER_SUITE_WRAP[] = { 0x00, 0x50, 0xf2, 3 }; +static const u8 WPA_CIPHER_SUITE_CCMP[] = { 0x00, 0x50, 0xf2, 4 }; +static const u8 WPA_CIPHER_SUITE_WEP104[] = { 0x00, 0x50, 0xf2, 5 }; + +/* WPA IE version 1 + * 00-50-f2:1 (OUI:OUI type) + * 0x01 0x00 (version; little endian) + * (all following fields are optional:) + * Group Suite Selector (4 octets) (default: TKIP) + * Pairwise Suite Count (2 octets, little endian) (default: 1) + * Pairwise Suite List (4 * n octets) (default: TKIP) + * Authenticated Key Management Suite Count (2 octets, little endian) + * (default: 1) + * Authenticated Key Management Suite List (4 * n octets) + * (default: unspec 802.1X) + * WPA Capabilities (2 octets, little endian) (default: 0) + */ + +struct wpa_ie_hdr { + u8 elem_id; + u8 len; + u8 oui[3]; + u8 oui_type; + u8 version[2]; +} __attribute__ ((packed)); + + +static const int RSN_SELECTOR_LEN = 4; +static const u16 RSN_VERSION = 1; +static const u8 RSN_AUTH_KEY_MGMT_UNSPEC_802_1X[] = { 0x00, 0x0f, 0xac, 1 }; +static const u8 RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X[] = { 0x00, 0x0f, 0xac, 2 }; +static const u8 RSN_CIPHER_SUITE_NONE[] = { 0x00, 0x0f, 0xac, 0 }; +static const u8 RSN_CIPHER_SUITE_WEP40[] = { 0x00, 0x0f, 0xac, 1 }; +static const u8 RSN_CIPHER_SUITE_TKIP[] = { 0x00, 0x0f, 0xac, 2 }; +static const u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 }; +static const u8 RSN_CIPHER_SUITE_CCMP[] = { 0x00, 0x0f, 0xac, 4 }; +static const u8 RSN_CIPHER_SUITE_WEP104[] = { 0x00, 0x0f, 0xac, 5 }; + +/* EAPOL-Key Key Data Encapsulation + * GroupKey and STAKey require encryption, otherwise, encryption is optional. + */ +static const u8 RSN_KEY_DATA_GROUPKEY[] = { 0x00, 0x0f, 0xac, 1 }; +static const u8 RSN_KEY_DATA_STAKEY[] = { 0x00, 0x0f, 0xac, 2 }; +static const u8 RSN_KEY_DATA_MAC_ADDR[] = { 0x00, 0x0f, 0xac, 3 }; +static const u8 RSN_KEY_DATA_PMKID[] = { 0x00, 0x0f, 0xac, 4 }; + +/* RSN IE version 1 + * 0x01 0x00 (version; little endian) + * (all following fields are optional:) + * Group Suite Selector (4 octets) (default: CCMP) + * Pairwise Suite Count (2 octets, little endian) (default: 1) + * Pairwise Suite List (4 * n octets) (default: CCMP) + * Authenticated Key Management Suite Count (2 octets, little endian) + * (default: 1) + * Authenticated Key Management Suite List (4 * n octets) + * (default: unspec 802.1X) + * RSN Capabilities (2 octets, little endian) (default: 0) + * PMKID Count (2 octets) (default: 0) + * PMKID List (16 * n octets) + */ + +struct rsn_ie_hdr { + u8 elem_id; /* WLAN_EID_RSN */ + u8 len; + u8 version[2]; +} __attribute__ ((packed)); + + +#define WPA_KEY_INFO_TYPE_MASK (BIT(0) | BIT(1) | BIT(2)) +#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 BIT(0) +#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES BIT(1) +#define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */ +/* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */ +#define WPA_KEY_INFO_KEY_INDEX_MASK (BIT(4) | BIT(5)) +#define WPA_KEY_INFO_KEY_INDEX_SHIFT 4 +#define WPA_KEY_INFO_INSTALL BIT(6) /* pairwise */ +#define WPA_KEY_INFO_TXRX BIT(6) /* group */ +#define WPA_KEY_INFO_ACK BIT(7) +#define WPA_KEY_INFO_MIC BIT(8) +#define WPA_KEY_INFO_SECURE BIT(9) +#define WPA_KEY_INFO_ERROR BIT(10) +#define WPA_KEY_INFO_REQUEST BIT(11) +#define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12) /* IEEE 802.11i/RSN only */ + + + +static int wpa_selector_to_bitfield(const u8 *s) +{ + if (memcmp(s, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_NONE; + if (memcmp(s, WPA_CIPHER_SUITE_WEP40, WPA_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_WEP40; + if (memcmp(s, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_TKIP; + if (memcmp(s, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_CCMP; + if (memcmp(s, WPA_CIPHER_SUITE_WEP104, WPA_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_WEP104; + return 0; +} + + +static int wpa_key_mgmt_to_bitfield(const u8 *s) +{ + if (memcmp(s, WPA_AUTH_KEY_MGMT_UNSPEC_802_1X, WPA_SELECTOR_LEN) == 0) + return IW_AUTH_KEY_MGMT_802_1X; + if (memcmp(s, WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X, WPA_SELECTOR_LEN) == + 0) + return IW_AUTH_KEY_MGMT_PSK; + if (memcmp(s, WPA_AUTH_KEY_MGMT_NONE, WPA_SELECTOR_LEN) == 0) + return 0; + return 0; +} + + +static int rsn_selector_to_bitfield(const u8 *s) +{ + if (memcmp(s, RSN_CIPHER_SUITE_NONE, RSN_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_NONE; + if (memcmp(s, RSN_CIPHER_SUITE_WEP40, RSN_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_WEP40; + if (memcmp(s, RSN_CIPHER_SUITE_TKIP, RSN_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_TKIP; + if (memcmp(s, RSN_CIPHER_SUITE_CCMP, RSN_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_CCMP; + if (memcmp(s, RSN_CIPHER_SUITE_WEP104, RSN_SELECTOR_LEN) == 0) + return IW_AUTH_CIPHER_WEP104; + return 0; +} + + +static int rsn_key_mgmt_to_bitfield(const u8 *s) +{ + if (memcmp(s, RSN_AUTH_KEY_MGMT_UNSPEC_802_1X, RSN_SELECTOR_LEN) == 0) + return IW_AUTH_KEY_MGMT_802_1X; + if (memcmp(s, RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X, RSN_SELECTOR_LEN) == + 0) + return IW_AUTH_KEY_MGMT_PSK; + return 0; +} + + +static int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len, + struct wpa_ie_data *data) +{ + const struct wpa_ie_hdr *hdr; + const u8 *pos; + int left; + int i, count; + + data->proto = IW_AUTH_WPA_VERSION_WPA; + data->pairwise_cipher = IW_AUTH_CIPHER_TKIP; + data->group_cipher = IW_AUTH_CIPHER_TKIP; + data->key_mgmt = IW_AUTH_KEY_MGMT_802_1X; + data->capabilities = 0; + data->pmkid = NULL; + data->num_pmkid = 0; + + if (wpa_ie_len == 0) { + /* No WPA IE - fail silently */ + return -1; + } + + if (wpa_ie_len < sizeof(struct wpa_ie_hdr)) { + nm_log_dbg (LOGD_WIFI, "IE len too short %lu", + (unsigned long) wpa_ie_len); + return -1; + } + + hdr = (const struct wpa_ie_hdr *) wpa_ie; + + if (hdr->elem_id != WPA_GENERIC_INFO_ELEM || + hdr->len != wpa_ie_len - 2 || + memcmp(hdr->oui, WPA_OUI_TYPE, WPA_SELECTOR_LEN) != 0 || + WPA_GET_LE16(hdr->version) != WPA_VERSION) { + nm_log_dbg (LOGD_WIFI, "malformed IE or unknown version"); + return -1; + } + + pos = (const u8 *) (hdr + 1); + left = wpa_ie_len - sizeof(*hdr); + + if (left >= WPA_SELECTOR_LEN) { + data->group_cipher = wpa_selector_to_bitfield(pos); + pos += WPA_SELECTOR_LEN; + left -= WPA_SELECTOR_LEN; + } else if (left > 0) { + nm_log_dbg (LOGD_WIFI, "IE length mismatch, %u too much", left); + return -1; + } + + if (left >= 2) { + data->pairwise_cipher = 0; + count = WPA_GET_LE16(pos); + pos += 2; + left -= 2; + if (count == 0 || left < count * WPA_SELECTOR_LEN) { + nm_log_dbg (LOGD_WIFI, "IE count botch (pairwise), " + "count %u left %u", count, left); + return -1; + } + for (i = 0; i < count; i++) { + data->pairwise_cipher |= wpa_selector_to_bitfield(pos); + pos += WPA_SELECTOR_LEN; + left -= WPA_SELECTOR_LEN; + } + } else if (left == 1) { + nm_log_dbg (LOGD_WIFI, "IE too short (for key mgmt)"); + return -1; + } + + if (left >= 2) { + data->key_mgmt = 0; + count = WPA_GET_LE16(pos); + pos += 2; + left -= 2; + if (count == 0 || left < count * WPA_SELECTOR_LEN) { + nm_log_dbg (LOGD_WIFI, "IE count botch (key mgmt), " + "count %u left %u", count, left); + return -1; + } + for (i = 0; i < count; i++) { + data->key_mgmt |= wpa_key_mgmt_to_bitfield(pos); + pos += WPA_SELECTOR_LEN; + left -= WPA_SELECTOR_LEN; + } + } else if (left == 1) { + nm_log_dbg (LOGD_WIFI, "IE too short (for capabilities)"); + return -1; + } + + if (left >= 2) { + if (WPA_GET_LE16 (pos) & WPA_CAPABILITY_PREAUTH) + data->capabilities |= IW_PMKID_CAND_PREAUTH; + pos += 2; + left -= 2; + } + + if (left > 0) { + nm_log_dbg (LOGD_WIFI, "IE has %u trailing bytes", left); + return -1; + } + + return 0; +} + + +static int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len, + struct wpa_ie_data *data) +{ + const struct rsn_ie_hdr *hdr; + const u8 *pos; + int left; + int i, count; + + data->proto = IW_AUTH_WPA_VERSION_WPA2; + data->pairwise_cipher = IW_AUTH_CIPHER_CCMP; + data->group_cipher = IW_AUTH_CIPHER_CCMP; + data->key_mgmt = IW_AUTH_KEY_MGMT_802_1X; + data->capabilities = 0; + data->pmkid = NULL; + data->num_pmkid = 0; + + if (rsn_ie_len == 0) { + /* No RSN IE - fail silently */ + return -1; + } + + if (rsn_ie_len < sizeof(struct rsn_ie_hdr)) { + nm_log_dbg (LOGD_WIFI, "IE len too short %lu", + (unsigned long) rsn_ie_len); + return -1; + } + + hdr = (const struct rsn_ie_hdr *) rsn_ie; + + if (hdr->elem_id != WPA_RSN_INFO_ELEM || + hdr->len != rsn_ie_len - 2 || + WPA_GET_LE16(hdr->version) != RSN_VERSION) { + nm_log_dbg (LOGD_WIFI, "malformed IE or unknown version"); + return -1; + } + + pos = (const u8 *) (hdr + 1); + left = rsn_ie_len - sizeof(*hdr); + + if (left >= RSN_SELECTOR_LEN) { + data->group_cipher = rsn_selector_to_bitfield(pos); + pos += RSN_SELECTOR_LEN; + left -= RSN_SELECTOR_LEN; + } else if (left > 0) { + nm_log_dbg (LOGD_WIFI, "IE length mismatch, %u too much", left); + return -1; + } + + if (left >= 2) { + data->pairwise_cipher = 0; + count = WPA_GET_LE16(pos); + pos += 2; + left -= 2; + if (count == 0 || left < count * RSN_SELECTOR_LEN) { + nm_log_dbg (LOGD_WIFI, "IE count botch (pairwise), " + "count %u left %u", count, left); + return -1; + } + for (i = 0; i < count; i++) { + data->pairwise_cipher |= rsn_selector_to_bitfield(pos); + pos += RSN_SELECTOR_LEN; + left -= RSN_SELECTOR_LEN; + } + } else if (left == 1) { + nm_log_dbg (LOGD_WIFI, "IE too short (for key mgmt)"); + return -1; + } + + if (left >= 2) { + data->key_mgmt = 0; + count = WPA_GET_LE16(pos); + pos += 2; + left -= 2; + if (count == 0 || left < count * RSN_SELECTOR_LEN) { + nm_log_dbg (LOGD_WIFI, "IE count botch (key mgmt), " + "count %u left %u", count, left); + return -1; + } + for (i = 0; i < count; i++) { + data->key_mgmt |= rsn_key_mgmt_to_bitfield(pos); + pos += RSN_SELECTOR_LEN; + left -= RSN_SELECTOR_LEN; + } + } else if (left == 1) { + nm_log_dbg (LOGD_WIFI, "IE too short (for capabilities)"); + return -1; + } + + if (left >= 2) { + if (WPA_GET_LE16 (pos) & WPA_CAPABILITY_PREAUTH) + data->capabilities |= IW_PMKID_CAND_PREAUTH; + pos += 2; + left -= 2; + } + + if (left >= 2) { + data->num_pmkid = WPA_GET_LE16(pos); + pos += 2; + left -= 2; + if (left < data->num_pmkid * PMKID_LEN) { + nm_log_dbg (LOGD_WIFI, "PMKID underflow " + "(num_pmkid=%d left=%d)", + data->num_pmkid, left); + data->num_pmkid = 0; + } else { + data->pmkid = pos; + pos += data->num_pmkid * PMKID_LEN; + left -= data->num_pmkid * PMKID_LEN; + } + } + + if (left > 0) { + nm_log_dbg (LOGD_WIFI, "IE has %u trailing bytes - ignored", left); + } + + return 0; +} + + +/** + * wpa_parse_wpa_ie - Parse WPA/RSN IE + * @wpa_ie: Pointer to WPA or RSN IE + * @wpa_ie_len: Length of the WPA/RSN IE + * @data: Pointer to data area for parsing results + * Returns: parsed results on success, NULL on failure + * + * Parse the contents of WPA or RSN IE and write the parsed data into data. + */ +wpa_ie_data * wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len) +{ + wpa_ie_data *data = NULL; + int err = -1; + + if (!wpa_ie || wpa_ie_len <= 0) + return NULL; + + data = g_slice_new0 (wpa_ie_data); + + if (wpa_ie_len >= 1 && wpa_ie[0] == WPA_RSN_INFO_ELEM) + err = wpa_parse_wpa_ie_rsn(wpa_ie, wpa_ie_len, data); + else + err = wpa_parse_wpa_ie_wpa(wpa_ie, wpa_ie_len, data); + + if (err != 0) { + g_slice_free (wpa_ie_data, data); + data = NULL; + } + + if (data) { + nm_log_dbg (LOGD_WIFI, "WPA IE: -------------------"); + nm_log_dbg (LOGD_WIFI, " proto 0x%X", data->proto); + nm_log_dbg (LOGD_WIFI, " pw cipher 0x%X", data->pairwise_cipher); + nm_log_dbg (LOGD_WIFI, " gr cipher 0x%X", data->group_cipher); + nm_log_dbg (LOGD_WIFI, " key mgmt 0x%X", data->key_mgmt); + nm_log_dbg (LOGD_WIFI, " capabilities 0x%X", data->capabilities); + nm_log_dbg (LOGD_WIFI, " # pmkid 0x%X", data->num_pmkid); + nm_log_dbg (LOGD_WIFI, ""); + } + + return data; +} + diff --git a/src/wpa.h b/src/wpa.h new file mode 100644 index 00000000..18d1dbee --- /dev/null +++ b/src/wpa.h @@ -0,0 +1,38 @@ +/* + * wpa_supplicant - WPA definitions + * Copyright (c) 2003-2005, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this file may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +#ifndef WPA_H +#define WPA_H + +#include + +#define WPA_GENERIC_INFO_ELEM 0xdd +#define WPA_RSN_INFO_ELEM 0x30 + +#define WPA_MAX_IE_LEN 40 + +typedef struct wpa_ie_data { + int proto; + int pairwise_cipher; + int group_cipher; + int key_mgmt; + int capabilities; + int num_pmkid; + const uint8_t *pmkid; +} wpa_ie_data; + + +wpa_ie_data * wpa_parse_wpa_ie (const uint8_t *wpa_ie, size_t wpa_ie_len); + +#endif /* WPA_H */ diff --git a/system-settings/Makefile.am b/system-settings/Makefile.am new file mode 100644 index 00000000..67cf8702 --- /dev/null +++ b/system-settings/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS=plugins + diff --git a/system-settings/Makefile.in b/system-settings/Makefile.in new file mode 100644 index 00000000..75861053 --- /dev/null +++ b/system-settings/Makefile.in @@ -0,0 +1,620 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = system-settings +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = plugins +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/Makefile.am b/system-settings/plugins/Makefile.am new file mode 100644 index 00000000..94f75600 --- /dev/null +++ b/system-settings/plugins/Makefile.am @@ -0,0 +1,17 @@ +SUBDIRS=keyfile + +if TARGET_REDHAT +SUBDIRS+=ifcfg-rh +endif + +if TARGET_SUSE +SUBDIRS+=ifcfg-suse +endif + +if TARGET_MANDRIVA +SUBDIRS+=ifcfg-rh +endif + +if TARGET_DEBIAN +SUBDIRS+=ifupdown +endif diff --git a/system-settings/plugins/Makefile.in b/system-settings/plugins/Makefile.in new file mode 100644 index 00000000..49469a0e --- /dev/null +++ b/system-settings/plugins/Makefile.in @@ -0,0 +1,625 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@TARGET_REDHAT_TRUE@am__append_1 = ifcfg-rh +@TARGET_SUSE_TRUE@am__append_2 = ifcfg-suse +@TARGET_MANDRIVA_TRUE@am__append_3 = ifcfg-rh +@TARGET_DEBIAN_TRUE@am__append_4 = ifupdown +subdir = system-settings/plugins +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = keyfile ifcfg-rh ifcfg-suse ifupdown +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = keyfile $(am__append_1) $(am__append_2) $(am__append_3) \ + $(am__append_4) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/ifcfg-rh/Makefile.am b/system-settings/plugins/ifcfg-rh/Makefile.am new file mode 100644 index 00000000..3f0bf222 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/Makefile.am @@ -0,0 +1,76 @@ +SUBDIRS=. tests + +nm-ifcfg-rh-glue.h: nm-ifcfg-rh.xml + dbus-binding-tool --prefix=nm_ifcfg_rh --mode=glib-server --output=$@ $< + +BUILT_SOURCES = \ + nm-ifcfg-rh-glue.h + +pkglib_LTLIBRARIES = libnm-settings-plugin-ifcfg-rh.la + +noinst_LTLIBRARIES = libifcfg-rh-io.la + +libifcfg_rh_io_la_SOURCES = \ + shvar.c \ + shvar.h \ + reader.c \ + reader.h \ + writer.c \ + writer.h \ + errors.c \ + common.h \ + utils.c \ + utils.h + +INCLUDES = \ + -I$(top_srcdir)/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/marshallers + +libifcfg_rh_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(NSS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DSBINDIR=\"$(sbindir)\" + +libifcfg_rh_io_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(NSS_LIBS) + +libnm_settings_plugin_ifcfg_rh_la_SOURCES = \ + plugin.c \ + plugin.h \ + nm-ifcfg-connection.c \ + nm-ifcfg-connection.h + +libnm_settings_plugin_ifcfg_rh_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +libnm_settings_plugin_ifcfg_rh_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_ifcfg_rh_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + libifcfg-rh-io.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GIO_LIBS) + +dbusservicedir = $(DBUS_SYS_DIR) +dbusservice_DATA = nm-ifcfg-rh.conf + +EXTRA_DIST = \ + $(dbusservice_DATA) \ + nm-ifcfg-rh.xml + +CLEANFILES = $(BUILT_SOURCES) + diff --git a/system-settings/plugins/ifcfg-rh/Makefile.in b/system-settings/plugins/ifcfg-rh/Makefile.in new file mode 100644 index 00000000..47794271 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/Makefile.in @@ -0,0 +1,924 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = system-settings/plugins/ifcfg-rh +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" \ + "$(DESTDIR)$(dbusservicedir)" +LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libifcfg_rh_io_la_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libifcfg_rh_io_la_OBJECTS = libifcfg_rh_io_la-shvar.lo \ + libifcfg_rh_io_la-reader.lo libifcfg_rh_io_la-writer.lo \ + libifcfg_rh_io_la-errors.lo libifcfg_rh_io_la-utils.lo +libifcfg_rh_io_la_OBJECTS = $(am_libifcfg_rh_io_la_OBJECTS) +libnm_settings_plugin_ifcfg_rh_la_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + libifcfg-rh-io.la $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libnm_settings_plugin_ifcfg_rh_la_OBJECTS = \ + libnm_settings_plugin_ifcfg_rh_la-plugin.lo \ + libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.lo +libnm_settings_plugin_ifcfg_rh_la_OBJECTS = \ + $(am_libnm_settings_plugin_ifcfg_rh_la_OBJECTS) +libnm_settings_plugin_ifcfg_rh_la_LINK = $(LIBTOOL) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) \ + $(libnm_settings_plugin_ifcfg_rh_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libifcfg_rh_io_la_SOURCES) \ + $(libnm_settings_plugin_ifcfg_rh_la_SOURCES) +DIST_SOURCES = $(libifcfg_rh_io_la_SOURCES) \ + $(libnm_settings_plugin_ifcfg_rh_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +DATA = $(dbusservice_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = . tests +BUILT_SOURCES = \ + nm-ifcfg-rh-glue.h + +pkglib_LTLIBRARIES = libnm-settings-plugin-ifcfg-rh.la +noinst_LTLIBRARIES = libifcfg-rh-io.la +libifcfg_rh_io_la_SOURCES = \ + shvar.c \ + shvar.h \ + reader.c \ + reader.h \ + writer.c \ + writer.h \ + errors.c \ + common.h \ + utils.c \ + utils.h + +INCLUDES = \ + -I$(top_srcdir)/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/libnm-util \ + -I$(top_builddir)/marshallers + +libifcfg_rh_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(NSS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DSBINDIR=\"$(sbindir)\" + +libifcfg_rh_io_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(NSS_LIBS) + +libnm_settings_plugin_ifcfg_rh_la_SOURCES = \ + plugin.c \ + plugin.h \ + nm-ifcfg-connection.c \ + nm-ifcfg-connection.h + +libnm_settings_plugin_ifcfg_rh_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +libnm_settings_plugin_ifcfg_rh_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_ifcfg_rh_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/marshallers/libmarshallers.la \ + libifcfg-rh-io.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GIO_LIBS) + +dbusservicedir = $(DBUS_SYS_DIR) +dbusservice_DATA = nm-ifcfg-rh.conf +EXTRA_DIST = \ + $(dbusservice_DATA) \ + nm-ifcfg-rh.xml + +CLEANFILES = $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/ifcfg-rh/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/ifcfg-rh/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libifcfg-rh-io.la: $(libifcfg_rh_io_la_OBJECTS) $(libifcfg_rh_io_la_DEPENDENCIES) + $(LINK) $(libifcfg_rh_io_la_OBJECTS) $(libifcfg_rh_io_la_LIBADD) $(LIBS) +libnm-settings-plugin-ifcfg-rh.la: $(libnm_settings_plugin_ifcfg_rh_la_OBJECTS) $(libnm_settings_plugin_ifcfg_rh_la_DEPENDENCIES) + $(libnm_settings_plugin_ifcfg_rh_la_LINK) -rpath $(pkglibdir) $(libnm_settings_plugin_ifcfg_rh_la_OBJECTS) $(libnm_settings_plugin_ifcfg_rh_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifcfg_rh_io_la-errors.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifcfg_rh_io_la-reader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifcfg_rh_io_la-shvar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifcfg_rh_io_la-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifcfg_rh_io_la-writer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_ifcfg_rh_la-plugin.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libifcfg_rh_io_la-shvar.lo: shvar.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libifcfg_rh_io_la-shvar.lo -MD -MP -MF $(DEPDIR)/libifcfg_rh_io_la-shvar.Tpo -c -o libifcfg_rh_io_la-shvar.lo `test -f 'shvar.c' || echo '$(srcdir)/'`shvar.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifcfg_rh_io_la-shvar.Tpo $(DEPDIR)/libifcfg_rh_io_la-shvar.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='shvar.c' object='libifcfg_rh_io_la-shvar.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libifcfg_rh_io_la-shvar.lo `test -f 'shvar.c' || echo '$(srcdir)/'`shvar.c + +libifcfg_rh_io_la-reader.lo: reader.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libifcfg_rh_io_la-reader.lo -MD -MP -MF $(DEPDIR)/libifcfg_rh_io_la-reader.Tpo -c -o libifcfg_rh_io_la-reader.lo `test -f 'reader.c' || echo '$(srcdir)/'`reader.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifcfg_rh_io_la-reader.Tpo $(DEPDIR)/libifcfg_rh_io_la-reader.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reader.c' object='libifcfg_rh_io_la-reader.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libifcfg_rh_io_la-reader.lo `test -f 'reader.c' || echo '$(srcdir)/'`reader.c + +libifcfg_rh_io_la-writer.lo: writer.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libifcfg_rh_io_la-writer.lo -MD -MP -MF $(DEPDIR)/libifcfg_rh_io_la-writer.Tpo -c -o libifcfg_rh_io_la-writer.lo `test -f 'writer.c' || echo '$(srcdir)/'`writer.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifcfg_rh_io_la-writer.Tpo $(DEPDIR)/libifcfg_rh_io_la-writer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='writer.c' object='libifcfg_rh_io_la-writer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libifcfg_rh_io_la-writer.lo `test -f 'writer.c' || echo '$(srcdir)/'`writer.c + +libifcfg_rh_io_la-errors.lo: errors.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libifcfg_rh_io_la-errors.lo -MD -MP -MF $(DEPDIR)/libifcfg_rh_io_la-errors.Tpo -c -o libifcfg_rh_io_la-errors.lo `test -f 'errors.c' || echo '$(srcdir)/'`errors.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifcfg_rh_io_la-errors.Tpo $(DEPDIR)/libifcfg_rh_io_la-errors.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='errors.c' object='libifcfg_rh_io_la-errors.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libifcfg_rh_io_la-errors.lo `test -f 'errors.c' || echo '$(srcdir)/'`errors.c + +libifcfg_rh_io_la-utils.lo: utils.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libifcfg_rh_io_la-utils.lo -MD -MP -MF $(DEPDIR)/libifcfg_rh_io_la-utils.Tpo -c -o libifcfg_rh_io_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifcfg_rh_io_la-utils.Tpo $(DEPDIR)/libifcfg_rh_io_la-utils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='libifcfg_rh_io_la-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libifcfg_rh_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libifcfg_rh_io_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c + +libnm_settings_plugin_ifcfg_rh_la-plugin.lo: plugin.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifcfg_rh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_ifcfg_rh_la-plugin.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_ifcfg_rh_la-plugin.Tpo -c -o libnm_settings_plugin_ifcfg_rh_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_ifcfg_rh_la-plugin.Tpo $(DEPDIR)/libnm_settings_plugin_ifcfg_rh_la-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plugin.c' object='libnm_settings_plugin_ifcfg_rh_la-plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifcfg_rh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_ifcfg_rh_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c + +libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.lo: nm-ifcfg-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifcfg_rh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.Tpo -c -o libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.lo `test -f 'nm-ifcfg-connection.c' || echo '$(srcdir)/'`nm-ifcfg-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.Tpo $(DEPDIR)/libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ifcfg-connection.c' object='libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifcfg_rh_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_ifcfg_rh_la-nm-ifcfg-connection.lo `test -f 'nm-ifcfg-connection.c' || echo '$(srcdir)/'`nm-ifcfg-connection.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dbusserviceDATA: $(dbusservice_DATA) + @$(NORMAL_INSTALL) + test -z "$(dbusservicedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusservicedir)" + @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusservicedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusservicedir)" || exit $$?; \ + done + +uninstall-dbusserviceDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(dbusservicedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(dbusservicedir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(LTLIBRARIES) $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(dbusservicedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-pkglibLTLIBRARIES mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dbusserviceDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dbusserviceDATA uninstall-pkglibLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ + ctags-recursive install install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dbusserviceDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-dbusserviceDATA uninstall-pkglibLTLIBRARIES + + +nm-ifcfg-rh-glue.h: nm-ifcfg-rh.xml + dbus-binding-tool --prefix=nm_ifcfg_rh --mode=glib-server --output=$@ $< + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/ifcfg-rh/common.h b/system-settings/plugins/ifcfg-rh/common.h new file mode 100644 index 00000000..f5ab1c89 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/common.h @@ -0,0 +1,49 @@ +/* -*- 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 2008 - 2009 Red Hat, Inc. + */ + +#ifndef __COMMON_H__ +#define __COMMON_H__ + +#include + +#define IFCFG_TAG "ifcfg-" +#define KEYS_TAG "keys-" +#define ROUTE_TAG "route-" +#define ROUTE6_TAG "route6-" + +#define BAK_TAG ".bak" +#define TILDE_TAG "~" +#define ORIG_TAG ".orig" +#define REJ_TAG ".rej" +#define RPMNEW_TAG ".rpmnew" + +#define IFCFG_DIR SYSCONFDIR"/sysconfig/network-scripts" + +#define IFCFG_PLUGIN_NAME "ifcfg-rh" +#define IFCFG_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." + +#define TYPE_ETHERNET "Ethernet" +#define TYPE_WIRELESS "Wireless" + +GQuark ifcfg_plugin_error_quark (void); + + +#endif /* __COMMON_H__ */ + diff --git a/system-settings/plugins/ifcfg-rh/errors.c b/system-settings/plugins/ifcfg-rh/errors.c new file mode 100644 index 00000000..25039104 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/errors.c @@ -0,0 +1,35 @@ +/* -*- 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 2008 - 2009 Red Hat, Inc. + */ + +#include +#include "common.h" + +GQuark +ifcfg_plugin_error_quark (void) +{ + static GQuark error_quark = 0; + + if (G_UNLIKELY (error_quark == 0)) + error_quark = g_quark_from_static_string ("ifcfg-plugin-error-quark"); + + return error_quark; +} + + diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c new file mode 100644 index 00000000..b54bc8af --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -0,0 +1,353 @@ +/* -*- 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. + * + * Copyright (C) 2008 - 2009 Red Hat, Inc. + */ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "nm-ifcfg-connection.h" +#include "reader.h" +#include "writer.h" +#include "nm-inotify-helper.h" + +static NMSettingsConnectionInterface *parent_settings_connection_iface; + +static void settings_connection_interface_init (NMSettingsConnectionInterface *klass); + +G_DEFINE_TYPE_EXTENDED (NMIfcfgConnection, nm_ifcfg_connection, NM_TYPE_SYSCONFIG_CONNECTION, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, + settings_connection_interface_init)) + +#define NM_IFCFG_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IFCFG_CONNECTION, NMIfcfgConnectionPrivate)) + +typedef struct { + gulong ih_event_id; + + char *filename; + int file_wd; + + char *keyfile; + int keyfile_wd; + + char *routefile; + int routefile_wd; + + char *route6file; + int route6file_wd; + + char *udi; + char *unmanaged; +} NMIfcfgConnectionPrivate; + +enum { + PROP_0, + PROP_FILENAME, + PROP_UNMANAGED, + PROP_UDI, + + LAST_PROP +}; + +/* Signals */ +enum { + IFCFG_CHANGED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static void +files_changed_cb (NMInotifyHelper *ih, + struct inotify_event *evt, + const char *path, + gpointer user_data) +{ + NMIfcfgConnection *self = NM_IFCFG_CONNECTION (user_data); + NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (self); + + if ((evt->wd != priv->file_wd) && (evt->wd != priv->keyfile_wd) && (evt->wd != priv->routefile_wd) && (evt->wd != priv->route6file_wd)) + return; + + /* push the event up to the plugin */ + g_signal_emit (self, signals[IFCFG_CHANGED], 0); +} + +NMIfcfgConnection * +nm_ifcfg_connection_new (const char *filename, + GError **error, + gboolean *ignore_error) +{ + GObject *object; + NMIfcfgConnectionPrivate *priv; + NMConnection *tmp; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + NMInotifyHelper *ih; + + g_return_val_if_fail (filename != NULL, NULL); + + tmp = connection_from_file (filename, NULL, NULL, NULL, &unmanaged, &keyfile, &routefile, &route6file, error, ignore_error); + if (!tmp) + return NULL; + + object = (GObject *) g_object_new (NM_TYPE_IFCFG_CONNECTION, + NM_IFCFG_CONNECTION_FILENAME, filename, + NM_IFCFG_CONNECTION_UNMANAGED, unmanaged, + NULL); + if (!object) { + g_object_unref (tmp); + return NULL; + } + + /* Update our settings with what was read from the file */ + nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (object), tmp, FALSE, NULL); + g_object_unref (tmp); + + priv = NM_IFCFG_CONNECTION_GET_PRIVATE (object); + + ih = nm_inotify_helper_get (); + priv->ih_event_id = g_signal_connect (ih, "event", G_CALLBACK (files_changed_cb), object); + + priv->file_wd = nm_inotify_helper_add_watch (ih, filename); + + priv->keyfile = keyfile; + priv->keyfile_wd = nm_inotify_helper_add_watch (ih, keyfile); + + priv->routefile = routefile; + priv->routefile_wd = nm_inotify_helper_add_watch (ih, routefile); + + priv->route6file = route6file; + priv->route6file_wd = nm_inotify_helper_add_watch (ih, route6file); + + return NM_IFCFG_CONNECTION (object); +} + +const char * +nm_ifcfg_connection_get_filename (NMIfcfgConnection *self) +{ + g_return_val_if_fail (NM_IS_IFCFG_CONNECTION (self), NULL); + + return NM_IFCFG_CONNECTION_GET_PRIVATE (self)->filename; +} + +const char * +nm_ifcfg_connection_get_unmanaged_spec (NMIfcfgConnection *self) +{ + g_return_val_if_fail (NM_IS_IFCFG_CONNECTION (self), FALSE); + + return NM_IFCFG_CONNECTION_GET_PRIVATE (self)->unmanaged; +} + +static gboolean +update (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceUpdateFunc callback, + gpointer user_data) +{ + NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (connection); + GError *error = NULL; + + if (!writer_update_connection (NM_CONNECTION (connection), + IFCFG_DIR, + priv->filename, + priv->keyfile, + &error)) { + callback (connection, error, user_data); + g_error_free (error); + return FALSE; + } + + return parent_settings_connection_iface->update (connection, callback, user_data); +} + +static gboolean +do_delete (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceDeleteFunc callback, + gpointer user_data) +{ + NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (connection); + + g_unlink (priv->filename); + if (priv->keyfile) + g_unlink (priv->keyfile); + if (priv->routefile) + g_unlink (priv->routefile); + + if (priv->route6file) + g_unlink (priv->route6file); + + return parent_settings_connection_iface->delete (connection, callback, user_data); +} + +/* GObject */ + +static void +settings_connection_interface_init (NMSettingsConnectionInterface *iface) +{ + parent_settings_connection_iface = g_type_interface_peek_parent (iface); + iface->update = update; + iface->delete = do_delete; +} + +static void +nm_ifcfg_connection_init (NMIfcfgConnection *connection) +{ +} + +static void +finalize (GObject *object) +{ + NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (object); + NMInotifyHelper *ih; + + g_free (priv->udi); + + nm_connection_clear_secrets (NM_CONNECTION (object)); + + ih = nm_inotify_helper_get (); + + g_signal_handler_disconnect (ih, priv->ih_event_id); + + g_free (priv->filename); + if (priv->file_wd >= 0) + nm_inotify_helper_remove_watch (ih, priv->file_wd); + + g_free (priv->keyfile); + if (priv->keyfile_wd >= 0) + nm_inotify_helper_remove_watch (ih, priv->keyfile_wd); + + g_free (priv->routefile); + if (priv->routefile_wd >= 0) + nm_inotify_helper_remove_watch (ih, priv->routefile_wd); + + g_free (priv->route6file); + if (priv->route6file_wd >= 0) + nm_inotify_helper_remove_watch (ih, priv->route6file_wd); + + G_OBJECT_CLASS (nm_ifcfg_connection_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_FILENAME: + /* Construct only */ + priv->filename = g_value_dup_string (value); + break; + case PROP_UNMANAGED: + priv->unmanaged = g_value_dup_string (value); + break; + case PROP_UDI: + /* Construct only */ + priv->udi = g_value_dup_string (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) +{ + NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_FILENAME: + g_value_set_string (value, priv->filename); + break; + case PROP_UNMANAGED: + g_value_set_string (value, priv->unmanaged); + break; + case PROP_UDI: + g_value_set_string (value, priv->udi); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_ifcfg_connection_class_init (NMIfcfgConnectionClass *ifcfg_connection_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (ifcfg_connection_class); + + g_type_class_add_private (ifcfg_connection_class, sizeof (NMIfcfgConnectionPrivate)); + + /* Virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_FILENAME, + g_param_spec_string (NM_IFCFG_CONNECTION_FILENAME, + "FileName", + "File name", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property + (object_class, PROP_UNMANAGED, + g_param_spec_string (NM_IFCFG_CONNECTION_UNMANAGED, + "Unmanaged", + "Unmanaged", + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property + (object_class, PROP_UDI, + g_param_spec_string (NM_IFCFG_CONNECTION_UDI, + "UDI", + "UDI", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + signals[IFCFG_CHANGED] = + g_signal_new ("ifcfg-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h new file mode 100644 index 00000000..5cac5d9c --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h @@ -0,0 +1,64 @@ +/* -*- 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. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef NM_IFCFG_CONNECTION_H +#define NM_IFCFG_CONNECTION_H + +G_BEGIN_DECLS + +#include +#include + +#define NM_TYPE_IFCFG_CONNECTION (nm_ifcfg_connection_get_type ()) +#define NM_IFCFG_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IFCFG_CONNECTION, NMIfcfgConnection)) +#define NM_IFCFG_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IFCFG_CONNECTION, NMIfcfgConnectionClass)) +#define NM_IS_IFCFG_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IFCFG_CONNECTION)) +#define NM_IS_IFCFG_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IFCFG_CONNECTION)) +#define NM_IFCFG_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IFCFG_CONNECTION, NMIfcfgConnectionClass)) + +#define NM_IFCFG_CONNECTION_FILENAME "filename" +#define NM_IFCFG_CONNECTION_UNMANAGED "unmanaged" +#define NM_IFCFG_CONNECTION_UDI "udi" + +typedef struct { + NMSysconfigConnection parent; +} NMIfcfgConnection; + +typedef struct { + NMSysconfigConnectionClass parent; +} NMIfcfgConnectionClass; + +GType nm_ifcfg_connection_get_type (void); + +NMIfcfgConnection *nm_ifcfg_connection_new (const char *filename, + GError **error, + gboolean *ignore_error); + +const char *nm_ifcfg_connection_get_filename (NMIfcfgConnection *self); + +const char *nm_ifcfg_connection_get_unmanaged_spec (NMIfcfgConnection *self); + +gboolean nm_ifcfg_connection_update (NMIfcfgConnection *self, + GHashTable *new_settings, + GError **error); + +G_END_DECLS + +#endif /* NM_IFCFG_CONNECTION_H */ diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf b/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf new file mode 100644 index 00000000..cade31dd --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml b/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml new file mode 100644 index 00000000..52793452 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml @@ -0,0 +1,31 @@ + + + + + + Utility methods for handling NM integration with standard Red Hat ifcfg files. + + + + + Given an ifcfg file, return various internal information about it. + + + + + The full path to an ifcfg file. + + + + + The UUID of the NM connection backed by this ifcfg file. If the ifcfg file does not contain a UUID tag, this UUID is generated by NM, otherwise the UUID from the ifcfg file is used. + + + + + The object path of the NM connected backed by this ifcfg file. + + + + + diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c new file mode 100644 index 00000000..47ce0075 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -0,0 +1,793 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * Dan Williams + * Søren Sandmann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "common.h" +#include "nm-dbus-glib-types.h" +#include "plugin.h" +#include "nm-system-config-interface.h" +#include "nm-ifcfg-connection.h" +#include "nm-inotify-helper.h" +#include "shvar.h" +#include "writer.h" +#include "utils.h" + +#define DBUS_SERVICE_NAME "com.redhat.ifcfgrh1" +#define DBUS_OBJECT_PATH "/com/redhat/ifcfgrh1" + +static gboolean impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin, + const char *in_ifcfg, + const char **out_uuid, + const char **out_path, + GError **error); + +#include "nm-ifcfg-rh-glue.h" + +static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); + +static void connection_changed_handler (SCPluginIfcfg *plugin, + const char *path, + NMIfcfgConnection *connection, + gboolean *do_remove, + gboolean *do_new); + +static void handle_connection_remove_or_new (SCPluginIfcfg *plugin, + const char *path, + NMIfcfgConnection *connection, + gboolean do_remove, + gboolean do_new); + +G_DEFINE_TYPE_EXTENDED (SCPluginIfcfg, sc_plugin_ifcfg, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE, + system_config_interface_init)) + +#define SC_PLUGIN_IFCFG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgPrivate)) + + +typedef struct { + GHashTable *connections; + + gulong ih_event_id; + int sc_network_wd; + char *hostname; + + GFileMonitor *monitor; + guint monitor_id; + + DBusGConnection *bus; +} SCPluginIfcfgPrivate; + + +static void +connection_unmanaged_changed (NMIfcfgConnection *connection, + GParamSpec *pspec, + gpointer user_data) +{ + g_signal_emit_by_name (SC_PLUGIN_IFCFG (user_data), NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); +} + +static void +connection_ifcfg_changed (NMIfcfgConnection *connection, gpointer user_data) +{ + SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (user_data); + gboolean do_remove = FALSE, do_new = FALSE; + const char *path; + + path = nm_ifcfg_connection_get_filename (connection); + g_return_if_fail (path != NULL); + + connection_changed_handler (plugin, path, connection, &do_remove, &do_new); + handle_connection_remove_or_new (plugin, path, connection, do_remove, do_new); +} + +static NMIfcfgConnection * +read_one_connection (SCPluginIfcfg *plugin, const char *filename) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + NMIfcfgConnection *connection; + GError *error = NULL; + gboolean ignore_error = FALSE; + + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "parsing %s ... ", filename); + + connection = nm_ifcfg_connection_new (filename, &error, &ignore_error); + if (connection) { + NMSettingConnection *s_con; + const char *cid; + + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + + cid = nm_setting_connection_get_id (s_con); + g_assert (cid); + + g_hash_table_insert (priv->connections, + (gpointer) nm_ifcfg_connection_get_filename (connection), + g_object_ref (connection)); + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, " read connection '%s'", cid); + + if (nm_ifcfg_connection_get_unmanaged_spec (connection)) { + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "Ignoring connection '%s' and its " + "device because NM_CONTROLLED was false.", cid); + g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); + } else { + /* Wait for the connection to become unmanaged once it knows the + * UDI of it's device, if/when the device gets plugged in. + */ + g_signal_connect (G_OBJECT (connection), "notify::unmanaged", + G_CALLBACK (connection_unmanaged_changed), plugin); + } + + /* watch changes of ifcfg hardlinks */ + g_signal_connect (G_OBJECT (connection), "ifcfg-changed", + G_CALLBACK (connection_ifcfg_changed), plugin); + } else { + if (!ignore_error) { + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, " error: %s", + (error && error->message) ? error->message : "(unknown)"); + } + g_error_free (error); + } + + return connection; +} + +static void +read_connections (SCPluginIfcfg *plugin) +{ + GDir *dir; + GError *err = NULL; + + dir = g_dir_open (IFCFG_DIR, 0, &err); + if (dir) { + const char *item; + + while ((item = g_dir_read_name (dir))) { + char *full_path; + + if (utils_should_ignore_file (item, TRUE)) + continue; + + full_path = g_build_filename (IFCFG_DIR, item, NULL); + read_one_connection (plugin, full_path); + g_free (full_path); + } + + g_dir_close (dir); + } else { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Can not read directory '%s': %s", IFCFG_DIR, err->message); + g_error_free (err); + } +} + +/* Monitoring */ + +static void +connection_changed_handler (SCPluginIfcfg *plugin, + const char *path, + NMIfcfgConnection *connection, + gboolean *do_remove, + gboolean *do_new) +{ + NMIfcfgConnection *new; + GError *error = NULL; + gboolean ignore_error = FALSE; + const char *new_unmanaged = NULL, *old_unmanaged = NULL; + + g_return_if_fail (plugin != NULL); + g_return_if_fail (path != NULL); + g_return_if_fail (connection != NULL); + g_return_if_fail (do_remove != NULL); + g_return_if_fail (do_new != NULL); + + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "updating %s", path); + + new = (NMIfcfgConnection *) nm_ifcfg_connection_new (path, &error, &ignore_error); + if (!new) { + /* errors reading connection; remove it */ + if (!ignore_error) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " error: %s", + (error && error->message) ? error->message : "(unknown)"); + } + g_clear_error (&error); + + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", path); + *do_remove = TRUE; + return; + } + + /* Successfully read connection changes */ + + old_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (connection)); + new_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (new)); + + if (new_unmanaged) { + if (!old_unmanaged) { + /* Unexport the connection by destroying it, then re-creating it as unmanaged */ + *do_remove = *do_new = TRUE; + } + } else { + if (old_unmanaged) { /* now managed */ + NMSettingConnection *s_con; + const char *cid; + + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (new), NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + + cid = nm_setting_connection_get_id (s_con); + g_assert (cid); + + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "Managing connection '%s' and its " + "device because NM_CONTROLLED was true.", cid); + g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection); + } + + if (!nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (connection), + NM_CONNECTION (new), + TRUE, + &error)) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " error updating: %s", + (error && error->message) ? error->message : "(unknown)"); + g_clear_error (&error); + } + + /* Update unmanaged status */ + g_object_set (connection, "unmanaged", new_unmanaged, NULL); + g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); + } + g_object_unref (new); +} + +static void +handle_connection_remove_or_new (SCPluginIfcfg *plugin, + const char *path, + NMIfcfgConnection *connection, + gboolean do_remove, + gboolean do_new) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + + g_return_if_fail (plugin != NULL); + g_return_if_fail (path != NULL); + + if (do_remove) { + const char *unmanaged; + + g_return_if_fail (connection != NULL); + + unmanaged = nm_ifcfg_connection_get_unmanaged_spec (connection); + g_hash_table_remove (priv->connections, path); + g_signal_emit_by_name (connection, "removed"); + + /* Emit unmanaged changes _after_ removing the connection */ + if (unmanaged) + g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); + } + + if (do_new) { + connection = read_one_connection (plugin, path); + if (connection) { + if (!nm_ifcfg_connection_get_unmanaged_spec (connection)) + g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection); + } + } +} +static void +dir_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (user_data); + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + char *path, *name; + NMIfcfgConnection *connection; + gboolean do_remove = FALSE, do_new = FALSE; + + path = g_file_get_path (file); + if (utils_should_ignore_file (path, FALSE)) { + g_free (path); + return; + } + + /* Given any ifcfg, keys, or routes file, get the ifcfg file path */ + name = utils_get_ifcfg_path (path); + g_free (path); + + connection = g_hash_table_lookup (priv->connections, name); + if (!connection) { + do_new = TRUE; + } else { + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name); + do_remove = TRUE; + break; + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + /* Update */ + connection_changed_handler (plugin, name, connection, &do_remove, &do_new); + break; + default: + break; + } + } + + handle_connection_remove_or_new (plugin, name, connection, do_remove, do_new); + + g_free (name); +} + +static void +setup_ifcfg_monitoring (SCPluginIfcfg *plugin) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + GFile *file; + GFileMonitor *monitor; + + priv->connections = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref); + + file = g_file_new_for_path (IFCFG_DIR "/"); + monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref (file); + + if (monitor) { + priv->monitor_id = g_signal_connect (monitor, "changed", G_CALLBACK (dir_changed), plugin); + priv->monitor = monitor; + } +} + +static GSList * +get_connections (NMSystemConfigInterface *config) +{ + SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (config); + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + GSList *list = NULL; + GHashTableIter iter; + gpointer value; + + if (!priv->connections) { + setup_ifcfg_monitoring (plugin); + read_connections (plugin); + } + + g_hash_table_iter_init (&iter, priv->connections); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + NMIfcfgConnection *exported = NM_IFCFG_CONNECTION (value); + + if (!nm_ifcfg_connection_get_unmanaged_spec (exported)) + list = g_slist_prepend (list, value); + } + + return list; +} + +static void +check_unmanaged (gpointer key, gpointer data, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + NMIfcfgConnection *connection = NM_IFCFG_CONNECTION (data); + const char *unmanaged_spec; + GSList *iter; + + unmanaged_spec = nm_ifcfg_connection_get_unmanaged_spec (connection); + if (!unmanaged_spec) + return; + + /* Just return if the unmanaged spec is already in the list */ + for (iter = *list; iter; iter = g_slist_next (iter)) { + if (!strcmp ((char *) iter->data, unmanaged_spec)) + return; + } + + *list = g_slist_prepend (*list, g_strdup (unmanaged_spec)); +} + +static GSList * +get_unmanaged_specs (NMSystemConfigInterface *config) +{ + SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (config); + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (config); + GSList *list = NULL; + + if (!priv->connections) { + setup_ifcfg_monitoring (plugin); + read_connections (plugin); + } + + g_hash_table_foreach (priv->connections, check_unmanaged, &list); + return list; +} + +static gboolean +add_connection (NMSystemConfigInterface *config, + NMConnection *connection, + GError **error) +{ + return writer_new_connection (connection, IFCFG_DIR, NULL, error); +} + +#define SC_NETWORK_FILE SYSCONFDIR"/sysconfig/network" + +static char * +plugin_get_hostname (SCPluginIfcfg *plugin) +{ + shvarFile *network; + char *hostname; + gboolean ignore_localhost; + + network = svNewFile (SC_NETWORK_FILE); + if (!network) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Could not get hostname: failed to read " SC_NETWORK_FILE); + return FALSE; + } + + hostname = svGetValue (network, "HOSTNAME", FALSE); + ignore_localhost = svTrueValue (network, "NM_IGNORE_HOSTNAME_LOCALHOST", FALSE); + if (ignore_localhost) { + /* Ignore a hostname of 'localhost' or 'localhost.localdomain' to preserve + * 'network' service behavior. + */ + if (hostname && (!strcmp (hostname, "localhost") || !strcmp (hostname, "localhost.localdomain"))) { + g_free (hostname); + hostname = NULL; + } + } + + svCloseFile (network); + return hostname; +} + +static gboolean +plugin_set_hostname (SCPluginIfcfg *plugin, const char *hostname) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + shvarFile *network; + + network = svCreateFile (SC_NETWORK_FILE); + if (!network) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Could not save hostname: failed to create/open " SC_NETWORK_FILE); + return FALSE; + } + + svSetValue (network, "HOSTNAME", hostname, FALSE); + svWriteFile (network, 0644); + svCloseFile (network); + + g_free (priv->hostname); + priv->hostname = hostname ? g_strdup (hostname) : NULL; + return TRUE; +} + +static void +sc_network_changed_cb (NMInotifyHelper *ih, + struct inotify_event *evt, + const char *path, + gpointer user_data) +{ + SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (user_data); + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + char *new_hostname; + + if (evt->wd != priv->sc_network_wd) + return; + + new_hostname = plugin_get_hostname (plugin); + if ( (new_hostname && !priv->hostname) + || (!new_hostname && priv->hostname) + || (priv->hostname && new_hostname && strcmp (priv->hostname, new_hostname))) { + g_free (priv->hostname); + priv->hostname = new_hostname; + g_object_notify (G_OBJECT (plugin), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); + } else + g_free (new_hostname); +} + +static gboolean +impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin, + const char *in_ifcfg, + const char **out_uuid, + const char **out_path, + GError **error) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + NMIfcfgConnection *connection; + NMSettingConnection *s_con; + const char *uuid; + const char *path; + + if (!g_path_is_absolute (in_ifcfg)) { + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, + "ifcfg path '%s' is not absolute", in_ifcfg); + return FALSE; + } + + connection = g_hash_table_lookup (priv->connections, in_ifcfg); + if (!connection) { + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION, + "ifcfg file '%s' unknown", in_ifcfg); + return FALSE; + } + + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION); + if (!s_con) { + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "unable to retrieve the connection setting"); + return FALSE; + } + + uuid = nm_setting_connection_get_uuid (s_con); + if (!uuid) { + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "unable to get the UUID"); + return FALSE; + } + + path = nm_connection_get_path (NM_CONNECTION (connection)); + if (!path) { + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "unable to get the connection D-Bus path"); + return FALSE; + } + + *out_uuid = g_strdup (uuid); + *out_path = g_strdup (path); + + return TRUE; +} + +static void +init (NMSystemConfigInterface *config) +{ +} + +static void +sc_plugin_ifcfg_init (SCPluginIfcfg *plugin) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + NMInotifyHelper *ih; + GError *error = NULL; + gboolean success = FALSE; + + ih = nm_inotify_helper_get (); + priv->ih_event_id = g_signal_connect (ih, "event", G_CALLBACK (sc_network_changed_cb), plugin); + priv->sc_network_wd = nm_inotify_helper_add_watch (ih, SC_NETWORK_FILE); + + priv->hostname = plugin_get_hostname (plugin); + + priv->bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); + if (!priv->bus) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Couldn't connect to D-Bus: %s", + error->message); + g_clear_error (&error); + } else { + DBusConnection *tmp; + DBusGProxy *proxy; + int result; + + tmp = dbus_g_connection_get_connection (priv->bus); + dbus_connection_set_exit_on_disconnect (tmp, FALSE); + + proxy = dbus_g_proxy_new_for_name (priv->bus, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus"); + + if (!dbus_g_proxy_call (proxy, "RequestName", &error, + G_TYPE_STRING, DBUS_SERVICE_NAME, + G_TYPE_UINT, DBUS_NAME_FLAG_DO_NOT_QUEUE, + G_TYPE_INVALID, + G_TYPE_UINT, &result, + G_TYPE_INVALID)) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Couldn't acquire D-Bus service: %s", + error->message); + g_clear_error (&error); + } else if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, "Couldn't acquire ifcfgrh1 D-Bus service (already taken)"); + } else + success = TRUE; + } + + if (!success) { + dbus_g_connection_unref (priv->bus); + priv->bus = NULL; + } +} + +static void +dispose (GObject *object) +{ + SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (object); + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + NMInotifyHelper *ih; + + if (priv->bus) { + dbus_g_connection_unref (priv->bus); + priv->bus = NULL; + } + + ih = nm_inotify_helper_get (); + + g_signal_handler_disconnect (ih, priv->ih_event_id); + + if (priv->sc_network_wd >= 0) + nm_inotify_helper_remove_watch (ih, priv->sc_network_wd); + + g_free (priv->hostname); + + if (priv->connections) + g_hash_table_destroy (priv->connections); + + if (priv->monitor) { + if (priv->monitor_id) + g_signal_handler_disconnect (priv->monitor, priv->monitor_id); + + g_file_monitor_cancel (priv->monitor); + g_object_unref (priv->monitor); + } + + G_OBJECT_CLASS (sc_plugin_ifcfg_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + G_OBJECT_CLASS (sc_plugin_ifcfg_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (object); + + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME: + g_value_set_string (value, IFCFG_PLUGIN_NAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO: + g_value_set_string (value, IFCFG_PLUGIN_INFO); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES: + g_value_set_uint (value, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS | NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + g_value_set_string (value, priv->hostname); + 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) +{ + const char *hostname; + + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + hostname = g_value_get_string (value); + if (hostname && strlen (hostname) < 1) + hostname = NULL; + plugin_set_hostname (SC_PLUGIN_IFCFG (object), hostname); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +sc_plugin_ifcfg_class_init (SCPluginIfcfgClass *req_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (req_class); + + g_type_class_add_private (req_class, sizeof (SCPluginIfcfgPrivate)); + + object_class->dispose = dispose; + object_class->finalize = finalize; + object_class->get_property = get_property; + object_class->set_property = set_property; + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME, + NM_SYSTEM_CONFIG_INTERFACE_NAME); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO, + NM_SYSTEM_CONFIG_INTERFACE_INFO); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES, + NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME, + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (req_class), + &dbus_glib_nm_ifcfg_rh_object_info); +} + +static void +system_config_interface_init (NMSystemConfigInterface *system_config_interface_class) +{ + /* interface implementation */ + system_config_interface_class->get_connections = get_connections; + system_config_interface_class->add_connection = add_connection; + system_config_interface_class->get_unmanaged_specs = get_unmanaged_specs; + system_config_interface_class->init = init; +} + +G_MODULE_EXPORT GObject * +nm_system_config_factory (void) +{ + static SCPluginIfcfg *singleton = NULL; + SCPluginIfcfgPrivate *priv; + + if (!singleton) { + singleton = SC_PLUGIN_IFCFG (g_object_new (SC_TYPE_PLUGIN_IFCFG, NULL)); + if (singleton) { + priv = SC_PLUGIN_IFCFG_GET_PRIVATE (singleton); + if (priv->bus) + dbus_g_connection_register_g_object (priv->bus, + DBUS_OBJECT_PATH, + G_OBJECT (singleton)); + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "Acquired D-Bus service %s", DBUS_SERVICE_NAME); + } + } else + g_object_ref (singleton); + + return G_OBJECT (singleton); +} diff --git a/system-settings/plugins/ifcfg-rh/plugin.h b/system-settings/plugins/ifcfg-rh/plugin.h new file mode 100644 index 00000000..d820a26e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/plugin.h @@ -0,0 +1,50 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* NetworkManager system settings service + * + * Dan Williams + * Søren Sandmann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2007 - 2008 Red Hat, Inc. + */ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +#include + +#define SC_TYPE_PLUGIN_IFCFG (sc_plugin_ifcfg_get_type ()) +#define SC_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfg)) +#define SC_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgClass)) +#define SC_IS_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IFCFG)) +#define SC_IS_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SC_TYPE_PLUGIN_IFCFG)) +#define SC_PLUGIN_IFCFG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgClass)) + +typedef struct _SCPluginIfcfg SCPluginIfcfg; +typedef struct _SCPluginIfcfgClass SCPluginIfcfgClass; + +struct _SCPluginIfcfg { + GObject parent; +}; + +struct _SCPluginIfcfgClass { + GObjectClass parent; +}; + +GType sc_plugin_ifcfg_get_type (void); + +#endif /* _PLUGIN_H_ */ + diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c new file mode 100644 index 00000000..1c7e8eb6 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -0,0 +1,3261 @@ +/* -*- 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. + * + * Copyright (C) 2008 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef __user +#define __user +#endif +#include +#include +#undef __user + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "shvar.h" +#include "utils.h" + +#include "reader.h" + +#define PLUGIN_PRINT(pname, fmt, args...) \ + { g_message (" " pname ": " fmt, ##args); } + +#define PLUGIN_WARN(pname, fmt, args...) \ + { g_warning (" " pname ": " fmt, ##args); } + +static gboolean eap_simple_reader (const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error); + +static gboolean eap_tls_reader (const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error); + +static gboolean eap_peap_reader (const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error); + +static gboolean eap_ttls_reader (const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error); + + +static gboolean +get_int (const char *str, int *value) +{ + char *e; + + errno = 0; + *value = strtol (str, &e, 0); + if (errno || *e != '\0') + return FALSE; + + return TRUE; +} + +static NMSetting * +make_connection_setting (const char *file, + shvarFile *ifcfg, + const char *type, + const char *suggested) +{ + NMSettingConnection *s_con; + const char *ifcfg_name = NULL; + char *new_id = NULL, *uuid = NULL, *value; + char *ifcfg_id; + + ifcfg_name = utils_get_ifcfg_name (file, TRUE); + if (!ifcfg_name) + return NULL; + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + + /* Try the ifcfg file's internally defined name if available */ + ifcfg_id = svGetValue (ifcfg, "NAME", FALSE); + if (ifcfg_id && strlen (ifcfg_id)) + g_object_set (s_con, NM_SETTING_CONNECTION_ID, ifcfg_id, NULL); + + if (!nm_setting_connection_get_id (s_con)) { + if (suggested) { + /* For cosmetic reasons, if the suggested name is the same as + * the ifcfg files name, don't use it. Mainly for wifi so that + * the SSID is shown in the connection ID instead of just "wlan0". + */ + if (strcmp (ifcfg_name, suggested)) { + new_id = g_strdup_printf ("%s %s (%s)", reader_get_prefix (), suggested, ifcfg_name); + g_object_set (s_con, NM_SETTING_CONNECTION_ID, new_id, NULL); + } + } + + /* Use the ifcfg file's name as a last resort */ + if (!nm_setting_connection_get_id (s_con)) { + new_id = g_strdup_printf ("%s %s", reader_get_prefix (), ifcfg_name); + g_object_set (s_con, NM_SETTING_CONNECTION_ID, new_id, NULL); + } + } + + g_free (new_id); + g_free (ifcfg_id); + + /* Try for a UUID key before falling back to hashing the file name */ + uuid = svGetValue (ifcfg, "UUID", FALSE); + if (!uuid || !strlen (uuid)) { + g_free (uuid); + uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName); + } + g_object_set (s_con, + NM_SETTING_CONNECTION_TYPE, type, + NM_SETTING_CONNECTION_UUID, uuid, + NULL); + g_free (uuid); + + /* Missing ONBOOT is treated as "ONBOOT=true" by the old network service */ + g_object_set (s_con, NM_SETTING_CONNECTION_AUTOCONNECT, + svTrueValue (ifcfg, "ONBOOT", TRUE), + NULL); + + value = svGetValue (ifcfg, "LAST_CONNECT", FALSE); + if (value) { + unsigned long int tmp; + guint64 timestamp; + + errno = 0; + tmp = strtoul (value, NULL, 10); + if (errno == 0) { + timestamp = (guint64) tmp; + g_object_set (s_con, NM_SETTING_CONNECTION_TIMESTAMP, timestamp, NULL); + } else + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid LAST_CONNECT time"); + g_free (value); + } + + return NM_SETTING (s_con); +} + +static gboolean +read_mac_address (shvarFile *ifcfg, GByteArray **array, GError **error) +{ + char *value = NULL; + struct ether_addr *mac; + + g_return_val_if_fail (ifcfg != NULL, FALSE); + g_return_val_if_fail (array != NULL, FALSE); + g_return_val_if_fail (*array == NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + value = svGetValue (ifcfg, "HWADDR", FALSE); + if (!value || !strlen (value)) { + g_free (value); + return TRUE; + } + + mac = ether_aton (value); + if (!mac) { + g_free (value); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "The MAC address '%s' was invalid.", value); + return FALSE; + } + + g_free (value); + *array = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (*array, (guint8 *) mac->ether_addr_octet, ETH_ALEN); + return TRUE; +} + +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); +} + +static char * +match_iscsiadm_tag (const char *line, const char *tag, gboolean *skip) +{ + char *p; + + if (g_ascii_strncasecmp (line, tag, strlen (tag))) + return NULL; + + p = strchr (line, '='); + if (!p) { + g_warning ("%s: malformed iscsiadm record: no = in '%s'.", + __func__, line); + *skip = TRUE; + return NULL; + } + + p++; /* advance past = */ + return g_strstrip (p); +} + +#define ISCSI_HWADDR_TAG "iface.hwaddress" +#define ISCSI_BOOTPROTO_TAG "iface.bootproto" +#define ISCSI_IPADDR_TAG "iface.ipaddress" +#define ISCSI_SUBNET_TAG "iface.subnet_mask" +#define ISCSI_GATEWAY_TAG "iface.gateway" +#define ISCSI_DNS1_TAG "iface.primary_dns" +#define ISCSI_DNS2_TAG "iface.secondary_dns" + +static gboolean +fill_ip4_setting_from_ibft (shvarFile *ifcfg, + NMSettingIP4Config *s_ip4, + const char *iscsiadm_path, + GError **error) +{ + const char *argv[4] = { iscsiadm_path, "-m", "fw", NULL }; + const char *envp[1] = { NULL }; + gboolean success = FALSE, in_record = FALSE, hwaddr_matched = FALSE, skip = FALSE; + char *out = NULL, *err = NULL; + gint status = 0; + GByteArray *ifcfg_mac = NULL; + char **lines = NULL, **iter; + const char *method = NULL; + struct in_addr ipaddr; + struct in_addr gateway; + struct in_addr dns1; + struct in_addr dns2; + guint32 prefix = 0; + + g_return_val_if_fail (s_ip4 != NULL, FALSE); + g_return_val_if_fail (iscsiadm_path != NULL, FALSE); + + if (!g_spawn_sync ("/", (char **) argv, (char **) envp, 0, + iscsiadm_child_setup, NULL, &out, &err, &status, error)) + return FALSE; + + if (!WIFEXITED (status)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "%s exited abnormally.", iscsiadm_path); + goto done; + } + + if (WEXITSTATUS (status) != 0) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "%s exited with error %d. Message: '%s'", + iscsiadm_path, WEXITSTATUS (status), err ? err : "(none)"); + goto done; + } + + if (!read_mac_address (ifcfg, &ifcfg_mac, error)) + goto done; + /* Ensure we got a MAC */ + if (!ifcfg_mac) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing device MAC address (no HWADDR tag present)."); + goto done; + } + + memset (&ipaddr, 0, sizeof (ipaddr)); + memset (&gateway, 0, sizeof (gateway)); + memset (&dns1, 0, sizeof (dns1)); + memset (&dns2, 0, sizeof (dns2)); + + /* Success, lets parse the output */ + lines = g_strsplit_set (out, "\n\r", -1); + for (iter = lines; iter && *iter; iter++) { + char *p; + + if (!g_ascii_strcasecmp (*iter, "# BEGIN RECORD")) { + if (in_record) { + g_warning ("%s: malformed iscsiadm record: already parsing record.", __func__); + skip = TRUE; + } + } else if (!g_ascii_strcasecmp (*iter, "# END RECORD")) { + if (!skip && hwaddr_matched) { + /* Record is good; fill IP4 config with its info */ + if (!method) { + g_warning ("%s: malformed iscsiadm record: missing BOOTPROTO.", __func__); + return FALSE; + } + + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_METHOD, method, NULL); + + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) { + NMIP4Address *addr; + + if (!ipaddr.s_addr || !prefix) { + g_warning ("%s: malformed iscsiadm record: BOOTPROTO=static " + "but missing IP address or prefix.", __func__); + return FALSE; + } + + addr = nm_ip4_address_new (); + nm_ip4_address_set_address (addr, ipaddr.s_addr); + nm_ip4_address_set_prefix (addr, prefix); + nm_ip4_address_set_gateway (addr, gateway.s_addr); + nm_setting_ip4_config_add_address (s_ip4, addr); + nm_ip4_address_unref (addr); + + if (dns1.s_addr) + nm_setting_ip4_config_add_dns (s_ip4, dns1.s_addr); + if (dns2.s_addr) + nm_setting_ip4_config_add_dns (s_ip4, dns2.s_addr); + + // FIXME: DNS search domains? + } + return TRUE; + } + skip = FALSE; + hwaddr_matched = FALSE; + memset (&ipaddr, 0, sizeof (ipaddr)); + memset (&gateway, 0, sizeof (gateway)); + memset (&dns1, 0, sizeof (dns1)); + memset (&dns2, 0, sizeof (dns2)); + prefix = 0; + method = NULL; + } + + if (skip) + continue; + + /* HWADDR */ + if (!skip && (p = match_iscsiadm_tag (*iter, ISCSI_HWADDR_TAG, &skip))) { + struct ether_addr *ibft_mac; + + ibft_mac = ether_aton (p); + if (!ibft_mac) { + g_warning ("%s: malformed iscsiadm record: invalid hwaddress.", __func__); + skip = TRUE; + continue; + } + + if (memcmp (ifcfg_mac->data, (guint8 *) ibft_mac->ether_addr_octet, ETH_ALEN)) { + /* This record isn't for the current device, ignore it */ + skip = TRUE; + continue; + } + + /* Success, this record is for this device */ + hwaddr_matched = TRUE; + } + + /* BOOTPROTO */ + if (!skip && (p = match_iscsiadm_tag (*iter, ISCSI_BOOTPROTO_TAG, &skip))) { + if (!g_ascii_strcasecmp (p, "dhcp")) + method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; + else if (!g_ascii_strcasecmp (p, "static")) + method = NM_SETTING_IP4_CONFIG_METHOD_MANUAL; + else { + g_warning ("%s: malformed iscsiadm record: unknown BOOTPROTO '%s'.", + __func__, p); + skip = TRUE; + continue; + } + } + + if (!skip && (p = match_iscsiadm_tag (*iter, ISCSI_IPADDR_TAG, &skip))) { + if (inet_pton (AF_INET, p, &ipaddr) < 1) { + g_warning ("%s: malformed iscsiadm record: invalid IP address '%s'.", + __func__, p); + skip = TRUE; + continue; + } + } + + if (!skip && (p = match_iscsiadm_tag (*iter, ISCSI_SUBNET_TAG, &skip))) { + struct in_addr mask; + + if (inet_pton (AF_INET, p, &mask) < 1) { + g_warning ("%s: malformed iscsiadm record: invalid subnet mask '%s'.", + __func__, p); + skip = TRUE; + continue; + } + + prefix = nm_utils_ip4_netmask_to_prefix (mask.s_addr); + } + + if (!skip && (p = match_iscsiadm_tag (*iter, ISCSI_GATEWAY_TAG, &skip))) { + if (inet_pton (AF_INET, p, &gateway) < 1) { + g_warning ("%s: malformed iscsiadm record: invalid IP gateway '%s'.", + __func__, p); + skip = TRUE; + continue; + } + } + + if (!skip && (p = match_iscsiadm_tag (*iter, ISCSI_DNS1_TAG, &skip))) { + if (inet_pton (AF_INET, p, &dns1) < 1) { + g_warning ("%s: malformed iscsiadm record: invalid DNS1 address '%s'.", + __func__, p); + skip = TRUE; + continue; + } + } + + if (!skip && (p = match_iscsiadm_tag (*iter, ISCSI_DNS2_TAG, &skip))) { + if (inet_pton (AF_INET, p, &dns2) < 1) { + g_warning ("%s: malformed iscsiadm record: invalid DNS2 address '%s'.", + __func__, p); + skip = TRUE; + continue; + } + } + } + + success = TRUE; + +done: + if (ifcfg_mac) + g_byte_array_free (ifcfg_mac, TRUE); + g_strfreev (lines); + g_free (out); + g_free (err); + return success; +} + +static gboolean +read_ip4_address (shvarFile *ifcfg, + const char *tag, + guint32 *out_addr, + GError **error) +{ + char *value = NULL; + struct in_addr 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); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + *out_addr = 0; + + value = svGetValue (ifcfg, tag, FALSE); + if (!value) + return TRUE; + + if (inet_pton (AF_INET, value, &ip4_addr) > 0) { + *out_addr = ip4_addr.s_addr; + success = TRUE; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid %s IP4 address '%s'", tag, value); + } + g_free (value); + return success; +} + +static gboolean +parse_ip6_address (const char *value, + struct in6_addr *out_addr, + GError **error) +{ + struct in6_addr ip6_addr; + gboolean success = FALSE; + + g_return_val_if_fail (value != NULL, FALSE); + g_return_val_if_fail (out_addr != NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + *out_addr = in6addr_any; + + if (inet_pton (AF_INET6, value, &ip6_addr) > 0) { + *out_addr = ip6_addr; + success = TRUE; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 address '%s'", value); + } + return success; +} + +static NMIP4Address * +read_full_ip4_address (shvarFile *ifcfg, + const char *network_file, + guint32 which, + GError **error) +{ + NMIP4Address *addr; + char *ip_tag, *prefix_tag, *netmask_tag, *gw_tag; + guint32 tmp; + gboolean success = FALSE; + shvarFile *network_ifcfg; + char *value; + + g_return_val_if_fail (which > 0, NULL); + g_return_val_if_fail (ifcfg != NULL, NULL); + g_return_val_if_fail (network_file != NULL, NULL); + + addr = nm_ip4_address_new (); + if (which == 1) { + ip_tag = g_strdup ("IPADDR"); + prefix_tag = g_strdup ("PREFIX"); + netmask_tag = g_strdup ("NETMASK"); + gw_tag = g_strdup ("GATEWAY"); + } else { + ip_tag = g_strdup_printf ("IPADDR%u", which); + prefix_tag = g_strdup_printf ("PREFIX%u", which); + netmask_tag = g_strdup_printf ("NETMASK%u", which); + gw_tag = g_strdup_printf ("GATEWAY%u", which); + } + + /* IP address */ + if (!read_ip4_address (ifcfg, ip_tag, &tmp, error)) + goto error; + if (!tmp) { + nm_ip4_address_unref (addr); + addr = NULL; + success = TRUE; /* done */ + goto error; + } + nm_ip4_address_set_address (addr, tmp); + + /* Gateway */ + if (!read_ip4_address (ifcfg, gw_tag, &tmp, error)) + goto error; + 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 = svNewFile (network_file); + if (network_ifcfg) { + read_success = read_ip4_address (network_ifcfg, "GATEWAY", &tmp, error); + svCloseFile (network_ifcfg); + if (!read_success) + goto error; + nm_ip4_address_set_gateway (addr, tmp); + } + } + + /* 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) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP4 prefix '%s'", value); + g_free (value); + goto error; + } + 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)) + goto error; + nm_ip4_address_set_prefix (addr, nm_utils_ip4_netmask_to_prefix (tmp)); + } + + /* Try to autodetermine the prefix for the address' class */ + if (!nm_ip4_address_get_prefix (addr)) { + guint32 prefix = 0; + + prefix = nm_utils_ip4_get_default_prefix (nm_ip4_address_get_address (addr)); + nm_ip4_address_set_prefix (addr, prefix); + + value = svGetValue (ifcfg, ip_tag, FALSE); + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: missing %s, assuming %s/%u", + prefix_tag, value, prefix); + g_free (value); + } + + /* Validate the prefix */ + if (nm_ip4_address_get_prefix (addr) > 32) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing or invalid IP4 prefix '%d'", + nm_ip4_address_get_prefix (addr)); + goto error; + } + + success = TRUE; + +error: + if (!success) { + nm_ip4_address_unref (addr); + addr = NULL; + } + + g_free (ip_tag); + g_free (prefix_tag); + g_free (netmask_tag); + g_free (gw_tag); + return addr; +} + +static NMIP4Route * +read_one_ip4_route (shvarFile *ifcfg, + const char *network_file, + guint32 which, + GError **error) +{ + NMIP4Route *route; + char *ip_tag, *netmask_tag, *gw_tag, *metric_tag, *value; + guint32 tmp; + gboolean success = FALSE; + + g_return_val_if_fail (ifcfg != NULL, NULL); + g_return_val_if_fail (network_file != NULL, NULL); + g_return_val_if_fail (which >= 0, NULL); + + route = nm_ip4_route_new (); + + ip_tag = g_strdup_printf ("ADDRESS%u", which); + netmask_tag = g_strdup_printf ("NETMASK%u", which); + gw_tag = g_strdup_printf ("GATEWAY%u", which); + metric_tag = g_strdup_printf ("METRIC%u", which); + + /* Destination */ + if (!read_ip4_address (ifcfg, ip_tag, &tmp, error)) + goto out; + if (!tmp) { + /* 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; + success = TRUE; /* done */ + goto out; + } + g_free (val); + } + nm_ip4_route_set_dest (route, tmp); + + /* Next hop */ + if (!read_ip4_address (ifcfg, gw_tag, &tmp, error)) + goto out; + if (!tmp) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing or invalid IP4 gateway address '%d'", + tmp); + goto out; + } + nm_ip4_route_set_next_hop (route, tmp); + + /* Prefix */ + if (!read_ip4_address (ifcfg, netmask_tag, &tmp, error)) + goto out; + nm_ip4_route_set_prefix (route, nm_utils_ip4_netmask_to_prefix (tmp)); + + /* Validate the prefix */ + if ( !nm_ip4_route_get_prefix (route) + || nm_ip4_route_get_prefix (route) > 32) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing or invalid IP4 prefix '%d'", + nm_ip4_route_get_prefix (route)); + 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) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP4 route metric '%s'", value); + g_free (value); + goto out; + } + nm_ip4_route_set_metric (route, (guint32) metric); + g_free (value); + } + + success = TRUE; + +out: + if (!success) { + nm_ip4_route_unref (route); + route = NULL; + } + + g_free (ip_tag); + g_free (netmask_tag); + g_free (gw_tag); + g_free (metric_tag); + return route; +} + +static gboolean +read_route_file_legacy (const char *filename, NMSettingIP4Config *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; + struct in_addr ip4_addr; + char *dest = NULL, *prefix = NULL, *next_hop = NULL, *metric = NULL; + long int prefix_int, metric_int; + gboolean success = FALSE; + + const char *pattern_empty = "^\\s*(\\#.*)?$"; + const char *pattern_to1 = "^\\s*(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|default)" /* IP or 'default' keyword */ + "(?:/(\\d{1,2}))?"; /* optional prefix */ + const char *pattern_to2 = "to\\s+(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|default)" /* IP or 'default' keyword */ + "(?:/(\\d{1,2}))?"; /* optional prefix */ + const char *pattern_via = "via\\s+(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})"; /* IP of gateway */ + const char *pattern_metric = "metric\\s+(\\d+)"; /* metric */ + + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (s_ip4 != NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + /* Read the route file */ + if (!g_file_get_contents (filename, &contents, &len, NULL)) + return FALSE; + + if (len == 0) { + g_free (contents); + return FALSE; + } + + /* Create regexes for pieces to be matched */ + regex_to1 = g_regex_new (pattern_to1, 0, 0, NULL); + regex_to2 = g_regex_new (pattern_to2, 0, 0, NULL); + 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++) { + + /* Skip empty lines */ + if (g_regex_match_simple (pattern_empty, *iter, 0, 0)) + continue; + + /* Destination */ + g_regex_match (regex_to1, *iter, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + g_regex_match (regex_to2, *iter, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IP4 route destination address in record: '%s'", *iter); + goto error; + } + } + dest = g_match_info_fetch (match_info, 1); + g_match_info_free (match_info); + if (!strcmp (dest, "default")) + strcpy (dest, "0.0.0.0"); + if (inet_pton (AF_INET, dest, &ip4_addr) != 1) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP4 route destination address '%s'", dest); + g_free (dest); + goto error; + } + nm_ip4_route_set_dest (route, ip4_addr.s_addr); + g_free (dest); + + /* Prefix - is optional; 32 if missing */ + prefix = g_match_info_fetch (match_info, 2); + prefix_int = 32; + if (prefix) { + errno = 0; + prefix_int = strtol (prefix, NULL, 10); + if (errno || prefix_int < 0 || prefix_int > 32) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP4 route destination prefix '%s'", prefix); + g_free (prefix); + 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)) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IP4 route gateway address in record: '%s'", *iter); + goto error; + } + next_hop = g_match_info_fetch (match_info, 1); + g_match_info_free (match_info); + if (inet_pton (AF_INET, next_hop, &ip4_addr) != 1) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP4 route gateway address '%s'", next_hop); + g_free (next_hop); + goto error; + } + nm_ip4_route_set_next_hop (route, ip4_addr.s_addr); + g_free (next_hop); + + /* Metric */ + g_regex_match (regex_metric, *iter, 0, &match_info); + metric_int = 0; + if (g_match_info_matches (match_info)) { + metric = g_match_info_fetch (match_info, 1); + errno = 0; + metric_int = strtol (metric, NULL, 10); + if (errno || metric_int < 0) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP4 route metric '%s'", metric); + g_free (metric); + goto error; + } + 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)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate IP4 route"); + + } + + success = TRUE; + +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); + g_regex_unref (regex_metric); + + return success; +} + +static NMIP6Address * +parse_full_ip6_address (const char *addr_str, GError **error) +{ + NMIP6Address *addr; + char **list; + char *ip_tag, *prefix_tag; + struct in6_addr tmp = IN6ADDR_ANY_INIT; + gboolean success = FALSE; + + g_return_val_if_fail (addr_str != NULL, NULL); + g_return_val_if_fail (error != NULL, NULL); + g_return_val_if_fail (*error == NULL, NULL); + + /* Split the adddress and prefix */ + list = g_strsplit_set (addr_str, "/", 2); + if (g_strv_length (list) < 1) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 address '%s'", addr_str); + goto error; + } + + ip_tag = list[0]; + prefix_tag = list[1]; + + addr = nm_ip6_address_new (); + /* IP address */ + if (ip_tag) { + if (!parse_ip6_address (ip_tag, &tmp, error)) + goto error; + } + + nm_ip6_address_set_address (addr, &tmp); + + /* Prefix */ + if (prefix_tag) { + long int prefix; + + errno = 0; + prefix = strtol (prefix_tag, NULL, 10); + if (errno || prefix <= 0 || prefix > 128) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 prefix '%s'", prefix_tag); + 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); + } + + success = TRUE; + +error: + if (!success) { + nm_ip6_address_unref (addr); + addr = NULL; + } + + g_strfreev (list); + return addr; +} + +/* IPv6 address is very complex to describe completely by a regular expression, + * so don't try to, rather use looser syntax to comprise all possibilities + * NOTE: The regexes below don't describe all variants allowed by 'ip route add', + * namely destination IP without 'to' keyword is recognized just at line start. + */ +#define IPV6_ADDR_REGEX "[0-9A-Fa-f:.]+" + +static gboolean +read_route6_file (const char *filename, NMSettingIP6Config *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, *next_hop = NULL, *metric = NULL; + long int prefix_int, metric_int; + gboolean success = FALSE; + + const char *pattern_empty = "^\\s*(\\#.*)?$"; + const char *pattern_to1 = "^\\s*(" IPV6_ADDR_REGEX "|default)" /* IPv6 or 'default' keyword */ + "(?:/(\\d{1,2}))?"; /* optional prefix */ + const char *pattern_to2 = "to\\s+(" IPV6_ADDR_REGEX "|default)" /* IPv6 or 'default' keyword */ + "(?:/(\\d{1,2}))?"; /* optional prefix */ + const char *pattern_via = "via\\s+(" IPV6_ADDR_REGEX ")"; /* IPv6 of gateway */ + const char *pattern_metric = "metric\\s+(\\d+)"; /* metric */ + + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (s_ip6 != NULL, FALSE); + g_return_val_if_fail (error != NULL, FALSE); + g_return_val_if_fail (*error == NULL, FALSE); + + /* Read the route file */ + if (!g_file_get_contents (filename, &contents, &len, NULL)) + return FALSE; + + if (len == 0) { + g_free (contents); + return FALSE; + } + + /* Create regexes for pieces to be matched */ + regex_to1 = g_regex_new (pattern_to1, 0, 0, NULL); + regex_to2 = g_regex_new (pattern_to2, 0, 0, NULL); + 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++) { + + /* Skip empty lines */ + if (g_regex_match_simple (pattern_empty, *iter, 0, 0)) + continue; + + /* Destination */ + g_regex_match (regex_to1, *iter, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + g_regex_match (regex_to2, *iter, 0, &match_info); + if (!g_match_info_matches (match_info)) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IP6 route destination address in record: '%s'", *iter); + goto error; + } + } + dest = g_match_info_fetch (match_info, 1); + g_match_info_free (match_info); + if (!strcmp (dest, "default")) + strcpy (dest, "::"); + if (inet_pton (AF_INET6, dest, &ip6_addr) != 1) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "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); + prefix_int = 128; + if (prefix) { + errno = 0; + prefix_int = strtol (prefix, NULL, 10); + if (errno || prefix_int < 0 || prefix_int > 128) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 route destination prefix '%s'", prefix); + 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)) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IP6 route gateway address in record: '%s'", *iter); + goto error; + } + next_hop = g_match_info_fetch (match_info, 1); + g_match_info_free (match_info); + if (inet_pton (AF_INET6, next_hop, &ip6_addr) != 1) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 route gateway address '%s'", next_hop); + g_free (next_hop); + goto error; + } + nm_ip6_route_set_next_hop (route, &ip6_addr); + g_free (next_hop); + + /* Metric */ + g_regex_match (regex_metric, *iter, 0, &match_info); + metric_int = 0; + if (g_match_info_matches (match_info)) { + metric = g_match_info_fetch (match_info, 1); + errno = 0; + metric_int = strtol (metric, NULL, 10); + if (errno || metric_int < 0 || metric_int > G_MAXUINT32) { + g_match_info_free (match_info); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid IP6 route metric '%s'", metric); + 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)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate IP6 route"); + } + + success = TRUE; + +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); + g_regex_unref (regex_metric); + + return success; +} + + +static NMSetting * +make_ip4_setting (shvarFile *ifcfg, + const char *network_file, + const char *iscsiadm_path, + gboolean valid_ip6_config, + GError **error) +{ + NMSettingIP4Config *s_ip4 = NULL; + char *value = NULL; + char *route_path = NULL; + char *method = NM_SETTING_IP4_CONFIG_METHOD_MANUAL; + guint32 i; + shvarFile *network_ifcfg; + shvarFile *route_ifcfg; + gboolean never_default = FALSE, tmp_success; + + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + if (!s_ip4) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not allocate IP4 setting"); + return NULL; + } + + /* First check if DEFROUTE is set for this device; DEFROUTE has the + * opposite meaning from never-default. The default if DEFROUTE is not + * specified is DEFROUTE=yes which means that this connection can be used + * as a default route + */ + never_default = !svTrueValue (ifcfg, "DEFROUTE", TRUE); + + /* Then check if GATEWAYDEV; it's global and overrides DEFROUTE */ + network_ifcfg = svNewFile (network_file); + if (network_ifcfg) { + char *gatewaydev; + + /* Get the connection ifcfg device name and the global gateway device */ + value = svGetValue (ifcfg, "DEVICE", FALSE); + gatewaydev = svGetValue (network_ifcfg, "GATEWAYDEV", FALSE); + + /* If there was a global gateway device specified, then only connections + * for that device can be the default connection. + */ + if (gatewaydev && value) + never_default = !!strcmp (value, gatewaydev); + + g_free (gatewaydev); + g_free (value); + svCloseFile (network_ifcfg); + } + + value = svGetValue (ifcfg, "BOOTPROTO", FALSE); + if (value) { + if (!g_ascii_strcasecmp (value, "bootp") || !g_ascii_strcasecmp (value, "dhcp")) + method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; + else if (!g_ascii_strcasecmp (value, "ibft")) { + /* iSCSI Boot Firmware Table: need to read values from the iSCSI + * firmware for this device and create the IP4 setting using those. + */ + if (fill_ip4_setting_from_ibft (ifcfg, s_ip4, iscsiadm_path, error)) + return NM_SETTING (s_ip4); + g_object_unref (s_ip4); + return NULL; + } 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, + NULL); + return NM_SETTING (s_ip4); + } else if (!g_ascii_strcasecmp (value, "shared")) { + 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, + NULL); + return NM_SETTING (s_ip4); + } else if (!g_ascii_strcasecmp (value, "none") || !g_ascii_strcasecmp (value, "static")) { + /* Static IP */ + } else if (strlen (value)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Unknown BOOTPROTO '%s'", value); + g_free (value); + goto done; + } + g_free (value); + } else { + char *tmp_ip4, *tmp_prefix, *tmp_netmask; + + /* If there is no BOOTPROTO, no IPADDR, no PREFIX, no NETMASK, but + * valid IPv6 configuration, assume that IPv4 is disabled. Otherwise, + * if there is no IPv6 configuration, assume DHCP is to be used. + * Happens with minimal ifcfg files like the following that anaconda + * sometimes used to write out: + * + * DEVICE=eth0 + * HWADDR=11:22:33:44:55:66 + * + */ + tmp_ip4 = svGetValue (ifcfg, "IPADDR", FALSE); + tmp_prefix = svGetValue (ifcfg, "PREFIX", FALSE); + tmp_netmask = svGetValue (ifcfg, "NETMASK", FALSE); + if (!tmp_ip4 && !tmp_prefix && !tmp_netmask) { + if (valid_ip6_config) { + /* Nope, no IPv4 */ + g_object_set (s_ip4, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_DISABLED, + NULL); + return NM_SETTING (s_ip4); + } + + method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; + } + g_free (tmp_ip4); + g_free (tmp_prefix); + g_free (tmp_netmask); + } + + 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", TRUE), + NULL); + + /* Handle manual settings */ + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) { + NMIP4Address *addr; + + for (i = 1; i < 256; i++) { + addr = read_full_ip4_address (ifcfg, network_file, i, error); + if (error && *error) + goto done; + if (!addr) + break; + + if (!nm_setting_ip4_config_add_address (s_ip4, addr)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate IP4 address"); + nm_ip4_address_unref (addr); + } + } else 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_free (value); + + value = svGetValue (ifcfg, "DHCP_CLIENT_ID", FALSE); + if (value && strlen (value)) + g_object_set (s_ip4, NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, value, NULL); + g_free (value); + } + + /* DNS servers + * Pick up just IPv4 addresses (IPv6 addresses are taken by make_ip6_setting()) + */ + for (i = 1, tmp_success = TRUE; i <= 10 && tmp_success; i++) { + char *tag; + guint32 dns; + struct in6_addr ip6_dns; + GError *tmp_err = NULL; + + tag = g_strdup_printf ("DNS%u", i); + tmp_success = read_ip4_address (ifcfg, tag, &dns, error); + if (!tmp_success) { + /* if it's IPv6, don't exit */ + dns = 0; + value = svGetValue (ifcfg, tag, FALSE); + if (value) { + tmp_success = parse_ip6_address (value, &ip6_dns, &tmp_err); + g_clear_error (&tmp_err); + g_free (value); + } + if (!tmp_success) { + g_free (tag); + goto done; + } + g_clear_error (error); + } + + if (dns && !nm_setting_ip4_config_add_dns (s_ip4, dns)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate DNS server %s", tag); + g_free (tag); + } + + /* DNS searches */ + value = svGetValue (ifcfg, "DOMAIN", FALSE); + if (value) { + char **searches = NULL; + + searches = g_strsplit (value, " ", 0); + if (searches) { + char **item; + for (item = searches; *item; item++) { + if (strlen (*item)) { + if (!nm_setting_ip4_config_add_dns_search (s_ip4, *item)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate DNS domain '%s'", *item); + } + } + g_strfreev (searches); + } + g_free (value); + } + + /* Static routes - route- file */ + route_path = utils_get_route_path (ifcfg->fileName); + if (!route_path) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "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)) { + /* Parse route file in new syntax */ + g_free (route_path); + route_ifcfg = utils_get_route_ifcfg (ifcfg->fileName, FALSE); + if (route_ifcfg) { + NMIP4Route *route; + for (i = 0; i < 256; i++) { + route = read_one_ip4_route (route_ifcfg, network_file, i, error); + if (error && *error) { + svCloseFile (route_ifcfg); + goto done; + } + if (!route) + break; + + if (!nm_setting_ip4_config_add_route (s_ip4, route)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate IP4 route"); + nm_ip4_route_unref (route); + } + svCloseFile (route_ifcfg); + } + } else { + read_route_file_legacy (route_path, s_ip4, error); + g_free (route_path); + if (error && *error) + goto done; + } + + /* Legacy value NM used for a while but is incorrect (rh #459370) */ + if (!nm_setting_ip4_config_get_num_dns_searches (s_ip4)) { + value = svGetValue (ifcfg, "SEARCH", FALSE); + if (value) { + char **searches = NULL; + + searches = g_strsplit (value, " ", 0); + if (searches) { + char **item; + for (item = searches; *item; item++) { + if (strlen (*item)) { + if (!nm_setting_ip4_config_add_dns_search (s_ip4, *item)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate DNS search '%s'", *item); + } + } + g_strfreev (searches); + } + g_free (value); + } + } + + return NM_SETTING (s_ip4); + +done: + g_object_unref (s_ip4); + return NULL; +} + +static NMSetting * +make_ip6_setting (shvarFile *ifcfg, + const char *network_file, + const char *iscsiadm_path, + GError **error) +{ + NMSettingIP6Config *s_ip6 = NULL; + char *value = NULL; + char *str_value; + char *route6_path = NULL; + gboolean bool_value, ipv6forwarding, ipv6_autoconf; + char *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL; + guint32 i; + shvarFile *network_ifcfg; + gboolean never_default = FALSE, tmp_success; + + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + if (!s_ip6) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not allocate IP6 setting"); + return NULL; + } + + /* Is IPV6 enabled? Set method to "ignored", when not enabled */ + str_value = svGetValue (ifcfg, "IPV6INIT", FALSE); + bool_value = svTrueValue (ifcfg, "IPV6INIT", FALSE); + if (!str_value) { + network_ifcfg = svNewFile (network_file); + if (network_ifcfg) { + bool_value = svTrueValue (network_ifcfg, "IPV6INIT", FALSE); + svCloseFile (network_ifcfg); + } + } + g_free (str_value); + + if (!bool_value) { + /* IPv6 is disabled */ + g_object_set (s_ip6, + NM_SETTING_IP6_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, + NULL); + return NM_SETTING (s_ip6); + } + + /* 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 + * specified is IPV6_DEFROUTE=yes which means that this connection can be used + * as a default route + */ + never_default = !svTrueValue (ifcfg, "IPV6_DEFROUTE", TRUE); + + /* Then check if IPV6_DEFAULTGW or IPV6_DEFAULTDEV is specified; + * they are global and override IPV6_DEFROUTE + * When both are set, the device specified in IPV6_DEFAULTGW takes preference. + */ + network_ifcfg = svNewFile (network_file); + if (network_ifcfg) { + char *ipv6_defaultgw, *ipv6_defaultdev; + char *default_dev = NULL; + + /* Get the connection ifcfg device name and the global default route device */ + value = svGetValue (ifcfg, "DEVICE", FALSE); + ipv6_defaultgw = svGetValue (network_ifcfg, "IPV6_DEFAULTGW", FALSE); + ipv6_defaultdev = svGetValue (network_ifcfg, "IPV6_DEFAULTDEV", FALSE); + + if (ipv6_defaultgw) { + default_dev = strchr (ipv6_defaultgw, '%'); + if (default_dev) + default_dev++; + } + if (!default_dev) + default_dev = ipv6_defaultdev; + + /* If there was a global default route device specified, then only connections + * for that device can be the default connection. + */ + if (default_dev && value) + never_default = !!strcmp (value, default_dev); + + g_free (ipv6_defaultgw); + g_free (ipv6_defaultdev); + g_free (value); + svCloseFile (network_ifcfg); + } + + /* Find out method property */ + ipv6forwarding = svTrueValue (ifcfg, "IPV6FORWARDING", FALSE); + ipv6_autoconf = svTrueValue (ifcfg, "IPV6_AUTOCONF", !ipv6forwarding); + + if (ipv6_autoconf) + method = NM_SETTING_IP6_CONFIG_METHOD_AUTO; + else { + /* IPV6_AUTOCONF=no and no IPv6 address -> method 'link-local' */ + str_value = svGetValue (ifcfg, "IPV6ADDR", FALSE); + if (!str_value) + str_value = svGetValue (ifcfg, "IPV6ADDR_SECONDARIES", FALSE); + + if (!str_value) + method = NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL; + g_free (str_value); + } + /* TODO - handle other methods */ + + 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), + NULL); + + if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + NMIP6Address *addr; + char *val; + char *ipv6addr, *ipv6addr_secondaries; + char **list = NULL, **iter; + + ipv6addr = svGetValue (ifcfg, "IPV6ADDR", FALSE); + ipv6addr_secondaries = svGetValue (ifcfg, "IPV6ADDR_SECONDARIES", FALSE); + + val = g_strjoin (ipv6addr && ipv6addr_secondaries ? " " : NULL, + ipv6addr ? ipv6addr : "", + ipv6addr_secondaries ? ipv6addr_secondaries : "", + NULL); + g_free (ipv6addr); + g_free (ipv6addr_secondaries); + + list = g_strsplit_set (val, " ", 0); + g_free (val); + for (iter = list; iter && *iter; iter++, i++) { + addr = parse_full_ip6_address (*iter, error); + if (!addr) { + g_strfreev (list); + goto error; + } + + if (!nm_setting_ip6_config_add_address (s_ip6, addr)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate IP6 address"); + nm_ip6_address_unref (addr); + } + g_strfreev (list); + } else if (!strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + /* TODO - autoconf or DHCPv6 stuff goes here */ + } + + /* DNS servers + * Pick up just IPv6 addresses (IPv4 addresses are taken by make_ip4_setting()) + */ + for (i = 1, tmp_success = TRUE; i <= 10 && tmp_success; i++) { + char *tag; + struct in6_addr ip6_dns; + + ip6_dns = in6addr_any; + tag = g_strdup_printf ("DNS%u", i); + value = svGetValue (ifcfg, tag, FALSE); + if (value) + tmp_success = parse_ip6_address (value, &ip6_dns, error); + + if (!tmp_success) { + struct in_addr ip4_addr; + if (inet_pton (AF_INET, value, &ip4_addr) != 1) { + g_free (tag); + g_free (value); + goto error; + } + /* ignore error - it is IPv4 address */ + tmp_success = TRUE; + g_clear_error (error); + } + + if (!IN6_IS_ADDR_UNSPECIFIED (&ip6_dns) && !nm_setting_ip6_config_add_dns (s_ip6, &ip6_dns)) + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: duplicate DNS server %s", tag); + g_free (tag); + g_free (value); + } + + /* DNS searches ('DOMAIN' key) are read by make_ip4_setting() and included in NMSettingIP4Config */ + + /* Read static routes from route6- file */ + route6_path = utils_get_route6_path (ifcfg->fileName); + if (!route6_path) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not get route6 file path for '%s'", ifcfg->fileName); + goto error; + } + + read_route6_file (route6_path, s_ip6, error); + g_free (route6_path); + if (error && *error) + goto error; + + return NM_SETTING (s_ip6); + +error: + g_object_unref (s_ip6); + return NULL; +} + +static gboolean +add_one_wep_key (shvarFile *ifcfg, + const char *shvar_key, + guint8 key_idx, + gboolean passphrase, + NMSettingWirelessSecurity *s_wsec, + GError **error) +{ + char *key = NULL; + char *value = NULL; + gboolean success = FALSE; + + g_return_val_if_fail (ifcfg != NULL, FALSE); + g_return_val_if_fail (shvar_key != NULL, FALSE); + g_return_val_if_fail (key_idx <= 3, FALSE); + g_return_val_if_fail (s_wsec != NULL, FALSE); + + value = svGetValue (ifcfg, shvar_key, FALSE); + if (!value || !strlen (value)) { + g_free (value); + return TRUE; + } + + /* Validate keys */ + if (passphrase) { + if (strlen (value) && strlen (value) < 64) { + key = g_strdup (value); + g_object_set (G_OBJECT (s_wsec), + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, + NM_WEP_KEY_TYPE_PASSPHRASE, + NULL); + } + } else { + if (strlen (value) == 10 || strlen (value) == 26) { + /* Hexadecimal WEP key */ + char *p = value; + + while (*p) { + if (!g_ascii_isxdigit (*p)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid hexadecimal WEP key."); + goto out; + } + p++; + } + key = g_strdup (value); + } else if ( !strncmp (value, "s:", 2) + && (strlen (value) == 7 || strlen (value) == 15)) { + /* ASCII key */ + char *p = value + 2; + + while (*p) { + if (!isascii ((int) (*p))) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid ASCII WEP key."); + goto out; + } + p++; + } + + /* Remove 's:' prefix. + * Don't convert to hex string. wpa_supplicant takes 'wep_key0' option over D-Bus as byte array + * and converts it to hex string itself. Even though we convert hex string keys into a bin string + * before passing to wpa_supplicant, this prevents two unnecessary conversions. And mainly, + * ASCII WEP key doesn't change to HEX WEP key in UI, which could confuse users. + */ + key = g_strdup (value + 2); + } + } + + if (key) { + nm_setting_wireless_security_set_wep_key (s_wsec, key_idx, key); + success = TRUE; + } else + g_set_error (error, ifcfg_plugin_error_quark (), 0, "Invalid WEP key length."); + +out: + g_free (value); + return success; +} + +static gboolean +read_wep_keys (shvarFile *ifcfg, + guint8 def_idx, + NMSettingWirelessSecurity *s_wsec, + GError **error) +{ + /* Try hex/ascii keys first */ + if (!add_one_wep_key (ifcfg, "KEY1", 0, FALSE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY2", 1, FALSE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY3", 2, FALSE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY4", 3, FALSE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY", def_idx, FALSE, s_wsec, error)) + return FALSE; + + /* And then passphrases */ + if (!add_one_wep_key (ifcfg, "KEY_PASSPHRASE1", 0, TRUE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY_PASSPHRASE2", 1, TRUE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY_PASSPHRASE3", 2, TRUE, s_wsec, error)) + return FALSE; + if (!add_one_wep_key (ifcfg, "KEY_PASSPHRASE4", 3, TRUE, s_wsec, error)) + return FALSE; + + return TRUE; +} + +static NMSetting * +make_wep_setting (shvarFile *ifcfg, + const char *file, + GError **error) +{ + NMSettingWirelessSecurity *s_wireless_sec; + char *value; + shvarFile *keys_ifcfg = NULL; + int default_key_idx = 0; + + s_wireless_sec = NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); + g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", NULL); + + value = svGetValue (ifcfg, "DEFAULTKEY", FALSE); + if (value) { + gboolean success; + + success = get_int (value, &default_key_idx); + if (success && (default_key_idx >= 1) && (default_key_idx <= 4)) { + default_key_idx--; /* convert to [0...3] */ + g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, default_key_idx, NULL); + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid default WEP key '%s'", value); + g_free (value); + goto error; + } + g_free (value); + } + + /* Read keys in the ifcfg file */ + if (!read_wep_keys (ifcfg, default_key_idx, s_wireless_sec, error)) + goto error; + + /* Try to get keys from the "shadow" key file */ + keys_ifcfg = utils_get_keys_ifcfg (file, FALSE); + if (keys_ifcfg) { + if (!read_wep_keys (keys_ifcfg, default_key_idx, s_wireless_sec, error)) { + svCloseFile (keys_ifcfg); + goto error; + } + svCloseFile (keys_ifcfg); + g_assert (error == NULL || *error == NULL); + } + + /* If there's a default key, ensure that key exists */ + if ((default_key_idx == 1) && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 1)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Default WEP key index was 2, but no valid KEY2 exists."); + goto error; + } else if ((default_key_idx == 2) && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 2)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Default WEP key index was 3, but no valid KEY3 exists."); + goto error; + } else if ((default_key_idx == 3) && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 3)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Default WEP key index was 4, but no valid KEY4 exists."); + goto error; + } + + value = svGetValue (ifcfg, "SECURITYMODE", FALSE); + if (value) { + char *lcase; + + lcase = g_ascii_strdown (value, -1); + g_free (value); + + if (!strcmp (lcase, "open")) { + g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", NULL); + } else if (!strcmp (lcase, "restricted")) { + g_object_set (s_wireless_sec, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "shared", NULL); + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid WEP authentication algorithm '%s'", + lcase); + g_free (lcase); + goto error; + } + g_free (lcase); + } + + if ( !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 0) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 1) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 2) + && !nm_setting_wireless_security_get_wep_key (s_wireless_sec, 3) + && !nm_setting_wireless_security_get_wep_tx_keyidx (s_wireless_sec)) { + const char *auth_alg; + + auth_alg = nm_setting_wireless_security_get_auth_alg (s_wireless_sec); + if (auth_alg && !strcmp (auth_alg, "shared")) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "WEP Shared Key authentication is invalid for " + "unencrypted connections."); + goto error; + } + + /* Unencrypted */ + g_object_unref (s_wireless_sec); + s_wireless_sec = NULL; + } + + return (NMSetting *) s_wireless_sec; + +error: + if (s_wireless_sec) + g_object_unref (s_wireless_sec); + return NULL; +} + +static gboolean +fill_wpa_ciphers (shvarFile *ifcfg, + NMSettingWirelessSecurity *wsec, + gboolean group, + gboolean adhoc) +{ + char *value = NULL, *p; + char **list = NULL, **iter; + int i = 0; + + p = value = svGetValue (ifcfg, group ? "CIPHER_GROUP" : "CIPHER_PAIRWISE", TRUE); + if (!value) + return TRUE; + + /* Strip quotes */ + if (p[0] == '"') + p++; + if (p[strlen (p) - 1] == '"') + p[strlen (p) - 1] = '\0'; + + list = g_strsplit_set (p, " ", 0); + for (iter = list; iter && *iter; iter++, i++) { + /* Ad-Hoc configurations cannot have pairwise ciphers, and can only + * have one group cipher. Ignore any additional group ciphers and + * any pairwise ciphers specified. + */ + if (adhoc) { + if (group && (i > 0)) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: ignoring group cipher '%s' (only one group cipher allowed in Ad-Hoc mode)", + *iter); + continue; + } else if (!group) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: ignoring pairwise cipher '%s' (pairwise not used in Ad-Hoc mode)", + *iter); + continue; + } + } + + if (!strcmp (*iter, "CCMP")) { + if (group) + nm_setting_wireless_security_add_group (wsec, "ccmp"); + else + nm_setting_wireless_security_add_pairwise (wsec, "ccmp"); + } else if (!strcmp (*iter, "TKIP")) { + if (group) + nm_setting_wireless_security_add_group (wsec, "tkip"); + else + nm_setting_wireless_security_add_pairwise (wsec, "tkip"); + } else if (group && !strcmp (*iter, "WEP104")) + nm_setting_wireless_security_add_group (wsec, "wep104"); + else if (group && !strcmp (*iter, "WEP40")) + nm_setting_wireless_security_add_group (wsec, "wep40"); + else { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: ignoring invalid %s cipher '%s'", + group ? "CIPHER_GROUP" : "CIPHER_PAIRWISE", + *iter); + } + } + + if (list) + g_strfreev (list); + g_free (value); + return TRUE; +} + +#define WPA_PMK_LEN 32 + +static char * +parse_wpa_psk (shvarFile *ifcfg, + const char *file, + const GByteArray *ssid, + GError **error) +{ + shvarFile *keys_ifcfg; + char *psk = NULL, *p, *hashed = NULL; + gboolean quoted = FALSE; + + /* Passphrase must be between 10 and 66 characters in length becuase WPA + * hex keys are exactly 64 characters (no quoting), and WPA passphrases + * are between 8 and 63 characters (inclusive), plus optional quoting if + * the passphrase contains spaces. + */ + + /* Try to get keys from the "shadow" key file */ + keys_ifcfg = utils_get_keys_ifcfg (file, FALSE); + if (keys_ifcfg) { + psk = svGetValue (keys_ifcfg, "WPA_PSK", TRUE); + svCloseFile (keys_ifcfg); + } + + /* Fall back to the original ifcfg */ + if (!psk) + psk = svGetValue (ifcfg, "WPA_PSK", TRUE); + + if (!psk) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing WPA_PSK for WPA-PSK key management"); + return NULL; + } + + p = psk; + + if (p[0] == '"' && psk[strlen (psk) - 1] == '"') + quoted = TRUE; + + if (!quoted && (strlen (psk) == 64)) { + /* Verify the hex PSK; 64 digits */ + while (*p) { + if (!isxdigit (*p++)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid WPA_PSK (contains non-hexadecimal characters)"); + goto out; + } + } + hashed = g_strdup (psk); + } else { + /* Prior to 4f6eef9e77265484555663cf666cde4fa8323469 and + * 28e2e446868b94b92edc4a82aa0bf1e3eda8ec54 the writer may not have + * properly quoted passphrases, so just handle anything that's unquoted + * and between 8 and 63 characters as a passphrase. + */ + + if (quoted) { + /* Get rid of the quotes */ + p++; + p[strlen (p) - 1] = '\0'; + } + + /* Length check */ + if (strlen (p) < 8 || strlen (p) > 63) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid WPA_PSK (passphrases must be between " + "8 and 63 characters long (inclusive))"); + goto out; + } + + hashed = g_strdup (p); + } + + if (!hashed) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid WPA_PSK (doesn't look like a passphrase or hex key)"); + goto out; + } + +out: + g_free (psk); + return hashed; +} + +typedef struct { + const char *method; + gboolean (*reader)(const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error); + gboolean wifi_phase2_only; +} EAPReader; + +static EAPReader eap_readers[] = { + { "md5", eap_simple_reader, TRUE }, + { "pap", eap_simple_reader, TRUE }, + { "chap", eap_simple_reader, TRUE }, + { "mschap", eap_simple_reader, TRUE }, + { "mschapv2", eap_simple_reader, TRUE }, + { "leap", eap_simple_reader, TRUE }, + { "tls", eap_tls_reader, FALSE }, + { "peap", eap_peap_reader, FALSE }, + { "ttls", eap_ttls_reader, FALSE }, + { NULL, NULL } +}; + +static gboolean +eap_simple_reader (const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error) +{ + char *value; + + value = svGetValue (ifcfg, "IEEE_8021X_IDENTITY", FALSE); + if (!value) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IEEE_8021X_IDENTITY for EAP method '%s'.", + eap_method); + return FALSE; + } + g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, value, NULL); + g_free (value); + + value = svGetValue (ifcfg, "IEEE_8021X_PASSWORD", FALSE); + if (!value && keys) { + /* Try the lookaside keys file */ + value = svGetValue (keys, "IEEE_8021X_PASSWORD", FALSE); + } + + if (!value) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IEEE_8021X_PASSWORD for EAP method '%s'.", + eap_method); + return FALSE; + } + + g_object_set (s_8021x, NM_SETTING_802_1X_PASSWORD, value, NULL); + g_free (value); + + return TRUE; +} + +static char * +get_cert_file (const char *ifcfg_path, const char *cert_path) +{ + const char *base = cert_path; + char *p, *ret, *dirname; + + g_return_val_if_fail (ifcfg_path != NULL, NULL); + g_return_val_if_fail (cert_path != NULL, NULL); + + if (cert_path[0] == '/') + return g_strdup (cert_path); + + p = strrchr (cert_path, '/'); + if (p) + base = p + 1; + + dirname = g_path_get_dirname (ifcfg_path); + ret = g_build_path ("/", dirname, base, NULL); + g_free (dirname); + return ret; +} + +static gboolean +eap_tls_reader (const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error) +{ + char *value; + char *ca_cert = NULL; + char *real_path = NULL; + char *client_cert = NULL; + char *privkey = NULL; + char *privkey_password = NULL; + gboolean success = FALSE; + NMSetting8021xCKFormat privkey_format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN; + + value = svGetValue (ifcfg, "IEEE_8021X_IDENTITY", FALSE); + if (!value) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IEEE_8021X_IDENTITY for EAP method '%s'.", + eap_method); + return FALSE; + } + g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, value, NULL); + g_free (value); + + ca_cert = svGetValue (ifcfg, + phase2 ? "IEEE_8021X_INNER_CA_CERT" : "IEEE_8021X_CA_CERT", + FALSE); + if (ca_cert) { + real_path = get_cert_file (ifcfg->fileName, ca_cert); + if (phase2) { + if (!nm_setting_802_1x_set_phase2_ca_cert (s_8021x, + real_path, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + error)) + goto done; + } else { + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + real_path, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + error)) + goto done; + } + } else { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: missing %s for EAP" + " method '%s'; this is insecure!", + phase2 ? "IEEE_8021X_INNER_CA_CERT" : "IEEE_8021X_CA_CERT", + eap_method); + } + + /* Private key password */ + privkey_password = svGetValue (ifcfg, + phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD": "IEEE_8021X_PRIVATE_KEY_PASSWORD", + FALSE); + if (!privkey_password && keys) { + /* Try the lookaside keys file */ + privkey_password = svGetValue (keys, + phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD": "IEEE_8021X_PRIVATE_KEY_PASSWORD", + FALSE); + } + + if (!privkey_password) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing %s for EAP method '%s'.", + phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD" : "IEEE_8021X_PRIVATE_KEY_PASSWORD", + eap_method); + goto done; + } + + /* The private key itself */ + privkey = svGetValue (ifcfg, + phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY" : "IEEE_8021X_PRIVATE_KEY", + FALSE); + if (!privkey) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing %s for EAP method '%s'.", + phase2 ? "IEEE_8021X_INNER_PRIVATE_KEY" : "IEEE_8021X_PRIVATE_KEY", + eap_method); + goto done; + } + + g_free (real_path); + real_path = get_cert_file (ifcfg->fileName, privkey); + if (phase2) { + if (!nm_setting_802_1x_set_phase2_private_key (s_8021x, + real_path, + privkey_password, + NM_SETTING_802_1X_CK_SCHEME_PATH, + &privkey_format, + error)) + goto done; + } else { + if (!nm_setting_802_1x_set_private_key (s_8021x, + real_path, + privkey_password, + NM_SETTING_802_1X_CK_SCHEME_PATH, + &privkey_format, + error)) + goto done; + } + + /* Only set the client certificate if the private key is not PKCS#12 format, + * as NM (due to supplicant restrictions) requires. If the key was PKCS#12, + * then nm_setting_802_1x_set_private_key() already set the client certificate + * to the same value as the private key. + */ + if ( privkey_format == NM_SETTING_802_1X_CK_FORMAT_RAW_KEY + || privkey_format == NM_SETTING_802_1X_CK_FORMAT_X509) { + client_cert = svGetValue (ifcfg, + phase2 ? "IEEE_8021X_INNER_CLIENT_CERT" : "IEEE_8021X_CLIENT_CERT", + FALSE); + if (!client_cert) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing %s for EAP method '%s'.", + phase2 ? "IEEE_8021X_INNER_CLIENT_CERT" : "IEEE_8021X_CLIENT_CERT", + eap_method); + goto done; + } + + g_free (real_path); + real_path = get_cert_file (ifcfg->fileName, client_cert); + if (phase2) { + if (!nm_setting_802_1x_set_phase2_client_cert (s_8021x, + real_path, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + error)) + goto done; + } else { + if (!nm_setting_802_1x_set_client_cert (s_8021x, + real_path, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + error)) + goto done; + } + } + + success = TRUE; + +done: + g_free (real_path); + g_free (ca_cert); + g_free (client_cert); + g_free (privkey); + g_free (privkey_password); + return success; +} + +static gboolean +eap_peap_reader (const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error) +{ + char *ca_cert = NULL; + char *real_cert_path = NULL; + char *inner_auth = NULL; + char *peapver = NULL; + char *lower; + char **list = NULL, **iter; + gboolean success = FALSE; + + ca_cert = svGetValue (ifcfg, "IEEE_8021X_CA_CERT", FALSE); + if (ca_cert) { + real_cert_path = get_cert_file (ifcfg->fileName, ca_cert); + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + real_cert_path, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + error)) + goto done; + } else { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: missing " + "IEEE_8021X_CA_CERT for EAP method '%s'; this is" + " insecure!", + eap_method); + } + + peapver = svGetValue (ifcfg, "IEEE_8021X_PEAP_VERSION", FALSE); + if (peapver) { + if (!strcmp (peapver, "0")) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPVER, "0", NULL); + else if (!strcmp (peapver, "1")) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPVER, "1", NULL); + else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Unknown IEEE_8021X_PEAP_VERSION value '%s'", + peapver); + goto done; + } + } + + if (svTrueValue (ifcfg, "IEEE_8021X_PEAP_FORCE_NEW_LABEL", FALSE)) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE1_PEAPLABEL, "1", NULL); + + inner_auth = svGetValue (ifcfg, "IEEE_8021X_INNER_AUTH_METHODS", FALSE); + if (!inner_auth) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IEEE_8021X_INNER_AUTH_METHODS."); + goto done; + } + + /* Handle options for the inner auth method */ + list = g_strsplit (inner_auth, " ", 0); + for (iter = list; iter && *iter; iter++) { + if (!strlen (*iter)) + continue; + + if ( !strcmp (*iter, "MSCHAPV2") + || !strcmp (*iter, "MD5") + || !strcmp (*iter, "GTC")) { + if (!eap_simple_reader (*iter, ifcfg, keys, s_8021x, TRUE, error)) + goto done; + } else if (!strcmp (*iter, "TLS")) { + if (!eap_tls_reader (*iter, ifcfg, keys, s_8021x, TRUE, error)) + goto done; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Unknown IEEE_8021X_INNER_AUTH_METHOD '%s'.", + *iter); + goto done; + } + + lower = g_ascii_strdown (*iter, -1); + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, lower, NULL); + g_free (lower); + break; + } + + if (!nm_setting_802_1x_get_phase2_auth (s_8021x)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "No valid IEEE_8021X_INNER_AUTH_METHODS found."); + goto done; + } + + success = TRUE; + +done: + if (list) + g_strfreev (list); + g_free (inner_auth); + g_free (peapver); + g_free (real_cert_path); + g_free (ca_cert); + return success; +} + +static gboolean +eap_ttls_reader (const char *eap_method, + shvarFile *ifcfg, + shvarFile *keys, + NMSetting8021x *s_8021x, + gboolean phase2, + GError **error) +{ + gboolean success = FALSE; + char *anon_ident = NULL; + char *ca_cert = NULL; + char *real_cert_path = NULL; + char *inner_auth = NULL; + char *tmp; + char **list = NULL, **iter; + + ca_cert = svGetValue (ifcfg, "IEEE_8021X_CA_CERT", FALSE); + if (ca_cert) { + real_cert_path = get_cert_file (ifcfg->fileName, ca_cert); + if (!nm_setting_802_1x_set_ca_cert (s_8021x, + real_cert_path, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + error)) + goto done; + } else { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: missing " + "IEEE_8021X_CA_CERT for EAP method '%s'; this is" + " insecure!", + eap_method); + } + + anon_ident = svGetValue (ifcfg, "IEEE_8021X_ANON_IDENTITY", FALSE); + if (anon_ident && strlen (anon_ident)) + g_object_set (s_8021x, NM_SETTING_802_1X_ANONYMOUS_IDENTITY, anon_ident, NULL); + + tmp = svGetValue (ifcfg, "IEEE_8021X_INNER_AUTH_METHODS", FALSE); + if (!tmp) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IEEE_8021X_INNER_AUTH_METHODS."); + goto done; + } + + inner_auth = g_ascii_strdown (tmp, -1); + g_free (tmp); + + /* Handle options for the inner auth method */ + list = g_strsplit (inner_auth, " ", 0); + for (iter = list; iter && *iter; iter++) { + if (!strlen (*iter)) + continue; + + if ( !strcmp (*iter, "mschapv2") + || !strcmp (*iter, "mschap") + || !strcmp (*iter, "pap") + || !strcmp (*iter, "chap")) { + if (!eap_simple_reader (*iter, ifcfg, keys, s_8021x, TRUE, error)) + goto done; + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, *iter, NULL); + } else if (!strcmp (*iter, "eap-tls")) { + if (!eap_tls_reader (*iter, ifcfg, keys, s_8021x, TRUE, error)) + goto done; + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, "tls", NULL); + } else if (!strcmp (*iter, "eap-mschapv2") || !strcmp (*iter, "eap-md5")) { + if (!eap_simple_reader (*iter, ifcfg, keys, s_8021x, TRUE, error)) + goto done; + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, (*iter + strlen ("eap-")), NULL); + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Unknown IEEE_8021X_INNER_AUTH_METHOD '%s'.", + *iter); + goto done; + } + break; + } + + success = TRUE; + +done: + if (list) + g_strfreev (list); + g_free (inner_auth); + g_free (real_cert_path); + g_free (ca_cert); + g_free (anon_ident); + return success; +} + +static NMSetting8021x * +fill_8021x (shvarFile *ifcfg, + const char *file, + const char *key_mgmt, + gboolean wifi, + GError **error) +{ + NMSetting8021x *s_8021x; + shvarFile *keys = NULL; + char *value; + char **list, **iter; + + value = svGetValue (ifcfg, "IEEE_8021X_EAP_METHODS", FALSE); + if (!value) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing IEEE_8021X_EAP_METHODS for key management '%s'", + key_mgmt); + return NULL; + } + + list = g_strsplit (value, " ", 0); + g_free (value); + + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + + /* Read in the lookaside keys file, if present */ + keys = utils_get_keys_ifcfg (file, FALSE); + + /* Validate and handle each EAP method */ + for (iter = list; iter && *iter; iter++) { + EAPReader *eap = &eap_readers[0]; + gboolean found = FALSE; + char *lower = NULL; + + lower = g_ascii_strdown (*iter, -1); + while (eap->method && !found) { + if (strcmp (eap->method, lower)) + goto next; + + /* Some EAP methods don't provide keying material, thus they + * cannot be used with WiFi unless they are an inner method + * used with TTLS or PEAP or whatever. + */ + if (wifi && eap->wifi_phase2_only) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: ignored invalid " + "IEEE_8021X_EAP_METHOD '%s'; not allowed for wifi.", + lower); + goto next; + } + + /* Parse EAP method specific options */ + if (!(*eap->reader)(lower, ifcfg, keys, s_8021x, FALSE, error)) { + g_free (lower); + goto error; + } + nm_setting_802_1x_add_eap_method (s_8021x, lower); + found = TRUE; + + next: + eap++; + } + + if (!found) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: ignored unknown" + "IEEE_8021X_EAP_METHOD '%s'.", + lower); + } + g_free (lower); + } + g_strfreev (list); + + if (nm_setting_802_1x_get_num_eap_methods (s_8021x) == 0) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "No valid EAP methods found in IEEE_8021X_EAP_METHODS."); + goto error; + } + + if (keys) + svCloseFile (keys); + return s_8021x; + +error: + if (keys) + svCloseFile (keys); + g_object_unref (s_8021x); + return NULL; +} + +static NMSetting * +make_wpa_setting (shvarFile *ifcfg, + const char *file, + const GByteArray *ssid, + gboolean adhoc, + NMSetting8021x **s_8021x, + GError **error) +{ + NMSettingWirelessSecurity *wsec; + char *value, *psk, *lower; + + wsec = NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); + + value = svGetValue (ifcfg, "KEY_MGMT", FALSE); + if (!value) + goto error; /* Not WPA or Dynamic WEP */ + + /* Pairwise and Group ciphers */ + fill_wpa_ciphers (ifcfg, wsec, FALSE, adhoc); + fill_wpa_ciphers (ifcfg, wsec, TRUE, adhoc); + + /* WPA and/or RSN */ + if (adhoc) { + /* Ad-Hoc mode only supports WPA proto for now */ + nm_setting_wireless_security_add_proto (wsec, "wpa"); + } else { + char *allow_wpa, *allow_rsn; + + allow_wpa = svGetValue (ifcfg, "WPA_ALLOW_WPA", FALSE); + allow_rsn = svGetValue (ifcfg, "WPA_ALLOW_WPA2", FALSE); + + if (allow_wpa && svTrueValue (ifcfg, "WPA_ALLOW_WPA", TRUE)) + nm_setting_wireless_security_add_proto (wsec, "wpa"); + if (allow_rsn && svTrueValue (ifcfg, "WPA_ALLOW_WPA2", TRUE)) + nm_setting_wireless_security_add_proto (wsec, "rsn"); + + /* If neither WPA_ALLOW_WPA or WPA_ALLOW_WPA2 were present, default + * to both WPA and RSN allowed. + */ + if (!allow_wpa && !allow_rsn) { + nm_setting_wireless_security_add_proto (wsec, "wpa"); + nm_setting_wireless_security_add_proto (wsec, "rsn"); + } + + g_free (allow_wpa); + g_free (allow_rsn); + } + + if (!strcmp (value, "WPA-PSK")) { + psk = parse_wpa_psk (ifcfg, file, ssid, error); + if (!psk) + goto error; + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_PSK, psk, NULL); + g_free (psk); + + if (adhoc) + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-none", NULL); + else + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", NULL); + } else if (!strcmp (value, "WPA-EAP") || !strcmp (value, "IEEE8021X")) { + /* Adhoc mode is mutually exclusive with any 802.1x-based authentication */ + if (adhoc) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Ad-Hoc mode cannot be used with KEY_MGMT type '%s'", value); + goto error; + } + + *s_8021x = fill_8021x (ifcfg, file, value, TRUE, error); + if (!*s_8021x) + goto error; + + lower = g_ascii_strdown (value, -1); + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, lower, NULL); + g_free (lower); + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Unknown wireless KEY_MGMT type '%s'", value); + goto error; + } + + g_free (value); + return (NMSetting *) wsec; + +error: + g_free (value); + if (wsec) + g_object_unref (wsec); + return NULL; +} + +static NMSetting * +make_leap_setting (shvarFile *ifcfg, + const char *file, + GError **error) +{ + NMSettingWirelessSecurity *wsec; + shvarFile *keys_ifcfg; + char *value; + + wsec = NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); + + value = svGetValue (ifcfg, "KEY_MGMT", FALSE); + if (!value || strcmp (value, "IEEE8021X")) + goto error; /* Not LEAP */ + + g_free (value); + value = svGetValue (ifcfg, "SECURITYMODE", FALSE); + if (!value || strcasecmp (value, "leap")) + goto error; /* Not LEAP */ + + g_free (value); + + value = svGetValue (ifcfg, "IEEE_8021X_PASSWORD", FALSE); + if (!value) { + /* Try to get keys from the "shadow" key file */ + keys_ifcfg = utils_get_keys_ifcfg (file, FALSE); + if (keys_ifcfg) { + value = svGetValue (keys_ifcfg, "IEEE_8021X_PASSWORD", FALSE); + svCloseFile (keys_ifcfg); + } + } + if (value && strlen (value)) + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, value, NULL); + g_free (value); + + value = svGetValue (ifcfg, "IEEE_8021X_IDENTITY", FALSE); + if (!value || !strlen (value)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing LEAP identity"); + goto error; + } + g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, value, NULL); + g_free (value); + + g_object_set (wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "leap", + NULL); + + return (NMSetting *) wsec; + +error: + g_free (value); + if (wsec) + g_object_unref (wsec); + return NULL; +} + +static NMSetting * +make_wireless_security_setting (shvarFile *ifcfg, + const char *file, + const GByteArray *ssid, + gboolean adhoc, + NMSetting8021x **s_8021x, + GError **error) +{ + NMSetting *wsec; + + if (!adhoc) { + wsec = make_leap_setting (ifcfg, file, error); + if (wsec) + return wsec; + else if (*error) + return NULL; + } + + wsec = make_wpa_setting (ifcfg, file, ssid, adhoc, s_8021x, error); + if (wsec) + return wsec; + else if (*error) + return NULL; + + wsec = make_wep_setting (ifcfg, file, error); + if (wsec) + return wsec; + else if (*error) + return NULL; + + return NULL; /* unencrypted */ +} + +static NMSetting * +make_wireless_setting (shvarFile *ifcfg, + gboolean nm_controlled, + char **unmanaged, + GError **error) +{ + NMSettingWireless *s_wireless; + GByteArray *array = NULL; + char *value; + + s_wireless = NM_SETTING_WIRELESS (nm_setting_wireless_new ()); + + if (read_mac_address (ifcfg, &array, error)) { + if (array) { + g_object_set (s_wireless, NM_SETTING_WIRELESS_MAC_ADDRESS, array, NULL); + + /* A connection can only be unmanaged if we know the MAC address */ + if (!nm_controlled) { + *unmanaged = g_strdup_printf ("mac:%02x:%02x:%02x:%02x:%02x:%02x", + array->data[0], array->data[1], array->data[2], + array->data[3], array->data[4], array->data[5]); + } + + g_byte_array_free (array, TRUE); + } else if (!nm_controlled) { + /* If NM_CONTROLLED=no but there wasn't a MAC address, notify + * the user that the device cannot be unmanaged. + */ + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: NM_CONTROLLED was false but HWADDR was missing; device will be managed"); + } + } else { + g_object_unref (s_wireless); + return NULL; + } + + value = svGetValue (ifcfg, "ESSID", TRUE); + if (value) { + gsize ssid_len = 0, value_len = strlen (value); + char *p = value, *tmp; + char buf[33]; + + ssid_len = value_len; + if ( (value_len >= 2) + && (value[0] == '"') + && (value[value_len - 1] == '"')) { + /* Strip the quotes and unescape */ + p = value + 1; + value[value_len - 1] = '\0'; + svUnescape (p); + ssid_len = strlen (p); + } else if ((value_len > 2) && (strncmp (value, "0x", 2) == 0)) { + /* Hex representation */ + if (value_len % 2) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid SSID '%s' size (looks like hex but length not multiple of 2)", + value); + g_free (value); + goto error; + } + + p = value + 2; + while (*p) { + if (!isxdigit (*p)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)", + value, *p); + g_free (value); + goto error; + } + p++; + } + + tmp = utils_hexstr2bin (value + 2, value_len - 2); + ssid_len = (value_len - 2) / 2; + memcpy (buf, tmp, ssid_len); + p = &buf[0]; + } + + if (ssid_len > 32 || ssid_len == 0) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid SSID '%s' (size %zu not between 1 and 32 inclusive)", + value, ssid_len); + g_free (value); + goto error; + } + + array = g_byte_array_sized_new (ssid_len); + g_byte_array_append (array, (const guint8 *) p, ssid_len); + g_object_set (s_wireless, NM_SETTING_WIRELESS_SSID, array, NULL); + g_byte_array_free (array, TRUE); + g_free (value); + } else { + /* Only fail on lack of SSID if device is managed */ + if (nm_controlled) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, "Missing SSID"); + goto error; + } + } + + if (!nm_controlled) + goto done; + + value = svGetValue (ifcfg, "MODE", FALSE); + if (value) { + char *lcase; + const char *mode = NULL; + + lcase = g_ascii_strdown (value, -1); + g_free (value); + + if (!strcmp (lcase, "ad-hoc")) { + mode = "adhoc"; + } else if (!strcmp (lcase, "managed") || !strcmp (lcase, "auto")) { + mode = "infrastructure"; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid mode '%s' (not 'Ad-Hoc', 'Managed', or 'Auto')", + lcase); + g_free (lcase); + goto error; + } + g_free (lcase); + + g_object_set (s_wireless, NM_SETTING_WIRELESS_MODE, mode, NULL); + } + + value = svGetValue (ifcfg, "BSSID", FALSE); + if (value) { + struct ether_addr *eth; + GByteArray *bssid; + + eth = ether_aton (value); + if (!eth) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid BSSID '%s'", value); + goto error; + } + + bssid = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (bssid, eth->ether_addr_octet, ETH_ALEN); + g_object_set (s_wireless, NM_SETTING_WIRELESS_BSSID, bssid, NULL); + g_byte_array_free (bssid, TRUE); + } + + value = svGetValue (ifcfg, "CHANNEL", FALSE); + if (value) { + long int chan; + + errno = 0; + chan = strtol (value, NULL, 10); + if (errno || chan <= 0 || chan > 196) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid wireless channel '%s'", value); + g_free (value); + goto error; + } + g_object_set (s_wireless, NM_SETTING_WIRELESS_CHANNEL, (guint32) chan, NULL); + if (chan > 14) + g_object_set (s_wireless, NM_SETTING_WIRELESS_BAND, "a", NULL); + else + g_object_set (s_wireless, NM_SETTING_WIRELESS_BAND, "bg", NULL); + } + + value = svGetValue (ifcfg, "MTU", FALSE); + if (value) { + long int mtu; + + errno = 0; + mtu = strtol (value, NULL, 10); + if (errno || mtu < 0 || mtu > 50000) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid wireless MTU '%s'", value); + g_free (value); + goto error; + } + g_object_set (s_wireless, NM_SETTING_WIRELESS_MTU, (guint32) mtu, NULL); + } + +done: + return NM_SETTING (s_wireless); + +error: + if (s_wireless) + g_object_unref (s_wireless); + return NULL; +} + +static NMConnection * +wireless_connection_from_ifcfg (const char *file, + shvarFile *ifcfg, + gboolean nm_controlled, + char **unmanaged, + GError **error) +{ + NMConnection *connection = NULL; + NMSetting *con_setting = NULL; + NMSetting *wireless_setting = NULL; + NMSetting8021x *s_8021x = NULL; + const GByteArray *ssid; + NMSetting *security_setting = NULL; + char *printable_ssid = NULL; + const char *mode; + gboolean adhoc = FALSE; + + 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); + + connection = nm_connection_new (); + if (!connection) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Failed to allocate new connection for %s.", file); + return NULL; + } + + /* Wireless */ + wireless_setting = make_wireless_setting (ifcfg, nm_controlled, unmanaged, error); + if (!wireless_setting) { + g_object_unref (connection); + return NULL; + } + nm_connection_add_setting (connection, wireless_setting); + + ssid = nm_setting_wireless_get_ssid (NM_SETTING_WIRELESS (wireless_setting)); + if (ssid) + printable_ssid = nm_utils_ssid_to_utf8 ((const char *) ssid->data, ssid->len); + else + printable_ssid = g_strdup_printf ("unmanaged"); + + if (nm_controlled) { + mode = nm_setting_wireless_get_mode (NM_SETTING_WIRELESS (wireless_setting)); + if (mode && !strcmp (mode, "adhoc")) + adhoc = TRUE; + + /* Wireless security */ + security_setting = make_wireless_security_setting (ifcfg, file, ssid, adhoc, &s_8021x, error); + if (*error) { + g_object_unref (connection); + return NULL; + } + if (security_setting) { + nm_connection_add_setting (connection, security_setting); + if (s_8021x) + nm_connection_add_setting (connection, NM_SETTING (s_8021x)); + + g_object_set (wireless_setting, NM_SETTING_WIRELESS_SEC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL); + } + } + + /* Connection */ + con_setting = make_connection_setting (file, ifcfg, + NM_SETTING_WIRELESS_SETTING_NAME, + printable_ssid); + g_free (printable_ssid); + if (!con_setting) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Failed to create connection setting."); + g_object_unref (connection); + return NULL; + } + nm_connection_add_setting (connection, con_setting); + + /* Don't verify if unmanaged since we may not have an SSID or whatever */ + if (nm_controlled) { + if (!nm_connection_verify (connection, error)) { + g_object_unref (connection); + return NULL; + } + } + + return connection; +} + +static NMSetting * +make_wired_setting (shvarFile *ifcfg, + const char *file, + gboolean nm_controlled, + char **unmanaged, + NMSetting8021x **s_8021x, + GError **error) +{ + NMSettingWired *s_wired; + char *value = NULL; + int mtu; + GByteArray *mac = NULL; + + s_wired = NM_SETTING_WIRED (nm_setting_wired_new ()); + + value = svGetValue (ifcfg, "MTU", FALSE); + if (value) { + if (get_int (value, &mtu)) { + if (mtu >= 0 && mtu < 65536) + g_object_set (s_wired, NM_SETTING_WIRED_MTU, mtu, NULL); + } else { + /* Shouldn't be fatal... */ + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid MTU '%s'", value); + } + g_free (value); + } + + if (read_mac_address (ifcfg, &mac, error)) { + if (mac) { + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL); + + /* A connection can only be unmanaged if we know the MAC address */ + if (!nm_controlled) { + *unmanaged = g_strdup_printf ("mac:%02x:%02x:%02x:%02x:%02x:%02x", + mac->data[0], mac->data[1], mac->data[2], + mac->data[3], mac->data[4], mac->data[5]); + } + + g_byte_array_free (mac, TRUE); + } else if (!nm_controlled) { + /* If NM_CONTROLLED=no but there wasn't a MAC address, notify + * the user that the device cannot be unmanaged. + */ + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: NM_CONTROLLED was false but HWADDR was missing; device will be managed"); + } + } else { + g_object_unref (s_wired); + s_wired = NULL; + } + + value = svGetValue (ifcfg, "KEY_MGMT", FALSE); + if (value) { + if (!strcmp (value, "IEEE8021X")) { + *s_8021x = fill_8021x (ifcfg, file, value, FALSE, error); + if (!*s_8021x) + goto error; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Unknown wired KEY_MGMT type '%s'", value); + goto error; + } + g_free (value); + } + + return (NMSetting *) s_wired; + +error: + g_free (value); + g_object_unref (s_wired); + return NULL; +} + +static NMConnection * +wired_connection_from_ifcfg (const char *file, + shvarFile *ifcfg, + gboolean nm_controlled, + char **unmanaged, + GError **error) +{ + NMConnection *connection = NULL; + NMSetting *con_setting = NULL; + NMSetting *wired_setting = NULL; + NMSetting8021x *s_8021x = NULL; + + g_return_val_if_fail (file != NULL, NULL); + g_return_val_if_fail (ifcfg != NULL, NULL); + + connection = nm_connection_new (); + if (!connection) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Failed to allocate new connection for %s.", file); + return NULL; + } + + con_setting = make_connection_setting (file, ifcfg, NM_SETTING_WIRED_SETTING_NAME, NULL); + if (!con_setting) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Failed to create connection setting."); + g_object_unref (connection); + return NULL; + } + nm_connection_add_setting (connection, con_setting); + + wired_setting = make_wired_setting (ifcfg, file, nm_controlled, unmanaged, &s_8021x, error); + if (!wired_setting) { + g_object_unref (connection); + return NULL; + } + nm_connection_add_setting (connection, wired_setting); + + if (s_8021x) + nm_connection_add_setting (connection, NM_SETTING (s_8021x)); + + if (!nm_connection_verify (connection, error)) { + g_object_unref (connection); + return NULL; + } + + return connection; +} + +static gboolean +is_wireless_device (const char *iface) +{ + int fd; + struct iw_range range; + struct iwreq wrq; + gboolean is_wireless = FALSE; + + g_return_val_if_fail (iface != NULL, FALSE); + + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (!fd) + return FALSE; + + memset (&wrq, 0, sizeof (struct iwreq)); + memset (&range, 0, sizeof (struct iw_range)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + wrq.u.data.pointer = (caddr_t) ⦥ + wrq.u.data.length = sizeof (struct iw_range); + + if (ioctl (fd, SIOCGIWRANGE, &wrq) == 0) + is_wireless = TRUE; + else { + if (errno == EOPNOTSUPP) + is_wireless = FALSE; + else { + /* Sigh... some wired devices (kvm/qemu) return EINVAL when the + * device is down even though it's not a wireless device. So try + * IWNAME as a fallback. + */ + memset (&wrq, 0, sizeof (struct iwreq)); + strncpy (wrq.ifr_name, iface, IFNAMSIZ); + if (ioctl (fd, SIOCGIWNAME, &wrq) == 0) + is_wireless = TRUE; + } + } + + close (fd); + return is_wireless; +} + +NMConnection * +connection_from_file (const char *filename, + const char *network_file, /* for unit tests only */ + const char *test_type, /* for unit tests only */ + const char *iscsiadm_path, /* for unit tests only */ + char **unmanaged, + char **keyfile, + char **routefile, + char **route6file, + GError **error, + gboolean *ignore_error) +{ + NMConnection *connection = NULL; + shvarFile *parsed; + char *type, *nmc = NULL, *bootproto; + NMSetting *s_ip4, *s_ip6; + const char *ifcfg_name = NULL; + gboolean nm_controlled = TRUE; + gboolean ip6_used = FALSE; + + g_return_val_if_fail (filename != NULL, NULL); + g_return_val_if_fail (unmanaged != NULL, NULL); + g_return_val_if_fail (*unmanaged == NULL, NULL); + g_return_val_if_fail (keyfile != NULL, NULL); + g_return_val_if_fail (*keyfile == NULL, NULL); + g_return_val_if_fail (routefile != NULL, NULL); + g_return_val_if_fail (*routefile == NULL, NULL); + g_return_val_if_fail (route6file != NULL, NULL); + g_return_val_if_fail (*route6file == NULL, NULL); + + /* Non-NULL only for unit tests; normally use /etc/sysconfig/network */ + if (!network_file) + network_file = SYSCONFDIR "/sysconfig/network"; + + if (!iscsiadm_path) + iscsiadm_path = SBINDIR "/iscsiadm"; + + ifcfg_name = utils_get_ifcfg_name (filename, TRUE); + if (!ifcfg_name) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Ignoring connection '%s' because it's not an ifcfg file.", filename); + return NULL; + } + + parsed = svNewFile (filename); + if (!parsed) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Couldn't parse file '%s'", filename); + return NULL; + } + + type = svGetValue (parsed, "TYPE", FALSE); + if (!type) { + char *device; + + /* If no type, if the device has wireless extensions, it's wifi, + * otherwise it's ethernet. + */ + device = svGetValue (parsed, "DEVICE", FALSE); + if (!device) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "File '%s' had neither TYPE nor DEVICE keys.", filename); + goto done; + } + + if (!strcmp (device, "lo")) { + *ignore_error = TRUE; + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Ignoring loopback device config."); + g_free (device); + goto done; + } + + if (!test_type) { + /* Test wireless extensions */ + if (is_wireless_device (device)) + type = g_strdup (TYPE_WIRELESS); + else + type = g_strdup (TYPE_ETHERNET); + } else { + /* For the unit tests, there won't necessarily be any + * adapters of the connection's type in the system so the + * type can't be tested with ioctls. + */ + type = g_strdup (test_type); + } + + g_free (device); + } + + nmc = svGetValue (parsed, "NM_CONTROLLED", FALSE); + if (nmc) { + char *lower; + + lower = g_ascii_strdown (nmc, -1); + g_free (nmc); + + if (!strcmp (lower, "no") || !strcmp (lower, "n") || !strcmp (lower, "false")) + nm_controlled = FALSE; + g_free (lower); + } + + if (!strcasecmp (type, TYPE_ETHERNET)) + connection = wired_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, error); + else if (!strcasecmp (type, TYPE_WIRELESS)) + connection = wireless_connection_from_ifcfg (filename, parsed, nm_controlled, unmanaged, error); + else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Unknown connection type '%s'", type); + } + + if (nm_controlled) { + g_free (*unmanaged); + *unmanaged = NULL; + } + + g_free (type); + + /* Don't bother reading the connection fully if it's unmanaged */ + if (!connection || *unmanaged) + goto done; + + s_ip6 = make_ip6_setting (parsed, network_file, iscsiadm_path, error); + if (*error) { + g_object_unref (connection); + connection = NULL; + goto done; + } else if (s_ip6) { + const char *method; + + nm_connection_add_setting (connection, s_ip6); + method = nm_setting_ip6_config_get_method (NM_SETTING_IP6_CONFIG (s_ip6)); + if (method && strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) + ip6_used = TRUE; + } + + s_ip4 = make_ip4_setting (parsed, network_file, iscsiadm_path, ip6_used, error); + if (*error) { + g_object_unref (connection); + connection = NULL; + goto done; + } else if (s_ip4) + nm_connection_add_setting (connection, s_ip4); + + /* iSCSI / ibft connections are read-only since their settings are + * stored in NVRAM and can only be changed in BIOS. + */ + bootproto = svGetValue (parsed, "BOOTPROTO", FALSE); + if ( bootproto + && connection + && !g_ascii_strcasecmp (bootproto, "ibft")) { + NMSettingConnection *s_con; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_assert (s_con); + + g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_READ_ONLY, TRUE, NULL); + } + + if (!nm_connection_verify (connection, error)) { + g_object_unref (connection); + connection = NULL; + } + + *keyfile = utils_get_keys_path (filename); + *routefile = utils_get_route_path (filename); + *route6file = utils_get_route6_path (filename); + +done: + svCloseFile (parsed); + return connection; +} + +const char * +reader_get_prefix (void) +{ + return _("System"); +} + diff --git a/system-settings/plugins/ifcfg-rh/reader.h b/system-settings/plugins/ifcfg-rh/reader.h new file mode 100644 index 00000000..2a031977 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/reader.h @@ -0,0 +1,42 @@ +/* -*- 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. + * + * Copyright (C) 2008 Red Hat, Inc. + */ + +#ifndef __READER_H__ +#define __READER_H__ + +#include +#include + +#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 */ + const char *iscsiadm_path, /* for unit tests only */ + char **unmanaged, + char **keyfile, + char **routefile, + char **route6file, + GError **error, + gboolean *ignore_error); + +const char *reader_get_prefix (void); + +#endif /* __READER_H__ */ diff --git a/system-settings/plugins/ifcfg-rh/shvar.c b/system-settings/plugins/ifcfg-rh/shvar.c new file mode 100644 index 00000000..1e15d76f --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/shvar.c @@ -0,0 +1,396 @@ +/* + * shvar.c + * + * Implementation of non-destructively reading/writing files containing + * only shell variable declarations and full-line comments. + * + * Includes explicit inheritance mechanism intended for use with + * Red Hat Linux ifcfg-* files. There is no protection against + * inheritance loops; they will generally cause stack overflows. + * Furthermore, they are only intended for one level of inheritance; + * the value setting algorithm assumes this. + * + * Copyright 1999,2000 Red Hat, Inc. + * + * This 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "shvar.h" + +/* Open the file , returning a shvarFile on success and NULL on failure. + Add a wrinkle to let the caller specify whether or not to create the file + (actually, return a structure anyway) if it doesn't exist. */ +static shvarFile * +svOpenFile(const char *name, gboolean create) +{ + shvarFile *s = NULL; + int closefd = 0; + + s = g_malloc0(sizeof(shvarFile)); + + s->fd = -1; + if (create) + s->fd = open(name, O_RDWR); /* NOT O_CREAT */ + + if (!create || s->fd == -1) { + /* try read-only */ + s->fd = open(name, O_RDONLY); /* NOT O_CREAT */ + if (s->fd != -1) closefd = 1; + } + s->fileName = g_strdup(name); + + if (s->fd != -1) { + struct stat buf; + char *p, *q; + + if (fstat(s->fd, &buf) < 0) goto bail; + s->arena = g_malloc0(buf.st_size + 1); + + if (read(s->fd, s->arena, buf.st_size) < 0) goto bail; + + /* we'd use g_strsplit() here, but we want a list, not an array */ + for(p = s->arena; (q = strchr(p, '\n')) != NULL; p = q + 1) { + s->lineList = g_list_append(s->lineList, g_strndup(p, q - p)); + } + + /* closefd is set if we opened the file read-only, so go ahead and + close it, because we can't write to it anyway */ + if (closefd) { + close(s->fd); + s->fd = -1; + } + + return s; + } + + if (create) { + return s; + } + +bail: + if (s->fd != -1) close(s->fd); + if (s->arena) g_free (s->arena); + if (s->fileName) g_free (s->fileName); + g_free (s); + return NULL; +} + +/* Open the file , return shvarFile on success, NULL on failure */ +shvarFile * +svNewFile(const char *name) +{ + return svOpenFile(name, FALSE); +} + +/* Create a new file structure, returning actual data if the file exists, + * and a suitable starting point if it doesn't. */ +shvarFile * +svCreateFile(const char *name) +{ + return svOpenFile(name, TRUE); +} + +/* remove escaped characters in place */ +void +svUnescape(char *s) { + int len, i; + + len = strlen(s); + if ((s[0] == '"' || s[0] == '\'') && s[0] == s[len-1]) { + i = len - 2; + if (i == 0) + s[0] = '\0'; + else { + memmove(s, s+1, i); + s[i+1] = '\0'; + len = i; + } + } + for (i = 0; i < len; i++) { + if (s[i] == '\\') { + memmove(s+i, s+i+1, len-(i+1)); + len--; + } + s[len] = '\0'; + } +} + + +/* create a new string with all necessary characters escaped. + * caller must free returned string + */ +static const char escapees[] = "\"'\\$~`"; /* must be escaped */ +static const char spaces[] = " \t|&;()<>"; /* only require "" */ +char * +svEscape(const char *s) { + char *new; + int i, j, mangle = 0, space = 0; + int newlen, slen; + static int esclen, splen; + + if (!esclen) esclen = strlen(escapees); + if (!splen) splen = strlen(spaces); + slen = strlen(s); + + for (i = 0; i < slen; i++) { + if (strchr(escapees, s[i])) mangle++; + if (strchr(spaces, s[i])) space++; + } + if (!mangle && !space) return strdup(s); + + newlen = slen + mangle + 3; /* 3 is extra ""\0 */ + new = g_malloc0(newlen); + if (!new) return NULL; + + j = 0; + new[j++] = '"'; + for (i = 0; i < slen; i++) { + if (strchr(escapees, s[i])) { + new[j++] = '\\'; + } + new[j++] = s[i]; + } + new[j++] = '"'; + g_assert(j == slen + mangle + 2); /* j is the index of the '\0' */ + + return new; +} + +/* Get the value associated with the key, and leave the current pointer + * pointing at the line containing the value. The char* returned MUST + * be freed by the caller. + */ +char * +svGetValue(shvarFile *s, const char *key, gboolean verbatim) +{ + char *value = NULL; + char *line; + char *keyString; + int len; + + g_assert(s); + g_assert(key); + + keyString = g_malloc0(strlen(key) + 2); + strcpy(keyString, key); + keyString[strlen(key)] = '='; + len = strlen(keyString); + + 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); + if (!verbatim) + svUnescape(value); + break; + } + } + g_free(keyString); + + if (value) { + if (value[0]) { + return value; + } else { + g_free(value); + return NULL; + } + } + if (s->parent) value = svGetValue(s->parent, key, verbatim); + return value; +} + +/* return 1 if resolves to any truth value (e.g. "yes", "y", "true") + * return 0 if resolves to any non-truth value (e.g. "no", "n", "false") + * return otherwise + */ +int +svTrueValue(shvarFile *s, const char *key, int def) +{ + char *tmp; + int returnValue = def; + + tmp = svGetValue(s, key, FALSE); + if (!tmp) return returnValue; + + if ( (!strcasecmp("yes", tmp)) || + (!strcasecmp("true", tmp)) || + (!strcasecmp("t", tmp)) || + (!strcasecmp("y", tmp)) ) returnValue = 1; + else + if ( (!strcasecmp("no", tmp)) || + (!strcasecmp("false", tmp)) || + (!strcasecmp("f", tmp)) || + (!strcasecmp("n", tmp)) ) returnValue = 0; + + g_free (tmp); + return returnValue; +} + + +/* Set the variable equal to the value . + * If does not exist, and the pointer is set, append + * the key=value pair after that line. Otherwise, prepend the pair + * to the top of the file. Here's the algorithm, as the C code + * seems to be rather dense: + * + * if (value == NULL), then: + * if val2 (parent): change line to key= or append line key= + * if val1 (this) : delete line + * else noop + * else use this table: + * val2 + * NULL value other + * v NULL append line noop append line + * a + * l value noop noop noop + * 1 + * other change line delete line change line + * + * No changes are ever made to the parent config file, only to the + * specific file passed on the command line. + * + */ +void +svSetValue(shvarFile *s, const char *key, const char *value, gboolean verbatim) +{ + char *newval = NULL, *val1 = NULL, *val2 = NULL; + char *keyValue; + + g_assert(s); + g_assert(key); + /* value may be NULL */ + + if (value) + newval = verbatim ? g_strdup(value) : svEscape(value); + keyValue = g_strdup_printf("%s=%s", key, newval ? newval : ""); + + val1 = svGetValue(s, key, FALSE); + if (val1 && newval && !strcmp(val1, newval)) goto bail; + if (s->parent) val2 = svGetValue(s->parent, key, FALSE); + + if (!newval || !newval[0]) { + /* delete value somehow */ + if (val2) { + /* change/append line to get key= */ + if (s->current) s->current->data = keyValue; + else s->lineList = g_list_append(s->lineList, keyValue); + s->modified = 1; + } else if (val1) { + /* delete line */ + s->lineList = g_list_remove_link(s->lineList, s->current); + g_list_free_1(s->current); + s->modified = 1; + goto bail; /* do not need keyValue */ + } + goto end; + } + + if (!val1) { + if (val2 && !strcmp(val2, newval)) goto end; + /* append line */ + s->lineList = g_list_append(s->lineList, keyValue); + s->modified = 1; + goto end; + } + + /* deal with a whole line of noops */ + if (val1 && !strcmp(val1, newval)) goto end; + + /* At this point, val1 && val1 != value */ + if (val2 && !strcmp(val2, newval)) { + /* delete line */ + s->lineList = g_list_remove_link(s->lineList, s->current); + g_list_free_1(s->current); + s->modified = 1; + goto bail; /* do not need keyValue */ + } else { + /* change line */ + if (s->current) s->current->data = keyValue; + else s->lineList = g_list_append(s->lineList, keyValue); + s->modified = 1; + } + +end: + if (newval) free(newval); + if (val1) free(val1); + if (val2) free(val2); + return; + +bail: + if (keyValue) free (keyValue); + goto end; +} + +/* Write the current contents iff modified. Returns -1 on error + * and 0 on success. Do not write if no values have been modified. + * The mode argument is only used if creating the file, not if + * re-writing an existing file, and is passed unchanged to the + * open() syscall. + */ +int +svWriteFile(shvarFile *s, int mode) +{ + FILE *f; + int tmpfd; + + if (s->modified) { + if (s->fd == -1) + s->fd = open(s->fileName, O_WRONLY|O_CREAT, mode); + if (s->fd == -1) + return -1; + if (ftruncate(s->fd, 0) < 0) + return -1; + + tmpfd = dup(s->fd); + f = fdopen(tmpfd, "w"); + fseek(f, 0, SEEK_SET); + for (s->current = s->lineList; s->current; s->current = s->current->next) { + char *line = s->current->data; + fprintf(f, "%s\n", line); + } + fclose(f); + } + + return 0; +} + + +/* Close the file descriptor (if open) and delete the shvarFile. + * Returns -1 on error and 0 on success. + */ +int +svCloseFile(shvarFile *s) +{ + + g_assert(s); + + if (s->fd != -1) close(s->fd); + + g_free(s->arena); + g_free(s->fileName); + g_list_foreach (s->lineList, (GFunc) g_free, NULL); + g_list_free(s->lineList); /* implicitly frees s->current */ + g_free(s); + return 0; +} diff --git a/system-settings/plugins/ifcfg-rh/shvar.h b/system-settings/plugins/ifcfg-rh/shvar.h new file mode 100644 index 00000000..4b650d2a --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/shvar.h @@ -0,0 +1,110 @@ +/* + * shvar.h + * + * Interface for non-destructively reading/writing files containing + * only shell variable declarations and full-line comments. + * + * Includes explicit inheritance mechanism intended for use with + * Red Hat Linux ifcfg-* files. There is no protection against + * inheritance loops; they will generally cause stack overflows. + * Furthermore, they are only intended for one level of inheritance; + * the value setting algorithm assumes this. + * + * Copyright 1999 Red Hat, Inc. + * + * This 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. + * + */ +#ifndef _SHVAR_H +#define _SHVAR_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef struct _shvarFile shvarFile; +struct _shvarFile { + char *fileName; /* read-only */ + int fd; /* read-only */ + char *arena; /* ignore */ + GList *lineList; /* read-only */ + GList *current; /* set implicitly or explicitly, + points to element of lineList */ + shvarFile *parent; /* set explicitly */ + int modified; /* ignore */ +}; + + +/* Create the file , return shvarFile on success, NULL on failure */ +shvarFile * +svCreateFile(const char *name); + +/* Open the file , return shvarFile on success, NULL on failure */ +shvarFile * +svNewFile(const char *name); + +/* Get the value associated with the key, and leave the current pointer + * pointing at the line containing the value. The char* returned MUST + * be freed by the caller. + */ +char * +svGetValue(shvarFile *s, const char *key, gboolean verbatim); + +/* return 1 if resolves to any truth value (e.g. "yes", "y", "true") + * return 0 if resolves to any non-truth value (e.g. "no", "n", "false") + * return otherwise + */ +int +svTrueValue(shvarFile *s, const char *key, int def); + +/* Set the variable equal to the value . + * If does not exist, and the pointer is set, append + * the key=value pair after that line. Otherwise, prepend the pair + * to the top of the file. + */ +void +svSetValue(shvarFile *s, const char *key, const char *value, gboolean verbatim); + + +/* Write the current contents iff modified. Returns -1 on error + * and 0 on success. Do not write if no values have been modified. + * The mode argument is only used if creating the file, not if + * re-writing an existing file, and is passed unchanged to the + * open() syscall. + */ +int +svWriteFile(shvarFile *s, int mode); + +/* Close the file descriptor (if open) and delete the shvarFile. + * Returns -1 on error and 0 on success. + */ +int +svCloseFile(shvarFile *s); + +/* Return a new escaped string */ +char * +svEscape(const char *s); + +/* Unescape a string in-place */ +void +svUnescape(char *s); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* ! _SHVAR_H */ diff --git a/system-settings/plugins/ifcfg-rh/tests/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/Makefile.am new file mode 100644 index 00000000..8933bb2e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/Makefile.am @@ -0,0 +1,50 @@ +SUBDIRS=network-scripts + +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/system-settings/plugins/ifcfg-rh + +noinst_PROGRAMS = test-ifcfg-rh test-ifcfg-rh-utils + +test_ifcfg_rh_SOURCES = \ + test-ifcfg-rh.c + +test_ifcfg_rh_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DTEST_IFCFG_DIR=\"$(abs_srcdir)\" \ + -DTEST_SCRATCH_DIR=\"$(abs_builddir)/\" + +test_ifcfg_rh_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/system-settings/plugins/ifcfg-rh/libifcfg-rh-io.la \ + $(DBUS_LIBS) + +test_ifcfg_rh_utils_SOURCES = \ + test-ifcfg-rh-utils.c + +test_ifcfg_rh_utils_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_ifcfg_rh_utils_LDADD = \ + $(top_builddir)/system-settings/plugins/ifcfg-rh/libifcfg-rh-io.la + +if WITH_TESTS + +check-local: test-ifcfg-rh + $(abs_builddir)/test-ifcfg-rh-utils + $(abs_builddir)/test-ifcfg-rh + +endif + +EXTRA_DIST = \ + iscsiadm-test-dhcp \ + iscsiadm-test-static \ + iscsiadm-test-bad-ipaddr \ + iscsiadm-test-bad-gateway \ + iscsiadm-test-bad-dns1 \ + iscsiadm-test-bad-dns2 + diff --git a/system-settings/plugins/ifcfg-rh/tests/Makefile.in b/system-settings/plugins/ifcfg-rh/tests/Makefile.in new file mode 100644 index 00000000..5d00daf0 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/Makefile.in @@ -0,0 +1,774 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = test-ifcfg-rh$(EXEEXT) test-ifcfg-rh-utils$(EXEEXT) +subdir = system-settings/plugins/ifcfg-rh/tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_test_ifcfg_rh_OBJECTS = test_ifcfg_rh-test-ifcfg-rh.$(OBJEXT) +test_ifcfg_rh_OBJECTS = $(am_test_ifcfg_rh_OBJECTS) +am__DEPENDENCIES_1 = +test_ifcfg_rh_DEPENDENCIES = $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/system-settings/plugins/ifcfg-rh/libifcfg-rh-io.la \ + $(am__DEPENDENCIES_1) +am_test_ifcfg_rh_utils_OBJECTS = \ + test_ifcfg_rh_utils-test-ifcfg-rh-utils.$(OBJEXT) +test_ifcfg_rh_utils_OBJECTS = $(am_test_ifcfg_rh_utils_OBJECTS) +test_ifcfg_rh_utils_DEPENDENCIES = $(top_builddir)/system-settings/plugins/ifcfg-rh/libifcfg-rh-io.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_ifcfg_rh_SOURCES) $(test_ifcfg_rh_utils_SOURCES) +DIST_SOURCES = $(test_ifcfg_rh_SOURCES) $(test_ifcfg_rh_utils_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = network-scripts +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/system-settings/plugins/ifcfg-rh + +test_ifcfg_rh_SOURCES = \ + test-ifcfg-rh.c + +test_ifcfg_rh_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DTEST_IFCFG_DIR=\"$(abs_srcdir)\" \ + -DTEST_SCRATCH_DIR=\"$(abs_builddir)/\" + +test_ifcfg_rh_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/system-settings/plugins/ifcfg-rh/libifcfg-rh-io.la \ + $(DBUS_LIBS) + +test_ifcfg_rh_utils_SOURCES = \ + test-ifcfg-rh-utils.c + +test_ifcfg_rh_utils_CPPFLAGS = \ + $(GLIB_CFLAGS) + +test_ifcfg_rh_utils_LDADD = \ + $(top_builddir)/system-settings/plugins/ifcfg-rh/libifcfg-rh-io.la + +EXTRA_DIST = \ + iscsiadm-test-dhcp \ + iscsiadm-test-static \ + iscsiadm-test-bad-ipaddr \ + iscsiadm-test-bad-gateway \ + iscsiadm-test-bad-dns1 \ + iscsiadm-test-bad-dns2 + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/ifcfg-rh/tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/ifcfg-rh/tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +test-ifcfg-rh$(EXEEXT): $(test_ifcfg_rh_OBJECTS) $(test_ifcfg_rh_DEPENDENCIES) + @rm -f test-ifcfg-rh$(EXEEXT) + $(LINK) $(test_ifcfg_rh_OBJECTS) $(test_ifcfg_rh_LDADD) $(LIBS) +test-ifcfg-rh-utils$(EXEEXT): $(test_ifcfg_rh_utils_OBJECTS) $(test_ifcfg_rh_utils_DEPENDENCIES) + @rm -f test-ifcfg-rh-utils$(EXEEXT) + $(LINK) $(test_ifcfg_rh_utils_OBJECTS) $(test_ifcfg_rh_utils_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ifcfg_rh-test-ifcfg-rh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ifcfg_rh_utils-test-ifcfg-rh-utils.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +test_ifcfg_rh-test-ifcfg-rh.o: test-ifcfg-rh.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ifcfg_rh_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_ifcfg_rh-test-ifcfg-rh.o -MD -MP -MF $(DEPDIR)/test_ifcfg_rh-test-ifcfg-rh.Tpo -c -o test_ifcfg_rh-test-ifcfg-rh.o `test -f 'test-ifcfg-rh.c' || echo '$(srcdir)/'`test-ifcfg-rh.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_ifcfg_rh-test-ifcfg-rh.Tpo $(DEPDIR)/test_ifcfg_rh-test-ifcfg-rh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-ifcfg-rh.c' object='test_ifcfg_rh-test-ifcfg-rh.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ifcfg_rh_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_ifcfg_rh-test-ifcfg-rh.o `test -f 'test-ifcfg-rh.c' || echo '$(srcdir)/'`test-ifcfg-rh.c + +test_ifcfg_rh-test-ifcfg-rh.obj: test-ifcfg-rh.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ifcfg_rh_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_ifcfg_rh-test-ifcfg-rh.obj -MD -MP -MF $(DEPDIR)/test_ifcfg_rh-test-ifcfg-rh.Tpo -c -o test_ifcfg_rh-test-ifcfg-rh.obj `if test -f 'test-ifcfg-rh.c'; then $(CYGPATH_W) 'test-ifcfg-rh.c'; else $(CYGPATH_W) '$(srcdir)/test-ifcfg-rh.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_ifcfg_rh-test-ifcfg-rh.Tpo $(DEPDIR)/test_ifcfg_rh-test-ifcfg-rh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-ifcfg-rh.c' object='test_ifcfg_rh-test-ifcfg-rh.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ifcfg_rh_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_ifcfg_rh-test-ifcfg-rh.obj `if test -f 'test-ifcfg-rh.c'; then $(CYGPATH_W) 'test-ifcfg-rh.c'; else $(CYGPATH_W) '$(srcdir)/test-ifcfg-rh.c'; fi` + +test_ifcfg_rh_utils-test-ifcfg-rh-utils.o: test-ifcfg-rh-utils.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ifcfg_rh_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_ifcfg_rh_utils-test-ifcfg-rh-utils.o -MD -MP -MF $(DEPDIR)/test_ifcfg_rh_utils-test-ifcfg-rh-utils.Tpo -c -o test_ifcfg_rh_utils-test-ifcfg-rh-utils.o `test -f 'test-ifcfg-rh-utils.c' || echo '$(srcdir)/'`test-ifcfg-rh-utils.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_ifcfg_rh_utils-test-ifcfg-rh-utils.Tpo $(DEPDIR)/test_ifcfg_rh_utils-test-ifcfg-rh-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-ifcfg-rh-utils.c' object='test_ifcfg_rh_utils-test-ifcfg-rh-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ifcfg_rh_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_ifcfg_rh_utils-test-ifcfg-rh-utils.o `test -f 'test-ifcfg-rh-utils.c' || echo '$(srcdir)/'`test-ifcfg-rh-utils.c + +test_ifcfg_rh_utils-test-ifcfg-rh-utils.obj: test-ifcfg-rh-utils.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ifcfg_rh_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_ifcfg_rh_utils-test-ifcfg-rh-utils.obj -MD -MP -MF $(DEPDIR)/test_ifcfg_rh_utils-test-ifcfg-rh-utils.Tpo -c -o test_ifcfg_rh_utils-test-ifcfg-rh-utils.obj `if test -f 'test-ifcfg-rh-utils.c'; then $(CYGPATH_W) 'test-ifcfg-rh-utils.c'; else $(CYGPATH_W) '$(srcdir)/test-ifcfg-rh-utils.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_ifcfg_rh_utils-test-ifcfg-rh-utils.Tpo $(DEPDIR)/test_ifcfg_rh_utils-test-ifcfg-rh-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-ifcfg-rh-utils.c' object='test_ifcfg_rh_utils-test-ifcfg-rh-utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_ifcfg_rh_utils_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_ifcfg_rh_utils-test-ifcfg-rh-utils.obj `if test -f 'test-ifcfg-rh-utils.c'; then $(CYGPATH_W) 'test-ifcfg-rh-utils.c'; else $(CYGPATH_W) '$(srcdir)/test-ifcfg-rh-utils.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +@WITH_TESTS_FALSE@check-local: +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-recursive +all-am: Makefile $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +@WITH_TESTS_TRUE@check-local: test-ifcfg-rh +@WITH_TESTS_TRUE@ $(abs_builddir)/test-ifcfg-rh-utils +@WITH_TESTS_TRUE@ $(abs_builddir)/test-ifcfg-rh + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns1 b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns1 new file mode 100755 index 00000000..4a6a9382 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns1 @@ -0,0 +1,21 @@ +#!/bin/bash + +cat << EOF +# BEGIN RECORD +iface.initiatorname = iqn.pjones6 +iface.hwaddress = 00:33:21:98:b9:f0 +iface.bootproto = STATIC +iface.ipaddress = 192.168.32.72 +iface.subnet_mask = 255.255.252.0 +iface.gateway = 192.168.35.254 +iface.primary_dns = 10000.500.250.1 +iface.secondary_dns = 10.16.255.3 +iface.vlan = 0 +iface.net_ifacename = eth0 +node.name = iqn.0.2008-11.com.blahblah:iscsi0 +node.conn[0].address = 10.16.52.16 +node.conn[0].port = 3260 +node.boot_lun = 00000000 +# END RECORD +EOF + diff --git a/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns2 b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns2 new file mode 100755 index 00000000..9bd5839b --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-dns2 @@ -0,0 +1,21 @@ +#!/bin/bash + +cat << EOF +# BEGIN RECORD +iface.initiatorname = iqn.pjones6 +iface.hwaddress = 00:33:21:98:b9:f0 +iface.bootproto = STATIC +iface.ipaddress = 192.168.32.72 +iface.subnet_mask = 255.255.252.0 +iface.gateway = 192.168.35.254 +iface.primary_dns = 10.16.255.2 +iface.secondary_dns = blah.foo.bar.baz +iface.vlan = 0 +iface.net_ifacename = eth0 +node.name = iqn.0.2008-11.com.blahblah:iscsi0 +node.conn[0].address = 10.16.52.16 +node.conn[0].port = 3260 +node.boot_lun = 00000000 +# END RECORD +EOF + diff --git a/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-gateway b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-gateway new file mode 100755 index 00000000..b3dc7447 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-gateway @@ -0,0 +1,21 @@ +#!/bin/bash + +cat << EOF +# BEGIN RECORD +iface.initiatorname = iqn.pjones6 +iface.hwaddress = 00:33:21:98:b9:f0 +iface.bootproto = STATIC +iface.ipaddress = aa.bb.cc.dd +iface.subnet_mask = 255.255.252.0 +iface.gateway = 192.168.35.254 +iface.primary_dns = 10.16.255.2 +iface.secondary_dns = 10.16.255.3 +iface.vlan = 0 +iface.net_ifacename = eth0 +node.name = iqn.0.2008-11.com.blahblah:iscsi0 +node.conn[0].address = 10.16.52.16 +node.conn[0].port = 3260 +node.boot_lun = 00000000 +# END RECORD +EOF + diff --git a/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-ipaddr b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-ipaddr new file mode 100755 index 00000000..92f44777 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-bad-ipaddr @@ -0,0 +1,21 @@ +#!/bin/bash + +cat << EOF +# BEGIN RECORD +iface.initiatorname = iqn.pjones6 +iface.hwaddress = 00:33:21:98:b9:f0 +iface.bootproto = STATIC +iface.ipaddress = 192.168.32.72 +iface.subnet_mask = 255.255.252.0 +iface.gateway = bb.cc.dd.ee +iface.primary_dns = 10.16.255.2 +iface.secondary_dns = 10.16.255.3 +iface.vlan = 0 +iface.net_ifacename = eth0 +node.name = iqn.0.2008-11.com.blahblah:iscsi0 +node.conn[0].address = 10.16.52.16 +node.conn[0].port = 3260 +node.boot_lun = 00000000 +# END RECORD +EOF + diff --git a/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-dhcp b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-dhcp new file mode 100755 index 00000000..6de0637c --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-dhcp @@ -0,0 +1,33 @@ +#!/bin/bash + +cat << EOF +# BEGIN RECORD +iface.initiatorname = iqn.pjones6 +iface.hwaddress = 00:33:21:98:b9:f0 +iface.bootproto = DHCP +iface.gateway = 10.16.52.254 +iface.primary_dns = 10.16.255.2 +iface.secondary_dns = 10.16.255.3 +iface.vlan = 0 +iface.net_ifacename = eth0 +node.name = iqn.0.2008-11.com.blahblah:iscsi0 +node.conn[0].address = 10.16.52.16 +node.conn[0].port = 3260 +node.boot_lun = 00000000 +# END RECORD +# BEGIN RECORD +iface.initiatorname = iqn.pjones6 +iface.hwaddress = 00:33:21:98:b9:f1 +iface.bootproto = DHCP +iface.gateway = 10.16.52.254 +iface.primary_dns = 10.16.255.2 +iface.secondary_dns = 10.16.255.3 +iface.vlan = 0 +iface.net_ifacename = eth1 +node.name = iqn.1.2008-11.com.blahblah:iscsi1 +node.conn[0].address = 10.16.52.16 +node.conn[0].port = 3260 +node.boot_lun = 00000000 +# END RECORD +EOF + diff --git a/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-static b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-static new file mode 100755 index 00000000..99a6e7c1 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/iscsiadm-test-static @@ -0,0 +1,35 @@ +#!/bin/bash + +cat << EOF +# BEGIN RECORD +iface.initiatorname = iqn.pjones6 +iface.hwaddress = 00:33:21:98:b9:f0 +iface.bootproto = STATIC +iface.ipaddress = 192.168.32.72 +iface.subnet_mask = 255.255.252.0 +iface.gateway = 192.168.35.254 +iface.primary_dns = 10.16.255.2 +iface.secondary_dns = 10.16.255.3 +iface.vlan = 0 +iface.net_ifacename = eth0 +node.name = iqn.0.2008-11.com.blahblah:iscsi0 +node.conn[0].address = 10.16.52.16 +node.conn[0].port = 3260 +node.boot_lun = 00000000 +# END RECORD +# BEGIN RECORD +iface.initiatorname = iqn.pjones6 +iface.hwaddress = 00:33:21:98:b9:f1 +iface.bootproto = DHCP +iface.gateway = 10.16.52.254 +iface.primary_dns = 10.16.255.2 +iface.secondary_dns = 10.16.255.3 +iface.vlan = 0 +iface.net_ifacename = eth1 +node.name = iqn.1.2008-11.com.blahblah:iscsi1 +node.conn[0].address = 10.16.52.16 +node.conn[0].port = 3260 +node.boot_lun = 00000000 +# END RECORD +EOF + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am new file mode 100644 index 00000000..60059019 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am @@ -0,0 +1,76 @@ +EXTRA_DIST = \ + ifcfg-test-minimal \ + ifcfg-test-nm-controlled \ + ifcfg-test-wired-static \ + ifcfg-test-wired-static-bootproto \ + ifcfg-test-wired-dhcp \ + ifcfg-test-wired-global-gateway \ + network-test-wired-global-gateway \ + ifcfg-test-wired-never-default \ + network-test-wired-never-default \ + ifcfg-test-wired-defroute-no \ + ifcfg-test-wired-defroute-no-gatewaydev-yes \ + network-test-wired-defroute-no-gatewaydev-yes \ + ifcfg-test-wired-8021x-peap-mschapv2 \ + keys-test-wired-8021x-peap-mschapv2 \ + ifcfg-test-onboot-no \ + ifcfg-test-wifi-open \ + ifcfg-test-wifi-open-auto \ + ifcfg-test-wifi-open-ssid-quoted \ + ifcfg-test-wifi-open-ssid-long-quoted \ + ifcfg-test-wifi-open-ssid-hex \ + ifcfg-test-wifi-open-ssid-long-hex \ + ifcfg-test-wifi-open-ssid-bad-hex \ + ifcfg-test-wifi-wep \ + keys-test-wifi-wep \ + ifcfg-test-wifi-wep-adhoc \ + keys-test-wifi-wep-adhoc \ + ifcfg-test-wifi-wep-eap-ttls-chap \ + keys-test-wifi-wep-eap-ttls-chap \ + ifcfg-test-wifi-leap \ + keys-test-wifi-leap \ + ifcfg-test-wifi-wpa-psk \ + keys-test-wifi-wpa-psk \ + ifcfg-test-wifi-wpa-psk-unquoted \ + keys-test-wifi-wpa-psk-unquoted \ + ifcfg-test-wifi-wpa-psk-unquoted2 \ + keys-test-wifi-wpa-psk-unquoted2 \ + ifcfg-test-wifi-wpa-psk-adhoc \ + keys-test-wifi-wpa-psk-adhoc \ + ifcfg-test-wifi-wpa-psk-hex \ + keys-test-wifi-wpa-psk-hex \ + ifcfg-test-wifi-wpa-eap-tls \ + keys-test-wifi-wpa-eap-tls \ + ifcfg-test-wifi-wpa-eap-ttls-tls \ + keys-test-wifi-wpa-eap-ttls-tls \ + test_ca_cert.pem \ + test1_key_and_cert.pem \ + ifcfg-test-ibft-dhcp \ + ifcfg-test-ibft-static \ + ifcfg-test-static-routes-legacy \ + route-test-static-routes-legacy \ + ifcfg-test-wired-static-routes \ + route-test-wired-static-routes \ + ifcfg-test-wired-static-routes-legacy \ + route-test-wired-static-routes-legacy \ + ifcfg-test-wired-ipv6-manual \ + route6-test-wired-ipv6-manual \ + ifcfg-test-wired-static-no-prefix-8 \ + ifcfg-test-wired-static-no-prefix-16 \ + ifcfg-test-wired-static-no-prefix-24 \ + ifcfg-test-wired-ipv6-only \ + ifcfg-test-wifi-wep-passphrase \ + keys-test-wifi-wep-passphrase \ + ifcfg-test-wifi-wep-40-ascii \ + keys-test-wifi-wep-40-ascii \ + ifcfg-test-wifi-wep-104-ascii \ + keys-test-wifi-wep-104-ascii + +check-local: + @for f in $(EXTRA_DIST); do \ + chmod 0600 $(abs_srcdir)/$$f; \ + done + +# Make the special temp dir for some written connections + mkdir -p $(abs_builddir)/tmp + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.in b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.in new file mode 100644 index 00000000..23b9f9cb --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.in @@ -0,0 +1,495 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = system-settings/plugins/ifcfg-rh/tests/network-scripts +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + ifcfg-test-minimal \ + ifcfg-test-nm-controlled \ + ifcfg-test-wired-static \ + ifcfg-test-wired-static-bootproto \ + ifcfg-test-wired-dhcp \ + ifcfg-test-wired-global-gateway \ + network-test-wired-global-gateway \ + ifcfg-test-wired-never-default \ + network-test-wired-never-default \ + ifcfg-test-wired-defroute-no \ + ifcfg-test-wired-defroute-no-gatewaydev-yes \ + network-test-wired-defroute-no-gatewaydev-yes \ + ifcfg-test-wired-8021x-peap-mschapv2 \ + keys-test-wired-8021x-peap-mschapv2 \ + ifcfg-test-onboot-no \ + ifcfg-test-wifi-open \ + ifcfg-test-wifi-open-auto \ + ifcfg-test-wifi-open-ssid-quoted \ + ifcfg-test-wifi-open-ssid-long-quoted \ + ifcfg-test-wifi-open-ssid-hex \ + ifcfg-test-wifi-open-ssid-long-hex \ + ifcfg-test-wifi-open-ssid-bad-hex \ + ifcfg-test-wifi-wep \ + keys-test-wifi-wep \ + ifcfg-test-wifi-wep-adhoc \ + keys-test-wifi-wep-adhoc \ + ifcfg-test-wifi-wep-eap-ttls-chap \ + keys-test-wifi-wep-eap-ttls-chap \ + ifcfg-test-wifi-leap \ + keys-test-wifi-leap \ + ifcfg-test-wifi-wpa-psk \ + keys-test-wifi-wpa-psk \ + ifcfg-test-wifi-wpa-psk-unquoted \ + keys-test-wifi-wpa-psk-unquoted \ + ifcfg-test-wifi-wpa-psk-unquoted2 \ + keys-test-wifi-wpa-psk-unquoted2 \ + ifcfg-test-wifi-wpa-psk-adhoc \ + keys-test-wifi-wpa-psk-adhoc \ + ifcfg-test-wifi-wpa-psk-hex \ + keys-test-wifi-wpa-psk-hex \ + ifcfg-test-wifi-wpa-eap-tls \ + keys-test-wifi-wpa-eap-tls \ + ifcfg-test-wifi-wpa-eap-ttls-tls \ + keys-test-wifi-wpa-eap-ttls-tls \ + test_ca_cert.pem \ + test1_key_and_cert.pem \ + ifcfg-test-ibft-dhcp \ + ifcfg-test-ibft-static \ + ifcfg-test-static-routes-legacy \ + route-test-static-routes-legacy \ + ifcfg-test-wired-static-routes \ + route-test-wired-static-routes \ + ifcfg-test-wired-static-routes-legacy \ + route-test-wired-static-routes-legacy \ + ifcfg-test-wired-ipv6-manual \ + route6-test-wired-ipv6-manual \ + ifcfg-test-wired-static-no-prefix-8 \ + ifcfg-test-wired-static-no-prefix-16 \ + ifcfg-test-wired-static-no-prefix-24 \ + ifcfg-test-wired-ipv6-only \ + ifcfg-test-wifi-wep-passphrase \ + keys-test-wifi-wep-passphrase \ + ifcfg-test-wifi-wep-40-ascii \ + keys-test-wifi-wep-40-ascii \ + ifcfg-test-wifi-wep-104-ascii \ + keys-test-wifi-wep-104-ascii + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/ifcfg-rh/tests/network-scripts/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool distclean distclean-generic distclean-libtool \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +check-local: + @for f in $(EXTRA_DIST); do \ + chmod 0600 $(abs_srcdir)/$$f; \ + done + +# Make the special temp dir for some written connections + mkdir -p $(abs_builddir)/tmp + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-ibft-dhcp b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-ibft-dhcp new file mode 100644 index 00000000..abfcd6e4 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-ibft-dhcp @@ -0,0 +1,4 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +DEVICE=eth0 +HWADDR=00:33:21:98:b9:f1 +BOOTPROTO=ibft diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-ibft-static b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-ibft-static new file mode 100644 index 00000000..99b02e42 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-ibft-static @@ -0,0 +1,4 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +DEVICE=eth0 +HWADDR=00:33:21:98:b9:f0 +BOOTPROTO=ibft diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-minimal b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-minimal new file mode 100644 index 00000000..63bcc840 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-minimal @@ -0,0 +1,4 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +DEVICE=eth0 +HWADDR=00:16:41:11:22:33 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-nm-controlled b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-nm-controlled new file mode 100644 index 00000000..a38f1f5f --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-nm-controlled @@ -0,0 +1,9 @@ +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:f8:9f +BOOTPROTO=dhcp +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +NM_CONTROLLED=no + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-onboot-no b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-onboot-no new file mode 100644 index 00000000..b9491711 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-onboot-no @@ -0,0 +1,5 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +ONBOOT=no + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-static-routes-legacy b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-static-routes-legacy new file mode 100644 index 00000000..2173729d --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-static-routes-legacy @@ -0,0 +1,12 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +DEVICE=eth0 +HWADDR=00:16:41:11:22:33 +NAME="test-static-routes-legacy" +TYPE=Ethernet +BOOTPROTO=dhcp +DEFROUTE=yes +UUID=ba60d05a-7898-820d-c2db-427a88f8f2a5 +ONBOOT=yes +IPV6INIT=no +PEERDNS=yes +PEERROUTES=yes diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-leap b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-leap new file mode 100644 index 00000000..50f4fd31 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-leap @@ -0,0 +1,17 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +KEY_MGMT=IEEE8021X +SECURITYMODE=LEAP +IEEE_8021X_IDENTITY="Bill Smith" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open new file mode 100644 index 00000000..d4bb8f75 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open @@ -0,0 +1,13 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-auto b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-auto new file mode 100644 index 00000000..42ee200a --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-auto @@ -0,0 +1,13 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Auto +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex new file mode 100644 index 00000000..32d63342 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex @@ -0,0 +1,13 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=0x626cxx +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-hex b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-hex new file mode 100644 index 00000000..dcb46da7 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-hex @@ -0,0 +1,13 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=0x626c6168626c6168 +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-long-hex b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-long-hex new file mode 100644 index 00000000..37bb085b --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-long-hex @@ -0,0 +1,13 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=0x626c6168626c6168626c6168626c6168626c6168626c6168626c6168626c6168AA +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-long-quoted b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-long-quoted new file mode 100644 index 00000000..0b46acd6 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-long-quoted @@ -0,0 +1,13 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID="foo\"bar\\foo\"bar\\foo\"bar\\foo\"bar\\1" +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-quoted b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-quoted new file mode 100644 index 00000000..08496bb5 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-open-ssid-quoted @@ -0,0 +1,13 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID="foo\"bar\\" +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep new file mode 100644 index 00000000..e1ce20d6 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep @@ -0,0 +1,14 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +SECURITYMODE=restricted diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-104-ascii b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-104-ascii new file mode 100644 index 00000000..250efa13 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-104-ascii @@ -0,0 +1,14 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +SECURITYMODE=open diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-40-ascii b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-40-ascii new file mode 100644 index 00000000..250efa13 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-40-ascii @@ -0,0 +1,14 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +SECURITYMODE=open diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-adhoc b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-adhoc new file mode 100644 index 00000000..9d0bacfc --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-adhoc @@ -0,0 +1,15 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=11 +MODE=Ad-Hoc +RATE=auto +ONBOOT=no +USERCTL=yes +PEERDNS=no +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPV6INIT=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-eap-ttls-chap b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-eap-ttls-chap new file mode 100644 index 00000000..bdea6aa3 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-eap-ttls-chap @@ -0,0 +1,20 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +BOOTPROTO=dhcp +ONBOOT=yes +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +NM_CONTROLLED=yes +PEERDNS=yes +ESSID=blahblah +MODE=Managed +RATE=auto +KEY_MGMT=IEEE8021X +IEEE_8021X_EAP_METHODS=TTLS +IEEE_8021X_IDENTITY="David Smith" +IEEE_8021X_CA_CERT=test_ca_cert.pem +IEEE_8021X_INNER_AUTH_METHODS=CHAP + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-passphrase b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-passphrase new file mode 100644 index 00000000..250efa13 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wep-passphrase @@ -0,0 +1,14 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +SECURITYMODE=open diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-eap-tls b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-eap-tls new file mode 100644 index 00000000..92aaeeab --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-eap-tls @@ -0,0 +1,25 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +BOOTPROTO=dhcp +ONBOOT=yes +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +NM_CONTROLLED=yes +PEERDNS=yes +ESSID=blahblah +MODE=Managed +RATE=auto +CIPHER_PAIRWISE="TKIP CCMP" +CIPHER_GROUP="TKIP CCMP WEP40 WEP104" +KEY_MGMT=WPA-EAP +WPA_ALLOW_WPA=yes +WPA_ALLOW_WPA2=yes +IEEE_8021X_EAP_METHODS=TLS +IEEE_8021X_IDENTITY="Bill Smith" +IEEE_8021X_CA_CERT=test_ca_cert.pem +IEEE_8021X_CLIENT_CERT=test1_key_and_cert.pem +IEEE_8021X_PRIVATE_KEY=test1_key_and_cert.pem + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-eap-ttls-tls b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-eap-ttls-tls new file mode 100644 index 00000000..42ed1d68 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-eap-ttls-tls @@ -0,0 +1,28 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +BOOTPROTO=dhcp +ONBOOT=yes +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +NM_CONTROLLED=yes +PEERDNS=yes +ESSID=blahblah +MODE=Managed +RATE=auto +CIPHER_PAIRWISE="TKIP CCMP" +CIPHER_GROUP="TKIP CCMP WEP40 WEP104" +KEY_MGMT=WPA-EAP +WPA_ALLOW_WPA=yes +WPA_ALLOW_WPA2=yes +IEEE_8021X_EAP_METHODS=TTLS +IEEE_8021X_IDENTITY="Chuck Shumer" +IEEE_8021X_ANON_IDENTITY="anonymous" +IEEE_8021X_CA_CERT=test_ca_cert.pem +IEEE_8021X_INNER_AUTH_METHODS=EAP-TLS +IEEE_8021X_INNER_CA_CERT=test_ca_cert.pem +IEEE_8021X_INNER_CLIENT_CERT=test1_key_and_cert.pem +IEEE_8021X_INNER_PRIVATE_KEY=test1_key_and_cert.pem + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk new file mode 100644 index 00000000..2119ba8e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk @@ -0,0 +1,19 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +CIPHER_PAIRWISE="TKIP CCMP" +CIPHER_GROUP="TKIP CCMP WEP40 WEP104" +KEY_MGMT=WPA-PSK +WPA_ALLOW_WPA=yes +WPA_ALLOW_WPA2=yes + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc new file mode 100644 index 00000000..aa00925e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc @@ -0,0 +1,16 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Ad-Hoc +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +CIPHER_GROUP=CCMP +KEY_MGMT=WPA-PSK + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-hex b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-hex new file mode 100644 index 00000000..2119ba8e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-hex @@ -0,0 +1,19 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +CIPHER_PAIRWISE="TKIP CCMP" +CIPHER_GROUP="TKIP CCMP WEP40 WEP104" +KEY_MGMT=WPA-PSK +WPA_ALLOW_WPA=yes +WPA_ALLOW_WPA2=yes + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted new file mode 100644 index 00000000..2119ba8e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted @@ -0,0 +1,19 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +CIPHER_PAIRWISE="TKIP CCMP" +CIPHER_GROUP="TKIP CCMP WEP40 WEP104" +KEY_MGMT=WPA-PSK +WPA_ALLOW_WPA=yes +WPA_ALLOW_WPA2=yes + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted2 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted2 new file mode 100644 index 00000000..2119ba8e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted2 @@ -0,0 +1,19 @@ +TYPE=Wireless +DEVICE=eth2 +HWADDR=00:16:41:11:22:33 +NM_CONTROLLED=yes +BOOTPROTO=dhcp +ESSID=blahblah +CHANNEL=1 +MODE=Managed +RATE=auto +ONBOOT=yes +USERCTL=yes +PEERDNS=yes +IPV6INIT=no +CIPHER_PAIRWISE="TKIP CCMP" +CIPHER_GROUP="TKIP CCMP WEP40 WEP104" +KEY_MGMT=WPA-PSK +WPA_ALLOW_WPA=yes +WPA_ALLOW_WPA2=yes + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-8021x-peap-mschapv2 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-8021x-peap-mschapv2 new file mode 100644 index 00000000..6d68eca1 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-8021x-peap-mschapv2 @@ -0,0 +1,15 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=dhcp +ONBOOT=yes +NM_CONTROLLED=yes +KEY_MGMT=IEEE8021X +IEEE_8021X_EAP_METHODS=PEAP +IEEE_8021X_IDENTITY="David Smith" +IEEE_8021X_CA_CERT=test_ca_cert.pem +IEEE_8021X_PEAP_VERSION=1 +IEEE_8021X_PEAP_FORCE_NEW_LABEL=yes +IEEE_8021X_INNER_AUTH_METHODS=MSCHAPV2 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no new file mode 100644 index 00000000..fe8b15b2 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no @@ -0,0 +1,15 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth4 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=dhcp +ONBOOT=yes +USERCTL=yes +NM_CONTROLLED=yes +PEERDNS=yes +DEFROUTE=no + +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=no + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes new file mode 100644 index 00000000..3cf4323d --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes @@ -0,0 +1,15 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=dhcp +ONBOOT=yes +USERCTL=yes +NM_CONTROLLED=yes +PEERDNS=yes +DEFROUTE=no + +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=no + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp new file mode 100644 index 00000000..727d2ceb --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp @@ -0,0 +1,14 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=dhcp +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +NM_CONTROLLED=yes +PEERDNS=no +DHCP_HOSTNAME=foobar +DNS1=4.2.2.1 +DNS2=4.2.2.2 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway new file mode 100644 index 00000000..98d91053 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway @@ -0,0 +1,14 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=192.168.1.5 +PREFIX=24 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual new file mode 100644 index 00000000..45db0e4c --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-manual @@ -0,0 +1,19 @@ +# Intel Corporation 82567LM Gigabit Network Connection +TYPE=Ethernet +DEVICE=eth2 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=dhcp +ONBOOT=yes +USERCTL=yes +NM_CONTROLLED=yes +PEERDNS=yes +DNS1=10.2.0.4 +DNS2=10.2.0.5 +DNS3=1:2:3:4::a +DNS4=1:2:3:4::b +DOMAIN="lorem.com ipsum.org dolor.edu" +IPV6INIT=yes +IPV6_AUTOCONF=no +IPV6ADDR="1001:abba::1234/56" +IPV6ADDR_SECONDARIES="2001:abba::2234/64 3001:abba::3234/96" +IPV6_FAILURE_FATAL=no diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-only b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-only new file mode 100644 index 00000000..59ec32e5 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-ipv6-only @@ -0,0 +1,14 @@ +# Intel Corporation 82567LM Gigabit Network Connection +TYPE=Ethernet +DEVICE=eth2 +HWADDR=00:11:22:33:44:ee +ONBOOT=yes +USERCTL=yes +NM_CONTROLLED=yes +PEERDNS=yes +DNS1=1:2:3:4::a +DOMAIN="lorem.com ipsum.org dolor.edu" +IPV6INIT=yes +IPV6_AUTOCONF=no +IPV6ADDR="1001:abba::1234/56" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-never-default b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-never-default new file mode 100644 index 00000000..12d5b5e6 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-never-default @@ -0,0 +1,11 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth4 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=dhcp +ONBOOT=yes +USERCTL=yes +NM_CONTROLLED=yes +PEERDNS=yes +IPV6INIT=yes +IPV6_AUTOCONF=yes diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static new file mode 100644 index 00000000..c8315f45 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static @@ -0,0 +1,20 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=192.168.1.5 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 +IPV6INIT=yes +IPV6_AUTOCONF=no +IPV6ADDR=dead:beaf::1 +IPV6ADDR_SECONDARIES="dead:beaf::2/56" +DNS3=1:2:3:4::a +DNS4=1:2:3:4::b diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-bootproto b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-bootproto new file mode 100644 index 00000000..ee821503 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-bootproto @@ -0,0 +1,15 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=static +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=192.168.1.5 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-16 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-16 new file mode 100644 index 00000000..07999038 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-16 @@ -0,0 +1,14 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=172.16.3.4 +GATEWAY=172.16.3.1 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-24 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-24 new file mode 100644 index 00000000..688143cd --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-24 @@ -0,0 +1,14 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=192.168.1.5 +GATEWAY=192.168.1.1 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-8 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-8 new file mode 100644 index 00000000..0433c62a --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-no-prefix-8 @@ -0,0 +1,14 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=10.11.12.13 +GATEWAY=10.0.0.1 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-routes b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-routes new file mode 100644 index 00000000..7faf49bd --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-routes @@ -0,0 +1,15 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=192.168.1.5 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-routes-legacy b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-routes-legacy new file mode 100644 index 00000000..7faf49bd --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-static-routes-legacy @@ -0,0 +1,15 @@ +# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) +TYPE=Ethernet +DEVICE=eth0 +HWADDR=00:11:22:33:44:ee +BOOTPROTO=none +ONBOOT=yes +USERCTL=yes +IPV6INIT=no +MTU=1492 +NM_CONTROLLED=yes +DNS1=4.2.2.1 +DNS2=4.2.2.2 +IPADDR=192.168.1.5 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-leap b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-leap new file mode 100644 index 00000000..fe78177e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-leap @@ -0,0 +1 @@ +IEEE_8021X_PASSWORD="foobarblah" diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep new file mode 100644 index 00000000..0bd766c2 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep @@ -0,0 +1 @@ +KEY=0123456789abcdef0123456789 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-104-ascii b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-104-ascii new file mode 100644 index 00000000..f5d532b2 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-104-ascii @@ -0,0 +1 @@ +KEY1=s:LoremIpsumSit diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-40-ascii b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-40-ascii new file mode 100644 index 00000000..b0d14708 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-40-ascii @@ -0,0 +1 @@ +KEY1=s:Lorem diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-adhoc b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-adhoc new file mode 100644 index 00000000..0bd766c2 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-adhoc @@ -0,0 +1 @@ +KEY=0123456789abcdef0123456789 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-eap-ttls-chap b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-eap-ttls-chap new file mode 100644 index 00000000..6936f2e0 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-eap-ttls-chap @@ -0,0 +1,2 @@ +IEEE_8021X_PASSWORD="foobar baz" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-passphrase b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-passphrase new file mode 100644 index 00000000..d45c0ea8 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wep-passphrase @@ -0,0 +1 @@ +KEY_PASSPHRASE1="foobar222blahblah" diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-eap-tls b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-eap-tls new file mode 100644 index 00000000..0c3bc1e1 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-eap-tls @@ -0,0 +1,2 @@ +IEEE_8021X_PRIVATE_KEY_PASSWORD="test1" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-eap-ttls-tls b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-eap-ttls-tls new file mode 100644 index 00000000..b6256b95 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-eap-ttls-tls @@ -0,0 +1,2 @@ +IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD="test1" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk new file mode 100644 index 00000000..d7813b2f --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk @@ -0,0 +1,2 @@ +WPA_PSK="I wonder what the king is doing tonight?" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-adhoc b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-adhoc new file mode 100644 index 00000000..d7813b2f --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-adhoc @@ -0,0 +1,2 @@ +WPA_PSK="I wonder what the king is doing tonight?" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-hex b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-hex new file mode 100644 index 00000000..d0576a8d --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-hex @@ -0,0 +1,2 @@ +WPA_PSK=1da190379817bc360dda52e85c388c439a21ea5c7bf819c64e9da051807deae6 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-unquoted b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-unquoted new file mode 100644 index 00000000..9a47196a --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-unquoted @@ -0,0 +1,2 @@ +WPA_PSK=54336845e2f3f321c4c7 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-unquoted2 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-unquoted2 new file mode 100644 index 00000000..347bb85e --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-unquoted2 @@ -0,0 +1,2 @@ +WPA_PSK="a5d4d45e78e1455d8e6124e81ea137f9a5d4d45e78e1455d8e6124e81ea137f9" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wired-8021x-peap-mschapv2 b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wired-8021x-peap-mschapv2 new file mode 100644 index 00000000..6936f2e0 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wired-8021x-peap-mschapv2 @@ -0,0 +1,2 @@ +IEEE_8021X_PASSWORD="foobar baz" + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-defroute-no-gatewaydev-yes b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-defroute-no-gatewaydev-yes new file mode 100644 index 00000000..0d6a302f --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-defroute-no-gatewaydev-yes @@ -0,0 +1,2 @@ +GATEWAYDEV=eth0 +IPV6_DEFAULTDEV=eth0 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-global-gateway b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-global-gateway new file mode 100644 index 00000000..7987d105 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-global-gateway @@ -0,0 +1 @@ +GATEWAY=192.168.1.2 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-never-default b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-never-default new file mode 100644 index 00000000..9a292679 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/network-test-wired-never-default @@ -0,0 +1,4 @@ +GATEWAYDEV=eth0 +# when devices in IPV6_DEFAULTDEV and IPV6_DEFAULTGW don't match the one in IPV6_DEFAULTGW is prefered +IPV6_DEFAULTDEV=eth4 +IPV6_DEFAULTGW=2001::1234%eth0 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-static-routes-legacy b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-static-routes-legacy new file mode 100644 index 00000000..3db42ab5 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-static-routes-legacy @@ -0,0 +1,3 @@ +1.2.3.0/24 via 222.173.190.239 metric 0 +3.2.1.0/24 via 202.254.171.190 metric 77 +7.7.7.7/32 via 10.0.2.2 metric 11 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes new file mode 100644 index 00000000..ee2a32d8 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes @@ -0,0 +1,8 @@ +ADDRESS0=11.22.33.0 +NETMASK0=255.255.255.0 +GATEWAY0=192.168.1.5 + +ADDRESS1=44.55.66.77 +NETMASK1=255.255.255.255 +GATEWAY1=192.168.1.7 +METRIC1=3 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes-legacy b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes-legacy new file mode 100644 index 00000000..cb7d42bd --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route-test-wired-static-routes-legacy @@ -0,0 +1,7 @@ +# Test route file in legacy format; i.e. lines passed as argumet to "ip route add" + + +21.31.41.0/24 via 9.9.9.9 metric 1 + via 8.8.8.8 to 32.42.52.62 + 43.53.0.0/16 metric 3 via 7.7.7.7 dev eth2 + diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/route6-test-wired-ipv6-manual b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route6-test-wired-ipv6-manual new file mode 100644 index 00000000..ae4e47ae --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/route6-test-wired-ipv6-manual @@ -0,0 +1 @@ +9876::1234/96 via 9876::7777 metric 2 diff --git a/system-settings/plugins/ifcfg-rh/tests/network-scripts/test1_key_and_cert.pem b/system-settings/plugins/ifcfg-rh/tests/network-scripts/test1_key_and_cert.pem new file mode 100644 index 00000000..dec9aa1b --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/test1_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/system-settings/plugins/ifcfg-rh/tests/network-scripts/test_ca_cert.pem b/system-settings/plugins/ifcfg-rh/tests/network-scripts/test_ca_cert.pem new file mode 100644 index 00000000..ef1be20d --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/network-scripts/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/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c new file mode 100644 index 00000000..cf2a7c03 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh-utils.c @@ -0,0 +1,162 @@ +/* -*- 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 Red Hat, Inc. + */ + +#include +#include +#include +#include + +#include "nm-test-helpers.h" + +#include "common.h" +#include "utils.h" + + +static void +test_get_ifcfg_name (const char *desc, + const char *path, + gboolean only_ifcfg, + const char *expected) +{ + const char *result; + + result = utils_get_ifcfg_name (path, only_ifcfg); + if (expected == NULL) { + ASSERT (result == NULL, desc, "unexpected valid ifcfg name '%s'", result); + } else { + ASSERT (result != NULL, desc, "failed to create ifcfg name for '%s'", path); + + ASSERT (strcmp (result, expected) == 0, + desc, "unexpected ifcfg name '%s' created for '%s'", result, path); + } +} + +static void +test_get_ifcfg_path (const char *desc, + const char *path, + const char *expected) +{ + const char *result; + + result = utils_get_ifcfg_path (path); + if (expected == NULL) { + ASSERT (result == NULL, desc, "unexpected valid ifcfg name '%s'", result); + } else { + ASSERT (result != NULL, desc, "failed to create ifcfg name for '%s'", path); + + ASSERT (strcmp (result, expected) == 0, + desc, "unexpected ifcfg name '%s' created for '%s'", result, path); + } +} + +static void +test_get_keys_path (const char *desc, + const char *path, + const char *expected) +{ + const char *result; + + result = utils_get_keys_path (path); + if (expected == NULL) { + ASSERT (result == NULL, desc, "unexpected valid extra path '%s'", result); + } else { + ASSERT (result != NULL, desc, "failed to create extra path for '%s'", path); + + ASSERT (strcmp (result, expected) == 0, + desc, "unexpected extra path '%s' created for '%s'", result, path); + } +} + +static void +test_get_route_path (const char *desc, + const char *path, + const char *expected) +{ + const char *result; + + result = utils_get_route_path (path); + if (expected == NULL) { + ASSERT (result == NULL, desc, "unexpected valid extra path '%s'", result); + } else { + ASSERT (result != NULL, desc, "failed to create extra path for '%s'", path); + + ASSERT (strcmp (result, expected) == 0, + desc, "unexpected extra path '%s' created for '%s'", result, path); + } +} + +static void +test_ignored (const char *desc, const char *path, gboolean expected_ignored) +{ + gboolean result; + + result = utils_should_ignore_file (path, FALSE); + ASSERT (result == expected_ignored, desc, "unexpected ignore result for path '%s'", path); +} + +int main (int argc, char **argv) +{ + char *base; + + /* The tests */ + test_get_ifcfg_name ("get-ifcfg-name-bad", "/foo/bar/adfasdfadf", FALSE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-good", "/foo/bar/ifcfg-FooBar", FALSE, "FooBar"); + test_get_ifcfg_name ("get-ifcfg-name-keys", "/foo/bar/keys-BlahLbah", FALSE, "BlahLbah"); + test_get_ifcfg_name ("get-ifcfg-name-route", "/foo/bar/route-Lalalala", FALSE, "Lalalala"); + test_get_ifcfg_name ("get-ifcfg-name-only-ifcfg-route", "/foo/bar/route-Lalalala", TRUE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-only-ifcfg-keys", "/foo/bar/keys-Lalalala", TRUE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-no-path-ifcfg", "ifcfg-Lalalala", FALSE, "Lalalala"); + test_get_ifcfg_name ("get-ifcfg-name-no-path-keys", "keys-Lalalala", FALSE, "Lalalala"); + test_get_ifcfg_name ("get-ifcfg-name-no-path-route", "route-Lalalala", FALSE, "Lalalala"); + + test_get_ifcfg_name ("get-ifcfg-name-bad2-ifcfg", "/foo/bar/asdfasifcfg-Foobar", FALSE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-bad2-keys", "/foo/bar/asdfaskeys-Foobar", FALSE, NULL); + test_get_ifcfg_name ("get-ifcfg-name-bad2-route", "/foo/bar/asdfasroute-Foobar", FALSE, NULL); + + test_get_ifcfg_path ("ifcfg-path-bad", "/foo/bar/adfasdfasdf", NULL); + test_get_ifcfg_path ("ifcfg-path-from-keys-no-path", "keys-BlahBlah", "ifcfg-BlahBlah"); + test_get_ifcfg_path ("ifcfg-path-from-keys", "/foo/bar/keys-BlahBlah", "/foo/bar/ifcfg-BlahBlah"); + test_get_ifcfg_path ("ifcfg-path-from-route", "/foo/bar/route-BlahBlah", "/foo/bar/ifcfg-BlahBlah"); + + test_get_keys_path ("keys-path-bad", "/foo/bar/asdfasdfasdfasdf", NULL); + test_get_keys_path ("keys-path-from-ifcfg-no-path", "ifcfg-FooBar", "keys-FooBar"); + test_get_keys_path ("keys-path-from-ifcfg", "/foo/bar/ifcfg-FooBar", "/foo/bar/keys-FooBar"); + test_get_keys_path ("keys-path-from-route", "/foo/bar/route-FooBar", "/foo/bar/keys-FooBar"); + + test_get_route_path ("route-path-bad", "/foo/bar/asdfasdfasdfasdf", NULL); + test_get_route_path ("route-path-from-ifcfg-no-path", "ifcfg-FooBar", "route-FooBar"); + test_get_route_path ("route-path-from-ifcfg", "/foo/bar/ifcfg-FooBar", "/foo/bar/route-FooBar"); + test_get_route_path ("route-path-from-keys", "/foo/bar/keys-FooBar", "/foo/bar/route-FooBar"); + + test_ignored ("ignored-ifcfg", "ifcfg-FooBar", FALSE); + test_ignored ("ignored-keys", "keys-FooBar", FALSE); + test_ignored ("ignored-route", "route-FooBar", FALSE); + test_ignored ("ignored-bak", "ifcfg-FooBar" BAK_TAG, TRUE); + test_ignored ("ignored-tilde", "ifcfg-FooBar" TILDE_TAG, TRUE); + test_ignored ("ignored-orig", "ifcfg-FooBar" ORIG_TAG, TRUE); + test_ignored ("ignored-rej", "ifcfg-FooBar" REJ_TAG, TRUE); + test_ignored ("ignored-rpmnew", "ifcfg-FooBar" RPMNEW_TAG, TRUE); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + diff --git a/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c new file mode 100644 index 00000000..6e873fe8 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -0,0 +1,9112 @@ +/* -*- 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 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-test-helpers.h" + +#include "common.h" +#include "reader.h" +#include "writer.h" + +typedef enum { + CK_CA_CERT = 0, + CK_CLIENT_CERT = 1, + CK_PRIV_KEY = 2 +} CertKeyType; + +static gboolean +verify_cert_or_key (CertKeyType ck_type, + NMSetting8021x *s_compare, + const char *file, + const char *privkey_password, + const char *ifcfg, + const char *test_name, + const char *setting_key) +{ + NMSetting8021x *s_8021x; + GError *error = NULL; + gboolean success = FALSE; + const char *expected = NULL, *setting = NULL; + gboolean phase2 = FALSE; + NMSetting8021xCKScheme scheme = NM_SETTING_802_1X_CK_SCHEME_UNKNOWN; + + if (strstr (setting_key, "phase2")) + phase2 = TRUE; + + /* CA Cert */ + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, + test_name, "failed to verify %s: could not create temp 802.1x setting", + ifcfg); + + if (ck_type == CK_CA_CERT) { + if (phase2) + success = nm_setting_802_1x_set_phase2_ca_cert (s_8021x, file, NM_SETTING_802_1X_CK_SCHEME_PATH, NULL, &error); + else + success = nm_setting_802_1x_set_ca_cert (s_8021x, file, NM_SETTING_802_1X_CK_SCHEME_PATH, NULL, &error); + } else if (ck_type == CK_CLIENT_CERT) { + if (phase2) + success = nm_setting_802_1x_set_phase2_client_cert (s_8021x, file, NM_SETTING_802_1X_CK_SCHEME_PATH, NULL, &error); + else + success = nm_setting_802_1x_set_client_cert (s_8021x, file, NM_SETTING_802_1X_CK_SCHEME_PATH, NULL, &error); + } else if (ck_type == CK_PRIV_KEY) { + if (phase2) + success = nm_setting_802_1x_set_phase2_private_key (s_8021x, file, privkey_password, NM_SETTING_802_1X_CK_SCHEME_PATH, NULL, &error); + else + success = nm_setting_802_1x_set_private_key (s_8021x, file, privkey_password, NM_SETTING_802_1X_CK_SCHEME_PATH, NULL, &error); + } + ASSERT (success == TRUE, + test_name, "failed to verify %s: could not load item for %s / %s: %s", + ifcfg, NM_SETTING_802_1X_SETTING_NAME, setting_key, error->message); + + if (ck_type == CK_CA_CERT) { + if (phase2) + scheme = nm_setting_802_1x_get_phase2_ca_cert_scheme (s_8021x); + else + scheme = nm_setting_802_1x_get_ca_cert_scheme (s_8021x); + } else if (ck_type == CK_CLIENT_CERT) { + if (phase2) + scheme = nm_setting_802_1x_get_phase2_client_cert_scheme (s_8021x); + else + scheme = nm_setting_802_1x_get_client_cert_scheme (s_8021x); + } else if (ck_type == CK_PRIV_KEY) { + if (phase2) + scheme = nm_setting_802_1x_get_phase2_private_key_scheme (s_8021x); + else + scheme = nm_setting_802_1x_get_private_key_scheme (s_8021x); + } + ASSERT (scheme == NM_SETTING_802_1X_CK_SCHEME_PATH, + test_name, "failed to verify %s: unexpected cert/key scheme for %s / %s", + ifcfg, NM_SETTING_802_1X_SETTING_NAME, setting_key); + + if (ck_type == CK_CA_CERT) { + if (phase2) + expected = nm_setting_802_1x_get_phase2_ca_cert_path (s_8021x); + else + expected = nm_setting_802_1x_get_ca_cert_path (s_8021x); + } else if (ck_type == CK_CLIENT_CERT) { + if (phase2) + expected = nm_setting_802_1x_get_phase2_client_cert_path (s_8021x); + else + expected = nm_setting_802_1x_get_client_cert_path (s_8021x); + } else if (ck_type == CK_PRIV_KEY) { + if (phase2) + expected = nm_setting_802_1x_get_phase2_private_key_path (s_8021x); + else + expected = nm_setting_802_1x_get_private_key_path (s_8021x); + } + ASSERT (expected != NULL, + test_name, "failed to verify %s: failed to get read item for %s / %s", + ifcfg, NM_SETTING_802_1X_SETTING_NAME, setting_key); + + if (ck_type == CK_CA_CERT) { + if (phase2) + setting = nm_setting_802_1x_get_phase2_ca_cert_path (s_compare); + else + setting = nm_setting_802_1x_get_ca_cert_path (s_compare); + } else if (ck_type == CK_CLIENT_CERT) { + if (phase2) + setting = nm_setting_802_1x_get_phase2_client_cert_path (s_compare); + else + setting = nm_setting_802_1x_get_client_cert_path (s_compare); + } else if (ck_type == CK_PRIV_KEY) { + if (phase2) + setting = nm_setting_802_1x_get_phase2_private_key_path (s_compare); + else + setting = nm_setting_802_1x_get_private_key_path (s_compare); + } + ASSERT (setting != NULL, + test_name, "failed to verify %s: missing %s / %s key", + ifcfg, NM_SETTING_802_1X_SETTING_NAME, setting_key); + + ASSERT (strlen (setting) == strlen (expected), + test_name, "failed to verify %s: unexpected %s / %s certificate length", + test_name, NM_SETTING_802_1X_SETTING_NAME, setting_key); + + ASSERT (strcmp (setting, expected) == 0, + test_name, "failed to verify %s: %s / %s key certificate mismatch", + ifcfg, NM_SETTING_802_1X_SETTING_NAME, setting_key); + + g_object_unref (s_8021x); + return TRUE; +} + + +#define TEST_IFCFG_MINIMAL TEST_IFCFG_DIR"/network-scripts/ifcfg-test-minimal" + +static void +test_read_minimal (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *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 GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 }; + const char *expected_id = "System test-minimal"; + guint64 expected_timestamp = 0; + + connection = connection_from_file (TEST_IFCFG_MINIMAL, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "minimal-wired-read", "failed to read %s: %s", TEST_IFCFG_MINIMAL, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "minimal-wired-verify", "failed to verify %s: %s", TEST_IFCFG_MINIMAL, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "minimal-wired-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_MINIMAL, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "minimal-wired-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_MINIMAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "minimal-wired-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_MINIMAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID can't be tested if the ifcfg does not contain the UUID key, because + * the UUID is generated on the full path of the ifcfg file, which can change + * depending on where the tests are run. + */ + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == expected_timestamp, + "minimal-wired-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_MINIMAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "minimal-wired-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_MINIMAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "minimal-wired-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_MINIMAL, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "minimal-wired-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_MINIMAL, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "minimal-wired-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_MINIMAL, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "minimal-wired-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_MINIMAL, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + ASSERT (nm_setting_wired_get_mtu (s_wired) == 0, + "minimal-wired-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_MINIMAL, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MTU); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "minimal-wired-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_MINIMAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0, + "minimal-wired-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_MINIMAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + ASSERT (nm_setting_ip4_config_get_never_default (s_ip4) == FALSE, + "minimal-wired-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_MINIMAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_NEVER_DEFAULT); + + g_object_unref (connection); +} + +#define TEST_IFCFG_UNMANAGED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-nm-controlled" + +static void +test_read_unmanaged (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *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 GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0xf8, 0x9f }; + const char *expected_id = "System test-nm-controlled"; + guint64 expected_timestamp = 0; + + connection = connection_from_file (TEST_IFCFG_UNMANAGED, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "unmanaged-read", "failed to read %s: %s", TEST_IFCFG_UNMANAGED, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "unmanaged-verify", "failed to verify %s: %s", TEST_IFCFG_UNMANAGED, error->message); + + ASSERT (unmanaged != NULL, + "unmanaged-verify", "failed to verify %s: expected unmanaged", TEST_IFCFG_UNMANAGED); + + ASSERT (strcmp (unmanaged, "mac:00:11:22:33:f8:9f") == 0, + "unmanaged-verify", "failed to verify %s: expected unmanaged", TEST_IFCFG_UNMANAGED); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "unmanaged-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_UNMANAGED, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "unmanaged-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_UNMANAGED, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "unmanaged-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_UNMANAGED, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == expected_timestamp, + "unmanaged-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_UNMANAGED, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + /* Since the unmanaged connections are not completely read, defaults will + * be used for many settings. + */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "unmanaged-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_UNMANAGED, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "unmanaged-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_UNMANAGED, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "unmanaged-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_UNMANAGED, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "unmanaged-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_UNMANAGED, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "unmanaged-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_UNMANAGED, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 == NULL, + "unmanaged-verify-ip4", "failed to verify %s: unexpected %s setting", + TEST_IFCFG_UNMANAGED, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + g_object_unref (connection); +} + +static void +test_read_wired_static (const char *file, const char *expected_id) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *unmanaged = FALSE; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0xee }; + const char *tmp; + const char *expected_dns1 = "4.2.2.1"; + const char *expected_dns2 = "4.2.2.2"; + struct in_addr addr; + struct in6_addr addr6; + const char *expected_address1 = "192.168.1.5"; + const char *expected_address1_gw = "192.168.1.1"; + const char *expected6_address1 = "dead:beaf::1"; + const char *expected6_address2 = "dead:beaf::2"; + const char *expected6_dns1 = "1:2:3:4::a"; + const char *expected6_dns2 = "1:2:3:4::b"; + NMIP4Address *ip4_addr; + NMIP6Address *ip6_addr; + + connection = connection_from_file (file, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-static-read", "failed to read %s: %s", file, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-static-verify", "failed to verify %s: %s", file, error->message); + + ASSERT (unmanaged == FALSE, + "wired-static-verify", "failed to verify %s: unexpected unmanaged value", file); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-static-verify-connection", "failed to verify %s: missing %s setting", + file, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-static-verify-connection", "failed to verify %s: missing %s / %s key", + file, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-static-verify-connection", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == 0, + "wired-static-verify-connection", "failed to verify %s: unexpected %s /%s key value", + file, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "wired-static-verify-connection", "failed to verify %s: unexpected %s /%s key value", + file, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-static-verify-wired", "failed to verify %s: missing %s setting", + file, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "wired-static-verify-wired", "failed to verify %s: missing %s / %s key", + file, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "wired-static-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + file, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "wired-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + ASSERT (nm_setting_wired_get_mtu (s_wired) == 1492, + "wired-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MTU); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-static-verify-ip4", "failed to verify %s: missing %s setting", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0, + "wired-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + /* Implicit may-fail */ + ASSERT (nm_setting_ip4_config_get_may_fail (s_ip4) == FALSE, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_MAY_FAIL); + + /* DNS Addresses */ + ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2, + "wired-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET, expected_dns1, &addr) > 0, + "wired-static-verify-ip4", "failed to verify %s: couldn't convert DNS IP address #1", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 0) == addr.s_addr, + "wired-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value #1", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET, expected_dns2, &addr) > 0, + "wired-static-verify-ip4", "failed to verify %s: couldn't convert DNS IP address #2", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 1) == addr.s_addr, + "wired-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value #2", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 1, + "wired-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + /* Address #1 */ + ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0); + ASSERT (ip4_addr, + "wired-static-verify-ip4", "failed to verify %s: missing IP4 address #1", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (nm_ip4_address_get_prefix (ip4_addr) == 24, + "wired-static-verify-ip4", "failed to verify %s: unexpected IP4 address #1 prefix", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address1, &addr) > 0, + "wired-static-verify-ip4", "failed to verify %s: couldn't convert IP address #1", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_ip4_address_get_address (ip4_addr) == addr.s_addr, + "wired-static-verify-ip4", "failed to verify %s: unexpected IP4 address #1", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address1_gw, &addr) > 0, + "wired-static-verify-ip4", "failed to verify %s: couldn't convert IP address #1 gateway", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + ASSERT (nm_ip4_address_get_gateway (ip4_addr) == addr.s_addr, + "wired-static-verify-ip4", "failed to verify %s: unexpected IP4 address #1 gateway", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + if (!strcmp (expected_id, "System test-wired-static")) { + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-static-verify-ip6", "failed to verify %s: missing %s setting", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) == 0, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + /* Implicit may-fail */ + ASSERT (nm_setting_ip6_config_get_may_fail (s_ip6) == TRUE, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_MAY_FAIL); + + /* DNS Addresses */ + ASSERT (nm_setting_ip6_config_get_num_dns (s_ip6) == 2, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected6_dns1, &addr6) > 0, + "wired-static-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #1", + file); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 0), &addr6), + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value #1", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET6, expected6_dns2, &addr6) > 0, + "wired-static-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #2", + file); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 1), &addr6), + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value #2", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + + ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 2, + "wired-static-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + /* Address #1 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0); + ASSERT (ip6_addr, + "wired-static-verify-ip6", "failed to verify %s: missing IP6 address #1", + file); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 64, + "wired-static-verify-ip6", "failed to verify %s: unexpected IP6 address #1 prefix", + file); + + ASSERT (inet_pton (AF_INET6, expected6_address1, &addr6) > 0, + "wired-static-verify-ip6", "failed to verify %s: couldn't convert IP address #1", + file); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "wired-static-verify-ip6", "failed to verify %s: unexpected IP6 address #1", + file); + + /* Address #2 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 1); + ASSERT (ip6_addr, + "wired-static-verify-ip6", "failed to verify %s: missing IP6 address #2", + file); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 56, + "wired-static-verify-ip6", "failed to verify %s: unexpected IP6 address #2 prefix", + file); + + ASSERT (inet_pton (AF_INET6, expected6_address2, &addr6) > 0, + "wired-static-verify-ip6", "failed to verify %s: couldn't convert IP address #2", + file); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "wired-static-verify-ip6", "failed to verify %s: unexpected IP6 address #2", + file); + } + + g_object_unref (connection); +} + +#define TEST_IFCFG_STATIC_NO_PREFIX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-no-prefix" + +static void +test_read_wired_static_no_prefix (guint32 expected_prefix) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingIP4Config *s_ip4; + char *unmanaged = FALSE; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + NMIP4Address *ip4_addr; + char *file, *expected_id; + const char *tmp; + + file = g_strdup_printf (TEST_IFCFG_STATIC_NO_PREFIX "-%u", expected_prefix); + ASSERT (file != NULL, + "wired-static-no-prefix-read", "failed to create path to file"); + + expected_id = g_strdup_printf ("System test-wired-static-no-prefix-%u", expected_prefix); + ASSERT (expected_id != NULL, + "wired-static-no-prefix-read", "failed to expected connection ID"); + + connection = connection_from_file (file, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-static-no-prefix-read", "failed to read %s: %s", file, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-static-no-prefix-verify", "failed to verify %s: %s", file, error->message); + + ASSERT (unmanaged == FALSE, + "wired-static-no-prefix-verify", "failed to verify %s: unexpected unmanaged value", file); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-static-no-prefix-verify-connection", "failed to verify %s: missing %s setting", + file, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-static-no-prefix-verify-connection", "failed to verify %s: missing %s / %s key", + file, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-static-no-prefix-verify-connection", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + g_free (expected_id); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: missing %s setting", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 1, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + /* Address #1 */ + ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0); + ASSERT (ip4_addr, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: missing IP4 address #1", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (nm_ip4_address_get_prefix (ip4_addr) == expected_prefix, + "wired-static-no-prefix-verify-ip4", "failed to verify %s: unexpected IP4 address #1 prefix", + file, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + g_free (file); + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_DHCP TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcp" + +static void +test_read_wired_dhcp (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + char *unmanaged = NULL; + char *keyfile = NULL; + char *routefile = NULL; + char *route6file = NULL; + gboolean ignore_error = FALSE; + GError *error = NULL; + const GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0xee }; + const char *tmp; + const char *expected_id = "System test-wired-dhcp"; + const char *expected_dns1 = "4.2.2.1"; + const char *expected_dns2 = "4.2.2.2"; + struct in_addr addr; + const char *expected_dhcp_hostname = "foobar"; + + connection = connection_from_file (TEST_IFCFG_WIRED_DHCP, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-dhcp-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DHCP, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-dhcp-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_DHCP, error->message); + + ASSERT (unmanaged == FALSE, + "wired-dhcp-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_DHCP); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-dhcp-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-dhcp-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-dhcp-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == 0, + "wired-dhcp-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "wired-dhcp-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-dhcp-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "wired-dhcp-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "wired-dhcp-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "wired-dhcp-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-dhcp-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + tmp = nm_setting_ip4_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); + 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); + + ASSERT (nm_setting_ip4_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); + + /* DNS Addresses */ + ASSERT (nm_setting_ip4_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); + + ASSERT (inet_pton (AF_INET, expected_dns1, &addr) > 0, + "wired-dhcp-verify-ip4", "failed to verify %s: couldn't convert DNS IP address #1", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 0) == addr.s_addr, + "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); + + ASSERT (inet_pton (AF_INET, expected_dns2, &addr) > 0, + "wired-dhcp-verify-ip4", "failed to verify %s: couldn't convert DNS IP address #2", + TEST_IFCFG_WIRED_DHCP, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 1) == addr.s_addr, + "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); + + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_GLOBAL_GATEWAY TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-global-gateway" +#define TEST_NETWORK_WIRED_GLOBAL_GATEWAY TEST_IFCFG_DIR"/network-scripts/network-test-wired-global-gateway" + +static void +test_read_wired_global_gateway (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *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-global-gateway"; + struct in_addr addr; + const char *expected_address1 = "192.168.1.5"; + const char *expected_address1_gw = "192.168.1.2"; + NMIP4Address *ip4_addr; + + connection = connection_from_file (TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + TEST_NETWORK_WIRED_GLOBAL_GATEWAY, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-global-gateway-read", "failed to read %s: %s", TEST_IFCFG_WIRED_GLOBAL_GATEWAY, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-global-gateway-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_GLOBAL_GATEWAY, error->message); + + ASSERT (unmanaged == FALSE, + "wired-global-gateway-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_GLOBAL_GATEWAY); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-global-gateway-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-global-gateway-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-global-gateway-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-global-gateway-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-global-gateway-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0, + "wired-global-gateway-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + /* Address #1 */ + ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0); + ASSERT (ip4_addr, + "wired-global-gateway-verify-ip4", "failed to verify %s: missing IP4 address #1", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (nm_ip4_address_get_prefix (ip4_addr) == 24, + "wired-global-gateway-verify-ip4", "failed to verify %s: unexpected IP4 address #1 prefix", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address1, &addr) > 0, + "wired-global-gateway-verify-ip4", "failed to verify %s: couldn't convert IP address #1", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_ip4_address_get_address (ip4_addr) == addr.s_addr, + "wired-global-gateway-verify-ip4", "failed to verify %s: unexpected IP4 address #1", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address1_gw, &addr) > 0, + "wired-global-gateway-verify-ip4", "failed to verify %s: couldn't convert IP address #1 gateway", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + ASSERT (nm_ip4_address_get_gateway (ip4_addr) == addr.s_addr, + "wired-global-gateway-verify-ip4", "failed to verify %s: unexpected IP4 address #1 gateway", + TEST_IFCFG_WIRED_GLOBAL_GATEWAY, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_NEVER_DEFAULT TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-never-default" +#define TEST_NETWORK_WIRED_NEVER_DEFAULT TEST_IFCFG_DIR"/network-scripts/network-test-wired-never-default" + +static void +test_read_wired_never_default (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + 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; + const char *tmp; + const char *expected_id = "System test-wired-never-default"; + + connection = connection_from_file (TEST_IFCFG_WIRED_NEVER_DEFAULT, + TEST_NETWORK_WIRED_NEVER_DEFAULT, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-never-default-read", "failed to read %s: %s", TEST_IFCFG_WIRED_NEVER_DEFAULT, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-never-default-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_NEVER_DEFAULT, error->message); + + ASSERT (unmanaged == FALSE, + "wired-never-default-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_NEVER_DEFAULT); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-never-default-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-never-default-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-never-default-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-never-default-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-never-default-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0, + "wired-never-default-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + ASSERT (nm_setting_ip4_config_get_never_default (s_ip4) == TRUE, + "wired-never-default-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_NEVER_DEFAULT); + + /* DNS Addresses */ + ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 0, + "wired-never-default-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-never-default-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_config_get_method (s_ip6); + ASSERT (strcmp (tmp, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0, + "wired-never-default-verify-ip6", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_METHOD); + + ASSERT (nm_setting_ip6_config_get_never_default (s_ip6) == TRUE, + "wired-never-default-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_NEVER_DEFAULT, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_DEFROUTE_NO TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-defroute-no" + +static void +test_read_wired_defroute_no (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + 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; + const char *tmp; + const char *expected_id = "System test-wired-defroute-no"; + + connection = connection_from_file (TEST_IFCFG_WIRED_DEFROUTE_NO, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-defroute-no-read", "failed to read %s: %s", TEST_IFCFG_WIRED_DEFROUTE_NO, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-defroute-no-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_DEFROUTE_NO, error->message); + + ASSERT (unmanaged == FALSE, + "wired-defroute-no-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_DEFROUTE_NO); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-defroute-no-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-defroute-no-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-defroute-no-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-defroute-no-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-defroute-no-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + ASSERT (nm_setting_ip4_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); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-defroute-no-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_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); + + ASSERT (nm_setting_ip6_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); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-defroute-no-gatewaydev-yes" +#define TEST_NETWORK_WIRED_DEFROUTE_NO_GATEWAYDEV_YES TEST_IFCFG_DIR"/network-scripts/network-test-wired-defroute-no-gatewaydev-yes" + +static void +test_read_wired_defroute_no_gatewaydev_yes (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + 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; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-defroute-no-gatewaydev-yes-read", + "failed to read %s: %s", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-defroute-no-gatewaydev-yes-verify", + "failed to verify %s: %s", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + error->message); + + ASSERT (unmanaged == FALSE, + "wired-defroute-no-gatewaydev-yes-verify", + "failed to verify %s: unexpected unmanaged value", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-defroute-no-gatewaydev-yes-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-defroute-no-gatewaydev-yes-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-defroute-no-gatewaydev-yes-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-defroute-no-gatewaydev-yes-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-defroute-no-gatewaydev-yes-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + ASSERT (nm_setting_ip4_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); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-defroute-no-gatewaydev-yes-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + 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", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_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", + TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_STATIC_ROUTES TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-routes" + +static void +test_read_wired_static_routes (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *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; + struct in_addr addr; + const char *expected_id = "System test-wired-static-routes"; + const char *expected_dst1 = "11.22.33.0"; + const char *expected_dst2 = "44.55.66.77"; + const char *expected_gw1 = "192.168.1.5"; + const char *expected_gw2 = "192.168.1.7"; + + connection = connection_from_file (TEST_IFCFG_WIRED_STATIC_ROUTES, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + + ASSERT (connection != NULL, + "wired-static-routes-read", + "failed to read %s: %s", + TEST_IFCFG_WIRED_STATIC_ROUTES, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-static-routes-verify", "failed to verify %s: %s", + TEST_IFCFG_WIRED_STATIC_ROUTES, error->message); + + ASSERT (unmanaged == NULL, + "wired-static-routes-verify", + "failed to verify %s: unexpected unmanaged value", + TEST_IFCFG_WIRED_STATIC_ROUTES); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-static-routes-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-static-routes-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-static-routes-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-static-routes-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-static-routes-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + /* Routes */ + ASSERT (nm_setting_ip4_config_get_num_routes (s_ip4) == 2, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ROUTES); + + ip4_route = nm_setting_ip4_config_get_route (s_ip4, 0); + ASSERT (ip4_route, + "wired-static-routes-verify-ip4", "failed to verify %s: missing IP4 route #1", + TEST_IFCFG_WIRED_STATIC_ROUTES); + + ASSERT (inet_pton (AF_INET, expected_dst1, &addr) > 0, + "wired-static-routes-verify-ip4", "failed to verify %s: couldn't convert destination IP address #1", + TEST_IFCFG_WIRED_STATIC_ROUTES); + ASSERT (nm_ip4_route_get_dest (ip4_route) == addr.s_addr, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected %s / %s key value #1", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ROUTES); + + ASSERT (nm_ip4_route_get_prefix (ip4_route) == 24, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected destination route #1 prefix", + TEST_IFCFG_WIRED_STATIC_ROUTES); + + ASSERT (inet_pton (AF_INET, expected_gw1, &addr) > 0, + "wired-static-routes-verify-ip4", "failed to verify %s: couldn't convert next hop IP address #1", + TEST_IFCFG_WIRED_STATIC_ROUTES); + ASSERT (nm_ip4_route_get_next_hop (ip4_route) == addr.s_addr, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected %s / %s key value #1", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ROUTES); + + ip4_route = nm_setting_ip4_config_get_route (s_ip4, 1); + ASSERT (ip4_route, + "wired-static-routes-verify-ip4", "failed to verify %s: missing IP4 route #2", + TEST_IFCFG_WIRED_STATIC_ROUTES); + + ASSERT (inet_pton (AF_INET, expected_dst2, &addr) > 0, + "wired-static-routes-verify-ip4", "failed to verify %s: couldn't convert destination IP address #2", + TEST_IFCFG_WIRED_STATIC_ROUTES); + ASSERT (nm_ip4_route_get_dest (ip4_route) == addr.s_addr, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected %s / %s key value #2", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ROUTES); + + ASSERT (nm_ip4_route_get_prefix (ip4_route) == 32, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected destination route #2 prefix", + TEST_IFCFG_WIRED_STATIC_ROUTES); + + ASSERT (inet_pton (AF_INET, expected_gw2, &addr) > 0, + "wired-static-routes-verify-ip4", "failed to verify %s: couldn't convert next hop IP address #2", + TEST_IFCFG_WIRED_STATIC_ROUTES); + ASSERT (nm_ip4_route_get_next_hop (ip4_route) == addr.s_addr, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected %s / %s key value #2", + TEST_IFCFG_WIRED_STATIC_ROUTES, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ROUTES); + ASSERT (nm_ip4_route_get_metric (ip4_route) == 3, + "wired-static-routes-verify-ip4", "failed to verify %s: unexpected route metric #2", + TEST_IFCFG_WIRED_STATIC_ROUTES); + + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-routes-legacy" + +static void +test_read_wired_static_routes_legacy (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *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; + struct in_addr addr; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + + ASSERT (connection != NULL, + "wired-static-routes-legacy-read", + "failed to read %s: %s", + TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-static-routes-legacy-verify", "failed to verify %s: %s", + TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, error->message); + + ASSERT (unmanaged == NULL, + "wired-static-routes-legacy-verify", + "failed to verify %s: unexpected unmanaged value", + TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-static-routes-legacy-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-static-routes-legacy-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-static-routes-legacy-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-static-routes-legacy-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-static-routes-legacy-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + /* Routes */ + ASSERT (nm_setting_ip4_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); + + /* 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.s_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.s_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); + + /* 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.s_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.s_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); + + /* 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); + + 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.s_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.s_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 (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_IPV6_MANUAL TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-ipv6-manual" + +static void +test_read_wired_ipv6_manual (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + 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; + 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; + const char *expected_route1_dest = "9876::1234"; + guint32 expected_route1_prefix = 96; + const char *expected_route1_nexthop = "9876::7777"; + guint32 expected_route1_metric = 2; + const char *expected_dns1 = "1:2:3:4::a"; + const char *expected_dns2 = "1:2:3:4::b"; + NMIP6Address *ip6_addr; + NMIP6Route *ip6_route; + struct in6_addr addr; + + connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_MANUAL, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-ipv6-manual-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_MANUAL, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-ipv6-manual-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_IPV6_MANUAL, error->message); + + ASSERT (unmanaged == FALSE, + "wired-ipv6-manual-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-ipv6-manual-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-ipv6-manual-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-ipv6-manual-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-ipv6-manual-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-ipv6-manual-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* DNS Addresses */ + ASSERT (nm_setting_ip4_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); + + /* DNS search domains */ + ASSERT (nm_setting_ip4_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); + + tmp = nm_setting_ip4_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); + 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); + + tmp = nm_setting_ip4_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); + 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); + + tmp = nm_setting_ip4_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); + 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); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_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); + + ASSERT (nm_setting_ip6_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); + + ASSERT (nm_setting_ip6_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); + + /* IP addresses */ + ASSERT (nm_setting_ip6_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); + + /* 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); + + /* 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); + + /* 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); + + /* Routes */ + ASSERT (nm_setting_ip6_config_get_num_routes (s_ip6) == 1, + "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_ROUTES); + + /* Route #1 */ + ip6_route = nm_setting_ip6_config_get_route (s_ip6, 0); + ASSERT (ip6_route, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: missing IP6 route #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (inet_pton (AF_INET6, expected_route1_dest, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP route dest #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_route_get_dest (ip6_route), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 route dest #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (nm_ip6_route_get_prefix (ip6_route) == expected_route1_prefix, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 route #1 prefix", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (inet_pton (AF_INET6, expected_route1_nexthop, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert IP route next_hop #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_route_get_next_hop (ip6_route), &addr), + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 route next hop #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + ASSERT (nm_ip6_route_get_metric (ip6_route) == expected_route1_metric, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: unexpected IP6 route #1 metric", + TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* DNS Addresses */ + ASSERT (nm_setting_ip6_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); + + ASSERT (inet_pton (AF_INET6, expected_dns1, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 0), &addr), + "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); + + ASSERT (inet_pton (AF_INET6, expected_dns2, &addr) > 0, + "wired-ipv6-manual-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #2", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 1), &addr), + "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); + + /* DNS domains - none as domains are stuffed to 'ipv4' setting */ + ASSERT (nm_setting_ip6_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); + + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_IPV6_ONLY TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-ipv6-only" + +static void +test_read_wired_ipv6_only (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + 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; + const char *tmp; + const char *expected_id = "System test-wired-ipv6-only"; + const char *expected_address1 = "1001:abba::1234"; + guint32 expected_prefix1 = 56; + const char *expected_dns1 = "1:2:3:4::a"; + NMIP6Address *ip6_addr; + struct in6_addr addr; + const char *method; + + connection = connection_from_file (TEST_IFCFG_WIRED_IPV6_ONLY, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-ipv6-only-read", "failed to read %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-ipv6-only-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); + + ASSERT (unmanaged == FALSE, + "wired-ipv6-only-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_IPV6_MANUAL); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wired-ipv6-only-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wired-ipv6-only-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wired-ipv6-only-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-ipv6-only-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-ipv6-only-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + method = nm_setting_ip4_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); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "wired-ipv6-only-verify-ip6", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_IPV6_MANUAL, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_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); + + /* IP addresses */ + ASSERT (nm_setting_ip6_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); + + /* 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); + + /* DNS Addresses */ + ASSERT (nm_setting_ip6_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); + + ASSERT (inet_pton (AF_INET6, expected_dns1, &addr) > 0, + "wired-ipv6-only-verify-ip6", "failed to verify %s: couldn't convert DNS IP address #1", + TEST_IFCFG_WIRED_IPV6_MANUAL); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 0), &addr), + "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); + + /* DNS domains - none as domains are stuffed to 'ipv4' setting */ + ASSERT (nm_setting_ip6_config_get_num_dns_searches (s_ip6) == 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_DNS); + + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); +} + +#define TEST_IFCFG_ONBOOT_NO TEST_IFCFG_DIR"/network-scripts/ifcfg-test-onboot-no" + +static void +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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "onboot-no-read", "failed to read %s: %s", TEST_IFCFG_ONBOOT_NO, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "onboot-no-verify", "failed to verify %s: %s", TEST_IFCFG_ONBOOT_NO, error->message); + + ASSERT (unmanaged == FALSE, + "onboot-no-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_ONBOOT_NO); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "onboot-no-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_ONBOOT_NO, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == FALSE, + "onboot-no-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_ONBOOT_NO, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2 TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-8021x-peap-mschapv2" +#define TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2_CA_CERT TEST_IFCFG_DIR"/network-scripts/test_ca_cert.pem" + +static void +test_read_wired_8021x_peap_mschapv2 (void) +{ + NMConnection *connection; + NMSettingWired *s_wired; + NMSettingIP4Config *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"; + const char *expected_password = "foobar baz"; + gboolean success = FALSE; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wired-8021x-peap-mschapv2-read", "failed to read %s: %s", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wired-8021x-peap-mschapv2-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, error->message); + + ASSERT (unmanaged == FALSE, + "wired-8021x-peap-mschapv2-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "wired-8021x-peap-mschapv2-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wired-8021x-peap-mschapv2-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + /* ===== 802.1x SETTING ===== */ + s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); + ASSERT (s_8021x != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME); + + /* EAP methods */ + ASSERT (nm_setting_802_1x_get_num_eap_methods (s_8021x) == 1, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + tmp = nm_setting_802_1x_get_eap_method (s_8021x, 0); + ASSERT (tmp != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: missing %s / %s eap method", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + ASSERT (strcmp (tmp, "peap") == 0, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + + /* Identity */ + tmp = nm_setting_802_1x_get_identity (s_8021x); + ASSERT (tmp != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_IDENTITY); + ASSERT (strcmp (tmp, expected_identity) == 0, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_IDENTITY); + + /* Password */ + tmp = nm_setting_802_1x_get_password (s_8021x); + ASSERT (tmp != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PASSWORD); + ASSERT (strcmp (tmp, expected_password) == 0, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PASSWORD); + + /* PEAP version */ + tmp = nm_setting_802_1x_get_phase1_peapver (s_8021x); + ASSERT (tmp != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE1_PEAPVER); + ASSERT (strcmp (tmp, "1") == 0, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE1_PEAPVER); + + /* PEAP Label */ + tmp = nm_setting_802_1x_get_phase1_peaplabel (s_8021x); + ASSERT (tmp != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE1_PEAPLABEL); + ASSERT (strcmp (tmp, "1") == 0, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE1_PEAPLABEL); + + /* CA Cert */ + tmp_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (tmp_8021x != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: could not create temp 802.1x setting", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME); + + success = nm_setting_802_1x_set_ca_cert (tmp_8021x, + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2_CA_CERT, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: could not load CA certificate", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_CA_CERT); + expected_ca_cert_path = nm_setting_802_1x_get_ca_cert_path (tmp_8021x); + ASSERT (expected_ca_cert_path != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: failed to get CA certificate", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_CA_CERT); + + read_ca_cert_path = nm_setting_802_1x_get_ca_cert_path (s_8021x); + ASSERT (read_ca_cert_path != NULL, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_CA_CERT); + + ASSERT (strcmp (read_ca_cert_path, expected_ca_cert_path) == 0, + "wired-8021x-peap-mschapv2-verify-8021x", "failed to verify %s: unexpected %s / %s certificate path", + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_CA_CERT); + + g_object_unref (tmp_8021x); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_OPEN TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open" + +static void +test_read_wifi_open (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + NMSettingIP4Config *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 GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 }; + const char *expected_id = "System blahblah (test-wifi-open)"; + guint64 expected_timestamp = 0; + const char *expected_ssid = "blahblah"; + const char *expected_mode = "infrastructure"; + const guint32 expected_channel = 1; + + connection = connection_from_file (TEST_IFCFG_WIFI_OPEN, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-open-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-open-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_OPEN, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-open-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-open-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-open-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID can't be tested if the ifcfg does not contain the UUID key, because + * the UUID is generated on the full path of the ifcfg file, which can change + * depending on where the tests are run. + */ + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == expected_timestamp, + "wifi-open-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "wifi-open-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-open-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wireless_get_mac_address (s_wireless); + ASSERT (array != NULL, + "wifi-open-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "wifi-open-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "wifi-open-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + + ASSERT (nm_setting_wireless_get_mtu (s_wireless) == 0, + "wifi-open-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MTU); + + array = nm_setting_wireless_get_ssid (s_wireless); + ASSERT (array != NULL, + "wifi-open-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (array->len == strlen (expected_ssid), + "wifi-open-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (memcmp (array->data, expected_ssid, strlen (expected_ssid)) == 0, + "wifi-open-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + + ASSERT (nm_setting_wireless_get_bssid (s_wireless) == NULL, + "wifi-open-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID); + + tmp = nm_setting_wireless_get_mode (s_wireless); + ASSERT (tmp != NULL, + "wifi-open-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + ASSERT (strcmp (tmp, expected_mode) == 0, + "wifi-open-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + + ASSERT (nm_setting_wireless_get_security (s_wireless) == NULL, + "wifi-open-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + ASSERT (nm_setting_wireless_get_channel (s_wireless) == expected_channel, + "wifi-open-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_CHANNEL); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-open-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_OPEN_AUTO TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-auto" + +static void +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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-open-auto-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_AUTO, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-open-auto-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_OPEN_AUTO, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-open-auto-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN_AUTO, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-open-auto-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN_AUTO, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-open-auto-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN_AUTO, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-open-auto-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN_AUTO, + NM_SETTING_WIRELESS_SETTING_NAME); + + tmp = nm_setting_wireless_get_mode (s_wireless); + ASSERT (tmp != NULL, + "wifi-open-auto-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN_AUTO, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + ASSERT (strcmp (tmp, expected_mode) == 0, + "wifi-open-auto-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN_AUTO, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_OPEN_SSID_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-hex" + +static void +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; + const GByteArray *array; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-open-ssid-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_HEX, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-open-ssid-hex-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_HEX, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-open-ssid-hex-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN_SSID_HEX, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-open-ssid-hex-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN_SSID_HEX, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-open-ssid-hex-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN_SSID_HEX, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-open-ssid-hex-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN_SSID_HEX, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* SSID */ + array = nm_setting_wireless_get_ssid (s_wireless); + ASSERT (array != NULL, + "wifi-open-ssid-hex-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN_SSID_HEX, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (array->len == strlen (expected_ssid), + "wifi-open-ssid-hex-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_OPEN_SSID_HEX, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (memcmp (array->data, expected_ssid, strlen (expected_ssid)) == 0, + "wifi-open-ssid-hex-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN_SSID_HEX, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + + g_object_unref (connection); +} + +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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection == NULL, test, "unexpected success reading %s", file); + g_clear_error (&error); +} + +#define TEST_IFCFG_WIFI_OPEN_SSID_QUOTED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-quoted" + +static void +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; + const GByteArray *array; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-open-ssid-quoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-open-ssid-quoted-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-open-ssid-quoted-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-open-ssid-quoted-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-open-ssid-quoted-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-open-ssid-quoted-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* SSID */ + array = nm_setting_wireless_get_ssid (s_wireless); + ASSERT (array != NULL, + "wifi-open-ssid-quoted-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (array->len == strlen (expected_ssid), + "wifi-open-ssid-quoted-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (memcmp (array->data, expected_ssid, strlen (expected_ssid)) == 0, + "wifi-open-ssid-quoted-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WEP TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep" + +static void +test_read_wifi_wep (void) +{ + NMConnection *connection; + 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; + GError *error = NULL; + const char *tmp; + const GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 }; + const char *expected_id = "System blahblah (test-wifi-wep)"; + guint64 expected_timestamp = 0; + const char *expected_ssid = "blahblah"; + const char *expected_mode = "infrastructure"; + const guint32 expected_channel = 1; + const char *expected_wep_key0 = "0123456789abcdef0123456789"; + NMWepKeyType key_type; + + connection = connection_from_file (TEST_IFCFG_WIFI_WEP, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WEP, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wep-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-wep-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-wep-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID can't be tested if the ifcfg does not contain the UUID key, because + * the UUID is generated on the full path of the ifcfg file, which can change + * depending on where the tests are run. + */ + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == expected_timestamp, + "wifi-wep-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "wifi-wep-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wireless_get_mac_address (s_wireless); + ASSERT (array != NULL, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + + /* MTU */ + ASSERT (nm_setting_wireless_get_mtu (s_wireless) == 0, + "wifi-wep-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MTU); + + /* SSID */ + array = nm_setting_wireless_get_ssid (s_wireless); + ASSERT (array != NULL, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (array->len == strlen (expected_ssid), + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (memcmp (array->data, expected_ssid, strlen (expected_ssid)) == 0, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + + /* BSSID */ + ASSERT (nm_setting_wireless_get_bssid (s_wireless) == NULL, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID); + + /* Mode */ + tmp = nm_setting_wireless_get_mode (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + ASSERT (strcmp (tmp, expected_mode) == 0, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + + /* Channel */ + ASSERT (nm_setting_wireless_get_channel (s_wireless) == expected_channel, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_CHANNEL); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "none") == 0, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP key index */ + ASSERT (nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) == 0, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + + /* WEP key type */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + ASSERT (key_type == NM_WEP_KEY_TYPE_UNKNOWN || key_type == NM_WEP_KEY_TYPE_KEY, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected WEP key type %d", + TEST_IFCFG_WIFI_WEP, + key_type); + + /* WEP key index 0 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + ASSERT (strcmp (tmp, expected_wep_key0) == 0, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + + /* WEP key index 1 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 1); + ASSERT (tmp == NULL, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + + /* WEP key index 2 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 2); + ASSERT (tmp == NULL, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + + /* WEP key index 3 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 3); + ASSERT (tmp == NULL, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + + /* WEP Authentication mode */ + tmp = nm_setting_wireless_security_get_auth_alg (s_wsec); + ASSERT (tmp != NULL, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + ASSERT (strcmp (tmp, "shared") == 0, + "wifi-wep-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-wep-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WEP_ADHOC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep-adhoc" + +static void +test_read_wifi_wep_adhoc (void) +{ + NMConnection *connection; + 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; + GError *error = NULL; + const char *tmp; + const GByteArray *array; + const char *expected_id = "System blahblah (test-wifi-wep-adhoc)"; + const char *expected_ssid = "blahblah"; + const char *expected_mode = "adhoc"; + const char *expected_wep_key0 = "0123456789abcdef0123456789"; + struct in_addr addr; + const char *expected_dns1 = "4.2.2.1"; + const char *expected_dns2 = "4.2.2.2"; + + connection = connection_from_file (TEST_IFCFG_WIFI_WEP_ADHOC, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_ADHOC, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-adhoc-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WEP_ADHOC, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wep-adhoc-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-wep-adhoc-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-wep-adhoc-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID can't be tested if the ifcfg does not contain the UUID key, because + * the UUID is generated on the full path of the ifcfg file, which can change + * depending on where the tests are run. + */ + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == FALSE, + "wifi-wep-adhoc-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* SSID */ + array = nm_setting_wireless_get_ssid (s_wireless); + ASSERT (array != NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (array->len == strlen (expected_ssid), + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (memcmp (array->data, expected_ssid, strlen (expected_ssid)) == 0, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + + /* BSSID */ + ASSERT (nm_setting_wireless_get_bssid (s_wireless) == NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID); + + /* Mode */ + tmp = nm_setting_wireless_get_mode (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + ASSERT (strcmp (tmp, expected_mode) == 0, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + + /* Channel */ + ASSERT (nm_setting_wireless_get_channel (s_wireless) == 11, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_CHANNEL); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "none") == 0, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP key index */ + ASSERT (nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) == 0, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + + /* WEP key index 0 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + ASSERT (strcmp (tmp, expected_wep_key0) == 0, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + + /* WEP key index 1 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 1); + ASSERT (tmp == NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + + /* WEP key index 2 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 2); + ASSERT (tmp == NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + + /* WEP key index 3 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 3); + ASSERT (tmp == NULL, + "wifi-wep-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + + /* WEP Authentication mode */ + tmp = nm_setting_wireless_security_get_auth_alg (s_wsec); + ASSERT (tmp == NULL, + "wifi-wep-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-wep-adhoc-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + /* Ignore auto DNS */ + ASSERT (nm_setting_ip4_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); + + /* DNS Addresses */ + ASSERT (nm_setting_ip4_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); + + ASSERT (inet_pton (AF_INET, expected_dns1, &addr) > 0, + "wifi-wep-adhoc-verify-ip4", "failed to verify %s: couldn't convert DNS IP address #1", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 0) == addr.s_addr, + "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); + + ASSERT (inet_pton (AF_INET, expected_dns2, &addr) > 0, + "wifi-wep-adhoc-verify-ip4", "failed to verify %s: couldn't convert DNS IP address #2", + TEST_IFCFG_WIFI_WEP_ADHOC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 1) == addr.s_addr, + "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); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WEP_PASSPHRASE TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep-passphrase" + +static void +test_read_wifi_wep_passphrase (void) +{ + NMConnection *connection; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-passphrase-read", "failed to read %s: %s", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-passphrase-verify", "failed to verify %s: %s", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wep-passphrase-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "none") == 0, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP key index */ + ASSERT (nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) == 0, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + + /* WEP key type */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + ASSERT (key_type == NM_WEP_KEY_TYPE_PASSPHRASE, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected WEP key type %d", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + key_type); + + /* WEP key index 0 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + ASSERT (strcmp (tmp, expected_wep_key0) == 0, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + + /* WEP key index 1 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 1); + ASSERT (tmp == NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + + /* WEP key index 2 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 2); + ASSERT (tmp == NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + + /* WEP key index 3 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 3); + ASSERT (tmp == NULL, + "wifi-wep-passphrase-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_PASSPHRASE, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WEP_40_ASCII TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep-40-ascii" + +static void +test_read_wifi_wep_40_ascii (void) +{ + NMConnection *connection; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-40-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-40-ascii-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WEP_40_ASCII, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wep-40-ascii-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "none") == 0, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP key index */ + ASSERT (nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) == 0, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + + /* WEP key type */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + ASSERT (key_type == NM_WEP_KEY_TYPE_UNKNOWN || key_type == NM_WEP_KEY_TYPE_KEY, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected WEP key type %d", + TEST_IFCFG_WIFI_WEP_40_ASCII, + key_type); + + /* WEP key index 0 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + ASSERT (strcmp (tmp, expected_wep_key0) == 0, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + + /* WEP key index 1 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 1); + ASSERT (tmp == NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + + /* WEP key index 2 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 2); + ASSERT (tmp == NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + + /* WEP key index 3 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 3); + ASSERT (tmp == NULL, + "wifi-wep-40-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_40_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WEP_104_ASCII TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep-104-ascii" + +static void +test_read_wifi_wep_104_ascii (void) +{ + NMConnection *connection; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-104-ascii-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-104-ascii-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WEP_104_ASCII, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wep-104-ascii-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "none") == 0, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP key index */ + ASSERT (nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) == 0, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX); + + /* WEP key type */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + ASSERT (key_type == NM_WEP_KEY_TYPE_UNKNOWN || key_type == NM_WEP_KEY_TYPE_KEY, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected WEP key type %d", + TEST_IFCFG_WIFI_WEP_104_ASCII, + key_type); + + /* WEP key index 0 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + ASSERT (strcmp (tmp, expected_wep_key0) == 0, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + + /* WEP key index 1 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 1); + ASSERT (tmp == NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY1); + + /* WEP key index 2 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 2); + ASSERT (tmp == NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY2); + + /* WEP key index 3 */ + tmp = nm_setting_wireless_security_get_wep_key (s_wsec, 3); + ASSERT (tmp == NULL, + "wifi-wep-104-ascii-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WEP_104_ASCII, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_LEAP TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-leap" + +static void +test_read_wifi_leap (void) +{ + NMConnection *connection; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-leap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_LEAP, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-leap-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_LEAP, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-leap-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-leap-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-leap-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-leap-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-leap-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-leap-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-leap-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + ASSERT (strcmp (nm_setting_wireless_security_get_key_mgmt (s_wsec), "ieee8021x") == 0, + "wifi-leap-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* WEP Authentication mode */ + tmp = nm_setting_wireless_security_get_auth_alg (s_wsec); + ASSERT (tmp != NULL, + "wifi-leap-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + ASSERT (strcmp (tmp, "leap") == 0, + "wifi-leap-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + + /* LEAP Username */ + tmp = nm_setting_wireless_security_get_leap_username (s_wsec); + ASSERT (tmp != NULL, + "wifi-leap-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME); + ASSERT (strcmp (tmp, expected_identity) == 0, + "wifi-leap-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME); + + /* LEAP Password */ + tmp = nm_setting_wireless_security_get_leap_password (s_wsec); + ASSERT (tmp != NULL, + "wifi-leap-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD); + ASSERT (strcmp (tmp, expected_password) == 0, + "wifi-leap-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_LEAP, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WPA_PSK TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk" + +static void +test_read_wifi_wpa_psk (void) +{ + NMConnection *connection; + 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; + GError *error = NULL; + const char *tmp; + const GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x16, 0x41, 0x11, 0x22, 0x33 }; + const char *expected_id = "System blahblah (test-wifi-wpa-psk)"; + guint64 expected_timestamp = 0; + const char *expected_ssid = "blahblah"; + const char *expected_mode = "infrastructure"; + const guint32 expected_channel = 1; + const char *expected_key_mgmt = "wpa-psk"; + const char *expected_psk = "I wonder what the king is doing tonight?"; + guint32 n, i; + gboolean found_pair_tkip = FALSE; + gboolean found_pair_ccmp = FALSE; + gboolean found_group_tkip = FALSE; + gboolean found_group_ccmp = FALSE; + gboolean found_group_wep40 = FALSE; + gboolean found_group_wep104 = FALSE; + gboolean found_proto_wpa = FALSE; + gboolean found_proto_rsn = FALSE; + + connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wpa-psk-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wpa-psk-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WPA_PSK, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wpa-psk-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-wpa-psk-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-wpa-psk-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID can't be tested if the ifcfg does not contain the UUID key, because + * the UUID is generated on the full path of the ifcfg file, which can change + * depending on where the tests are run. + */ + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == expected_timestamp, + "wifi-wpa-psk-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "wifi-wpa-psk-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wireless_get_mac_address (s_wireless); + ASSERT (array != NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS); + + /* MTU */ + ASSERT (nm_setting_wireless_get_mtu (s_wireless) == 0, + "wifi-wpa-psk-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MTU); + + /* SSID */ + array = nm_setting_wireless_get_ssid (s_wireless); + ASSERT (array != NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (array->len == strlen (expected_ssid), + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (memcmp (array->data, expected_ssid, strlen (expected_ssid)) == 0, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + + /* BSSID */ + ASSERT (nm_setting_wireless_get_bssid (s_wireless) == NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID); + + /* Mode */ + tmp = nm_setting_wireless_get_mode (s_wireless); + ASSERT (tmp != NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + ASSERT (strcmp (tmp, expected_mode) == 0, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + + /* Channel */ + ASSERT (nm_setting_wireless_get_channel (s_wireless) == expected_channel, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_CHANNEL); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + tmp = nm_setting_wireless_security_get_key_mgmt (s_wsec); + ASSERT (tmp != NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + ASSERT (strcmp (tmp, expected_key_mgmt) == 0, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* PSK */ + tmp = nm_setting_wireless_security_get_psk (s_wsec); + ASSERT (tmp != NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PSK); + ASSERT (strcmp (tmp, expected_psk) == 0, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PSK); + + /* WEP Authentication mode */ + tmp = nm_setting_wireless_security_get_auth_alg (s_wsec); + ASSERT (tmp == NULL, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); + + /* Pairwise ciphers */ + n = nm_setting_wireless_security_get_num_pairwise (s_wsec); + ASSERT (n == 2, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PAIRWISE); + for (i = 0; i < n; i++) { + tmp = nm_setting_wireless_security_get_pairwise (s_wsec, i); + ASSERT (tmp, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing pairwise cipher", + TEST_IFCFG_WIFI_WPA_PSK); + if (strcmp (tmp, "tkip") == 0) + found_pair_tkip = TRUE; + else if (strcmp (tmp, "ccmp") == 0) + found_pair_ccmp = TRUE; + } + ASSERT (found_pair_tkip, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing pairwise TKIP cipher", + TEST_IFCFG_WIFI_WPA_PSK); + ASSERT (found_pair_ccmp, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing pairwise CCMP cipher", + TEST_IFCFG_WIFI_WPA_PSK); + + /* Group ciphers */ + n = nm_setting_wireless_security_get_num_groups (s_wsec); + ASSERT (n == 4, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_GROUP); + for (i = 0; i < n; i++) { + tmp = nm_setting_wireless_security_get_group (s_wsec, i); + ASSERT (tmp, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing group cipher", + TEST_IFCFG_WIFI_WPA_PSK); + if (strcmp (tmp, "tkip") == 0) + found_group_tkip = TRUE; + else if (strcmp (tmp, "ccmp") == 0) + found_group_ccmp = TRUE; + else if (strcmp (tmp, "wep40") == 0) + found_group_wep40 = TRUE; + else if (strcmp (tmp, "wep104") == 0) + found_group_wep104 = TRUE; + } + ASSERT (found_group_tkip, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing group TKIP cipher", + TEST_IFCFG_WIFI_WPA_PSK); + ASSERT (found_group_ccmp, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing group CCMP cipher", + TEST_IFCFG_WIFI_WPA_PSK); + ASSERT (found_group_wep40, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing group WEP-40 cipher", + TEST_IFCFG_WIFI_WPA_PSK); + ASSERT (found_group_wep104, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing group WEP-104 cipher", + TEST_IFCFG_WIFI_WPA_PSK); + + /* Protocols */ + n = nm_setting_wireless_security_get_num_protos (s_wsec); + ASSERT (n == 2, + "wifi-wpa-psk-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PROTO); + for (i = 0; i < n; i++) { + tmp = nm_setting_wireless_security_get_proto (s_wsec, i); + ASSERT (tmp, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing protocol", + TEST_IFCFG_WIFI_WPA_PSK); + if (strcmp (tmp, "wpa") == 0) + found_proto_wpa = TRUE; + else if (strcmp (tmp, "rsn") == 0) + found_proto_rsn = TRUE; + } + ASSERT (found_proto_wpa, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing protoocl WPA", + TEST_IFCFG_WIFI_WPA_PSK); + ASSERT (found_proto_rsn, "wifi-wpa-psk-verify-wireless", "failed to verify %s: missing protocol RSN", + TEST_IFCFG_WIFI_WPA_PSK); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-wpa-psk-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted" + +static void +test_read_wifi_wpa_psk_unquoted (void) +{ + NMConnection *connection; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wpa-psk-unquoted-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wpa-psk-unquoted-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wpa-psk-unquoted-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-wpa-psk-unquoted-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-wpa-psk-unquoted-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wpa-psk-unquoted-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wpa-psk-unquoted-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wpa-psk-unquoted-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wpa-psk-unquoted-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* PSK */ + tmp = nm_setting_wireless_security_get_psk (s_wsec); + ASSERT (tmp != NULL, + "wifi-wpa-psk-unquoted-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PSK); + ASSERT (strcmp (tmp, expected_psk) == 0, + "wifi-wpa-psk-unquoted-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PSK); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2 TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk-unquoted2" + +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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection == NULL, + "wifi-wpa-psk-unquoted-read", "unexpected success reading %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2); + g_clear_error (&error); +} + +#define TEST_IFCFG_WIFI_WPA_PSK_ADHOC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc" + +static void +test_read_wifi_wpa_psk_adhoc (void) +{ + NMConnection *connection; + 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; + GError *error = NULL; + const char *tmp; + const char *expected_id = "System blahblah (test-wifi-wpa-psk-adhoc)"; + const char *expected_mode = "adhoc"; + const char *expected_key_mgmt = "wpa-none"; + const char *expected_psk = "I wonder what the king is doing tonight?"; + const char *expected_group = "ccmp"; + const char *expected_proto = "wpa"; + + connection = connection_from_file (TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wpa-psk-adhoc-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_ADHOC, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wpa-psk-adhoc-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WPA_PSK_ADHOC, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wpa-psk-adhoc-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-wpa-psk-adhoc-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-wpa-psk-adhoc-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* Mode */ + tmp = nm_setting_wireless_get_mode (s_wireless); + ASSERT (tmp != NULL, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + ASSERT (strcmp (tmp, expected_mode) == 0, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MODE); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + tmp = nm_setting_wireless_security_get_key_mgmt (s_wsec); + ASSERT (tmp != NULL, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + ASSERT (strcmp (tmp, expected_key_mgmt) == 0, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* PSK */ + tmp = nm_setting_wireless_security_get_psk (s_wsec); + ASSERT (tmp != NULL, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PSK); + ASSERT (strcmp (tmp, expected_psk) == 0, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PSK); + + /* Pairwise cipher: unused in adhoc mode */ + ASSERT (nm_setting_wireless_security_get_num_pairwise (s_wsec) == 0, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PAIRWISE); + + /* Group cipher */ + ASSERT (nm_setting_wireless_security_get_num_groups (s_wsec) == 1, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_GROUP); + + tmp = nm_setting_wireless_security_get_group (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: missing group cipher", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC); + ASSERT (strcmp (tmp, expected_group) == 0, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_GROUP); + + /* Protocols */ + ASSERT (nm_setting_wireless_security_get_num_protos (s_wsec) == 1, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PROTO); + tmp = nm_setting_wireless_security_get_proto (s_wsec, 0); + ASSERT (tmp != NULL, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: missing proto", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC); + ASSERT (strcmp (tmp, expected_proto) == 0, + "wifi-wpa-psk-adhoc-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PROTO); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-wpa-psk-adhoc-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_ADHOC, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WPA_PSK_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk-hex" + +static void +test_read_wifi_wpa_psk_hex (void) +{ + NMConnection *connection; + 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; + GError *error = NULL; + const char *tmp; + const GByteArray *array; + const char *expected_id = "System blahblah (test-wifi-wpa-psk-hex)"; + const char *expected_ssid = "blahblah"; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wpa-psk-hex-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_PSK_HEX, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wpa-psk-hex-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WPA_PSK_HEX, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "wifi-wpa-psk-hex-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "wifi-wpa-psk-hex-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "wifi-wpa-psk-hex-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* SSID */ + array = nm_setting_wireless_get_ssid (s_wireless); + ASSERT (array != NULL, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (array->len == strlen (expected_ssid), + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + ASSERT (memcmp (array->data, expected_ssid, strlen (expected_ssid)) == 0, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SSID); + + /* Security */ + tmp = nm_setting_wireless_get_security (s_wireless); + ASSERT (tmp != NULL, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + ASSERT (strcmp (tmp, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) == 0, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_SEC); + + /* ===== WIRELESS SECURITY SETTING ===== */ + + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + + /* Key management */ + tmp = nm_setting_wireless_security_get_key_mgmt (s_wsec); + ASSERT (tmp != NULL, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + ASSERT (strcmp (tmp, expected_key_mgmt) == 0, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* PSK */ + tmp = nm_setting_wireless_security_get_psk (s_wsec); + ASSERT (tmp != NULL, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PSK); + ASSERT (strcmp (tmp, expected_psk) == 0, + "wifi-wpa-psk-hex-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_PSK); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-wpa-psk-hex-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_PSK_HEX, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WPA_EAP_TLS TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-eap-tls" +#define TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT TEST_IFCFG_DIR"/network-scripts/test_ca_cert.pem" +#define TEST_IFCFG_WIFI_WPA_EAP_TLS_CLIENT_CERT TEST_IFCFG_DIR"/network-scripts/test1_key_and_cert.pem" +#define TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY TEST_IFCFG_DIR"/network-scripts/test1_key_and_cert.pem" + +static void +test_read_wifi_wpa_eap_tls (void) +{ + NMConnection *connection; + NMSettingWireless *s_wireless; + NMSettingIP4Config *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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wpa-eap-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TLS, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wpa-eap-tls-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TLS, error->message); + + ASSERT (unmanaged == FALSE, + "wifi-wpa-eap-tls-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIFI_WPA_EAP_TLS); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wpa-eap-tls-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-wpa-eap-tls-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + /* ===== 802.1x SETTING ===== */ + s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); + ASSERT (s_8021x != NULL, + "wifi-wpa-eap-tls-verify-8021x", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_802_1X_SETTING_NAME); + + /* EAP methods */ + ASSERT (nm_setting_802_1x_get_num_eap_methods (s_8021x) == 1, + "wifi-wpa-eap-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + tmp = nm_setting_802_1x_get_eap_method (s_8021x, 0); + ASSERT (tmp != NULL, + "wifi-wpa-eap-tls-verify-8021x", "failed to verify %s: missing %s / %s eap method", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + ASSERT (strcmp (tmp, "tls") == 0, + "wifi-wpa-eap-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + + /* Identity */ + tmp = nm_setting_802_1x_get_identity (s_8021x); + ASSERT (tmp != NULL, + "wifi-wpa-eap-tls-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_IDENTITY); + ASSERT (strcmp (tmp, expected_identity) == 0, + "wifi-wpa-eap-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_IDENTITY); + + /* CA Cert */ + verify_cert_or_key (CK_CA_CERT, + s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, + NULL, + TEST_IFCFG_WIFI_WPA_EAP_TLS, + "wifi-wpa-eap-tls-verify-8021x", + NM_SETTING_802_1X_CA_CERT); + + /* Client Cert */ + verify_cert_or_key (CK_CLIENT_CERT, + s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CLIENT_CERT, + NULL, + TEST_IFCFG_WIFI_WPA_EAP_TLS, + "wifi-wpa-eap-tls-verify-8021x", + NM_SETTING_802_1X_CLIENT_CERT); + + /* Private Key Password */ + password = nm_setting_802_1x_get_private_key_password (s_8021x); + ASSERT (password != NULL, + "wifi-wpa-eap-tls-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD); + + ASSERT (strcmp (password, expected_privkey_password) == 0, + "wifi-wpa-eap-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WPA_EAP_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD); + + /* Private key */ + verify_cert_or_key (CK_PRIV_KEY, + s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY, + expected_privkey_password, + TEST_IFCFG_WIFI_WPA_EAP_TLS, + "wifi-wpa-eap-tls-verify-8021x", + NM_SETTING_802_1X_PRIVATE_KEY); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-eap-ttls-tls" +#define TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS_CA_CERT TEST_IFCFG_DIR"/network-scripts/test_ca_cert.pem" +/* Also use TLS defines from the previous test */ + +static void +test_read_wifi_wpa_eap_ttls_tls (void) +{ + NMConnection *connection; + NMSettingWireless *s_wireless; + NMSettingIP4Config *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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wpa-eap-ttls-tls-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wpa-eap-ttls-tls-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, error->message); + + ASSERT (unmanaged == FALSE, + "wifi-wpa-eap-ttls-tls-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wpa-eap-ttls-tls-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-wpa-eap-ttls-tls-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + /* ===== 802.1x SETTING ===== */ + s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); + ASSERT (s_8021x != NULL, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME); + + /* EAP methods */ + ASSERT (nm_setting_802_1x_get_num_eap_methods (s_8021x) == 1, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + tmp = nm_setting_802_1x_get_eap_method (s_8021x, 0); + ASSERT (tmp != NULL, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: missing %s / %s eap method", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + ASSERT (strcmp (tmp, "ttls") == 0, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + + /* CA Cert */ + verify_cert_or_key (CK_CA_CERT, + s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS_CA_CERT, + NULL, + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + "wifi-wpa-eap-ttls-tls-verify-8021x", + NM_SETTING_802_1X_CA_CERT); + + /* Inner auth method */ + tmp = nm_setting_802_1x_get_phase2_autheap (s_8021x); + ASSERT (tmp != NULL, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: missing %s / %s eap method", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE2_AUTHEAP); + ASSERT (strcmp (tmp, "tls") == 0, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE2_AUTHEAP); + + /* Inner CA Cert */ + verify_cert_or_key (CK_CA_CERT, + s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, + NULL, + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + "wifi-wpa-eap-ttls-tls-verify-8021x", + NM_SETTING_802_1X_PHASE2_CA_CERT); + + /* Inner Client Cert */ + verify_cert_or_key (CK_CLIENT_CERT, + s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CLIENT_CERT, + NULL, + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + "wifi-wpa-eap-ttls-tls-verify-8021x", + NM_SETTING_802_1X_PHASE2_CLIENT_CERT); + + /* Inner Private Key Password */ + password = nm_setting_802_1x_get_phase2_private_key_password (s_8021x); + ASSERT (password != NULL, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD); + + ASSERT (strcmp (password, expected_privkey_password) == 0, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD); + + /* Inner private key */ + verify_cert_or_key (CK_PRIV_KEY, + s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY, + expected_privkey_password, + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + "wifi-wpa-eap-ttls-tls-verify-8021x", + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY); + + /* Identity */ + tmp = nm_setting_802_1x_get_identity (s_8021x); + ASSERT (tmp != NULL, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_IDENTITY); + ASSERT (strcmp (tmp, expected_identity) == 0, + "wifi-wpa-eap-ttls-tls-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_IDENTITY); + + g_object_unref (connection); +} + +#define TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wep-eap-ttls-chap" +#define TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP_CA_CERT TEST_IFCFG_DIR"/network-scripts/test_ca_cert.pem" + +static void +test_read_wifi_wep_eap_ttls_chap (void) +{ + NMConnection *connection; + NMSettingWireless *s_wireless; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "wifi-wep-eap-ttls-chap-read", "failed to read %s: %s", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "wifi-wep-eap-ttls-chap-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, error->message); + + ASSERT (unmanaged == FALSE, + "wifi-wep-eap-ttls-chap-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP); + + /* ===== WIRELESS SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "wifi-wep-eap-ttls-chap-verify-wireless", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_WIRELESS_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "wifi-wep-eap-ttls-chap-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + /* ===== 802.1x SETTING ===== */ + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY)); + ASSERT (s_wsec != NULL, + "wifi-wep-eap-ttls-chap-verify-wireless-security", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME); + + /* Key management */ + tmp = nm_setting_wireless_security_get_key_mgmt (s_wsec); + ASSERT (tmp != NULL, + "wifi-wep-eap-ttls-chap-verify-wireless-security", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + ASSERT (strcmp (tmp, expected_key_mgmt) == 0, + "wifi-wep-eap-ttls-chap-verify-wireless-security", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WPA_PSK, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); + + /* ===== 802.1x SETTING ===== */ + s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); + ASSERT (s_8021x != NULL, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: missing %s setting", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME); + + /* EAP methods */ + ASSERT (nm_setting_802_1x_get_num_eap_methods (s_8021x) == 1, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + tmp = nm_setting_802_1x_get_eap_method (s_8021x, 0); + ASSERT (tmp != NULL, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: missing %s / %s eap method", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + ASSERT (strcmp (tmp, "ttls") == 0, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_EAP); + + /* CA Cert */ + verify_cert_or_key (CK_CA_CERT, + s_8021x, + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP_CA_CERT, + NULL, + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + "wifi-wep-eap-ttls-chap-verify-8021x", + NM_SETTING_802_1X_CA_CERT); + + /* Inner auth method */ + tmp = nm_setting_802_1x_get_phase2_auth (s_8021x); + ASSERT (tmp != NULL, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: missing %s / %s eap method", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE2_AUTH); + ASSERT (strcmp (tmp, "chap") == 0, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PHASE2_AUTH); + + /* Password */ + tmp = nm_setting_802_1x_get_identity (s_8021x); + ASSERT (tmp != NULL, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_IDENTITY); + ASSERT (strcmp (tmp, expected_identity) == 0, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_IDENTITY); + + /* Password */ + tmp = nm_setting_802_1x_get_password (s_8021x); + ASSERT (tmp != NULL, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PASSWORD); + ASSERT (strcmp (tmp, expected_password) == 0, + "wifi-wep-eap-ttls-chap-verify-8021x", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, + NM_SETTING_802_1X_SETTING_NAME, + NM_SETTING_802_1X_PASSWORD); + + g_object_unref (connection); +} + +static void +test_write_wired_static (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4, *reread_s_ip4; + NMSettingIP6Config *s_ip6, *reread_s_ip6; + static unsigned char tmpmac[] = { 0x31, 0x33, 0x33, 0x37, 0xbe, 0xcd }; + GByteArray *mac; + guint32 mtu = 1492; + char *uuid; + guint64 timestamp = 0x12344433L; + const guint32 ip1 = htonl (0x01010103); + const guint32 ip2 = htonl (0x01010105); + const guint32 gw = htonl (0x01010101); + const guint32 dns1 = htonl (0x04020201); + const guint32 dns2 = htonl (0x04020202); + 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; + struct in6_addr dns6_1, dns6_2; + const guint32 route1_prefix = 64, route2_prefix = 0; + const guint32 route1_metric = 99, route2_metric = 1; + NMIP4Address *addr; + NMIP6Address *addr6; + NMIP6Route *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); + inet_pton (AF_INET6, "fade:0102:0103::face", &dns6_1); + inet_pton (AF_INET6, "cafe:ffff:eeee:dddd:cccc:bbbb:aaaa:feed", &dns6_2); + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wired-static-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wired-static-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wired Static", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + "wired-static-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + mac = g_byte_array_sized_new (sizeof (tmpmac)); + g_byte_array_append (mac, &tmpmac[0], sizeof (tmpmac)); + + g_object_set (s_wired, + NM_SETTING_WIRED_MAC_ADDRESS, mac, + NM_SETTING_WIRED_MTU, mtu, + NULL); + g_byte_array_free (mac, TRUE); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wired-static-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, + 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_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); + + 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); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-static-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, + 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); + + /* 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); + + /* DNS servers */ + nm_setting_ip6_config_add_dns (s_ip6, &dns6_1); + nm_setting_ip6_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); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wired-static-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wired-static-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wired-static-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (reread != NULL, + "wired-static-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wired-static-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + /* FIXME: currently DNS domains from IPv6 setting are stored in 'DOMAIN' key in ifcfg-file + * However after re-reading they are dropped into IPv4 setting. + * So, in order to comparison succeeded, move DNS domains back to IPv6 setting. + */ + reread_s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (reread, NM_TYPE_SETTING_IP4_CONFIG)); + reread_s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (reread, NM_TYPE_SETTING_IP6_CONFIG)); + 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); + + 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); + + g_free (testfile); + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wired_dhcp (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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_connection_new (); + ASSERT (connection != NULL, + "wired-dhcp-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wired-dhcp-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wired DHCP", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + "wired-dhcp-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wired-dhcp-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_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, + NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wired-dhcp-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-dhcp-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, + NULL); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wired-dhcp-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wired-dhcp-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (reread != NULL, + "wired-dhcp-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wired-dhcp-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wired-dhcp-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wired_static_ip6_only (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + static unsigned char tmpmac[] = { 0x31, 0x33, 0x33, 0x37, 0xbe, 0xcd }; + GByteArray *mac; + char *uuid; + guint64 timestamp = 0x12344433L; + struct in6_addr ip6; + struct in6_addr dns6; + NMIP6Address *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); + inet_pton (AF_INET6, "fade:0102:0103::face", &dns6); + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wired-static-ip6-only-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wired-static-ip6-only-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wired Static IP6 Only", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + "wired-static-ip6-only-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + mac = g_byte_array_sized_new (sizeof (tmpmac)); + g_byte_array_append (mac, &tmpmac[0], sizeof (tmpmac)); + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, mac, NULL); + g_byte_array_free (mac, TRUE); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wired-static-ip6-only-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_DISABLED, + NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-static-ip6-only-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, + 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); + + /* DNS server */ + nm_setting_ip6_config_add_dns (s_ip6, &dns6); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wired-static-ip6-only-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wired-static-ip6-only-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wired-static-ip6-only-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (reread != NULL, + "wired-static-ip6-only-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wired-static-ip6-only-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + 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 (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); + g_object_unref (reread); +} + + +#define TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY TEST_IFCFG_DIR"/network-scripts/ifcfg-test-static-routes-legacy" + +static void +test_read_write_static_routes_legacy (void) +{ + NMConnection *connection, *reread; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + char *unmanaged = NULL; + 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, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "read-write-static-routes-legacy-read", "failed to read %s: %s", + TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "read-write-static-routes-legacy-verify", "failed to verify %s: %s", + TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "read-write-static-routes-legacy-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "read-write-static-routes-legacy-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "read_write-static-routes-legacy-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "read-write-static-routes-legacy-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "read-write-static-routes-legacy-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_READ_WRITE_STATIC_ROUTES_LEGACY, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + ASSERT (nm_setting_ip4_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); + + /* Save the ifcfg; use a special different scratch dir to ensure that + * we can clean up after the written connection in both the original + * source tree and for 'make distcheck'. + */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/tmp", + &testfile, + &error); + ASSERT (success == TRUE, + "read-write-static-routes-legacy-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "read-write-static-routes-legacy-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile2, + &routefile2, + &route6file2, + &error, + &ignore_error); + unlink (testfile); + unlink (routefile2); + unlink (route6file2); + + 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); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "read-write-static-routes-legacy-write", "written and re-read connection weren't the same."); + + g_free (testfile); + 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); +} + +static void +test_write_wired_static_routes (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + static unsigned char tmpmac[] = { 0x31, 0x33, 0x33, 0x37, 0xbe, 0xcd }; + GByteArray *mac; + guint32 mtu = 1492; + char *uuid; + guint64 timestamp = 0x12344433L; + const guint32 ip1 = htonl (0x01010103); + const guint32 ip2 = htonl (0x01010105); + const guint32 gw = htonl (0x01010101); + const guint32 dns1 = htonl (0x04020201); + const guint32 dns2 = htonl (0x04020202); + 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; + 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_connection_new (); + ASSERT (connection != NULL, + "wired-static-routes-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wired-static-routes-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wired Static Routes", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + "wired-static-routes-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + mac = g_byte_array_sized_new (sizeof (tmpmac)); + g_byte_array_append (mac, &tmpmac[0], sizeof (tmpmac)); + + g_object_set (s_wired, + NM_SETTING_WIRED_MAC_ADDRESS, mac, + NM_SETTING_WIRED_MTU, mtu, + NULL); + g_byte_array_free (mac, TRUE); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wired-static-routes-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, + 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_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); + + /* 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); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wired-static-routes-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wired-static-routes-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wired-static-routes-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_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); + unlink (routefile); + + ASSERT (nm_connection_verify (reread, &error), + "wired-static-routes-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wired-static-routes-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wired_dhcp_8021x_peap_mschapv2 (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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_connection_new (); + ASSERT (connection != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wired DHCP 802.1x PEAP MSCHAPv2", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + /* 802.1x setting */ + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "failed to allocate new %s setting", + NM_SETTING_802_1X_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_8021x)); + + g_object_set (s_8021x, + NM_SETTING_802_1X_IDENTITY, "Bob Saget", + NM_SETTING_802_1X_PASSWORD, "Kids, it was back in October 2008...", + NM_SETTING_802_1X_PHASE1_PEAPVER, "1", + NM_SETTING_802_1X_PHASE1_PEAPLABEL, "1", + NM_SETTING_802_1X_PHASE2_AUTH, "mschapv2", + NULL); + + nm_setting_802_1x_add_eap_method (s_8021x, "peap"); + + success = nm_setting_802_1x_set_ca_cert (s_8021x, + TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2_CA_CERT, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wired-dhcp-8021x-peap-mschapv2write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wired-dhcp-8021x-peap-mschapv2write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wired-dhcp-8021x-peap-mschapv2write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wired-dhcp-8021x-peap-mschapv2write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_ETHERNET, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_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); + unlink (keyfile); + + ASSERT (nm_connection_verify (reread, &error), + "wired-dhcp-8021x-peap-mschapv2write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wired-dhcp-8021x-peap-mschapv2write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_open (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 }; + GByteArray *bssid; + const unsigned char bssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 }; + guint32 channel = 9, mtu = 1345; + GByteArray *mac; + const unsigned char mac_data[] = { 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; + shvarFile *ifcfg; + char *tmp; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-open-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-open-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi Open", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-open-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + bssid = g_byte_array_sized_new (sizeof (bssid_data)); + g_byte_array_append (bssid, bssid_data, sizeof (bssid_data)); + mac = g_byte_array_sized_new (sizeof (mac_data)); + g_byte_array_append (mac, mac_data, sizeof (mac_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_BSSID, bssid, + NM_SETTING_WIRELESS_MAC_ADDRESS, mac, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_BAND, "bg", + NM_SETTING_WIRELESS_CHANNEL, channel, + NM_SETTING_WIRELESS_MTU, mtu, + NULL); + + g_byte_array_free (ssid, TRUE); + g_byte_array_free (bssid, TRUE); + g_byte_array_free (mac, TRUE); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-open-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-open-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-open-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-open-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-open-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + + /* Now make sure that the ESSID item isn't double-quoted (rh #606518) */ + ifcfg = svNewFile (testfile); + ASSERT (ifcfg != NULL, + "wifi-open-write-reread", "failed to load %s as shvarfile", testfile); + + tmp = svGetValue (ifcfg, "ESSID", TRUE); + ASSERT (tmp != NULL, + "wifi-open-write-reread", "failed to read ESSID key from %s", testfile); + + g_message (tmp); + ASSERT (strncmp (tmp, "\"\"", 2) != 0, + "wifi-open-write-reread", "unexpected ESSID double-quote in %s", testfile); + + svCloseFile (ifcfg); + + unlink (testfile); + + ASSERT (reread != NULL, + "wifi-open-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-open-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-open-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_open_hex_ssid (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd }; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-open-hex-ssid-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-open-hex-ssid-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi Open Hex SSID", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-open-hex-ssid-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NULL); + + g_byte_array_free (ssid, TRUE); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-open-hex-ssid-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-open-hex-ssid-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-open-hex-ssid-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-open-hex-ssid-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-open-hex-ssid-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (reread != NULL, + "wifi-open-hex-ssid-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-open-hex-ssid-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-open-hex-ssid-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wep (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah"; + struct stat statbuf; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wep-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wep-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WEP", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wep-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wep-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 2, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "shared", + NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, "0123456789abcdef0123456789"); + nm_setting_wireless_security_set_wep_key (s_wsec, 1, "11111111111111111111111111"); + nm_setting_wireless_security_set_wep_key (s_wsec, 2, "aaaaaaaaaaaaaaaaaaaaaaaaaa"); + nm_setting_wireless_security_set_wep_key (s_wsec, 3, "BBBBBBBBBBBBBBBBBBBBBBBBBB"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wep-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wep-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wep-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wep-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wep-write-reread", "expected keyfile for '%s'", 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, + "wifi-wep-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wep-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wep-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wep_adhoc (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah"; + struct stat statbuf; + NMIP4Address *addr; + const guint32 ip1 = htonl (0x01010103); + const guint32 gw = htonl (0x01010101); + const guint32 dns1 = htonl (0x04020201); + const guint32 prefix = 24; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wep-adhoc-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wep-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WEP AdHoc", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wep-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "adhoc", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wep-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, "0123456789abcdef0123456789"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wep-adhoc-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, 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); + + nm_setting_ip4_config_add_dns (s_ip4, dns1); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wep-adhoc-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wep-adhoc-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wep-adhoc-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wep-adhoc-write-reread", "expected keyfile for '%s'", 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, + "wifi-wep-adhoc-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wep-adhoc-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wep-adhoc-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wep_passphrase (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah"; + struct stat statbuf; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wep-passphrase-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wep-passphrase-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WEP Passphrase", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wep-passphrase-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wep-passphrase-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 0, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "shared", + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, NM_WEP_KEY_TYPE_PASSPHRASE, + NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, "asdfdjaslfjasd;flasjdfl;aksdf"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wep-passphrase-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wep-passphrase-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wep-passphrase-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wep-passphrase-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wep-passphrase-write-reread", "expected keyfile for '%s'", 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, + "wifi-wep-passphrase-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wep-passphrase-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wep-passphrase-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wep_40_ascii (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah40"; + struct stat statbuf; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WEP 40 ASCII", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 2, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "shared", + NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, "lorem"); + nm_setting_wireless_security_set_wep_key (s_wsec, 1, "ipsum"); + nm_setting_wireless_security_set_wep_key (s_wsec, 2, "dolor"); + nm_setting_wireless_security_set_wep_key (s_wsec, 3, "donec"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wep-40-ascii-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-40-ascii-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wep-40-ascii-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wep-40-ascii-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wep-40-ascii-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wep-40-ascii-write-reread", "expected keyfile for '%s'", 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, + "wifi-wep-40-ascii-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wep-40-ascii-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wep-40-ascii-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wep_104_ascii (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah104"; + struct stat statbuf; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WEP 104 ASCII", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "none", + NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 0, + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", + NULL); + nm_setting_wireless_security_set_wep_key (s_wsec, 0, "LoremIpsumSit"); + nm_setting_wireless_security_set_wep_key (s_wsec, 1, "AlfaBetaGamma"); + nm_setting_wireless_security_set_wep_key (s_wsec, 2, "WEP-104 ASCII"); + nm_setting_wireless_security_set_wep_key (s_wsec, 3, "thisismyascii"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wep-104-ascii-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wep-104-ascii-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wep-104-ascii-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wep-104-ascii-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wep-104-ascii-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wep-104-ascii-write-reread", "expected keyfile for '%s'", 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, + "wifi-wep-104-ascii-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wep-104-ascii-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wep-104-ascii-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_leap (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah"; + struct stat statbuf; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-leap-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-leap-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi LEAP", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-leap-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-leap-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "ieee8021x", + NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "leap", + NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, "Bill Smith", + NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, "foobar22", + NULL); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-leap-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-leap-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-leap-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-leap-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-leap-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-leap-write-reread", "expected keyfile for '%s'", 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, + "wifi-leap-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-leap-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-leap-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wpa_psk (const char *name, + const char *test_name, + gboolean wep_group, + gboolean wpa, + gboolean wpa2, + const char *psk) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah"; + + g_return_if_fail (psk != NULL); + + connection = nm_connection_new (); + ASSERT (connection != NULL, + test_name, "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + test_name, "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, name, + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + test_name, "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + test_name, "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", + NM_SETTING_WIRELESS_SECURITY_PSK, psk, + NULL); + + if (wep_group) { + nm_setting_wireless_security_add_group (s_wsec, "wep40"); + nm_setting_wireless_security_add_group (s_wsec, "wep104"); + } + if (wpa) { + nm_setting_wireless_security_add_proto (s_wsec, "wpa"); + nm_setting_wireless_security_add_pairwise (s_wsec, "tkip"); + nm_setting_wireless_security_add_group (s_wsec, "tkip"); + } + if (wpa2) { + nm_setting_wireless_security_add_proto (s_wsec, "rsn"); + nm_setting_wireless_security_add_pairwise (s_wsec, "ccmp"); + nm_setting_wireless_security_add_group (s_wsec, "ccmp"); + } + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + test_name, "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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + test_name, "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + test_name, "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + test_name, "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + test_name, "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + tmp = g_strdup_printf ("%s-reread", test_name); + ASSERT (keyfile != NULL, + tmp, "expected keyfile for '%s'", testfile); + unlink (keyfile); + + ASSERT (reread != NULL, + tmp, "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + tmp, "failed to verify %s: %s", testfile, error->message); + g_free (tmp); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + test_name, "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wpa_psk_adhoc (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const unsigned char ssid_data[] = "blahblah"; + NMIP4Address *addr; + const guint32 ip1 = htonl (0x01010103); + const guint32 gw = htonl (0x01010101); + const guint32 dns1 = htonl (0x04020201); + const guint32 prefix = 24; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wpa-psk-adhoc-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wpa-psk-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WPA PSK", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wpa-psk-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (sizeof (ssid_data)); + g_byte_array_append (ssid, ssid_data, sizeof (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "adhoc", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_CHANNEL, 11, + NM_SETTING_WIRELESS_BAND, "bg", + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wpa-psk-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-none", + NM_SETTING_WIRELESS_SECURITY_PSK, "7d308b11df1b4243b0f78e5f3fc68cdbb9a264ed0edf4c188edf329ff5b467f0", + NULL); + + nm_setting_wireless_security_add_proto (s_wsec, "wpa"); + nm_setting_wireless_security_add_group (s_wsec, "tkip"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wpa-psk-adhoc-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, 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); + + nm_setting_ip4_config_add_dns (s_ip4, dns1); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wpa-psk-adhoc-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wpa-psk-adhoc-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wpa-psk-adhoc-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wpa-psk-adhoc-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wpa-psk-adhoc-write-reread", "expected keyfile for '%s'", testfile); + unlink (keyfile); + + ASSERT (reread != NULL, + "wifi-wpa-psk-adhoc-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wpa-psk-adhoc-write-reread", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wpa-psk-adhoc-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wpa_eap_tls (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSetting8021x *s_8021x; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const char *ssid_data = "blahblah"; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wpa-eap-tls-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wpa-eap-tls-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WPA EAP-TLS", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wpa-eap-tls-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (strlen (ssid_data)); + g_byte_array_append (ssid, (const unsigned char *) ssid_data, strlen (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wpa-eap-tls-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-eap", NULL); + nm_setting_wireless_security_add_proto (s_wsec, "wpa"); + nm_setting_wireless_security_add_pairwise (s_wsec, "tkip"); + nm_setting_wireless_security_add_group (s_wsec, "tkip"); + + /* Wireless security setting */ + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, + "wifi-wpa-eap-tls-write", "failed to allocate new %s setting", + NM_SETTING_802_1X_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_8021x)); + + g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, "Bill Smith", NULL); + + nm_setting_802_1x_add_eap_method (s_8021x, "tls"); + + success = nm_setting_802_1x_set_ca_cert (s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-tls-write", "failed to set CA certificate '%s': %s", + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, error->message); + + success = nm_setting_802_1x_set_client_cert (s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CLIENT_CERT, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-tls-write", "failed to set client certificate '%s': %s", + TEST_IFCFG_WIFI_WPA_EAP_TLS_CLIENT_CERT, error->message); + + success = nm_setting_802_1x_set_private_key (s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY, + "test1", + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-tls-write", "failed to set private key '%s': %s", + TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY, error->message); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wpa-eap-tls-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wpa-eap-tls-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wpa-eap-tls-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-tls-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wpa-eap-tls-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + unlink (testfile); + + ASSERT (keyfile != NULL, + "wifi-wpa-eap-tls-write-reread", "expected keyfile for '%s'", testfile); + unlink (keyfile); + + ASSERT (reread != NULL, + "wifi-wpa-eap-tls-write-reread", "failed to read %s: %s", testfile, error->message); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wpa-eap-tls-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wpa-eap-tls-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wpa_eap_ttls_tls (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSetting8021x *s_8021x; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const char *ssid_data = "blahblah"; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wpa-eap-ttls-tls-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wpa-eap-ttls-tls-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WPA EAP-TTLS (TLS)", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wpa-eap-ttls-tls-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (strlen (ssid_data)); + g_byte_array_append (ssid, (const unsigned char *) ssid_data, strlen (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wpa-eap-ttls-tls-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-eap", NULL); + nm_setting_wireless_security_add_proto (s_wsec, "rsn"); + nm_setting_wireless_security_add_pairwise (s_wsec, "ccmp"); + nm_setting_wireless_security_add_group (s_wsec, "ccmp"); + + /* Wireless security setting */ + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, + "wifi-wpa-eap-ttls-tls-write", "failed to allocate new %s setting", + NM_SETTING_802_1X_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_8021x)); + + nm_setting_802_1x_add_eap_method (s_8021x, "ttls"); + + g_object_set (s_8021x, + NM_SETTING_802_1X_IDENTITY, "Bill Smith", + NM_SETTING_802_1X_ANONYMOUS_IDENTITY, "foobar22", + NM_SETTING_802_1X_PHASE2_AUTHEAP, "tls", + NULL); + + success = nm_setting_802_1x_set_ca_cert (s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-ttls-tls-write", "failed to set CA certificate '%s': %s", + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, error->message); + + /* Phase 2 TLS stuff */ + + /* phase2 CA cert */ + success = nm_setting_802_1x_set_phase2_ca_cert (s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-ttls-tls-write", "failed to set inner CA certificate '%s': %s", + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, error->message); + + /* phase2 client cert */ + success = nm_setting_802_1x_set_phase2_client_cert (s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CLIENT_CERT, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-ttls-tls-write", "failed to set inner client certificate '%s': %s", + TEST_IFCFG_WIFI_WPA_EAP_TLS_CLIENT_CERT, error->message); + + /* phase2 private key */ + success = nm_setting_802_1x_set_phase2_private_key (s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY, + "test1", + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-ttls-tls-write", "failed to set private key '%s': %s", + TEST_IFCFG_WIFI_WPA_EAP_TLS_PRIVATE_KEY, error->message); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wpa-eap-ttls-tls-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wpa-eap-ttls-tls-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wpa-eap-ttls-tls-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-ttls-tls-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wpa-eap-ttls-tls-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_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); + unlink (keyfile); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wpa-eap-ttls-tls-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wpa-eap-ttls-tls-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +static void +test_write_wifi_wpa_eap_ttls_mschapv2 (void) +{ + NMConnection *connection; + NMConnection *reread; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSetting8021x *s_8021x; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *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; + GByteArray *ssid; + const char *ssid_data = "blahblah"; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wifi WPA EAP-TTLS (MSCHAPv2)", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wifi setting */ + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + ASSERT (s_wifi != NULL, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + + ssid = g_byte_array_sized_new (strlen (ssid_data)); + g_byte_array_append (ssid, (const unsigned char *) ssid_data, strlen (ssid_data)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_MODE, "infrastructure", + NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NULL); + + g_byte_array_free (ssid, TRUE); + + /* Wireless security setting */ + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + ASSERT (s_wsec != NULL, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + + g_object_set (s_wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-eap", NULL); + nm_setting_wireless_security_add_proto (s_wsec, "wpa"); + nm_setting_wireless_security_add_proto (s_wsec, "rsn"); + nm_setting_wireless_security_add_pairwise (s_wsec, "tkip"); + nm_setting_wireless_security_add_pairwise (s_wsec, "ccmp"); + nm_setting_wireless_security_add_group (s_wsec, "tkip"); + nm_setting_wireless_security_add_group (s_wsec, "ccmp"); + + /* Wireless security setting */ + s_8021x = (NMSetting8021x *) nm_setting_802_1x_new (); + ASSERT (s_8021x != NULL, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to allocate new %s setting", + NM_SETTING_802_1X_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_8021x)); + + nm_setting_802_1x_add_eap_method (s_8021x, "ttls"); + + g_object_set (s_8021x, + NM_SETTING_802_1X_IDENTITY, "Bill Smith", + NM_SETTING_802_1X_PASSWORD, ";alkdfja;dslkfjsad;lkfjsadf", + NM_SETTING_802_1X_ANONYMOUS_IDENTITY, "foobar22", + NM_SETTING_802_1X_PHASE2_AUTHEAP, "mschapv2", + NULL); + + success = nm_setting_802_1x_set_ca_cert (s_8021x, + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, + NM_SETTING_802_1X_CK_SCHEME_PATH, + NULL, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to set CA certificate '%s': %s", + TEST_IFCFG_WIFI_WPA_EAP_TLS_CA_CERT, error->message); + + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wifi-wpa-eap-ttls-mschapv2-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_AUTO, NULL); + + /* IP6 setting */ + s_ip6 = (NMSettingIP6Config *) nm_setting_ip6_config_new (); + ASSERT (s_ip6 != NULL, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == TRUE, + "wifi-wpa-eap-ttls-mschapv2-write", "failed to write connection to disk: %s", + (error && error->message) ? error->message : "(unknown)"); + + ASSERT (testfile != NULL, + "wifi-wpa-eap-ttls-mschapv2-write", "didn't get ifcfg file path back after writing connection"); + + /* re-read the connection for comparison */ + reread = connection_from_file (testfile, + NULL, + TYPE_WIRELESS, + NULL, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_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); + unlink (keyfile); + + ASSERT (nm_connection_verify (reread, &error), + "wifi-wpa-eap-ttls-mschapv2-write-reread-verify", "failed to verify %s: %s", testfile, error->message); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "wifi-wpa-eap-ttls-mschapv2-write", "written and re-read connection weren't the same."); + + g_free (testfile); + g_object_unref (connection); + g_object_unref (reread); +} + +#define TEST_IFCFG_IBFT_DHCP TEST_IFCFG_DIR"/network-scripts/ifcfg-test-ibft-dhcp" + +static void +test_read_ibft_dhcp (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *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 GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x33, 0x21, 0x98, 0xb9, 0xf1 }; + const char *expected_id = "System test-ibft-dhcp"; + guint64 expected_timestamp = 0; + + connection = connection_from_file (TEST_IFCFG_IBFT_DHCP, + NULL, + TYPE_ETHERNET, + TEST_IFCFG_DIR "/iscsiadm-test-dhcp", + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "ibft-dhcp-read", "failed to read %s: %s", TEST_IFCFG_IBFT_DHCP, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "ibft-dhcp-verify", "failed to verify %s: %s", TEST_IFCFG_IBFT_DHCP, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "ibft-dhcp-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "ibft-dhcp-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "ibft-dhcp-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID can't be tested if the ifcfg does not contain the UUID key, because + * the UUID is generated on the full path of the ifcfg file, which can change + * depending on where the tests are run. + */ + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == expected_timestamp, + "ibft-dhcp-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "ibft-dhcp-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* Read-only */ + ASSERT (nm_setting_connection_get_read_only (s_con) == TRUE, + "ibft-dhcp-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_READ_ONLY); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "ibft-dhcp-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "ibft-dhcp-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "ibft-dhcp-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "ibft-dhcp-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + ASSERT (nm_setting_wired_get_mtu (s_wired) == 0, + "ibft-dhcp-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MTU); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "ibft-dhcp-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0, + "ibft-dhcp-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_DHCP, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + g_object_unref (connection); +} + +#define TEST_IFCFG_IBFT_STATIC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-ibft-static" + +static void +test_read_ibft_static (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *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 GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x33, 0x21, 0x98, 0xb9, 0xf0 }; + const char *expected_id = "System test-ibft-static"; + guint64 expected_timestamp = 0; + const char *expected_dns1 = "10.16.255.2"; + const char *expected_dns2 = "10.16.255.3"; + struct in_addr addr; + const char *expected_address1 = "192.168.32.72"; + const char *expected_address1_gw = "192.168.35.254"; + NMIP4Address *ip4_addr; + + connection = connection_from_file (TEST_IFCFG_IBFT_STATIC, + NULL, + TYPE_ETHERNET, + TEST_IFCFG_DIR "/iscsiadm-test-static", + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection != NULL, + "ibft-static-read", "failed to read %s: %s", TEST_IFCFG_IBFT_STATIC, error->message); + + ASSERT (nm_connection_verify (connection, &error), + "ibft-static-verify", "failed to verify %s: %s", TEST_IFCFG_IBFT_STATIC, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "ibft-static-verify-connection", "failed to verify %s: missing %s setting", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "ibft-static-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "ibft-static-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID can't be tested if the ifcfg does not contain the UUID key, because + * the UUID is generated on the full path of the ifcfg file, which can change + * depending on where the tests are run. + */ + + /* Timestamp */ + ASSERT (nm_setting_connection_get_timestamp (s_con) == expected_timestamp, + "ibft-static-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "ibft-static-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* Read-only */ + ASSERT (nm_setting_connection_get_read_only (s_con) == TRUE, + "ibft-static-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_READ_ONLY); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "ibft-static-verify-wired", "failed to verify %s: missing %s setting", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "ibft-static-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "ibft-static-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "ibft-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + ASSERT (nm_setting_wired_get_mtu (s_wired) == 0, + "ibft-static-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MTU); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "ibft-static-verify-ip4", "failed to verify %s: missing %s setting", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_config_get_method (s_ip4); + ASSERT (strcmp (tmp, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) == 0, + "ibft-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_METHOD); + + /* DNS Addresses */ + ASSERT (nm_setting_ip4_config_get_num_dns (s_ip4) == 2, + "ibft-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET, expected_dns1, &addr) > 0, + "ibft-static-verify-ip4", "failed to verify %s: couldn't convert DNS IP address #1", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 0) == addr.s_addr, + "ibft-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value #1", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + ASSERT (inet_pton (AF_INET, expected_dns2, &addr) > 0, + "ibft-static-verify-ip4", "failed to verify %s: couldn't convert DNS IP address #2", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 1) == addr.s_addr, + "ibft-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value #2", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + ASSERT (nm_setting_ip4_config_get_num_addresses (s_ip4) == 1, + "ibft-static-verify-ip4", "failed to verify %s: unexpected %s / %s key value", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + + /* Address #1 */ + ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0); + ASSERT (ip4_addr, + "ibft-static-verify-ip4", "failed to verify %s: missing IP4 address #1", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (nm_ip4_address_get_prefix (ip4_addr) == 22, + "ibft-static-verify-ip4", "failed to verify %s: unexpected IP4 address #1 prefix", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address1, &addr) > 0, + "ibft-static-verify-ip4", "failed to verify %s: couldn't convert IP address #1", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_ip4_address_get_address (ip4_addr) == addr.s_addr, + "ibft-static-verify-ip4", "failed to verify %s: unexpected IP4 address #1", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address1_gw, &addr) > 0, + "ibft-static-verify-ip4", "failed to verify %s: couldn't convert IP address #1 gateway", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + ASSERT (nm_ip4_address_get_gateway (ip4_addr) == addr.s_addr, + "ibft-static-verify-ip4", "failed to verify %s: unexpected IP4 address #1 gateway", + TEST_IFCFG_IBFT_STATIC, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + g_object_unref (connection); +} + +static void +test_read_ibft_malformed (const char *name, const char *iscsiadm_path) +{ + 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 (TEST_IFCFG_IBFT_STATIC, + NULL, + TYPE_ETHERNET, + iscsiadm_path, + &unmanaged, + &keyfile, + &routefile, + &route6file, + &error, + &ignore_error); + ASSERT (connection == NULL, + name, "unexpectedly able to read %s", TEST_IFCFG_IBFT_STATIC); +} + +static void +test_write_wired_pppoe (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingPPPOE *s_pppoe; + NMSettingPPP *s_ppp; + char *uuid; + gboolean success; + GError *error = NULL; + char *testfile = NULL; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "wired-pppoe-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "wired-pppoe-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write Wired PPPoE", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wired setting */ + s_wired = (NMSettingWired *) nm_setting_wired_new (); + ASSERT (s_wired != NULL, + "wired-pppoe-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "wired-pppoe-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_AUTO, + NULL); + + /* PPPoE setting */ + s_pppoe = (NMSettingPPPOE *) nm_setting_pppoe_new (); + ASSERT (s_pppoe != NULL, + "wired-pppoe-write", "failed to allocate new %s setting", + NM_SETTING_PPPOE_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_pppoe)); + + g_object_set (G_OBJECT (s_pppoe), + NM_SETTING_PPPOE_SERVICE, "stupid-service", + NM_SETTING_PPPOE_USERNAME, "Bill Smith", + NM_SETTING_PPPOE_PASSWORD, "test1", + NULL); + + /* PPP setting */ + s_ppp = (NMSettingPPP *) nm_setting_ppp_new (); + ASSERT (s_ppp != NULL, + "wired-pppoe-write", "failed to allocate new %s setting", + NM_SETTING_PPP_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ppp)); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "wired-pppoe-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == FALSE, + "wired-pppoe-write", "unexpected success writing connection to disk"); + + g_object_unref (connection); +} + +static void +test_write_vpn (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingIP4Config *s_ip4; + NMSettingVPN *s_vpn; + char *uuid; + gboolean success; + GError *error = NULL; + char *testfile = NULL; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "vpn-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "vpn-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Test Write VPN", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_VPN_SETTING_NAME, + NULL); + g_free (uuid); + + /* VPN setting */ + s_vpn = (NMSettingVPN *) nm_setting_vpn_new (); + ASSERT (s_vpn != NULL, + "vpn-write", "failed to allocate new %s setting", + NM_SETTING_VPN_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_vpn)); + + g_object_set (s_vpn, + NM_SETTING_VPN_SERVICE_TYPE, "awesomevpn", + NM_SETTING_VPN_USER_NAME, "Bill Smith", + NULL); + + nm_setting_vpn_add_data_item (s_vpn, "server", "vpn.somewhere.com"); + nm_setting_vpn_add_secret (s_vpn, "password", "sup3rs3cr3t"); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "vpn-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_AUTO, + NULL); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "vpn-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == FALSE, + "vpn-write", "unexpected success writing connection to disk"); + + g_object_unref (connection); +} + +static void +test_write_mobile_broadband (gboolean gsm) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingIP4Config *s_ip4; + NMSettingGsm *s_gsm; + NMSettingCdma *s_cdma; + NMSettingPPP *s_ppp; + NMSettingSerial *s_serial; + char *uuid; + gboolean success; + GError *error = NULL; + char *testfile = NULL; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "mobile-broadband-write", "failed to allocate new connection"); + + /* Connection setting */ + s_con = (NMSettingConnection *) nm_setting_connection_new (); + ASSERT (s_con != NULL, + "mobile-broadband-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, gsm ? "Test Write GSM" : "Test Write CDMA", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, + NM_SETTING_CONNECTION_TYPE, gsm ? NM_SETTING_GSM_SETTING_NAME : NM_SETTING_CDMA_SETTING_NAME, + NULL); + g_free (uuid); + + if (gsm) { + /* GSM setting */ + s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); + ASSERT (s_gsm != NULL, + "mobile-broadband-write", "failed to allocate new %s setting", + NM_SETTING_GSM_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_gsm)); + + g_object_set (s_gsm, NM_SETTING_GSM_NUMBER, "*99#", NULL); + } else { + /* CDMA setting */ + s_cdma = (NMSettingCdma *) nm_setting_cdma_new (); + ASSERT (s_cdma != NULL, + "mobile-broadband-write", "failed to allocate new %s setting", + NM_SETTING_CDMA_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_cdma)); + + g_object_set (s_cdma, NM_SETTING_CDMA_NUMBER, "#777", NULL); + } + + /* Serial setting */ + s_serial = (NMSettingSerial *) nm_setting_serial_new (); + ASSERT (s_serial != NULL, + "mobile-broadband-write", "failed to allocate new %s setting", + NM_SETTING_SERIAL_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_serial)); + + g_object_set (s_serial, + NM_SETTING_SERIAL_BAUD, 115200, + NM_SETTING_SERIAL_BITS, 8, + NM_SETTING_SERIAL_PARITY, 'n', + NM_SETTING_SERIAL_STOPBITS, 1, + NULL); + + /* IP4 setting */ + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + ASSERT (s_ip4 != NULL, + "mobile-broadband-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_AUTO, + NULL); + + /* PPP setting */ + s_ppp = (NMSettingPPP *) nm_setting_ppp_new (); + ASSERT (s_ppp != NULL, + "mobile-broadband-write", "failed to allocate new %s setting", + NM_SETTING_PPP_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_ppp)); + + ASSERT (nm_connection_verify (connection, &error) == TRUE, + "mobile-broadband-write", "failed to verify connection: %s", + (error && error->message) ? error->message : "(unknown)"); + + /* Save the ifcfg */ + success = writer_new_connection (connection, + TEST_SCRATCH_DIR "/network-scripts/", + &testfile, + &error); + ASSERT (success == FALSE, + "mobile-broadband-write", "unexpected success writing connection to disk"); + + 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" +#define TEST_IFCFG_WIFI_OPEN_SSID_LONG_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-long-hex" + + +#define TEST_IFCFG_WIRED_STATIC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static" +#define TEST_IFCFG_WIRED_STATIC_BOOTPROTO TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-static-bootproto" + +#define DEFAULT_HEX_PSK "7d308b11df1b4243b0f78e5f3fc68cdbb9a264ed0edf4c188edf329ff5b467f0" + +int main (int argc, char **argv) +{ + GError *error = NULL; + DBusGConnection *bus; + char *base; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + if (!nm_utils_init (&error)) + FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + + /* The tests */ + test_read_unmanaged (); + test_read_minimal (); + test_read_wired_static (TEST_IFCFG_WIRED_STATIC, "System test-wired-static"); + test_read_wired_static (TEST_IFCFG_WIRED_STATIC_BOOTPROTO, "System test-wired-static-bootproto"); + test_read_wired_static_no_prefix (8); + test_read_wired_static_no_prefix (16); + test_read_wired_static_no_prefix (24); + test_read_wired_dhcp (); + test_read_wired_global_gateway (); + test_read_wired_never_default (); + test_read_wired_defroute_no (); + test_read_wired_defroute_no_gatewaydev_yes (); + test_read_wired_static_routes (); + test_read_wired_static_routes_legacy (); + test_read_wired_ipv6_manual (); + test_read_wired_ipv6_only (); + test_read_onboot_no (); + test_read_wired_8021x_peap_mschapv2 (); + test_read_wifi_open (); + test_read_wifi_open_auto (); + test_read_wifi_open_ssid_hex (); + test_read_wifi_open_ssid_bad (TEST_IFCFG_WIFI_OPEN_SSID_BAD_HEX, "wifi-open-ssid-bad-hex-read"); + test_read_wifi_open_ssid_bad (TEST_IFCFG_WIFI_OPEN_SSID_LONG_HEX, "wifi-open-ssid-long-hex-read"); + test_read_wifi_open_ssid_bad (TEST_IFCFG_WIFI_OPEN_SSID_LONG_QUOTED, "wifi-open-ssid-long-quoted-read"); + test_read_wifi_open_ssid_quoted (); + test_read_wifi_wep (); + test_read_wifi_wep_adhoc (); + test_read_wifi_wep_passphrase (); + test_read_wifi_wep_40_ascii (); + test_read_wifi_wep_104_ascii (); + test_read_wifi_leap (); + test_read_wifi_wpa_psk (); + test_read_wifi_wpa_psk_unquoted (); + test_read_wifi_wpa_psk_unquoted2 (); + test_read_wifi_wpa_psk_adhoc (); + test_read_wifi_wpa_psk_hex (); + test_read_wifi_wpa_eap_tls (); + test_read_wifi_wpa_eap_ttls_tls (); + test_read_wifi_wep_eap_ttls_chap (); + + test_write_wired_static (); + test_write_wired_static_ip6_only (); + test_write_wired_static_routes (); + test_read_write_static_routes_legacy (); + test_write_wired_dhcp (); + test_write_wired_dhcp_8021x_peap_mschapv2 (); + test_write_wifi_open (); + test_write_wifi_open_hex_ssid (); + test_write_wifi_wep (); + test_write_wifi_wep_adhoc (); + test_write_wifi_wep_passphrase (); + test_write_wifi_wep_40_ascii (); + test_write_wifi_wep_104_ascii (); + test_write_wifi_leap (); + test_write_wifi_wpa_psk ("Test Write Wifi WPA PSK", + "wifi-wpa-psk-write", + FALSE, + TRUE, + FALSE, + DEFAULT_HEX_PSK); + test_write_wifi_wpa_psk ("Test Write Wifi WPA2 PSK", + "wifi-wpa2-psk-write", + FALSE, + FALSE, + TRUE, + DEFAULT_HEX_PSK); + test_write_wifi_wpa_psk ("Test Write Wifi WPA WPA2 PSK", + "wifi-wpa-wpa2-psk-write", + FALSE, + TRUE, + TRUE, + DEFAULT_HEX_PSK); + test_write_wifi_wpa_psk ("Test Write Wifi WEP WPA WPA2 PSK", + "wifi-wep-wpa-wpa2-psk-write", + TRUE, + TRUE, + TRUE, + DEFAULT_HEX_PSK); + test_write_wifi_wpa_psk ("Test Write Wifi WPA WPA2 PSK Passphrase", + "wifi-wpa-wpa2-psk-passphrase-write", + FALSE, + TRUE, + TRUE, + "really insecure passphrase04!"); + test_write_wifi_wpa_psk_adhoc (); + test_write_wifi_wpa_eap_tls (); + test_write_wifi_wpa_eap_ttls_tls (); + test_write_wifi_wpa_eap_ttls_mschapv2 (); + + /* iSCSI / ibft */ + test_read_ibft_dhcp (); + test_read_ibft_static (); + test_read_ibft_malformed ("ibft-bad-record-read", TEST_IFCFG_DIR "/iscsiadm-test-bad-record"); + test_read_ibft_malformed ("ibft-bad-entry-read", TEST_IFCFG_DIR "/iscsiadm-test-bad-entry"); + test_read_ibft_malformed ("ibft-bad-ipaddr-read", TEST_IFCFG_DIR "/iscsiadm-test-bad-ipaddr"); + test_read_ibft_malformed ("ibft-bad-gateway-read", TEST_IFCFG_DIR "/iscsiadm-test-bad-gateway"); + test_read_ibft_malformed ("ibft-bad-dns1-read", TEST_IFCFG_DIR "/iscsiadm-test-bad-dns1"); + test_read_ibft_malformed ("ibft-bad-dns2-read", TEST_IFCFG_DIR "/iscsiadm-test-bad-dns2"); + + /* Stuff we expect to fail for now */ + test_write_wired_pppoe (); + test_write_vpn (); + test_write_mobile_broadband (TRUE); + test_write_mobile_broadband (FALSE); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + return 0; +} + diff --git a/system-settings/plugins/ifcfg-rh/utils.c b/system-settings/plugins/ifcfg-rh/utils.c new file mode 100644 index 00000000..211458be --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/utils.c @@ -0,0 +1,338 @@ +/* -*- 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 2008 - 2009 Red Hat, Inc. + */ + +#include +#include +#include +#include "utils.h" +#include "shvar.h" + +/* + * utils_bin2hexstr + * + * Convert a byte-array into a hexadecimal string. + * + * Code originally by Alex Larsson and + * copyright Red Hat, Inc. under terms of the LGPL. + * + */ +char * +utils_bin2hexstr (const char *bytes, int len, int final_len) +{ + static char hex_digits[] = "0123456789abcdef"; + char *result; + int i; + gsize buflen = (len * 2) + 1; + + g_return_val_if_fail (bytes != NULL, NULL); + g_return_val_if_fail (len > 0, NULL); + g_return_val_if_fail (len < 4096, NULL); /* Arbitrary limit */ + if (final_len > -1) + g_return_val_if_fail (final_len < buflen, NULL); + + result = g_malloc0 (buflen); + for (i = 0; i < len; i++) + { + result[2*i] = hex_digits[(bytes[i] >> 4) & 0xf]; + result[2*i+1] = hex_digits[bytes[i] & 0xf]; + } + /* Cut converted key off at the correct length for this cipher type */ + if (final_len > -1) + result[final_len] = '\0'; + else + result[buflen - 1] = '\0'; + + return result; +} + +/* From hostap, Copyright (c) 2002-2005, Jouni Malinen */ + +static int hex2num (char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + return -1; +} + +static int hex2byte (const char *hex) +{ + int a, b; + a = hex2num(*hex++); + if (a < 0) + return -1; + b = hex2num(*hex++); + if (b < 0) + return -1; + return (a << 4) | b; +} + +char * +utils_hexstr2bin (const char *hex, size_t len) +{ + size_t i; + int a; + const char * ipos = hex; + char * buf = NULL; + char * opos; + + /* Length must be a multiple of 2 */ + if ((len % 2) != 0) + return NULL; + + opos = buf = g_malloc0 ((len / 2) + 1); + for (i = 0; i < len; i += 2) { + a = hex2byte (ipos); + if (a < 0) { + g_free (buf); + return NULL; + } + *opos++ = a; + ipos += 2; + } + return buf; +} + +/* End from hostap */ + +static gboolean +check_suffix (const char *base, const char *tag) +{ + int len, tag_len; + + g_return_val_if_fail (base != NULL, TRUE); + g_return_val_if_fail (tag != NULL, TRUE); + + len = strlen (base); + tag_len = strlen (tag); + if ((len > tag_len) && !strcasecmp (base + len - tag_len, tag)) + return TRUE; + return FALSE; +} + +gboolean +utils_should_ignore_file (const char *filename, gboolean only_ifcfg) +{ + char *base; + gboolean ignore = TRUE; + gboolean is_ifcfg = FALSE; + gboolean is_other = FALSE; + + g_return_val_if_fail (filename != NULL, TRUE); + + base = g_path_get_basename (filename); + g_return_val_if_fail (base != NULL, TRUE); + + /* Only handle ifcfg, keys, and routes files */ + if (!strncmp (base, IFCFG_TAG, strlen (IFCFG_TAG))) + is_ifcfg = TRUE; + + if (only_ifcfg == FALSE) { + if ( !strncmp (base, KEYS_TAG, strlen (KEYS_TAG)) + || !strncmp (base, ROUTE_TAG, strlen (ROUTE_TAG)) + || !strncmp (base, ROUTE6_TAG, strlen (ROUTE6_TAG))) + is_other = TRUE; + } + + /* But not those that have certain suffixes */ + if ( (is_ifcfg || is_other) + && !check_suffix (base, BAK_TAG) + && !check_suffix (base, TILDE_TAG) + && !check_suffix (base, ORIG_TAG) + && !check_suffix (base, REJ_TAG) + && !check_suffix (base, RPMNEW_TAG)) + ignore = FALSE; + + g_free (base); + return ignore; +} + +char * +utils_cert_path (const char *parent, const char *suffix) +{ + const char *name; + char *dir, *path; + + g_return_val_if_fail (parent != NULL, NULL); + g_return_val_if_fail (suffix != NULL, NULL); + + name = utils_get_ifcfg_name (parent, FALSE); + dir = g_path_get_dirname (parent); + path = g_strdup_printf ("%s/%s-%s", dir, name, suffix); + g_free (dir); + return path; +} + +const char * +utils_get_ifcfg_name (const char *file, gboolean only_ifcfg) +{ + const char *name = NULL, *start = NULL; + char *base; + + g_return_val_if_fail (file != NULL, NULL); + + base = g_path_get_basename (file); + if (!base) + 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); + } + + return name; +} + +/* Used to get any ifcfg/extra file path from any other ifcfg/extra path + * in the form . + */ +static char * +utils_get_extra_path (const char *parent, const char *tag) +{ + char *item_path = NULL, *dirname; + const char *name; + + g_return_val_if_fail (parent != NULL, NULL); + g_return_val_if_fail (tag != NULL, NULL); + + dirname = g_path_get_dirname (parent); + if (!dirname) + return NULL; + + name = utils_get_ifcfg_name (parent, FALSE); + if (name) { + if (!strcmp (dirname, ".")) + item_path = g_strdup_printf ("%s%s", tag, name); + else + item_path = g_strdup_printf ("%s/%s%s", dirname, tag, name); + } + g_free (dirname); + + return item_path; +} + +char * +utils_get_ifcfg_path (const char *parent) +{ + return utils_get_extra_path (parent, IFCFG_TAG); +} + +char * +utils_get_keys_path (const char *parent) +{ + return utils_get_extra_path (parent, KEYS_TAG); +} + +char * +utils_get_route_path (const char *parent) +{ + return utils_get_extra_path (parent, ROUTE_TAG); +} + +char * +utils_get_route6_path (const char *parent) +{ + return utils_get_extra_path (parent, ROUTE6_TAG); +} + +shvarFile * +utils_get_extra_ifcfg (const char *parent, const char *tag, gboolean should_create) +{ + shvarFile *ifcfg = NULL; + char *path; + + path = utils_get_extra_path (parent, tag); + if (!path) + return NULL; + + if (should_create && !g_file_test (path, G_FILE_TEST_EXISTS)) + ifcfg = svCreateFile (path); + + if (!ifcfg) + ifcfg = svNewFile (path); + + g_free (path); + return ifcfg; +} + +shvarFile * +utils_get_keys_ifcfg (const char *parent, gboolean should_create) +{ + return utils_get_extra_ifcfg (parent, KEYS_TAG, should_create); +} + +shvarFile * +utils_get_route_ifcfg (const char *parent, gboolean should_create) +{ + return utils_get_extra_ifcfg (parent, ROUTE_TAG, should_create); +} + +shvarFile * +utils_get_route6_ifcfg (const char *parent, gboolean should_create) +{ + return utils_get_extra_ifcfg (parent, ROUTE6_TAG, should_create); +} + +/* Finds out if route file has new or older format + * Returns TRUE - new syntax (ADDRESS=a.b.c.d ...), error opening file or empty + * FALSE - older syntax, i.e. argument to 'ip route add' (1.2.3.0/24 via 11.22.33.44) + */ +gboolean +utils_has_route_file_new_syntax (const char *filename) +{ + char *contents = NULL; + gsize len = 0; + gboolean ret = FALSE; + const char *pattern = "^[[:space:]]*ADDRESS[0-9]+="; + + g_return_val_if_fail (filename != NULL, TRUE); + + if (!g_file_get_contents (filename, &contents, &len, NULL)) + return TRUE; + + if (len <= 0) { + ret = TRUE; + goto gone; + } + + if (g_regex_match_simple (pattern, contents, G_REGEX_MULTILINE, 0)) + ret = TRUE; + +gone: + g_free (contents); + return ret; +} + diff --git a/system-settings/plugins/ifcfg-rh/utils.h b/system-settings/plugins/ifcfg-rh/utils.h new file mode 100644 index 00000000..d5e3a133 --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/utils.h @@ -0,0 +1,51 @@ +/* -*- 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 2008 - 2009 Red Hat, Inc. + */ + +#ifndef _UTILS_H_ +#define _UTILS_H_ + +#include +#include "shvar.h" +#include "common.h" + +char *utils_bin2hexstr (const char *bytes, int len, int final_len); + +char *utils_hexstr2bin (const char *hex, size_t len); + +char *utils_cert_path (const char *parent, const char *suffix); + +const char *utils_get_ifcfg_name (const char *file, gboolean only_ifcfg); + +gboolean utils_should_ignore_file (const char *filename, gboolean only_ifcfg); + +char *utils_get_ifcfg_path (const char *parent); +char *utils_get_keys_path (const char *parent); +char *utils_get_route_path (const char *parent); +char *utils_get_route6_path (const char *parent); + +shvarFile *utils_get_extra_ifcfg (const char *parent, const char *tag, gboolean should_create); +shvarFile *utils_get_keys_ifcfg (const char *parent, gboolean should_create); +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); + +#endif /* _UTILS_H_ */ + diff --git a/system-settings/plugins/ifcfg-rh/writer.c b/system-settings/plugins/ifcfg-rh/writer.c new file mode 100644 index 00000000..90a7549c --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/writer.c @@ -0,0 +1,1559 @@ +/* -*- 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) 2009 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "shvar.h" +#include "reader.h" +#include "writer.h" +#include "utils.h" +#include "crypto.h" + +#define PLUGIN_WARN(pname, fmt, args...) \ + { g_warning (" " pname ": " fmt, ##args); } + +static void +set_secret (shvarFile *ifcfg, const char *key, const char *value, gboolean verbatim) +{ + shvarFile *keyfile; + + keyfile = utils_get_keys_ifcfg (ifcfg->fileName, TRUE); + if (!keyfile) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: could not create key file for '%s'", + ifcfg->fileName); + goto error; + } + + /* Clear the secret from the actual ifcfg */ + svSetValue (ifcfg, key, NULL, FALSE); + + svSetValue (keyfile, key, value, verbatim); + if (svWriteFile (keyfile, 0600)) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: could not update key file '%s'", + keyfile->fileName); + svCloseFile (keyfile); + goto error; + } + svCloseFile (keyfile); + return; + +error: + /* Try setting the secret in the actual ifcfg */ + svSetValue (ifcfg, key, value, FALSE); +} + +static gboolean +write_secret_file (const char *path, + const char *data, + gsize len, + GError **error) +{ + char *tmppath; + int fd = -1, written; + gboolean success = FALSE; + + tmppath = g_malloc0 (strlen (path) + 10); + if (!tmppath) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not allocate memory for temporary file for '%s'", + path); + return FALSE; + } + + memcpy (tmppath, path, strlen (path)); + strcat (tmppath, ".XXXXXX"); + + errno = 0; + fd = mkstemp (tmppath); + if (fd < 0) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not create temporary file for '%s': %d", + path, errno); + goto out; + } + + /* Only readable by root */ + errno = 0; + if (fchmod (fd, S_IRUSR | S_IWUSR)) { + close (fd); + unlink (tmppath); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not set permissions for temporary file '%s': %d", + path, errno); + goto out; + } + + errno = 0; + written = write (fd, data, len); + if (written != len) { + close (fd); + unlink (tmppath); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not write temporary file for '%s': %d", + path, errno); + goto out; + } + close (fd); + + /* Try to rename */ + errno = 0; + if (rename (tmppath, path)) { + unlink (tmppath); + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not rename temporary file to '%s': %d", + path, errno); + goto out; + } + success = TRUE; + +out: + return success; +} + +typedef NMSetting8021xCKScheme (*SchemeFunc)(NMSetting8021x *setting); +typedef const char * (*PathFunc) (NMSetting8021x *setting); +typedef const GByteArray * (*BlobFunc) (NMSetting8021x *setting); + +typedef struct ObjectType { + const char *setting_key; + SchemeFunc scheme_func; + PathFunc path_func; + BlobFunc blob_func; + const char *ifcfg_key; + const char *suffix; +} ObjectType; + +static const ObjectType ca_type = { + NM_SETTING_802_1X_CA_CERT, + nm_setting_802_1x_get_ca_cert_scheme, + nm_setting_802_1x_get_ca_cert_path, + nm_setting_802_1x_get_ca_cert_blob, + "IEEE_8021X_CA_CERT", + "ca-cert.der" +}; + +static const ObjectType phase2_ca_type = { + NM_SETTING_802_1X_PHASE2_CA_CERT, + nm_setting_802_1x_get_phase2_ca_cert_scheme, + nm_setting_802_1x_get_phase2_ca_cert_path, + nm_setting_802_1x_get_phase2_ca_cert_blob, + "IEEE_8021X_INNER_CA_CERT", + "inner-ca-cert.der" +}; + +static const ObjectType client_type = { + NM_SETTING_802_1X_CLIENT_CERT, + nm_setting_802_1x_get_client_cert_scheme, + nm_setting_802_1x_get_client_cert_path, + nm_setting_802_1x_get_client_cert_blob, + "IEEE_8021X_CLIENT_CERT", + "client-cert.der" +}; + +static const ObjectType phase2_client_type = { + NM_SETTING_802_1X_PHASE2_CLIENT_CERT, + nm_setting_802_1x_get_phase2_client_cert_scheme, + nm_setting_802_1x_get_phase2_client_cert_path, + nm_setting_802_1x_get_phase2_client_cert_blob, + "IEEE_8021X_INNER_CLIENT_CERT", + "inner-client-cert.der" +}; + +static const ObjectType pk_type = { + NM_SETTING_802_1X_PRIVATE_KEY, + nm_setting_802_1x_get_private_key_scheme, + nm_setting_802_1x_get_private_key_path, + nm_setting_802_1x_get_private_key_blob, + "IEEE_8021X_PRIVATE_KEY", + "private-key.pem" +}; + +static const ObjectType phase2_pk_type = { + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, + nm_setting_802_1x_get_phase2_private_key_scheme, + nm_setting_802_1x_get_phase2_private_key_path, + nm_setting_802_1x_get_phase2_private_key_blob, + "IEEE_8021X_INNER_PRIVATE_KEY", + "inner-private-key.pem" +}; + +static const ObjectType p12_type = { + NM_SETTING_802_1X_PRIVATE_KEY, + nm_setting_802_1x_get_private_key_scheme, + nm_setting_802_1x_get_private_key_path, + nm_setting_802_1x_get_private_key_blob, + "IEEE_8021X_PRIVATE_KEY", + "private-key.p12" +}; + +static const ObjectType phase2_p12_type = { + NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, + nm_setting_802_1x_get_phase2_private_key_scheme, + nm_setting_802_1x_get_phase2_private_key_path, + nm_setting_802_1x_get_phase2_private_key_blob, + "IEEE_8021X_INNER_PRIVATE_KEY", + "inner-private-key.p12" +}; + +static gboolean +write_object (NMSetting8021x *s_8021x, + shvarFile *ifcfg, + const GByteArray *override_data, + const ObjectType *objtype, + GError **error) +{ + NMSetting8021xCKScheme scheme; + const char *path = NULL; + const GByteArray *blob = NULL; + + g_return_val_if_fail (ifcfg != NULL, FALSE); + g_return_val_if_fail (objtype != NULL, FALSE); + + if (override_data) { + /* if given explicit data to save, always use that instead of asking + * the setting what to do. + */ + blob = override_data; + } else { + scheme = (*(objtype->scheme_func))(s_8021x); + switch (scheme) { + case NM_SETTING_802_1X_CK_SCHEME_BLOB: + blob = (*(objtype->blob_func))(s_8021x); + break; + case NM_SETTING_802_1X_CK_SCHEME_PATH: + path = (*(objtype->path_func))(s_8021x); + break; + default: + break; + } + } + + /* If certificate/private key wasn't sent, the connection may no longer be + * 802.1x and thus we clear out the paths and certs. + */ + if (!path && !blob) { + char *standard_file; + int ignored; + + /* Since no cert/private key is now being used, delete any standard file + * that was created for this connection, but leave other files alone. + * Thus, for example, + * /etc/sysconfig/network-scripts/ca-cert-Test_Write_Wifi_WPA_EAP-TLS.der + * will be deleted, but /etc/pki/tls/cert.pem will not. + */ + standard_file = utils_cert_path (ifcfg->fileName, objtype->suffix); + if (g_file_test (standard_file, G_FILE_TEST_EXISTS)) + ignored = unlink (standard_file); + g_free (standard_file); + + svSetValue (ifcfg, objtype->ifcfg_key, NULL, FALSE); + return TRUE; + } + + /* If the object path was specified, prefer that over any raw cert data that + * may have been sent. + */ + if (path) { + svSetValue (ifcfg, objtype->ifcfg_key, path, FALSE); + return TRUE; + } + + /* If it's raw certificate data, write the cert data out to the standard file */ + if (blob) { + gboolean success; + char *new_file; + GError *write_error = NULL; + + new_file = utils_cert_path (ifcfg->fileName, objtype->suffix); + if (!new_file) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not create file path for %s / %s", + NM_SETTING_802_1X_SETTING_NAME, objtype->setting_key); + return FALSE; + } + + /* Write the raw certificate data out to the standard file so that we + * can use paths from now on instead of pushing around the certificate + * data itself. + */ + success = write_secret_file (new_file, (const char *) blob->data, blob->len, &write_error); + if (success) { + svSetValue (ifcfg, objtype->ifcfg_key, new_file, FALSE); + return TRUE; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not write certificate/key for %s / %s: %s", + NM_SETTING_802_1X_SETTING_NAME, objtype->setting_key, + (write_error && write_error->message) ? write_error->message : "(unknown)"); + g_clear_error (&write_error); + } + g_free (new_file); + } + + return FALSE; +} + +static gboolean +write_8021x_certs (NMSetting8021x *s_8021x, + gboolean phase2, + shvarFile *ifcfg, + GError **error) +{ + GByteArray *enc_key = NULL; + const char *password = NULL; + char *generated_pw = NULL; + gboolean success = FALSE, is_pkcs12 = FALSE; + const ObjectType *otype = NULL; + const GByteArray *blob = NULL; + + /* CA certificate */ + if (phase2) + otype = &phase2_ca_type; + else + otype = &ca_type; + + if (!write_object (s_8021x, ifcfg, NULL, otype, error)) + return FALSE; + + /* Private key */ + if (phase2) { + if (nm_setting_802_1x_get_phase2_private_key_scheme (s_8021x) != NM_SETTING_802_1X_CK_SCHEME_UNKNOWN) { + if (nm_setting_802_1x_get_phase2_private_key_format (s_8021x) == NM_SETTING_802_1X_CK_FORMAT_PKCS12) + is_pkcs12 = TRUE; + } + password = nm_setting_802_1x_get_phase2_private_key_password (s_8021x); + } else { + if (nm_setting_802_1x_get_private_key_scheme (s_8021x) != NM_SETTING_802_1X_CK_SCHEME_UNKNOWN) { + if (nm_setting_802_1x_get_private_key_format (s_8021x) == NM_SETTING_802_1X_CK_FORMAT_PKCS12) + is_pkcs12 = TRUE; + } + password = nm_setting_802_1x_get_private_key_password (s_8021x); + } + + if (is_pkcs12) + otype = phase2 ? &phase2_p12_type : &p12_type; + else + otype = phase2 ? &phase2_pk_type : &pk_type; + + if ((*(otype->scheme_func))(s_8021x) == NM_SETTING_802_1X_CK_SCHEME_BLOB) + blob = (*(otype->blob_func))(s_8021x); + + /* Only do the private key re-encrypt dance if we got the raw key data, which + * by definition will be unencrypted. If we're given a direct path to the + * private key file, it'll be encrypted, so we don't need to re-encrypt. + */ + if (blob && !is_pkcs12) { + /* Encrypt the unencrypted private key with the fake password */ + enc_key = nm_utils_rsa_key_encrypt (blob, password, &generated_pw, error); + if (!enc_key) + goto out; + + if (generated_pw) + password = generated_pw; + } + + /* Save the private key */ + if (!write_object (s_8021x, ifcfg, enc_key ? enc_key : blob, otype, error)) + goto out; + + /* Private key password */ + if (phase2) + set_secret (ifcfg, "IEEE_8021X_INNER_PRIVATE_KEY_PASSWORD", password, FALSE); + else + set_secret (ifcfg, "IEEE_8021X_PRIVATE_KEY_PASSWORD", password, FALSE); + + /* Client certificate */ + if (is_pkcs12) { + svSetValue (ifcfg, + phase2 ? "IEEE_8021X_INNER_CLIENT_CERT" : "IEEE_8021X_CLIENT_CERT", + NULL, FALSE); + } else { + if (phase2) + otype = &phase2_client_type; + else + otype = &client_type; + + /* Save the client certificate */ + if (!write_object (s_8021x, ifcfg, NULL, otype, error)) + goto out; + } + + success = TRUE; + +out: + if (generated_pw) { + memset (generated_pw, 0, strlen (generated_pw)); + g_free (generated_pw); + } + if (enc_key) { + memset (enc_key->data, 0, enc_key->len); + g_byte_array_free (enc_key, TRUE); + } + return success; +} + +static gboolean +write_8021x_setting (NMConnection *connection, + shvarFile *ifcfg, + gboolean wired, + GError **error) +{ + NMSetting8021x *s_8021x; + const char *value; + char *tmp = NULL; + gboolean success = FALSE; + GString *phase2_auth; + + s_8021x = (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + if (!s_8021x) { + /* If wired, clear KEY_MGMT */ + if (wired) + svSetValue (ifcfg, "KEY_MGMT", NULL, FALSE); + return TRUE; + } + + /* If wired, write KEY_MGMT */ + if (wired) + svSetValue (ifcfg, "KEY_MGMT", "IEEE8021X", FALSE); + + /* EAP method */ + if (nm_setting_802_1x_get_num_eap_methods (s_8021x)) { + value = nm_setting_802_1x_get_eap_method (s_8021x, 0); + if (value) + tmp = g_ascii_strup (value, -1); + } + svSetValue (ifcfg, "IEEE_8021X_EAP_METHODS", tmp ? tmp : NULL, FALSE); + g_free (tmp); + + svSetValue (ifcfg, "IEEE_8021X_IDENTITY", + nm_setting_802_1x_get_identity (s_8021x), + FALSE); + + svSetValue (ifcfg, "IEEE_8021X_ANON_IDENTITY", + nm_setting_802_1x_get_anonymous_identity (s_8021x), + FALSE); + + set_secret (ifcfg, "IEEE_8021X_PASSWORD", nm_setting_802_1x_get_password (s_8021x), FALSE); + + /* PEAP version */ + value = nm_setting_802_1x_get_phase1_peapver (s_8021x); + svSetValue (ifcfg, "IEEE_8021X_PEAP_VERSION", NULL, FALSE); + if (value && (!strcmp (value, "0") || !strcmp (value, "1"))) + svSetValue (ifcfg, "IEEE_8021X_PEAP_VERSION", value, FALSE); + + /* Force new PEAP label */ + value = nm_setting_802_1x_get_phase1_peaplabel (s_8021x); + svSetValue (ifcfg, "IEEE_8021X_PEAP_FORCE_NEW_LABEL", NULL, FALSE); + if (value && !strcmp (value, "1")) + svSetValue (ifcfg, "IEEE_8021X_PEAP_FORCE_NEW_LABEL", "yes", FALSE); + + /* Phase2 auth methods */ + svSetValue (ifcfg, "IEEE_8021X_INNER_AUTH_METHODS", NULL, FALSE); + phase2_auth = g_string_new (NULL); + + value = nm_setting_802_1x_get_phase2_auth (s_8021x); + if (value) { + tmp = g_ascii_strup (value, -1); + g_string_append (phase2_auth, tmp); + g_free (tmp); + } + + value = nm_setting_802_1x_get_phase2_autheap (s_8021x); + if (value) { + if (phase2_auth->len) + g_string_append_c (phase2_auth, ' '); + + tmp = g_ascii_strup (value, -1); + g_string_append_printf (phase2_auth, "EAP-%s", tmp); + g_free (tmp); + } + + svSetValue (ifcfg, "IEEE_8021X_INNER_AUTH_METHODS", + phase2_auth->len ? phase2_auth->str : NULL, + FALSE); + + g_string_free (phase2_auth, TRUE); + + success = write_8021x_certs (s_8021x, FALSE, ifcfg, error); + if (success) { + /* phase2/inner certs */ + success = write_8021x_certs (s_8021x, TRUE, ifcfg, error); + } + + return success; +} + +static gboolean +write_wireless_security_setting (NMConnection *connection, + shvarFile *ifcfg, + gboolean adhoc, + gboolean *no_8021x, + GError **error) +{ + NMSettingWirelessSecurity *s_wsec; + const char *key_mgmt, *auth_alg, *key, *proto, *cipher, *psk; + gboolean wep = FALSE, wpa = FALSE; + char *tmp; + guint32 i, num; + GString *str; + + s_wsec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); + if (!s_wsec) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing '%s' setting", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); + return FALSE; + } + + key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec); + g_assert (key_mgmt); + + auth_alg = nm_setting_wireless_security_get_auth_alg (s_wsec); + + svSetValue (ifcfg, "DEFAULTKEY", NULL, FALSE); + + if (!strcmp (key_mgmt, "none")) { + wep = TRUE; + *no_8021x = TRUE; + } else if (!strcmp (key_mgmt, "wpa-none") || !strcmp (key_mgmt, "wpa-psk")) { + svSetValue (ifcfg, "KEY_MGMT", "WPA-PSK", FALSE); + wpa = TRUE; + *no_8021x = TRUE; + } else if (!strcmp (key_mgmt, "ieee8021x")) { + svSetValue (ifcfg, "KEY_MGMT", "IEEE8021X", FALSE); + } else if (!strcmp (key_mgmt, "wpa-eap")) { + svSetValue (ifcfg, "KEY_MGMT", "WPA-EAP", FALSE); + wpa = TRUE; + } + + svSetValue (ifcfg, "SECURITYMODE", NULL, FALSE); + if (auth_alg) { + if (!strcmp (auth_alg, "shared")) + svSetValue (ifcfg, "SECURITYMODE", "restricted", FALSE); + else if (!strcmp (auth_alg, "open")) + svSetValue (ifcfg, "SECURITYMODE", "open", FALSE); + else if (!strcmp (auth_alg, "leap")) { + svSetValue (ifcfg, "SECURITYMODE", "leap", FALSE); + svSetValue (ifcfg, "IEEE_8021X_IDENTITY", + nm_setting_wireless_security_get_leap_username (s_wsec), + FALSE); + set_secret (ifcfg, "IEEE_8021X_PASSWORD", + nm_setting_wireless_security_get_leap_password (s_wsec), + FALSE); + *no_8021x = TRUE; + } + } + + /* WEP keys */ + + /* Clear existing keys */ + set_secret (ifcfg, "KEY", NULL, FALSE); /* Clear any default key */ + for (i = 0; i < 4; i++) { + tmp = g_strdup_printf ("KEY_PASSPHRASE%d", i + 1); + set_secret (ifcfg, tmp, NULL, FALSE); + g_free (tmp); + + tmp = g_strdup_printf ("KEY%d", i + 1); + set_secret (ifcfg, tmp, NULL, FALSE); + g_free (tmp); + } + + /* And write the new ones out */ + if (wep) { + /* Default WEP TX key index */ + tmp = g_strdup_printf ("%d", nm_setting_wireless_security_get_wep_tx_keyidx (s_wsec) + 1); + svSetValue (ifcfg, "DEFAULTKEY", tmp, FALSE); + g_free (tmp); + + for (i = 0; i < 4; i++) { + NMWepKeyType key_type; + + key = nm_setting_wireless_security_get_wep_key (s_wsec, i); + if (key) { + char *ascii_key = NULL; + + /* Passphrase needs a different ifcfg key since with WEP, there + * are some passphrases that are indistinguishable from WEP hex + * keys. + */ + key_type = nm_setting_wireless_security_get_wep_key_type (s_wsec); + if (key_type == NM_WEP_KEY_TYPE_PASSPHRASE) + tmp = g_strdup_printf ("KEY_PASSPHRASE%d", i + 1); + else { + tmp = g_strdup_printf ("KEY%d", i + 1); + + /* Add 's:' prefix for ASCII keys */ + if (strlen (key) == 5 || strlen (key) == 13) { + ascii_key = g_strdup_printf ("s:%s", key); + key = ascii_key; + } + } + + set_secret (ifcfg, tmp, key, FALSE); + g_free (tmp); + g_free (ascii_key); + } + } + } + + /* WPA protos */ + svSetValue (ifcfg, "WPA_ALLOW_WPA", NULL, FALSE); + svSetValue (ifcfg, "WPA_ALLOW_WPA2", NULL, FALSE); + num = nm_setting_wireless_security_get_num_protos (s_wsec); + for (i = 0; i < num; i++) { + proto = nm_setting_wireless_security_get_proto (s_wsec, i); + if (proto && !strcmp (proto, "wpa")) + svSetValue (ifcfg, "WPA_ALLOW_WPA", "yes", FALSE); + else if (proto && !strcmp (proto, "rsn")) + svSetValue (ifcfg, "WPA_ALLOW_WPA2", "yes", FALSE); + } + + /* WPA Pairwise ciphers */ + svSetValue (ifcfg, "CIPHER_PAIRWISE", NULL, FALSE); + str = g_string_new (NULL); + num = nm_setting_wireless_security_get_num_pairwise (s_wsec); + for (i = 0; i < num; i++) { + if (i > 0) + g_string_append_c (str, ' '); + cipher = nm_setting_wireless_security_get_pairwise (s_wsec, i); + tmp = g_ascii_strup (cipher, -1); + g_string_append (str, tmp); + g_free (tmp); + } + if (strlen (str->str)) + svSetValue (ifcfg, "CIPHER_PAIRWISE", str->str, FALSE); + g_string_free (str, TRUE); + + /* WPA Group ciphers */ + svSetValue (ifcfg, "CIPHER_GROUP", NULL, FALSE); + str = g_string_new (NULL); + num = nm_setting_wireless_security_get_num_groups (s_wsec); + for (i = 0; i < num; i++) { + if (i > 0) + g_string_append_c (str, ' '); + cipher = nm_setting_wireless_security_get_group (s_wsec, i); + tmp = g_ascii_strup (cipher, -1); + g_string_append (str, tmp); + g_free (tmp); + } + if (strlen (str->str)) + svSetValue (ifcfg, "CIPHER_GROUP", str->str, FALSE); + g_string_free (str, TRUE); + + /* WPA Passphrase */ + if (wpa) { + GString *quoted = NULL; + + psk = nm_setting_wireless_security_get_psk (s_wsec); + if (psk && (strlen (psk) != 64)) { + /* Quote the PSK since it's a passphrase */ + quoted = g_string_sized_new (strlen (psk) + 2); /* 2 for quotes */ + g_string_append_c (quoted, '"'); + g_string_append (quoted, psk); + g_string_append_c (quoted, '"'); + } + set_secret (ifcfg, "WPA_PSK", quoted ? quoted->str : psk, TRUE); + if (quoted) + g_string_free (quoted, TRUE); + } else + set_secret (ifcfg, "WPA_PSK", NULL, FALSE); + + return TRUE; +} + +static gboolean +write_wireless_setting (NMConnection *connection, + shvarFile *ifcfg, + gboolean *no_8021x, + GError **error) +{ + NMSettingWireless *s_wireless; + char *tmp, *tmp2; + const GByteArray *ssid, *mac, *bssid; + const char *mode; + char buf[33]; + guint32 mtu, chan, i; + gboolean adhoc = FALSE, hex_ssid = FALSE; + + s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); + if (!s_wireless) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing '%s' setting", NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + + svSetValue (ifcfg, "HWADDR", NULL, FALSE); + mac = nm_setting_wireless_get_mac_address (s_wireless); + if (mac) { + tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + mac->data[0], mac->data[1], mac->data[2], + mac->data[3], mac->data[4], mac->data[5]); + svSetValue (ifcfg, "HWADDR", tmp, FALSE); + g_free (tmp); + } + + svSetValue (ifcfg, "MTU", NULL, FALSE); + mtu = nm_setting_wireless_get_mtu (s_wireless); + if (mtu) { + tmp = g_strdup_printf ("%u", mtu); + svSetValue (ifcfg, "MTU", tmp, FALSE); + g_free (tmp); + } + + ssid = nm_setting_wireless_get_ssid (s_wireless); + if (!ssid) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing SSID in '%s' setting", NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + if (!ssid->len || ssid->len > 32) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid SSID in '%s' setting", NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + + /* If the SSID contains any non-printable characters, we need to use the + * hex notation of the SSID instead. + */ + for (i = 0; i < ssid->len; i++) { + if (!isprint (ssid->data[i])) { + hex_ssid = TRUE; + break; + } + } + + if (hex_ssid) { + GString *str; + + /* Hex SSIDs don't get quoted */ + str = g_string_sized_new (ssid->len * 2 + 3); + g_string_append (str, "0x"); + for (i = 0; i < ssid->len; i++) + g_string_append_printf (str, "%02X", ssid->data[i]); + svSetValue (ifcfg, "ESSID", str->str, TRUE); + g_string_free (str, TRUE); + } else { + /* Printable SSIDs always get quoted */ + memset (buf, 0, sizeof (buf)); + memcpy (buf, ssid->data, ssid->len); + tmp = svEscape (buf); + + /* svEscape will usually quote the string, but just for consistency, + * if svEscape doesn't quote the ESSID, we quote it ourselves. + */ + if (tmp[0] != '"' && tmp[strlen (tmp) - 1] != '"') { + tmp2 = g_strdup_printf ("\"%s\"", tmp); + svSetValue (ifcfg, "ESSID", tmp2, TRUE); + g_free (tmp2); + } else + svSetValue (ifcfg, "ESSID", tmp, TRUE); + g_free (tmp); + } + + mode = nm_setting_wireless_get_mode (s_wireless); + if (!mode || !strcmp (mode, "infrastructure")) { + svSetValue (ifcfg, "MODE", "Managed", FALSE); + } else if (!strcmp (mode, "adhoc")) { + svSetValue (ifcfg, "MODE", "Ad-Hoc", FALSE); + adhoc = TRUE; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Invalid mode '%s' in '%s' setting", + mode, NM_SETTING_WIRELESS_SETTING_NAME); + return FALSE; + } + + svSetValue (ifcfg, "CHANNEL", NULL, FALSE); + chan = nm_setting_wireless_get_channel (s_wireless); + if (chan) { + tmp = g_strdup_printf ("%u", chan); + svSetValue (ifcfg, "CHANNEL", tmp, FALSE); + g_free (tmp); + } + + svSetValue (ifcfg, "BSSID", NULL, FALSE); + bssid = nm_setting_wireless_get_bssid (s_wireless); + if (bssid) { + tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + bssid->data[0], bssid->data[1], bssid->data[2], + bssid->data[3], bssid->data[4], bssid->data[5]); + svSetValue (ifcfg, "BSSID", tmp, FALSE); + g_free (tmp); + } + + if (nm_setting_wireless_get_security (s_wireless)) { + if (!write_wireless_security_setting (connection, ifcfg, adhoc, no_8021x, error)) + return FALSE; + } + + svSetValue (ifcfg, "TYPE", TYPE_WIRELESS, FALSE); + + return TRUE; +} + +static gboolean +write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) +{ + NMSettingWired *s_wired; + const GByteArray *mac; + char *tmp; + guint32 mtu; + + s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); + if (!s_wired) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing '%s' setting", NM_SETTING_WIRED_SETTING_NAME); + return FALSE; + } + + mac = nm_setting_wired_get_mac_address (s_wired); + if (mac) { + tmp = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", + mac->data[0], mac->data[1], mac->data[2], + mac->data[3], mac->data[4], mac->data[5]); + svSetValue (ifcfg, "HWADDR", tmp, FALSE); + g_free (tmp); + } + + svSetValue (ifcfg, "MTU", NULL, FALSE); + mtu = nm_setting_wired_get_mtu (s_wired); + if (mtu) { + tmp = g_strdup_printf ("%u", mtu); + svSetValue (ifcfg, "MTU", tmp, FALSE); + g_free (tmp); + } + + svSetValue (ifcfg, "TYPE", TYPE_ETHERNET, FALSE); + + return TRUE; +} + +static void +write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg) +{ + char *tmp; + + svSetValue (ifcfg, "NAME", nm_setting_connection_get_id (s_con), FALSE); + svSetValue (ifcfg, "UUID", nm_setting_connection_get_uuid (s_con), FALSE); + svSetValue (ifcfg, "ONBOOT", + nm_setting_connection_get_autoconnect (s_con) ? "yes" : "no", + FALSE); + + svSetValue (ifcfg, "LAST_CONNECT", NULL, FALSE); + if (nm_setting_connection_get_timestamp (s_con)) { + tmp = g_strdup_printf ("%" G_GUINT64_FORMAT, nm_setting_connection_get_timestamp (s_con)); + svSetValue (ifcfg, "LAST_CONNECT", tmp, FALSE); + g_free (tmp); + } +} + +static gboolean +write_route_file_legacy (const char *filename, NMSettingIP4Config *s_ip4, GError **error) +{ + char dest[INET_ADDRSTRLEN]; + char next_hop[INET_ADDRSTRLEN]; + char **route_items; + char *route_contents; + NMIP4Route *route; + guint32 ip, prefix, metric; + guint32 i, num; + gboolean success = FALSE; + + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (s_ip4 != NULL, FALSE); + 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); + if (num == 0) { + unlink (filename); + return TRUE; + } + + 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); + + 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)); + + 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); + } + route_items[num] = NULL; + route_contents = g_strjoinv (NULL, route_items); + g_strfreev (route_items); + + if (!g_file_set_contents (filename, route_contents, -1, NULL)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Writing route file '%s' failed", filename); + goto error; + } + + success = TRUE; + +error: + g_free (route_contents); + + return success; +} + +static gboolean +write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) +{ + NMSettingIP4Config *s_ip4; + const char *value; + char *addr_key, *prefix_key, *netmask_key, *gw_key, *metric_key, *tmp; + char *route_path = NULL; + guint32 i, num; + GString *searches; + gboolean success = FALSE; + const char *method = NULL; + + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip4) + method = nm_setting_ip4_config_get_method (s_ip4); + + /* Missing IP4 setting is assumed to be DHCP */ + if (!method) + method = NM_SETTING_IP4_CONFIG_METHOD_AUTO; + + if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) { + int result; + + /* IPv4 disabled, clear IPv4 related parameters */ + svSetValue (ifcfg, "BOOTPROTO", NULL, FALSE); + for (i = 0; i < 254; i++) { + if (i == 0) { + addr_key = g_strdup ("IPADDR"); + prefix_key = g_strdup ("PREFIX"); + gw_key = g_strdup ("GATEWAY"); + } else { + addr_key = g_strdup_printf ("IPADDR%d", i + 1); + prefix_key = g_strdup_printf ("PREFIX%d", i + 1); + gw_key = g_strdup_printf ("GATEWAY%d", i + 1); + } + + svSetValue (ifcfg, addr_key, NULL, FALSE); + svSetValue (ifcfg, prefix_key, NULL, FALSE); + svSetValue (ifcfg, gw_key, NULL, FALSE); + } + + route_path = utils_get_route_path (ifcfg->fileName); + result = unlink (route_path); + g_free (route_path); + return TRUE; + } + + value = nm_setting_ip4_config_get_method (s_ip4); + g_assert (value); + if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) + svSetValue (ifcfg, "BOOTPROTO", "dhcp", FALSE); + else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) + svSetValue (ifcfg, "BOOTPROTO", "none", FALSE); + else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) + svSetValue (ifcfg, "BOOTPROTO", "autoip", FALSE); + else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) + svSetValue (ifcfg, "BOOTPROTO", "shared", FALSE); + + num = nm_setting_ip4_config_get_num_addresses (s_ip4); + for (i = 0; i < 254; i++) { + char buf[INET_ADDRSTRLEN + 1]; + NMIP4Address *addr; + guint32 ip; + + if (i == 0) { + addr_key = g_strdup ("IPADDR"); + prefix_key = g_strdup ("PREFIX"); + gw_key = g_strdup ("GATEWAY"); + } else { + addr_key = g_strdup_printf ("IPADDR%d", i + 1); + prefix_key = g_strdup_printf ("PREFIX%d", i + 1); + gw_key = g_strdup_printf ("GATEWAY%d", i + 1); + } + + if (i >= num) { + svSetValue (ifcfg, addr_key, NULL, FALSE); + svSetValue (ifcfg, prefix_key, NULL, FALSE); + svSetValue (ifcfg, gw_key, NULL, FALSE); + } else { + 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, addr_key, &buf[0], FALSE); + + tmp = g_strdup_printf ("%u", nm_ip4_address_get_prefix (addr)); + svSetValue (ifcfg, prefix_key, 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, gw_key, &buf[0], FALSE); + } else + svSetValue (ifcfg, gw_key, NULL, FALSE); + } + + g_free (addr_key); + g_free (prefix_key); + g_free (gw_key); + } + + num = nm_setting_ip4_config_get_num_dns (s_ip4); + for (i = 0; i < 254; i++) { + char buf[INET_ADDRSTRLEN + 1]; + guint32 ip; + + addr_key = g_strdup_printf ("DNS%d", i + 1); + + if (i >= num) + svSetValue (ifcfg, addr_key, NULL, FALSE); + else { + ip = nm_setting_ip4_config_get_dns (s_ip4, i); + + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET, (const void *) &ip, &buf[0], sizeof (buf)); + svSetValue (ifcfg, addr_key, &buf[0], FALSE); + } + g_free (addr_key); + } + + num = nm_setting_ip4_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)); + } + svSetValue (ifcfg, "DOMAIN", searches->str, FALSE); + g_string_free (searches, TRUE); + } else + svSetValue (ifcfg, "DOMAIN", NULL, FALSE); + + /* 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", + FALSE); + + svSetValue (ifcfg, "PEERDNS", NULL, FALSE); + svSetValue (ifcfg, "PEERROUTES", NULL, FALSE); + svSetValue (ifcfg, "DHCP_HOSTNAME", NULL, FALSE); + svSetValue (ifcfg, "DHCP_CLIENT_ID", NULL, FALSE); + if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) { + svSetValue (ifcfg, "PEERDNS", + nm_setting_ip4_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", + FALSE); + + value = nm_setting_ip4_config_get_dhcp_hostname (s_ip4); + if (value) + svSetValue (ifcfg, "DHCP_HOSTNAME", value, FALSE); + + value = nm_setting_ip4_config_get_dhcp_client_id (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", + FALSE); + + /* Static routes - route- file */ + route_path = utils_get_route_path (ifcfg->fileName); + if (!route_path) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not get route file path for '%s'", ifcfg->fileName); + goto out; + } + + if (utils_has_route_file_new_syntax (route_path)) { + shvarFile *routefile; + + g_free (route_path); + routefile = utils_get_route_ifcfg (ifcfg->fileName, TRUE); + if (!routefile) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not create route file '%s'", routefile->fileName); + goto out; + } + + num = nm_setting_ip4_config_get_num_routes (s_ip4); + for (i = 0; i < 256; i++) { + char buf[INET_ADDRSTRLEN]; + NMIP4Route *route; + guint32 ip, metric; + + addr_key = g_strdup_printf ("ADDRESS%d", i); + netmask_key = g_strdup_printf ("NETMASK%d", i); + gw_key = g_strdup_printf ("GATEWAY%d", i); + metric_key = g_strdup_printf ("METRIC%d", i); + + if (i >= num) { + svSetValue (routefile, addr_key, NULL, FALSE); + svSetValue (routefile, netmask_key, NULL, FALSE); + svSetValue (routefile, gw_key, NULL, FALSE); + svSetValue (routefile, metric_key, NULL, FALSE); + } else { + 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)); + svSetValue (routefile, addr_key, &buf[0], 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)); + 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); + + memset (buf, 0, sizeof (buf)); + metric = nm_ip4_route_get_metric (route); + if (metric == 0) + svSetValue (routefile, metric_key, NULL, FALSE); + else { + tmp = g_strdup_printf ("%u", metric); + svSetValue (routefile, metric_key, tmp, FALSE); + g_free (tmp); + } + } + + g_free (addr_key); + g_free (netmask_key); + g_free (gw_key); + g_free (metric_key); + } + if (svWriteFile (routefile, 0644)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not update route file '%s'", routefile->fileName); + svCloseFile (routefile); + goto out; + } + svCloseFile (routefile); + } else { + write_route_file_legacy (route_path, s_ip4, error); + g_free (route_path); + if (error && *error) + goto out; + } + + success = TRUE; + +out: + return success; +} + +static gboolean +write_route6_file (const char *filename, NMSettingIP6Config *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; + guint32 i, num; + gboolean success = FALSE; + + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (s_ip6 != NULL, FALSE); + 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); + if (num == 0) { + unlink (filename); + return TRUE; + } + + 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)); + + 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); + } + route_items[num] = NULL; + route_contents = g_strjoinv (NULL, route_items); + g_strfreev (route_items); + + if (!g_file_set_contents (filename, route_contents, -1, NULL)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Writing route6 file '%s' failed", filename); + goto error; + } + + success = TRUE; + +error: + g_free (route_contents); + return success; +} + +static gboolean +write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) +{ + NMSettingIP6Config *s_ip6; + NMSettingIP4Config *s_ip4; + const char *value; + char *addr_key, *prefix; + guint32 i, num, num4; + GString *searches; + char buf[INET6_ADDRSTRLEN]; + NMIP6Address *addr; + const struct in6_addr *ip; + GString *ip_str1, *ip_str2, *ip_ptr; + char *route6_path; + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (!s_ip6) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing '%s' setting", NM_SETTING_IP6_CONFIG_SETTING_NAME); + return FALSE; + } + + value = nm_setting_ip6_config_get_method (s_ip6); + g_assert (value); + if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) { + svSetValue (ifcfg, "IPV6INIT", "no", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); + return TRUE; + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); + } else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) { + svSetValue (ifcfg, "IPV6INIT", "yes", FALSE); + svSetValue (ifcfg, "DHCPV6C", NULL, FALSE); + /* TODO */ + } + + if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) { + /* Write out IP addresses */ + num = nm_setting_ip6_config_get_num_addresses (s_ip6); + + ip_str1 = g_string_new (NULL); + ip_str2 = g_string_new (NULL); + 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)); + 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); + } + + svSetValue (ifcfg, "IPV6ADDR", ip_str1->str, FALSE); + svSetValue (ifcfg, "IPV6ADDR_SECONDARIES", ip_str2->str, FALSE); + g_string_free (ip_str1, TRUE); + g_string_free (ip_str2, TRUE); + } else { + svSetValue (ifcfg, "IPV6ADDR", NULL, FALSE); + svSetValue (ifcfg, "IPV6ADDR_SECONDARIES", NULL, FALSE); + } + + /* Write out DNS - 'DNS' key is used both for IPv4 and IPv6 */ + s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); + 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); + 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 { + ip = nm_setting_ip6_config_get_dns (s_ip6, i); + + memset (buf, 0, sizeof (buf)); + inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf)); + svSetValue (ifcfg, addr_key, buf, 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); + if (num > 0) { + char *ip4_domains; + ip4_domains = svGetValue (ifcfg, "DOMAIN", FALSE); + searches = g_string_new (ip4_domains); + 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)); + } + svSetValue (ifcfg, "DOMAIN", searches->str, FALSE); + g_string_free (searches, TRUE); + g_free (ip4_domains); + } + + /* handle IPV6_DEFROUTE */ + /* IPV6_DEFROUTE has the opposite meaning from 'never-default' */ + if (nm_setting_ip6_config_get_never_default(s_ip6)) + svSetValue (ifcfg, "IPV6_DEFROUTE", "no", FALSE); + else + svSetValue (ifcfg, "IPV6_DEFROUTE", "yes", FALSE); + + svSetValue (ifcfg, "IPV6_PEERDNS", NULL, FALSE); + 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", + FALSE); + + svSetValue (ifcfg, "IPV6_PEERROUTES", + nm_setting_ip6_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", + FALSE); + + /* Static routes go to route6- file */ + route6_path = utils_get_route6_path (ifcfg->fileName); + if (!route6_path) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Could not get route6 file path for '%s'", ifcfg->fileName); + goto error; + } + write_route6_file (route6_path, s_ip6, error); + g_free (route6_path); + if (error && *error) + goto error; + + return TRUE; + +error: + return FALSE; +} + +static char * +escape_id (const char *id) +{ + char *escaped = g_strdup (id); + char *p = escaped; + + /* Escape random stuff */ + while (*p) { + if (*p == ' ') + *p = '_'; + else if (*p == '/') + *p = '-'; + else if (*p == '\\') + *p = '-'; + p++; + } + + return escaped; +} + +static gboolean +write_connection (NMConnection *connection, + const char *ifcfg_dir, + const char *filename, + const char *keyfile, + char **out_filename, + GError **error) +{ + NMSettingConnection *s_con; + NMSettingIP6Config *s_ip6; + gboolean success = FALSE; + shvarFile *ifcfg = NULL; + char *ifcfg_name = NULL; + const char *type; + gboolean no_8021x = FALSE; + gboolean wired = FALSE; + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + if (!s_con) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing '%s' setting", NM_SETTING_CONNECTION_SETTING_NAME); + return FALSE; + } + + if (filename) { + /* For existing connections, 'filename' should be full path to ifcfg file */ + ifcfg = svNewFile (filename); + ifcfg_name = g_strdup (filename); + } else { + char *escaped; + + escaped = escape_id (nm_setting_connection_get_id (s_con)); + ifcfg_name = g_strdup_printf ("%s/ifcfg-%s", ifcfg_dir, escaped); + ifcfg = svCreateFile (ifcfg_name); + g_free (escaped); + } + + if (!ifcfg) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Failed to open/create ifcfg file '%s'", ifcfg_name); + goto out; + } + + type = nm_setting_connection_get_connection_type (s_con); + if (!type) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Missing connection type!"); + goto out; + } + + if (!strcmp (type, NM_SETTING_WIRED_SETTING_NAME)) { + // FIXME: can't write PPPoE at this time + if (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Can't write connection type '%s'", + NM_SETTING_PPPOE_SETTING_NAME); + goto out; + } + + if (!write_wired_setting (connection, ifcfg, error)) + goto out; + wired = TRUE; + } else if (!strcmp (type, NM_SETTING_WIRELESS_SETTING_NAME)) { + if (!write_wireless_setting (connection, ifcfg, &no_8021x, error)) + goto out; + } else { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Can't write connection type '%s'", type); + goto out; + } + + if (!no_8021x) { + if (!write_8021x_setting (connection, ifcfg, wired, error)) + goto out; + } + + if (!write_ip4_setting (connection, ifcfg, error)) + goto out; + + s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); + if (s_ip6) { + if (!write_ip6_setting (connection, ifcfg, error)) + goto out; + } + + write_connection_setting (s_con, ifcfg); + + if (svWriteFile (ifcfg, 0644)) { + g_set_error (error, ifcfg_plugin_error_quark (), 0, + "Can't write connection '%s'", ifcfg->fileName); + goto out; + } + + /* Only return the filename if this was a newly written ifcfg */ + if (out_filename && !filename) + *out_filename = g_strdup (ifcfg_name); + + success = TRUE; + +out: + if (ifcfg) + svCloseFile (ifcfg); + g_free (ifcfg_name); + return success; +} + +gboolean +writer_new_connection (NMConnection *connection, + const char *ifcfg_dir, + char **out_filename, + GError **error) +{ + return write_connection (connection, ifcfg_dir, NULL, NULL, out_filename, error); +} + +gboolean +writer_update_connection (NMConnection *connection, + const char *ifcfg_dir, + const char *filename, + const char *keyfile, + GError **error) +{ + return write_connection (connection, ifcfg_dir, filename, keyfile, NULL, error); +} + diff --git a/system-settings/plugins/ifcfg-rh/writer.h b/system-settings/plugins/ifcfg-rh/writer.h new file mode 100644 index 00000000..edeac0cc --- /dev/null +++ b/system-settings/plugins/ifcfg-rh/writer.h @@ -0,0 +1,39 @@ +/* -*- 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) 2009 Red Hat, Inc. + */ + +#ifndef _WRITER_H_ +#define _WRITER_H_ + +#include +#include +#include + +gboolean writer_new_connection (NMConnection *connection, + const char *ifcfg_dir, + char **out_filename, + GError **error); + +gboolean writer_update_connection (NMConnection *connection, + const char *ifcfg_dir, + const char *filename, + const char *keyfile, + GError **error); + +#endif /* _WRITER_H_ */ diff --git a/system-settings/plugins/ifcfg-suse/Makefile.am b/system-settings/plugins/ifcfg-suse/Makefile.am new file mode 100644 index 00000000..f28f57f7 --- /dev/null +++ b/system-settings/plugins/ifcfg-suse/Makefile.am @@ -0,0 +1,26 @@ + +pkglib_LTLIBRARIES = libnm-settings-plugin-ifcfg-suse.la + +libnm_settings_plugin_ifcfg_suse_la_SOURCES = \ + plugin.c \ + plugin.h + +libnm_settings_plugin_ifcfg_suse_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -I${top_srcdir}/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +libnm_settings_plugin_ifcfg_suse_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_ifcfg_suse_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GIO_LIBS) + diff --git a/system-settings/plugins/ifcfg-suse/Makefile.in b/system-settings/plugins/ifcfg-suse/Makefile.in new file mode 100644 index 00000000..81a91530 --- /dev/null +++ b/system-settings/plugins/ifcfg-suse/Makefile.in @@ -0,0 +1,624 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = system-settings/plugins/ifcfg-suse +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libnm_settings_plugin_ifcfg_suse_la_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libnm_settings_plugin_ifcfg_suse_la_OBJECTS = \ + libnm_settings_plugin_ifcfg_suse_la-plugin.lo +libnm_settings_plugin_ifcfg_suse_la_OBJECTS = \ + $(am_libnm_settings_plugin_ifcfg_suse_la_OBJECTS) +libnm_settings_plugin_ifcfg_suse_la_LINK = $(LIBTOOL) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) \ + $(libnm_settings_plugin_ifcfg_suse_la_LDFLAGS) $(LDFLAGS) -o \ + $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnm_settings_plugin_ifcfg_suse_la_SOURCES) +DIST_SOURCES = $(libnm_settings_plugin_ifcfg_suse_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pkglib_LTLIBRARIES = libnm-settings-plugin-ifcfg-suse.la +libnm_settings_plugin_ifcfg_suse_la_SOURCES = \ + plugin.c \ + plugin.h + +libnm_settings_plugin_ifcfg_suse_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -I${top_srcdir}/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +libnm_settings_plugin_ifcfg_suse_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_ifcfg_suse_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GIO_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/ifcfg-suse/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/ifcfg-suse/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnm-settings-plugin-ifcfg-suse.la: $(libnm_settings_plugin_ifcfg_suse_la_OBJECTS) $(libnm_settings_plugin_ifcfg_suse_la_DEPENDENCIES) + $(libnm_settings_plugin_ifcfg_suse_la_LINK) -rpath $(pkglibdir) $(libnm_settings_plugin_ifcfg_suse_la_OBJECTS) $(libnm_settings_plugin_ifcfg_suse_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_ifcfg_suse_la-plugin.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnm_settings_plugin_ifcfg_suse_la-plugin.lo: plugin.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifcfg_suse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_ifcfg_suse_la-plugin.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_ifcfg_suse_la-plugin.Tpo -c -o libnm_settings_plugin_ifcfg_suse_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_ifcfg_suse_la-plugin.Tpo $(DEPDIR)/libnm_settings_plugin_ifcfg_suse_la-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plugin.c' object='libnm_settings_plugin_ifcfg_suse_la-plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifcfg_suse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_ifcfg_suse_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/ifcfg-suse/plugin.c b/system-settings/plugins/ifcfg-suse/plugin.c new file mode 100644 index 00000000..26c73d2d --- /dev/null +++ b/system-settings/plugins/ifcfg-suse/plugin.c @@ -0,0 +1,322 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ + +/* NetworkManager system settings service + * + * Søren Sandmann + * + * 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 - 2009 Red Hat, Inc. + * (C) Copyright 2007 - 2008 Novell, Inc. + */ + +#include +#include + +#include +#include +#include + +#include "plugin.h" +#include "nm-system-config-interface.h" + +#define IFCFG_PLUGIN_NAME "ifcfg-suse" +#define IFCFG_PLUGIN_INFO "(C) 2008 Novell, Inc. To report bugs please use the NetworkManager mailing list." +#define IFCFG_DIR SYSCONFDIR "/sysconfig/network" +#define CONF_DHCP IFCFG_DIR "/dhcp" +#define HOSTNAME_FILE "/etc/HOSTNAME" + +static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); + +G_DEFINE_TYPE_EXTENDED (SCPluginIfcfg, sc_plugin_ifcfg, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE, + system_config_interface_init)) + +#define SC_PLUGIN_IFCFG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgPrivate)) + + +#define IFCFG_FILE_PATH_TAG "ifcfg-file-path" + +typedef struct { + GFileMonitor *hostname_monitor; + GFileMonitor *dhcp_monitor; + char *hostname; +} SCPluginIfcfgPrivate; + +GQuark +ifcfg_plugin_error_quark (void) +{ + static GQuark error_quark = 0; + + if (G_UNLIKELY (error_quark == 0)) + error_quark = g_quark_from_static_string ("ifcfg-plugin-error-quark"); + + return error_quark; +} + +typedef void (*FileChangedFn) (gpointer user_data); + +typedef struct { + FileChangedFn callback; + gpointer user_data; +} FileMonitorInfo; + +static void +file_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + FileMonitorInfo *info; + + switch (event_type) { + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + case G_FILE_MONITOR_EVENT_DELETED: + info = (FileMonitorInfo *) user_data; + info->callback (info->user_data); + break; + default: + break; + } +} + +static GFileMonitor * +monitor_file_changes (const char *filename, + FileChangedFn callback, + gpointer user_data) +{ + GFile *file; + GFileMonitor *monitor; + FileMonitorInfo *info; + + file = g_file_new_for_path (filename); + monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref (file); + + if (monitor) { + info = g_new0 (FileMonitorInfo, 1); + info->callback = callback; + info->user_data = user_data; + g_object_weak_ref (G_OBJECT (monitor), (GWeakNotify) g_free, info); + g_signal_connect (monitor, "changed", G_CALLBACK (file_changed), info); + } + + return monitor; +} + +static gboolean +hostname_is_dynamic (void) +{ + GIOChannel *channel; + const char *pattern = "DHCLIENT_SET_HOSTNAME="; + char *str = NULL; + int pattern_len; + gboolean dynamic = FALSE; + + channel = g_io_channel_new_file (CONF_DHCP, "r", NULL); + if (!channel) + return dynamic; + + pattern_len = strlen (pattern); + + while (g_io_channel_read_line (channel, &str, NULL, NULL, NULL) != G_IO_STATUS_EOF) { + if (!strncmp (str, pattern, pattern_len)) { + if (!strncmp (str + pattern_len, "\"yes\"", 5)) + dynamic = TRUE; + break; + } + g_free (str); + } + + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + + return dynamic; +} + +static char * +hostname_read () +{ + GIOChannel *channel; + char *hostname = NULL; + + channel = g_io_channel_new_file (HOSTNAME_FILE, "r", NULL); + if (channel) { + g_io_channel_read_line (channel, &hostname, NULL, NULL, NULL); + g_io_channel_shutdown (channel, FALSE, NULL); + g_io_channel_unref (channel); + + if (hostname) + hostname = g_strchomp (hostname); + } + + return hostname; +} + +static void +hostname_changed (gpointer data) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (data); + + g_free (priv->hostname); + if (hostname_is_dynamic ()) + priv->hostname = NULL; + else + priv->hostname = hostname_read (); + + g_object_notify (G_OBJECT (data), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); +} + +static void +plugin_set_hostname (SCPluginIfcfg *plugin, const char *hostname) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); + GIOChannel *channel; + + channel = g_io_channel_new_file (HOSTNAME_FILE, "w", NULL); + if (channel) { + g_io_channel_write_chars (channel, hostname, -1, NULL, NULL); + g_io_channel_write_chars (channel, "\n", -1, NULL, NULL); + g_io_channel_shutdown (channel, TRUE, NULL); + g_io_channel_unref (channel); + } + + g_free (priv->hostname); + priv->hostname = hostname ? g_strdup (hostname) : NULL; +} + +static void +init (NMSystemConfigInterface *config) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (config); + + priv->hostname_monitor = monitor_file_changes (HOSTNAME_FILE, hostname_changed, config); + priv->dhcp_monitor = monitor_file_changes (CONF_DHCP, hostname_changed, config); + + if (!hostname_is_dynamic ()) + priv->hostname = hostname_read (); +} + +static void +sc_plugin_ifcfg_init (SCPluginIfcfg *self) +{ +} + +static void +dispose (GObject *object) +{ + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (object); + + if (priv->dhcp_monitor) + g_object_unref (priv->dhcp_monitor); + + if (priv->hostname_monitor) + g_object_unref (priv->hostname_monitor); + + g_free (priv->hostname); + + G_OBJECT_CLASS (sc_plugin_ifcfg_parent_class)->dispose (object); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME: + g_value_set_string (value, IFCFG_PLUGIN_NAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO: + g_value_set_string (value, IFCFG_PLUGIN_INFO); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES: + g_value_set_uint (value, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + g_value_set_string (value, SC_PLUGIN_IFCFG_GET_PRIVATE (object)->hostname); + 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) +{ + const char *hostname; + + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + hostname = g_value_get_string (value); + if (hostname && strlen (hostname) < 1) + hostname = NULL; + plugin_set_hostname (SC_PLUGIN_IFCFG (object), hostname); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +sc_plugin_ifcfg_class_init (SCPluginIfcfgClass *req_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (req_class); + + g_type_class_add_private (req_class, sizeof (SCPluginIfcfgPrivate)); + + object_class->get_property = get_property; + object_class->set_property = set_property; + object_class->dispose = dispose; + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME, + NM_SYSTEM_CONFIG_INTERFACE_NAME); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO, + NM_SYSTEM_CONFIG_INTERFACE_INFO); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES, + NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME, + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); +} + +static void +system_config_interface_init (NMSystemConfigInterface *system_config_interface_class) +{ + /* interface implementation */ + system_config_interface_class->init = init; +} + +G_MODULE_EXPORT GObject * +nm_system_config_factory (void) +{ + static SCPluginIfcfg *singleton = NULL; + + if (!singleton) + singleton = SC_PLUGIN_IFCFG (g_object_new (SC_TYPE_PLUGIN_IFCFG, NULL)); + else + g_object_ref (singleton); + + return G_OBJECT (singleton); +} diff --git a/system-settings/plugins/ifcfg-suse/plugin.h b/system-settings/plugins/ifcfg-suse/plugin.h new file mode 100644 index 00000000..97840595 --- /dev/null +++ b/system-settings/plugins/ifcfg-suse/plugin.h @@ -0,0 +1,52 @@ +/* NetworkManager system settings service + * + * Søren Sandmann + * + * 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 Red Hat, Inc. + */ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +#include + +#define PLUGIN_NAME "ifcfg-suse" + +#define SC_TYPE_PLUGIN_IFCFG (sc_plugin_ifcfg_get_type ()) +#define SC_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfg)) +#define SC_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgClass)) +#define SC_IS_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IFCFG)) +#define SC_IS_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SC_TYPE_PLUGIN_IFCFG)) +#define SC_PLUGIN_IFCFG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgClass)) + +typedef struct _SCPluginIfcfg SCPluginIfcfg; +typedef struct _SCPluginIfcfgClass SCPluginIfcfgClass; + +struct _SCPluginIfcfg { + GObject parent; +}; + +struct _SCPluginIfcfgClass { + GObjectClass parent; +}; + +GType sc_plugin_ifcfg_get_type (void); + +GQuark ifcfg_plugin_error_quark (void); + +#endif /* _PLUGIN_H_ */ + diff --git a/system-settings/plugins/ifupdown/Makefile.am b/system-settings/plugins/ifupdown/Makefile.am new file mode 100644 index 00000000..ec503115 --- /dev/null +++ b/system-settings/plugins/ifupdown/Makefile.am @@ -0,0 +1,34 @@ + +INCLUDES = \ + -I$(top_srcdir)/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/libnm-util + +pkglib_LTLIBRARIES = libnm-settings-plugin-ifupdown.la + +libnm_settings_plugin_ifupdown_la_SOURCES = \ + interface_parser.c \ + interface_parser.h \ + nm-ifupdown-connection.c \ + nm-ifupdown-connection.h \ + parser.c \ + parser.h \ + plugin.c \ + plugin.h + +libnm_settings_plugin_ifupdown_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(GUDEV_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +libnm_settings_plugin_ifupdown_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_ifupdown_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GUDEV_LIBS) + diff --git a/system-settings/plugins/ifupdown/Makefile.in b/system-settings/plugins/ifupdown/Makefile.in new file mode 100644 index 00000000..6c3a6ae7 --- /dev/null +++ b/system-settings/plugins/ifupdown/Makefile.in @@ -0,0 +1,657 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = system-settings/plugins/ifupdown +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libnm_settings_plugin_ifupdown_la_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libnm_settings_plugin_ifupdown_la_OBJECTS = \ + libnm_settings_plugin_ifupdown_la-interface_parser.lo \ + libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.lo \ + libnm_settings_plugin_ifupdown_la-parser.lo \ + libnm_settings_plugin_ifupdown_la-plugin.lo +libnm_settings_plugin_ifupdown_la_OBJECTS = \ + $(am_libnm_settings_plugin_ifupdown_la_OBJECTS) +libnm_settings_plugin_ifupdown_la_LINK = $(LIBTOOL) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) \ + $(libnm_settings_plugin_ifupdown_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnm_settings_plugin_ifupdown_la_SOURCES) +DIST_SOURCES = $(libnm_settings_plugin_ifupdown_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I$(top_srcdir)/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/libnm-util + +pkglib_LTLIBRARIES = libnm-settings-plugin-ifupdown.la +libnm_settings_plugin_ifupdown_la_SOURCES = \ + interface_parser.c \ + interface_parser.h \ + nm-ifupdown-connection.c \ + nm-ifupdown-connection.h \ + parser.c \ + parser.h \ + plugin.c \ + plugin.h + +libnm_settings_plugin_ifupdown_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(GUDEV_CFLAGS) \ + -DG_DISABLE_DEPRECATED \ + -DSYSCONFDIR=\"$(sysconfdir)\" + +libnm_settings_plugin_ifupdown_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_ifupdown_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GUDEV_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/ifupdown/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/ifupdown/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnm-settings-plugin-ifupdown.la: $(libnm_settings_plugin_ifupdown_la_OBJECTS) $(libnm_settings_plugin_ifupdown_la_DEPENDENCIES) + $(libnm_settings_plugin_ifupdown_la_LINK) -rpath $(pkglibdir) $(libnm_settings_plugin_ifupdown_la_OBJECTS) $(libnm_settings_plugin_ifupdown_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_ifupdown_la-interface_parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_ifupdown_la-parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_ifupdown_la-plugin.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnm_settings_plugin_ifupdown_la-interface_parser.lo: interface_parser.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifupdown_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_ifupdown_la-interface_parser.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_ifupdown_la-interface_parser.Tpo -c -o libnm_settings_plugin_ifupdown_la-interface_parser.lo `test -f 'interface_parser.c' || echo '$(srcdir)/'`interface_parser.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_ifupdown_la-interface_parser.Tpo $(DEPDIR)/libnm_settings_plugin_ifupdown_la-interface_parser.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='interface_parser.c' object='libnm_settings_plugin_ifupdown_la-interface_parser.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifupdown_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_ifupdown_la-interface_parser.lo `test -f 'interface_parser.c' || echo '$(srcdir)/'`interface_parser.c + +libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.lo: nm-ifupdown-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifupdown_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.Tpo -c -o libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.lo `test -f 'nm-ifupdown-connection.c' || echo '$(srcdir)/'`nm-ifupdown-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.Tpo $(DEPDIR)/libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-ifupdown-connection.c' object='libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifupdown_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_ifupdown_la-nm-ifupdown-connection.lo `test -f 'nm-ifupdown-connection.c' || echo '$(srcdir)/'`nm-ifupdown-connection.c + +libnm_settings_plugin_ifupdown_la-parser.lo: parser.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifupdown_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_ifupdown_la-parser.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_ifupdown_la-parser.Tpo -c -o libnm_settings_plugin_ifupdown_la-parser.lo `test -f 'parser.c' || echo '$(srcdir)/'`parser.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_ifupdown_la-parser.Tpo $(DEPDIR)/libnm_settings_plugin_ifupdown_la-parser.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser.c' object='libnm_settings_plugin_ifupdown_la-parser.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifupdown_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_ifupdown_la-parser.lo `test -f 'parser.c' || echo '$(srcdir)/'`parser.c + +libnm_settings_plugin_ifupdown_la-plugin.lo: plugin.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifupdown_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_ifupdown_la-plugin.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_ifupdown_la-plugin.Tpo -c -o libnm_settings_plugin_ifupdown_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_ifupdown_la-plugin.Tpo $(DEPDIR)/libnm_settings_plugin_ifupdown_la-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plugin.c' object='libnm_settings_plugin_ifupdown_la-plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_ifupdown_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_ifupdown_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/ifupdown/interface_parser.c b/system-settings/plugins/ifupdown/interface_parser.c new file mode 100644 index 00000000..f28cf7ca --- /dev/null +++ b/system-settings/plugins/ifupdown/interface_parser.c @@ -0,0 +1,215 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ +/* NetworkManager -- Network link manager + * + * Tom Parker + * + * 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 2004 Tom Parker + */ + + +#include "interface_parser.h" +#include +#include +#include +#include "nm-utils.h" + +if_block* first; +if_block* last; + +if_data* last_data; + +void add_block(const char *type, const char* name) +{ + if_block *ret = (if_block*)calloc(1,sizeof(struct _if_block)); + ret->name = g_strdup(name); + ret->type = g_strdup(type); + if (first == NULL) + first = last = ret; + else + { + last->next = ret; + last = ret; + } + last_data = NULL; + //printf("added block '%s' with type '%s'\n",name,type); +} + +void add_data(const char *key,const char *data) +{ + if_data *ret; + + // Check if there is a block where we can attach our data + if (first == NULL) + return; + + ret = (if_data*) calloc(1,sizeof(struct _if_data)); + ret->key = g_strdup(key); + ret->data = g_strdup(data); + + if (last->info == NULL) + { + last->info = ret; + last_data = ret; + } + else + { + last_data->next = ret; + last_data = last_data->next; + } + //printf("added data '%s' with key '%s'\n",data,key); +} + +#define SPACE_OR_TAB(string,ret) {ret = strchr(string,' ');ret=(ret == NULL?strchr(string,'\t'):ret);} + +void ifparser_init(void) +{ + FILE *inp = fopen(ENI_INTERFACES_FILE, "r"); + int ret = 0; + char *line; + char *space; + char rline[255]; + + if (inp == NULL) + { + nm_warning ("Error: Can't open %s\n", ENI_INTERFACES_FILE); + return; + } + first = last = NULL; + while(1) + { + line = space = NULL; + ret = fscanf(inp,"%255[^\n]\n",rline); + if (ret == EOF) + break; + // If the line did not match, skip it + if (ret == 0) { + char *ignored; + + ignored = fgets(rline, 255, inp); + continue; + } + + line = rline; + while(line[0] == ' ') + line++; + if (line[0]=='#' || line[0]=='\0') + continue; + + SPACE_OR_TAB(line,space) + if (space == NULL) + { + nm_warning ("Error: Can't parse interface line '%s'\n",line); + continue; + } + space[0] = '\0'; + + // There are four different stanzas: + // iface, mapping, auto and allow-*. Create a block for each of them. + if (strcmp(line,"iface")==0) + { + char *space2 = strchr(space+1,' '); + if (space2 == NULL) + { + nm_warning ("Error: Can't parse iface line '%s'\n",space+1); + continue; + } + space2[0]='\0'; + add_block(line,space+1); + + if (space2[1]!='\0') + { + space = strchr(space2+1,' '); + if (space == NULL) + { + nm_warning ("Error: Can't parse data '%s'\n",space2+1); + continue; + } + space[0] = '\0'; + add_data(space2+1,space+1); + } + } + else if (strcmp(line,"auto")==0) + add_block(line,space+1); + else if (strcmp(line,"mapping")==0) + add_block(line,space+1); + else if (strncmp(line,"allow-",6)==0) + add_block(line,space+1); + else + add_data(line,space+1); + + //printf("line: '%s' ret=%d\n",rline,ret); + } + fclose(inp); +} + +void _destroy_data(if_data *ifd) +{ + if (ifd == NULL) + return; + _destroy_data(ifd->next); + free(ifd->key); + free(ifd->data); + free(ifd); + return; +} + +void _destroy_block(if_block* ifb) +{ + if (ifb == NULL) + return; + _destroy_block(ifb->next); + _destroy_data(ifb->info); + free(ifb->name); + free(ifb->type); + free(ifb); + return; +} + +void ifparser_destroy(void) +{ + _destroy_block(first); + first = last = NULL; +} + +if_block *ifparser_getfirst(void) +{ + return first; +} + +if_block *ifparser_getif(const char* iface) +{ + if_block *curr = first; + while(curr!=NULL) + { + if (strcmp(curr->type,"iface")==0 && strcmp(curr->name,iface)==0) + return curr; + curr = curr->next; + } + return NULL; +} + +const char *ifparser_getkey(if_block* iface, const char *key) +{ + if_data *curr = iface->info; + while(curr!=NULL) + { + if (strcmp(curr->key,key)==0) + return curr->data; + curr = curr->next; + } + return NULL; +} diff --git a/system-settings/plugins/ifupdown/interface_parser.h b/system-settings/plugins/ifupdown/interface_parser.h new file mode 100644 index 00000000..52b98d04 --- /dev/null +++ b/system-settings/plugins/ifupdown/interface_parser.h @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ +/* NetworkManager -- Network link manager + * + * Tom Parker + * + * 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 2004 Tom Parker + */ + + +#ifndef _INTERFACE_PARSER_H +#define _INTERFACE_PARSER_H + +#include "config.h" + +#define ENI_INTERFACES_FILE "/etc/network/interfaces" + +typedef struct _if_data +{ + char *key; + char *data; + struct _if_data *next; +} if_data; + +typedef struct _if_block +{ + char *type; + char *name; + if_data *info; + struct _if_block *next; +} if_block; + +void ifparser_init(void); +void ifparser_destroy(void); + +if_block *ifparser_getif(const char* iface); +if_block *ifparser_getfirst(void); +const char *ifparser_getkey(if_block* iface, const char *key); + +void add_block(const char *type, const char* name); +void add_data(const char *key,const char *data); +void _destroy_data(if_data *ifd); +void _destroy_block(if_block* ifb); +#endif diff --git a/system-settings/plugins/ifupdown/nm-ifupdown-connection.c b/system-settings/plugins/ifupdown/nm-ifupdown-connection.c new file mode 100644 index 00000000..ad9a479a --- /dev/null +++ b/system-settings/plugins/ifupdown/nm-ifupdown-connection.c @@ -0,0 +1,187 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ + +/* NetworkManager system settings service (ifupdown) + * + * Alexander Sack + * + * 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,2008 Canonical Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "nm-ifupdown-connection.h" +#include "parser.h" + +G_DEFINE_TYPE (NMIfupdownConnection, nm_ifupdown_connection, NM_TYPE_SYSCONFIG_CONNECTION) + +#define NM_IFUPDOWN_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IFUPDOWN_CONNECTION, NMIfupdownConnectionPrivate)) + +typedef struct { + if_block *ifblock; +} NMIfupdownConnectionPrivate; + +enum { + PROP_ZERO, + PROP_IFBLOCK, + _PROP_END, +}; + + +NMIfupdownConnection* +nm_ifupdown_connection_new (if_block *block) +{ + g_return_val_if_fail (block != NULL, NULL); + + return (NMIfupdownConnection *) g_object_new (NM_TYPE_IFUPDOWN_CONNECTION, + NM_IFUPDOWN_CONNECTION_IFBLOCK, block, + NULL); +} + +static void +get_secrets (NMExportedConnection *exported, + const gchar *setting_name, + const gchar **hints, + gboolean request_new, + DBusGMethodInvocation *context) +{ + GError *error = NULL; + + PLUGIN_PRINT ("SCPlugin-Ifupdown", "get_secrets() for setting_name:'%s'", setting_name); + + /* FIXME: Only wifi secrets are supported for now */ + if (strcmp (setting_name, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME)) { + g_set_error (&error, + NM_SYSCONFIG_SETTINGS_ERROR, + NM_SYSCONFIG_SETTINGS_ERROR_GENERAL, + "%s.%d - security setting name not supported '%s'.", + __FILE__, __LINE__, setting_name); + PLUGIN_PRINT ("SCPlugin-Ifupdown", "%s", error->message); + dbus_g_method_return_error (context, error); + g_error_free (error); + return; + } + + NM_EXPORTED_CONNECTION_CLASS (nm_ifupdown_connection_parent_class)->get_secrets (exported, setting_name, hints, request_new, context); +} + +static void +nm_ifupdown_connection_init (NMIfupdownConnection *connection) +{ +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMIfupdownConnectionPrivate *priv; + GError *error = NULL; + + object = G_OBJECT_CLASS (nm_ifupdown_connection_parent_class)->constructor (type, n_construct_params, construct_params); + g_return_val_if_fail (object, NULL); + + priv = NM_IFUPDOWN_CONNECTION_GET_PRIVATE (object); + if (!priv) { + g_warning ("%s.%d - no private instance.", __FILE__, __LINE__); + goto err; + } + if (!priv->ifblock) { + g_warning ("(ifupdown) ifblock not provided to constructor."); + goto err; + } + + if (!ifupdown_update_connection_from_if_block (NM_CONNECTION (object), priv->ifblock, &error)) { + g_warning ("%s.%d - invalid connection read from /etc/network/interfaces: (%d) %s", + __FILE__, + __LINE__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + goto err; + } + + return object; + + err: + g_object_unref (object); + return NULL; +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMIfupdownConnectionPrivate *priv = NM_IFUPDOWN_CONNECTION_GET_PRIVATE (object); + g_return_if_fail (priv); + + switch (prop_id) { + case PROP_IFBLOCK: + priv->ifblock = g_value_get_pointer (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) +{ + NMIfupdownConnectionPrivate *priv = NM_IFUPDOWN_CONNECTION_GET_PRIVATE (object); + g_return_if_fail (priv); + + switch (prop_id) { + case PROP_IFBLOCK: + g_value_set_pointer (value, priv->ifblock); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_ifupdown_connection_class_init (NMIfupdownConnectionClass *ifupdown_connection_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (ifupdown_connection_class); + NMExportedConnectionClass *connection_class = NM_EXPORTED_CONNECTION_CLASS (ifupdown_connection_class); + + g_type_class_add_private (ifupdown_connection_class, sizeof (NMIfupdownConnectionPrivate)); + + /* Virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + + connection_class->get_secrets = get_secrets; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_IFBLOCK, + g_param_spec_pointer (NM_IFUPDOWN_CONNECTION_IFBLOCK, + "ifblock", + "", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +} + diff --git a/system-settings/plugins/ifupdown/nm-ifupdown-connection.h b/system-settings/plugins/ifupdown/nm-ifupdown-connection.h new file mode 100644 index 00000000..4eb20e50 --- /dev/null +++ b/system-settings/plugins/ifupdown/nm-ifupdown-connection.h @@ -0,0 +1,55 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ + +/* NetworkManager system settings service (ifupdown) + * + * Alexander Sack + * + * 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 Canonical Ltd. + */ + +#ifndef NM_IFUPDOWN_CONNECTION_H +#define NM_IFUPDOWN_CONNECTION_H + +#include +#include "interface_parser.h" + +G_BEGIN_DECLS + +#define NM_TYPE_IFUPDOWN_CONNECTION (nm_ifupdown_connection_get_type ()) +#define NM_IFUPDOWN_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IFUPDOWN_CONNECTION, NMIfupdownConnection)) +#define NM_IFUPDOWN_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IFUPDOWN_CONNECTION, NMIfupdownConnectionClass)) +#define NM_IS_IFUPDOWN_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IFUPDOWN_CONNECTION)) +#define NM_IS_IFUPDOWN_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IFUPDOWN_CONNECTION)) +#define NM_IFUPDOWN_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IFUPDOWN_CONNECTION, NMIfupdownConnectionClass)) + +#define NM_IFUPDOWN_CONNECTION_IFBLOCK "ifblock" + +typedef struct { + NMExportedConnection parent; +} NMIfupdownConnection; + +typedef struct { + NMExportedConnectionClass parent; +} NMIfupdownConnectionClass; + +GType nm_ifupdown_connection_get_type (void); + +NMIfupdownConnection *nm_ifupdown_connection_new (if_block *block); + +G_END_DECLS + +#endif /* NM_IFUPDOWN_CONNECTION_H */ diff --git a/system-settings/plugins/ifupdown/parser.c b/system-settings/plugins/ifupdown/parser.c new file mode 100644 index 00000000..dc2f8abf --- /dev/null +++ b/system-settings/plugins/ifupdown/parser.c @@ -0,0 +1,577 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ + +/* NetworkManager system settings service (ifupdown) + * + * Alexander Sack + * + * 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 Canonical Ltd. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "parser.h" +#include "plugin.h" + + +#define WPA_PMK_LEN 32 + +#include "parser.h" + +static const gchar* +_ifupdownplugin_guess_connection_type (if_block *block) +{ + if_data *curr = block->info; + const gchar* ret_type = NULL; + const gchar* value = ifparser_getkey(block, "inet"); + if(value && !strcmp("ppp", value)) { + ret_type = NM_SETTING_PPP_SETTING_NAME; + } + + while(!ret_type && curr) { + if(!strncmp("wireless-", curr->key, strlen("wireless-")) || + !strncmp("wpa-", curr->key, strlen("wpa-"))) { + ret_type = NM_SETTING_WIRELESS_SETTING_NAME; + } + curr = curr->next; + } + + if(!ret_type) + ret_type = NM_SETTING_WIRED_SETTING_NAME; + + PLUGIN_PRINT("SCPluginIfupdown", + "guessed connection type (%s) = %s", + block->name, ret_type); + return ret_type; +} + + +struct _Mapping { + const gchar *domain; + const gpointer target; +}; + +static gpointer +map_by_mapping(struct _Mapping *mapping, const gchar *key) +{ + struct _Mapping *curr = mapping; + while(curr->domain) { + if(!strcmp(curr->domain, key)) + return curr->target; + curr++; + } + return NULL; +} + +static void +update_wireless_setting_from_if_block(NMConnection *connection, + if_block *block) +{ + gint wpa_l= strlen("wpa-"); + gint wireless_l= strlen("wireless-"); + + if_data *curr = block->info; + const gchar* value = ifparser_getkey (block, "inet"); + struct _Mapping mapping[] = { + {"ssid", "ssid"}, + { NULL, NULL} + }; + + NMSettingWireless *wireless_setting = NULL; + + if(value && !strcmp("ppp", value)) { + return; + } + + PLUGIN_PRINT ("SCPlugin-Ifupdown", "update wireless settings (%s).", block->name); + wireless_setting = NM_SETTING_WIRELESS(nm_setting_wireless_new()); + + while(curr) { + if(strlen(curr->key) > wireless_l && + !strncmp("wireless-", curr->key, wireless_l)) { + const gchar* newkey = map_by_mapping(mapping, curr->key+wireless_l); + PLUGIN_PRINT ("SCPlugin-Ifupdown", "wireless setting key: %s='%s'", + newkey, curr->data); + if(newkey && !strcmp("ssid", newkey)) { + GByteArray *ssid; + gint len = strlen(curr->data); + + ssid = g_byte_array_sized_new (len); + g_byte_array_append (ssid, (const guint8 *) curr->data, len); + g_object_set (wireless_setting, NM_SETTING_WIRELESS_SSID, ssid, NULL); + g_byte_array_free (ssid, TRUE); + PLUGIN_PRINT("SCPlugin-Ifupdown", "setting wireless ssid = %d", len); + } else { + g_object_set(wireless_setting, + newkey, curr->data, + NULL); + } + } else if(strlen(curr->key) > wpa_l && + !strncmp("wpa-", curr->key, wpa_l)) { + const gchar* newkey = map_by_mapping(mapping, curr->key+wpa_l); + + if(newkey && !strcmp("ssid", newkey)) { + GByteArray *ssid; + gint len = strlen(curr->data); + + ssid = g_byte_array_sized_new (len); + g_byte_array_append (ssid, (const guint8 *) curr->data, len); + g_object_set (wireless_setting, NM_SETTING_WIRELESS_SSID, ssid, NULL); + g_byte_array_free (ssid, TRUE); + PLUGIN_PRINT("SCPlugin-Ifupdown", "setting wpa ssid = %d", len); + } else if(newkey) { + + g_object_set(wireless_setting, + newkey, curr->data, + NULL); + PLUGIN_PRINT ("SCPlugin-Ifupdown", "setting wpa newkey(%s)=data(%s)", newkey, curr->data); + } + } + curr = curr->next; + } + nm_connection_add_setting(connection, (NMSetting*) wireless_setting); +} + +typedef gchar* (*IfupdownStrDupeFunc) (gpointer value, gpointer data); +typedef gpointer (*IfupdownStrToTypeFunc) (const gchar* value); + +static char* +normalize_dupe_wireless_key (gpointer value, gpointer data) { + char* valuec = value; + char* endc = valuec + strlen (valuec); + char* delim = valuec; + char* next = delim; + char* result = malloc (strlen (valuec) + 1); + char* result_cur = result; + + while (*delim && (next = strchr (delim, '-')) != NULL) { + if (next == delim) { + delim++; + continue; + } + strncpy (result_cur, delim, next - delim); + result_cur += next - delim; + delim = next + 1; + } + if (*delim && strlen (valuec) > GPOINTER_TO_UINT(delim - valuec)) { + strncpy (result_cur, delim, endc - delim); + result_cur += endc - delim; + } + *result_cur = '\0'; + return result; +} + +static char* +normalize_dupe (gpointer value, gpointer data) { + return g_strdup(value); +} + +static char* +normalize_tolower (gpointer value, gpointer data) { + return g_ascii_strdown(value, -1); +} + +static char *normalize_psk (gpointer value, gpointer data) +{ + if (strlen (value) >= 8 && strlen (value) <= 64) + return g_strdup (value); + return NULL; +} + +static gpointer +string_to_gpointerint(const gchar* data) +{ + gint result = (gint) strtol (data, NULL, 10); + return GINT_TO_POINTER(result); +} + +static gpointer +string_to_glist_of_strings(const gchar* data) +{ + GSList *ret = NULL; + gchar *string = (gchar*) data; + while(string) { + gchar* next = NULL; + if( (next = strchr(string, ' ')) || + (next = strchr(string, '\t')) || + (next = strchr(string, '\0')) ) { + + gchar *part = g_strndup(string, (next - string)); + ret = g_slist_append(ret, part); + if (*next) + string = next+1; + else + string = NULL; + } else { + string = NULL; + } + } + return ret; +} + +static void +slist_free_all(gpointer slist) +{ + GSList *list = (GSList *) slist; + g_slist_foreach (list, (GFunc) g_free, NULL); + g_slist_free (list); +} + +static void +update_wireless_security_setting_from_if_block(NMConnection *connection, + if_block *block) +{ + gint wpa_l= strlen("wpa-"); + gint wireless_l= strlen("wireless-"); + if_data *curr = block->info; + const gchar* value = ifparser_getkey (block, "inet"); + struct _Mapping mapping[] = { + {"psk", "psk"}, + {"identity", "leap-username"}, + {"password", "leap-password"}, + {"key", "wep-key0"}, + {"key-mgmt", "key-mgmt"}, + {"group", "group"}, + {"pairwise", "pairwise"}, + {"proto", "proto"}, + {"pin", "pin"}, + {"wep-key0", "wep-key0"}, + {"wep-key1", "wep-key1"}, + {"wep-key2", "wep-key2"}, + {"wep-key3", "wep-key3"}, + {"wep-tx-keyidx", "wep-tx-keyidx"}, + { NULL, NULL} + }; + + struct _Mapping dupe_mapping[] = { + {"psk", normalize_psk}, + {"identity", normalize_dupe}, + {"password", normalize_dupe}, + {"key", normalize_dupe_wireless_key}, + {"key-mgmt", normalize_tolower}, + {"group", normalize_tolower}, + {"pairwise", normalize_tolower}, + {"proto", normalize_tolower}, + {"pin", normalize_dupe}, + {"wep-key0", normalize_dupe_wireless_key}, + {"wep-key1", normalize_dupe_wireless_key}, + {"wep-key2", normalize_dupe_wireless_key}, + {"wep-key3", normalize_dupe_wireless_key}, + {"wep-tx-keyidx", normalize_dupe}, + { NULL, NULL} + }; + + struct _Mapping type_mapping[] = { + {"group", string_to_glist_of_strings}, + {"pairwise", string_to_glist_of_strings}, + {"proto", string_to_glist_of_strings}, + {"wep-tx-keyidx", string_to_gpointerint}, + { NULL, NULL} + }; + + struct _Mapping free_type_mapping[] = { + {"group", slist_free_all}, + {"pairwise", slist_free_all}, + {"proto", slist_free_all}, + { NULL, NULL} + }; + + NMSettingWirelessSecurity *wireless_security_setting; + NMSettingWireless *s_wireless; + gboolean security = FALSE; + + if(value && !strcmp("ppp", value)) { + return; + } + + s_wireless = NM_SETTING_WIRELESS(nm_connection_get_setting(connection, + NM_TYPE_SETTING_WIRELESS)); + g_return_if_fail(s_wireless); + + PLUGIN_PRINT ("SCPlugin-Ifupdown","update wireless security settings (%s).", block->name); + wireless_security_setting = + NM_SETTING_WIRELESS_SECURITY(nm_setting_wireless_security_new()); + + while(curr) { + if(strlen(curr->key) > wireless_l && + !strncmp("wireless-", curr->key, wireless_l)) { + + gchar *property_value = NULL; + gpointer typed_property_value = NULL; + const gchar* newkey = map_by_mapping(mapping, curr->key+wireless_l); + IfupdownStrDupeFunc dupe_func = map_by_mapping (dupe_mapping, curr->key+wireless_l); + IfupdownStrToTypeFunc type_map_func = map_by_mapping (type_mapping, curr->key+wireless_l); + GFreeFunc free_func = map_by_mapping (free_type_mapping, curr->key+wireless_l); + if(!newkey || !dupe_func) { + g_warning("no (wireless) mapping found for key: %s", curr->key); + goto next; + } + property_value = (*dupe_func) (curr->data, connection); + PLUGIN_PRINT ("SCPlugin-Ifupdown", "setting wireless security key: %s=%s", + newkey, property_value); + + if (type_map_func) { + errno = 0; + typed_property_value = (*type_map_func) (property_value); + if(errno) + goto wireless_next; + } + + g_object_set(wireless_security_setting, + newkey, typed_property_value ? typed_property_value : property_value, + NULL); + security = TRUE; + + wireless_next: + g_free(property_value); + if (typed_property_value && free_func) + (*free_func) (typed_property_value); + + } else if(strlen(curr->key) > wpa_l && + !strncmp("wpa-", curr->key, wpa_l)) { + + gchar *property_value = NULL; + gpointer typed_property_value = NULL; + const gchar* newkey = map_by_mapping(mapping, curr->key+wpa_l); + IfupdownStrDupeFunc dupe_func = map_by_mapping (dupe_mapping, curr->key+wpa_l); + IfupdownStrToTypeFunc type_map_func = map_by_mapping (type_mapping, curr->key+wpa_l); + GFreeFunc free_func = map_by_mapping (free_type_mapping, curr->key+wpa_l); + if(!newkey || !dupe_func) { + goto next; + } + property_value = (*dupe_func) (curr->data, connection); + PLUGIN_PRINT ("SCPlugin-Ifupdown", "setting wpa security key: %s=%s", + newkey, +#ifdef DEBUG_SECRETS + property_value +#else // DEBUG_SECRETS + !strcmp("key", newkey) || + !strcmp("leap-password", newkey) || + !strcmp("pin", newkey) || + !strcmp("psk", newkey) || + !strcmp("wep-key0", newkey) || + !strcmp("wep-key1", newkey) || + !strcmp("wep-key2", newkey) || + !strcmp("wep-key3", newkey) || + NULL ? + "" : property_value +#endif // DEBUG_SECRETS + ); + + if (type_map_func) { + errno = 0; + typed_property_value = (*type_map_func) (property_value); + if(errno) + goto wpa_next; + } + + g_object_set(wireless_security_setting, + newkey, typed_property_value ? typed_property_value : property_value, + NULL); + security = TRUE; + + wpa_next: + g_free(property_value); + if (free_func && typed_property_value) + (*free_func) (typed_property_value); + } + next: + curr = curr->next; + } + + + if(security) { + nm_connection_add_setting(connection, NM_SETTING(wireless_security_setting)); + g_object_set(s_wireless, NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL); + } + +} + +static void +update_wired_setting_from_if_block(NMConnection *connection, + if_block *block) +{ + NMSettingWired *s_wired = NULL; + s_wired = NM_SETTING_WIRED(nm_setting_wired_new()); + nm_connection_add_setting(connection, NM_SETTING(s_wired)); +} + +static GQuark +eni_plugin_error_quark() { + static GQuark error_quark = 0; + + if(!error_quark) { + error_quark = g_quark_from_static_string ("eni-plugin-error-quark"); + } + + return error_quark; +} + + +static void +update_ip4_setting_from_if_block(NMConnection *connection, + if_block *block) +{ + + NMSettingIP4Config *ip4_setting = NM_SETTING_IP4_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(ip4_setting, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL); + } else { + struct in_addr tmp_ip4_addr; + NMIP4Address *ip4_addr = nm_ip4_address_new (); + + const char *address_v = ifparser_getkey(block, "address"); + const char *netmask_v = ifparser_getkey(block, "netmask"); + const char *gateway_v = ifparser_getkey(block, "gateway"); + const char *nameserver_v = ifparser_getkey(block, "dns-nameserver"); + const char *nameservers_v = ifparser_getkey(block, "dns-nameservers"); + GSList* nameservers_list = NULL; + GSList* nameservers_list_i = NULL; + GError *error = NULL; + + if(nameservers_v) + nameservers_list_i = nameservers_list = string_to_glist_of_strings (nameservers_v); + if(nameserver_v) + nameservers_list_i = nameservers_list = g_slist_append(nameservers_list, g_strdup(nameserver_v)); + + if (!address_v) + address_v = g_strdup ("0.0.0.0"); + + if (inet_pton (AF_INET, address_v, &tmp_ip4_addr)) + nm_ip4_address_set_address (ip4_addr, tmp_ip4_addr.s_addr); + else + g_set_error (&error, eni_plugin_error_quark (), 0, + "Invalid %s IP4 address '%s'", "address", address_v); + if (!netmask_v) + netmask_v = g_strdup( "255.255.255.255"); + + if (inet_pton (AF_INET, netmask_v, &tmp_ip4_addr)) + nm_ip4_address_set_prefix (ip4_addr, nm_utils_ip4_netmask_to_prefix(tmp_ip4_addr.s_addr)); + else + g_set_error (&error, eni_plugin_error_quark (), 0, + "Invalid %s IP4 address '%s'", "netmask", netmask_v); + + if (!gateway_v) + gateway_v = g_strdup (address_v); + + if (inet_pton (AF_INET, gateway_v, &tmp_ip4_addr)) + nm_ip4_address_set_gateway (ip4_addr, tmp_ip4_addr.s_addr); + else + g_set_error (&error, eni_plugin_error_quark (), 0, + "Invalid %s IP4 address '%s'", "gateway", gateway_v); + + if (nm_setting_ip4_config_add_address (ip4_setting, ip4_addr)) { + PLUGIN_PRINT("SCPlugin-Ifupdown", "addresses count: %d", + nm_setting_ip4_config_get_num_addresses (ip4_setting)); + } else { + PLUGIN_PRINT("SCPlugin-Ifupdown", "ignoring duplicate IP4 address"); + } + + while(nameservers_list_i) { + gchar *dns = nameservers_list_i->data; + nameservers_list_i = nameservers_list_i -> next; + if(!dns) + continue; + if (inet_pton (AF_INET, dns, &tmp_ip4_addr)) { + if (!nm_setting_ip4_config_add_dns (ip4_setting, tmp_ip4_addr.s_addr)) + PLUGIN_PRINT("SCPlugin-Ifupdown", "ignoring duplicate DNS server '%s'", dns); + } else + g_set_error (&error, eni_plugin_error_quark (), 0, + "Invalid %s IP4 address nameserver '%s'", "nameserver", dns); + } + if (!nm_setting_ip4_config_get_num_dns (ip4_setting)) + PLUGIN_PRINT("SCPlugin-Ifupdown", "No dns-nameserver configured in /etc/network/interfaces"); + + g_object_set(ip4_setting, + NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, + NULL); + + g_slist_foreach (nameservers_list, (GFunc) g_free, NULL); + g_slist_free (nameservers_list); + } + + nm_connection_add_setting(connection, NM_SETTING(ip4_setting)); +} + +gboolean +ifupdown_update_connection_from_if_block (NMConnection *connection, + if_block *block, + GError **error) +{ + const char *type = NULL; + char *idstr = NULL; + char *uuid_base = NULL; + char *uuid = NULL; + NMSettingConnection *s_con; + gboolean success = FALSE; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if(!s_con) { + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new()); + g_assert (s_con); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + } + + type = _ifupdownplugin_guess_connection_type (block); + idstr = g_strconcat ("Ifupdown (", block->name, ")", NULL); + uuid_base = idstr; + + uuid = nm_utils_uuid_generate_from_string (uuid_base); + g_object_set (s_con, + NM_SETTING_CONNECTION_TYPE, type, + NM_SETTING_CONNECTION_ID, idstr, + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_READ_ONLY, TRUE, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NULL); + g_free (uuid); + + PLUGIN_PRINT("SCPlugin-Ifupdown", "update_connection_setting_from_if_block: name:%s, type:%s, id:%s, uuid: %s", + block->name, type, idstr, nm_setting_connection_get_uuid (s_con)); + + if (!strcmp (NM_SETTING_WIRED_SETTING_NAME, type)) + update_wired_setting_from_if_block (connection, block); + else if (!strcmp (NM_SETTING_WIRELESS_SETTING_NAME, type)) { + update_wireless_setting_from_if_block (connection, block); + update_wireless_security_setting_from_if_block (connection, block); + } + + update_ip4_setting_from_if_block (connection, block); + + success = nm_connection_verify (connection, error); + + g_free (idstr); + return success; +} diff --git a/system-settings/plugins/ifupdown/parser.h b/system-settings/plugins/ifupdown/parser.h new file mode 100644 index 00000000..6aebb8c7 --- /dev/null +++ b/system-settings/plugins/ifupdown/parser.h @@ -0,0 +1,34 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ + +/* NetworkManager system settings service (ifupdown) + * + * Alexander Sack + * + * 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 Canonical Ltd. + */ + +#include +#include "interface_parser.h" + +G_BEGIN_DECLS + +gboolean +ifupdown_update_connection_from_if_block (NMConnection *connection, + if_block *block, + GError **error); + +G_END_DECLS diff --git a/system-settings/plugins/ifupdown/plugin.c b/system-settings/plugins/ifupdown/plugin.c new file mode 100644 index 00000000..e2358b9f --- /dev/null +++ b/system-settings/plugins/ifupdown/plugin.c @@ -0,0 +1,681 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* NetworkManager system settings service (ifupdown) + * + * Alexander Sack + * + * 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,2008 Canonical Ltd. + * (C) Copyright 2009 Red Hat, Inc. + */ + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "interface_parser.h" + +#include "NetworkManager.h" +#include "nm-system-config-interface.h" +#include "nm-setting-ip4-config.h" +#include "nm-setting-wireless.h" +#include "nm-setting-wired.h" +#include "nm-setting-ppp.h" + +#include "nm-ifupdown-connection.h" +#include "plugin.h" +#include "parser.h" +#include "nm-inotify-helper.h" + +#include + +#include + +#define G_UDEV_API_IS_SUBJECT_TO_CHANGE +#include + +#define IFUPDOWN_PLUGIN_NAME "ifupdown" +#define IFUPDOWN_PLUGIN_INFO "(C) 2008 Canonical Ltd. To report bugs please use the NetworkManager mailing list." +#define IFUPDOWN_SYSTEM_HOSTNAME_FILE "/etc/hostname" + +#define IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE SYSCONFDIR "/NetworkManager/NetworkManager.conf" +#define IFUPDOWN_OLD_SYSTEM_SETTINGS_KEY_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" + +#define IFUPDOWN_KEY_FILE_GROUP "ifupdown" +#define IFUPDOWN_KEY_FILE_KEY_MANAGED "managed" +#define IFUPDOWN_UNMANAGE_WELL_KNOWN_DEFAULT TRUE + +/* #define ALWAYS_UNMANAGE TRUE */ +#ifndef ALWAYS_UNMANAGE +# define ALWAYS_UNMANAGE FALSE +#endif + +typedef struct { + GUdevClient *client; + + GHashTable *iface_connections; + gchar* hostname; + + GHashTable *well_known_interfaces; + GHashTable *well_known_ifaces; + gboolean unmanage_well_known; + const char *conf_file; + + gulong inotify_event_id; + int inotify_system_hostname_wd; +} SCPluginIfupdownPrivate; + +static void +system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); + +G_DEFINE_TYPE_EXTENDED (SCPluginIfupdown, sc_plugin_ifupdown, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE, + system_config_interface_init)) + +#define SC_PLUGIN_IFUPDOWN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_IFUPDOWN, SCPluginIfupdownPrivate)) + +static void +sc_plugin_ifupdown_class_init (SCPluginIfupdownClass *req_class); + +static void +SCPluginIfupdown_init (NMSystemConfigInterface *config); + +/* Returns the plugins currently known list of connections. The returned + * list is freed by the system settings service. + */ +static GSList* +SCPluginIfupdown_get_connections (NMSystemConfigInterface *config); + +/* + * Return a list of device specifications which NetworkManager should not + * manage. Returned list will be freed by the system settings service, and + * each element must be allocated using g_malloc() or its variants. + */ +static GSList* +SCPluginIfupdown_get_unmanaged_specs (NMSystemConfigInterface *config); + + +/* GObject */ +static void +GObject__get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec); + +static void +GObject__set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec); + +static void +GObject__dispose (GObject *object); + +/* other helpers */ +static const char * +get_hostname (NMSystemConfigInterface *config); + + +static void +update_system_hostname(NMInotifyHelper *inotify_helper, + struct inotify_event *evt, + const char *path, + NMSystemConfigInterface *config); + + +static void +system_config_interface_init (NMSystemConfigInterface *system_config_interface_class) +{ + system_config_interface_class->init = SCPluginIfupdown_init; + system_config_interface_class->get_connections = SCPluginIfupdown_get_connections; + system_config_interface_class->get_unmanaged_specs = SCPluginIfupdown_get_unmanaged_specs; +} + +static void +sc_plugin_ifupdown_class_init (SCPluginIfupdownClass *req_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (req_class); + + g_type_class_add_private (req_class, sizeof (SCPluginIfupdownPrivate)); + + object_class->dispose = GObject__dispose; + object_class->get_property = GObject__get_property; + object_class->set_property = GObject__set_property; + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME, + NM_SYSTEM_CONFIG_INTERFACE_NAME); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO, + NM_SYSTEM_CONFIG_INTERFACE_INFO); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES, + NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME, + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); +} + +static void +ignore_cb (NMSettingsConnectionInterface *connection, + GError *error, + gpointer user_data) +{ +} + +static void +bind_device_to_connection (SCPluginIfupdown *self, + GUdevDevice *device, + NMIfupdownConnection *exported) +{ + GByteArray *mac_address; + NMSetting *s_wired = NULL; + NMSetting *s_wifi = NULL; + const char *iface, *address; + struct ether_addr *tmp_mac; + + iface = g_udev_device_get_name (device); + if (!iface) { + PLUGIN_WARN ("SCPluginIfupdown", "failed to get ifname for device."); + return; + } + + address = g_udev_device_get_sysfs_attr (device, "address"); + if (!address || !strlen (address)) { + PLUGIN_WARN ("SCPluginIfupdown", "failed to get MAC address for %s", iface); + return; + } + + tmp_mac = ether_aton (address); + if (!tmp_mac) { + PLUGIN_WARN ("SCPluginIfupdown", "failed to parse MAC address '%s' for %s", + address, iface); + return; + } + + mac_address = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (mac_address, &(tmp_mac->ether_addr_octet[0]), ETH_ALEN); + + s_wired = nm_connection_get_setting (NM_CONNECTION (exported), NM_TYPE_SETTING_WIRED); + s_wifi = nm_connection_get_setting (NM_CONNECTION (exported), NM_TYPE_SETTING_WIRELESS); + if (s_wired) { + PLUGIN_PRINT ("SCPluginIfupdown", "locking wired connection setting"); + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, mac_address, NULL); + } else if (s_wifi) { + PLUGIN_PRINT ("SCPluginIfupdown", "locking wireless connection setting"); + g_object_set (s_wifi, NM_SETTING_WIRELESS_MAC_ADDRESS, mac_address, NULL); + } + g_byte_array_free (mac_address, TRUE); + + nm_settings_connection_interface_update (NM_SETTINGS_CONNECTION_INTERFACE (exported), + ignore_cb, + NULL); +} + +static void +udev_device_added (SCPluginIfupdown *self, GUdevDevice *device) +{ + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (self); + const char *iface, *path; + NMIfupdownConnection *exported; + + iface = g_udev_device_get_name (device); + path = g_udev_device_get_sysfs_path (device); + if (!iface || !path) + return; + + PLUGIN_PRINT("SCPlugin-Ifupdown", + "devices added (path: %s, iface: %s)", path, iface); + + /* if we have a configured connection for this particular iface + * we want to either unmanage the device or lock it + */ + exported = (NMIfupdownConnection *) g_hash_table_lookup (priv->iface_connections, iface); + if (!exported && !g_hash_table_lookup (priv->well_known_interfaces, iface)) { + PLUGIN_PRINT("SCPlugin-Ifupdown", + "device added (path: %s, iface: %s): no ifupdown configuration found.", path, iface); + return; + } + + g_hash_table_insert (priv->well_known_ifaces, g_strdup (iface), g_object_ref (device)); + + if (exported) + bind_device_to_connection (self, device, exported); + + if (ALWAYS_UNMANAGE || priv->unmanage_well_known) + g_signal_emit_by_name (G_OBJECT (self), NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); +} + +static void +udev_device_removed (SCPluginIfupdown *self, GUdevDevice *device) +{ + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (self); + const char *iface, *path; + + iface = g_udev_device_get_name (device); + path = g_udev_device_get_sysfs_path (device); + if (!iface || !path) + return; + + PLUGIN_PRINT("SCPlugin-Ifupdown", + "devices removed (path: %s, iface: %s)", path, iface); + + if (!g_hash_table_remove (priv->well_known_ifaces, iface)) + return; + + if (ALWAYS_UNMANAGE || priv->unmanage_well_known) + g_signal_emit_by_name (G_OBJECT (self), NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); +} + +static void +handle_uevent (GUdevClient *client, + const char *action, + GUdevDevice *device, + gpointer user_data) +{ + SCPluginIfupdown *self = SC_PLUGIN_IFUPDOWN (user_data); + const char *subsys; + + g_return_if_fail (action != NULL); + + /* A bit paranoid */ + subsys = g_udev_device_get_subsystem (device); + g_return_if_fail (subsys != NULL); + g_return_if_fail (strcmp (subsys, "net") == 0); + + if (!strcmp (action, "add")) + udev_device_added (self, device); + else if (!strcmp (action, "remove")) + udev_device_removed (self, device); +} + +static void +SCPluginIfupdown_init (NMSystemConfigInterface *config) +{ + SCPluginIfupdown *self = SC_PLUGIN_IFUPDOWN (config); + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (self); + GHashTable *auto_ifaces; + if_block *block = NULL; + NMInotifyHelper *inotify_helper; + GKeyFile* keyfile; + GError *error = NULL; + GList *keys, *iter; + const char *subsys[2] = { "net", NULL }; + + auto_ifaces = g_hash_table_new (g_str_hash, g_str_equal); + + if(!priv->iface_connections) + priv->iface_connections = g_hash_table_new (g_str_hash, g_str_equal); + + if(!priv->well_known_ifaces) + priv->well_known_ifaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + + if(!priv->well_known_interfaces) + priv->well_known_interfaces = g_hash_table_new (g_str_hash, g_str_equal); + + PLUGIN_PRINT("SCPlugin-Ifupdown", "init!"); + + priv->client = g_udev_client_new (subsys); + if (!priv->client) { + PLUGIN_WARN ("SCPlugin-Ifupdown", " error initializing libgudev"); + } else + g_signal_connect (priv->client, "uevent", G_CALLBACK (handle_uevent), self); + + priv->unmanage_well_known = IFUPDOWN_UNMANAGE_WELL_KNOWN_DEFAULT; + + inotify_helper = nm_inotify_helper_get (); + priv->inotify_event_id = g_signal_connect (inotify_helper, + "event", + G_CALLBACK (update_system_hostname), + config); + + priv->inotify_system_hostname_wd = + nm_inotify_helper_add_watch (inotify_helper, IFUPDOWN_SYSTEM_HOSTNAME_FILE); + + update_system_hostname (inotify_helper, NULL, NULL, config); + + /* Read in all the interfaces */ + ifparser_init (); + block = ifparser_getfirst (); + while (block) { + if(!strcmp ("auto", block->type) || !strcmp ("allow-hotplug", block->type)) + g_hash_table_insert (auto_ifaces, block->name, GUINT_TO_POINTER (1)); + else if (!strcmp ("iface", block->type) && strcmp ("lo", block->name)) { + NMIfupdownConnection *exported; + + /* Remove any connection for this block that was previously found */ + exported = g_hash_table_lookup (priv->iface_connections, block->name); + if (exported) { + nm_settings_connection_interface_delete (NM_SETTINGS_CONNECTION_INTERFACE (exported), + ignore_cb, + NULL); + g_hash_table_remove (priv->iface_connections, block->name); + } + + /* add the new connection */ + exported = nm_ifupdown_connection_new (block); + if (exported) { + g_hash_table_insert (priv->iface_connections, block->name, exported); + g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); + } + } else if (!strcmp ("mapping", block->type)) { + g_hash_table_insert (priv->well_known_interfaces, block->name, "known"); + } + block = block->next; + } + + /* Make 'auto' interfaces autoconnect=TRUE */ + keys = g_hash_table_get_keys (priv->iface_connections); + for (iter = keys; iter; iter = g_list_next (iter)) { + NMIfupdownConnection *exported; + NMSetting *setting; + + if (!g_hash_table_lookup (auto_ifaces, iter->data)) + continue; + + exported = g_hash_table_lookup (priv->iface_connections, iter->data); + setting = NM_SETTING (nm_connection_get_setting (NM_CONNECTION (exported), NM_TYPE_SETTING_CONNECTION)); + g_object_set (setting, NM_SETTING_CONNECTION_AUTOCONNECT, TRUE, NULL); + + nm_settings_connection_interface_update (NM_SETTINGS_CONNECTION_INTERFACE (exported), + ignore_cb, + NULL); + + PLUGIN_PRINT("SCPlugin-Ifupdown", "autoconnect"); + } + g_list_free (keys); + g_hash_table_destroy (auto_ifaces); + + /* Find the config file */ + if (g_file_test (IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE, G_FILE_TEST_EXISTS)) + priv->conf_file = IFUPDOWN_SYSTEM_SETTINGS_KEY_FILE; + else + priv->conf_file = IFUPDOWN_OLD_SYSTEM_SETTINGS_KEY_FILE; + + keyfile = g_key_file_new (); + if (!g_key_file_load_from_file (keyfile, + priv->conf_file, + G_KEY_FILE_NONE, + &error)) { + nm_info ("loading system config file (%s) caused error: (%d) %s", + priv->conf_file, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } else { + gboolean manage_well_known; + error = NULL; + + manage_well_known = g_key_file_get_boolean (keyfile, + IFUPDOWN_KEY_FILE_GROUP, + IFUPDOWN_KEY_FILE_KEY_MANAGED, + &error); + if (error) { + nm_info ("getting keyfile key '%s' in group '%s' failed: (%d) %s", + IFUPDOWN_KEY_FILE_GROUP, + IFUPDOWN_KEY_FILE_KEY_MANAGED, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } else + priv->unmanage_well_known = !manage_well_known; + } + PLUGIN_PRINT ("SCPluginIfupdown", "management mode: %s", priv->unmanage_well_known ? "unmanaged" : "managed"); + if (keyfile) + g_key_file_free (keyfile); + + /* Add well-known interfaces */ + keys = g_udev_client_query_by_subsystem (priv->client, "net"); + for (iter = keys; iter; iter = g_list_next (iter)) { + udev_device_added (self, G_UDEV_DEVICE (iter->data)); + g_object_unref (G_UDEV_DEVICE (iter->data)); + } + g_list_free (keys); + + /* Now if we're running in managed mode, let NM know there are new connections */ + if (!priv->unmanage_well_known) { + GList *con_list = g_hash_table_get_values (priv->iface_connections); + GList *cl_iter; + + for (cl_iter = con_list; cl_iter; cl_iter = g_list_next (cl_iter)) { + g_signal_emit_by_name (self, + NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, + NM_EXPORTED_CONNECTION (cl_iter->data)); + } + g_list_free (con_list); + } + + PLUGIN_PRINT("SCPlugin-Ifupdown", "end _init."); +} + + +/* Returns the plugins currently known list of connections. The returned + * list is freed by the system settings service. + */ +static GSList* +SCPluginIfupdown_get_connections (NMSystemConfigInterface *config) +{ + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (config); + GSList *connections = NULL; + GHashTableIter iter; + gpointer value; + + PLUGIN_PRINT("SCPlugin-Ifupdown", "(%d) ... get_connections.", GPOINTER_TO_UINT(config)); + + if(priv->unmanage_well_known) { + PLUGIN_PRINT("SCPlugin-Ifupdown", "(%d) ... get_connections (managed=false): return empty list.", GPOINTER_TO_UINT(config)); + return NULL; + } + + g_hash_table_iter_init (&iter, priv->iface_connections); + while (g_hash_table_iter_next (&iter, NULL, &value)) + connections = g_slist_prepend (connections, value); + + PLUGIN_PRINT("SCPlugin-Ifupdown", "(%d) connections count: %d", GPOINTER_TO_UINT(config), g_slist_length(connections)); + return connections; +} + +/* + * Return a list of device specifications which NetworkManager should not + * manage. Returned list will be freed by the system settings service, and + * each element must be allocated using g_malloc() or its variants. + */ +static GSList* +SCPluginIfupdown_get_unmanaged_specs (NMSystemConfigInterface *config) +{ + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (config); + GSList *specs = NULL; + GHashTableIter iter; + gpointer value; + + if (!ALWAYS_UNMANAGE && !priv->unmanage_well_known) + return NULL; + + PLUGIN_PRINT("Ifupdown", "get unmanaged devices count: %d", + g_hash_table_size (priv->well_known_ifaces)); + + g_hash_table_iter_init (&iter, priv->well_known_ifaces); + while (g_hash_table_iter_next (&iter, NULL, &value)) { + GUdevDevice *device = G_UDEV_DEVICE (value); + const char *address; + + address = g_udev_device_get_sysfs_attr (device, "address"); + if (address) + specs = g_slist_append (specs, g_strdup_printf ("mac:%s", address)); + } + return specs; +} + + +static const char * +get_hostname (NMSystemConfigInterface *config) +{ + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (config); + return priv->hostname; +} + +static void +update_system_hostname(NMInotifyHelper *inotify_helper, + struct inotify_event *evt, + const char *path, + NMSystemConfigInterface *config) +{ + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (config); + gchar *hostname_file = NULL; + gsize hostname_file_len = 0; + GError *error = NULL; + + PLUGIN_PRINT ("SCPlugin-Ifupdown", "update_system_hostname"); + + if (evt && evt->wd != priv->inotify_system_hostname_wd) + return; + + if(!g_file_get_contents ( IFUPDOWN_SYSTEM_HOSTNAME_FILE, + &hostname_file, + &hostname_file_len, + &error)) { + nm_warning ("update_system_hostname() - couldn't read " + IFUPDOWN_SYSTEM_HOSTNAME_FILE " (%d/%s)", + error->code, error->message); + return; + } + + if (priv->hostname) + g_free(priv->hostname); + + priv->hostname = g_strstrip(hostname_file); + + g_object_notify (G_OBJECT (config), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); +} + +static void +write_system_hostname(NMSystemConfigInterface *config, + const char *newhostname) +{ + GError *error = NULL; + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (config); + PLUGIN_PRINT ("SCPlugin-Ifupdown", "write_system_hostname: %s", newhostname); + + g_return_if_fail (newhostname); + + if(!g_file_set_contents ( IFUPDOWN_SYSTEM_HOSTNAME_FILE, + newhostname, + -1, + &error)) { + nm_warning ("update_system_hostname() - couldn't write hostname (%s) to " + IFUPDOWN_SYSTEM_HOSTNAME_FILE " (%d/%s)", + newhostname, error->code, error->message); + } else { + priv->hostname = g_strdup (newhostname); + } + g_object_notify (G_OBJECT (config), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); +} + + +static void +sc_plugin_ifupdown_init (SCPluginIfupdown *plugin) +{ +} + +static void +GObject__get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSystemConfigInterface *self = NM_SYSTEM_CONFIG_INTERFACE (object); + + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME: + g_value_set_string (value, IFUPDOWN_PLUGIN_NAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO: + g_value_set_string (value, IFUPDOWN_PLUGIN_INFO); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES: + g_value_set_uint (value, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + { + g_value_set_string (value, get_hostname(self)); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +GObject__set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + { + const gchar *hostname = g_value_get_string (value); + if (hostname && strlen (hostname) < 1) + hostname = NULL; + write_system_hostname(NM_SYSTEM_CONFIG_INTERFACE(object), + hostname); + break; + } + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +GObject__dispose (GObject *object) +{ + SCPluginIfupdown *plugin = SC_PLUGIN_IFUPDOWN (object); + SCPluginIfupdownPrivate *priv = SC_PLUGIN_IFUPDOWN_GET_PRIVATE (plugin); + NMInotifyHelper *inotify_helper = nm_inotify_helper_get (); + + g_signal_handler_disconnect (inotify_helper, priv->inotify_event_id); + + if (priv->inotify_system_hostname_wd >= 0) + nm_inotify_helper_remove_watch (inotify_helper, priv->inotify_system_hostname_wd); + + if (priv->well_known_ifaces) + g_hash_table_destroy(priv->well_known_ifaces); + + if (priv->well_known_interfaces) + g_hash_table_destroy(priv->well_known_interfaces); + + if (priv->client) + g_object_unref (priv->client); + + G_OBJECT_CLASS (sc_plugin_ifupdown_parent_class)->dispose (object); +} + +G_MODULE_EXPORT GObject * +nm_system_config_factory (void) +{ + static SCPluginIfupdown *singleton = NULL; + + if (!singleton) + singleton = SC_PLUGIN_IFUPDOWN (g_object_new (SC_TYPE_PLUGIN_IFUPDOWN, NULL)); + else + g_object_ref (singleton); + + return G_OBJECT (singleton); +} + diff --git a/system-settings/plugins/ifupdown/plugin.h b/system-settings/plugins/ifupdown/plugin.h new file mode 100644 index 00000000..09f8767a --- /dev/null +++ b/system-settings/plugins/ifupdown/plugin.h @@ -0,0 +1,53 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ + +/* NetworkManager system settings service (ifupdown) + * + * Alexander Sack + * + * 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 Canonical Ltd. + */ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +#include + +#define PLUGIN_NAME "ifupdown" + +#define SC_TYPE_PLUGIN_IFUPDOWN (sc_plugin_ifupdown_get_type ()) +#define SC_PLUGIN_IFUPDOWN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IFUPDOWN, SCPluginIfupdown)) +#define SC_PLUGIN_IFUPDOWN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IFUPDOWN, SCPluginIfupdownClass)) +#define SC_IS_PLUGIN_IFUPDOWN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IFUPDOWN)) +#define SC_IS_PLUGIN_IFUPDOWN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SC_TYPE_PLUGIN_IFUPDOWN)) +#define SC_PLUGIN_IFUPDOWN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IFUPDOWN, SCPluginIfupdownClass)) + +typedef struct _SCPluginIfupdown SCPluginIfupdown; +typedef struct _SCPluginIfupdownClass SCPluginIfupdownClass; + +struct _SCPluginIfupdown { + GObject parent; +}; + +struct _SCPluginIfupdownClass { + GObjectClass parent; +}; + +GType sc_plugin_ifupdown_get_type (void); + +GQuark ifupdown_plugin_error_quark (void); + +#endif /* _PLUGIN_H_ */ diff --git a/system-settings/plugins/keyfile/Makefile.am b/system-settings/plugins/keyfile/Makefile.am new file mode 100644 index 00000000..ca4d3cd3 --- /dev/null +++ b/system-settings/plugins/keyfile/Makefile.am @@ -0,0 +1,40 @@ +SUBDIRS=io tests + +INCLUDES = \ + -I$(top_srcdir)/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/system-settings/plugins/keyfile/io + +pkglib_LTLIBRARIES = libnm-settings-plugin-keyfile.la + +libnm_settings_plugin_keyfile_la_SOURCES = \ + nm-keyfile-connection.c \ + nm-keyfile-connection.h \ + plugin.c \ + plugin.h + +keyfiledir=$(sysconfdir)/NetworkManager/system-connections + +libnm_settings_plugin_keyfile_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DG_DISABLE_DEPRECATED \ + -DKEYFILE_DIR=\""$(keyfiledir)"\" + +libnm_settings_plugin_keyfile_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_keyfile_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(DBUS_LIBS) \ + $(GIO_LIBS) + +install-data-hook: + $(mkinstalldirs) -m 0755 $(DESTDIR)$(keyfiledir) + diff --git a/system-settings/plugins/keyfile/Makefile.in b/system-settings/plugins/keyfile/Makefile.in new file mode 100644 index 00000000..7462151b --- /dev/null +++ b/system-settings/plugins/keyfile/Makefile.in @@ -0,0 +1,801 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = system-settings/plugins/keyfile +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libnm_settings_plugin_keyfile_la_DEPENDENCIES = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libnm_settings_plugin_keyfile_la_OBJECTS = \ + libnm_settings_plugin_keyfile_la-nm-keyfile-connection.lo \ + libnm_settings_plugin_keyfile_la-plugin.lo +libnm_settings_plugin_keyfile_la_OBJECTS = \ + $(am_libnm_settings_plugin_keyfile_la_OBJECTS) +libnm_settings_plugin_keyfile_la_LINK = $(LIBTOOL) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) \ + $(libnm_settings_plugin_keyfile_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnm_settings_plugin_keyfile_la_SOURCES) +DIST_SOURCES = $(libnm_settings_plugin_keyfile_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = io tests +INCLUDES = \ + -I$(top_srcdir)/src/system-settings \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/system-settings/plugins/keyfile/io + +pkglib_LTLIBRARIES = libnm-settings-plugin-keyfile.la +libnm_settings_plugin_keyfile_la_SOURCES = \ + nm-keyfile-connection.c \ + nm-keyfile-connection.h \ + plugin.c \ + plugin.h + +keyfiledir = $(sysconfdir)/NetworkManager/system-connections +libnm_settings_plugin_keyfile_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(GMODULE_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DG_DISABLE_DEPRECATED \ + -DKEYFILE_DIR=\""$(keyfiledir)"\" + +libnm_settings_plugin_keyfile_la_LDFLAGS = -module -avoid-version +libnm_settings_plugin_keyfile_la_LIBADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(DBUS_LIBS) \ + $(GIO_LIBS) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/keyfile/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/keyfile/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnm-settings-plugin-keyfile.la: $(libnm_settings_plugin_keyfile_la_OBJECTS) $(libnm_settings_plugin_keyfile_la_DEPENDENCIES) + $(libnm_settings_plugin_keyfile_la_LINK) -rpath $(pkglibdir) $(libnm_settings_plugin_keyfile_la_OBJECTS) $(libnm_settings_plugin_keyfile_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_keyfile_la-nm-keyfile-connection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_settings_plugin_keyfile_la-plugin.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnm_settings_plugin_keyfile_la-nm-keyfile-connection.lo: nm-keyfile-connection.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_keyfile_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_keyfile_la-nm-keyfile-connection.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_keyfile_la-nm-keyfile-connection.Tpo -c -o libnm_settings_plugin_keyfile_la-nm-keyfile-connection.lo `test -f 'nm-keyfile-connection.c' || echo '$(srcdir)/'`nm-keyfile-connection.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_keyfile_la-nm-keyfile-connection.Tpo $(DEPDIR)/libnm_settings_plugin_keyfile_la-nm-keyfile-connection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nm-keyfile-connection.c' object='libnm_settings_plugin_keyfile_la-nm-keyfile-connection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_keyfile_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_keyfile_la-nm-keyfile-connection.lo `test -f 'nm-keyfile-connection.c' || echo '$(srcdir)/'`nm-keyfile-connection.c + +libnm_settings_plugin_keyfile_la-plugin.lo: plugin.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_keyfile_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnm_settings_plugin_keyfile_la-plugin.lo -MD -MP -MF $(DEPDIR)/libnm_settings_plugin_keyfile_la-plugin.Tpo -c -o libnm_settings_plugin_keyfile_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_settings_plugin_keyfile_la-plugin.Tpo $(DEPDIR)/libnm_settings_plugin_keyfile_la-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plugin.c' object='libnm_settings_plugin_keyfile_la-plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnm_settings_plugin_keyfile_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnm_settings_plugin_keyfile_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-data-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-pkglibLTLIBRARIES ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-hook install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkglibLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +install-data-hook: + $(mkinstalldirs) -m 0755 $(DESTDIR)$(keyfiledir) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/keyfile/io/Makefile.am b/system-settings/plugins/keyfile/io/Makefile.am new file mode 100644 index 00000000..9333c509 --- /dev/null +++ b/system-settings/plugins/keyfile/io/Makefile.am @@ -0,0 +1,20 @@ +INCLUDES = \ + -I$(top_srcdir)/system-settings/src \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib + +noinst_LTLIBRARIES = libkeyfile-io.la + +libkeyfile_io_la_SOURCES = \ + reader.h \ + reader.c \ + writer.h \ + writer.c + +libkeyfile_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +libkeyfile_io_la_LIBADD = $(GLIB_LIBS) + diff --git a/system-settings/plugins/keyfile/io/Makefile.in b/system-settings/plugins/keyfile/io/Makefile.in new file mode 100644 index 00000000..06084a6c --- /dev/null +++ b/system-settings/plugins/keyfile/io/Makefile.in @@ -0,0 +1,569 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = system-settings/plugins/keyfile/io +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libkeyfile_io_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libkeyfile_io_la_OBJECTS = libkeyfile_io_la-reader.lo \ + libkeyfile_io_la-writer.lo +libkeyfile_io_la_OBJECTS = $(am_libkeyfile_io_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libkeyfile_io_la_SOURCES) +DIST_SOURCES = $(libkeyfile_io_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = \ + -I$(top_srcdir)/system-settings/src \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib + +noinst_LTLIBRARIES = libkeyfile-io.la +libkeyfile_io_la_SOURCES = \ + reader.h \ + reader.c \ + writer.h \ + writer.c + +libkeyfile_io_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) + +libkeyfile_io_la_LIBADD = $(GLIB_LIBS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/keyfile/io/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/keyfile/io/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libkeyfile-io.la: $(libkeyfile_io_la_OBJECTS) $(libkeyfile_io_la_DEPENDENCIES) + $(LINK) $(libkeyfile_io_la_OBJECTS) $(libkeyfile_io_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkeyfile_io_la-reader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkeyfile_io_la-writer.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libkeyfile_io_la-reader.lo: reader.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyfile_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkeyfile_io_la-reader.lo -MD -MP -MF $(DEPDIR)/libkeyfile_io_la-reader.Tpo -c -o libkeyfile_io_la-reader.lo `test -f 'reader.c' || echo '$(srcdir)/'`reader.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libkeyfile_io_la-reader.Tpo $(DEPDIR)/libkeyfile_io_la-reader.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reader.c' object='libkeyfile_io_la-reader.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyfile_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkeyfile_io_la-reader.lo `test -f 'reader.c' || echo '$(srcdir)/'`reader.c + +libkeyfile_io_la-writer.lo: writer.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyfile_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libkeyfile_io_la-writer.lo -MD -MP -MF $(DEPDIR)/libkeyfile_io_la-writer.Tpo -c -o libkeyfile_io_la-writer.lo `test -f 'writer.c' || echo '$(srcdir)/'`writer.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libkeyfile_io_la-writer.Tpo $(DEPDIR)/libkeyfile_io_la-writer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='writer.c' object='libkeyfile_io_la-writer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyfile_io_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libkeyfile_io_la-writer.lo `test -f 'writer.c' || echo '$(srcdir)/'`writer.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/keyfile/io/reader.c b/system-settings/plugins/keyfile/io/reader.c new file mode 100644 index 00000000..5582733f --- /dev/null +++ b/system-settings/plugins/keyfile/io/reader.c @@ -0,0 +1,1085 @@ +/* -*- 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 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-dbus-glib-types.h" +#include "reader.h" + +static gboolean +read_array_of_uint (GKeyFile *file, + NMSetting *setting, + const char *key) +{ + GArray *array = NULL; + gsize length; + int i; + gint *tmp; + + tmp = g_key_file_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]); + + if (array) { + g_object_set (setting, key, array, NULL); + g_array_free (array, TRUE); + } + + return TRUE; +} + +static gboolean +get_one_int (const char *str, guint32 max_val, const char *key_name, guint32 *out) +{ + long tmp; + + errno = 0; + tmp = strtol (str, NULL, 10); + if (errno || (tmp < 0) || (tmp > max_val)) { + g_warning ("%s: ignoring invalid IP %s item '%s'", __func__, key_name, str); + return FALSE; + } + + *out = (guint32) tmp; + return TRUE; +} + +static void +free_one_ip4_address (gpointer data, gpointer user_data) +{ + g_array_free ((GArray *) data, TRUE); +} + +static GPtrArray * +read_ip4_addresses (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *addresses; + int i = 0; + + addresses = g_ptr_array_sized_new (3); + + /* Look for individual addresses */ + while (i++ < 1000) { + gchar **tmp, **iter; + char *key_name; + gsize length = 0; + int ret; + GArray *address; + guint32 empty = 0; + int j; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); + g_free (key_name); + + if (!tmp || !length) + break; /* all done */ + + if ((length < 2) || (length > 3)) { + g_warning ("%s: ignoring invalid IPv4 address item '%s'", __func__, key_name); + goto next; + } + + /* convert the string array into IP addresses */ + address = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 3); + for (iter = tmp, j = 0; *iter; iter++, j++) { + struct in_addr addr; + + if (j == 1) { + guint32 prefix = 0; + + /* prefix */ + if (!get_one_int (*iter, 32, key_name, &prefix)) { + g_array_free (address, TRUE); + goto next; + } + + g_array_append_val (address, prefix); + } else { + /* address and gateway */ + ret = inet_pton (AF_INET, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv4 %s element '%s'", __func__, key_name, *iter); + g_array_free (address, TRUE); + goto next; + } + g_array_append_val (address, addr.s_addr); + } + } + + /* fill in blank gateway if not specified */ + if (address->len == 2) + g_array_append_val (address, empty); + + g_ptr_array_add (addresses, address); + +next: + g_strfreev (tmp); + } + + if (addresses->len < 1) { + g_ptr_array_free (addresses, TRUE); + addresses = NULL; + } + + return addresses; +} + +static void +ip4_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *addresses; + const char *setting_name = nm_setting_get_name (setting); + + addresses = read_ip4_addresses (keyfile, setting_name, key); + + /* Work around for previous syntax */ + if (!addresses && !strcmp (key, NM_SETTING_IP4_CONFIG_ADDRESSES)) + addresses = read_ip4_addresses (keyfile, setting_name, "address"); + + if (addresses) { + g_object_set (setting, key, addresses, NULL); + g_ptr_array_foreach (addresses, free_one_ip4_address, NULL); + g_ptr_array_free (addresses, TRUE); + } +} + +static void +free_one_ip4_route (gpointer data, gpointer user_data) +{ + g_array_free ((GArray *) data, TRUE); +} + +static GPtrArray * +read_ip4_routes (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *routes; + int i = 0; + + routes = g_ptr_array_sized_new (3); + + /* Look for individual routes */ + while (i++ < 1000) { + gchar **tmp, **iter; + char *key_name; + gsize length = 0; + int ret; + GArray *route; + int j; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); + g_free (key_name); + + if (!tmp || !length) + break; /* all done */ + + if (length != 4) { + g_warning ("%s: ignoring invalid IPv4 route item '%s'", __func__, key_name); + goto next; + } + + /* convert the string array into IP addresses */ + route = g_array_sized_new (FALSE, TRUE, sizeof (guint32), 4); + for (iter = tmp, j = 0; *iter; iter++, j++) { + struct in_addr addr; + + if (j == 1) { + guint32 prefix = 0; + + /* prefix */ + if (!get_one_int (*iter, 32, key_name, &prefix)) { + g_array_free (route, TRUE); + goto next; + } + + g_array_append_val (route, prefix); + } else if (j == 3) { + guint32 metric = 0; + + /* metric */ + if (!get_one_int (*iter, G_MAXUINT32, key_name, &metric)) { + g_array_free (route, TRUE); + goto next; + } + + g_array_append_val (route, metric); + } else { + /* address and next hop */ + ret = inet_pton (AF_INET, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv4 %s element '%s'", __func__, key_name, *iter); + g_array_free (route, TRUE); + goto next; + } + g_array_append_val (route, addr.s_addr); + } + } + g_ptr_array_add (routes, route); + +next: + g_strfreev (tmp); + } + + if (routes->len < 1) { + g_ptr_array_free (routes, TRUE); + routes = NULL; + } + + return routes; +} + +static void +ip4_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *routes; + const char *setting_name = nm_setting_get_name (setting); + + routes = read_ip4_routes (keyfile, setting_name, key); + if (routes) { + g_object_set (setting, key, routes, NULL); + g_ptr_array_foreach (routes, free_one_ip4_route, NULL); + g_ptr_array_free (routes, TRUE); + } +} + +static void +ip4_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + const char *setting_name = nm_setting_get_name (setting); + GArray *array = NULL; + gsize length; + char **list, **iter; + int ret; + + list = g_key_file_get_string_list (keyfile, setting_name, key, &length, NULL); + if (!list || !g_strv_length (list)) + return; + + array = g_array_sized_new (FALSE, FALSE, sizeof (guint32), length); + for (iter = list; *iter; iter++) { + struct in_addr addr; + + ret = inet_pton (AF_INET, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid DNS server address '%s'", __func__, *iter); + continue; + } + + g_array_append_val (array, addr.s_addr); + } + g_strfreev (list); + + if (array) { + g_object_set (setting, key, array, NULL); + g_array_free (array, TRUE); + } +} + +static void +free_one_ip6_address (gpointer data, gpointer user_data) +{ + g_value_array_free ((GValueArray *) data); +} + +static char * +split_prefix (char *addr) +{ + char *slash; + + g_return_val_if_fail (addr != NULL, NULL); + + /* Find the prefix and split the string */ + slash = strchr (addr, '/'); + if (slash && slash > addr) { + slash++; + *(slash - 1) = '\0'; + } + + return slash; +} + +static char * +split_gw (char *str) +{ + char *comma; + + g_return_val_if_fail (str != NULL, NULL); + + /* Find the prefix and split the string */ + comma = strchr (str, ','); + if (comma && comma > str) { + comma++; + *(comma - 1) = '\0'; + return comma; + } + return NULL; +} + +static GPtrArray * +read_ip6_addresses (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *addresses; + struct in6_addr addr, gw; + guint32 prefix; + int i = 0; + + addresses = g_ptr_array_sized_new (3); + + /* Look for individual addresses */ + while (i++ < 1000) { + char *tmp, *key_name, *str_prefix, *str_gw; + int ret; + GValueArray *values; + GByteArray *address; + GByteArray *gateway; + GValue value = { 0 }; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string (file, setting_name, key_name, NULL); + g_free (key_name); + + if (!tmp) + break; /* all done */ + + /* convert the string array into IPv6 addresses */ + values = g_value_array_new (2); /* NMIP6Address has 2 items */ + + /* Split the address and prefix */ + str_prefix = split_prefix (tmp); + + /* address */ + ret = inet_pton (AF_INET6, tmp, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp); + g_value_array_free (values); + goto next; + } + + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* prefix */ + prefix = 0; + if (str_prefix) { + if (!get_one_int (str_prefix, 128, key_name, &prefix)) { + g_value_array_free (values); + goto next; + } + } else { + /* Missing prefix defaults to /64 */ + prefix = 64; + } + + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, prefix); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* Gateway (optional) */ + str_gw = split_gw (str_prefix); + if (str_gw) { + ret = inet_pton (AF_INET6, str_gw, &gw); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s gateway '%s'", __func__, key_name, tmp); + g_value_array_free (values); + goto next; + } + + if (!IN6_IS_ADDR_UNSPECIFIED (&gw)) { + gateway = g_byte_array_new (); + g_byte_array_append (gateway, (guint8 *) gw.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, gateway); + g_value_array_append (values, &value); + g_value_unset (&value); + } + } + + g_ptr_array_add (addresses, values); + +next: + g_free (tmp); + } + + if (addresses->len < 1) { + g_ptr_array_free (addresses, TRUE); + addresses = NULL; + } + + return addresses; +} + +static void +ip6_addr_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *addresses; + const char *setting_name = nm_setting_get_name (setting); + + addresses = read_ip6_addresses (keyfile, setting_name, key); + if (addresses) { + g_object_set (setting, key, addresses, NULL); + g_ptr_array_foreach (addresses, free_one_ip6_address, NULL); + g_ptr_array_free (addresses, TRUE); + } +} + +static void +free_one_ip6_route (gpointer data, gpointer user_data) +{ + g_value_array_free ((GValueArray *) data); +} + +static GPtrArray * +read_ip6_routes (GKeyFile *file, + const char *setting_name, + const char *key) +{ + GPtrArray *routes; + struct in6_addr addr; + guint32 prefix, metric; + int i = 0; + + routes = g_ptr_array_sized_new (3); + + /* Look for individual routes */ + while (i++ < 1000) { + gchar **tmp; + char *key_name, *str_prefix; + gsize length = 0; + int ret; + GValueArray *values; + GByteArray *address; + GValue value = { 0 }; + + key_name = g_strdup_printf ("%s%d", key, i); + tmp = g_key_file_get_string_list (file, setting_name, key_name, &length, NULL); + g_free (key_name); + + if (!tmp || !length) + break; /* all done */ + + if (length != 3) { + g_warning ("%s: ignoring invalid IPv6 address item '%s'", __func__, key_name); + goto next; + } + + /* convert the string array into IPv6 routes */ + values = g_value_array_new (4); /* NMIP6Route has 4 items */ + + /* Split the route and prefix */ + str_prefix = split_prefix (tmp[0]); + + /* destination address */ + ret = inet_pton (AF_INET6, tmp[0], &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp[0]); + g_value_array_free (values); + goto next; + } + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* prefix */ + prefix = 0; + if (str_prefix) { + if (!get_one_int (str_prefix, 128, key_name, &prefix)) { + g_value_array_free (values); + goto next; + } + } else { + /* default to 64 if unspecified */ + prefix = 64; + } + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, prefix); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* next hop address */ + ret = inet_pton (AF_INET6, tmp[1], &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid IPv6 %s element '%s'", __func__, key_name, tmp[1]); + g_value_array_free (values); + goto next; + } + address = g_byte_array_new (); + g_byte_array_append (address, (guint8 *) addr.s6_addr, 16); + g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); + g_value_take_boxed (&value, address); + g_value_array_append (values, &value); + g_value_unset (&value); + + /* metric */ + metric = 0; + if (!get_one_int (tmp[2], G_MAXUINT32, key_name, &metric)) { + g_value_array_free (values); + goto next; + } + g_value_init (&value, G_TYPE_UINT); + g_value_set_uint (&value, metric); + g_value_array_append (values, &value); + g_value_unset (&value); + + g_ptr_array_add (routes, values); + +next: + g_strfreev (tmp); + } + + if (routes->len < 1) { + g_ptr_array_free (routes, TRUE); + routes = NULL; + } + + return routes; +} + +static void +ip6_route_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + GPtrArray *routes; + const char *setting_name = nm_setting_get_name (setting); + + routes = read_ip6_routes (keyfile, setting_name, key); + + if (routes) { + g_object_set (setting, key, routes, NULL); + g_ptr_array_foreach (routes, free_one_ip6_route, NULL); + g_ptr_array_free (routes, TRUE); + } +} + +static void +free_one_ip6_dns (gpointer data, gpointer user_data) +{ + g_byte_array_free ((GByteArray *) data, TRUE); +} + +static void +ip6_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + const char *setting_name = nm_setting_get_name (setting); + GPtrArray *array = NULL; + gsize length; + char **list, **iter; + int ret; + + list = g_key_file_get_string_list (keyfile, setting_name, key, &length, NULL); + if (!list || !g_strv_length (list)) + return; + + array = g_ptr_array_sized_new (length); + for (iter = list; *iter; iter++) { + GByteArray *byte_array; + struct in6_addr addr; + + ret = inet_pton (AF_INET6, *iter, &addr); + if (ret <= 0) { + g_warning ("%s: ignoring invalid DNS server IPv6 address '%s'", __func__, *iter); + continue; + } + byte_array = g_byte_array_new (); + g_byte_array_append (byte_array, (guint8 *) addr.s6_addr, 16); + + g_ptr_array_add (array, byte_array); + } + g_strfreev (list); + + if (array) { + g_object_set (setting, key, array, NULL); + g_ptr_array_foreach (array, free_one_ip6_dns, NULL); + g_ptr_array_free (array, TRUE); + } +} + +static void +mac_address_parser (NMSetting *setting, const char *key, GKeyFile *keyfile) +{ + const char *setting_name = nm_setting_get_name (setting); + struct ether_addr *eth; + char *tmp_string = NULL, *p; + gint *tmp_list; + GByteArray *array = NULL; + gsize length; + int i; + + p = tmp_string = g_key_file_get_string (keyfile, setting_name, key, NULL); + if (tmp_string) { + /* Look for enough ':' characters to signify a MAC address */ + i = 0; + while (*p) { + if (*p == ':') + i++; + p++; + } + if (i == 5) { + /* parse as a MAC address */ + eth = ether_aton (tmp_string); + if (eth) { + g_free (tmp_string); + array = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (array, eth->ether_addr_octet, ETH_ALEN); + goto done; + } + } + } + g_free (tmp_string); + + /* Old format; list of ints */ + tmp_list = g_key_file_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) { + g_warning ("%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); + +done: + if (array->len == ETH_ALEN) { + g_object_set (setting, key, array, NULL); + } else { + g_warning ("%s: ignoring invalid MAC address for %s / %s", + __func__, setting_name, key); + } + g_byte_array_free (array, TRUE); +} + +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 = g_key_file_get_keys (file, setting_name, NULL, NULL); + if (!keys || !*keys) + return; + + for (iter = keys; *iter; iter++) { + value = g_key_file_get_string (file, setting_name, *iter, NULL); + if (!value) + continue; + + if (NM_IS_SETTING_VPN (setting)) { + if (strcmp (*iter, NM_SETTING_VPN_SERVICE_TYPE)) + nm_setting_vpn_add_data_item (NM_SETTING_VPN (setting), *iter, value); + } + g_free (value); + } + g_strfreev (keys); +} + + +typedef struct { + const char *setting_name; + const char *key; + gboolean check_for_key; + void (*parser) (NMSetting *setting, const char *key, GKeyFile *keyfile); +} KeyParser; + +/* A table of keys that require further parsing/conversion becuase 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_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES, + FALSE, + ip4_addr_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES, + FALSE, + ip6_addr_parser }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ROUTES, + FALSE, + ip4_route_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES, + FALSE, + ip6_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 }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS, + TRUE, + mac_address_parser }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID, + TRUE, + mac_address_parser }, + { NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR, + TRUE, + mac_address_parser }, + { NULL, NULL, FALSE } +}; + +static void +read_one_setting_value (NMSetting *setting, + const char *key, + const GValue *value, + GParamFlags flags, + gpointer user_data) +{ + GKeyFile *file = 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; + + /* 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 && !g_key_file_has_key (file, setting_name, key, &err)) { + /* Key doesn't exist or an error ocurred, thus nothing to do. */ + if (err) { + g_warning ("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 && parser->setting_name) { + (*parser->parser) (setting, key, file); + return; + } + + type = G_VALUE_TYPE (value); + + if (type == G_TYPE_STRING) { + char *str_val; + + str_val = g_key_file_get_string (file, 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 = g_key_file_get_integer (file, setting_name, key, NULL); + if (int_val < 0) + g_warning ("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 = g_key_file_get_integer (file, setting_name, key, NULL); + g_object_set (setting, key, int_val, NULL); + } else if (type == G_TYPE_BOOLEAN) { + gboolean bool_val; + + bool_val = g_key_file_get_boolean (file, setting_name, key, NULL); + g_object_set (setting, key, bool_val, NULL); + } else if (type == G_TYPE_CHAR) { + int int_val; + + int_val = g_key_file_get_integer (file, setting_name, key, NULL); + if (int_val < G_MININT8 || int_val > G_MAXINT8) + g_warning ("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 = g_key_file_get_value (file, 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 == DBUS_TYPE_G_UCHAR_ARRAY) { + gint *tmp; + GByteArray *array; + gsize length; + int i; + + tmp = g_key_file_get_integer_list (file, 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) { + g_warning ("%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_object_set (setting, key, array, NULL); + g_byte_array_free (array, TRUE); + g_free (tmp); + } else if (type == DBUS_TYPE_G_LIST_OF_STRING) { + gchar **sa; + gsize length; + int i; + GSList *list = NULL; + + sa = g_key_file_get_string_list (file, setting_name, key, &length, NULL); + for (i = 0; i < length; i++) + list = g_slist_prepend (list, sa[i]); + + list = g_slist_reverse (list); + g_object_set (setting, key, list, NULL); + + g_slist_free (list); + g_strfreev (sa); + } else if (type == DBUS_TYPE_G_MAP_OF_STRING) { + read_hash_of_string (file, setting, key); + } else if (type == DBUS_TYPE_G_UINT_ARRAY) { + if (!read_array_of_uint (file, setting, key)) { + g_warning ("Unhandled setting property type (read): '%s/%s' : '%s'", + setting_name, key, G_VALUE_TYPE_NAME (value)); + } + } else { + g_warning ("Unhandled setting property type (read): '%s/%s' : '%s'", + setting_name, key, G_VALUE_TYPE_NAME (value)); + } +} + +static NMSetting * +read_setting (GKeyFile *file, const char *name) +{ + NMSetting *setting; + + setting = nm_connection_create_setting (name); + if (setting) + nm_setting_enumerate_values (setting, read_one_setting_value, (gpointer) file); + else + g_warning ("Invalid setting name '%s'", name); + + return setting; +} + +static void +read_vpn_secrets (GKeyFile *file, NMSettingVPN *s_vpn) +{ + char **keys, **iter; + + keys = g_key_file_get_keys (file, VPN_SECRETS_GROUP, NULL, NULL); + for (iter = keys; *iter; iter++) { + char *secret; + + secret = g_key_file_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 * +connection_from_file (const char *filename) +{ + GKeyFile *key_file; + struct stat statbuf; + gboolean bad_owner, bad_permissions; + NMConnection *connection = NULL; + GError *err = NULL; + + if (stat (filename, &statbuf) != 0 || !S_ISREG (statbuf.st_mode)) + return NULL; + + bad_owner = getuid () != statbuf.st_uid; + bad_permissions = statbuf.st_mode & 0077; + + if (bad_owner || bad_permissions) { + g_warning ("Ignoring insecure configuration file '%s'", filename); + return NULL; + } + + key_file = g_key_file_new (); + if (g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &err)) { + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + NMSetting *setting; + gchar **groups; + gsize length; + int i; + gboolean vpn_secrets = FALSE; + const char *ctype, *tmp; + + connection = nm_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, groups[i]); + if (setting) + nm_connection_add_setting (connection, setting); + } + + /* Make sure that we have the base device type setting even if + * the keyfile didn't include it, which can happen when the base + * device type setting is all default values (like ethernet). + */ + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) { + ctype = nm_setting_connection_get_connection_type (s_con); + setting = nm_connection_get_setting_by_name (connection, ctype); + if (ctype) { + gboolean add_serial = FALSE; + NMSetting *new_setting = NULL; + + if (!setting && !strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME)) + new_setting = nm_setting_wired_new (); + else if (!strcmp (ctype, NM_SETTING_BLUETOOTH_SETTING_NAME)) { + s_bt = (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + if (s_bt) { + tmp = nm_setting_bluetooth_get_connection_type (s_bt); + if (tmp && !strcmp (tmp, NM_SETTING_BLUETOOTH_TYPE_DUN)) + add_serial = TRUE; + } + } else if (!strcmp (ctype, NM_SETTING_GSM_SETTING_NAME)) + add_serial = TRUE; + else if (!strcmp (ctype, NM_SETTING_CDMA_SETTING_NAME)) + add_serial = TRUE; + + /* Bluetooth DUN, GSM, and CDMA connections require a serial setting */ + if (add_serial && !nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) + new_setting = nm_setting_serial_new (); + + if (new_setting) + nm_connection_add_setting (connection, new_setting); + } + } + + /* Serial connections require a PPP setting too */ + if (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)) { + if (!nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)) + nm_connection_add_setting (connection, nm_setting_ppp_new ()); + } + + /* Handle vpn secrets after the 'vpn' setting was read */ + if (vpn_secrets) { + NMSettingVPN *s_vpn; + + s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); + if (s_vpn) + read_vpn_secrets (key_file, s_vpn); + } + + g_strfreev (groups); + } else { + g_warning ("Error parsing file '%s': %s", filename, err->message); + g_error_free (err); + } + + g_key_file_free (key_file); + + return connection; +} diff --git a/system-settings/plugins/keyfile/io/reader.h b/system-settings/plugins/keyfile/io/reader.h new file mode 100644 index 00000000..beac866a --- /dev/null +++ b/system-settings/plugins/keyfile/io/reader.h @@ -0,0 +1,32 @@ +/* -*- 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 Red Hat, Inc. + */ + +#ifndef _KEYFILE_PLUGIN_READER_H +#define _KEYFILE_PLUGIN_READER_H + +#define VPN_SECRETS_GROUP "vpn-secrets" + +#include +#include + +NMConnection *connection_from_file (const char *filename); + +#endif /* _KEYFILE_PLUGIN_READER_H */ diff --git a/system-settings/plugins/keyfile/io/writer.c b/system-settings/plugins/keyfile/io/writer.c new file mode 100644 index 00000000..348fa515 --- /dev/null +++ b/system-settings/plugins/keyfile/io/writer.c @@ -0,0 +1,691 @@ +/* -*- 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 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-dbus-glib-types.h" +#include "writer.h" +#include "reader.h" + +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); + + g_key_file_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, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GArray *array; + char **list; + int i, num = 0; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_UINT_ARRAY)); + + array = (GArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + list = g_new0 (char *, array->len + 1); + + for (i = 0; i < array->len; i++) { + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + + addr.s_addr = g_array_index (array, guint32, i); + if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (addr.s_addr)); + } else + list[num++] = g_strdup (buf); + } + + g_key_file_set_string_list (file, nm_setting_get_name (setting), key, (const char **) list, num); + g_strfreev (list); +} + +static void +write_ip4_values (GKeyFile *file, + const char *setting_name, + const char *key, + GPtrArray *array, + guint32 tuple_len, + guint32 addr1_pos, + guint32 addr2_pos) +{ + char **list = NULL; + int i, j; + + list = g_new (char *, tuple_len); + + for (i = 0, j = 0; i < array->len; i++, j++) { + GArray *tuple = g_ptr_array_index (array, i); + gboolean success = TRUE; + char *key_name; + int k; + + memset (list, 0, tuple_len * sizeof (char *)); + + for (k = 0; k < tuple_len; k++) { + if (k == addr1_pos || k == addr2_pos) { + char buf[INET_ADDRSTRLEN + 1]; + struct in_addr addr; + + /* IP addresses */ + addr.s_addr = g_array_index (tuple, guint32, k); + if (!inet_ntop (AF_INET, &addr, buf, sizeof (buf))) { + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (addr.s_addr)); + success = FALSE; + break; + } else { + list[k] = g_strdup (buf); + } + } else { + /* prefix, metric */ + list[k] = g_strdup_printf ("%d", g_array_index (tuple, guint32, k)); + } + } + + if (success) { + key_name = g_strdup_printf ("%s%d", key, j + 1); + g_key_file_set_string_list (file, setting_name, key_name, (const char **) list, tuple_len); + g_free (key_name); + } + + for (k = 0; k < tuple_len; k++) + g_free (list[k]); + } + g_free (list); +} + +static void +ip4_addr_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (array && array->len) + write_ip4_values (file, setting_name, key, array, 3, 0, 2); +} + +static void +ip4_route_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (array && array->len) + write_ip4_values (file, setting_name, key, array, 4, 0, 2); +} + +static void +ip6_dns_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + GByteArray *byte_array; + char **list; + int i, num = 0; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + list = g_new0 (char *, array->len + 1); + + for (i = 0; i < array->len; i++) { + char buf[INET6_ADDRSTRLEN]; + + byte_array = g_ptr_array_index (array, i); + if (!inet_ntop (AF_INET6, (struct in6_addr *) byte_array->data, buf, sizeof (buf))) { + int j; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", byte_array->data[0]); + for (j = 1; j < 16; j++) + g_string_append_printf (ip6_str, " %02X", byte_array->data[j]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + } else + list[num++] = g_strdup (buf); + } + + g_key_file_set_string_list (file, nm_setting_get_name (setting), key, (const char **) list, num); + g_strfreev (list); +} + +static gboolean +ip6_array_to_addr (GValueArray *values, + guint32 idx, + char *buf, + size_t buflen, + gboolean *out_is_unspec) +{ + GByteArray *byte_array; + GValue *addr_val; + struct in6_addr *addr; + + g_return_val_if_fail (buflen >= INET6_ADDRSTRLEN, FALSE); + + addr_val = g_value_array_get_nth (values, idx); + byte_array = g_value_get_boxed (addr_val); + addr = (struct in6_addr *) byte_array->data; + + if (out_is_unspec && IN6_IS_ADDR_UNSPECIFIED (addr)) + *out_is_unspec = TRUE; + + errno = 0; + if (!inet_ntop (AF_INET6, addr, buf, buflen)) { + GString *ip6_str = g_string_sized_new (INET6_ADDRSTRLEN + 10); + + /* error converting the address */ + g_string_append_printf (ip6_str, "%02X", byte_array->data[0]); + for (idx = 1; idx < 16; idx++) + g_string_append_printf (ip6_str, " %02X", byte_array->data[idx]); + nm_warning ("%s: error %d converting IP6 address %s", + __func__, errno, ip6_str->str); + g_string_free (ip6_str, TRUE); + return FALSE; + } + + return TRUE; +} + +static char * +ip6_array_to_addr_prefix (GValueArray *values) +{ + GValue *prefix_val; + char *ret = NULL; + GString *ip6_str; + char buf[INET6_ADDRSTRLEN + 1]; + gboolean is_unspec = FALSE; + + /* address */ + if (ip6_array_to_addr (values, 0, buf, sizeof (buf), NULL)) { + /* 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); + prefix_val = g_value_array_get_nth (values, 1); + g_string_append_printf (ip6_str, "/%u", g_value_get_uint (prefix_val)); + + if (ip6_array_to_addr (values, 2, buf, sizeof (buf), &is_unspec)) { + if (!is_unspec) + g_string_append_printf (ip6_str, ",%s", buf); + } + + ret = ip6_str->str; + g_string_free (ip6_str, FALSE); + } + + return ret; +} + +static void +ip6_addr_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + int i, j; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + for (i = 0, j = 1; i < array->len; i++) { + GValueArray *values = g_ptr_array_index (array, i); + char *key_name, *ip6_addr; + + if (values->n_values != 3) { + nm_warning ("%s: error writing IP6 address %d (address array length " + "%d is not 3)", + __func__, i, values->n_values); + continue; + } + + ip6_addr = ip6_array_to_addr_prefix (values); + if (ip6_addr) { + /* Write it out */ + key_name = g_strdup_printf ("%s%d", key, j++); + g_key_file_set_string (file, setting_name, key_name, ip6_addr); + g_free (key_name); + g_free (ip6_addr); + } + } +} + +static void +ip6_route_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GPtrArray *array; + const char *setting_name = nm_setting_get_name (setting); + char *list[3]; + int i, j; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE)); + + array = (GPtrArray *) g_value_get_boxed (value); + if (!array || !array->len) + return; + + for (i = 0, j = 1; i < array->len; i++) { + GValueArray *values = g_ptr_array_index (array, i); + char *key_name; + guint32 int_val; + char buf[INET6_ADDRSTRLEN + 1]; + gboolean is_unspec = FALSE; + + memset (list, 0, sizeof (list)); + + /* Address and prefix */ + list[0] = ip6_array_to_addr_prefix (values); + if (!list[0]) + continue; + + /* Next Hop */ + if (!ip6_array_to_addr (values, 2, buf, sizeof (buf), &is_unspec)) + continue; + if (is_unspec) + continue; + list[1] = g_strdup (buf); + + /* Metric */ + value = g_value_array_get_nth (values, 3); + int_val = g_value_get_uint (value); + list[2] = g_strdup_printf ("%d", int_val); + + /* Write it out */ + key_name = g_strdup_printf ("%s%d", key, j++); + g_key_file_set_string_list (file, setting_name, key_name, (const char **) list, 3); + g_free (key_name); + + g_free (list[0]); + g_free (list[1]); + g_free (list[2]); + } +} + + +static void +mac_address_writer (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GByteArray *array; + const char *setting_name = nm_setting_get_name (setting); + char *mac; + struct ether_addr tmp; + + g_return_if_fail (G_VALUE_HOLDS (value, DBUS_TYPE_G_UCHAR_ARRAY)); + + array = (GByteArray *) g_value_get_boxed (value); + if (!array) + return; + + if (array->len != ETH_ALEN) { + nm_warning ("%s: invalid %s / %s MAC address length %d", + __func__, setting_name, key, array->len); + return; + } + + memcpy (tmp.ether_addr_octet, array->data, ETH_ALEN); + mac = ether_ntoa (&tmp); + g_key_file_set_string (file, setting_name, key, mac); +} + +typedef struct { + GKeyFile *file; + const char *setting_name; +} WriteStringHashInfo; + +static void +write_hash_of_string_helper (gpointer key, gpointer data, gpointer user_data) +{ + WriteStringHashInfo *info = (WriteStringHashInfo *) user_data; + const char *property = (const char *) key; + const char *value = (const char *) data; + + g_key_file_set_string (info->file, + info->setting_name, + property, + value); +} + +static void +write_hash_of_string (GKeyFile *file, + NMSetting *setting, + const char *key, + const GValue *value) +{ + GHashTable *hash = g_value_get_boxed (value); + WriteStringHashInfo info; + + info.file = file; + + /* Write VPN secrets out to a different group to keep them separate */ + if ( (G_OBJECT_TYPE (setting) == NM_TYPE_SETTING_VPN) + && !strcmp (key, NM_SETTING_VPN_SECRETS)) { + info.setting_name = VPN_SECRETS_GROUP; + } else + info.setting_name = nm_setting_get_name (setting); + + g_hash_table_foreach (hash, write_hash_of_string_helper, &info); +} + +typedef struct { + const char *setting_name; + const char *key; + void (*writer) (GKeyFile *keyfile, NMSetting *setting, const char *key, const GValue *value); +} KeyWriter; + +/* A table of keys that require further parsing/conversion becuase 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_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES, + ip4_addr_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_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS, + mac_address_writer }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_MAC_ADDRESS, + mac_address_writer }, + { NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID, + mac_address_writer }, + { NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR, + mac_address_writer }, + { NULL, NULL, NULL } +}; + +static void +write_setting_value (NMSetting *setting, + const char *key, + const GValue *value, + GParamFlags flag, + gpointer user_data) +{ + GKeyFile *file = (GKeyFile *) 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 (file, setting_name, key, NULL); + 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) (file, setting, key, value); + return; + } + writer++; + } + + if (type == G_TYPE_STRING) { + const char *str; + + str = g_value_get_string (value); + if (str) + g_key_file_set_string (file, setting_name, key, str); + } else if (type == G_TYPE_UINT) + g_key_file_set_integer (file, setting_name, key, (int) g_value_get_uint (value)); + else if (type == G_TYPE_INT) + g_key_file_set_integer (file, 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)); + g_key_file_set_value (file, setting_name, key, numstr); + g_free (numstr); + } else if (type == G_TYPE_BOOLEAN) { + g_key_file_set_boolean (file, setting_name, key, g_value_get_boolean (value)); + } else if (type == G_TYPE_CHAR) { + g_key_file_set_integer (file, setting_name, key, (int) g_value_get_char (value)); + } else if (type == DBUS_TYPE_G_UCHAR_ARRAY) { + GByteArray *array; + + array = (GByteArray *) g_value_get_boxed (value); + if (array && array->len > 0) { + int *tmp_array; + int i; + + tmp_array = g_new (gint, array->len); + for (i = 0; i < array->len; i++) + tmp_array[i] = (int) array->data[i]; + + g_key_file_set_integer_list (file, setting_name, key, tmp_array, array->len); + g_free (tmp_array); + } + } else if (type == DBUS_TYPE_G_LIST_OF_STRING) { + GSList *list; + GSList *iter; + + list = (GSList *) g_value_get_boxed (value); + if (list) { + char **array; + int i = 0; + + array = g_new (char *, g_slist_length (list)); + for (iter = list; iter; iter = iter->next) + array[i++] = iter->data; + + g_key_file_set_string_list (file, setting_name, key, (const gchar **const) array, i); + g_free (array); + } + } else if (type == DBUS_TYPE_G_MAP_OF_STRING) { + write_hash_of_string (file, setting, key, value); + } else if (type == DBUS_TYPE_G_UINT_ARRAY) { + if (!write_array_of_uint (file, setting, key, value)) { + g_warning ("Unhandled setting property type (write) '%s/%s' : '%s'", + setting_name, key, g_type_name (type)); + } + } else { + g_warning ("Unhandled setting property type (write) '%s/%s' : '%s'", + setting_name, key, g_type_name (type)); + } +} + +char * +writer_id_to_filename (const char *id) +{ + 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++; + } + + return filename; +} + +gboolean +write_connection (NMConnection *connection, + const char *keyfile_dir, + uid_t owner_uid, + pid_t owner_grp, + char **out_path, + GError **error) +{ + NMSettingConnection *s_con; + GKeyFile *key_file; + char *data; + gsize len; + gboolean success = FALSE; + char *filename, *path; + int err; + + if (out_path) + g_return_val_if_fail (*out_path == NULL, FALSE); + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + if (!s_con) + return success; + + key_file = g_key_file_new (); + nm_connection_for_each_setting_value (connection, write_setting_value, key_file); + data = g_key_file_to_data (key_file, &len, error); + if (!data) + goto out; + + filename = writer_id_to_filename (nm_setting_connection_get_id (s_con)); + path = g_build_filename (keyfile_dir, filename, NULL); + g_free (filename); + + g_file_set_contents (path, data, len, error); + if (chown (path, owner_uid, owner_grp) < 0) { + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s.%d: error chowning '%s': %d", __FILE__, __LINE__, + path, errno); + unlink (path); + } else { + err = chmod (path, S_IRUSR | S_IWUSR); + if (err) { + g_set_error (error, + NM_SETTINGS_INTERFACE_ERROR, + NM_SETTINGS_INTERFACE_ERROR_INTERNAL_ERROR, + "%s.%d: error setting permissions on '%s': %d", __FILE__, + __LINE__, path, errno); + unlink (path); + } else { + if (out_path) + *out_path = g_strdup (path); + success = TRUE; + } + } + g_free (path); + +out: + g_free (data); + g_key_file_free (key_file); + return success; +} diff --git a/system-settings/plugins/keyfile/io/writer.h b/system-settings/plugins/keyfile/io/writer.h new file mode 100644 index 00000000..fa04deef --- /dev/null +++ b/system-settings/plugins/keyfile/io/writer.h @@ -0,0 +1,38 @@ +/* -*- 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 Red Hat, Inc. + */ + +#ifndef _KEYFILE_PLUGIN_WRITER_H +#define _KEYFILE_PLUGIN_WRITER_H + +#include +#include +#include + +gboolean write_connection (NMConnection *connection, + const char *keyfile_dir, + uid_t owner_uid, + pid_t owner_grp, + char **out_path, + GError **error); + +char *writer_id_to_filename (const char *id); + +#endif /* _KEYFILE_PLUGIN_WRITER_H */ diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c new file mode 100644 index 00000000..ed56d69d --- /dev/null +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -0,0 +1,242 @@ +/* -*- 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 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include + +#include "nm-dbus-glib-types.h" +#include "nm-keyfile-connection.h" +#include "reader.h" +#include "writer.h" + +static NMSettingsConnectionInterface *parent_settings_connection_iface; + +static void settings_connection_interface_init (NMSettingsConnectionInterface *klass); + +G_DEFINE_TYPE_EXTENDED (NMKeyfileConnection, nm_keyfile_connection, NM_TYPE_SYSCONFIG_CONNECTION, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SETTINGS_CONNECTION_INTERFACE, + settings_connection_interface_init)) + +#define NM_KEYFILE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionPrivate)) + +typedef struct { + char *filename; +} NMKeyfileConnectionPrivate; + +enum { + PROP_0, + PROP_FILENAME, + + LAST_PROP +}; + +NMKeyfileConnection * +nm_keyfile_connection_new (const char *filename) +{ + g_return_val_if_fail (filename != NULL, NULL); + + return (NMKeyfileConnection *) g_object_new (NM_TYPE_KEYFILE_CONNECTION, + NM_KEYFILE_CONNECTION_FILENAME, filename, + NULL); +} + +const char * +nm_keyfile_connection_get_filename (NMKeyfileConnection *self) +{ + g_return_val_if_fail (NM_IS_KEYFILE_CONNECTION (self), NULL); + + return NM_KEYFILE_CONNECTION_GET_PRIVATE (self)->filename; +} + +static gboolean +update (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceUpdateFunc callback, + gpointer user_data) +{ + NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (connection); + char *filename = NULL; + GError *error = NULL; + gboolean success; + + success = write_connection (NM_CONNECTION (connection), KEYFILE_DIR, 0, 0, &filename, &error); + if (success && filename && strcmp (priv->filename, filename)) { + /* Update the filename if it changed */ + g_free (priv->filename); + priv->filename = filename; + success = parent_settings_connection_iface->update (connection, callback, user_data); + } else { + callback (connection, error, user_data); + if (error) + g_error_free (error); + g_free (filename); + } + + return success; +} + +static gboolean +do_delete (NMSettingsConnectionInterface *connection, + NMSettingsConnectionInterfaceDeleteFunc callback, + gpointer user_data) +{ + NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (connection); + + g_unlink (priv->filename); + + return parent_settings_connection_iface->delete (connection, callback, user_data); +} + +/* GObject */ + +static void +settings_connection_interface_init (NMSettingsConnectionInterface *iface) +{ + parent_settings_connection_iface = g_type_interface_peek_parent (iface); + iface->update = update; + iface->delete = do_delete; +} + +static void +nm_keyfile_connection_init (NMKeyfileConnection *connection) +{ +} + +static GObject * +constructor (GType type, + guint n_construct_params, + GObjectConstructParam *construct_params) +{ + GObject *object; + NMKeyfileConnectionPrivate *priv; + NMSettingConnection *s_con; + NMConnection *tmp; + + object = G_OBJECT_CLASS (nm_keyfile_connection_parent_class)->constructor (type, n_construct_params, construct_params); + + if (!object) + return NULL; + + priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object); + + g_assert (priv->filename); + + tmp = connection_from_file (priv->filename); + if (!tmp) { + g_object_unref (object); + return NULL; + } + + nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (object), tmp, FALSE, NULL); + g_object_unref (tmp); + + /* if for some reason the connection didn't have a UUID, add one */ + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (object), NM_TYPE_SETTING_CONNECTION); + if (s_con && !nm_setting_connection_get_uuid (s_con)) { + GError *error = NULL; + char *uuid; + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, NM_SETTING_CONNECTION_UUID, uuid, NULL); + g_free (uuid); + + if (!write_connection (NM_CONNECTION (object), KEYFILE_DIR, 0, 0, NULL, &error)) { + g_warning ("Couldn't update connection %s with a UUID: (%d) %s", + nm_setting_connection_get_id (s_con), + error ? error->code : 0, + (error && error->message) ? error->message : "unknown"); + g_error_free (error); + } + } + + return object; +} + +static void +finalize (GObject *object) +{ + NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object); + + nm_connection_clear_secrets (NM_CONNECTION (object)); + + g_free (priv->filename); + + G_OBJECT_CLASS (nm_keyfile_connection_parent_class)->finalize (object); +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_FILENAME: + /* Construct only */ + priv->filename = g_value_dup_string (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) +{ + NMKeyfileConnectionPrivate *priv = NM_KEYFILE_CONNECTION_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_FILENAME: + g_value_set_string (value, priv->filename); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_keyfile_connection_class_init (NMKeyfileConnectionClass *keyfile_connection_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (keyfile_connection_class); + + g_type_class_add_private (keyfile_connection_class, sizeof (NMKeyfileConnectionPrivate)); + + /* Virtual methods */ + object_class->constructor = constructor; + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + + /* Properties */ + g_object_class_install_property + (object_class, PROP_FILENAME, + g_param_spec_string (NM_KEYFILE_CONNECTION_FILENAME, + "FileName", + "File name", + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +} diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.h b/system-settings/plugins/keyfile/nm-keyfile-connection.h new file mode 100644 index 00000000..3b4e050c --- /dev/null +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.h @@ -0,0 +1,54 @@ +/* -*- 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 Red Hat, Inc. + */ + +#ifndef NM_KEYFILE_CONNECTION_H +#define NM_KEYFILE_CONNECTION_H + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_KEYFILE_CONNECTION (nm_keyfile_connection_get_type ()) +#define NM_KEYFILE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnection)) +#define NM_KEYFILE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionClass)) +#define NM_IS_KEYFILE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_KEYFILE_CONNECTION)) +#define NM_IS_KEYFILE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_KEYFILE_CONNECTION)) +#define NM_KEYFILE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_KEYFILE_CONNECTION, NMKeyfileConnectionClass)) + +#define NM_KEYFILE_CONNECTION_FILENAME "filename" + +typedef struct { + NMSysconfigConnection parent; +} NMKeyfileConnection; + +typedef struct { + NMSysconfigConnectionClass parent; +} NMKeyfileConnectionClass; + +GType nm_keyfile_connection_get_type (void); + +NMKeyfileConnection *nm_keyfile_connection_new (const char *filename); + +const char *nm_keyfile_connection_get_filename (NMKeyfileConnection *self); + +G_END_DECLS + +#endif /* NM_KEYFILE_CONNECTION_H */ diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c new file mode 100644 index 00000000..36f47ccd --- /dev/null +++ b/system-settings/plugins/keyfile/plugin.c @@ -0,0 +1,581 @@ +/* -*- 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 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "plugin.h" +#include "nm-system-config-interface.h" +#include "nm-keyfile-connection.h" +#include "writer.h" + +#define KEYFILE_PLUGIN_NAME "keyfile" +#define KEYFILE_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list." + +#define CONF_FILE SYSCONFDIR "/NetworkManager/NetworkManager.conf" +#define OLD_CONF_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf" + +static char *plugin_get_hostname (SCPluginKeyfile *plugin); +static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class); + +G_DEFINE_TYPE_EXTENDED (SCPluginKeyfile, sc_plugin_keyfile, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE, + system_config_interface_init)) + +#define SC_PLUGIN_KEYFILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_KEYFILE, SCPluginKeyfilePrivate)) + +typedef struct { + GHashTable *hash; + + GFileMonitor *monitor; + guint monitor_id; + + const char *conf_file; + GFileMonitor *conf_file_monitor; + guint conf_file_monitor_id; + + char *hostname; + + gboolean disposed; +} SCPluginKeyfilePrivate; + +static void +read_connections (NMSystemConfigInterface *config) +{ + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config); + GDir *dir; + GError *err = NULL; + + dir = g_dir_open (KEYFILE_DIR, 0, &err); + if (dir) { + const char *item; + + while ((item = g_dir_read_name (dir))) { + NMKeyfileConnection *connection; + char *full_path; + + full_path = g_build_filename (KEYFILE_DIR, item, NULL); + connection = nm_keyfile_connection_new (full_path); + if (connection) { + g_hash_table_insert (priv->hash, + (gpointer) nm_keyfile_connection_get_filename (connection), + connection); + } + g_free (full_path); + } + + g_dir_close (dir); + } else { + g_warning ("Can not read directory '%s': %s", KEYFILE_DIR, err->message); + g_error_free (err); + } +} + +typedef struct { + const char *uuid; + NMKeyfileConnection *found; +} FindByUUIDInfo; + +static void +find_by_uuid (gpointer key, gpointer data, gpointer user_data) +{ + NMKeyfileConnection *keyfile = NM_KEYFILE_CONNECTION (data); + FindByUUIDInfo *info = user_data; + NMSettingConnection *s_con; + const char *uuid; + + if (info->found) + return; + + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (keyfile), NM_TYPE_SETTING_CONNECTION); + + uuid = s_con ? nm_setting_connection_get_uuid (s_con) : NULL; + if (uuid && !strcmp (info->uuid, uuid)) + info->found = keyfile; +} + +static void +update_connection_settings (NMKeyfileConnection *orig, + NMKeyfileConnection *new) +{ + GError *error = NULL; + + if (!nm_sysconfig_connection_update (NM_SYSCONFIG_CONNECTION (orig), + NM_CONNECTION (new), + TRUE, + &error)) { + g_warning ("%s: '%s' / '%s' invalid: %d", + __func__, + error ? g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)) : "(none)", + (error && error->message) ? error->message : "(none)", + error ? error->code : -1); + g_clear_error (&error); + + g_signal_emit_by_name (orig, "removed"); + } +} + +/* Monitoring */ + +static void +dir_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer user_data) +{ + NMSystemConfigInterface *config = NM_SYSTEM_CONFIG_INTERFACE (user_data); + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config); + char *name; + NMKeyfileConnection *connection; + + name = g_file_get_path (file); + connection = g_hash_table_lookup (priv->hash, name); + + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + if (connection) { + /* Removing from the hash table should drop the last reference */ + g_object_ref (connection); + g_hash_table_remove (priv->hash, name); + g_signal_emit_by_name (connection, "removed"); + g_object_unref (connection); + } + break; + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + if (connection) { + /* Update */ + NMKeyfileConnection *tmp; + + tmp = (NMKeyfileConnection *) nm_keyfile_connection_new (name); + if (tmp) { + update_connection_settings (connection, tmp); + g_object_unref (tmp); + } + } else { + /* New */ + connection = nm_keyfile_connection_new (name); + if (connection) { + NMSettingConnection *s_con; + const char *connection_uuid; + NMKeyfileConnection *found = NULL; + + /* Connection renames will show up as different files but with + * the same UUID. Try to find the original connection. + */ + s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection), NM_TYPE_SETTING_CONNECTION); + connection_uuid = s_con ? nm_setting_connection_get_uuid (s_con) : NULL; + + if (connection_uuid) { + FindByUUIDInfo info = { .found = NULL, .uuid = connection_uuid }; + + g_hash_table_foreach (priv->hash, find_by_uuid, &info); + found = info.found; + } + + /* A connection rename is treated just like an update except + * there's a bit more housekeeping with the hash table. + */ + if (found) { + const char *old_filename = nm_keyfile_connection_get_filename (connection); + + /* Removing from the hash table should drop the last reference, + * but of course we want to keep the connection around. + */ + g_object_ref (found); + g_hash_table_remove (priv->hash, old_filename); + + /* Updating settings should update the NMKeyfileConnection's + * filename property too. + */ + update_connection_settings (found, connection); + + /* Re-insert the connection back into the hash with the new filename */ + g_hash_table_insert (priv->hash, + (gpointer) nm_keyfile_connection_get_filename (found), + found); + + /* Get rid of the temporary connection */ + g_object_unref (connection); + } else { + g_hash_table_insert (priv->hash, + (gpointer) nm_keyfile_connection_get_filename (connection), + connection); + g_signal_emit_by_name (config, NM_SYSTEM_CONFIG_INTERFACE_CONNECTION_ADDED, connection); + } + } + } + break; + default: + break; + } + + g_free (name); +} + +static void +conf_file_changed (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + gpointer data) +{ + SCPluginKeyfile *self = SC_PLUGIN_KEYFILE (data); + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (self); + char *tmp; + + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED); + + /* hostname */ + tmp = plugin_get_hostname (self); + if ((tmp && !priv->hostname) + || (!tmp && priv->hostname) + || (priv->hostname && tmp && strcmp (priv->hostname, tmp))) { + + g_free (priv->hostname); + priv->hostname = tmp; + tmp = NULL; + g_object_notify (G_OBJECT (self), NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); + } + + g_free (tmp); + + break; + default: + break; + } +} + +static void +setup_monitoring (NMSystemConfigInterface *config) +{ + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config); + GFile *file; + GFileMonitor *monitor; + + priv->hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref); + + file = g_file_new_for_path (KEYFILE_DIR); + monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref (file); + + if (monitor) { + priv->monitor_id = g_signal_connect (monitor, "changed", G_CALLBACK (dir_changed), config); + priv->monitor = monitor; + } + + file = g_file_new_for_path (priv->conf_file); + monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL); + g_object_unref (file); + + if (monitor) { + priv->conf_file_monitor_id = g_signal_connect (monitor, "changed", G_CALLBACK (conf_file_changed), config); + priv->conf_file_monitor = monitor; + } +} + +static void +hash_to_slist (gpointer key, gpointer value, gpointer user_data) +{ + GSList **list = (GSList **) user_data; + + *list = g_slist_prepend (*list, value); +} + +/* Plugin */ + +static GSList * +get_connections (NMSystemConfigInterface *config) +{ + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config); + GSList *connections = NULL; + + if (!priv->hash) { + setup_monitoring (config); + read_connections (config); + } + + g_hash_table_foreach (priv->hash, hash_to_slist, &connections); + + return connections; +} + +static gboolean +add_connection (NMSystemConfigInterface *config, + NMConnection *connection, + GError **error) +{ + return write_connection (connection, KEYFILE_DIR, 0, 0, NULL, error); +} + +static GSList * +get_unmanaged_specs (NMSystemConfigInterface *config) +{ + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (config); + GKeyFile *key_file; + GSList *specs = NULL; + GError *error = NULL; + + key_file = g_key_file_new (); + if (g_key_file_load_from_file (key_file, priv->conf_file, G_KEY_FILE_NONE, &error)) { + char *str; + + str = g_key_file_get_value (key_file, "keyfile", "unmanaged-devices", NULL); + if (str) { + char **udis; + int i; + + udis = g_strsplit (str, ";", -1); + g_free (str); + + for (i = 0; udis[i] != NULL; i++) + specs = g_slist_append (specs, udis[i]); + + g_free (udis); /* Yes, g_free, not g_strfreev because we need the strings in the list */ + } + } else { + g_warning ("Error parsing file '%s': %s", priv->conf_file, error->message); + g_error_free (error); + } + + g_key_file_free (key_file); + + return specs; +} + +static char * +plugin_get_hostname (SCPluginKeyfile *plugin) +{ + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (plugin); + GKeyFile *key_file; + char *hostname = NULL; + GError *error = NULL; + + key_file = g_key_file_new (); + if (g_key_file_load_from_file (key_file, priv->conf_file, G_KEY_FILE_NONE, &error)) + hostname = g_key_file_get_value (key_file, "keyfile", "hostname", NULL); + else { + g_warning ("Error parsing file '%s': %s", priv->conf_file, error->message); + g_error_free (error); + } + + g_key_file_free (key_file); + + return hostname; +} + +static gboolean +plugin_set_hostname (SCPluginKeyfile *plugin, const char *hostname) +{ + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (plugin); + GKeyFile *key_file; + GError *error = NULL; + gboolean result = FALSE; + + key_file = g_key_file_new (); + if (g_key_file_load_from_file (key_file, priv->conf_file, G_KEY_FILE_NONE, &error)) { + char *data; + gsize len; + + g_key_file_set_string (key_file, "keyfile", "hostname", hostname); + + data = g_key_file_to_data (key_file, &len, &error); + if (data) { + g_file_set_contents (priv->conf_file, data, len, &error); + g_free (data); + + g_free (priv->hostname); + priv->hostname = hostname ? g_strdup (hostname) : NULL; + result = TRUE; + } + + if (error) { + g_warning ("Error saving hostname: %s", error->message); + g_error_free (error); + } + } else { + g_warning ("Error parsing file '%s': %s", priv->conf_file, error->message); + g_error_free (error); + } + + g_key_file_free (key_file); + + return result; +} + +/* GObject */ + +static void +sc_plugin_keyfile_init (SCPluginKeyfile *plugin) +{ + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (plugin); + + if (g_file_test (CONF_FILE, G_FILE_TEST_EXISTS)) + priv->conf_file = CONF_FILE; + else + priv->conf_file = OLD_CONF_FILE; + + priv->hostname = plugin_get_hostname (plugin); +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME: + g_value_set_string (value, KEYFILE_PLUGIN_NAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO: + g_value_set_string (value, KEYFILE_PLUGIN_INFO); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES: + g_value_set_uint (value, NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_CONNECTIONS | + NM_SYSTEM_CONFIG_INTERFACE_CAP_MODIFY_HOSTNAME); + break; + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + g_value_set_string (value, SC_PLUGIN_KEYFILE_GET_PRIVATE (object)->hostname); + 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) +{ + const char *hostname; + + switch (prop_id) { + case NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME: + hostname = g_value_get_string (value); + if (hostname && strlen (hostname) < 1) + hostname = NULL; + plugin_set_hostname (SC_PLUGIN_KEYFILE (object), hostname); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (object); + + if (priv->disposed) + return; + + priv->disposed = TRUE; + + if (priv->monitor) { + if (priv->monitor_id) + g_signal_handler_disconnect (priv->monitor, priv->monitor_id); + + g_file_monitor_cancel (priv->monitor); + g_object_unref (priv->monitor); + } + + if (priv->conf_file_monitor) { + if (priv->conf_file_monitor_id) + g_signal_handler_disconnect (priv->conf_file_monitor, priv->conf_file_monitor_id); + + g_file_monitor_cancel (priv->conf_file_monitor); + g_object_unref (priv->conf_file_monitor); + } + + g_free (priv->hostname); + + if (priv->hash) + g_hash_table_destroy (priv->hash); + + G_OBJECT_CLASS (sc_plugin_keyfile_parent_class)->dispose (object); +} + +static void +sc_plugin_keyfile_class_init (SCPluginKeyfileClass *req_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (req_class); + + g_type_class_add_private (req_class, sizeof (SCPluginKeyfilePrivate)); + + object_class->dispose = dispose; + object_class->get_property = get_property; + object_class->set_property = set_property; + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME, + NM_SYSTEM_CONFIG_INTERFACE_NAME); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO, + NM_SYSTEM_CONFIG_INTERFACE_INFO); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES, + NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES); + + g_object_class_override_property (object_class, + NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME, + NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME); +} + +static void +system_config_interface_init (NMSystemConfigInterface *system_config_interface_class) +{ + /* interface implementation */ + system_config_interface_class->get_connections = get_connections; + system_config_interface_class->add_connection = add_connection; + system_config_interface_class->get_unmanaged_specs = get_unmanaged_specs; +} + +G_MODULE_EXPORT GObject * +nm_system_config_factory (void) +{ + static SCPluginKeyfile *singleton = NULL; + + if (!singleton) + singleton = SC_PLUGIN_KEYFILE (g_object_new (SC_TYPE_PLUGIN_KEYFILE, NULL)); + else + g_object_ref (singleton); + + return G_OBJECT (singleton); +} diff --git a/system-settings/plugins/keyfile/plugin.h b/system-settings/plugins/keyfile/plugin.h new file mode 100644 index 00000000..71496c07 --- /dev/null +++ b/system-settings/plugins/keyfile/plugin.h @@ -0,0 +1,46 @@ +/* -*- 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 Red Hat, Inc. + */ + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +#include + +#define SC_TYPE_PLUGIN_KEYFILE (sc_plugin_keyfile_get_type ()) +#define SC_PLUGIN_KEYFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_KEYFILE, SCPluginKeyfile)) +#define SC_PLUGIN_KEYFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_KEYFILE, SCPluginKeyfileClass)) +#define SC_IS_PLUGIN_KEYFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_KEYFILE)) +#define SC_IS_PLUGIN_KEYFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SC_TYPE_PLUGIN_KEYFILE)) +#define SC_PLUGIN_KEYFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_KEYFILE, SCPluginKeyfileClass)) + +typedef struct { + GObject parent; +} SCPluginKeyfile; + +typedef struct { + GObjectClass parent; +} SCPluginKeyfileClass; + +GType sc_plugin_keyfile_get_type (void); + +GQuark keyfile_plugin_error_quark (void); + +#endif /* _PLUGIN_H_ */ diff --git a/system-settings/plugins/keyfile/tests/Makefile.am b/system-settings/plugins/keyfile/tests/Makefile.am new file mode 100644 index 00000000..a0af14b2 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/Makefile.am @@ -0,0 +1,32 @@ +SUBDIRS=keyfiles + +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/system-settings/plugins/keyfile/io + +noinst_PROGRAMS = test-keyfile + +test_keyfile_SOURCES = \ + test-keyfile.c + +test_keyfile_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DTEST_KEYFILES_DIR=\"$(abs_srcdir)/keyfiles\" \ + -DTEST_SCRATCH_DIR=\"$(abs_builddir)/keyfiles\" + +test_keyfile_LDADD = \ + $(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) + +if WITH_TESTS + +check-local: test-keyfile + $(abs_builddir)/test-keyfile + +endif + diff --git a/system-settings/plugins/keyfile/tests/Makefile.in b/system-settings/plugins/keyfile/tests/Makefile.in new file mode 100644 index 00000000..317be7ef --- /dev/null +++ b/system-settings/plugins/keyfile/tests/Makefile.in @@ -0,0 +1,733 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = test-keyfile$(EXEEXT) +subdir = system-settings/plugins/keyfile/tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_test_keyfile_OBJECTS = test_keyfile-test-keyfile.$(OBJEXT) +test_keyfile_OBJECTS = $(am_test_keyfile_OBJECTS) +am__DEPENDENCIES_1 = +test_keyfile_DEPENDENCIES = $(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(test_keyfile_SOURCES) +DIST_SOURCES = $(test_keyfile_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = keyfiles +INCLUDES = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/libnm-util \ + -I$(top_srcdir)/libnm-glib \ + -I$(top_srcdir)/system-settings/plugins/keyfile/io + +test_keyfile_SOURCES = \ + test-keyfile.c + +test_keyfile_CPPFLAGS = \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + -DTEST_KEYFILES_DIR=\"$(abs_srcdir)/keyfiles\" \ + -DTEST_SCRATCH_DIR=\"$(abs_builddir)/keyfiles\" + +test_keyfile_LDADD = \ + $(top_builddir)/system-settings/plugins/keyfile/io/libkeyfile-io.la \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/keyfile/tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/keyfile/tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +test-keyfile$(EXEEXT): $(test_keyfile_OBJECTS) $(test_keyfile_DEPENDENCIES) + @rm -f test-keyfile$(EXEEXT) + $(LINK) $(test_keyfile_OBJECTS) $(test_keyfile_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_keyfile-test-keyfile.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +test_keyfile-test-keyfile.o: test-keyfile.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_keyfile_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_keyfile-test-keyfile.o -MD -MP -MF $(DEPDIR)/test_keyfile-test-keyfile.Tpo -c -o test_keyfile-test-keyfile.o `test -f 'test-keyfile.c' || echo '$(srcdir)/'`test-keyfile.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_keyfile-test-keyfile.Tpo $(DEPDIR)/test_keyfile-test-keyfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-keyfile.c' object='test_keyfile-test-keyfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_keyfile_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_keyfile-test-keyfile.o `test -f 'test-keyfile.c' || echo '$(srcdir)/'`test-keyfile.c + +test_keyfile-test-keyfile.obj: test-keyfile.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_keyfile_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_keyfile-test-keyfile.obj -MD -MP -MF $(DEPDIR)/test_keyfile-test-keyfile.Tpo -c -o test_keyfile-test-keyfile.obj `if test -f 'test-keyfile.c'; then $(CYGPATH_W) 'test-keyfile.c'; else $(CYGPATH_W) '$(srcdir)/test-keyfile.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test_keyfile-test-keyfile.Tpo $(DEPDIR)/test_keyfile-test-keyfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-keyfile.c' object='test_keyfile-test-keyfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_keyfile_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_keyfile-test-keyfile.obj `if test -f 'test-keyfile.c'; then $(CYGPATH_W) 'test-keyfile.c'; else $(CYGPATH_W) '$(srcdir)/test-keyfile.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +@WITH_TESTS_FALSE@check-local: +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-recursive +all-am: Makefile $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am check-local clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +@WITH_TESTS_TRUE@check-local: test-keyfile +@WITH_TESTS_TRUE@ $(abs_builddir)/test-keyfile + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_BT b/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_BT new file mode 100644 index 00000000..cc8a9ee3 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_BT @@ -0,0 +1,23 @@ + +[connection] +id=AT&T Data Connect BT +uuid=089130ab-ce28-46e4-ad77-d44869b03d19 +type=bluetooth +autoconnect=false + +[ipv4] +method=auto + +[gsm] +number=*99# +username=ISP@CINGULARGPRS.COM +password=CINGULAR1 +apn=ISP.CINGULAR + +[serial] +baud=115200 + +[bluetooth] +bdaddr=00:11:22:33:44:55 +type=dun + diff --git a/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_Plain b/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_Plain new file mode 100644 index 00000000..236cca0e --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/ATT_Data_Connect_Plain @@ -0,0 +1,20 @@ + +[connection] +id=AT&T Data Connect +uuid=15d742f1-2b5a-421e-9f27-fcb1fc26d72c +type=gsm +autoconnect=false + +[ipv4] +method=auto + +[gsm] +number=*99# +username=ISP@CINGULARGPRS.COM +password=CINGULAR1 +apn=ISP.CINGULAR +network-id=24005 +pin=2345 + +[serial] +baud=115200 diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am new file mode 100644 index 00000000..52252f9a --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.am @@ -0,0 +1,14 @@ +EXTRA_DIST = \ + Test_Wired_Connection \ + Test_GSM_Connection \ + Test_Wireless_Connection \ + Test_Wired_Connection_MAC_Case \ + Test_Wired_Connection_IP6 \ + ATT_Data_Connect_BT \ + ATT_Data_Connect_Plain + +check-local: + @for f in $(EXTRA_DIST); do \ + chmod 0600 $(abs_srcdir)/$$f; \ + done + diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Makefile.in b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.in new file mode 100644 index 00000000..e809d46f --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Makefile.in @@ -0,0 +1,433 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = system-settings/plugins/keyfile/tests/keyfiles +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + Test_Wired_Connection \ + Test_GSM_Connection \ + Test_Wireless_Connection \ + Test_Wired_Connection_MAC_Case \ + Test_Wired_Connection_IP6 \ + ATT_Data_Connect_BT \ + ATT_Data_Connect_Plain + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu system-settings/plugins/keyfile/tests/keyfiles/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu system-settings/plugins/keyfile/tests/keyfiles/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool distclean distclean-generic distclean-libtool \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +check-local: + @for f in $(EXTRA_DIST); do \ + chmod 0600 $(abs_srcdir)/$$f; \ + done + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_GSM_Connection b/system-settings/plugins/keyfile/tests/keyfiles/Test_GSM_Connection new file mode 100644 index 00000000..3d58fee0 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_GSM_Connection @@ -0,0 +1,41 @@ + +[serial] +baud=115200 +bits=8 +parity=110 +stopbits=1 +send-delay=0 + +[connection] +id=Test GSM Connection +uuid=05a5ec81-fa72-4b7c-9f85-4a0dfd36c84f +type=gsm +autoconnect=false +timestamp=0 + +[gsm] +number=*99# +username=username +apn=my.apn +network-type=0 +band=0 + +[ppp] +noauth=false +refuse-eap=false +refuse-pap=false +refuse-chap=false +refuse-mschap=false +refuse-mschapv2=false +nobsdcomp=false +nodeflate=false +no-vj-comp=false +require-mppe=false +require-mppe-128=false +mppe-stateful=false +crtscts=false +baud=0 +mru=0 +mtu=0 +lcp-echo-failure=5 +lcp-echo-interval=30 diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection new file mode 100644 index 00000000..5785dc24 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection @@ -0,0 +1,32 @@ + +[connection] +id=Test Wired Connection +uuid=4e80a56d-c99f-4aad-a6dd-b449bc398c57 +type=802-3-ethernet +autoconnect=true +timestamp=6654332 + +[802-3-ethernet] +mac-address=00:11:22:33:44:55 +speed=0 +duplex=full +auto-negotiate=true +mtu=1400 + +[ipv4] +method=manual +dns=4.2.2.1;4.2.2.2; +addresses1=192.168.0.5;24;192.168.0.1; +addresses2=1.2.3.4;16;1.2.1.1; +ignore-auto-routes=false +ignore-auto-dns=false + +[ipv6] +method=manual +dns=1111:dddd::aaaa;1::cafe; +dns-search=super-domain.com;redhat.com;gnu.org; +addresses1=abcd:1234:ffff::cdde/64 +addresses2=1:2:3:4:5:6:7:8/96 +routes1=a:b:c:d::/64;f:e:d:c:1:2:3:4;99; +ignore-auto-routes=false +ignore-auto-dns=false diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_IP6 b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_IP6 new file mode 100644 index 00000000..a42dd5d2 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_IP6 @@ -0,0 +1,20 @@ + +[connection] +id=Test Wired Connection IP6 +uuid=4e80a56d-c99f-4aad-a6dd-b449bc398c57 +type=802-3-ethernet +autoconnect=true +timestamp=6654332 + +[802-3-ethernet] +auto-negotiate=true +mtu=1400 + +[ipv4] +method=disabled + +[ipv6] +method=manual +addresses1=abcd:1234:ffff::cdde/64,abcd:1234:ffff::cdd1 +dns=1111:dddd::aaaa;1::cafe; + diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_MAC_Case b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_MAC_Case new file mode 100644 index 00000000..29aef494 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wired_Connection_MAC_Case @@ -0,0 +1,32 @@ + +[connection] +id=Test Wired Connection MAC Case +uuid=4e80a56d-c99f-4aad-a6dd-b449bc398c57 +type=802-3-ethernet +autoconnect=true +timestamp=6654332 + +[802-3-ethernet] +mac-address=00:11:aa:BB:CC:55 +speed=0 +duplex=full +auto-negotiate=true +mtu=1400 + +[ipv4] +method=manual +dns=4.2.2.1;4.2.2.2; +addresses1=192.168.0.5;24;192.168.0.1; +addresses2=1.2.3.4;16;1.2.1.1; +ignore-auto-routes=false +ignore-auto-dns=false + +[ipv6] +method=manual +dns=1111:dddd::aaaa;1::cafe; +dns-search=super-domain.com;redhat.com;gnu.org; +addresses1=abcd:1234:ffff::cdde/64 +addresses2=1:2:3:4:5:6:7:8/96 +routes1=a:b:c:d::/64;f:e:d:c:1:2:3:4;99; +ignore-auto-routes=false +ignore-auto-dns=false diff --git a/system-settings/plugins/keyfile/tests/keyfiles/Test_Wireless_Connection b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wireless_Connection new file mode 100644 index 00000000..b1949d0d --- /dev/null +++ b/system-settings/plugins/keyfile/tests/keyfiles/Test_Wireless_Connection @@ -0,0 +1,22 @@ +[connection] +id=Test Wireless Connection +uuid=2f962388-e5f3-45af-a62c-ac220b8f7baa +type=802-11-wireless +autoconnect=false +timestamp=1226604314 + +[802-11-wireless] +ssid=110;109;45;116;101;115;116;45;97;112; +mode=infrastructure +channel=0 +rate=0 +tx-power=0 +mtu=0 +bssid=00:1a:33:44:99:82 + +[ipv4] +method=auto +ignore-auto-routes=false +ignore-auto-dns=false +never-default=false + diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c new file mode 100644 index 00000000..81e17440 --- /dev/null +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -0,0 +1,1882 @@ +/* -*- 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 - 2010 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nm-test-helpers.h" + +#include "reader.h" +#include "writer.h" + +#define TEST_WIRED_FILE TEST_KEYFILES_DIR"/Test_Wired_Connection" +#define TEST_WIRELESS_FILE TEST_KEYFILES_DIR"/Test_Wireless_Connection" + +static void +test_read_valid_wired_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + GError *error = NULL; + const GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + const char *tmp; + const char *expected_id = "Test Wired Connection"; + const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57"; + const guint64 expected_timestamp = 6654332; + guint64 timestamp; + const char *expected_dns1 = "4.2.2.1"; + const char *expected_dns2 = "4.2.2.2"; + struct in_addr addr; + const char *expected_address1 = "192.168.0.5"; + const char *expected_address2 = "1.2.3.4"; + const char *expected_address1_gw = "192.168.0.1"; + const char *expected_address2_gw = "1.2.1.1"; + NMIP4Address *ip4_addr; + const char *expected6_dns1 = "1111:dddd::aaaa"; + const char *expected6_dns2 = "1::cafe"; + const char *expected6_dnssearch1 = "super-domain.com"; + const char *expected6_dnssearch2 = "redhat.com"; + const char *expected6_dnssearch3 = "gnu.org"; + struct in6_addr addr6; + const char *expected6_address1 = "abcd:1234:ffff::cdde"; + const char *expected6_address2 = "1:2:3:4:5:6:7:8"; + const char *expected6_route_dest = "a:b:c:d::"; + const char *expected6_route_nh = "f:e:d:c:1:2:3:4"; + NMIP6Address *ip6_addr; + NMIP6Route *ip6_route; + + connection = connection_from_file (TEST_WIRED_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_WIRED_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_WIRED_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_WIRED_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID */ + tmp = nm_setting_connection_get_uuid (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + ASSERT (strcmp (tmp, expected_uuid) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + + /* Timestamp */ + timestamp = nm_setting_connection_get_timestamp (s_con); + ASSERT (timestamp == expected_timestamp, + "connection-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_WIRED_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == TRUE, + "connection-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_WIRED_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "connection-verify-wired", "failed to verify %s: missing %s setting", + TEST_WIRED_FILE, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "connection-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_WIRED_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + TEST_WIRED_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + ASSERT (nm_setting_wired_get_mtu (s_wired) == 1400, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MTU); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "connection-verify-ip4", "failed to verify %s: missing %s setting", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + /* DNS Addresses */ + ASSERT (nm_setting_ip4_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); + + ASSERT (inet_pton (AF_INET, expected_dns1, &addr) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert DNS IP address #1", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 0) == addr.s_addr, + "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); + + ASSERT (inet_pton (AF_INET, expected_dns2, &addr) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert DNS IP address #2", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_setting_ip4_config_get_dns (s_ip4, 1) == addr.s_addr, + "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); + + ASSERT (nm_setting_ip4_config_get_num_addresses (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); + + /* Address #1 */ + ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 0); + ASSERT (ip4_addr, + "connection-verify-wired", "failed to verify %s: missing IP4 address #1", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (nm_ip4_address_get_prefix (ip4_addr) == 24, + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1 prefix", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address1, &addr) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #1", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_ip4_address_get_address (ip4_addr) == addr.s_addr, + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address1_gw, &addr) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #1 gateway", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + ASSERT (nm_ip4_address_get_gateway (ip4_addr) == addr.s_addr, + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1 gateway", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + /* Address #2 */ + ip4_addr = nm_setting_ip4_config_get_address (s_ip4, 1); + ASSERT (ip4_addr, + "connection-verify-wired", "failed to verify %s: missing IP4 address #2", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (nm_ip4_address_get_prefix (ip4_addr) == 16, + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #2 prefix", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address2, &addr) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #2", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_DNS); + ASSERT (nm_ip4_address_get_address (ip4_addr) == addr.s_addr, + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #2", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET, expected_address2_gw, &addr) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #2 gateway", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + ASSERT (nm_ip4_address_get_gateway (ip4_addr) == addr.s_addr, + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #2 gateway", + TEST_WIRED_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP4_CONFIG_ADDRESSES); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "connection-verify-ip6", "failed to verify %s: missing %s setting", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_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); + + /* DNS Addresses */ + ASSERT (nm_setting_ip6_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); + + ASSERT (inet_pton (AF_INET6, expected6_dns1, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert DNS IP6 address #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 0), &addr6), + "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); + + ASSERT (inet_pton (AF_INET6, expected6_dns2, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert DNS IP address #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_setting_ip6_config_get_dns (s_ip6, 1), &addr6), + "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); + + ASSERT (nm_setting_ip6_config_get_num_addresses (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); + + /* DNS Searches */ + ASSERT (nm_setting_ip6_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); + + ASSERT (!strcmp (nm_setting_ip6_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), + "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), + "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); + + /* Address #1 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0); + ASSERT (ip6_addr, + "connection-verify-wired", "failed to verify %s: missing IP6 address #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 64, + "connection-verify-wired", "failed to verify %s: unexpected IP6 address #1 prefix", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET6, expected6_address1, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + /* Address #2 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 1); + ASSERT (ip6_addr, + "connection-verify-wired", "failed to verify %s: missing IP6 address #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 96, + "connection-verify-wired", "failed to verify %s: unexpected IP6 address #2 prefix", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET6, expected6_address2, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP6 address #2", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + /* Route #1 */ + ip6_route = nm_setting_ip6_config_get_route (s_ip6, 0); + ASSERT (ip6_route, + "connection-verify-wired", "failed to verify %s: missing IP6 route #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + ASSERT (inet_pton (AF_INET6, expected6_route_dest, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP route dest #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_route_get_dest (ip6_route), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 route dest #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + ASSERT (nm_ip6_route_get_prefix (ip6_route) == 64, + "connection-verify-wired", "failed to verify %s: unexpected IP6 route #1 prefix", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + ASSERT (inet_pton (AF_INET6, expected6_route_nh, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP route next hop #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_DNS); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_route_get_next_hop (ip6_route), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 route dest #1", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + ASSERT (nm_ip6_route_get_metric (ip6_route) == 99, + "connection-verify-wired", "failed to verify %s: unexpected IP6 route #1 metric", + TEST_WIRED_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ROUTES); + + g_object_unref (connection); +} + +static void +add_one_ip4_address (NMSettingIP4Config *s_ip4, + const char *addr, + const char *gw, + guint32 prefix) +{ + struct in_addr 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.s_addr); + + inet_pton (AF_INET, gw, &tmp); + nm_ip4_address_set_gateway (ip4_addr, tmp.s_addr); + + 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) +{ + struct in_addr 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.s_addr); + + inet_pton (AF_INET, nh, &addr); + nm_ip4_route_set_next_hop (route, addr.s_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); + } + + nm_setting_ip6_config_add_address (s_ip6, ip6_addr); + nm_ip6_address_unref (ip6_addr); +} + +static void +add_one_ip6_route (NMSettingIP6Config *s_ip6, + const char *dest, + const char *nh, + guint32 prefix, + guint32 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); + + nm_setting_ip6_config_add_route (s_ip6, route); + nm_ip6_route_unref (route); +} + + +static void +test_write_wired_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *uuid; + GByteArray *mac; + unsigned char tmpmac[] = { 0x99, 0x88, 0x77, 0x66, 0x55, 0x44 }; + gboolean success; + NMConnection *reread; + char *testfile = NULL; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + struct in_addr addr; + struct in6_addr addr6; + 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 *route1 = "10.10.10.2"; + const char *route1_nh = "10.10.10.1"; + const char *route2 = "0.0.0.0"; + const char *route2_nh = "1.2.1.1"; + const char *dns6_1 = "1::cafe"; + const char *dns6_2 = "2::cafe"; + const char *address6_1 = "abcd::beef"; + const char *address6_2 = "dcba::beef"; + const char *route6_1 = "1:2:3:4:5:6:7:8"; + const char *route6_1_nh = "8:7:6:5:4:3:2:1"; + const char *route6_2 = "::"; + const char *route6_2_nh = "2001::1111"; + guint64 timestamp = 0x12345678L; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Work Wired", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* Wired setting */ + + s_wired = NM_SETTING_WIRED (nm_setting_wired_new ()); + ASSERT (s_wired != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + mac = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (mac, &tmpmac[0], sizeof (tmpmac)); + g_object_set (s_wired, + NM_SETTING_WIRED_MAC_ADDRESS, mac, + NM_SETTING_WIRED_MTU, 900, + NULL); + g_byte_array_free (mac, TRUE); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-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, + NULL); + + /* Addresses */ + add_one_ip4_address (s_ip4, address1, address1_gw, 24); + add_one_ip4_address (s_ip4, address2, address2_gw, 8); + + /* Routes */ + add_one_ip4_route (s_ip4, route1, route1_nh, 24, 3); + add_one_ip4_route (s_ip4, route2, route2_nh, 8, 1); + + /* DNS servers */ + inet_pton (AF_INET, dns1, &addr); + nm_setting_ip4_config_add_dns (s_ip4, addr.s_addr); + inet_pton (AF_INET, dns2, &addr); + nm_setting_ip4_config_add_dns (s_ip4, addr.s_addr); + + /* IP6 setting */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ()); + ASSERT (s_ip6 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, + NULL); + + /* Addresses */ + add_one_ip6_address (s_ip6, address6_1, 64, NULL); + add_one_ip6_address (s_ip6, address6_2, 56, NULL); + + /* 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); + + /* DNS servers */ + inet_pton (AF_INET6, dns6_1, &addr6); + nm_setting_ip6_config_add_dns (s_ip6, &addr6); + inet_pton (AF_INET6, dns6_2, &addr6); + nm_setting_ip6_config_add_dns (s_ip6, &addr6); + + /* DNS searches */ + nm_setting_ip6_config_add_dns_search (s_ip6, "wallaceandgromit.com"); + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + +#define TEST_WIRED_IP6_FILE TEST_KEYFILES_DIR"/Test_Wired_Connection_IP6" + +static void +test_read_ip6_wired_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + GError *error = NULL; + const char *tmp; + const char *expected_id = "Test Wired Connection IP6"; + const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57"; + struct in6_addr addr6; + const char *expected6_address1 = "abcd:1234:ffff::cdde"; + const char *expected6_gw1 = "abcd:1234:ffff::cdd1"; + NMIP6Address *ip6_addr; + + connection = connection_from_file (TEST_WIRED_IP6_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_WIRED_IP6_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_WIRED_IP6_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID */ + tmp = nm_setting_connection_get_uuid (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + ASSERT (strcmp (tmp, expected_uuid) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_IP6_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "connection-verify-wired", "failed to verify %s: missing %s setting", + TEST_WIRED_IP6_FILE, + NM_SETTING_WIRED_SETTING_NAME); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "connection-verify-ip4", "failed to verify %s: missing %s setting", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + ASSERT (nm_setting_ip4_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); + + /* ===== IPv6 SETTING ===== */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG)); + ASSERT (s_ip6 != NULL, + "connection-verify-ip6", "failed to verify %s: missing %s setting", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip6_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); + + ASSERT (nm_setting_ip6_config_get_num_addresses (s_ip6) == 1, + "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_DNS); + + /* Address #1 */ + ip6_addr = nm_setting_ip6_config_get_address (s_ip6, 0); + ASSERT (ip6_addr, + "connection-verify-wired", "failed to verify %s: missing IP6 address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (nm_ip6_address_get_prefix (ip6_addr) == 64, + "connection-verify-wired", "failed to verify %s: unexpected IP6 address #1 prefix", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET6, expected6_address1, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert IP address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_address (ip6_addr), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + ASSERT (inet_pton (AF_INET6, expected6_gw1, &addr6) > 0, + "connection-verify-wired", "failed to verify %s: couldn't convert GW address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + ASSERT (IN6_ARE_ADDR_EQUAL (nm_ip6_address_get_gateway (ip6_addr), &addr6), + "connection-verify-wired", "failed to verify %s: unexpected IP4 address #1", + TEST_WIRED_IP6_FILE, + NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDRESSES); + + g_object_unref (connection); +} + +static void +test_write_ip6_wired_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *uuid; + gboolean success; + NMConnection *reread; + char *testfile = NULL; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + struct in6_addr addr6; + const char *dns = "1::cafe"; + const char *address = "abcd::beef"; + const char *gw = "dcba::beef"; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Work Wired IP6", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, + NULL); + g_free (uuid); + + /* Wired setting */ + + s_wired = NM_SETTING_WIRED (nm_setting_wired_new ()); + ASSERT (s_wired != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_WIRED_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-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_DISABLED, + NULL); + + /* IP6 setting */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ()); + ASSERT (s_ip6 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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, + NULL); + + /* Addresses */ + add_one_ip6_address (s_ip6, address, 64, gw); + + /* DNS servers */ + inet_pton (AF_INET6, dns, &addr6); + nm_setting_ip6_config_add_dns (s_ip6, &addr6); + + /* DNS searches */ + nm_setting_ip6_config_add_dns_search (s_ip6, "wallaceandgromit.com"); + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + +#define TEST_WIRED_MAC_CASE_FILE TEST_KEYFILES_DIR"/Test_Wired_Connection_MAC_Case" + +static void +test_read_wired_mac_case (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWired *s_wired; + GError *error = NULL; + const GByteArray *array; + char expected_mac_address[ETH_ALEN] = { 0x00, 0x11, 0xaa, 0xbb, 0xcc, 0x55 }; + const char *tmp; + const char *expected_id = "Test Wired Connection MAC Case"; + const char *expected_uuid = "4e80a56d-c99f-4aad-a6dd-b449bc398c57"; + + connection = connection_from_file (TEST_WIRED_MAC_CASE_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_WIRED_MAC_CASE_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_WIRED_MAC_CASE_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID */ + tmp = nm_setting_connection_get_uuid (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + ASSERT (strcmp (tmp, expected_uuid) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + + /* ===== WIRED SETTING ===== */ + + s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED)); + ASSERT (s_wired != NULL, + "connection-verify-wired", "failed to verify %s: missing %s setting", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_WIRED_SETTING_NAME); + + /* MAC address */ + array = nm_setting_wired_get_mac_address (s_wired); + ASSERT (array != NULL, + "connection-verify-wired", "failed to verify %s: missing %s / %s key", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (array->len == ETH_ALEN, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value length", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + ASSERT (memcmp (array->data, &expected_mac_address[0], sizeof (expected_mac_address)) == 0, + "connection-verify-wired", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRED_MAC_CASE_FILE, + NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_WIRED_MAC_ADDRESS); + + g_object_unref (connection); +} + +static void +test_read_valid_wireless_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + NMSettingIP4Config *s_ip4; + GError *error = NULL; + const GByteArray *array; + char expected_bssid[ETH_ALEN] = { 0x00, 0x1a, 0x33, 0x44, 0x99, 0x82 }; + const char *tmp; + const char *expected_id = "Test Wireless Connection"; + const char *expected_uuid = "2f962388-e5f3-45af-a62c-ac220b8f7baa"; + const guint64 expected_timestamp = 1226604314; + guint64 timestamp; + + connection = connection_from_file (TEST_WIRELESS_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_WIRELESS_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_WIRELESS_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID */ + tmp = nm_setting_connection_get_uuid (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + ASSERT (strcmp (tmp, expected_uuid) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + + /* Timestamp */ + timestamp = nm_setting_connection_get_timestamp (s_con); + ASSERT (timestamp == expected_timestamp, + "connection-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP); + + /* Autoconnect */ + ASSERT (nm_setting_connection_get_autoconnect (s_con) == FALSE, + "connection-verify-connection", "failed to verify %s: unexpected %s /%s key value", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_AUTOCONNECT); + + /* ===== WIRED SETTING ===== */ + + s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS)); + ASSERT (s_wireless != NULL, + "connection-verify-wireless", "failed to verify %s: missing %s setting", + TEST_WIRELESS_FILE, + NM_SETTING_WIRED_SETTING_NAME); + + /* BSSID */ + array = nm_setting_wireless_get_bssid (s_wireless); + ASSERT (array != NULL, + "connection-verify-wireless", "failed to verify %s: missing %s / %s key", + TEST_WIRELESS_FILE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID); + ASSERT (array->len == ETH_ALEN, + "connection-verify-wireless", "failed to verify %s: unexpected %s / %s key value length", + TEST_WIRELESS_FILE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID); + ASSERT (memcmp (array->data, &expected_bssid[0], sizeof (expected_bssid)) == 0, + "connection-verify-wireless", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRELESS_FILE, + NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_WIRELESS_BSSID); + + /* ===== IPv4 SETTING ===== */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG)); + ASSERT (s_ip4 != NULL, + "connection-verify-ip4", "failed to verify %s: missing %s setting", + TEST_WIRELESS_FILE, + NM_SETTING_IP4_CONFIG_SETTING_NAME); + + /* Method */ + tmp = nm_setting_ip4_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); + + g_object_unref (connection); +} + +static void +test_write_wireless_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingWireless *s_wireless; + NMSettingIP4Config *s_ip4; + NMSettingIP6Config *s_ip6; + char *uuid; + GByteArray *bssid; + unsigned char tmpbssid[] = { 0xaa, 0xb9, 0xa1, 0x74, 0x55, 0x44 }; + GByteArray *ssid; + unsigned char tmpssid[] = { 0x31, 0x33, 0x33, 0x37 }; + gboolean success; + NMConnection *reread; + char *testfile = NULL; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + guint64 timestamp = 0x12344433L; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "Work Wireless", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRELESS_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* Wireless setting */ + + s_wireless = NM_SETTING_WIRELESS (nm_setting_wireless_new ()); + ASSERT (s_wireless != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_WIRELESS_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_wireless)); + + bssid = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (bssid, &tmpbssid[0], sizeof (tmpbssid)); + + ssid = g_byte_array_sized_new (sizeof (tmpssid)); + g_byte_array_append (ssid, &tmpssid[0], sizeof (tmpssid)); + + g_object_set (s_wireless, + NM_SETTING_WIRELESS_BSSID, bssid, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRED_MTU, 1000, + NULL); + + g_byte_array_free (bssid, TRUE); + g_byte_array_free (ssid, TRUE); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-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_AUTO, + NULL); + + /* IP6 setting */ + + s_ip6 = NM_SETTING_IP6_CONFIG (nm_setting_ip6_config_new ()); + ASSERT (s_ip6 != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_IP6_CONFIG_SETTING_NAME); + 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); + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + +#define TEST_BT_DUN_FILE TEST_KEYFILES_DIR"/ATT_Data_Connect_BT" + +static void +test_read_bt_dun_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingBluetooth *s_bluetooth; + NMSettingSerial *s_serial; + NMSettingPPP *s_ppp; + NMSettingGsm *s_gsm; + GError *error = NULL; + const GByteArray *array; + char expected_bdaddr[ETH_ALEN] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; + const char *tmp; + const char *expected_id = "AT&T Data Connect BT"; + const char *expected_uuid = "089130ab-ce28-46e4-ad77-d44869b03d19"; + const char *expected_apn = "ISP.CINGULAR"; + const char *expected_username = "ISP@CINGULARGPRS.COM"; + const char *expected_password = "CINGULAR1"; + + connection = connection_from_file (TEST_BT_DUN_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_BT_DUN_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_BT_DUN_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_BT_DUN_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + /* UUID */ + tmp = nm_setting_connection_get_uuid (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + ASSERT (strcmp (tmp, expected_uuid) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_WIRELESS_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_UUID); + + /* ===== BLUETOOTH SETTING ===== */ + + s_bluetooth = NM_SETTING_BLUETOOTH (nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH)); + ASSERT (s_bluetooth != NULL, + "connection-verify-bt", "failed to verify %s: missing %s setting", + TEST_WIRELESS_FILE, + NM_SETTING_WIRED_SETTING_NAME); + + /* BDADDR */ + array = nm_setting_bluetooth_get_bdaddr (s_bluetooth); + ASSERT (array != NULL, + "connection-verify-bt", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR); + ASSERT (array->len == ETH_ALEN, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value length", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR); + ASSERT (memcmp (array->data, &expected_bdaddr[0], sizeof (expected_bdaddr)) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_BDADDR); + + /* Type */ + tmp = nm_setting_bluetooth_get_connection_type (s_bluetooth); + ASSERT (tmp != NULL, + "connection-verify-bt", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_TYPE); + ASSERT (strcmp (tmp, NM_SETTING_BLUETOOTH_TYPE_DUN) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_BLUETOOTH_TYPE); + + /* ===== GSM SETTING ===== */ + + s_gsm = NM_SETTING_GSM (nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM)); + ASSERT (s_gsm != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s setting", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME); + + /* APN */ + tmp = nm_setting_gsm_get_apn (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_APN); + ASSERT (strcmp (tmp, expected_apn) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_APN); + + /* Username */ + tmp = nm_setting_gsm_get_username (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_USERNAME); + ASSERT (strcmp (tmp, expected_username) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_USERNAME); + + /* Password */ + tmp = nm_setting_gsm_get_password (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD); + ASSERT (strcmp (tmp, expected_password) == 0, + "connection-verify-bt", "failed to verify %s: unexpected %s / %s key value", + TEST_BT_DUN_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD); + + /* ===== SERIAL SETTING ===== */ + + s_serial = NM_SETTING_SERIAL (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)); + ASSERT (s_serial != NULL, + "connection-verify-serial", "failed to verify %s: missing %s setting", + TEST_BT_DUN_FILE, + NM_SETTING_SERIAL_SETTING_NAME); + + /* ===== PPP SETTING ===== */ + + s_ppp = NM_SETTING_PPP (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)); + ASSERT (s_ppp != NULL, + "connection-verify-ppp", "failed to verify %s: missing %s setting", + TEST_BT_DUN_FILE, + NM_SETTING_PPP_SETTING_NAME); + + g_object_unref (connection); +} + +static void +test_write_bt_dun_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingBluetooth *s_bt; + NMSettingIP4Config *s_ip4; + NMSettingGsm *s_gsm; + char *uuid; + GByteArray *bdaddr; + unsigned char tmpbdaddr[] = { 0xaa, 0xb9, 0xa1, 0x74, 0x55, 0x44 }; + gboolean success; + NMConnection *reread; + char *testfile = NULL; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + guint64 timestamp = 0x12344433L; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "T-Mobile Funkadelic", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_BLUETOOTH_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* Bluetooth setting */ + + s_bt = NM_SETTING_BLUETOOTH (nm_setting_bluetooth_new ()); + ASSERT (s_bt != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_BLUETOOTH_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_bt)); + + bdaddr = g_byte_array_sized_new (ETH_ALEN); + g_byte_array_append (bdaddr, &tmpbdaddr[0], sizeof (tmpbdaddr)); + + g_object_set (s_bt, + NM_SETTING_BLUETOOTH_BDADDR, bdaddr, + NM_SETTING_BLUETOOTH_TYPE, NM_SETTING_BLUETOOTH_TYPE_DUN, + NULL); + + g_byte_array_free (bdaddr, TRUE); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-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_AUTO, + NULL); + + /* GSM setting */ + s_gsm = NM_SETTING_GSM (nm_setting_gsm_new ()); + ASSERT (s_gsm != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_GSM_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_gsm)); + + g_object_set (s_gsm, + NM_SETTING_GSM_APN, "internet2.voicestream.com", + NM_SETTING_GSM_USERNAME, "george.clinton", + NM_SETTING_GSM_PASSWORD, "parliament", + NM_SETTING_GSM_NUMBER, "*99#", + NULL); + + /* Serial setting */ + nm_connection_add_setting (connection, nm_setting_serial_new ()); + + /* PPP setting */ + nm_connection_add_setting (connection, nm_setting_ppp_new ()); + + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + +#define TEST_GSM_FILE TEST_KEYFILES_DIR"/ATT_Data_Connect_Plain" + +static void +test_read_gsm_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingSerial *s_serial; + NMSettingPPP *s_ppp; + NMSettingGsm *s_gsm; + NMSetting *s_bluetooth; + GError *error = NULL; + const char *tmp; + const char *expected_id = "AT&T Data Connect"; + const char *expected_apn = "ISP.CINGULAR"; + const char *expected_username = "ISP@CINGULARGPRS.COM"; + const char *expected_password = "CINGULAR1"; + const char *expected_network_id = "24005"; + const char *expected_pin = "2345"; + + connection = connection_from_file (TEST_GSM_FILE); + ASSERT (connection != NULL, + "connection-read", "failed to read %s", TEST_GSM_FILE); + + ASSERT (nm_connection_verify (connection, &error), + "connection-verify", "failed to verify %s: %s", TEST_GSM_FILE, error->message); + + /* ===== CONNECTION SETTING ===== */ + + s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)); + ASSERT (s_con != NULL, + "connection-verify-connection", "failed to verify %s: missing %s setting", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME); + + /* ID */ + tmp = nm_setting_connection_get_id (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, expected_id) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + + tmp = nm_setting_connection_get_connection_type (s_con); + ASSERT (tmp != NULL, + "connection-verify-connection", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_ID); + ASSERT (strcmp (tmp, NM_SETTING_GSM_SETTING_NAME) == 0, + "connection-verify-connection", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_CONNECTION_SETTING_NAME, + NM_SETTING_CONNECTION_TYPE); + + /* ===== BLUETOOTH SETTING ===== */ + + /* Plain GSM, so no BT setting expected */ + s_bluetooth = nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); + ASSERT (s_bluetooth == NULL, + "connection-verify-bt", "unexpected %s setting", + TEST_GSM_FILE, + NM_SETTING_BLUETOOTH_SETTING_NAME); + + /* ===== GSM SETTING ===== */ + + s_gsm = NM_SETTING_GSM (nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM)); + ASSERT (s_gsm != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s setting", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME); + + /* APN */ + tmp = nm_setting_gsm_get_apn (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_APN); + ASSERT (strcmp (tmp, expected_apn) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_APN); + + /* Username */ + tmp = nm_setting_gsm_get_username (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_USERNAME); + ASSERT (strcmp (tmp, expected_username) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_USERNAME); + + /* Password */ + tmp = nm_setting_gsm_get_password (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD); + ASSERT (strcmp (tmp, expected_password) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD); + + /* Network ID */ + tmp = nm_setting_gsm_get_network_id (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_NETWORK_ID); + ASSERT (strcmp (tmp, expected_network_id) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_NETWORK_ID); + + /* PIN */ + tmp = nm_setting_gsm_get_pin (s_gsm); + ASSERT (tmp != NULL, + "connection-verify-gsm", "failed to verify %s: missing %s / %s key", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PIN); + ASSERT (strcmp (tmp, expected_pin) == 0, + "connection-verify-gsm", "failed to verify %s: unexpected %s / %s key value", + TEST_GSM_FILE, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PIN); + + /* ===== SERIAL SETTING ===== */ + + s_serial = NM_SETTING_SERIAL (nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL)); + ASSERT (s_serial != NULL, + "connection-verify-serial", "failed to verify %s: missing %s setting", + TEST_GSM_FILE, + NM_SETTING_SERIAL_SETTING_NAME); + + /* ===== PPP SETTING ===== */ + + s_ppp = NM_SETTING_PPP (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP)); + ASSERT (s_ppp != NULL, + "connection-verify-ppp", "failed to verify %s: missing %s setting", + TEST_GSM_FILE, + NM_SETTING_PPP_SETTING_NAME); + + g_object_unref (connection); +} + +static void +test_write_gsm_connection (void) +{ + NMConnection *connection; + NMSettingConnection *s_con; + NMSettingIP4Config *s_ip4; + NMSettingGsm *s_gsm; + char *uuid; + gboolean success; + NMConnection *reread; + char *testfile = NULL; + GError *error = NULL; + pid_t owner_grp; + uid_t owner_uid; + guint64 timestamp = 0x12344433L; + + connection = nm_connection_new (); + ASSERT (connection != NULL, + "connection-write", "failed to allocate new connection"); + + /* Connection setting */ + + s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); + ASSERT (s_con != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_CONNECTION_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "T-Mobile Funkadelic 2", + NM_SETTING_CONNECTION_UUID, uuid, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NM_SETTING_CONNECTION_TYPE, NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_CONNECTION_TIMESTAMP, timestamp, + NULL); + g_free (uuid); + + /* IP4 setting */ + + s_ip4 = NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); + ASSERT (s_ip4 != NULL, + "connection-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_AUTO, + NULL); + + /* GSM setting */ + s_gsm = NM_SETTING_GSM (nm_setting_gsm_new ()); + ASSERT (s_gsm != NULL, + "connection-write", "failed to allocate new %s setting", + NM_SETTING_GSM_SETTING_NAME); + nm_connection_add_setting (connection, NM_SETTING (s_gsm)); + + g_object_set (s_gsm, + NM_SETTING_GSM_APN, "internet2.voicestream.com", + NM_SETTING_GSM_USERNAME, "george.clinton.again", + NM_SETTING_GSM_PASSWORD, "parliament2", + NM_SETTING_GSM_NUMBER, "*99#", + NM_SETTING_GSM_PIN, "123456", + NM_SETTING_GSM_NETWORK_ID, "254098", + NM_SETTING_GSM_HOME_ONLY, TRUE, + NM_SETTING_GSM_NETWORK_TYPE, NM_SETTING_GSM_NETWORK_TYPE_PREFER_UMTS_HSPA, + NULL); + + /* Serial setting */ + nm_connection_add_setting (connection, nm_setting_serial_new ()); + + /* PPP setting */ + nm_connection_add_setting (connection, nm_setting_ppp_new ()); + + + /* Write out the connection */ + owner_uid = geteuid (); + owner_grp = getegid (); + success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + ASSERT (success == TRUE, + "connection-write", "failed to allocate write keyfile: %s", + error ? error->message : "(none)"); + + ASSERT (testfile != NULL, + "connection-write", "didn't get keyfile name back after writing connection"); + + /* Read the connection back in and compare it to the one we just wrote out */ + reread = connection_from_file (testfile); + ASSERT (reread != NULL, "connection-write", "failed to re-read test connection"); + + ASSERT (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT) == TRUE, + "connection-write", "written and re-read connection weren't the same"); + + g_clear_error (&error); + unlink (testfile); + g_free (testfile); + + g_object_unref (reread); + g_object_unref (connection); +} + +int main (int argc, char **argv) +{ + GError *error = NULL; + DBusGConnection *bus; + char *base; + + g_type_init (); + bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); + + if (!nm_utils_init (&error)) + FAIL ("nm-utils-init", "failed to initialize libnm-util: %s", error->message); + + /* The tests */ + test_read_valid_wired_connection (); + test_write_wired_connection (); + + test_read_ip6_wired_connection (); + test_write_ip6_wired_connection (); + + test_read_wired_mac_case (); + + test_read_valid_wireless_connection (); + test_write_wireless_connection (); + + test_read_bt_dun_connection (); + test_write_bt_dun_connection (); + + test_read_gsm_connection (); + test_write_gsm_connection (); + + base = g_path_get_basename (argv[0]); + fprintf (stdout, "%s: SUCCESS\n", base); + g_free (base); + dbus_g_connection_unref (bus); + return 0; +} + diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 00000000..8e235e43 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,39 @@ +INCLUDES = -I${top_srcdir} \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib \ + -I${top_srcdir}/include + +AM_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DBINDIR=\"$(bindir)\" \ + -DNM_RUN_DIR=\"$(rundir)\" \ + -DDATADIR=\"$(datadir)\" + +bin_PROGRAMS = nm-tool + +noinst_PROGRAMS = nm-online libnm-glib-test + +nm_tool_SOURCES = nm-tool.c +nm_tool_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +nm_online_SOURCES = nm-online.c +nm_online_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +libnm_glib_test_SOURCES = libnm-glib-test.c +libnm_glib_test_CFLAGS = \ + -Wno-deprecated-declarations \ + -Wno-deprecated +libnm_glib_test_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + diff --git a/test/Makefile.in b/test/Makefile.in new file mode 100644 index 00000000..7164f4d2 --- /dev/null +++ b/test/Makefile.in @@ -0,0 +1,662 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = nm-tool$(EXEEXT) +noinst_PROGRAMS = nm-online$(EXEEXT) libnm-glib-test$(EXEEXT) +subdir = test +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am_libnm_glib_test_OBJECTS = \ + libnm_glib_test-libnm-glib-test.$(OBJEXT) +libnm_glib_test_OBJECTS = $(am_libnm_glib_test_OBJECTS) +am__DEPENDENCIES_1 = +libnm_glib_test_DEPENDENCIES = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +libnm_glib_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libnm_glib_test_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_nm_online_OBJECTS = nm-online.$(OBJEXT) +nm_online_OBJECTS = $(am_nm_online_OBJECTS) +nm_online_DEPENDENCIES = $(top_builddir)/libnm-util/libnm-util.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_nm_tool_OBJECTS = nm-tool.$(OBJEXT) +nm_tool_OBJECTS = $(am_nm_tool_OBJECTS) +nm_tool_DEPENDENCIES = $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnm_glib_test_SOURCES) $(nm_online_SOURCES) \ + $(nm_tool_SOURCES) +DIST_SOURCES = $(libnm_glib_test_SOURCES) $(nm_online_SOURCES) \ + $(nm_tool_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I${top_srcdir} \ + -I${top_srcdir}/libnm-util \ + -I${top_srcdir}/libnm-glib \ + -I${top_srcdir}/include + +AM_CPPFLAGS = \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + -DBINDIR=\"$(bindir)\" \ + -DNM_RUN_DIR=\"$(rundir)\" \ + -DDATADIR=\"$(datadir)\" + +nm_tool_SOURCES = nm-tool.c +nm_tool_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +nm_online_SOURCES = nm-online.c +nm_online_LDADD = \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +libnm_glib_test_SOURCES = libnm-glib-test.c +libnm_glib_test_CFLAGS = \ + -Wno-deprecated-declarations \ + -Wno-deprecated + +libnm_glib_test_LDADD = \ + $(top_builddir)/libnm-glib/libnm-glib.la \ + $(top_builddir)/libnm-util/libnm-util.la \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu test/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +libnm-glib-test$(EXEEXT): $(libnm_glib_test_OBJECTS) $(libnm_glib_test_DEPENDENCIES) + @rm -f libnm-glib-test$(EXEEXT) + $(libnm_glib_test_LINK) $(libnm_glib_test_OBJECTS) $(libnm_glib_test_LDADD) $(LIBS) +nm-online$(EXEEXT): $(nm_online_OBJECTS) $(nm_online_DEPENDENCIES) + @rm -f nm-online$(EXEEXT) + $(LINK) $(nm_online_OBJECTS) $(nm_online_LDADD) $(LIBS) +nm-tool$(EXEEXT): $(nm_tool_OBJECTS) $(nm_tool_DEPENDENCIES) + @rm -f nm-tool$(EXEEXT) + $(LINK) $(nm_tool_OBJECTS) $(nm_tool_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnm_glib_test-libnm-glib-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-online.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-tool.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnm_glib_test-libnm-glib-test.o: libnm-glib-test.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_CFLAGS) $(CFLAGS) -MT libnm_glib_test-libnm-glib-test.o -MD -MP -MF $(DEPDIR)/libnm_glib_test-libnm-glib-test.Tpo -c -o libnm_glib_test-libnm-glib-test.o `test -f 'libnm-glib-test.c' || echo '$(srcdir)/'`libnm-glib-test.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_test-libnm-glib-test.Tpo $(DEPDIR)/libnm_glib_test-libnm-glib-test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libnm-glib-test.c' object='libnm_glib_test-libnm-glib-test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_CFLAGS) $(CFLAGS) -c -o libnm_glib_test-libnm-glib-test.o `test -f 'libnm-glib-test.c' || echo '$(srcdir)/'`libnm-glib-test.c + +libnm_glib_test-libnm-glib-test.obj: libnm-glib-test.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_CFLAGS) $(CFLAGS) -MT libnm_glib_test-libnm-glib-test.obj -MD -MP -MF $(DEPDIR)/libnm_glib_test-libnm-glib-test.Tpo -c -o libnm_glib_test-libnm-glib-test.obj `if test -f 'libnm-glib-test.c'; then $(CYGPATH_W) 'libnm-glib-test.c'; else $(CYGPATH_W) '$(srcdir)/libnm-glib-test.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libnm_glib_test-libnm-glib-test.Tpo $(DEPDIR)/libnm_glib_test-libnm-glib-test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libnm-glib-test.c' object='libnm_glib_test-libnm-glib-test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnm_glib_test_CFLAGS) $(CFLAGS) -c -o libnm_glib_test-libnm-glib-test.obj `if test -f 'libnm-glib-test.c'; then $(CYGPATH_W) 'libnm-glib-test.c'; else $(CYGPATH_W) '$(srcdir)/libnm-glib-test.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool clean-noinstPROGRAMS ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/test/libnm-glib-test.c b/test/libnm-glib-test.c new file mode 100644 index 00000000..9ad1dc0a --- /dev/null +++ b/test/libnm-glib-test.c @@ -0,0 +1,113 @@ +/* libnm_glib_test - test app for libnm_glib + * + * Dan Williams + * + * 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 2005 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include + +#include "libnm_glib.h" + + +static void status_printer (libnm_glib_ctx *ctx, gpointer user_data) +{ + libnm_glib_state state; + + g_return_if_fail (ctx != NULL); + + state = libnm_glib_get_network_state (ctx); + switch (state) + { + case LIBNM_NO_DBUS: + fprintf (stderr, "Status: No DBUS\n"); + break; + case LIBNM_NO_NETWORKMANAGER: + fprintf (stderr, "Status: No NetworkManager\n"); + break; + case LIBNM_NO_NETWORK_CONNECTION: + fprintf (stderr, "Status: No Connection\n"); + break; + case LIBNM_ACTIVE_NETWORK_CONNECTION: + fprintf (stderr, "Status: Active Connection\n"); + break; + case LIBNM_INVALID_CONTEXT: + fprintf (stderr, "Status: Error\n"); + break; + default: + fprintf (stderr, "Status: unknown\n"); + break; + } +} + +static GMainLoop *loop = NULL; + +static void +signal_handler (int signo) +{ + if (signo == SIGINT || signo == SIGTERM) { + g_message ("Caught signal %d, shutting down...", signo); + g_main_loop_quit (loop); + } +} + +static void +setup_signals (void) +{ + struct sigaction action; + sigset_t mask; + + sigemptyset (&mask); + action.sa_handler = signal_handler; + action.sa_mask = mask; + action.sa_flags = 0; + sigaction (SIGTERM, &action, NULL); + sigaction (SIGINT, &action, NULL); +} + +int main( int argc, char *argv[] ) +{ + libnm_glib_ctx *ctx; + guint id; + + ctx = libnm_glib_init (); + if (!ctx) + { + fprintf (stderr, "Could not initialize libnm.\n"); + exit (1); + } + + id = libnm_glib_register_callback (ctx, status_printer, ctx, NULL); + fprintf (stderr, "Registered Callback with ID %d\n", id); + libnm_glib_unregister_callback (ctx, id); + fprintf (stderr, "Unregistered Callback with ID %d\n", id); + + id = libnm_glib_register_callback (ctx, status_printer, ctx, NULL); + fprintf (stderr, "Registered Callback with ID %d\n", id); + + loop = g_main_loop_new (NULL, FALSE); + setup_signals (); + g_main_loop_run (loop); + + libnm_glib_shutdown (ctx); + + exit (0); +} diff --git a/test/nm-online.c b/test/nm-online.c new file mode 100644 index 00000000..27bf1789 --- /dev/null +++ b/test/nm-online.c @@ -0,0 +1,210 @@ +/* -*- 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) 2006 - 2008 Novell, Inc. + * + */ + +/* + * nm-online.c - Are we online? + * + * Return values: + * + * 0 : already online or connection established within given timeout + * 1 : offline or not online within given timeout + * 2 : unspecified error + * + * Robert Love + */ + +#define PROGRESS_STEPS 15 + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "NetworkManager.h" +#include "nm-glib-compat.h" + +typedef struct +{ + int value; + double norm; + gboolean quiet; +} Timeout; + +static GMainLoop *loop; + +static DBusHandlerResult dbus_filter (DBusConnection *connection G_GNUC_UNUSED, + DBusMessage *message, + void *user_data G_GNUC_UNUSED) +{ + NMState state; + + if (!dbus_message_is_signal (message, NM_DBUS_INTERFACE, "StateChanged")) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + + if (!dbus_message_get_args (message, NULL, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID)) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + + if (state == NM_STATE_CONNECTED) + g_main_loop_quit (loop); + + return DBUS_HANDLER_RESULT_HANDLED; +} + +static NMState check_online (DBusConnection *connection) +{ + DBusMessage *message, *reply; + DBusError error; + dbus_uint32_t state; + + message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH, + NM_DBUS_INTERFACE, "state"); + if (!message) + exit (2); + + dbus_error_init (&error); + reply = dbus_connection_send_with_reply_and_block (connection, message, + -1, &error); + dbus_message_unref (message); + if (!reply) + return NM_STATE_UNKNOWN; + + if (!dbus_message_get_args (reply, NULL, DBUS_TYPE_UINT32, &state, + DBUS_TYPE_INVALID)) + exit (2); + + return state; +} + +static gboolean handle_timeout (gpointer data) +{ + int i = PROGRESS_STEPS; + Timeout *timeout = (Timeout *) data; + + if (!timeout->quiet) { + g_print ("\rConnecting"); + for (; i > 0; i--) + putchar ((timeout->value >= (i * timeout->norm)) ? ' ' : '.'); + if (timeout->value) + g_print (" %4is", timeout->value); + fflush (stdout); + } + + timeout->value--; + if (timeout->value < 0) { + if (!timeout->quiet) + g_print ("\n"); + exit (1); + } + + return TRUE; +} + +int main (int argc, char *argv[]) +{ + DBusConnection *connection; + DBusError error; + NMState state; + gint t_secs = -1; + gboolean exit_no_nm = FALSE; + gboolean quiet = FALSE; + Timeout timeout; + GOptionContext *opt_ctx = NULL; + gboolean success; + + GOptionEntry options[] = { + {"timeout", 't', 0, G_OPTION_ARG_INT, &t_secs, "Time to wait for a connection, in seconds (default is 30)", NULL}, + {"exit", 'x', 0, G_OPTION_ARG_NONE, &exit_no_nm, "Exit immediately if NetworkManager is not running or connecting", NULL}, + {"quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet, "Don't print anything", NULL}, + {NULL} + }; + + opt_ctx = g_option_context_new (""); + g_option_context_set_translation_domain (opt_ctx, "UTF-8"); + 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, + "Waits for a successful connection in NetworkManager."); + + success = g_option_context_parse (opt_ctx, &argc, &argv, NULL); + g_option_context_free (opt_ctx); + + if (!success) { + g_warning ("Invalid option. Please use --help to see a list of valid options."); + return 2; + } + + if (t_secs > -1) + timeout.value = t_secs; + else + timeout.value = 30; + if (timeout.value < 0 || timeout.value > 3600) { + g_warning ("Invalid option. Please use --help to see a list of valid options."); + return 2; + } + + g_type_init (); + loop = g_main_loop_new (NULL, FALSE); + + dbus_error_init (&error); + connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error); + if (connection == NULL) { + dbus_error_free (&error); + return 2; + } + + dbus_connection_setup_with_g_main (connection, NULL); + + if (!dbus_connection_add_filter (connection, dbus_filter, NULL, NULL)) + return 2; + + dbus_bus_add_match (connection, + "type='signal'," + "interface='" NM_DBUS_INTERFACE "'," + "sender='" NM_DBUS_SERVICE "'," + "path='" NM_DBUS_PATH "'", &error); + if (dbus_error_is_set (&error)) { + dbus_error_free (&error); + return 2; + } + + /* Check after we setup the filter to ensure that we cannot race. */ + state = check_online (connection); + if (state == NM_STATE_CONNECTED) + return 0; + if (exit_no_nm && (state != NM_STATE_CONNECTING)) + return 1; + + if (timeout.value) { + timeout.norm = (double) timeout.value / (double) PROGRESS_STEPS; + g_timeout_add_seconds (1, handle_timeout, &timeout); + } + timeout.quiet = quiet; + + g_main_loop_run (loop); + + return 0; +} diff --git a/test/nm-tool.c b/test/nm-tool.c new file mode 100644 index 00000000..df0c15ed --- /dev/null +++ b/test/nm-tool.c @@ -0,0 +1,721 @@ +/* nm-tool - information tool for NetworkManager + * + * Dan Williams + * + * 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 2005 - 2009 Red Hat, Inc. + * (C) Copyright 2007 Novell, Inc. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Don't use nm-dbus-glib-types.h so that we can keep nm-tool + * building standalone outside of the NM tree. + */ +#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) +#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT)) +#define DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)) + +static GHashTable *user_connections = NULL; +static GHashTable *system_connections = NULL; + +static gboolean +get_nm_state (NMClient *client) +{ + NMState state; + char *state_string; + gboolean success = TRUE; + + state = nm_client_get_state (client); + + switch (state) { + case NM_STATE_ASLEEP: + state_string = "asleep"; + break; + + case NM_STATE_CONNECTING: + state_string = "connecting"; + break; + + case NM_STATE_CONNECTED: + state_string = "connected"; + break; + + case NM_STATE_DISCONNECTED: + state_string = "disconnected"; + break; + + case NM_STATE_UNKNOWN: + default: + state_string = "unknown"; + success = FALSE; + break; + } + + printf ("State: %s\n\n", state_string); + + return success; +} + +static void +print_header (const char *label, const char *iface, const char *connection) +{ + GString *string; + + string = g_string_sized_new (79); + g_string_append_printf (string, "- %s: ", label); + if (iface) + g_string_append_printf (string, "%s ", iface); + if (connection) + g_string_append_printf (string, " [%s] ", connection); + + while (string->len < 80) + g_string_append_c (string, '-'); + + printf ("%s\n", string->str); + + g_string_free (string, TRUE); +} + +static void +print_string (const char *label, const char *data) +{ +#define SPACING 18 + int label_len = 0; + char spaces[50]; + int i; + + g_return_if_fail (label != NULL); + g_return_if_fail (data != NULL); + + label_len = strlen (label); + if (label_len > SPACING) + label_len = SPACING - 1; + for (i = 0; i < (SPACING - label_len); i++) + spaces[i] = 0x20; + spaces[i] = 0x00; + + printf (" %s:%s%s\n", label, &spaces[0], data); +} + + +static void +detail_access_point (gpointer data, gpointer user_data) +{ + NMAccessPoint *ap = NM_ACCESS_POINT (data); + const char *active_bssid = (const char *) user_data; + GString *str; + gboolean active = FALSE; + guint32 flags, wpa_flags, rsn_flags; + const GByteArray * ssid; + char *tmp; + + flags = nm_access_point_get_flags (ap); + wpa_flags = nm_access_point_get_wpa_flags (ap); + rsn_flags = nm_access_point_get_rsn_flags (ap); + + if (active_bssid) { + const char *current_bssid = nm_access_point_get_hw_address (ap); + if (current_bssid && !strcmp (current_bssid, active_bssid)) + active = TRUE; + } + + str = g_string_new (NULL); + g_string_append_printf (str, + "%s, %s, Freq %d MHz, Rate %d Mb/s, Strength %d", + (nm_access_point_get_mode (ap) == NM_802_11_MODE_INFRA) ? "Infra" : "Ad-Hoc", + nm_access_point_get_hw_address (ap), + nm_access_point_get_frequency (ap), + nm_access_point_get_max_bitrate (ap) / 1000, + nm_access_point_get_strength (ap)); + + if ( !(flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags != NM_802_11_AP_SEC_NONE) + && (rsn_flags != NM_802_11_AP_SEC_NONE)) + g_string_append (str, ", Encrypted: "); + + if ( (flags & NM_802_11_AP_FLAGS_PRIVACY) + && (wpa_flags == NM_802_11_AP_SEC_NONE) + && (rsn_flags == NM_802_11_AP_SEC_NONE)) + g_string_append (str, " WEP"); + if (wpa_flags != NM_802_11_AP_SEC_NONE) + g_string_append (str, " WPA"); + if (rsn_flags != NM_802_11_AP_SEC_NONE) + g_string_append (str, " WPA2"); + if ( (wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) + || (rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) + g_string_append (str, " Enterprise"); + + /* FIXME: broadcast/hidden */ + + ssid = nm_access_point_get_ssid (ap); + tmp = g_strdup_printf (" %s%s", active ? "*" : "", + ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)"); + + print_string (tmp, str->str); + + g_string_free (str, TRUE); + g_free (tmp); +} + +static gchar * +ip4_address_as_string (guint32 ip) +{ + struct in_addr tmp_addr; + char buf[INET_ADDRSTRLEN+1]; + + memset (&buf, '\0', sizeof (buf)); + tmp_addr.s_addr = ip; + + if (inet_ntop (AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN)) { + return g_strdup (buf); + } else { + nm_warning ("%s: error converting IP4 address 0x%X", + __func__, ntohl (tmp_addr.s_addr)); + return NULL; + } +} + +static gchar * +ip6_address_as_string (const struct in6_addr *ip) +{ + char buf[INET6_ADDRSTRLEN]; + + memset (&buf, '\0', sizeof (buf)); + + if (inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)) { + return g_strdup (buf); + } else { + int j; + GString *ip6_str = g_string_new (NULL); + g_string_append_printf (ip6_str, "%02X", ip->s6_addr[0]); + for (j = 1; j < 16; j++) + g_string_append_printf (ip6_str, " %02X", ip->s6_addr[j]); + nm_warning ("%s: error converting IP6 address %s", + __func__, ip6_str->str); + g_string_free (ip6_str, TRUE); + return NULL; + } +} + +static const char * +get_dev_state_string (NMDeviceState state) +{ + if (state == NM_DEVICE_STATE_UNMANAGED) + return "unmanaged"; + else if (state == NM_DEVICE_STATE_UNAVAILABLE) + return "unavailable"; + else if (state == NM_DEVICE_STATE_DISCONNECTED) + return "disconnected"; + else if (state == NM_DEVICE_STATE_PREPARE) + return "connecting (prepare)"; + else if (state == NM_DEVICE_STATE_CONFIG) + return "connecting (configuring)"; + else if (state == NM_DEVICE_STATE_NEED_AUTH) + return "connecting (need authentication)"; + else if (state == NM_DEVICE_STATE_IP_CONFIG) + return "connecting (getting IP configuration)"; + else if (state == NM_DEVICE_STATE_ACTIVATED) + return "connected"; + else if (state == NM_DEVICE_STATE_FAILED) + return "connection failed"; + return "unknown"; +} + +static NMConnection * +get_connection_for_active (NMActiveConnection *active) +{ + NMConnectionScope scope; + const char *path; + + g_return_val_if_fail (active != NULL, NULL); + + path = nm_active_connection_get_connection (active); + g_return_val_if_fail (path != NULL, NULL); + + scope = nm_active_connection_get_scope (active); + if (scope == NM_CONNECTION_SCOPE_USER) + return (NMConnection *) g_hash_table_lookup (user_connections, path); + else if (scope == NM_CONNECTION_SCOPE_SYSTEM) + return (NMConnection *) g_hash_table_lookup (system_connections, path); + + g_warning ("error: unknown connection scope"); + return NULL; +} + +struct cb_info { + NMClient *client; + const GPtrArray *active; +}; + +static void +detail_device (gpointer data, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (data); + struct cb_info *info = user_data; + char *tmp; + NMDeviceState state; + guint32 caps; + guint32 speed; + const GArray *array; + int j; + gboolean is_default = FALSE; + const char *id = NULL; + + state = nm_device_get_state (device); + + for (j = 0; info->active && (j < info->active->len); j++) { + NMActiveConnection *candidate = g_ptr_array_index (info->active, j); + const GPtrArray *devices = nm_active_connection_get_devices (candidate); + NMDevice *candidate_dev; + NMConnection *connection; + NMSettingConnection *s_con; + + if (!devices || !devices->len) + continue; + candidate_dev = g_ptr_array_index (devices, 0); + + if (candidate_dev == device) { + if (nm_active_connection_get_default (candidate)) + is_default = TRUE; + + connection = get_connection_for_active (candidate); + if (!connection) + break; + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + if (s_con) + id = nm_setting_connection_get_id (s_con); + break; + } + } + + print_header ("Device", nm_device_get_iface (device), id); + + /* General information */ + if (NM_IS_DEVICE_ETHERNET (device)) + print_string ("Type", "Wired"); + else if (NM_IS_DEVICE_WIFI (device)) + print_string ("Type", "802.11 WiFi"); + else if (NM_IS_GSM_DEVICE (device)) + print_string ("Type", "Mobile Broadband (GSM)"); + else if (NM_IS_CDMA_DEVICE (device)) + print_string ("Type", "Mobile Broadband (CDMA)"); + else if (NM_IS_DEVICE_BT (device)) + print_string ("Type", "Bluetooth"); + + print_string ("Driver", nm_device_get_driver (device) ? nm_device_get_driver (device) : "(unknown)"); + + print_string ("State", get_dev_state_string (state)); + + if (is_default) + print_string ("Default", "yes"); + else + print_string ("Default", "no"); + + tmp = NULL; + if (NM_IS_DEVICE_ETHERNET (device)) + tmp = g_strdup (nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device))); + else if (NM_IS_DEVICE_WIFI (device)) + tmp = g_strdup (nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device))); + + if (tmp) { + print_string ("HW Address", tmp); + g_free (tmp); + } + + /* Capabilities */ + caps = nm_device_get_capabilities (device); + printf ("\n Capabilities:\n"); + if (caps & NM_DEVICE_CAP_CARRIER_DETECT) + print_string (" Carrier Detect", "yes"); + + speed = 0; + if (NM_IS_DEVICE_ETHERNET (device)) { + /* Speed in Mb/s */ + speed = nm_device_ethernet_get_speed (NM_DEVICE_ETHERNET (device)); + } else if (NM_IS_DEVICE_WIFI (device)) { + /* Speed in b/s */ + speed = nm_device_wifi_get_bitrate (NM_DEVICE_WIFI (device)); + speed /= 1000; + } + + if (speed) { + char *speed_string; + + speed_string = g_strdup_printf ("%u Mb/s", speed); + print_string (" Speed", speed_string); + g_free (speed_string); + } + + /* Wireless specific information */ + if ((NM_IS_DEVICE_WIFI (device))) { + guint32 wcaps; + NMAccessPoint *active_ap = NULL; + const char *active_bssid = NULL; + const GPtrArray *aps; + + printf ("\n Wireless Properties\n"); + + wcaps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device)); + + if (wcaps & (NM_WIFI_DEVICE_CAP_CIPHER_WEP40 | NM_WIFI_DEVICE_CAP_CIPHER_WEP104)) + print_string (" WEP Encryption", "yes"); + if (wcaps & NM_WIFI_DEVICE_CAP_WPA) + print_string (" WPA Encryption", "yes"); + if (wcaps & NM_WIFI_DEVICE_CAP_RSN) + print_string (" WPA2 Encryption", "yes"); + + if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { + active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (device)); + active_bssid = active_ap ? nm_access_point_get_hw_address (active_ap) : NULL; + } + + printf ("\n Wireless Access Points %s\n", active_ap ? "(* = current AP)" : ""); + + aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + if (aps && aps->len) + g_ptr_array_foreach ((GPtrArray *) aps, detail_access_point, (gpointer) active_bssid); + } else if (NM_IS_DEVICE_ETHERNET (device)) { + printf ("\n Wired Properties\n"); + + if (nm_device_ethernet_get_carrier (NM_DEVICE_ETHERNET (device))) + print_string (" Carrier", "on"); + else + print_string (" Carrier", "off"); + } + + /* IP Setup info */ + if (state == NM_DEVICE_STATE_ACTIVATED) { + NMIP4Config *cfg4 = nm_device_get_ip4_config (device); + NMIP6Config *cfg6 = nm_device_get_ip6_config (device); + GSList *iter; + + if (cfg4) { + printf ("\n IPv4 Settings:\n"); + + for (iter = (GSList *) nm_ip4_config_get_addresses (cfg4); iter; iter = g_slist_next (iter)) { + NMIP4Address *addr = (NMIP4Address *) iter->data; + guint32 prefix = nm_ip4_address_get_prefix (addr); + char *tmp2; + + tmp = ip4_address_as_string (nm_ip4_address_get_address (addr)); + print_string (" Address", tmp); + g_free (tmp); + + tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix)); + tmp = g_strdup_printf ("%d (%s)", prefix, tmp2); + g_free (tmp2); + print_string (" Prefix", tmp); + g_free (tmp); + + tmp = ip4_address_as_string (nm_ip4_address_get_gateway (addr)); + print_string (" Gateway", tmp); + g_free (tmp); + printf ("\n"); + } + + array = nm_ip4_config_get_nameservers (cfg4); + if (array) { + int i; + + for (i = 0; i < array->len; i++) { + tmp = ip4_address_as_string (g_array_index (array, guint32, i)); + print_string (" DNS", tmp); + g_free (tmp); + } + } + } + + if (cfg6) { + printf ("\n IPv6 Settings:\n"); + + for (iter = (GSList *) nm_ip6_config_get_addresses (cfg6); iter; iter = g_slist_next (iter)) { + NMIP6Address *addr = (NMIP6Address *) iter->data; + guint32 prefix = nm_ip6_address_get_prefix (addr); + + tmp = ip6_address_as_string (nm_ip6_address_get_address (addr)); + print_string (" Address", tmp); + g_free (tmp); + + tmp = g_strdup_printf ("%d", prefix); + print_string (" Prefix", tmp); + g_free (tmp); + + tmp = ip6_address_as_string (nm_ip6_address_get_gateway (addr)); + print_string (" Gateway", tmp); + g_free (tmp); + printf ("\n"); + } + + for (iter = (GSList *) nm_ip6_config_get_nameservers (cfg6); iter; iter = g_slist_next (iter)) { + tmp = ip6_address_as_string (iter->data); + print_string (" DNS", tmp); + g_free (tmp); + } + } + } + + printf ("\n\n"); +} + +static const char * +get_vpn_state_string (NMVPNConnectionState state) +{ + switch (state) { + case NM_VPN_CONNECTION_STATE_PREPARE: + return "connecting (prepare)"; + case NM_VPN_CONNECTION_STATE_NEED_AUTH: + return "connecting (need authentication)"; + case NM_VPN_CONNECTION_STATE_CONNECT: + return "connecting"; + case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: + return "connecting (getting IP configuration)"; + case NM_VPN_CONNECTION_STATE_ACTIVATED: + return "connected"; + case NM_VPN_CONNECTION_STATE_FAILED: + return "connection failed"; + case NM_VPN_CONNECTION_STATE_DISCONNECTED: + return "disconnected"; + default: + break; + } + + return "unknown"; +} + +static void +detail_vpn (gpointer data, gpointer user_data) +{ + NMActiveConnection *active = NM_ACTIVE_CONNECTION (data); + NMConnection *connection; + NMSettingConnection *s_con; + NMVPNConnectionState state; + const char *banner; + + if (!NM_IS_VPN_CONNECTION (active)) + return; + + connection = get_connection_for_active (active); + g_return_if_fail (connection != NULL); + + s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); + g_return_if_fail (connection != NULL); + + print_header ("VPN", NULL, nm_setting_connection_get_id (s_con)); + + state = nm_vpn_connection_get_vpn_state (NM_VPN_CONNECTION (active)); + print_string ("State", get_vpn_state_string (state)); + + if (nm_active_connection_get_default (active)) + print_string ("Default", "yes"); + else + print_string ("Default", "no"); + + banner = nm_vpn_connection_get_banner (NM_VPN_CONNECTION (active)); + if (banner) { + char **lines, **iter; + + printf ("\n Message:\n"); + lines = g_strsplit_set (banner, "\n\r", -1); + for (iter = lines; *iter; iter++) { + if (*iter && strlen (*iter)) + printf (" %s\n", *iter); + } + g_strfreev (lines); + } + + printf ("\n\n"); +} + +static void +get_one_connection (DBusGConnection *bus, + const char *path, + NMConnectionScope scope, + GHashTable *table) +{ + DBusGProxy *proxy; + NMConnection *connection = NULL; + const char *service; + GError *error = NULL; + GHashTable *settings = NULL; + + g_return_if_fail (bus != NULL); + g_return_if_fail (path != NULL); + g_return_if_fail (table != NULL); + + service = (scope == NM_CONNECTION_SCOPE_SYSTEM) ? + NM_DBUS_SERVICE_SYSTEM_SETTINGS : NM_DBUS_SERVICE_USER_SETTINGS; + + proxy = dbus_g_proxy_new_for_name (bus, service, path, NM_DBUS_IFACE_SETTINGS_CONNECTION); + if (!proxy) + return; + + if (!dbus_g_proxy_call (proxy, "GetSettings", &error, + G_TYPE_INVALID, + DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &settings, + G_TYPE_INVALID)) { + nm_warning ("error: cannot retrieve connection: %s", error ? error->message : "(unknown)"); + goto out; + } + + connection = nm_connection_new_from_hash (settings, &error); + g_hash_table_destroy (settings); + + if (!connection) { + nm_warning ("error: invalid connection: '%s' / '%s' invalid: %d", + error ? g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)) : "(unknown)", + error ? error->message : "(unknown)", + error ? error->code : -1); + goto out; + } + + nm_connection_set_scope (connection, scope); + nm_connection_set_path (connection, path); + g_hash_table_insert (table, g_strdup (path), g_object_ref (connection)); + +out: + g_clear_error (&error); + if (connection) + g_object_unref (connection); + g_object_unref (proxy); +} + +static void +get_connections_for_service (DBusGConnection *bus, + NMConnectionScope scope, + GHashTable *table) +{ + GError *error = NULL; + DBusGProxy *proxy; + GPtrArray *paths = NULL; + int i; + const char *service; + + service = (scope == NM_CONNECTION_SCOPE_SYSTEM) ? + NM_DBUS_SERVICE_SYSTEM_SETTINGS : NM_DBUS_SERVICE_USER_SETTINGS; + + proxy = dbus_g_proxy_new_for_name (bus, + service, + NM_DBUS_PATH_SETTINGS, + NM_DBUS_IFACE_SETTINGS); + if (!proxy) { + g_warning ("error: failed to create DBus proxy for %s", service); + return; + } + + if (!dbus_g_proxy_call (proxy, "ListConnections", &error, + G_TYPE_INVALID, + DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, &paths, + G_TYPE_INVALID)) { + g_warning ("error: failed to read connections from %s:\n %s", + service, error ? error->message : "(unknown)"); + g_clear_error (&error); + goto out; + } + + for (i = 0; paths && (i < paths->len); i++) + get_one_connection (bus, g_ptr_array_index (paths, i), scope, table); + +out: + g_object_unref (proxy); +} + +static gboolean +get_all_connections (void) +{ + DBusGConnection *bus; + GError *error = NULL; + + bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); + if (error || !bus) { + g_warning ("error: could not connect to dbus"); + return FALSE; + } + + user_connections = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + get_connections_for_service (bus, NM_CONNECTION_SCOPE_USER, user_connections); + + system_connections = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + get_connections_for_service (bus, NM_CONNECTION_SCOPE_SYSTEM, system_connections); + + dbus_g_connection_unref (bus); + return TRUE; +} + +int +main (int argc, char *argv[]) +{ + NMClient *client; + const GPtrArray *devices; + struct cb_info info; + + g_type_init (); + + client = nm_client_new (); + if (!client) { + exit (1); + } + + printf ("\nNetworkManager Tool\n\n"); + + if (!get_nm_state (client)) { + g_warning ("error: could not connect to NetworkManager"); + exit (1); + } + + if (!get_all_connections ()) + exit (1); + + info.client = client; + info.active = nm_client_get_active_connections (client); + + + devices = nm_client_get_devices (client); + if (devices) + g_ptr_array_foreach ((GPtrArray *) devices, detail_device, &info); + + if (info.active) + g_ptr_array_foreach ((GPtrArray *) info.active, detail_vpn, &info); + + g_object_unref (client); + g_hash_table_unref (user_connections); + g_hash_table_unref (system_connections); + + return 0; +} diff --git a/tools/Makefile.am b/tools/Makefile.am new file mode 100644 index 00000000..17dc6146 --- /dev/null +++ b/tools/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = doc-generator.xsl diff --git a/tools/Makefile.in b/tools/Makefile.in new file mode 100644 index 00000000..307cf2c7 --- /dev/null +++ b/tools/Makefile.in @@ -0,0 +1,418 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tools +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libnl-check.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMODULE_CFLAGS = @GMODULE_CFLAGS@ +GMODULE_LIBS = @GMODULE_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +IPTABLES_PATH = @IPTABLES_PATH@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDL = @LIBDL@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBM = @LIBM@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +RANLIB = @RANLIB@ +RESOLVCONF_PATH = @RESOLVCONF_PATH@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_BASE_DIR = @UDEV_BASE_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = doc-generator.xsl +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tools/doc-generator.xsl b/tools/doc-generator.xsl new file mode 100644 index 00000000..bcc88e83 --- /dev/null +++ b/tools/doc-generator.xsl @@ -0,0 +1,691 @@ + + + + + + + + + + + + + + + + +

Errors:

+ +
+ + +

Generic types:

+ +
+ + + +

Simple types:

+ +
+ + +

Enumerated types:

+ +
+ + +

Sets of flags:

+ +
+ + +

Structure types:

+ +
+ + +

Mapping types:

+ +
+ + +

Types defined elsewhere:

+
+
+
+ + +

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

+ + +

+ This interface is + and is likely to cause havoc to your API/ABI if bindings are generated. + Don't include it in libraries that care about compatibility. +

+
+ + +

Implementations of this interface must also implement:

+
    + +
  • +
    +
+
+ + + + + +

Methods:

+ +
+ +

Interface has no methods.

+
+
+ + + +

Signals:

+ +
+ +

Interface has no signals.

+
+
+ + + +

Properties:

+
+ +
+
+ +

Interface has no properties.

+
+
+ + + +
+ + +

+ + + +

+ +
+ + + + + + + + + + + +
=
+ + +
+
+ +
(Undocumented)
+
+
+
+
+
+ + +

+ + + +

+ +
+ + + + + + + + + + + +
=
+ + +
+
+ +
(Undocumented)
+
+
+
+
+
+ + +
+ + - + + - + () + +
+
+ +
+
+ + +
+

+ + + - a{ + + + : + + + + } +

+
+ +
+
+

Members

+
+ +
+
+
+
+ + + + + - + + + +
+

+ + + - +

+
+ +
+
+
+ + +
+
+ + + - +
+
Defined by:
+
+
+ + + - ( + + , + ) + + + + - a{ + + + } + + + +
+

+ + + - ( + + + : + + , + + ) +

+
+ +
+ + +

In bindings that need a separate name, arrays of + should be called + .

+
+ +

Arrays of don't generally + make sense.

+
+
+
+

Members

+
+ +
+
+
+
+ + +
+

+ + + ( + + : + , + + ) → + + + + + , + + + nothing + +

+
+ +
+ + +
+

Parameters

+
+ +
+
+
+ + +
+

Returns

+
+ +
+
+
+ + +
+

Possible errors

+
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + ERR: Unable to find type ' + + ' + + + + () + + + + +
+ - + + +
+
+ + + + + + (undocumented) + + +
+
+ + +
+ - + + +
+
+ +
+
+ + +
+ + - + + + +
+
+ +
+
+ + +
+ +
+
+ + + + + + + (generic description) + + + (Undocumented.) + + +
+
+ + +
+

+ + + ( + + : + , + + )

+
+ +
+ + +
+

Parameters

+
+ +
+
+
+
+
+ + + + + + + + <xsl:value-of select="tp:title"/> + <xsl:if test="tp:version"> + <xsl:text> version </xsl:text> + <xsl:value-of select="tp:version"/> + </xsl:if> + + + + +

+ +

+ +

Version

+
+ + + + +

Interfaces

+
    + +
  • +
    +
+ + + + + +

Index

+

Index of interfaces

+
    + +
  • +
    +
+

Index of types

+
    + + +
  • + + + + + + +
  • +
    +
+ + +
+ +
+ + -- cgit 1.3.0-6-gf8a5